qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
377,691
<p>I have a button, I need to display a pop-up in javascript. So on its client click I call a javascript function which does that.</p> <p>if user clicks "yes", I need to do a post back and call buttons server side click event, here is what I am doing inside the javascript function</p> <pre><code>__doPostBack(deleteL...
[ { "answer_id": 377698, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>Yes.\nYou can use WSDualHttpBinding or NetTcpBinding.</p>\n" }, { "answer_id": 377943, "author": "ZombieSheep",...
2008/12/18
[ "https://Stackoverflow.com/questions/377691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38997/" ]
I have a button, I need to display a pop-up in javascript. So on its client click I call a javascript function which does that. if user clicks "yes", I need to do a post back and call buttons server side click event, here is what I am doing inside the javascript function ``` __doPostBack(deleteLinkButton, 'Click'); ...
You are looking for a technology called Comet. [Wikipedia entry](http://en.wikipedia.org/wiki/Comet_(programming)) If you Google "comet wcf" you'll find articles that should point you in the right direction.
377,695
<p>I am trying to get the size of an array populated by stdin:</p> <pre><code>char *myArray; cin &gt;&gt; myArray cout &lt;&lt; sizeof(myArray); </code></pre> <p>This returns 4 when I enter a string greater with a length greater than 4 e.g. "40905898"</p> <p>Where am i going wrong?</p>
[ { "answer_id": 377701, "author": "Leeor", "author_id": 46386, "author_profile": "https://Stackoverflow.com/users/46386", "pm_score": 2, "selected": false, "text": "<p>sizeof(pointer) will always return 4. You want to use strlen().</p>\n\n<p>Edit: IIRC, sizeof is evaluated at compile time...
2008/12/18
[ "https://Stackoverflow.com/questions/377695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am trying to get the size of an array populated by stdin: ``` char *myArray; cin >> myArray cout << sizeof(myArray); ``` This returns 4 when I enter a string greater with a length greater than 4 e.g. "40905898" Where am i going wrong?
`sizeof` operator statically evaluates to the size of the thing you are passing to it. A `char*` is a pointer which, depending on the machine architecture has a specific size (4 bytes on 32 bit systems and 8 bytes on 64 bit machines). To accomplish what you are trying to do, I suggest you use the `string` type which yo...
377,709
<p>I am considering adding validation on some insert and update statements for MS SQL Server 2005. I want to be able to check the values inserted before it is written into the table - in this particular case, it is an integer field where the data must conform to a rule. So a simple schema could be:</p> <pre><code>([id...
[ { "answer_id": 377720, "author": "Galwegian", "author_id": 3201, "author_profile": "https://Stackoverflow.com/users/3201", "pm_score": 1, "selected": false, "text": "<p>Use constraints for this</p>\n\n<p>e.g</p>\n\n<pre><code>CREATE TABLE [dbo].[SalesHistory](\n [SaleID] [int] NOT ...
2008/12/18
[ "https://Stackoverflow.com/questions/377709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20941/" ]
I am considering adding validation on some insert and update statements for MS SQL Server 2005. I want to be able to check the values inserted before it is written into the table - in this particular case, it is an integer field where the data must conform to a rule. So a simple schema could be: ``` ([id] [int] identi...
It depends on how complex the validation is. If you can do it in a constraint that is generally more efficient than a trigger. However, triigers can handle more complex validation which constraints cannot.
377,716
<p>I'm reading &quot;<a href="http://jspro.org/" rel="nofollow noreferrer">Pro JavaScript Techniques</a>&quot; by <a href="https://en.wikipedia.org/wiki/John_Resig" rel="nofollow noreferrer">John Resig</a>, and I'm confused with an example. This is the code:</p> <pre><code>// Create a new user object that accepts an ob...
[ { "answer_id": 377754, "author": "PEZ", "author_id": 44639, "author_profile": "https://Stackoverflow.com/users/44639", "pm_score": 2, "selected": false, "text": "<p>Adapting Jason's answer, it works:</p>\n<p>We need to make a closure for the values. Here's one way:</p>\n<pre><code>functi...
2008/12/18
[ "https://Stackoverflow.com/questions/377716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7595/" ]
I'm reading "[Pro JavaScript Techniques](http://jspro.org/)" by [John Resig](https://en.wikipedia.org/wiki/John_Resig), and I'm confused with an example. This is the code: ``` // Create a new user object that accepts an object of properties function User( properties ) { // Iterate through the properties of the objec...
I started this post with the sole purpose of learning why that things happened, and I finally did. So in case there's someone else interested in the "whys", here they are: **Why does 'this' changes inside the anonymous function?** A new function, even if it is an anonymous, declared inside an object or another functi...
377,722
<p>I have always been interested in algorithms, sort, crypto, binary trees, data compression, memory operations, etc.</p> <p>I read Mark Nelson's article about permutations in C++ with the STL function next_perm(), very interesting and useful, after that I wrote one class method to get the next permutation in Delphi, ...
[ { "answer_id": 377888, "author": "The Archetypal Paul", "author_id": 21755, "author_profile": "https://Stackoverflow.com/users/21755", "pm_score": 1, "selected": false, "text": "<p>So, in the homework-assistance kind of way, I can think of two approaches.</p>\n\n<p>Work out all permutati...
2008/12/18
[ "https://Stackoverflow.com/questions/377722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449425/" ]
I have always been interested in algorithms, sort, crypto, binary trees, data compression, memory operations, etc. I read Mark Nelson's article about permutations in C++ with the STL function next\_perm(), very interesting and useful, after that I wrote one class method to get the next permutation in Delphi, since tha...
My approach is a recursive generator that doesn't follow branches that contain illegal sequences. Here's the python 3 code: ``` def perm_maxlen(elements, prefix = "", maxlen = 2): if not elements: yield prefix + elements return used = set() for i in range(len(elements)): element...
377,763
<p>Is there any performance penalty for the following code snippet?</p> <pre><code>for (int i=0; i&lt;someValue; i++) { Object o = someList.get(i); o.doSomething; } </code></pre> <p>Or does this code actually make more sense?</p> <pre><code>Object o; for (int i=0; i&lt;someValue; i++) { o = someList.get(...
[ { "answer_id": 377775, "author": "Dave Markle", "author_id": 24995, "author_profile": "https://Stackoverflow.com/users/24995", "pm_score": 7, "selected": true, "text": "<p>In today's compilers, no. I declare objects in the smallest scope I can, because it's a lot more readable for the n...
2008/12/18
[ "https://Stackoverflow.com/questions/377763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24545/" ]
Is there any performance penalty for the following code snippet? ``` for (int i=0; i<someValue; i++) { Object o = someList.get(i); o.doSomething; } ``` Or does this code actually make more sense? ``` Object o; for (int i=0; i<someValue; i++) { o = someList.get(i); o.doSomething; } ``` If in byte c...
In today's compilers, no. I declare objects in the smallest scope I can, because it's a lot more readable for the next guy.
377,768
<p>I am looking for a more elegant way of concatenating strings in Ruby.</p> <p>I have the following line:</p> <pre><code>source = "#{ROOT_DIR}/" &lt;&lt; project &lt;&lt; "/App.config" </code></pre> <p>Is there a nicer way of doing this?</p> <p>And for that matter what is the difference between <code>&lt;&lt;</cod...
[ { "answer_id": 377787, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 10, "selected": true, "text": "<p>You can do that in several ways:</p>\n\n<ol>\n<li>As you shown with <code>&lt;&lt;</code> but that is not the <em>usual<...
2008/12/18
[ "https://Stackoverflow.com/questions/377768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11755/" ]
I am looking for a more elegant way of concatenating strings in Ruby. I have the following line: ``` source = "#{ROOT_DIR}/" << project << "/App.config" ``` Is there a nicer way of doing this? And for that matter what is the difference between `<<` and `+`?
You can do that in several ways: 1. As you shown with `<<` but that is not the *usual* way 2. With string interpolation ``` source = "#{ROOT_DIR}/#{project}/App.config" ``` 3. with `+` ``` source = "#{ROOT_DIR}/" + project + "/App.config" ``` The second method seems to be more efficient in term of memory/speed fr...
377,776
<p>If i have a parameterized SQL statement like this: </p> <pre><code>SELECT * FROM table WHERE my_field = :field_value </code></pre> <p>Does anyone know if PDO will recognize this(see below) as the same SQL statement and use the cache instead of assuming it's a completely different SQL statement:</p> <pre><code>SEL...
[ { "answer_id": 377867, "author": "andy.gurin", "author_id": 22388, "author_profile": "https://Stackoverflow.com/users/22388", "pm_score": 1, "selected": false, "text": "<p>It should be recognized as the same statement since the caching is done after the query parameters are replaced by v...
2008/12/18
[ "https://Stackoverflow.com/questions/377776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2494/" ]
If i have a parameterized SQL statement like this: ``` SELECT * FROM table WHERE my_field = :field_value ``` Does anyone know if PDO will recognize this(see below) as the same SQL statement and use the cache instead of assuming it's a completely different SQL statement: ``` SELECT * FROM table WHERE my_field = :ne...
If you're using PDO\_MySQL, it rewrites prepared statements into raw SQL on its own before the server even sees them, unless you set `PDO::ATTR_EMULATE_PREPARES` to false.
377,779
<p>I am displaying Japanese characters in a VB6 application with the system locale set to Japan and the language for non Unicode programs as Japanese. A call to GetACP() correctly returns 932 for Japanese. When I insert the Japanese strings into my controls they display as “ƒAƒtƒŠƒJ‚Ì—‰¤” rather than “アフリカの女王”. If I...
[ { "answer_id": 377806, "author": "geocar", "author_id": 37507, "author_profile": "https://Stackoverflow.com/users/37507", "pm_score": 1, "selected": false, "text": "<p>The second best way is to use a database of fonts, font.charsets, and heuristics, such as is done here:</p>\n\n<p><a hre...
2008/12/18
[ "https://Stackoverflow.com/questions/377779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5025/" ]
I am displaying Japanese characters in a VB6 application with the system locale set to Japan and the language for non Unicode programs as Japanese. A call to GetACP() correctly returns 932 for Japanese. When I insert the Japanese strings into my controls they display as “ƒAƒtƒŠƒJ‚Ì—‰¤” rather than “アフリカの女王”. If I manua...
Expanding Bob's answer, here's some code to get the current default charset. ``` Private Const LOCALE_SYSTEM_DEFAULT As Long = &H800 Private Const LOCALE_IDEFAULTANSICODEPAGE As Long = &H1004 Private Const TCI_SRCCODEPAGE = 2 Private Type FONTSIGNATURE fsUsb(4) As Long fsCsb(2) As Long End Type Private Type ...
377,784
<p>I created a separate assembly to contain common extension methods, the extension methods uses classes from <code>System.Web.dll</code> (and others).</p> <p>When I then create a new project (Console Application) that references the <code>Utilities.dll</code> assembly that contains the extension methods, I do not nee...
[ { "answer_id": 377793, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "<p>well, yes! In order to compile, it needs to be able to resolve everything in the public/protected API. Otherwise it...
2008/12/18
[ "https://Stackoverflow.com/questions/377784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40007/" ]
I created a separate assembly to contain common extension methods, the extension methods uses classes from `System.Web.dll` (and others). When I then create a new project (Console Application) that references the `Utilities.dll` assembly that contains the extension methods, I do not need to add a reference to `System....
well, yes! In order to compile, it needs to be able to resolve everything in the public/protected API. Otherwise it can't enforce the constraint. I imagine it needs to recognise the types to see if the extension method is a candidate for a method. You could try placing the extension methods in a child namespace that h...
377,785
<p>I just don't get it. I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper functions (e.g. &quot;touchesBegan&quot; ) in the implementation of a class which subclasses CocosNode. But it doesn't wo...
[ { "answer_id": 379260, "author": "keremk", "author_id": 29475, "author_profile": "https://Stackoverflow.com/users/29475", "pm_score": 2, "selected": false, "text": "<p>In order to detect touches, you need to subclass from UIResponder (which UIView does as well) . I am not familiar with c...
2008/12/18
[ "https://Stackoverflow.com/questions/377785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I just don't get it. I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper functions (e.g. "touchesBegan" ) in the implementation of a class which subclasses CocosNode. But it doesn't work. What coul...
Layer is the only cocos2d class which gets touches. The trick is that ALL instances of Layer get passed the touch events, one after the other, so your code has to handle this. I did it like this: ``` -(BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint loc...
377,794
<p>I am trying a straightforward remote json call with jquery. I am trying to use the reddit api. <a href="http://api.reddit.com" rel="nofollow noreferrer">http://api.reddit.com</a>. This returns a valid json object.</p> <p>If I call a local file (which is what is returned from the website saved to my local disk) thin...
[ { "answer_id": 377832, "author": "Jennifer", "author_id": 22360, "author_profile": "https://Stackoverflow.com/users/22360", "pm_score": 2, "selected": true, "text": "<p>The URL you are pointing to (www.redit.com...) is not returning JSON! Not sure where the JSON syndication from reddit c...
2008/12/18
[ "https://Stackoverflow.com/questions/377794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3431280/" ]
I am trying a straightforward remote json call with jquery. I am trying to use the reddit api. <http://api.reddit.com>. This returns a valid json object. If I call a local file (which is what is returned from the website saved to my local disk) things work fine. ``` $(document).ready(function() { $.getJSON("js/r...
The URL you are pointing to (www.redit.com...) is not returning JSON! Not sure where the JSON syndication from reddit comes but you might want to start with the example from the [docs](http://docs.jquery.com/Ajax/jQuery.getJSON): ``` $(document).ready(function() { $.getJSON("http://api.flickr.com/services/feeds/phot...
377,795
<p>When I pass an immutable type object(String, Integer,.. ) as final to a method I can achieve the characters of a C++ constant pointer. But how can I enforce such behavior in objects which are mutable?</p> <pre><code>public void someMethod(someType someObject){ /* * code that modifies the someObject's state * ...
[ { "answer_id": 377808, "author": "Bombe", "author_id": 43582, "author_profile": "https://Stackoverflow.com/users/43582", "pm_score": 2, "selected": false, "text": "<p>No, you can not prevent the object being modified via its setXXX() (or similar) methods. You could hand in a clone or a c...
2008/12/18
[ "https://Stackoverflow.com/questions/377795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27784/" ]
When I pass an immutable type object(String, Integer,.. ) as final to a method I can achieve the characters of a C++ constant pointer. But how can I enforce such behavior in objects which are mutable? ``` public void someMethod(someType someObject){ /* * code that modifies the someObject's state * */ } ``` A...
No, I don't think this is possible. The normal approach is to create an adapter for SomeType where all the methods changing state throws UnsupportedOperationException. This is used by for instance java.util.Collections.unmodifiable\*-functions. There are several approaches to this: * you can let SomeType be an interf...
377,798
<p>I'm using SQL Server 2005.</p> <p>I have a field that must either contain a unique value or a NULL value. I think I should be enforcing this with either a <code>CHECK CONSTRAINT</code> or a <code>TRIGGER for INSERT, UPDATE</code>.</p> <p>Is there an advantage to using a constraint here over a trigger (or vice-vers...
[ { "answer_id": 377810, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 2, "selected": false, "text": "<p>In Oracle, a unique key will permit multiple NULLs.</p>\n\n<p>In SQL Server 2005, a good approach is to do your insert...
2008/12/18
[ "https://Stackoverflow.com/questions/377798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20377/" ]
I'm using SQL Server 2005. I have a field that must either contain a unique value or a NULL value. I think I should be enforcing this with either a `CHECK CONSTRAINT` or a `TRIGGER for INSERT, UPDATE`. Is there an advantage to using a constraint here over a trigger (or vice-versa)? What might such a constraint/trigge...
Here is an alternative way to do it with a constraint. In order to enforce this constraint you'll need a function that counts the number of occurrences of the field value. In your constraint, simply make sure this maximum is 1. Constraint: ``` field is null or dbo.fn_count_maximum_of_field(field) < 2 ``` **EDIT ...
377,819
<p>Let's say I have a class like this:</p> <pre><code>class ApplicationDefs{ public static final String configOption1 = "some option"; public static final String configOption2 = "some other option"; public static final String configOption3 = "yet another option"; } </code></pre> <p>Many of the other classes in my app...
[ { "answer_id": 377824, "author": "GaryF", "author_id": 1035, "author_profile": "https://Stackoverflow.com/users/1035", "pm_score": 3, "selected": false, "text": "<p>No, it's part of the JLS, I'm afraid. This is touched upon, briefly, in Java Puzzlers but I don't have my copy to hand.</p>...
2008/12/18
[ "https://Stackoverflow.com/questions/377819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27784/" ]
Let's say I have a class like this: ``` class ApplicationDefs{ public static final String configOption1 = "some option"; public static final String configOption2 = "some other option"; public static final String configOption3 = "yet another option"; } ``` Many of the other classes in my application are using these o...
You can use String.intern() to get the desired effect, but should comment your code, because not many people know about this. i.e. ``` public static final String configOption1 = "some option".intern(); ``` This will prevent the compile time inline. Since it is referring to the exact same string that the compiler wil...
377,841
<p>I am trying to implement a wpf user control that binds a text box to a list of doubles using a converter. How can i set the instance of user control to be the converter parameter?</p> <p>the code for the control is shown below</p> <p>Thanks </p> <pre><code>&lt;UserControl x:Class="BaySizeControl.BaySizeTextBox" ...
[ { "answer_id": 377868, "author": "Frederic", "author_id": 42826, "author_profile": "https://Stackoverflow.com/users/42826", "pm_score": 4, "selected": true, "text": "<p>The parameters are for constants needed by your converter. To provide an object instance to your converter, you can use...
2008/12/18
[ "https://Stackoverflow.com/questions/377841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18966/" ]
I am trying to implement a wpf user control that binds a text box to a list of doubles using a converter. How can i set the instance of user control to be the converter parameter? the code for the control is shown below Thanks ``` <UserControl x:Class="BaySizeControl.BaySizeTextBox" xmlns="http://schemas.micros...
The parameters are for constants needed by your converter. To provide an object instance to your converter, you can use MultiBinding. Note: For this solution to work, you also need to modify your converter to implement IMultiValueConverter instead of IValueConverter. Fortunately, the modifications involved are fairly ...
377,846
<p>So I have this GIF file on my desktop (it's a 52 card deck of poker cards). I have been working on a program that cuts it up into little acm.graphics.GImages of each card. Now, however, I want to write those GImages or pixel arrays to a file so that I can use them later. I thought it would be as straight forward as ...
[ { "answer_id": 377893, "author": "Brendan Cashman", "author_id": 5814, "author_profile": "https://Stackoverflow.com/users/5814", "pm_score": 4, "selected": true, "text": "<p>Something along these lines should do the trick (modify the image type, dimensions and pixel array as appropriate)...
2008/12/18
[ "https://Stackoverflow.com/questions/377846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29182/" ]
So I have this GIF file on my desktop (it's a 52 card deck of poker cards). I have been working on a program that cuts it up into little acm.graphics.GImages of each card. Now, however, I want to write those GImages or pixel arrays to a file so that I can use them later. I thought it would be as straight forward as wri...
Something along these lines should do the trick (modify the image type, dimensions and pixel array as appropriate): ``` BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); WritableRaster raster = image.getRaster(); for ( i=0; i<width; i++ ) { for ( j=0; j<height; j++ ) { i...
377,850
<p>I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I basically want to get the list of ID's of people who have favourited that item (this is a bit simplified, but this is wha...
[ { "answer_id": 377900, "author": "soulmerge", "author_id": 44562, "author_profile": "https://Stackoverflow.com/users/44562", "pm_score": 5, "selected": true, "text": "<p>You can't access variables in the outer scope in such queries (can't use <code>items.id</code> there). You should rath...
2008/12/18
[ "https://Stackoverflow.com/questions/377850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37472/" ]
I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I basically want to get the list of ID's of people who have favourited that item (this is a bit simplified, but this is what i...
You can't access variables in the outer scope in such queries (can't use `items.id` there). You should rather try something like ``` SELECT items.name, items.color, CONCAT(favourites.userid) as idlist FROM items INNER JOIN favourites ON items.id = favourites.itemid WHERE items.id = $someid GROUP BY...
377,854
<p>jQuery return links are not working. I have Used jQuery and the basic Ajax feature. My jQuery returns the links from file <code>Links_ajax.php</code>.</p> <p>I giving the code samples.</p> <p>GetCustomerData.php has:</p> <pre><code>&lt;html&gt; &lt;script type="text/javascript"&gt; &lt;script src="ajax.js...
[ { "answer_id": 405139, "author": "Alec Smart", "author_id": 426996, "author_profile": "https://Stackoverflow.com/users/426996", "pm_score": 1, "selected": false, "text": "<p>First try the following:</p>\n\n<pre><code>success: function(data){\n //$(\"#response\").html(data);\n ale...
2008/12/18
[ "https://Stackoverflow.com/questions/377854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44984/" ]
jQuery return links are not working. I have Used jQuery and the basic Ajax feature. My jQuery returns the links from file `Links_ajax.php`. I giving the code samples. GetCustomerData.php has: ``` <html> <script type="text/javascript"> <script src="ajax.js" type="text/javascript"> $(function() { ...
First i wonder why you write a custom function HTTPrequest while you already have jquery object, infact you already use $.ajax at the top but then create getHTTPObject() later. The problem is the javascript function requestCustomerInfo() never delegate to handle the link at the ajax response data, you need to delegate...
377,864
<p>Is it possible is asp to detect from the MobileCapabilities object if the device support arabic or not</p>
[ { "answer_id": 500948, "author": "Asaf R", "author_id": 6827, "author_profile": "https://Stackoverflow.com/users/6827", "pm_score": 1, "selected": false, "text": "<p>You can use the Accept-Language header. It works for at least some phones. My Nokia bought from an Israli operator sends o...
2008/12/18
[ "https://Stackoverflow.com/questions/377864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is it possible is asp to detect from the MobileCapabilities object if the device support arabic or not
Yes, you can check the Accept-Language HTTP header for "ar" for arabic. For example this real sample: ``` Accept-Language: en;q=1.0,fr;q=0.5,ar;q=0.5 ``` Says, **en** (English) is accepted with a 100% quality, but you can give **fr** (French, France) too with a 50% quality (meaning, it's not my first choice, but I ...
377,865
<p>We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions <em>sometimes</em> when trying to iterate over a list of unmarshalled objects. The important bit is <em>sometimes</em>, after a reboot the particular code works fine. This seems to point in the direction of concurrenc...
[ { "answer_id": 670410, "author": "ivan_ivanovich_ivanoff", "author_id": 76393, "author_profile": "https://Stackoverflow.com/users/76393", "pm_score": 2, "selected": false, "text": "<p>I get this exception ONLY when I forget to tell JAXBContext\nabout ALL to-be-marshalled types it could b...
2008/12/18
[ "https://Stackoverflow.com/questions/377865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1996/" ]
We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions *sometimes* when trying to iterate over a list of unmarshalled objects. The important bit is *sometimes*, after a reboot the particular code works fine. This seems to point in the direction of concurrency/timing/race con...
Out of despair we turned to synchronizing on the `JAXBContext.class` object, seeing this as the only remaining possibility for some race condition and at least we have not been able to reproduce this issue again. Here's the critical code: ``` synchronized (JAXBContext.class) { context = JAXBContext.newInstance(pac...
377,872
<p>I dynamically create an element (div) in javascript, on which i register an event listener:</p> <pre><code>var tooltip = document.createElement('div'); tooltip.onclick = function() { alert('hello'); } </code></pre> <p>Now, if I attach this element to the document body:</p> <pre><code>document.body.appendChild(to...
[ { "answer_id": 377919, "author": "grepsedawk", "author_id": 14388, "author_profile": "https://Stackoverflow.com/users/14388", "pm_score": 0, "selected": false, "text": "<p>Your code works fine for me on firefox 3.0.5 and IE7. Are you sure your example is correct?</p>\n" }, { "ans...
2008/12/18
[ "https://Stackoverflow.com/questions/377872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I dynamically create an element (div) in javascript, on which i register an event listener: ``` var tooltip = document.createElement('div'); tooltip.onclick = function() { alert('hello'); } ``` Now, if I attach this element to the document body: ``` document.body.appendChild(tooltip); ``` all is well and the eve...
Maybe you need to register the event handler after appending?
377,883
<p>I'm making a simple tool that will get a string of MySQL commands and run it (on several DB servers sequentially). I trust the users to be sensible, but mistakes happen, and I'm looking for a way to prevent basic typos:</p> <p>Is there a way to validate, at runtime, (relatively simple) MySQL queries to see if they'...
[ { "answer_id": 377904, "author": "James Ogden", "author_id": 3198, "author_profile": "https://Stackoverflow.com/users/3198", "pm_score": 4, "selected": true, "text": "<p>Not without knowledge of the schema (for example, is 'x' a table?) and writing a SQL parser. Your MySQL query tool sh...
2008/12/18
[ "https://Stackoverflow.com/questions/377883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19746/" ]
I'm making a simple tool that will get a string of MySQL commands and run it (on several DB servers sequentially). I trust the users to be sensible, but mistakes happen, and I'm looking for a way to prevent basic typos: Is there a way to validate, at runtime, (relatively simple) MySQL queries to see if they're syntact...
Not without knowledge of the schema (for example, is 'x' a table?) and writing a SQL parser. Your MySQL query tool should be able to do that kind of validation (intellisense if you like) but I know from first hand experience, most of the (free) MySQL tools are abysmal. 'Preparing' the query would do what you want, but...
377,911
<p>I'm writing an utility (<a href="http://reg2run.sf.net" rel="nofollow noreferrer">http://reg2run.sf.net</a>) which in case execution without arguments works as windows application (shows OpenFileDialog, etc), otherwise - as console application.</p> <p>So, in first case I don't want to show a console window, that's ...
[ { "answer_id": 378004, "author": "Barry Kelly", "author_id": 3712, "author_profile": "https://Stackoverflow.com/users/3712", "pm_score": 4, "selected": true, "text": "<p>There are several approaches for applications that need to choose whether to act as console or GUI applications, depen...
2008/12/18
[ "https://Stackoverflow.com/questions/377911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41956/" ]
I'm writing an utility (<http://reg2run.sf.net>) which in case execution without arguments works as windows application (shows OpenFileDialog, etc), otherwise - as console application. So, in first case I don't want to show a console window, that's why project is Windows Application. But in second - I need to show it,...
There are several approaches for applications that need to choose whether to act as console or GUI applications, depending on context, on Windows: 1. Have two separate applications, and have one conditionally start the other. 2. A variant of the above strategy, have two applications, one called 'app.com' (i.e. just re...
377,912
<p>I have the function</p> <pre><code>sublist(_,[_],_) :- !. sublist(X,[Y|T],Z) :- R is X - Y, sublist(X,T,[R|Z]). </code></pre> <p>an example call is <code>sublist(2,[1,2,3],Z)</code>. At the end of execution it just gives me 'yes', but i'd like to see the contents of Z.</p> <p>I know it's something sim...
[ { "answer_id": 379025, "author": "Kaarel", "author_id": 12547, "author_profile": "https://Stackoverflow.com/users/12547", "pm_score": 1, "selected": false, "text": "<p>You don't really specify what <code>sublist/3</code> is supposed to do but maybe you mean this:</p>\n\n<pre><code>sublis...
2008/12/18
[ "https://Stackoverflow.com/questions/377912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42789/" ]
I have the function ``` sublist(_,[_],_) :- !. sublist(X,[Y|T],Z) :- R is X - Y, sublist(X,T,[R|Z]). ``` an example call is `sublist(2,[1,2,3],Z)`. At the end of execution it just gives me 'yes', but i'd like to see the contents of Z. I know it's something simple as i have other instructions that do sim...
I'm also going to assume that sublist/3 is supposed to subtract a number from all items in the list. The reason you're not getting any result for Z is because you're building the list on the way into the recursion. Which means that when the stopping predicate succeeds, Prolog works it's way back out of the recursion a...
377,920
<p>I'm creating a Q&amp;A application in CakePHP, and I want to exclude my associations in some cases. Imagine the following:</p> <p>I'm listing all questions on the first page using $this->Question->findAll();. Since I have the following association in my model:</p> <pre><code>public $hasMany = array('Answer' =&gt; ...
[ { "answer_id": 377969, "author": "duckyflip", "author_id": 7370, "author_profile": "https://Stackoverflow.com/users/7370", "pm_score": 4, "selected": true, "text": "<p>I quick look at the <a href=\"http://api.cakephp.org\" rel=\"noreferrer\">CakePHP API</a> reveals that you've got an <a ...
2008/12/18
[ "https://Stackoverflow.com/questions/377920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41596/" ]
I'm creating a Q&A application in CakePHP, and I want to exclude my associations in some cases. Imagine the following: I'm listing all questions on the first page using $this->Question->findAll();. Since I have the following association in my model: ``` public $hasMany = array('Answer' => array('className' =>...
I quick look at the [CakePHP API](http://api.cakephp.org) reveals that you've got an [unbindModel](http://api.cakephp.org/class_model.html#0b969d5264205cd3a425980dd53e9658) method on the Model. So in you example you can do this: ``` $this->Question->unBindModel(array('hasMany' => array(’Answer’))) ``` Alternatively,...
377,927
<p>I am writing a console program in C#.</p> <p>Is there a way I can use a Console.Clear() to only clear certain things on the console screen?</p> <p>Here's my issue:</p> <p>I have a logo (I put it on screen using Console.WriteLine()) and a 2d array which I want to keep constant and clear everything below it. </p>
[ { "answer_id": 377936, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 1, "selected": false, "text": "<p>Can you not clear and then re-write the logo and array? The console is not designed to be used as you describe.</p>\n...
2008/12/18
[ "https://Stackoverflow.com/questions/377927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47415/" ]
I am writing a console program in C#. Is there a way I can use a Console.Clear() to only clear certain things on the console screen? Here's my issue: I have a logo (I put it on screen using Console.WriteLine()) and a 2d array which I want to keep constant and clear everything below it.
You could use a custom method to clear parts of the screen... ``` static void Clear(int x, int y, int width, int height) { int curTop = Console.CursorTop; int curLeft = Console.CursorLeft; for (; height > 0;) { Console.SetCursorPosition(x, y + --height); Console.Write(new string(' ',wid...
377,960
<p>I want to set the font color of a cell to a specific RGB value.</p> <p>If I use</p> <pre><code>ActiveCell.Color = RGB(255,255,0) </code></pre> <p>I do get yellow, but if I use a more exotic RGB value like:</p> <pre><code>ActiveCell.Color = RGB(178, 150, 109) </code></pre> <p>I just get a grey color back.</p> <...
[ { "answer_id": 378014, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 4, "selected": true, "text": "<p>Excel only uses the colors in the color palette. When you set a cell using the RGB value, it chooses the one in the pa...
2008/12/18
[ "https://Stackoverflow.com/questions/377960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45467/" ]
I want to set the font color of a cell to a specific RGB value. If I use ``` ActiveCell.Color = RGB(255,255,0) ``` I do get yellow, but if I use a more exotic RGB value like: ``` ActiveCell.Color = RGB(178, 150, 109) ``` I just get a grey color back. How come can't I just use any RGB value? And do you know any ...
Excel only uses the colors in the color palette. When you set a cell using the RGB value, it chooses the one in the palette that is the closest match. You can update the palette with your colors and then choose your color and that will work. This will let you see what is currently in the palette: ``` Public Sub chec...
377,961
<p>Hey there, I've got a block of HTML that I'm going to be using repeatedly (at various times during a users visit, not at once). I think that the best way to accomplish this is to create an HTML div, hide it, and when needed take its innerHTML and do a replace() on several keywords. As an example HTML block...</p> ...
[ { "answer_id": 377972, "author": "Vilx-", "author_id": 41360, "author_profile": "https://Stackoverflow.com/users/41360", "pm_score": 5, "selected": true, "text": "<p>I doubt there will be anything more efficient. The alternative would be splitting it into parts and then concatenating, bu...
2008/12/18
[ "https://Stackoverflow.com/questions/377961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Hey there, I've got a block of HTML that I'm going to be using repeatedly (at various times during a users visit, not at once). I think that the best way to accomplish this is to create an HTML div, hide it, and when needed take its innerHTML and do a replace() on several keywords. As an example HTML block... ``` <div...
I doubt there will be anything more efficient. The alternative would be splitting it into parts and then concatenating, but I don't think that would be much efficient. Perhaps even less, considering that every concatenation results in a new string which has the same size as its operands. **Added:** This is probably th...
377,968
<p>Like the question says, if I have a request for a page on my site like this</p> <p><a href="http://somename.something.here/Dada.aspx" rel="nofollow noreferrer">http://somename.something.here/Dada.aspx</a></p> <p>to something like this</p> <p><a href="https://somename.something.here/Dada.aspx" rel="nofollow norefe...
[ { "answer_id": 377980, "author": "Bork Blatt", "author_id": 5381, "author_profile": "https://Stackoverflow.com/users/5381", "pm_score": -1, "selected": false, "text": "<p>Send a Redirect Header (302) to the browser.</p>\n\n<p>Example:</p>\n\n<pre><code>Response.Redirect(\"WebForm2.aspx\"...
2008/12/18
[ "https://Stackoverflow.com/questions/377968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17787/" ]
Like the question says, if I have a request for a page on my site like this <http://somename.something.here/Dada.aspx> to something like this <https://somename.something.here/Dada.aspx>
I prefer to (a) not redirect local connections (to ease development under VS), and (b) use a UriBuilder instead of a string.Replace as it's a bit more exact. ``` if (!Request.IsLocal && !Request.IsSecureConnection) { var ub = new UriBuilder(Request.Url); ub.Scheme = Uri.UriSchemeHttps; ub.Port = -1; // use...
377,974
<p>Here's the situation: we have an Oracle database we need to connect to to pull some data. Since getting access to said Oracle database is a real pain (mainly a bureaucratic obstacle more than anything else), we're just planning on linking it to our SQL Server and using the link to access data as we need it.</p>...
[ { "answer_id": 377998, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 3, "selected": true, "text": "<p>If the inner join significantly reduces the total number of rows, then option 1 will result in much less network traffic...
2008/12/18
[ "https://Stackoverflow.com/questions/377974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
Here's the situation: we have an Oracle database we need to connect to to pull some data. Since getting access to said Oracle database is a real pain (mainly a bureaucratic obstacle more than anything else), we're just planning on linking it to our SQL Server and using the link to access data as we need it. For one of...
If the inner join significantly reduces the total number of rows, then option 1 will result in much less network traffic (since you won't have all the rows from table1 having to go across the db link
377,990
<p>I have a set of five boolean values. If more than one of these are true I want to excecute a particular function. What is the most elegant way you can think of that would allow me to check this condition in a single if() statement? Target language is C# but I'm interested in solutions in other languages as well (as ...
[ { "answer_id": 378015, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 4, "selected": false, "text": "<p>I would just cast them to ints and sum.</p>\n\n<p>Unless you're in a super tight inner loop, that has the benefit of ...
2008/12/18
[ "https://Stackoverflow.com/questions/377990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6903/" ]
I have a set of five boolean values. If more than one of these are true I want to excecute a particular function. What is the most elegant way you can think of that would allow me to check this condition in a single if() statement? Target language is C# but I'm interested in solutions in other languages as well (as lon...
How about ``` if ((bool1? 1:0) + (bool2? 1:0) + (bool3? 1:0) + (bool4? 1:0) + (bool5? 1:0) > 1) // do something ``` or a generalized method would be... ``` public bool ExceedsThreshold(int threshold, IEnumerable<bool> bools) { int trueCnt = 0; foreach(bool b in bools) ...
377,992
<p>I've been playing around with Qt for a few hours now. I found that qmake produces Xcode project files on Mac OS X instead of good ol' makefiles. I don't want to launch Xcode every time I want to build "Hello, world".</p> <p>How do I make qmake generate regular makefiles or, if that's something that cannot be done o...
[ { "answer_id": 378102, "author": "Olie", "author_id": 34820, "author_profile": "https://Stackoverflow.com/users/34820", "pm_score": 6, "selected": false, "text": "<pre><code>$ man xcodebuild\n</code></pre>\n\n<p>So a typical command might be something like:</p>\n\n<pre><code>$ xcodebuild...
2008/12/18
[ "https://Stackoverflow.com/questions/377992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47135/" ]
I've been playing around with Qt for a few hours now. I found that qmake produces Xcode project files on Mac OS X instead of good ol' makefiles. I don't want to launch Xcode every time I want to build "Hello, world". How do I make qmake generate regular makefiles or, if that's something that cannot be done on the Mac,...
The open-source Qt binary installers for OS X from Trolltech default to creating .xcodeproj files when you run qmake. I don't use XCode for editing so it is a pain to open it to compile the project. To compile your projects from Terminal.app, just set an environment variable of QMAKESPEC to macx-g++ If you want to ju...
378,030
<p>I have a windows service that runs fine, but I have to have it run under a special user account.</p> <p>Currently I go into services and change the logon as section, but for deployment this has to be done more professionally.</p> <p>Is there a way for me to have it logon as a custom user account programatically, o...
[ { "answer_id": 378042, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 3, "selected": true, "text": "<p>When you open the Service COntrol Manager,(SCM), of course,there is a tab labeled Logon.. In there you can speci...
2008/12/18
[ "https://Stackoverflow.com/questions/378030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
I have a windows service that runs fine, but I have to have it run under a special user account. Currently I go into services and change the logon as section, but for deployment this has to be done more professionally. Is there a way for me to have it logon as a custom user account programatically, or during the inst...
When you open the Service COntrol Manager,(SCM), of course,there is a tab labeled Logon.. In there you can specify which domain or machine account it should run under... But programatically. if you use a Service Installer class in your code you can specify it there.. ``` public class MyServiceInstaller : Installer ...
378,040
<p>I have a problem that I would like have solved via a SQL query. This is going to be used as a PoC (proof of concept).</p> <p>The problem:</p> <p>Product offerings are made up of one or many product instances, a product instance can belong to many product offerings. This can be realised like this in a table:</p> <...
[ { "answer_id": 378074, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 1, "selected": false, "text": "<p>I don't have a db in front of me, but off the top of my head you want the list of POs that don't have any PIs not in yo...
2008/12/18
[ "https://Stackoverflow.com/questions/378040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47431/" ]
I have a problem that I would like have solved via a SQL query. This is going to be used as a PoC (proof of concept). The problem: Product offerings are made up of one or many product instances, a product instance can belong to many product offerings. This can be realised like this in a table: ``` PO | PI ----- A ...
Okay, I think I have it. This meets the constraints you provided. There might be a way to simplify this further, but it ate my brain a little: ``` select distinct PO from POPI x where PO not in ( select PO from POPI where PI not in (10,11,12) ) and PI not in ( select PI from POPI ...
378,066
<p>If I have a form-backing object that has a complicated object tree -- say a Person that has a Contact Info object that has an Address object that has a bunch of Strings -- it seems that the object needs to be fully populated with component objects before I can bind to it. So if I'm creating a new Person, I need to ...
[ { "answer_id": 379304, "author": "Olivier", "author_id": 43585, "author_profile": "https://Stackoverflow.com/users/43585", "pm_score": 1, "selected": false, "text": "<p>I guess you are talking about something like <code> &lt; form:input path=\"person.contactInfo.homeAddress.street\"/></c...
2008/12/18
[ "https://Stackoverflow.com/questions/378066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1237/" ]
If I have a form-backing object that has a complicated object tree -- say a Person that has a Contact Info object that has an Address object that has a bunch of Strings -- it seems that the object needs to be fully populated with component objects before I can bind to it. So if I'm creating a new Person, I need to make...
Call it overkill if you like, but what we actually ended up doing was to create a generic factory that will take any object and use reflection to (recursively) find all the null properties and instantiate an object of the correct type. I did this using Apache Commons BeanUtils. This way you can take an object that yo...
378,089
<p>The most recent Crystal XI component for Delphi was released for Delphi 7. That VCL component compiles in D2007, but gives me errors at runtime. What is the best way to display a database-connected Crystal Report in a Delphi 2007 application?</p>
[ { "answer_id": 378099, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 3, "selected": true, "text": "<p>This is the solution I've found, using ActiveX:</p>\n\n<p>First, register the Active X control like this:</p>\n\n<p>In ...
2008/12/18
[ "https://Stackoverflow.com/questions/378089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672/" ]
The most recent Crystal XI component for Delphi was released for Delphi 7. That VCL component compiles in D2007, but gives me errors at runtime. What is the best way to display a database-connected Crystal Report in a Delphi 2007 application?
This is the solution I've found, using ActiveX: First, register the Active X control like this: In Delphi, choose Component -> Import Component Click on "Type Library", click Next Choose "Crystal ActiveX Report Viewer Library 11.5" Pick whatever Palette Page you want (I went with "Data Access") Choose an import l...
378,092
<p>I'm using HTTPService with a POST operation to submit a Base64 encoded file (taken from bitmap data within the app) but I could really do with getting some idea of the progress of the POST operation (e.g. like the FileReference.upload()).</p> <p>I don't think this is possible, but it would be awesome if it is (via ...
[ { "answer_id": 389926, "author": "ForYourOwnGood", "author_id": 48728, "author_profile": "https://Stackoverflow.com/users/48728", "pm_score": 4, "selected": true, "text": "<p>Do not use HTTPService. Use URLRequest, URLLoader, and URLVariables.</p>\n\n<p>If your using an HTTPService tag, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6432/" ]
I'm using HTTPService with a POST operation to submit a Base64 encoded file (taken from bitmap data within the app) but I could really do with getting some idea of the progress of the POST operation (e.g. like the FileReference.upload()). I don't think this is possible, but it would be awesome if it is (via any means,...
Do not use HTTPService. Use URLRequest, URLLoader, and URLVariables. If your using an HTTPService tag, get ride of it and replace it with a Script tag filled with something like ... ``` private function forYou() : void{ var req : URLRequest = new URLRequest("PUT YOUR URL HERE") var loader : URLLoader = new...
378,096
<p>In a stylesheet i have:</p> <pre><code> * HTML BODY { padding-right: 0px; padding-left: 0px; padding-bottom: 25px; padding-top: 190px; } * HTML #maincontent { width: 100%; height: 100%; } </code></pre> <p>i know that a . means class and a # mea...
[ { "answer_id": 378103, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": -1, "selected": false, "text": "<p>For the 2nd snippet, since * matches anything the element item is redundant. It looks like it's there to remind t...
2008/12/18
[ "https://Stackoverflow.com/questions/378096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46716/" ]
In a stylesheet i have: ``` * HTML BODY { padding-right: 0px; padding-left: 0px; padding-bottom: 25px; padding-top: 190px; } * HTML #maincontent { width: 100%; height: 100%; } ``` i know that a . means class and a # means applied to the id, but ...
The \* is the universal selector, and thus matches any element. e.g. ``` P * { } ``` Matches any element which is the child of a P tag ``` * HTML ``` should mean nothing because HTML cannot be the child of anything (by definition). It's used because IE (edit, at least IE 5 - 6 - thanks RoBorg!) ignores \* and so ...
378,097
<p>I have a TreeView control showing multiple TreeNodes in an organised heirarchy. I want to stop the user selecting the highest level Nodes (this was achieved by using the BeforeSelect Event). I also want to stop the TreeView from highlighting the top level nodes if the user selects them i.e. stop the TreeView from ch...
[ { "answer_id": 378110, "author": "Frans Bouma", "author_id": 44991, "author_profile": "https://Stackoverflow.com/users/44991", "pm_score": 2, "selected": false, "text": "<p>If the selecting is cancelled by setting Cancel to true in the BeforeSelect's event args, the node will not be sele...
2008/12/18
[ "https://Stackoverflow.com/questions/378097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
I have a TreeView control showing multiple TreeNodes in an organised heirarchy. I want to stop the user selecting the highest level Nodes (this was achieved by using the BeforeSelect Event). I also want to stop the TreeView from highlighting the top level nodes if the user selects them i.e. stop the TreeView from chang...
In addition to your existing code if you add a handler to the MouseDown event on the TreeView with the code and select the node out using it's location, you can then set the nodes colours. ``` private void treeView1_MouseDown(object sender, MouseEventArgs e) { TreeNode tn = treeView1.GetNodeAt(e.Location); tn....
378,101
<p>I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class </p> <pre><code>public class TrackingModule : System.Web.IHttpModule { public TrackingModule(){} public void Init(System.Web.HttpApplication context) { context.BeginRequest+=new E...
[ { "answer_id": 378136, "author": "Bullines", "author_id": 27870, "author_profile": "https://Stackoverflow.com/users/27870", "pm_score": 0, "selected": false, "text": "<p>Does this work?</p>\n\n<pre><code>&lt;add name=\"TrackingModule\" type=\"WebserviceTrackingModule.TrackingModule\" /&g...
2008/12/18
[ "https://Stackoverflow.com/questions/378101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34402/" ]
I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class ``` public class TrackingModule : System.Web.IHttpModule { public TrackingModule(){} public void Init(System.Web.HttpApplication context) { context.BeginRequest+=new EventHandler(co...
I believe I have found a better solution. Attach the module at runtime instead of in the web config. Check out [Rick Strahl's blog post](http://www.west-wind.com/weblog/posts/44979.aspx) for the details.
378,105
<p>We have a custom section in my app.config file related to our IoC container class. How can I get intellisense when editing the config file for this section, as well as getting rid of the compiler messages informing me of the missing schema.</p> <p>I found this question here: <a href="https://stackoverflow.com/quest...
[ { "answer_id": 378162, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 5, "selected": true, "text": "<p>XML Intellisense will not automatically work for a custom configuration section. </p>\n\n<p>Visual Studio may repor...
2008/12/18
[ "https://Stackoverflow.com/questions/378105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
We have a custom section in my app.config file related to our IoC container class. How can I get intellisense when editing the config file for this section, as well as getting rid of the compiler messages informing me of the missing schema. I found this question here: [app.config configSections custom settings can not...
XML Intellisense will not automatically work for a custom configuration section. Visual Studio may report warnings on compilation complaining that the attributes of the custom configuration section are not defined. These warnings may be ignored. If you want XML IntelliSense support for a custom configuration sectio...
378,106
<p>I've downloaded the svntask for ant from tigris.org, so it is the "official" one.</p> <p>I have a simple task to update my entire project</p> <pre><code>&lt;target name="prepare"&gt; &lt;svn username="user" password="pass"&gt; &lt;update&gt; &lt;fileset dir="."/&gt; ...
[ { "answer_id": 378324, "author": "Jeffrey Fredrick", "author_id": 35894, "author_profile": "https://Stackoverflow.com/users/35894", "pm_score": 0, "selected": false, "text": "<p>So if you just run \"ant prepare\" it takes 2 hrs? Or is this 2 hr duration only under special conditions lik...
2008/12/18
[ "https://Stackoverflow.com/questions/378106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I've downloaded the svntask for ant from tigris.org, so it is the "official" one. I have a simple task to update my entire project ``` <target name="prepare"> <svn username="user" password="pass"> <update> <fileset dir="."/> </update> </svn> </target> ``` Running ...
By using the nested `<fileset>` the command ends up calling `update` for every file in the current directory hierarchy. That's probably why it takes two hours. Try using the `dir` attribute of the `update` task: ``` <svn username="user" password="pass"> <update dir="."/> ...
378,117
<p>I've been tasked with rewriting the Javascript engine currently powering my customer's internal website. While reviewing the code I've come across this function <em>flvFPW1</em> which I do not recognize, nor can I decipher the code(my Javascript knowledge is modest at best). A Google search gives me a few hits, but ...
[ { "answer_id": 378147, "author": "Rik Heywood", "author_id": 4012, "author_profile": "https://Stackoverflow.com/users/4012", "pm_score": 0, "selected": false, "text": "<p>I don't think it is a built in function, so it is just some function one of your team wrote. </p>\n\n<p>It might be a...
2008/12/18
[ "https://Stackoverflow.com/questions/378117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3999/" ]
I've been tasked with rewriting the Javascript engine currently powering my customer's internal website. While reviewing the code I've come across this function *flvFPW1* which I do not recognize, nor can I decipher the code(my Javascript knowledge is modest at best). A Google search gives me a few hits, but most if no...
My own research agrees that it's a dreamweaver extension: I found [code for version 1.44](http://forums.devshed.com/javascript-development-115/apply-onclick-to-all-links-in-template-265457.html) (scroll down some on this page) rather than 1.3: ``` function flvFPW1(){//v1.44 var v1=arguments,v2=v1[2].split(","),v3=(v1....
378,118
<p>Should I instantiate my worker variables inside or outside my for loop</p> <p>E.g.</p> <p>a)</p> <pre><code>bool b = default(bool); for (int i = 0; i &lt; MyCollection.Length; i++) { b = false; foreach(object myObject in myObjectCollection) { if (object.Property == MyCollection[i].Property) { ...
[ { "answer_id": 378130, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 0, "selected": false, "text": "<p>I like to declare them inside the loop, it saves a line of code (to declare and set it on the same line), and ...
2008/12/18
[ "https://Stackoverflow.com/questions/378118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12918/" ]
Should I instantiate my worker variables inside or outside my for loop E.g. a) ``` bool b = default(bool); for (int i = 0; i < MyCollection.Length; i++) { b = false; foreach(object myObject in myObjectCollection) { if (object.Property == MyCollection[i].Property) { b = true; break; } ...
Previous answer deleted as I'd misread the code. (Using "default(bool)" anywhere is a bit odd, btw.) However, unless the variable is captured by a delegate etc, I'd expect them to *either* compile to IL which is effectively the same (in terms of both behaviour and performance). As ever, write the most *readable* code...
378,133
<p>Given a DOM element how do I find its nearest parent with a given css class?</p> <pre><code>$(".editButton").click(function() { (magic container selector goes here).addClass("editing"); }); </code></pre> <p>I don't want to use lots or $(...).parent().parent() since I don't want to be bound to a particular dom s...
[ { "answer_id": 378148, "author": "Bill Zeller", "author_id": 19234, "author_profile": "https://Stackoverflow.com/users/19234", "pm_score": 6, "selected": true, "text": "<p>This should work</p>\n\n<pre><code>$(this).parents('.classYouWant:first').addClass(\"editing\");\n</code></pre>\n" ...
2008/12/18
[ "https://Stackoverflow.com/questions/378133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
Given a DOM element how do I find its nearest parent with a given css class? ``` $(".editButton").click(function() { (magic container selector goes here).addClass("editing"); }); ``` I don't want to use lots or $(...).parent().parent() since I don't want to be bound to a particular dom structure.
This should work ``` $(this).parents('.classYouWant:first').addClass("editing"); ```
378,153
<p>I am having some issues with using the OrderBy extension method on a LINQ query when it is operating on an enum type. I have created a regular DataContext using visual studio by simply dragging and dropping everything onto the designer. I have then created seperate entity models, which are simply POCO's, and I have ...
[ { "answer_id": 378191, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 1, "selected": false, "text": "<p>What is the relationship between the <code>Campaign</code> class and <code>Campaigns</code>? If <code>Campaigns</c...
2008/12/18
[ "https://Stackoverflow.com/questions/378153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40240/" ]
I am having some issues with using the OrderBy extension method on a LINQ query when it is operating on an enum type. I have created a regular DataContext using visual studio by simply dragging and dropping everything onto the designer. I have then created seperate entity models, which are simply POCO's, and I have use...
Can you specify the type `CampaignStatus` directly in your `DataContext` trough the designer? This way the value is automatically mapped to the `enum`.
378,157
<p>I am trying to use regular expressions to find a UK postcode within a string.</p> <p>I have got the regular expression working inside RegexBuddy, see below:</p> <pre><code>\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\b </code></pre> <p>I have a bunch of addresses and want to grab the postcode from them, ex...
[ { "answer_id": 378222, "author": "kristina", "author_id": 4243, "author_profile": "https://Stackoverflow.com/users/4243", "pm_score": 0, "selected": false, "text": "<p>Try</p>\n\n<pre><code>import re\nre.findall(\"[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\", x)\n</code></pre>\n\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30786/" ]
I am trying to use regular expressions to find a UK postcode within a string. I have got the regular expression working inside RegexBuddy, see below: ``` \b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\b ``` I have a bunch of addresses and want to grab the postcode from them, example below: > > 123 Some Road ...
repeating your address 3 times with postcode PA23 6NH, PA2 6NH and PA2Q 6NH as test for you pattern and using the regex from wikipedia against yours, the code is.. ``` import re s="123 Some Road Name\nTown, City\nCounty\nPA23 6NH\n123 Some Road Name\nTown, City"\ "County\nPA2 6NH\n123 Some Road Name\nTown, City\n...
378,167
<p>Looking for advice (perhaps best practice).</p> <p>We have a MS Word document (Office 2007) that we are extracting text from a cell.</p> <p>We can use the following:</p> <pre><code>string text = wordTable.cell(tablerow.index, 1).Range.Text; </code></pre> <p>The text is extracted; however we seem to get extra cha...
[ { "answer_id": 378206, "author": "Blounty", "author_id": 33944, "author_profile": "https://Stackoverflow.com/users/33944", "pm_score": 0, "selected": false, "text": "<p>I would definitely opt for breaking it out into a separate method personally. it helps with code readability and makes ...
2008/12/18
[ "https://Stackoverflow.com/questions/378167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44376/" ]
Looking for advice (perhaps best practice). We have a MS Word document (Office 2007) that we are extracting text from a cell. We can use the following: ``` string text = wordTable.cell(tablerow.index, 1).Range.Text; ``` The text is extracted; however we seem to get extra characters trailing, for example `\r\a`. N...
I would break it out into a separate method but use the replace implementation since it's the simplest solution. You could always change the implementation later if you run into problem (like the text contains more than one `\r\a` and needs to be preserved) So: ``` private string stripCellText(string text) { re...
378,204
<p>I have two arrays containing the same elements, but in different orders, and I want to know the extent to which their orders differ.</p> <p>The method I tried, didn't work. it was as follows:</p> <p>For each list I built a matrix which recorded for each pair of elements whether they were above or below each other ...
[ { "answer_id": 378221, "author": "jamesh", "author_id": 4737, "author_profile": "https://Stackoverflow.com/users/4737", "pm_score": 5, "selected": true, "text": "<p>Mean square of differences of indices of each element.</p>\n\n<pre><code>List 1: A B C D E\nList 2: A D C B E\n</code></pre...
2008/12/18
[ "https://Stackoverflow.com/questions/378204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11522/" ]
I have two arrays containing the same elements, but in different orders, and I want to know the extent to which their orders differ. The method I tried, didn't work. it was as follows: For each list I built a matrix which recorded for each pair of elements whether they were above or below each other in the list. I th...
Mean square of differences of indices of each element. ``` List 1: A B C D E List 2: A D C B E ``` Indices of each element of List 1 in List 2 (zero based) ``` A B C D E 0 3 2 1 4 ``` Indices of each element of List 1 in List 1 (zero based) ``` A B C D E 0 1 2 3 4 ``` Differences: ``` A B C D E 0 -2 0 2 0 ...
378,207
<p>suppose I declare a dynamic array like</p> <pre><code>int *dynArray = new int [1]; </code></pre> <p>which is initialized with an unknown amount of int values at some point.</p> <p>How would I iterate till the end of my array of unknown size?</p> <p>Also, if it read a blank space would its corresponding position ...
[ { "answer_id": 378235, "author": "Nemanja Trifunovic", "author_id": 8899, "author_profile": "https://Stackoverflow.com/users/8899", "pm_score": 4, "selected": true, "text": "<p>No portable way of doing this. Either pass the size together with the array, or, better, use a standard contain...
2008/12/18
[ "https://Stackoverflow.com/questions/378207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45963/" ]
suppose I declare a dynamic array like ``` int *dynArray = new int [1]; ``` which is initialized with an unknown amount of int values at some point. How would I iterate till the end of my array of unknown size? Also, if it read a blank space would its corresponding position in the array end up junked? Copying Inp...
No portable way of doing this. Either pass the size together with the array, or, better, use a standard container such as `std::vector`
378,210
<p>I have built a database in MS Access. There I have a table called Customers which also has a cell called Employee type: integer. I also built a program in C++ which controls all data.</p> <p>Let's say I have a string like this:</p> <pre><code>string sqlString = "SELECT * FROM Customers Where Customers.Employee = '...
[ { "answer_id": 378237, "author": "frankodwyer", "author_id": 42404, "author_profile": "https://Stackoverflow.com/users/42404", "pm_score": 2, "selected": false, "text": "<p>You need to convert id to a string, then your first approach should work.</p>\n\n<p>See this question for how to do...
2008/12/18
[ "https://Stackoverflow.com/questions/378210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have built a database in MS Access. There I have a table called Customers which also has a cell called Employee type: integer. I also built a program in C++ which controls all data. Let's say I have a string like this: ``` string sqlString = "SELECT * FROM Customers Where Customers.Employee = '" + id + "' "; ``` ...
You need to convert id to a string, then your first approach should work. See this question for how to do the conversion: [Alternative to itoa() for converting integer to string C++?](https://stackoverflow.com/questions/228005/alternative-to-itoa-for-converting-integer-to-string-c)
378,217
<p>Following on from <a href="https://stackoverflow.com/questions/367966/how-to-intercept-debugging-information-debugview-style-in-c">this question</a> I now have code that can attach to a process using the Mdbg API.</p> <p>The problem is that I can't detach from the process if I need to. When I call <strong>mgProces...
[ { "answer_id": 378363, "author": "glenatron", "author_id": 15394, "author_profile": "https://Stackoverflow.com/users/15394", "pm_score": 3, "selected": true, "text": "<p>It transpires that Mdbg will not allow you to do anything <a href=\"http://blogs.msdn.com/jmstall/archive/2006/03/22/a...
2008/12/18
[ "https://Stackoverflow.com/questions/378217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15394/" ]
Following on from [this question](https://stackoverflow.com/questions/367966/how-to-intercept-debugging-information-debugview-style-in-c) I now have code that can attach to a process using the Mdbg API. The problem is that I can't detach from the process if I need to. When I call **mgProcess.Detach().WaitOne();** ( w...
It transpires that Mdbg will not allow you to do anything [while the debugee is running](http://blogs.msdn.com/jmstall/archive/2006/03/22/att-macros.aspx). ``` MgProcess.CorProcess.Stop(0); MgProcess.Detach(); ``` Appears to be the way forward.
378,225
<p>I have this:</p> <pre><code>If String.IsNullOrEmpty(editTransactionRow.pay_id.ToString()) = False Then stTransactionPaymentID = editTransactionRow.pay_id 'Check for null value End If </code></pre> <p>Now, when <code>editTransactionRow.pay_id</code> is Null Visual Basic throws an exception. Is there something w...
[ { "answer_id": 378233, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 4, "selected": false, "text": "<p>editTransactionRow.pay_id is Null so in fact you are doing: null.ToString() and it cannot be executed. You n...
2008/12/18
[ "https://Stackoverflow.com/questions/378225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have this: ``` If String.IsNullOrEmpty(editTransactionRow.pay_id.ToString()) = False Then stTransactionPaymentID = editTransactionRow.pay_id 'Check for null value End If ``` Now, when `editTransactionRow.pay_id` is Null Visual Basic throws an exception. Is there something wrong with this code?
If you are using a strongly-typed dataset then you should do this: ``` If Not ediTransactionRow.Ispay_id1Null Then 'Do processing here End If ``` You are getting the error because a strongly-typed data set retrieves the underlying value and exposes the conversion through the property. For instance, here is essen...
378,265
<p>i'm using the <a href="http://msdn.microsoft.com/en-us/library/bb775248(VS.85).aspx" rel="nofollow noreferrer">Win32 progress dialog</a>. The damnest thing is that when i call:</p> <pre><code>progressDialog.StopProgressDialog(); </code></pre> <p>it doesn't disappear. It stays on screen until the user moves her mou...
[ { "answer_id": 378375, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackoverflow.com/users/22114", "pm_score": 0, "selected": false, "text": "<p>Check the return value of the StopProgressDialog Method, maybe that will give you more information about what is going on...
2008/12/18
[ "https://Stackoverflow.com/questions/378265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
i'm using the [Win32 progress dialog](http://msdn.microsoft.com/en-us/library/bb775248(VS.85).aspx). The damnest thing is that when i call: ``` progressDialog.StopProgressDialog(); ``` it doesn't disappear. It stays on screen until the user moves her mouse over it - *then* it suddenly disappers. The call to `StopP...
To really hide the dialog, I've added the following to my C++ wrapper class: ``` void CProgressDlg::Stop() { if ((m_isVisible)&&(m_bValid)) { HWND hDlgWnd = NULL; //Sometimes the progress dialog sticks around after stopping it, //until the mouse pointer is moved over it or some other tr...
378,284
<p>I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User stored in {$app}/Controller/User.php . Is...
[ { "answer_id": 378565, "author": "Tim Lytle", "author_id": 45531, "author_profile": "https://Stackoverflow.com/users/45531", "pm_score": 2, "selected": false, "text": "<p>This is certainly not a step-by-step answer, but I believe you can accomplish what you want by subclassing the standa...
2008/12/18
[ "https://Stackoverflow.com/questions/378284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5742/" ]
I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend\_Controller names the controllers by default. I am looking for a way to enable zend\_controller to understand my controller class named Controller\_User stored in {$app}/Controller/User.php . Is...
a subclassed dispatcher ( quoted from <http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/> ) ``` class Coolsilon_Controller_Dispatcher extends Zend_Controller_Dispatcher_Standard { public function __construct() { parent::__construct(); } public function formatControllerName($...
378,296
<p>I have an ATL control that I want to be Unicode-aware. I added a message handler for WM_UNICHAR:</p> <pre><code>MESSAGE_HANDLER( WM_UNICHAR, OnUniChar ) </code></pre> <p>But, for some reason, the OnUniChar handler is never called.</p> <p>According to the documentation, the handler should first be called with "UNI...
[ { "answer_id": 379059, "author": "Joel", "author_id": 46852, "author_profile": "https://Stackoverflow.com/users/46852", "pm_score": 4, "selected": true, "text": "<p>What are you doing that you think should generate a WM_UNICHAR message?</p>\n\n<p>If your code (or the ATL code) ultimately...
2008/12/18
[ "https://Stackoverflow.com/questions/378296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9936/" ]
I have an ATL control that I want to be Unicode-aware. I added a message handler for WM\_UNICHAR: ``` MESSAGE_HANDLER( WM_UNICHAR, OnUniChar ) ``` But, for some reason, the OnUniChar handler is never called. According to the documentation, the handler should first be called with "UNICODE\_NOCHAR", on which the hand...
What are you doing that you think should generate a WM\_UNICHAR message? If your code (or the ATL code) ultimately calls CreateWindowW, then your window is already Unicode aware, and WM\_CHAR messages will be UTF-16 format. The documentation is far from clear on when, exactly, a WM\_UNICHAR message gets generated, bu...
378,299
<p>I'm working in two different Oracle schemas on two different instances of Oracle. I've defined several types and type collections to transfer data between these schemas. The problem I'm running into is that even though the type have exactly the same definitions (same scripts used to create both sets in the schemas...
[ { "answer_id": 379246, "author": "kurosch", "author_id": 30153, "author_profile": "https://Stackoverflow.com/users/30153", "pm_score": 1, "selected": false, "text": "<p>I think the underlying issue is that Oracle doesn't know how to automatically serialize/deserialize your custom type ov...
2008/12/18
[ "https://Stackoverflow.com/questions/378299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24179/" ]
I'm working in two different Oracle schemas on two different instances of Oracle. I've defined several types and type collections to transfer data between these schemas. The problem I'm running into is that even though the type have exactly the same definitions (same scripts used to create both sets in the schemas) Ora...
I have read the Oracle Documentation and it is not very difficult. You need to add an OID to your type definitions in both databases. You can use a GUID as OID. ``` SELECT SYS_OP_GUID() FROM DUAL; SYS_OP_GUID() -------------------------------- AE34B912631948F0B274D778A29F6C8C ``` Now create your UDT in both da...
378,303
<p>I want to get a list of all Django auth user with a specific permission group, something like this:</p> <pre><code>user_dict = { 'queryset': User.objects.filter(permisson='blogger') } </code></pre> <p>I cannot find out how to do this. How are the permissions groups saved in the user model?</p>
[ { "answer_id": 378837, "author": "Daniel Naab", "author_id": 32638, "author_profile": "https://Stackoverflow.com/users/32638", "pm_score": 6, "selected": false, "text": "<p>This would be the easiest </p>\n\n<pre><code>from django.contrib.auth import models\n\ngroup = models.Group.objects...
2008/12/18
[ "https://Stackoverflow.com/questions/378303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42546/" ]
I want to get a list of all Django auth user with a specific permission group, something like this: ``` user_dict = { 'queryset': User.objects.filter(permisson='blogger') } ``` I cannot find out how to do this. How are the permissions groups saved in the user model?
If you want to get list of users by permission, look at this variant: ``` from django.contrib.auth.models import User, Permission from django.db.models import Q perm = Permission.objects.get(codename='blogger') users = User.objects.filter(Q(groups__permissions=perm) | Q(user_permissions=perm)).distinct() ```
378,330
<p>In my C# winforms app, I have a datagrid. When the datagrid reloads, I want to set the scrollbar back to where the user had it set. How can I do this?</p> <p>EDIT: I'm using the old winforms DataGrid control, not the newer DataGridView</p>
[ { "answer_id": 378523, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 6, "selected": true, "text": "<p>You don't actually interact directly with the scrollbar, rather you set the <code>FirstDisplayedScrollingRowIndex</code>. ...
2008/12/18
[ "https://Stackoverflow.com/questions/378330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3047/" ]
In my C# winforms app, I have a datagrid. When the datagrid reloads, I want to set the scrollbar back to where the user had it set. How can I do this? EDIT: I'm using the old winforms DataGrid control, not the newer DataGridView
You don't actually interact directly with the scrollbar, rather you set the `FirstDisplayedScrollingRowIndex`. So before it reloads, capture that index, once it's reloaded, reset it to that index. **EDIT:** Good point in the comment. If you're using a `DataGridView` then this will work. If you're using the old `DataGr...
378,338
<p>I want to exceute a simple command which works from the shell but doesn't work from Java. This is the command I want to execute, which works fine:</p> <pre><code>soffice -headless "-accept=socket,host=localhost,port=8100;urp;" </code></pre> <p>This is the code I am excecuting from Java trying to run this command:...
[ { "answer_id": 378448, "author": "Juan Manuel", "author_id": 47033, "author_profile": "https://Stackoverflow.com/users/47033", "pm_score": 2, "selected": false, "text": "<p>I'm not sure if I'm not mistaken, but as far as I see you're generating the commands but never passing them to the ...
2008/12/18
[ "https://Stackoverflow.com/questions/378338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37298/" ]
I want to exceute a simple command which works from the shell but doesn't work from Java. This is the command I want to execute, which works fine: ``` soffice -headless "-accept=socket,host=localhost,port=8100;urp;" ``` This is the code I am excecuting from Java trying to run this command: ``` String[] commands = ...
I would like to say how I solved this. I created a sh script that basically run the command of soffice for me. Then from Java I just run the script, and it works fine, like this: ``` public void startSOfficeService() throws InterruptedException, IOException { //First we need to check if the soffice process i...
378,346
<p>I'm not a Notes programmer, however, for my sins, have been working on some Notes features for an in-house project recently. I need to enable/disable editing of a field depending on circumstances. It seems to me to be a fairly standard feature, I need, but I can't find any information on how to do this anywhere.</p>...
[ { "answer_id": 378448, "author": "Juan Manuel", "author_id": 47033, "author_profile": "https://Stackoverflow.com/users/47033", "pm_score": 2, "selected": false, "text": "<p>I'm not sure if I'm not mistaken, but as far as I see you're generating the commands but never passing them to the ...
2008/12/18
[ "https://Stackoverflow.com/questions/378346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18744/" ]
I'm not a Notes programmer, however, for my sins, have been working on some Notes features for an in-house project recently. I need to enable/disable editing of a field depending on circumstances. It seems to me to be a fairly standard feature, I need, but I can't find any information on how to do this anywhere. In fo...
I would like to say how I solved this. I created a sh script that basically run the command of soffice for me. Then from Java I just run the script, and it works fine, like this: ``` public void startSOfficeService() throws InterruptedException, IOException { //First we need to check if the soffice process i...
378,365
<p>I want find the index of a given DOM node. It's like the inverse of doing </p> <pre><code>document.getElementById('id_of_element').childNodes[K] </code></pre> <p>I want to instead extract the value of <code>K</code> given that I already have the reference to the child node and the parent node. How do I do this? </...
[ { "answer_id": 378386, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 0, "selected": false, "text": "<p>I think the only way to do this is to loop through the parent's children until you find yourself.</p>\n\n<pre><code>var K ...
2008/12/18
[ "https://Stackoverflow.com/questions/378365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I want find the index of a given DOM node. It's like the inverse of doing ``` document.getElementById('id_of_element').childNodes[K] ``` I want to instead extract the value of `K` given that I already have the reference to the child node and the parent node. How do I do this?
The shortest possible way, without any frameworks, in all versions of Safari, FireFox, Chrome and IE >= 9: `var i = Array.prototype.indexOf.call(e.childNodes, someChildEl);`
378,376
<p>I'm currently using the default cookies as my single sign on (SSO) but some users are getting strange errors after I push an update. I'm considering moving to active record to store sessions but was wondering how I tell rails that the sessions are in another database?</p> <p>So if I store sessions via AR in App1DB ...
[ { "answer_id": 378470, "author": "AJ.", "author_id": 46890, "author_profile": "https://Stackoverflow.com/users/46890", "pm_score": 0, "selected": false, "text": "<p>The rails docs for the session configuration(<a href=\"http://api.rubyonrails.org/classes/ActionController/SessionManagemen...
2008/12/18
[ "https://Stackoverflow.com/questions/378376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9826/" ]
I'm currently using the default cookies as my single sign on (SSO) but some users are getting strange errors after I push an update. I'm considering moving to active record to store sessions but was wondering how I tell rails that the sessions are in another database? So if I store sessions via AR in App1DB how can al...
Rails most certainly **does** support database session storage. In config/environment.rb, uncomment ``` # config.action_controller.session_store = :active_record_store ``` Examining \actionpack-2.2.2\lib\action\_controller\session\active\_record\_store.rb shows that CGI::Session::ActiveRecordStore::Session inherits...
378,380
<p>I have a Windows application written in C++ that occasionally evaporates. I use the word evaporate because there is nothing left behind: no "we're sorry" message from Windows, no crash dump from the Dr. Watson facility...</p> <p>On the one occasion the crash occurred under the debugger, the debugger did not break-...
[ { "answer_id": 378399, "author": "chills42", "author_id": 23855, "author_profile": "https://Stackoverflow.com/users/23855", "pm_score": 4, "selected": true, "text": "<p>You could try using the adplus utility in the <a href=\"http://www.microsoft.com/whdc/devtools/debugging/default.mspx\"...
2008/12/18
[ "https://Stackoverflow.com/questions/378380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4841/" ]
I have a Windows application written in C++ that occasionally evaporates. I use the word evaporate because there is nothing left behind: no "we're sorry" message from Windows, no crash dump from the Dr. Watson facility... On the one occasion the crash occurred under the debugger, the debugger did not break---it showed...
You could try using the adplus utility in the [windows debugging tool package](http://www.microsoft.com/whdc/devtools/debugging/default.mspx). ``` adplus -crash -p yourprocessid ``` The auto dump tool provides mini dumps for exceptions and a full dump if the application crashes.
378,415
<p>I have a string <code>User name (sales)</code> and I want to extract the text between the brackets, how would I do this? </p> <p>I suspect sub-string but I can't work out how to read until the closing bracket, the length of text will vary.</p>
[ { "answer_id": 378433, "author": "chills42", "author_id": 23855, "author_profile": "https://Stackoverflow.com/users/23855", "pm_score": 4, "selected": false, "text": "<p>A regex maybe? I think this would work...</p>\n\n<pre><code>\\(([a-z]+?)\\)\n</code></pre>\n" }, { "answer_id"...
2008/12/18
[ "https://Stackoverflow.com/questions/378415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a string `User name (sales)` and I want to extract the text between the brackets, how would I do this? I suspect sub-string but I can't work out how to read until the closing bracket, the length of text will vary.
A very simple way to do it is by using regular expressions: ``` Regex.Match("User name (sales)", @"\(([^)]*)\)").Groups[1].Value ``` --- As a response to the (very funny) comment, here's the same Regex with some explanation: ``` \( # Escaped parenthesis, means "starts with a '(' character" ( ...
378,428
<pre><code>$c = $record['corrects']; $i = $record['incorrects']; if($c == 0 &amp;&amp; $i == 0) { $image = imagecreatetruecolor(200,80); $white = imagecolorallocate($image,255,255,255); $red = imagecolorallocate($image,255,0,0); imagefilledrectangle($image,0,0,199,79,$white); $text = 'Quiz cance...
[ { "answer_id": 378443, "author": "Ben", "author_id": 11522, "author_profile": "https://Stackoverflow.com/users/11522", "pm_score": 1, "selected": false, "text": "<p>I tried it, and it works. It produced a piece of red text, saying \"Quiz canceled!\".</p>\n\n<p>Maybe you should check whet...
2008/12/18
[ "https://Stackoverflow.com/questions/378428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47468/" ]
``` $c = $record['corrects']; $i = $record['incorrects']; if($c == 0 && $i == 0) { $image = imagecreatetruecolor(200,80); $white = imagecolorallocate($image,255,255,255); $red = imagecolorallocate($image,255,0,0); imagefilledrectangle($image,0,0,199,79,$white); $text = 'Quiz cancelled!'; $b...
Comment out the imagepng() and header() calls and view the output in your browser to see if any errors are being generated
378,449
<p>I want to use RSpec mocks to provide canned input to a block.</p> <p>Ruby:</p> <pre><code>class Parser attr_accessor :extracted def parse(fname) File.open(fname).each do |line| extracted = line if line =~ /^RCS file: (.*),v$/ end end end </code></pre> <p>RSpec:</p> <pre><code>describe Parser...
[ { "answer_id": 378605, "author": "James Mead", "author_id": 2025138, "author_profile": "https://Stackoverflow.com/users/2025138", "pm_score": 3, "selected": true, "text": "<p>I don't have a computer with Ruby &amp; RSpec available to check this, but I suspect you need to add a call to <c...
2008/12/18
[ "https://Stackoverflow.com/questions/378449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11414/" ]
I want to use RSpec mocks to provide canned input to a block. Ruby: ``` class Parser attr_accessor :extracted def parse(fname) File.open(fname).each do |line| extracted = line if line =~ /^RCS file: (.*),v$/ end end end ``` RSpec: ``` describe Parser before do @parser = Parser.new @l...
I don't have a computer with Ruby & RSpec available to check this, but I suspect you need to add a call to `and_yields` call [1] on the end of the `should_receive(:each)`. However, you might find it simpler not to use mocks in this case e.g. you could return a `StringIO` instance containing `linetext` from the `File.op...
378,456
<p>Is there a javascript function to swap a still image(jpg) to a movie(swf)? If there is is there a disjointed swap image path?</p>
[ { "answer_id": 378521, "author": "Jack", "author_id": 24998, "author_profile": "https://Stackoverflow.com/users/24998", "pm_score": 2, "selected": false, "text": "<p>You could do something like this:</p>\n\n<pre><code>&lt;div id=\"still_image\" style=\"display:block\"&gt;\n &lt;!-- im...
2008/12/18
[ "https://Stackoverflow.com/questions/378456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is there a javascript function to swap a still image(jpg) to a movie(swf)? If there is is there a disjointed swap image path?
You could do something like this: ``` <div id="still_image" style="display:block"> <!-- img code here --> </div> <div id="ani_swf" style="display:none"> <!-- embedded swf here --> </div> <input type="button" value="Swap" onclick="imgToSWF();" /> <script type="text/javascript"> function imgToSWF() { doc...
378,465
<p>I just recently noticed <code>Dictionary.TryGetValue(TKey key, out TValue value)</code> and was curious as to which is the better approach to retrieving a value from the Dictionary.</p> <p>I've traditionally done:</p> <pre><code>if (myDict.Contains(someKey)) someVal = myDict[someKey]; ... </code></pre> ...
[ { "answer_id": 378477, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 7, "selected": true, "text": "<p>TryGetValue is slightly faster, because FindEntry will only be called once. </p>\n\n<blockquote>\n <p>How much faster? It...
2008/12/18
[ "https://Stackoverflow.com/questions/378465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8945/" ]
I just recently noticed `Dictionary.TryGetValue(TKey key, out TValue value)` and was curious as to which is the better approach to retrieving a value from the Dictionary. I've traditionally done: ``` if (myDict.Contains(someKey)) someVal = myDict[someKey]; ... ``` unless I know it *has* to be in there. I...
TryGetValue is slightly faster, because FindEntry will only be called once. > > How much faster? It depends on the > dataset at hand. When you call the > Contains method, Dictionary does an > internal search to find its index. If > it returns true, you need another > index search to get the actual value. > Whe...
378,485
<p>I have the follow Linq query ... which executes correctly:</p> <pre><code>from t in Tasks where LookupTaskStarted(t.TaskId) == true select new { t.TaskId, t.Number, Started = LookupTaskStarted(t.TaskId) } </code></pre> <p>Is there anyway to create this as a property on the Linq-To-Sql class? Or do ...
[ { "answer_id": 378505, "author": "Perpetualcoder", "author_id": 37494, "author_profile": "https://Stackoverflow.com/users/37494", "pm_score": 0, "selected": false, "text": "<p>All linq-sql classes are created as partial. You could extend and add this property. </p>\n" }, { "answe...
2008/12/18
[ "https://Stackoverflow.com/questions/378485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
I have the follow Linq query ... which executes correctly: ``` from t in Tasks where LookupTaskStarted(t.TaskId) == true select new { t.TaskId, t.Number, Started = LookupTaskStarted(t.TaskId) } ``` Is there anyway to create this as a property on the Linq-To-Sql class? Or do I always have to reference ...
I don't have the answer to your question, but I have a refactoring suggestion. Instead of calling LookupTaskStarted() twice, you can record the value with a `let` clause: ``` from t in Tasks let started = LookupTaskStarted(t.TaskId) where started select new { T.TaskId, t.Number, Started = started } ``` A...
378,490
<p>I'm running on win2003 server, PHP 526, via the cmd-line.</p> <p>I have a cmdline string:</p> <pre><code>$cmd = ' "d:\Prog Files\foo.exe" -p "d:\data path\datadir" '; </code></pre> <p>Trying to do this in php code</p> <pre><code>$out = `$cmd`; # note use of backticks AKA shell_exec </code></pre> <p>re...
[ { "answer_id": 378610, "author": "Ciaran McNulty", "author_id": 34024, "author_profile": "https://Stackoverflow.com/users/34024", "pm_score": 4, "selected": true, "text": "<p>Use escapeshellarg() to escape your arguments, it should escape it with an appropriate combination of quotation m...
2008/12/18
[ "https://Stackoverflow.com/questions/378490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23598/" ]
I'm running on win2003 server, PHP 526, via the cmd-line. I have a cmdline string: ``` $cmd = ' "d:\Prog Files\foo.exe" -p "d:\data path\datadir" '; ``` Trying to do this in php code ``` $out = `$cmd`; # note use of backticks AKA shell_exec ``` results in a failure by foo.exe as it interprets the -p ar...
Use escapeshellarg() to escape your arguments, it should escape it with an appropriate combination of quotation marks and escaped spaces for your platform (I'm guessing you're on Windows).
378,493
<p>I wanted to create my own Python exception class, like this:</p> <pre><code>class MyException(BaseException): def __init__(self, errno, address): if errno == 10048: mess = str(address) + ' is already in use' else: mess = 'Unable to open ' + str(address) BaseExcept...
[ { "answer_id": 378514, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "<p>You have to call the method of the base class with the instance as the first argument:</p>\n\n<pre><code>BaseException.__ini...
2008/12/18
[ "https://Stackoverflow.com/questions/378493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11677/" ]
I wanted to create my own Python exception class, like this: ``` class MyException(BaseException): def __init__(self, errno, address): if errno == 10048: mess = str(address) + ' is already in use' else: mess = 'Unable to open ' + str(address) BaseException.__init__(m...
You have to call the method of the base class with the instance as the first argument: ``` BaseException.__init__(self, mess) ``` To quote from the [tutorial](http://docs.python.org/tutorial/classes.html#inheritance): > > An overriding method in a derived class may in fact want to extend rather than simply replace...
378,498
<p><a href="http://msdn.microsoft.com/en-us/netframework/aa569603.aspx" rel="nofollow noreferrer">BCL</a></p> <p>Specifically, am I breaking the EULA by doing this? </p>
[ { "answer_id": 378506, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 2, "selected": false, "text": "<p>Yes absolutely you can. You can also <a href=\"http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-so...
2008/12/18
[ "https://Stackoverflow.com/questions/378498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4435/" ]
[BCL](http://msdn.microsoft.com/en-us/netframework/aa569603.aspx) Specifically, am I breaking the EULA by doing this?
Why bother using reflector? [Just look at the original source code](http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx)! After more research, I found that the .NET Framework falls under the same EULA as the operating system on which it is installed, with a couple of ...
378,524
<p>I'm trying to create a Regex usuable in C# that will allow me to take a list of single letters and/or letter groups and ensure that a word is only comprised of items from that list. For instance:</p> <ul> <li>'a' would match 'a', 'aa', 'aaa', but not 'ab'</li> <li>'a b' would match 'a', 'ab', 'abba', 'b', but not '...
[ { "answer_id": 378582, "author": "Diadistis", "author_id": 47401, "author_profile": "https://Stackoverflow.com/users/47401", "pm_score": 3, "selected": true, "text": "<p>I am not quite sure what are you trying to do but in order for the last one to be false you should check if the string...
2008/12/18
[ "https://Stackoverflow.com/questions/378524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9913/" ]
I'm trying to create a Regex usuable in C# that will allow me to take a list of single letters and/or letter groups and ensure that a word is only comprised of items from that list. For instance: * 'a' would match 'a', 'aa', 'aaa', but not 'ab' * 'a b' would match 'a', 'ab', 'abba', 'b', but not 'abc' * 'a b abc' woul...
I am not quite sure what are you trying to do but in order for the last one to be false you should check if the string can be matched entirely : ``` Regex regex = new Regex(@"\A(?:(a|b|abc)*)\Z"); ```
378,528
<p>Exporting from c#.net I am getting a problem I have a form that when I export to excel as a result in excel Any ideas why is this happening I am including the ASP code below.</p> <pre><code>&lt;%@ Page Language="C#" MasterPageFile="~/masterpages/Admin.master" AutoEventWireup="true" CodeFile="members-search-adv.asp...
[ { "answer_id": 378666, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "<p>That's not the sequence at all- it's just not how asp.net and the web work. </p>\n\n<p>You don't fill the grid dur...
2008/12/18
[ "https://Stackoverflow.com/questions/378528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Exporting from c#.net I am getting a problem I have a form that when I export to excel as a result in excel Any ideas why is this happening I am including the ASP code below. ``` <%@ Page Language="C#" MasterPageFile="~/masterpages/Admin.master" AutoEventWireup="true" CodeFile="members-search-adv.aspx.cs" Inherits="ma...
That's not the sequence at all- it's just not how asp.net and the web work. You don't fill the grid during the load phase: you retrieve the data and set it as the datasource for the table, but the grid (actually a repeater) isn't filled yet. That doesn't happen until the databinding phase. After the databinding phase...
378,534
<p>How can I make a Property "ReadOnly" outside the Assembly (DLL) for people using the DLL but still be able to populate that property from within the assembly for them to read?</p> <p>For example, if I have a <strong>Transaction</strong> object that needs to populate a property in a <strong>Document</strong> object ...
[ { "answer_id": 378543, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 3, "selected": false, "text": "<p>If you're using C# you can have different access modifiers on the <code>get</code> and <code>set</code>, e.g. the fo...
2008/12/18
[ "https://Stackoverflow.com/questions/378534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47167/" ]
How can I make a Property "ReadOnly" outside the Assembly (DLL) for people using the DLL but still be able to populate that property from within the assembly for them to read? For example, if I have a **Transaction** object that needs to populate a property in a **Document** object (which is a child class of the **Tra...
C# ``` public object MyProp { get { return val; } internal set { val = value; } } ``` VB ``` Public Property MyProp As Object Get Return StoredVal End Get Friend Set(ByVal value As Object) StoredVal = value End Set End Property ```
378,536
<p>What I want to do is drawing a (large) terrain with OpenGL. So I have a set of vertices, lets say 256 x 256 which I store in a vertex buffer object in the VRAM. I properly triangulated them, so I've got an index buffer for the faces.</p> <pre><code>// vertexes glBindBufferARB(GL_ARRAY_BUFFER_ARB, vertexBufferId); g...
[ { "answer_id": 379514, "author": "Maurice Gilden", "author_id": 7866, "author_profile": "https://Stackoverflow.com/users/7866", "pm_score": 3, "selected": true, "text": "<p>If your texture should repeat (or mirror) itself in each quad the best way would be to use texture coordinates that...
2008/12/18
[ "https://Stackoverflow.com/questions/378536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12463/" ]
What I want to do is drawing a (large) terrain with OpenGL. So I have a set of vertices, lets say 256 x 256 which I store in a vertex buffer object in the VRAM. I properly triangulated them, so I've got an index buffer for the faces. ``` // vertexes glBindBufferARB(GL_ARRAY_BUFFER_ARB, vertexBufferId); glVertexPointer...
If your texture should repeat (or mirror) itself in each quad the best way would be to use texture coordinates that match the number of the (x, y) position in your array. E.g. for the first line of vertices use these texture coordinates: (0.0, 0.0), (1.0, 0.0), (2.0, 0.0)...(255.0, 0.0).
378,548
<p>How can you join between a table with a sparse number of dates and another table with an exhaustive number of dates such that the gaps between the sparse dates take the values of the previous sparse date?</p> <p>Illustrative example:</p> <pre><code>PRICE table (sparse dates): date itemid price 2008-12-04 ...
[ { "answer_id": 378572, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "<pre><code>SELECT v.date, p.price, v.volume\nFROM volume v\nLEFT JOIN Price p ON p.itemID=v.itemID\n AND p.[date] =...
2008/12/18
[ "https://Stackoverflow.com/questions/378548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41613/" ]
How can you join between a table with a sparse number of dates and another table with an exhaustive number of dates such that the gaps between the sparse dates take the values of the previous sparse date? Illustrative example: ``` PRICE table (sparse dates): date itemid price 2008-12-04 1 $1 2008-12-11...
This isn't as simple as a single LEFT OUTER JOIN to the sparse table, because you want the NULLs left by the outer join to be filled with the most recent price. ``` EXPLAIN SELECT v.`date`, v.volume_amt, p1.item_id, p1.price FROM Volume v JOIN Price p1 ON (v.`date` >= p1.`date` AND v.item_id = p1.item_id) LEFT OUTER...
378,556
<p>I'm having trouble getting this code to show up correctly in WebKit browsers(chrome/safari). It looks fine in IE6, IE7, and FireFox. </p> <pre><code>&lt;table width="100%"&gt; &lt;tr&gt; &lt;td rowspan="2" style="vertical-align:middle;"&gt; &lt;a href="http://http://{$smarty.const.DOMAIN}/co...
[ { "answer_id": 413408, "author": "Ross", "author_id": 2025, "author_profile": "https://Stackoverflow.com/users/2025", "pm_score": 0, "selected": false, "text": "<p>I could help more with a live example to test on but you could try adding this to your <code>tr</code> tags.</p>\n\n<pre><co...
2008/12/18
[ "https://Stackoverflow.com/questions/378556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13778/" ]
I'm having trouble getting this code to show up correctly in WebKit browsers(chrome/safari). It looks fine in IE6, IE7, and FireFox. ``` <table width="100%"> <tr> <td rowspan="2" style="vertical-align:middle;"> <a href="http://http://{$smarty.const.DOMAIN}/company/a_cherry_on_top/line/gift_car...
I have a few recommendations for you but I can't answer your question completely because WebKit seems to render your source fine when I try it. 1. First, maybe you can change `width="100%"` to `style="width:100%;"` Perhaps combined with the other markup, it's putting the browser in quirks mode. 2. Second, make sure yo...
378,559
<p>I restored my development database from production, and the stored procedures I need in my development environment doesn't exist in my production database. Is there a command Ii can use to import the developmetn stored procedures back into SQL Server. There are about 88 files, as each procedure is in a different t...
[ { "answer_id": 378570, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 5, "selected": true, "text": "<p>Oops, you did the painful way of generating scripts. You should have created a single script for all procedures by right cli...
2008/12/18
[ "https://Stackoverflow.com/questions/378559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36269/" ]
I restored my development database from production, and the stored procedures I need in my development environment doesn't exist in my production database. Is there a command Ii can use to import the developmetn stored procedures back into SQL Server. There are about 88 files, as each procedure is in a different text f...
Oops, you did the painful way of generating scripts. You should have created a single script for all procedures by right clicking on the database in SSMS, choosing Tasks -> Generate Scripts. However, if you don't want to go through that process again, open up a cmd shell in the folder and remember those old batch file...
378,574
<p>I'm using this to check for the availability of a URL:</p> <pre><code>$fp = fsockopen($url, 443, $errno, $errstr); </code></pre> <p>and I get this error back...</p> <p><strong>Warning: fsockopen() [function.fsockopen]: unable to connect to <a href="https://example.com/soapserver.php:443" rel="noreferrer">https://...
[ { "answer_id": 378586, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 5, "selected": false, "text": "<p>You should be using just the hostname, not the URL in the fsockopen call. You'll need to provide the uri, minus the...
2008/12/18
[ "https://Stackoverflow.com/questions/378574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26107/" ]
I'm using this to check for the availability of a URL: ``` $fp = fsockopen($url, 443, $errno, $errstr); ``` and I get this error back... **Warning: fsockopen() [function.fsockopen]: unable to connect to <https://example.com/soapserver.php:443> (Unable to find the socket transport "https" - did you forget to enable ...
also for ssl you need to prefix the host with ssl://
378,583
<p>I have a simple function that I want to call in the code behind file name Move and I was trying to see how this can be done and Im not using asp image button because not trying to use asp server side controls since they tend not to work well with ASP.net MVC..the way it is set up now it will look for a javascript fu...
[ { "answer_id": 379017, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 0, "selected": false, "text": "<p>You cannot do postbacks or call anything in a view from JavaScript in an ASP.NET MVC application. Anything you want ...
2008/12/18
[ "https://Stackoverflow.com/questions/378583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39809/" ]
I have a simple function that I want to call in the code behind file name Move and I was trying to see how this can be done and Im not using asp image button because not trying to use asp server side controls since they tend not to work well with ASP.net MVC..the way it is set up now it will look for a javascript funct...
Scott Guthrie has a [very good example](http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx) on how to do this using routing rules. This would give you the ability to have the user navigate to a URL in the format /Search/[Query]/[PageNumber] like <http://site/Search/Hippopot...
378,596
<p>I wrote a google map lookup page. Everthing worked fine until I referenced the page to use a master page. I removed the form tag from the master page as the search button on the map page is a submit button. Everything else on my page appears but the google map div appears with map navigation controls and logo but no...
[ { "answer_id": 378667, "author": "Chris Brandsma", "author_id": 9443, "author_profile": "https://Stackoverflow.com/users/9443", "pm_score": 0, "selected": false, "text": "<p>One thing that can change when you add a master page is your elements ids.</p>\n\n<p>If the div you are displaying...
2008/12/18
[ "https://Stackoverflow.com/questions/378596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46064/" ]
I wrote a google map lookup page. Everthing worked fine until I referenced the page to use a master page. I removed the form tag from the master page as the search button on the map page is a submit button. Everything else on my page appears but the google map div appears with map navigation controls and logo but no ma...
Please view below Code and let me know its useful ... **MasterPage Code ( GMap.master page)** ``` < body onload="initialize()" onunload="GUnload()" > < form id="form1" runat="server" > < div > < asp:contentplaceholder id="ContentPlaceHolder1" runat="server" > < /asp:contentplaceholder > <...
378,608
<p>I have a set of data that models a hierarchy of categories. A root category contains a set of top-level categories. Each top-level category contains a set of sub-categories.</p> <p>Each sub category has a set of organizations. A given organization can appear in multiple sub categories. </p> <p>The leaf nodes of th...
[ { "answer_id": 378646, "author": "Tom H", "author_id": 5696608, "author_profile": "https://Stackoverflow.com/users/5696608", "pm_score": 3, "selected": true, "text": "<p>Assuming that your hierarchy is always exactly 3 levels deep:</p>\n\n<pre><code>SELECT DISTINCT\n O.organization_i...
2008/12/18
[ "https://Stackoverflow.com/questions/378608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3238/" ]
I have a set of data that models a hierarchy of categories. A root category contains a set of top-level categories. Each top-level category contains a set of sub-categories. Each sub category has a set of organizations. A given organization can appear in multiple sub categories. The leaf nodes of this hierarchy are ...
Assuming that your hierarchy is always exactly 3 levels deep: ``` SELECT DISTINCT O.organization_id, O.organization_name FROM Categories CAT INNER JOIN Categories SUB ON SUB.parent_id = CAT.category_id INNER JOIN Category_Organizations CO ON CO.category_id = SUB.category_id INNER JOIN Organiza...
378,616
<p>I have written a java annotation that looks like this:</p> <pre><code>@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) // can I further limit this to only fields of type DomainObject? public @interface Owns { } </code></pre> <p>After briefly looking around I couldn't see if there was a way to furthe...
[ { "answer_id": 378633, "author": "Nathaniel Flath", "author_id": 41241, "author_profile": "https://Stackoverflow.com/users/41241", "pm_score": 0, "selected": false, "text": "<p>I believe that this is not enforcable at compile-time - If you want to ensure that it is not on any inappropria...
2008/12/18
[ "https://Stackoverflow.com/questions/378616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8517/" ]
I have written a java annotation that looks like this: ``` @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) // can I further limit this to only fields of type DomainObject? public @interface Owns { } ``` After briefly looking around I couldn't see if there was a way to further limit the usage of this ...
You could emit an error in an [annotation processor](http://java.sun.com/javase/6/docs/api/javax/annotation/processing/Processor.html) (you'll have to use a [private API](http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html) if you want Java 5 support). You can use the [Messager](http://java.sun.com/javase...
378,620
<p>I have a RadioButtonList on my page that is populated via Data Binding</p> <pre><code>&lt;asp:RadioButtonList ID="rb" runat="server"&gt; &lt;/asp:RadioButtonList&gt; &lt;asp:Button Text="Submit" OnClick="submit" runat="server" /&gt; </code></pre> <p>How do I get the value of the radio button that the user selected...
[ { "answer_id": 378639, "author": "terjetyl", "author_id": 29519, "author_profile": "https://Stackoverflow.com/users/29519", "pm_score": 4, "selected": false, "text": "<p>Using your radio button's ID, try <code>rb.SelectedValue</code>.</p>\n" }, { "answer_id": 379229, "author"...
2008/12/18
[ "https://Stackoverflow.com/questions/378620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a RadioButtonList on my page that is populated via Data Binding ``` <asp:RadioButtonList ID="rb" runat="server"> </asp:RadioButtonList> <asp:Button Text="Submit" OnClick="submit" runat="server" /> ``` How do I get the value of the radio button that the user selected in my "submit" method?
The ASPX code will look something like this: ``` <asp:RadioButtonList ID="rblist1" runat="server"> <asp:ListItem Text ="Item1" Value="1" /> <asp:ListItem Text ="Item2" Value="2" /> <asp:ListItem Text ="Item3" Value="3" /> <asp:ListItem Text ="Item4" Value="4" /> </asp:RadioButtonList> <asp...
378,630
<p>I am writing a DLL with mixed C/C++ code. I want to specify the ordinals of the functions I'm exporting. So I created a .DEF file that looks like this</p> <pre><code>LIBRARY LEONMATH EXPORTS sca_alloc @1 vec_alloc @2 mat_alloc @3 sca_free @4 vec_free @5 mat_free @6 ......
[ { "answer_id": 378751, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 3, "selected": true, "text": "<p>Well, I don't have experience with ordinals (which look like some ugly, compiler-specific thing), but I can help you with...
2008/12/18
[ "https://Stackoverflow.com/questions/378630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46571/" ]
I am writing a DLL with mixed C/C++ code. I want to specify the ordinals of the functions I'm exporting. So I created a .DEF file that looks like this ``` LIBRARY LEONMATH EXPORTS sca_alloc @1 vec_alloc @2 mat_alloc @3 sca_free @4 vec_free @5 mat_free @6 ... ``` I would...
Well, I don't have experience with ordinals (which look like some ugly, compiler-specific thing), but I can help you with making C++/C code compatible. Suppose, in C++, that your header file looks like this: ``` class MyClass { void foo(int); int bar(int); double bar(double); void baz(MyClass); }; ``...
378,632
<p>I have the following html in my webpage (simplified).</p> <pre><code>&lt;button type="submit" name="action" value="ButtonA"&gt;Click Here&lt;/button&gt; </code></pre> <p>In Firefox, it submits "ButtonA" as the value for the "action" form value. However, in IE7, it submits "Click Here". Is there any way to resolv...
[ { "answer_id": 378642, "author": "Abram Simon", "author_id": 46204, "author_profile": "https://Stackoverflow.com/users/46204", "pm_score": 0, "selected": false, "text": "<p>I think you should be using an <code>&lt;input type=\"submit\" /&gt;</code> instead of <code>&lt;button&gt;</code>....
2008/12/18
[ "https://Stackoverflow.com/questions/378632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1862/" ]
I have the following html in my webpage (simplified). ``` <button type="submit" name="action" value="ButtonA">Click Here</button> ``` In Firefox, it submits "ButtonA" as the value for the "action" form value. However, in IE7, it submits "Click Here". Is there any way to resolve this? I don't want to use input tags, ...
One solution is to use Javascript and a hidden field ``` <input type="hidden" name="actionparam" value="DoNothing"> <input type="button" onclick="OnSubmitForm('ActionA')" Value="Click Here for A" /> <input type="button" onclick="OnSubmitForm('ActionB')" Value="Click Here for B" /> function OnSubmitForm(ac...
378,638
<p>If I have a <code>DropDownList</code> control that makes up part of a CompositeControl how can I expose the <code>SelectedIndexChanged</code> event to the consuming aspx page?</p> <p>Thanks</p>
[ { "answer_id": 378843, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 2, "selected": false, "text": "<p>Here's what you do. First declare an event like this:</p>\n\n<pre><code>public event EventHandler SelectedIndexChanged;\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39643/" ]
If I have a `DropDownList` control that makes up part of a CompositeControl how can I expose the `SelectedIndexChanged` event to the consuming aspx page? Thanks
There is a much simpler way that is a direct pass through. Try this: ``` public event EventHandler SelectedIndexChanged { add { this.TargetControl.SelectedIndexChanged += value; } remove { this.TargetControl.SelectedIndexChanged -= value; } } ``` [Edit] Unless of course you need to injec...
378,643
<p>The following event can possibly get called hundreds of times a frame.</p> <pre><code>public bool OnCollision(Body body1, Body body2) { if(body2.Tag is Dog) ((Dog)body2.Tag).Bark(); } </code></pre> <p>I understand that using "is" causes a cast to be made and then when i want to do something with it, cast it...
[ { "answer_id": 378657, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 5, "selected": true, "text": "<pre><code> if(body2.Tag is Dog)\n</code></pre>\n\n<p>is actually compiled as</p>\n\n<pre><code>Dog Temp = body2.Tag a...
2008/12/18
[ "https://Stackoverflow.com/questions/378643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47489/" ]
The following event can possibly get called hundreds of times a frame. ``` public bool OnCollision(Body body1, Body body2) { if(body2.Tag is Dog) ((Dog)body2.Tag).Bark(); } ``` I understand that using "is" causes a cast to be made and then when i want to do something with it, cast it a second time. Is there a...
``` if(body2.Tag is Dog) ``` is actually compiled as ``` Dog Temp = body2.Tag as Dog; if (temp != null) ``` In your code, you're then doing the cast again. Better would be: ``` Dog dog = body2.Tag as Dog; if (dog != null) { dog.Bark(); } ```
378,655
<p>I want to exclude a subdirectories by pattern in subversion because the development tool we are using is generating them. Getting the tool to generate the directories elsewhere is not an option. We don't want to edit the global-ignore property in ~/.subversion/config as it is difficult to maintain consistency with ...
[ { "answer_id": 378695, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": true, "text": "<blockquote>\n <p>Can be done using an svn:ignore on rootdir</p>\n</blockquote>\n\n<p>No. <code>svn:ignore</code> spe...
2008/12/18
[ "https://Stackoverflow.com/questions/378655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40800/" ]
I want to exclude a subdirectories by pattern in subversion because the development tool we are using is generating them. Getting the tool to generate the directories elsewhere is not an option. We don't want to edit the global-ignore property in ~/.subversion/config as it is difficult to maintain consistency with this...
> > Can be done using an svn:ignore on rootdir > > > No. `svn:ignore` specifically are *not* applied recursively but only on the current folder. Since each folder holds its own versioning information, nothing is propagated to subfolders. See [The Red Book, Chapter 7., Properties](http://svnbook.red-bean.com/en/1.1...
378,669
<p>I am looking for best practice in building multiple visual basic projects(all dll's).We have multiple projects, and our final deliverable will be a dll.Now, one project uses 2 other projects, and another refers to another project.Should projects reference the vbp files, or the dll? If they reference vbp files, how ...
[ { "answer_id": 378707, "author": "JoshBerke", "author_id": 26160, "author_profile": "https://Stackoverflow.com/users/26160", "pm_score": 1, "selected": false, "text": "<p>Unless you are specifically managing the type libraries externally from VB, you should use project references. If you...
2008/12/18
[ "https://Stackoverflow.com/questions/378669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9087/" ]
I am looking for best practice in building multiple visual basic projects(all dll's).We have multiple projects, and our final deliverable will be a dll.Now, one project uses 2 other projects, and another refers to another project.Should projects reference the vbp files, or the dll? If they reference vbp files, how to b...
After some years with VB6, our projects tended to be structured like this: All project source (project and source) organized under the source folder. ``` \project\source \project\source\project1\ \project\source\project2\ ... ``` All binaries (.dll and .exe) in one bin folder. ``` \project\bin\ ``` All .dll set ...
378,700
<p>Is it possible to add a "metadata"-like description or comments to a table in Microsoft SQL 2000 and above? </p> <p>How would you do this through the CREATE TABLE statement?</p> <p>Is it possible to add a description or comment to fields?</p> <p>How do you query this info back in MSSQL 2000? 2005?</p>
[ { "answer_id": 378705, "author": "keithwarren7", "author_id": 40714, "author_profile": "https://Stackoverflow.com/users/40714", "pm_score": 2, "selected": false, "text": "<p>Most tools and people use the Extended Properties for supporting this. The common name used by SSMS is MS_Descript...
2008/12/18
[ "https://Stackoverflow.com/questions/378700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
Is it possible to add a "metadata"-like description or comments to a table in Microsoft SQL 2000 and above? How would you do this through the CREATE TABLE statement? Is it possible to add a description or comment to fields? How do you query this info back in MSSQL 2000? 2005?
Use extended properties. For example to add an extended property to a table in the dbo schema you can use: ``` EXEC sys.sp_addextendedproperty @name=N'<NameOfProp>', @value=N'<Value>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'<Table>' ``` You can update them: ``` EXEC sys.sp_u...
378,704
<p>It sounds wonky, but this is what I'm trying to do with javascript (this is all triggered by an event handler):</p> <ol> <li>Save the contents of a page (preferably the whole document or at least documentElement object) into a variable.</li> <li>Create an iframe and insert it into the body.</li> <li>Replace the doc...
[ { "answer_id": 378739, "author": "RekrowYnapmoc", "author_id": 28871, "author_profile": "https://Stackoverflow.com/users/28871", "pm_score": 1, "selected": false, "text": "<p>In regards to the last method, perhaps the DOM of the window you are copying FROM has not loaded yet?</p>\n\n<p>A...
2008/12/18
[ "https://Stackoverflow.com/questions/378704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3625/" ]
It sounds wonky, but this is what I'm trying to do with javascript (this is all triggered by an event handler): 1. Save the contents of a page (preferably the whole document or at least documentElement object) into a variable. 2. Create an iframe and insert it into the body. 3. Replace the document of the iframe with ...
In regards to the last method, perhaps the DOM of the window you are copying FROM has not loaded yet? As for the Doctype, you could rebuild it from scratch and insert it before the html node using a document.write. The doctype is accessible through document.doctype , but this only has a getter.
378,716
<p>I've been building a database input form. There are three fields for notes. They were all build at the same time. They have the same logic &amp; class system - but one of them is returning with escape marks when I update the record, e.g. I enter</p> <pre><code>1 2 3 </code></pre> <p>and the updated record returns ...
[ { "answer_id": 378728, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 0, "selected": false, "text": "<p>As it is, your question lacks a lot of crucial information. Obviously, if everything is done identically, the data...
2008/12/18
[ "https://Stackoverflow.com/questions/378716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I've been building a database input form. There are three fields for notes. They were all build at the same time. They have the same logic & class system - but one of them is returning with escape marks when I update the record, e.g. I enter ``` 1 2 3 ``` and the updated record returns ``` 1\r\n2\r\n3 ``` I'm co...
As Konrad suggested your question lacks clarity. Are they both on the same page? If not, do both pages have the same `DOCTYPE`? The simplest solution to this is to handle it regardless, `addslashes` (or `mysql_real_escape_string`) for `INSERT`s and `UPDATE`s and `stripslashes` for `SELECT`s. The other scenario you ha...
378,737
<p>I'm cloning a TClientDataSet and I want to copy all the fields to the clone (which is a new DataSet), I know I can loop through the Fields and copy the info, or make 2 instances of my class and just clone the cursor, but is there some better way? Something like create a new DataSet and assign the fields info?</p> <...
[ { "answer_id": 379020, "author": "Jim McKeeth", "author_id": 255, "author_profile": "https://Stackoverflow.com/users/255", "pm_score": 1, "selected": false, "text": "<p>Would CloneCursor work for you?</p>\n" }, { "answer_id": 379047, "author": "Jim McKeeth", "author_id": ...
2008/12/18
[ "https://Stackoverflow.com/questions/378737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727/" ]
I'm cloning a TClientDataSet and I want to copy all the fields to the clone (which is a new DataSet), I know I can loop through the Fields and copy the info, or make 2 instances of my class and just clone the cursor, but is there some better way? Something like create a new DataSet and assign the fields info? **EDIT:*...
Are you looking for a more aesthetic way of doing it or a faster way of doing it? If the former, create your own classes that hide the loop. If the latter, don't even worry about it. A very wise coder once said to me: disk access costs; network access costs; maybe screen access costs; everything else is free. Don't ...
378,741
<p>I'm new to Castle Windsor and am confused about the order in the config file. This is taken from the GettingStarted1 sample. The HttpServiceWatcher class takes an IFailureNotifier implementor in it's constructor. However, no matter how I order the two components that implement this interface -- AlarmFailureNotifi...
[ { "answer_id": 378798, "author": "gcores", "author_id": 40256, "author_profile": "https://Stackoverflow.com/users/40256", "pm_score": 0, "selected": false, "text": "<p>I don't know which version you're using, but I believe this was a bug some time ago and it has been corrected in the bui...
2008/12/18
[ "https://Stackoverflow.com/questions/378741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7961/" ]
I'm new to Castle Windsor and am confused about the order in the config file. This is taken from the GettingStarted1 sample. The HttpServiceWatcher class takes an IFailureNotifier implementor in it's constructor. However, no matter how I order the two components that implement this interface -- AlarmFailureNotifier and...
This was resolved with Castle 2.0 (that went RTM early last year). The latest version of Castle is 2.1.1: <http://sourceforge.net/projects/castleproject/files/InversionOfControl/2.1/Castle-Windsor-2.1.1.zip/download> Castle's releases are always a bit tricky to find (they need to update their site). I always refer ...
378,752
<p>Is there any way to map to a network drive by using a stored procedure? I have tried: </p> <pre><code>xp_cmdshell 'net use Q: [shared_network_drive] [pwd] /user:[username]' </code></pre> <p>but I got an error saying something like </p> <pre><code>'System error 1312 has occurred.' 'A specified logon session does n...
[ { "answer_id": 378908, "author": "Tom H", "author_id": 5696608, "author_profile": "https://Stackoverflow.com/users/5696608", "pm_score": 1, "selected": false, "text": "<p>Do you have a proxy account set up for xp_cmdshell? If you are not a member of sysadmin, it requires a proxy account....
2008/12/18
[ "https://Stackoverflow.com/questions/378752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62776/" ]
Is there any way to map to a network drive by using a stored procedure? I have tried: ``` xp_cmdshell 'net use Q: [shared_network_drive] [pwd] /user:[username]' ``` but I got an error saying something like ``` 'System error 1312 has occurred.' 'A specified logon session does not exist. It may already have been te...
In an other forum someone [posted a tip](http://www.msfn.org/board/topic/54894-info-net-use-command-returns-system-error-1312/) about how to solve the `System error 1312 has occurred.` problem by specifying the username including its domain like this: ``` net use Q: \\[host]\[folder] [pwd] /user:[host]\[username] ```...
378,768
<p>This morning, I tried to commit a revision to Subversion and found that all of a sudden I did not have permission to do so.</p> <pre>Can't move '/svn/db/txn-protorevs/21000-ga9.rev' to '/svn/db/revs/21/21001': Permission Denied</pre> <p>Looking at the revs directory, I noticed that somebody had committed the 21000...
[ { "answer_id": 378776, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": true, "text": "<p>If you have more than one developer accessing the repository through the <code>file://</code> protocol, you may want to...
2008/12/18
[ "https://Stackoverflow.com/questions/378768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3434/" ]
This morning, I tried to commit a revision to Subversion and found that all of a sudden I did not have permission to do so. ``` Can't move '/svn/db/txn-protorevs/21000-ga9.rev' to '/svn/db/revs/21/21001': Permission Denied ``` Looking at the revs directory, I noticed that somebody had committed the 21000th revision, ...
If you have more than one developer accessing the repository through the `file://` protocol, you may want to look into setting up a Subversion server (using `svnserve` or Apache). With that solution, the server itself is responsible for all access and permissions on the repository files, and you won't run into this pro...