question_id int64 4 6.31M | answer_id int64 7 6.31M | title stringlengths 9 150 | question_body stringlengths 0 28.8k | answer_body stringlengths 60 27.2k | question_text stringlengths 40 28.9k | combined_text stringlengths 124 39.6k | tags listlengths 1 6 | question_score int64 0 26.3k | answer_score int64 0 28.8k | view_count int64 15 14M | answer_count int64 0 182 | favorite_count int64 0 32 | question_creation_date stringdate 2008-07-31 21:42:52 2011-06-10 18:12:18 | answer_creation_date stringdate 2008-07-31 22:17:57 2011-06-10 18:14:17 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
129,144 | 129,177 | Generic Exception Handling in Python the "Right Way" | Sometimes I find myself in the situation where I want to execute several sequential commands like such: try: foo(a, b) except Exception, e: baz(e) try: bar(c, d) except Exception, e: baz(e)... This same pattern occurs when exceptions simply need to be ignored. This feels redundant and the excessive syntax causes it to ... | You could use the with statement if you have python 2.5 or above: from __future__ import with_statement import contextlib
@contextlib.contextmanager def handler(): try: yield except Exception, e: baz(e) Your example now becomes: with handler(): foo(a, b) with handler(): bar(c, d) | Generic Exception Handling in Python the "Right Way" Sometimes I find myself in the situation where I want to execute several sequential commands like such: try: foo(a, b) except Exception, e: baz(e) try: bar(c, d) except Exception, e: baz(e)... This same pattern occurs when exceptions simply need to be ignored. This f... | TITLE:
Generic Exception Handling in Python the "Right Way"
QUESTION:
Sometimes I find myself in the situation where I want to execute several sequential commands like such: try: foo(a, b) except Exception, e: baz(e) try: bar(c, d) except Exception, e: baz(e)... This same pattern occurs when exceptions simply need to ... | [
"python",
"exception",
"readability"
] | 33 | 74 | 66,682 | 6 | 0 | 2008-09-24T19:00:47.767000 | 2008-09-24T19:05:58.007000 |
129,157 | 204,281 | jQuery JSONP problem in IE6 | I've encountered a problem when retrieving a JSONP response from a server in a different domain using IE6. When I make the same AJAX call using JSONP to a server in the same domain as the web page, all goes well in all browsers (including IE6). However, when I make calls between domains (XSS) using JSONP, Internet Expl... | you're not going to like this response so much, but I'm convinced it's on your server side. Here's why: I've recreated your scenario and when I run with your JSONP responder I get IE6 hanging, as you've explained. However, when I change the JSONP responder to my own code (exactly the same output as you've give above) i... | jQuery JSONP problem in IE6 I've encountered a problem when retrieving a JSONP response from a server in a different domain using IE6. When I make the same AJAX call using JSONP to a server in the same domain as the web page, all goes well in all browsers (including IE6). However, when I make calls between domains (XSS... | TITLE:
jQuery JSONP problem in IE6
QUESTION:
I've encountered a problem when retrieving a JSONP response from a server in a different domain using IE6. When I make the same AJAX call using JSONP to a server in the same domain as the web page, all goes well in all browsers (including IE6). However, when I make calls be... | [
"jquery",
"ajax",
"internet-explorer-6",
"jsonp"
] | 4 | 5 | 6,978 | 4 | 0 | 2008-09-24T19:02:33.833000 | 2008-10-15T10:40:13.837000 |
129,171 | 129,209 | Read data in FileStream into a generic Stream | What's the most efficient way to read a stream into another stream? In this case, I'm trying to read data in a Filestream into a generic stream. I know I could do the following: 1. read line by line and write the data to the stream 2. read chunks of bytes and write to the stream 3. etc I'm just trying to find the most ... | Stephen Toub discusses a stream pipeline in his MSDN.NET matters column here. In the article he describes a CopyStream() method that copies from one input stream to another stream. This sounds quite similar to what you're trying to do. | Read data in FileStream into a generic Stream What's the most efficient way to read a stream into another stream? In this case, I'm trying to read data in a Filestream into a generic stream. I know I could do the following: 1. read line by line and write the data to the stream 2. read chunks of bytes and write to the s... | TITLE:
Read data in FileStream into a generic Stream
QUESTION:
What's the most efficient way to read a stream into another stream? In this case, I'm trying to read data in a Filestream into a generic stream. I know I could do the following: 1. read line by line and write the data to the stream 2. read chunks of bytes ... | [
"c#",
"stream"
] | 5 | 7 | 8,636 | 4 | 0 | 2008-09-24T19:04:37.883000 | 2008-09-24T19:10:13.940000 |
129,178 | 129,188 | Difference between int[] array and int array[] | I have recently been thinking about the difference between the two ways of defining an array: int[] array int array[] Is there a difference? | They are semantically identical. The int array[] syntax was only added to help C programmers get used to java. int[] array is much preferable, and less confusing. | Difference between int[] array and int array[] I have recently been thinking about the difference between the two ways of defining an array: int[] array int array[] Is there a difference? | TITLE:
Difference between int[] array and int array[]
QUESTION:
I have recently been thinking about the difference between the two ways of defining an array: int[] array int array[] Is there a difference?
ANSWER:
They are semantically identical. The int array[] syntax was only added to help C programmers get used to ... | [
"java",
"arrays"
] | 265 | 328 | 108,073 | 26 | 0 | 2008-09-24T19:06:12.623000 | 2008-09-24T19:08:05.550000 |
129,181 | 129,197 | Formatting Timestamps in Java | Is there a way to format a UTC time into any arbitrary string format I want in java? Basically I was thinking of having some class take the timestamp and I pass it is string telling it how I want it formated, and it returns the formatted string for me. Is there a way to do this? | The java.text.SimpleDateFormat class provides formatting and parsing for dates in a locale-sensitive manner. The javadoc header for SimpleDateFormat is a good source of detailed information. There is also a Java Tutorial with example usages. | Formatting Timestamps in Java Is there a way to format a UTC time into any arbitrary string format I want in java? Basically I was thinking of having some class take the timestamp and I pass it is string telling it how I want it formated, and it returns the formatted string for me. Is there a way to do this? | TITLE:
Formatting Timestamps in Java
QUESTION:
Is there a way to format a UTC time into any arbitrary string format I want in java? Basically I was thinking of having some class take the timestamp and I pass it is string telling it how I want it formated, and it returns the formatted string for me. Is there a way to d... | [
"java",
"date"
] | 28 | 33 | 61,808 | 4 | 0 | 2008-09-24T19:06:50.297000 | 2008-09-24T19:08:48.467000 |
129,207 | 129,999 | Getting Spring Application Context | Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application? Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a way for a class to ask for the previously cr... | If the object that needs access to the container is a bean in the container, just implement the BeanFactoryAware or ApplicationContextAware interfaces. If an object outside the container needs access to the container, I've used a standard GoF singleton pattern for the spring container. That way, you only have one singl... | Getting Spring Application Context Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application? Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a way for a... | TITLE:
Getting Spring Application Context
QUESTION:
Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application? Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is... | [
"java",
"spring",
"configuration",
"applicationcontext"
] | 245 | 185 | 419,755 | 16 | 0 | 2008-09-24T19:10:01.130000 | 2008-09-24T21:08:40.613000 |
129,208 | 129,303 | Best practice: Self-referential scripts on a web site | On the advice of a more experienced developer, I have always coded my web pages that require user input (form processing, database administration, etc.) as self-referential pages. For PHP pages, I set the action of the form to the 'PHP_SELF' element of the $_SERVER predefined variable, and depending on the arguments th... | I would argue that self-referential pages, as you put it, do not follow an appropriate separation of concerns. You're doing 2 different things with the same page, where a cleaner separation of logic would have you do them in 2 different pages. This practice is emphasized by MVC (model-view-controller, http://en.wikiped... | Best practice: Self-referential scripts on a web site On the advice of a more experienced developer, I have always coded my web pages that require user input (form processing, database administration, etc.) as self-referential pages. For PHP pages, I set the action of the form to the 'PHP_SELF' element of the $_SERVER ... | TITLE:
Best practice: Self-referential scripts on a web site
QUESTION:
On the advice of a more experienced developer, I have always coded my web pages that require user input (form processing, database administration, etc.) as self-referential pages. For PHP pages, I set the action of the form to the 'PHP_SELF' elemen... | [
"self-reference"
] | 1 | 5 | 1,791 | 5 | 0 | 2008-09-24T19:10:07.013000 | 2008-09-24T19:25:42.623000 |
129,222 | 149,341 | Network auto-discovery using SNMP and .NET | Are there any libraries, (third party is fine) that can help do network auto-discovery using SNMP and.NET? If not, have you ever rolled your own? | I've recently come across Sharp SNMP Suite which I think does what you're asking for. I say "think" as I've not actually used it myself yet! I've just started looking into SNMP for the first time for a forthcoming project. | Network auto-discovery using SNMP and .NET Are there any libraries, (third party is fine) that can help do network auto-discovery using SNMP and.NET? If not, have you ever rolled your own? | TITLE:
Network auto-discovery using SNMP and .NET
QUESTION:
Are there any libraries, (third party is fine) that can help do network auto-discovery using SNMP and.NET? If not, have you ever rolled your own?
ANSWER:
I've recently come across Sharp SNMP Suite which I think does what you're asking for. I say "think" as I... | [
".net",
"networking",
"snmp"
] | 7 | 4 | 3,097 | 4 | 0 | 2008-09-24T19:12:30.690000 | 2008-09-29T15:55:34.777000 |
129,226 | 129,331 | What are the current state of affairs on threading, concurrency and forked processes, in Ruby on Rails? | Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't. The notion of only one request-response active at the same time can be a hassle when creating web applications which fork off a shell-command that takes long to finish. What I'd like are some of your views on these k... | Rails currently doesn't handle concurrent requests within a single MRI (Matz Ruby Interpreter) Ruby process. Each request is essentally wrapped with a giant mutex. A lot of work has gone into making the forthcoming Rails 2.2 thread-safe, but you're not going to get a lot of benefit from this when running under Ruby 1.8... | What are the current state of affairs on threading, concurrency and forked processes, in Ruby on Rails? Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't. The notion of only one request-response active at the same time can be a hassle when creating web applications w... | TITLE:
What are the current state of affairs on threading, concurrency and forked processes, in Ruby on Rails?
QUESTION:
Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't. The notion of only one request-response active at the same time can be a hassle when creating ... | [
"ruby-on-rails",
"ruby",
"concurrency"
] | 7 | 4 | 1,212 | 5 | 0 | 2008-09-24T19:12:52.373000 | 2008-09-24T19:29:19.230000 |
129,248 | 129,302 | Many to many table queries | I have a many to many index table, and I want to do an include/exclude type query on it. fid is really a integer index, but here as letters for easier understanding. Here's a sample table: table t eid | fid ----+---- 1 | A 1 | B 1 | C 2 | B 2 | C 3 | A 3 | C 4 | A 4 | B 5 | B Here are some sample queries I want. What e... | Here's an example of a query for 1 (2 works much the same) select t1.eid from t t1 where t1.fid = 'B' and not exists (select 1 from t t2 where t2.eid = t1.eid and t2.fid = 'A') | Many to many table queries I have a many to many index table, and I want to do an include/exclude type query on it. fid is really a integer index, but here as letters for easier understanding. Here's a sample table: table t eid | fid ----+---- 1 | A 1 | B 1 | C 2 | B 2 | C 3 | A 3 | C 4 | A 4 | B 5 | B Here are some sa... | TITLE:
Many to many table queries
QUESTION:
I have a many to many index table, and I want to do an include/exclude type query on it. fid is really a integer index, but here as letters for easier understanding. Here's a sample table: table t eid | fid ----+---- 1 | A 1 | B 1 | C 2 | B 2 | C 3 | A 3 | C 4 | A 4 | B 5 | ... | [
"sql",
"join"
] | 2 | 3 | 435 | 7 | 0 | 2008-09-24T19:16:16.577000 | 2008-09-24T19:25:34.853000 |
129,265 | 129,300 | CASCADE DELETE just once | I have a Postgresql database on which I want to do a few cascading deletes. However, the tables aren't set up with the ON DELETE CASCADE rule. Is there any way I can perform a delete and tell Postgresql to cascade it just this once? Something equivalent to DELETE FROM some_table CASCADE; The answers to this older quest... | No. To do it just once you would simply write the delete statement for the table you want to cascade. DELETE FROM some_child_table WHERE some_fk_field IN (SELECT some_id FROM some_Table); DELETE FROM some_table; | CASCADE DELETE just once I have a Postgresql database on which I want to do a few cascading deletes. However, the tables aren't set up with the ON DELETE CASCADE rule. Is there any way I can perform a delete and tell Postgresql to cascade it just this once? Something equivalent to DELETE FROM some_table CASCADE; The an... | TITLE:
CASCADE DELETE just once
QUESTION:
I have a Postgresql database on which I want to do a few cascading deletes. However, the tables aren't set up with the ON DELETE CASCADE rule. Is there any way I can perform a delete and tell Postgresql to cascade it just this once? Something equivalent to DELETE FROM some_tab... | [
"postgresql",
"sql-delete",
"cascade"
] | 322 | 243 | 613,859 | 10 | 0 | 2008-09-24T19:19:19.580000 | 2008-09-24T19:25:08.413000 |
129,267 | 646,416 | Why no static methods in Interfaces, but static fields and inner classes OK? [pre-Java8] | There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types within an interface, but not static methods? Static inner types perhaps aren't a fair comparison, since that's j... | An official proposal has been made to allow static methods in interfaces in Java 7. This proposal is being made under Project Coin. My personal opinion is that it's a great idea. There is no technical difficulty in implementation, and it's a very logical, reasonable thing to do. There are several proposals in Project C... | Why no static methods in Interfaces, but static fields and inner classes OK? [pre-Java8] There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types within an interface, bu... | TITLE:
Why no static methods in Interfaces, but static fields and inner classes OK? [pre-Java8]
QUESTION:
There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types withi... | [
"java",
"interface",
"jls"
] | 91 | 49 | 57,790 | 15 | 0 | 2008-09-24T19:19:27.520000 | 2009-03-14T18:20:17.090000 |
129,283 | 129,398 | MVC model design / inheritance | Forgive the vague title, I wasn't sure how to describe it. If you have a generic model "Archive", how do you show different views/forms based on a user selected 'type'? For example, the user creates a new "Archive", then gets the choice of video, book, audio etc. From there they get different forms based on the archive... | Seems like you would not want to have the type inherit from Archive. "Always favor encapsulation/containment over inheritance". Why not create a class called Archive and give it a type property. The type can use inheritance to specialize for Audio, Video, etc. It would seem that you would specialize Archive based on so... | MVC model design / inheritance Forgive the vague title, I wasn't sure how to describe it. If you have a generic model "Archive", how do you show different views/forms based on a user selected 'type'? For example, the user creates a new "Archive", then gets the choice of video, book, audio etc. From there they get diffe... | TITLE:
MVC model design / inheritance
QUESTION:
Forgive the vague title, I wasn't sure how to describe it. If you have a generic model "Archive", how do you show different views/forms based on a user selected 'type'? For example, the user creates a new "Archive", then gets the choice of video, book, audio etc. From th... | [
"model-view-controller",
"oop",
"class",
"inheritance",
"model"
] | 1 | 3 | 7,328 | 5 | 0 | 2008-09-24T19:22:17.687000 | 2008-09-24T19:40:59.607000 |
129,285 | 129,340 | Can attributes be added dynamically in C#? | Is it possible to add attributes at runtime or to change the value of an attribute at runtime? | Attributes are static metadata. Assemblies, modules, types, members, parameters, and return values aren't first-class objects in C# (e.g., the System.Type class is merely a reflected representation of a type). You can get an instance of an attribute for a type and change the properties if they're writable but that won'... | Can attributes be added dynamically in C#? Is it possible to add attributes at runtime or to change the value of an attribute at runtime? | TITLE:
Can attributes be added dynamically in C#?
QUESTION:
Is it possible to add attributes at runtime or to change the value of an attribute at runtime?
ANSWER:
Attributes are static metadata. Assemblies, modules, types, members, parameters, and return values aren't first-class objects in C# (e.g., the System.Type ... | [
"c#",
".net",
"attributes"
] | 154 | 70 | 113,749 | 10 | 0 | 2008-09-24T19:22:20.867000 | 2008-09-24T19:31:42.857000 |
129,297 | 154,960 | Automatically resizing X11 display when connecting an external monitor | I have a laptop running Ubuntu to which I connect an external monitor when I'm at the office. Usually this requires me to run xrandr --auto in order for the laptop to re-size the display to match the external monitor. It would be nice if this could be done automatically, either triggered when the monitor is connected, ... | I guees that the problem is that the script is being run as root, with no access to your xauth data. Depending on your setup, something like this could work: xauth merge /home/your_username/.Xauthority export DISPLAY=:0.0 xrandr --auto You could use something more clever to find out which user you need to extract xauth... | Automatically resizing X11 display when connecting an external monitor I have a laptop running Ubuntu to which I connect an external monitor when I'm at the office. Usually this requires me to run xrandr --auto in order for the laptop to re-size the display to match the external monitor. It would be nice if this could ... | TITLE:
Automatically resizing X11 display when connecting an external monitor
QUESTION:
I have a laptop running Ubuntu to which I connect an external monitor when I'm at the office. Usually this requires me to run xrandr --auto in order for the laptop to re-size the display to match the external monitor. It would be n... | [
"linux",
"ubuntu",
"x11",
"xrandr"
] | 4 | 2 | 3,263 | 2 | 0 | 2008-09-24T19:24:52.657000 | 2008-09-30T20:36:10.630000 |
129,301 | 142,892 | RDLC SubReports Exporting to Excel Are Ignored | I have a RDLC report which has a table, calling a subreport N times. This works perfectly in the control viewer and when I export to PDF. Yet when I export to Excel, I get the following error: Subreports within table/matrix cells are ignored. Does anyone know why this occurs only within the Excel export? And is there a... | See MSDN forum link below...looks like this is not supported in 2000/2005, but there also seem to be some kludgey workarounds (nested lists). A Microsoft moderator claims that reporting services 2008 will export everything. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1520229&SiteID=1 | RDLC SubReports Exporting to Excel Are Ignored I have a RDLC report which has a table, calling a subreport N times. This works perfectly in the control viewer and when I export to PDF. Yet when I export to Excel, I get the following error: Subreports within table/matrix cells are ignored. Does anyone know why this occu... | TITLE:
RDLC SubReports Exporting to Excel Are Ignored
QUESTION:
I have a RDLC report which has a table, calling a subreport N times. This works perfectly in the control viewer and when I export to PDF. Yet when I export to Excel, I get the following error: Subreports within table/matrix cells are ignored. Does anyone ... | [
".net",
"rdlc"
] | 1 | 1 | 5,107 | 2 | 0 | 2008-09-24T19:25:33.043000 | 2008-09-27T03:31:47.373000 |
129,305 | 129,318 | How to write the content of one stream into another stream in .net? | I often run into the problem that I have one stream full of data and want to write everything of it into another stream. All code-examples out there use a buffer in form of a byte-array. Is there a more elegant way to this? If not, what's the ideal size of the buffer. Which factors make up this value? | Regarding the ideal buffer size: "When using the Read method, it is more efficient to use a buffer that is the same size as the internal buffer of the stream, where the internal buffer is set to your desired block size, and to always read less than the block size. If the size of the internal buffer was unspecified when... | How to write the content of one stream into another stream in .net? I often run into the problem that I have one stream full of data and want to write everything of it into another stream. All code-examples out there use a buffer in form of a byte-array. Is there a more elegant way to this? If not, what's the ideal siz... | TITLE:
How to write the content of one stream into another stream in .net?
QUESTION:
I often run into the problem that I have one stream full of data and want to write everything of it into another stream. All code-examples out there use a buffer in form of a byte-array. Is there a more elegant way to this? If not, wh... | [
".net",
"stream"
] | 41 | 16 | 21,605 | 7 | 0 | 2008-09-24T19:25:54.057000 | 2008-09-24T19:28:11.383000 |
129,310 | 602,505 | What browser features/plugins for opera, IE, firefox, chrome, safari, etc. do you use for browser compatibility testing? | I use the Nightly Tester Tools for Firefox and Fiddler for IE. What do you use? | Web Developer toolbar for Firefox, Visual Studio JIT debugger for IE, and Chrome's Resource Inspector. We don't use Opera for debugging due to the aforementioned tools, but we do take a look at our stuff to make sure it looks correct in Opera to be on the safe side. | What browser features/plugins for opera, IE, firefox, chrome, safari, etc. do you use for browser compatibility testing? I use the Nightly Tester Tools for Firefox and Fiddler for IE. What do you use? | TITLE:
What browser features/plugins for opera, IE, firefox, chrome, safari, etc. do you use for browser compatibility testing?
QUESTION:
I use the Nightly Tester Tools for Firefox and Fiddler for IE. What do you use?
ANSWER:
Web Developer toolbar for Firefox, Visual Studio JIT debugger for IE, and Chrome's Resource ... | [
"internet-explorer",
"firefox",
"safari",
"google-chrome",
"opera"
] | 2 | 2 | 620 | 4 | 0 | 2008-09-24T19:26:41.233000 | 2009-03-02T14:22:49.370000 |
129,312 | 129,320 | Windows (Vista): Set process-priority on a program shortcut | Is there any way to launch a program with a shortcut, that sets the process-priority of that program? iTunes is dragging my system to it's knees, but when I set the process-priority to "low", somehow, like magic, Windows gets back to it's normal responsive self:) | You learn something new every day. My answer was wrong, but since it was marked accepted I'm editing to be right. Change your short cut to point to: start /BELOWNORMAL iTunes.exe Instead of just iTunes.exe | Windows (Vista): Set process-priority on a program shortcut Is there any way to launch a program with a shortcut, that sets the process-priority of that program? iTunes is dragging my system to it's knees, but when I set the process-priority to "low", somehow, like magic, Windows gets back to it's normal responsive sel... | TITLE:
Windows (Vista): Set process-priority on a program shortcut
QUESTION:
Is there any way to launch a program with a shortcut, that sets the process-priority of that program? iTunes is dragging my system to it's knees, but when I set the process-priority to "low", somehow, like magic, Windows gets back to it's nor... | [
"windows",
"performance",
"itunes"
] | 4 | 4 | 4,797 | 1 | 0 | 2008-09-24T19:26:55.473000 | 2008-09-24T19:28:19.543000 |
129,328 | 129,347 | How do you handle attachments in your web application? | Due to a lack of response to my original question, probably due to poor wording on my part. Since then, I have thought about my original question and decided to reword it, hopefully for the better!:) We create custom business software for our customers, and quite often they want attachments to be added to certain busin... | Start with one file upload control ("Browse button"), and use JavaScript to dynamically add more upload controls if they want to attach multiple files in a single batch. Display them in a simple list format (Filename, type, size, date), but provide full details somewhere else if they want them. If they want to edit the... | How do you handle attachments in your web application? Due to a lack of response to my original question, probably due to poor wording on my part. Since then, I have thought about my original question and decided to reword it, hopefully for the better!:) We create custom business software for our customers, and quite o... | TITLE:
How do you handle attachments in your web application?
QUESTION:
Due to a lack of response to my original question, probably due to poor wording on my part. Since then, I have thought about my original question and decided to reword it, hopefully for the better!:) We create custom business software for our cust... | [
"asp.net",
"file"
] | 3 | 5 | 2,131 | 2 | 0 | 2008-09-24T19:29:01.413000 | 2008-09-24T19:32:36.070000 |
129,329 | 129,397 | Optimistic vs. Pessimistic locking | I understand the differences between optimistic and pessimistic locking. Now, could someone explain to me when I would use either one in general? And does the answer to this question change depending on whether or not I'm using a stored procedure to perform the query? But just to check, optimistic means "don't lock the... | Optimistic Locking is a strategy where you read a record, take note of a version number (other methods to do this involve dates, timestamps or checksums/hashes) and check that the version hasn't changed before you write the record back. When you write the record back you filter the update on the version to make sure it... | Optimistic vs. Pessimistic locking I understand the differences between optimistic and pessimistic locking. Now, could someone explain to me when I would use either one in general? And does the answer to this question change depending on whether or not I'm using a stored procedure to perform the query? But just to chec... | TITLE:
Optimistic vs. Pessimistic locking
QUESTION:
I understand the differences between optimistic and pessimistic locking. Now, could someone explain to me when I would use either one in general? And does the answer to this question change depending on whether or not I'm using a stored procedure to perform the query... | [
"database",
"transactions",
"locking",
"optimistic-locking",
"pessimistic-locking"
] | 974 | 1,278 | 613,790 | 13 | 0 | 2008-09-24T19:29:05.390000 | 2008-09-24T19:40:58.670000 |
129,330 | 132,650 | How do I make a custom Flex component for a gap-fill exercise? | The purpose of this component is to test knowledge of a student on a given subject - in the example below it would be geography. The student is given a piece of text with missing words in it. He/she has to fill in (type in this case) the missing words - hence this kind of test/exercise is called gap-fill.There could be... | You need a container that supports flow layout. It's not part of the standard Flex framework but you can find some working implementation here (part of the excellent FlexLib) and here (standalone implementation). | How do I make a custom Flex component for a gap-fill exercise? The purpose of this component is to test knowledge of a student on a given subject - in the example below it would be geography. The student is given a piece of text with missing words in it. He/she has to fill in (type in this case) the missing words - hen... | TITLE:
How do I make a custom Flex component for a gap-fill exercise?
QUESTION:
The purpose of this component is to test knowledge of a student on a given subject - in the example below it would be geography. The student is given a piece of text with missing words in it. He/she has to fill in (type in this case) the m... | [
"apache-flex",
"actionscript-3",
"air"
] | 2 | 2 | 653 | 3 | 0 | 2008-09-24T19:29:08.120000 | 2008-09-25T11:11:02.040000 |
129,335 | 129,361 | How do you redirect to a page using the POST verb? | When you call RedirectToAction within a controller, it automatically redirects using an HTTP GET. How do I explicitly tell it to use an HTTP POST? I have an action that accepts both GET and POST requests, and I want to be able to RedirectToAction using POST and send it some values. Like this: this.RedirectToAction( "ac... | HTTP doesn't support redirection to a page using POST. When you redirect somewhere, the HTTP "Location" header tells the browser where to go, and the browser makes a GET request for that page. You'll probably have to just write the code for your page to accept GET requests as well as POST requests. | How do you redirect to a page using the POST verb? When you call RedirectToAction within a controller, it automatically redirects using an HTTP GET. How do I explicitly tell it to use an HTTP POST? I have an action that accepts both GET and POST requests, and I want to be able to RedirectToAction using POST and send it... | TITLE:
How do you redirect to a page using the POST verb?
QUESTION:
When you call RedirectToAction within a controller, it automatically redirects using an HTTP GET. How do I explicitly tell it to use an HTTP POST? I have an action that accepts both GET and POST requests, and I want to be able to RedirectToAction usin... | [
"asp.net-mvc",
"redirect"
] | 156 | 122 | 186,026 | 8 | 0 | 2008-09-24T19:30:30.223000 | 2008-09-24T19:35:02.630000 |
129,345 | 573,438 | How to pass arguments to a constructor in an IOC-framework | How can I pass arguments to a constructor in an IOC-framework? I want to do something like: (Trying to be IOC-framework agnostic;) ) object objectToLogFor = xxx; container.Resolve (objectToLogFor);
public class MyLogging: ILogging { public MyLogging(object objectToLogFor){} } It seems that this is not possible in Stru... | In structure map you could achieve this using the With method: string objectToLogFor = "PolicyName"; ObjectFactory.With (objectToLogFor).GetInstance (); See: http://codebetter.com/blogs/jeremy.miller/archive/2008/09/25/using-structuremap-2-5-to-inject-your-entity-objects-into-services.aspx | How to pass arguments to a constructor in an IOC-framework How can I pass arguments to a constructor in an IOC-framework? I want to do something like: (Trying to be IOC-framework agnostic;) ) object objectToLogFor = xxx; container.Resolve (objectToLogFor);
public class MyLogging: ILogging { public MyLogging(object obj... | TITLE:
How to pass arguments to a constructor in an IOC-framework
QUESTION:
How can I pass arguments to a constructor in an IOC-framework? I want to do something like: (Trying to be IOC-framework agnostic;) ) object objectToLogFor = xxx; container.Resolve (objectToLogFor);
public class MyLogging: ILogging { public My... | [
"language-agnostic",
"inversion-of-control",
"structuremap"
] | 12 | 9 | 5,090 | 7 | 0 | 2008-09-24T19:32:10.937000 | 2009-02-21T17:34:38.860000 |
129,360 | 129,439 | Passing in parameter from html element with jQuery | I'm working with jQuery for the first time and need some help. I have html that looks like the following: Blah blah Blah blah something else I'm trying to use jQuery to add spans to the.tools divs that call variouis functions when clicked. The functions needs to receive the id (either the entire 'comment-8' or just the... | Event callbacks are called with an event object as the first argument, you can't pass something else in that way. This event object has a target property that references the element it was called for, and the this variable is a reference to the element the event handler was attached to. So you could do the following: f... | Passing in parameter from html element with jQuery I'm working with jQuery for the first time and need some help. I have html that looks like the following: Blah blah Blah blah something else I'm trying to use jQuery to add spans to the.tools divs that call variouis functions when clicked. The functions needs to receiv... | TITLE:
Passing in parameter from html element with jQuery
QUESTION:
I'm working with jQuery for the first time and need some help. I have html that looks like the following: Blah blah Blah blah something else I'm trying to use jQuery to add spans to the.tools divs that call variouis functions when clicked. The functio... | [
"javascript",
"jquery"
] | 3 | 6 | 37,245 | 6 | 0 | 2008-09-24T19:34:57.327000 | 2008-09-24T19:48:28.857000 |
129,362 | 129,367 | Restoring SplitterDistance inside TabControl is inconsistent | I'm writing a WinForms application and one of the tabs in my TabControl has a SplitContainer. I'm saving the SplitterDistance in the user's application settings, but the restore is inconsistent. If the tab page with the splitter is visible, then the restore works and the splitter distance is as I left it. If some other... | I found the problem. Each tab page doesn't get resized to match the tab control until it gets selected. For example, if the tab control is 100 pixels wide in the designer, and you've just set it to 500 pixels during load, then setting the splitter distance to 50 on a hidden tab page will get resized to a splitter dista... | Restoring SplitterDistance inside TabControl is inconsistent I'm writing a WinForms application and one of the tabs in my TabControl has a SplitContainer. I'm saving the SplitterDistance in the user's application settings, but the restore is inconsistent. If the tab page with the splitter is visible, then the restore w... | TITLE:
Restoring SplitterDistance inside TabControl is inconsistent
QUESTION:
I'm writing a WinForms application and one of the tabs in my TabControl has a SplitContainer. I'm saving the SplitterDistance in the user's application settings, but the restore is inconsistent. If the tab page with the splitter is visible, ... | [
"c#",
".net",
"winforms"
] | 10 | 7 | 8,142 | 9 | 0 | 2008-09-24T19:35:05.003000 | 2008-09-24T19:35:22.287000 |
129,382 | 130,876 | Anybody know where I can get docs or tutorials on VSS 2005 Integration via .net | I know that I can add the SourceSafeTypeLib to a project and can explore it in object browser and find obvious things (GetLatest, etc), but I am looking for some more thorough documentation or specific tutorials on things like "undo another user's checkout" or"determine who has a file checked out. If anyone knows where... | You might check out Microsoft's documentation on the Microsoft.VisualStudio.SourceSafe.Interop namespace (I assume that's what you've looked at). I used it to create a VB.NET utility that does get latest, check-outs, and check-ins against a VSS 2005 database. A quick perusal revealed the IVSSItem.UndoCheckout method, a... | Anybody know where I can get docs or tutorials on VSS 2005 Integration via .net I know that I can add the SourceSafeTypeLib to a project and can explore it in object browser and find obvious things (GetLatest, etc), but I am looking for some more thorough documentation or specific tutorials on things like "undo another... | TITLE:
Anybody know where I can get docs or tutorials on VSS 2005 Integration via .net
QUESTION:
I know that I can add the SourceSafeTypeLib to a project and can explore it in object browser and find obvious things (GetLatest, etc), but I am looking for some more thorough documentation or specific tutorials on things ... | [
".net",
"api",
"visual-sourcesafe"
] | 0 | 1 | 450 | 2 | 0 | 2008-09-24T19:38:03.170000 | 2008-09-25T00:55:59.990000 |
129,389 | 129,395 | How do you do a deep copy of an object in .NET? | I want a true deep copy. In Java, this was easy, but how do you do it in C#? | Important Note BinaryFormatter has been deprecated, and will no longer be available in.NET after November 2023. See BinaryFormatter Obsoletion Strategy I've seen a few different approaches to this, but I use a generic utility method as such: public static T DeepClone (this T obj) { using (var ms = new MemoryStream()) {... | How do you do a deep copy of an object in .NET? I want a true deep copy. In Java, this was easy, but how do you do it in C#? | TITLE:
How do you do a deep copy of an object in .NET?
QUESTION:
I want a true deep copy. In Java, this was easy, but how do you do it in C#?
ANSWER:
Important Note BinaryFormatter has been deprecated, and will no longer be available in.NET after November 2023. See BinaryFormatter Obsoletion Strategy I've seen a few ... | [
"c#",
".net",
"serialization",
"clone"
] | 701 | 725 | 667,132 | 10 | 0 | 2008-09-24T19:39:39.750000 | 2008-09-24T19:40:42.930000 |
129,391 | 192,696 | How do I add Active Directory support to Windows PE? | I want to query Active Directory from Windows PE 2.0, which is not supported "out of the box." Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend? | Installing the ADSI package from deployvista.com solved the problem for me, but your mileage may vary. | How do I add Active Directory support to Windows PE? I want to query Active Directory from Windows PE 2.0, which is not supported "out of the box." Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend? | TITLE:
How do I add Active Directory support to Windows PE?
QUESTION:
I want to query Active Directory from Windows PE 2.0, which is not supported "out of the box." Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend?
ANSWER:
Installing the ADSI package from de... | [
"windows",
"active-directory"
] | 0 | 0 | 3,200 | 3 | 0 | 2008-09-24T19:39:55.303000 | 2008-10-10T19:13:19.683000 |
129,405 | 129,839 | Can I use DoxyGen to document ActionScript code? | How do I Configuring DoxyGen to document ActionScript files? I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there. | Instead of doxygen you should use a documentation generator that specifically supports the language. For ActionScript 2, you have a couple choices: NaturalDocs ( example ) (free) ZenDoc (free) AS2Doc Pro ( example ) (commercial) If you are using ActionScript 3, Adobe includes a free documentation generator along with t... | Can I use DoxyGen to document ActionScript code? How do I Configuring DoxyGen to document ActionScript files? I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there. | TITLE:
Can I use DoxyGen to document ActionScript code?
QUESTION:
How do I Configuring DoxyGen to document ActionScript files? I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there.
ANSWER:
Instead of doxygen you should use a documentation genera... | [
"configuration",
"actionscript",
"documentation",
"doxygen"
] | 11 | 12 | 5,601 | 3 | 0 | 2008-09-24T19:42:10.290000 | 2008-09-24T20:42:07.977000 |
129,406 | 129,519 | Why is there a gap between my image and its containing box? | When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why? foo | Inline elements are vertically aligned to the baseline, not the very bottom of the containing box. This is because text needs a small amount of space underneath for descenders - the tails on letters like lowercase 'p'. So there is an imaginary line a short distance above the bottom, called the baseline, and inline elem... | Why is there a gap between my image and its containing box? When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why? foo | TITLE:
Why is there a gap between my image and its containing box?
QUESTION:
When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why? foo
ANSWER:
Inline elements are ve... | [
"html",
"css"
] | 12 | 22 | 13,756 | 6 | 0 | 2008-09-24T19:42:11.147000 | 2008-09-24T20:01:54.737000 |
129,417 | 129,434 | Passing Exceptions to an error screen in ASP.net/C# | Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. My general question is how do I pass the exception from page X to my Error page in ASP.net? | I suggest using the customErrors section in the web.config: And then using ELMAH to email and/or log the error. | Passing Exceptions to an error screen in ASP.net/C# Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. My general question is how do I pass the exception from page X to my Error page in A... | TITLE:
Passing Exceptions to an error screen in ASP.net/C#
QUESTION:
Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. My general question is how do I pass the exception from page X to ... | [
"c#",
"asp.net",
"error-handling"
] | 4 | 6 | 3,566 | 7 | 0 | 2008-09-24T19:44:35.340000 | 2008-09-24T19:47:50.043000 |
129,438 | 130,008 | What is a good project to work on to learn modern patterns and practices? | I'm trying to teach myself how to use Modern Persistence Patterns (OR/M, Repository, etc) and development practices (TDD, etc). Because the best way (for me) to learn is by doing, I'd like to build some sort of demo application for myself. The problem is, I've got no idea what sort of application to build. I'd like to ... | There are innumerable community-service organizations with little or no web presence. Pick a service organization -- any one -- Literacy Volunteers, Food Pantries, Home Furnishings Donations, Alcoholics Anonymous -- anything. The grass-roots community organizations benefit the most from involvement; they often need a m... | What is a good project to work on to learn modern patterns and practices? I'm trying to teach myself how to use Modern Persistence Patterns (OR/M, Repository, etc) and development practices (TDD, etc). Because the best way (for me) to learn is by doing, I'd like to build some sort of demo application for myself. The pr... | TITLE:
What is a good project to work on to learn modern patterns and practices?
QUESTION:
I'm trying to teach myself how to use Modern Persistence Patterns (OR/M, Repository, etc) and development practices (TDD, etc). Because the best way (for me) to learn is by doing, I'd like to build some sort of demo application ... | [
"design-patterns",
"project-planning"
] | 6 | 13 | 1,550 | 5 | 0 | 2008-09-24T19:48:12.333000 | 2008-09-24T21:10:15.740000 |
129,445 | 129,496 | postgreSQL - psql \i : how to execute script in a given path | I'm new to postgreSQL and I have a simple question: I'm trying to create a simple script that creates a DB so I can later call it like this: psql -f createDB.sql I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), like this: \i script1.sql \i script2.sql It wo... | Postgres started on Linux/Unix. I suspect that reversing the slash with fix it. \i somedir/script2.sql If you need to fully qualify something \i c:/somedir/script2.sql If that doesn't fix it, my next guess would be you need to escape the backslash. \i somedir\\script2.sql | postgreSQL - psql \i : how to execute script in a given path I'm new to postgreSQL and I have a simple question: I'm trying to create a simple script that creates a DB so I can later call it like this: psql -f createDB.sql I want the script to call other scripts (separate ones for creating tables, adding constraints, f... | TITLE:
postgreSQL - psql \i : how to execute script in a given path
QUESTION:
I'm new to postgreSQL and I have a simple question: I'm trying to create a simple script that creates a DB so I can later call it like this: psql -f createDB.sql I want the script to call other scripts (separate ones for creating tables, add... | [
"postgresql"
] | 81 | 109 | 189,353 | 4 | 0 | 2008-09-24T19:49:48.807000 | 2008-09-24T19:58:52.387000 |
129,451 | 129,472 | JavaScript or Java String Subtraction | If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings: org.company.project.component org.company.project.component.sub_component you just get: sub_component I know that I could just write code to walk the string comparing characters, but I was hopin... | Depends on precisely what you want. If you're looking for a way to compare strings in the general case -- meaning finding common sub-strings between arbitrary inputs -- then you're looking at something closer to the Levenshtein distance and similar algorithms. However, if all you need is prefix/suffix comparison, this ... | JavaScript or Java String Subtraction If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings: org.company.project.component org.company.project.component.sub_component you just get: sub_component I know that I could just write code to walk the string... | TITLE:
JavaScript or Java String Subtraction
QUESTION:
If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings: org.company.project.component org.company.project.component.sub_component you just get: sub_component I know that I could just write code ... | [
"java",
"javascript",
"regex"
] | 1 | 8 | 7,530 | 7 | 0 | 2008-09-24T19:50:24.840000 | 2008-09-24T19:54:51.023000 |
129,453 | 129,613 | .NET EventHandlers - Generic or no? | Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the EventHandler / EventArgs practice, but what I like to do is have something like: public delegate void EventHandler (object src, EventArgs args);
public class EventArgs: EventArgs {
pr... | Delegate of the following form has been added since.NET Framework 2.0 public delegate void EventHandler (object sender, TArgs args) where TArgs: EventArgs You approach goes a bit further, since you provide out-of-the-box implementation for EventArgs with single data item, but it lacks several properties of the original... | .NET EventHandlers - Generic or no? Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the EventHandler / EventArgs practice, but what I like to do is have something like: public delegate void EventHandler (object src, EventArgs args);
pub... | TITLE:
.NET EventHandlers - Generic or no?
QUESTION:
Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the EventHandler / EventArgs practice, but what I like to do is have something like: public delegate void EventHandler (object src, Eve... | [
"c#",
".net",
"generics",
"events"
] | 24 | 28 | 23,475 | 9 | 0 | 2008-09-24T19:50:41.813000 | 2008-09-24T20:13:36.127000 |
129,494 | 129,679 | Performance gains in stored procs for long running transactions | I have several long running report type transactions that take 5-10 minutes. Would I see any performance increase by using stored procs? Would it be significant? each query runs once a night. | The short answer is: no, stored procedures aren't going to improve the performance. For a start, if you are using parameterised queries there is no difference in performance between a stored procedure and inline SQL. The reason is that ALL queries have cached execution plans - not just stored procedures. Have a look at... | Performance gains in stored procs for long running transactions I have several long running report type transactions that take 5-10 minutes. Would I see any performance increase by using stored procs? Would it be significant? each query runs once a night. | TITLE:
Performance gains in stored procs for long running transactions
QUESTION:
I have several long running report type transactions that take 5-10 minutes. Would I see any performance increase by using stored procs? Would it be significant? each query runs once a night.
ANSWER:
The short answer is: no, stored proce... | [
"sql",
"stored-procedures"
] | 1 | 3 | 410 | 5 | 0 | 2008-09-24T19:58:44.853000 | 2008-09-24T20:20:56.517000 |
129,502 | 905,565 | How do I wrap text in a UITableViewCell without a custom cell | This is on iPhone 0S 2.0. Answers for 2.1 are fine too, though I am unaware of any differences regarding tables. It feels like it should be possible to get text to wrap without creating a custom cell, since a UITableViewCell contains a UILabel by default. I know I can make it work if I create a custom cell, but that's ... | Here is a simpler way, and it works for me: Inside your cellForRowAtIndexPath: function. The first time you create your cell: UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifie... | How do I wrap text in a UITableViewCell without a custom cell This is on iPhone 0S 2.0. Answers for 2.1 are fine too, though I am unaware of any differences regarding tables. It feels like it should be possible to get text to wrap without creating a custom cell, since a UITableViewCell contains a UILabel by default. I ... | TITLE:
How do I wrap text in a UITableViewCell without a custom cell
QUESTION:
This is on iPhone 0S 2.0. Answers for 2.1 are fine too, though I am unaware of any differences regarding tables. It feels like it should be possible to get text to wrap without creating a custom cell, since a UITableViewCell contains a UILa... | [
"ios",
"objective-c",
"cocoa-touch",
"uikit",
"iphone-sdk-2"
] | 153 | 279 | 99,972 | 10 | 0 | 2008-09-24T20:00:03.430000 | 2009-05-25T06:22:39.780000 |
129,507 | 129,522 | How do you test that a Python function throws an exception? | How does one write a unit test that fails only if a function doesn't throw an expected exception? | Use TestCase.assertRaises from the unittest module, for example: import mymod
class MyTestCase(unittest.TestCase): def test1(self): self.assertRaises(SomeCoolException, mymod.myfunc) | How do you test that a Python function throws an exception? How does one write a unit test that fails only if a function doesn't throw an expected exception? | TITLE:
How do you test that a Python function throws an exception?
QUESTION:
How does one write a unit test that fails only if a function doesn't throw an expected exception?
ANSWER:
Use TestCase.assertRaises from the unittest module, for example: import mymod
class MyTestCase(unittest.TestCase): def test1(self): se... | [
"python",
"unit-testing",
"exception"
] | 1,229 | 1,003 | 928,249 | 19 | 0 | 2008-09-24T20:00:35.597000 | 2008-09-24T20:02:29.600000 |
129,510 | 131,325 | Is it a bad idea to reload routes dynamically in Rails? | I have an application I'm writing where I'm allowing the administrators to add aliases for pages, categories, etc, and I would like to use a different controller/action depending on the alias (without redirecting, and I've found that render doesn't actually call the method. I just renders the template). I have tried a ... | Quick Solution Have a catch-all route at the bottom of routes.rb. Implement any alias lookup logic you want in the action that route routes you to. In my implementation, I have a table which maps defined URLs to a controller, action, and parameter hash. I just pluck them out of the database, then call the appropriate a... | Is it a bad idea to reload routes dynamically in Rails? I have an application I'm writing where I'm allowing the administrators to add aliases for pages, categories, etc, and I would like to use a different controller/action depending on the alias (without redirecting, and I've found that render doesn't actually call t... | TITLE:
Is it a bad idea to reload routes dynamically in Rails?
QUESTION:
I have an application I'm writing where I'm allowing the administrators to add aliases for pages, categories, etc, and I would like to use a different controller/action depending on the alias (without redirecting, and I've found that render doesn... | [
"ruby-on-rails",
"ruby"
] | 7 | 5 | 5,436 | 4 | 0 | 2008-09-24T20:00:52.320000 | 2008-09-25T03:24:56.683000 |
129,544 | 133,644 | What is the best way of handling non-validating SSL certificates in C# | I'm using the following code to make sure all certificates pass, even invalid ones, but I would like to know if there is a better way, as this event gets called globally and I only want the certificate to pass for a certain HTTP call and not for any others that are happening asynchronously. // This delegate makes sure ... | What about the certsender argument? Does it contain anything sensible so that you can tell what connection the callback is happening for? I checked the.NET API but it doesn't say what the argument is supposed to contain... | What is the best way of handling non-validating SSL certificates in C# I'm using the following code to make sure all certificates pass, even invalid ones, but I would like to know if there is a better way, as this event gets called globally and I only want the certificate to pass for a certain HTTP call and not for any... | TITLE:
What is the best way of handling non-validating SSL certificates in C#
QUESTION:
I'm using the following code to make sure all certificates pass, even invalid ones, but I would like to know if there is a better way, as this event gets called globally and I only want the certificate to pass for a certain HTTP ca... | [
"c#",
"http",
"ssl"
] | 4 | 1 | 586 | 2 | 0 | 2008-09-24T20:06:01.217000 | 2008-09-25T14:23:14.760000 |
129,551 | 129,604 | What has your QA/tester team said or done for the development team that made your day (as a developer) | There are lots of questions on how to improve communication between teams. One way to start is to identify what one team actually does that the other team really values and do more of that. For example. Our QA team provided a VM for us with: The latest release of our server-based commercial software installed and confi... | A good friend of mine who used to be in our QA department put together a bunch of amazing scripts with AutoIt. To me they were like gold, he would find issues, write me a script, email me the executable and I'd have a way to reproduce problems in a snap. His scripts helped me track down a memory leak that I had been (u... | What has your QA/tester team said or done for the development team that made your day (as a developer) There are lots of questions on how to improve communication between teams. One way to start is to identify what one team actually does that the other team really values and do more of that. For example. Our QA team pr... | TITLE:
What has your QA/tester team said or done for the development team that made your day (as a developer)
QUESTION:
There are lots of questions on how to improve communication between teams. One way to start is to identify what one team actually does that the other team really values and do more of that. For examp... | [
"project-management"
] | 2 | 1 | 333 | 4 | 0 | 2008-09-24T20:06:21.557000 | 2008-09-24T20:12:28.783000 |
129,605 | 129,792 | Profiling SQL Server and/or ASP.NET | How would one go about profiling a few queries that are being run from an ASP.NET application? There is some software where I work that runs extremely slow because of the database (I think). The tables have indexes but it still drags because it's working with so much data. How can I profile to see where I can make a fe... | Sql Server has some excellent tools to help you with this situation. These tools are built into Management Studio (which used to be called Enterprise Manager + Query Analyzer). Use SQL Profiler to show you the actual queries coming from the web application. Copy each of the problem queries out (the ones that eat up lot... | Profiling SQL Server and/or ASP.NET How would one go about profiling a few queries that are being run from an ASP.NET application? There is some software where I work that runs extremely slow because of the database (I think). The tables have indexes but it still drags because it's working with so much data. How can I ... | TITLE:
Profiling SQL Server and/or ASP.NET
QUESTION:
How would one go about profiling a few queries that are being run from an ASP.NET application? There is some software where I work that runs extremely slow because of the database (I think). The tables have indexes but it still drags because it's working with so muc... | [
"asp.net",
"sql-server",
"database",
"profiling"
] | 4 | 5 | 1,694 | 5 | 0 | 2008-09-24T20:12:30.153000 | 2008-09-24T20:34:23.473000 |
129,607 | 129,714 | What is the difference between my and local in Perl? | I am seeing both of them used in this script I am trying to debug and the literature is just not clear. Can someone demystify this for me? | Dynamic Scoping. It is a neat concept. Many people don't use it, or understand it. Basically think of my as creating and anchoring a variable to one block of {}, A.K.A. scope. my $foo if (true); # $foo lives and dies within the if statement. So a my variable is what you are used to. whereas with dynamic scoping $var ca... | What is the difference between my and local in Perl? I am seeing both of them used in this script I am trying to debug and the literature is just not clear. Can someone demystify this for me? | TITLE:
What is the difference between my and local in Perl?
QUESTION:
I am seeing both of them used in this script I am trying to debug and the literature is just not clear. Can someone demystify this for me?
ANSWER:
Dynamic Scoping. It is a neat concept. Many people don't use it, or understand it. Basically think of... | [
"perl",
"scoping"
] | 76 | 47 | 49,288 | 16 | 0 | 2008-09-24T20:12:59.373000 | 2008-09-24T20:24:08.863000 |
129,618 | 129,845 | Cannot Access http://<tfs-server>:8080 | I've installed TFS 2008, but I can't seem to access the server. When I try to connect to it in Visual Studio, I can't. If I try by browser on a remote PC, I get a generic page cannot be displayed. On the server, I get a 403. Nothing was touched in IIS and the service is running as a Network Service. Any ideas? | try: http://localhost:8080/Services/V1.0/ServerStatus.asmx. This will tell you if TFS is up and running. If you are getting anything else you need to look into IIS issues. | Cannot Access http://<tfs-server>:8080 I've installed TFS 2008, but I can't seem to access the server. When I try to connect to it in Visual Studio, I can't. If I try by browser on a remote PC, I get a generic page cannot be displayed. On the server, I get a 403. Nothing was touched in IIS and the service is running as... | TITLE:
Cannot Access http://<tfs-server>:8080
QUESTION:
I've installed TFS 2008, but I can't seem to access the server. When I try to connect to it in Visual Studio, I can't. If I try by browser on a remote PC, I get a generic page cannot be displayed. On the server, I get a 403. Nothing was touched in IIS and the ser... | [
"visual-studio",
"visual-studio-2008",
"iis",
"tfs"
] | 2 | 4 | 15,336 | 6 | 0 | 2008-09-24T20:14:05.953000 | 2008-09-24T20:42:51.797000 |
129,628 | 129,639 | What is declarative programming? | I keep hearing this term tossed around in several different contexts. What is it? | Declarative programming is when you write your code in such a way that it describes what you want to do, and not how you want to do it. It is left up to the compiler to figure out the how. Examples of declarative programming languages are SQL and Prolog. | What is declarative programming? I keep hearing this term tossed around in several different contexts. What is it? | TITLE:
What is declarative programming?
QUESTION:
I keep hearing this term tossed around in several different contexts. What is it?
ANSWER:
Declarative programming is when you write your code in such a way that it describes what you want to do, and not how you want to do it. It is left up to the compiler to figure ou... | [
"programming-languages",
"declarative",
"glossary"
] | 193 | 148 | 141,221 | 18 | 0 | 2008-09-24T20:15:26.857000 | 2008-09-24T20:17:03.980000 |
129,650 | 161,706 | C# + Castle ActiveRecord: HasAndBelongsToMany and collections | Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like FindAllPostByTags(IList tags) that returns all Posts that have all (not just some of) the Tags in the parameter. Any ... | You could also just use an IN statement DetachedCriteria query = DetachedCriteria.For (); query.CreateCriteria("Post").Add(Expression.In("TagName", string.Join(",",tags.ToArray()) ); I haven't compiled that so it could have errors | C# + Castle ActiveRecord: HasAndBelongsToMany and collections Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like FindAllPostByTags(IList tags) that returns all Posts th... | TITLE:
C# + Castle ActiveRecord: HasAndBelongsToMany and collections
QUESTION:
Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like FindAllPostByTags(IList tags) that re... | [
"c#",
".net",
"nhibernate",
"hql",
"castle-activerecord"
] | 3 | 2 | 2,505 | 3 | 0 | 2008-09-24T20:17:55.803000 | 2008-10-02T10:41:41.527000 |
129,651 | 129,706 | How do I keep a DIV from expanding to take up all available width? | In the following HTML, I'd like the frame around the image to be snug -- not to stretch out and take up all the available width in the parent container. I know there are a couple of ways to do this (including horrible things like manually setting its width to a particular number of pixels), but what is the right way? E... | The right way is to use:.pictureframe { display: inline-block; } Edit: Floating the element also produces the same effect, this is because floating elements use the same shrink-to-fit algorithm for determining the width. | How do I keep a DIV from expanding to take up all available width? In the following HTML, I'd like the frame around the image to be snug -- not to stretch out and take up all the available width in the parent container. I know there are a couple of ways to do this (including horrible things like manually setting its wi... | TITLE:
How do I keep a DIV from expanding to take up all available width?
QUESTION:
In the following HTML, I'd like the frame around the image to be snug -- not to stretch out and take up all the available width in the parent container. I know there are a couple of ways to do this (including horrible things like manua... | [
"html",
"css"
] | 26 | 31 | 28,281 | 6 | 0 | 2008-09-24T20:18:09.563000 | 2008-09-24T20:23:27.150000 |
129,677 | 130,323 | How can I sanitize user input with PHP? | Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags? | It's a common misconception that user input can be filtered. PHP even had a (now defunct) "feature", called magic-quotes, that builds on this idea. It's nonsense. Forget about filtering (or cleaning, or whatever people call it). What you should do, to avoid problems, is quite simple: whenever you embed a piece of data ... | How can I sanitize user input with PHP? Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags? | TITLE:
How can I sanitize user input with PHP?
QUESTION:
Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?
ANSWER:
It's a common misconception that user input can be filtered. PHP even had a (now defunct... | [
"php",
"security",
"xss",
"sql-injection",
"user-input"
] | 1,282 | 1,307 | 683,101 | 15 | 0 | 2008-09-24T20:20:39.650000 | 2008-09-24T22:30:37 |
129,693 | 143,699 | Is duplicated code more tolerable in unit tests? | I ruined several unit tests some time ago when I went through and refactored them to make them more DRY --the intent of each test was no longer clear. It seems there is a trade-off between tests' readability and maintainability. If I leave duplicated code in unit tests, they're more readable, but then if I change the S... | Duplicated code is a smell in unit test code just as much as in other code. If you have duplicated code in tests, it makes it harder to refactor the implementation code because you have a disproportionate number of tests to update. Tests should help you refactor with confidence, rather than be a large burden that imped... | Is duplicated code more tolerable in unit tests? I ruined several unit tests some time ago when I went through and refactored them to make them more DRY --the intent of each test was no longer clear. It seems there is a trade-off between tests' readability and maintainability. If I leave duplicated code in unit tests, ... | TITLE:
Is duplicated code more tolerable in unit tests?
QUESTION:
I ruined several unit tests some time ago when I went through and refactored them to make them more DRY --the intent of each test was no longer clear. It seems there is a trade-off between tests' readability and maintainability. If I leave duplicated co... | [
"unit-testing",
"dry",
"code-duplication"
] | 151 | 84 | 33,654 | 11 | 0 | 2008-09-24T20:22:10.693000 | 2008-09-27T14:26:56.707000 |
129,695 | 129,734 | Java: Serializing a huge amount of data to a single file | I need to serialize a huge amount of data (around 2gigs) of small objects into a single file in order to be processed later by another Java process. Performance is kind of important. Can anyone suggest a good method to achieve this? | Have you taken a look at google's protocol buffers? Sounds like a use case for it. | Java: Serializing a huge amount of data to a single file I need to serialize a huge amount of data (around 2gigs) of small objects into a single file in order to be processed later by another Java process. Performance is kind of important. Can anyone suggest a good method to achieve this? | TITLE:
Java: Serializing a huge amount of data to a single file
QUESTION:
I need to serialize a huge amount of data (around 2gigs) of small objects into a single file in order to be processed later by another Java process. Performance is kind of important. Can anyone suggest a good method to achieve this?
ANSWER:
Hav... | [
"java",
"serialization"
] | 5 | 4 | 9,209 | 9 | 0 | 2008-09-24T20:22:20.473000 | 2008-09-24T20:26:33.240000 |
129,740 | 129,806 | Any good collection module in perl? | Can someone suggest a good module in perl which can be used to store collection of objects? Or is ARRAY a good enough substitute for most of the needs? Update: I am looking for a collections class because I want to be able to do an operation like compute collection level property from each element. Since I need to perf... | There are collection modules for more complex structures, but it is common style in Perl to use Arrays for arrays, stacks and lists. Perl has built in functions for using the array as a stack or list: push/pop, shift/unshift, splice (inserting or removing in the middle) and the foreach form for iteration. Perl also has... | Any good collection module in perl? Can someone suggest a good module in perl which can be used to store collection of objects? Or is ARRAY a good enough substitute for most of the needs? Update: I am looking for a collections class because I want to be able to do an operation like compute collection level property fro... | TITLE:
Any good collection module in perl?
QUESTION:
Can someone suggest a good module in perl which can be used to store collection of objects? Or is ARRAY a good enough substitute for most of the needs? Update: I am looking for a collections class because I want to be able to do an operation like compute collection ... | [
"perl",
"collections"
] | 2 | 4 | 2,397 | 8 | 0 | 2008-09-24T20:26:43.600000 | 2008-09-24T20:36:24.107000 |
129,772 | 129,864 | How to begin WPF development? | I've been using Winforms since.NET 1.1 and I want to start learning WPF. I'm looking for some good resources for a beginner in WPF. What should I read, what tools do I need, and what are the best practices I should follow? | Please have a look at this StackOverflow post, which has a list of book recommendations. In terms of best practices, get familiar with the M-V-VM pattern. It seems to have gained the most traction in WPF-land. Check out this post for what tools you can use for WPF development. The MSDN Forum is a great place for resour... | How to begin WPF development? I've been using Winforms since.NET 1.1 and I want to start learning WPF. I'm looking for some good resources for a beginner in WPF. What should I read, what tools do I need, and what are the best practices I should follow? | TITLE:
How to begin WPF development?
QUESTION:
I've been using Winforms since.NET 1.1 and I want to start learning WPF. I'm looking for some good resources for a beginner in WPF. What should I read, what tools do I need, and what are the best practices I should follow?
ANSWER:
Please have a look at this StackOverflow... | [
".net",
"wpf",
".net-3.5"
] | 40 | 21 | 21,303 | 14 | 0 | 2008-09-24T20:30:54.213000 | 2008-09-24T20:46:27.500000 |
129,773 | 129,805 | NHibernate : map to fields or properties? | When you create your mapping files, do you map your properties to fields or properties: [...] [...] Of course, please explain why:) Usually, I map to properties, but mapping to fields can enable to put some "logic" in the getters/setters of the properties. Is it "bad" to map to fields? Is there a best practice? | I map to properties. If I find it necessary, I map the SETTER to a field. (usually via something like "access=field.camelcase"). This lets me have nice looking Queries, e.g. "from People Where FirstName = 'John'" instead of something like "from People Where firstName/_firstName" and also avoid setter logic when hydrati... | NHibernate : map to fields or properties? When you create your mapping files, do you map your properties to fields or properties: [...] [...] Of course, please explain why:) Usually, I map to properties, but mapping to fields can enable to put some "logic" in the getters/setters of the properties. Is it "bad" to map to... | TITLE:
NHibernate : map to fields or properties?
QUESTION:
When you create your mapping files, do you map your properties to fields or properties: [...] [...] Of course, please explain why:) Usually, I map to properties, but mapping to fields can enable to put some "logic" in the getters/setters of the properties. Is ... | [
".net",
"nhibernate"
] | 12 | 5 | 8,368 | 7 | 0 | 2008-09-24T20:31:09.127000 | 2008-09-24T20:36:20.987000 |
129,808 | 129,897 | How can I schedule a job in Sql Agent (Sql Server 2005) via C# code? | Hi I'd like to schedule an existing job in the Sql Server 2005 agent via C# code... i.e. when someone clicks a button on an asp.net web page. How can I do this? Thanks! | Have a look here: SMO Job Class The SQL Server Management Objects (SMO) Class Library lets you do practically anything programmatically in SQL Server. | How can I schedule a job in Sql Agent (Sql Server 2005) via C# code? Hi I'd like to schedule an existing job in the Sql Server 2005 agent via C# code... i.e. when someone clicks a button on an asp.net web page. How can I do this? Thanks! | TITLE:
How can I schedule a job in Sql Agent (Sql Server 2005) via C# code?
QUESTION:
Hi I'd like to schedule an existing job in the Sql Server 2005 agent via C# code... i.e. when someone clicks a button on an asp.net web page. How can I do this? Thanks!
ANSWER:
Have a look here: SMO Job Class The SQL Server Manageme... | [
"c#",
"sql-server-2005",
"scheduled-tasks"
] | 2 | 1 | 2,774 | 2 | 0 | 2008-09-24T20:36:35.090000 | 2008-09-24T20:52:13.523000 |
129,815 | 129,889 | Code or formula for intersection of two parabolas in any rotation | I am working on a geometry problem that requires finding the intersection of two parabolic arcs in any rotation. I was able to intesect a line and a parabolic arc by rotating the plane to align the arc with an axis, but two parabolas cannot both align with an axis. I am working on deriving the formulas, but I would lik... | I'd first define the equation for the parabolic arc in 2D without rotations: x(t) = ax² + bx + c y(t) = t; You can now apply the rotation by building a rotation matrix: s = sin(angle) c = cos(angle)
matrix = | c -s | | s c | Apply that matrix and you'll get the rotated parametric equation: x' (t) = x(t) * c - s*t; y' ... | Code or formula for intersection of two parabolas in any rotation I am working on a geometry problem that requires finding the intersection of two parabolic arcs in any rotation. I was able to intesect a line and a parabolic arc by rotating the plane to align the arc with an axis, but two parabolas cannot both align wi... | TITLE:
Code or formula for intersection of two parabolas in any rotation
QUESTION:
I am working on a geometry problem that requires finding the intersection of two parabolic arcs in any rotation. I was able to intesect a line and a parabolic arc by rotating the plane to align the arc with an axis, but two parabolas ca... | [
"math",
"graphics",
"geometry",
"planerotation"
] | 5 | 6 | 4,033 | 3 | 0 | 2008-09-24T20:37:37.067000 | 2008-09-24T20:51:03.400000 |
129,826 | 129,831 | telneting backspace key is wrong | When I telnet into our works sun station my backspace key doesn't work. I use a temporary workaround of: $ stty erase ^H This works but each time I telnet in I have to retype this. How can I set this to work properly in my.cshrc file? | You can put stty erase ^H in your.cshrc file. This will fix the problem. | telneting backspace key is wrong When I telnet into our works sun station my backspace key doesn't work. I use a temporary workaround of: $ stty erase ^H This works but each time I telnet in I have to retype this. How can I set this to work properly in my.cshrc file? | TITLE:
telneting backspace key is wrong
QUESTION:
When I telnet into our works sun station my backspace key doesn't work. I use a temporary workaround of: $ stty erase ^H This works but each time I telnet in I have to retype this. How can I set this to work properly in my.cshrc file?
ANSWER:
You can put stty erase ^H... | [
"keyboard",
"solaris",
"telnet",
"xterm"
] | 4 | 6 | 7,107 | 3 | 0 | 2008-09-24T20:39:40.153000 | 2008-09-24T20:40:33.987000 |
129,828 | 1,383,922 | Slipping podcasts through a filter | My workplace filters our internet traffic by forcing us to go through a proxy, and unfortunately sites such as IT Conversations and Libsyn are blocked. However, mp3 files in general are not filtered, if they come from sites not on the proxy's blacklist. So is there a website somewhere that will let me give it a URL and... | I ended up writing an extremely dumb-and-simple cgi-script and hosting it on my web server, with a script on my work computer to get at it. Here's the CGI script: #!/usr/local/bin/python
import cgitb; cgitb.enable() import cgi from urllib2 import urlopen
def tohex(data): return "".join(hex(ord(char))[2:].rjust(2,"0")... | Slipping podcasts through a filter My workplace filters our internet traffic by forcing us to go through a proxy, and unfortunately sites such as IT Conversations and Libsyn are blocked. However, mp3 files in general are not filtered, if they come from sites not on the proxy's blacklist. So is there a website somewhere... | TITLE:
Slipping podcasts through a filter
QUESTION:
My workplace filters our internet traffic by forcing us to go through a proxy, and unfortunately sites such as IT Conversations and Libsyn are blocked. However, mp3 files in general are not filtered, if they come from sites not on the proxy's blacklist. So is there a... | [
"podcast"
] | 0 | 0 | 375 | 5 | 0 | 2008-09-24T20:40:07.780000 | 2009-09-05T18:04:08.687000 |
129,829 | 129,905 | Forms in SharePoint | If I want to put a form up on SharePoint, is it easier to use InfoPath or build a custom web part in C#? Are there other options that I should consider? What are the requirements and hurdles for each option? | Building forms using InfoPath is absolutely the easiest way to publish a form in SharePoint. Notice it has many limitations, and you might find yourself trying to put some problematic logic or need an extra feature. Programming in C# requires C# knowledge (of course) and a knowledge in SharePoint's APIs. Also, once com... | Forms in SharePoint If I want to put a form up on SharePoint, is it easier to use InfoPath or build a custom web part in C#? Are there other options that I should consider? What are the requirements and hurdles for each option? | TITLE:
Forms in SharePoint
QUESTION:
If I want to put a form up on SharePoint, is it easier to use InfoPath or build a custom web part in C#? Are there other options that I should consider? What are the requirements and hurdles for each option?
ANSWER:
Building forms using InfoPath is absolutely the easiest way to pu... | [
".net",
"sharepoint",
"forms",
"infopath"
] | 4 | 5 | 3,105 | 5 | 0 | 2008-09-24T20:40:22.647000 | 2008-09-24T20:53:35.190000 |
129,877 | 141,689 | How do I write a generic memoize function? | I'm writing a function to find triangle numbers and the natural way to write it is recursively: function triangle (x) if x == 0 then return 0 end return x+triangle(x-1) end But attempting to calculate the first 100,000 triangle numbers fails with a stack overflow after a while. This is an ideal function to memoize, but... | I bet something like this should work with variable argument lists in Lua: local function varg_tostring(...) local s = select(1,...) for n = 2, select('#',...) do s = s..","..select(n,...) end return s end
local function memoize(f) local cache = {} return function (...) local al = varg_tostring(...) if cache[al] then ... | How do I write a generic memoize function? I'm writing a function to find triangle numbers and the natural way to write it is recursively: function triangle (x) if x == 0 then return 0 end return x+triangle(x-1) end But attempting to calculate the first 100,000 triangle numbers fails with a stack overflow after a while... | TITLE:
How do I write a generic memoize function?
QUESTION:
I'm writing a function to find triangle numbers and the natural way to write it is recursively: function triangle (x) if x == 0 then return 0 end return x+triangle(x-1) end But attempting to calculate the first 100,000 triangle numbers fails with a stack over... | [
"optimization",
"recursion",
"lua",
"closures",
"memoization"
] | 11 | 5 | 9,452 | 15 | 0 | 2008-09-24T20:48:41.457000 | 2008-09-26T20:15:21.837000 |
129,890 | 130,142 | Pass NSMutableArray object | I'm getting lost in pointer land, I believe. I've got this (code syntax might be a little off, I am not looking at the machine with this code on it...but all the pertinent details are correct): NSMutableArray *tmp = [[NSMutableArray alloc] init]; I them pass that to a routine in another class - (BOOL)myRoutine: (NSMuta... | You don't need to call retain in this case. [[NSMutableArray alloc] init] creates the object with a retain count of 1, so it won't get released until you specifically release it. It would be good to see more of the code. I don't think the error is in the very small amount you've posted so far.. | Pass NSMutableArray object I'm getting lost in pointer land, I believe. I've got this (code syntax might be a little off, I am not looking at the machine with this code on it...but all the pertinent details are correct): NSMutableArray *tmp = [[NSMutableArray alloc] init]; I them pass that to a routine in another class... | TITLE:
Pass NSMutableArray object
QUESTION:
I'm getting lost in pointer land, I believe. I've got this (code syntax might be a little off, I am not looking at the machine with this code on it...but all the pertinent details are correct): NSMutableArray *tmp = [[NSMutableArray alloc] init]; I them pass that to a routin... | [
"objective-c"
] | 2 | 2 | 4,070 | 5 | 0 | 2008-09-24T20:51:06.600000 | 2008-09-24T21:40:10.600000 |
129,898 | 129,978 | Javascript and session variables | I have a database that stores events in it and a page with a calendar object on it. When rendering the days it looks through the months events and if any match the current day being rendered it creates a linkbutton to represent the event in the day on the calendar and adds it to that cell. I add some javascript to the ... | Your session vars are controlled by the server, JS runs client side, and as such cannot modify the vars directly. You need to make server requests using POST or GET and hidden iframes, or XMLHTTPRequest() calls to send data from the JS to the server, and then have your server side code handle the vars. Add another quer... | Javascript and session variables I have a database that stores events in it and a page with a calendar object on it. When rendering the days it looks through the months events and if any match the current day being rendered it creates a linkbutton to represent the event in the day on the calendar and adds it to that ce... | TITLE:
Javascript and session variables
QUESTION:
I have a database that stores events in it and a page with a calendar object on it. When rendering the days it looks through the months events and if any match the current day being rendered it creates a linkbutton to represent the event in the day on the calendar and ... | [
"javascript",
"session"
] | 3 | 7 | 45,431 | 5 | 0 | 2008-09-24T20:52:27.377000 | 2008-09-24T21:05:41.650000 |
129,911 | 140,518 | How can adding data to a segment in flash memory screw up a program's timing? | I have a real-time embedded app with the major cycle running at 10KHz. It runs on a TI TMS320C configured to boot from flash. I recently added an initialized array to a source file, and all of a sudden the timing is screwed up (in a way too complex to explain well - essentially a serial port write is no longer completi... | After more than a day staring at traces and generated assembly, I think I figured it out. The root cause problem turned out to be an design issue that caused glitches only if the ISR that kicked off the serial port write collided with a higher priority one. The timing just happened to work out that it only took adding ... | How can adding data to a segment in flash memory screw up a program's timing? I have a real-time embedded app with the major cycle running at 10KHz. It runs on a TI TMS320C configured to boot from flash. I recently added an initialized array to a source file, and all of a sudden the timing is screwed up (in a way too c... | TITLE:
How can adding data to a segment in flash memory screw up a program's timing?
QUESTION:
I have a real-time embedded app with the major cycle running at 10KHz. It runs on a TI TMS320C configured to boot from flash. I recently added an initialized array to a source file, and all of a sudden the timing is screwed ... | [
"c",
"performance",
"embedded",
"real-time"
] | 4 | 1 | 489 | 7 | 0 | 2008-09-24T20:54:20.537000 | 2008-09-26T16:22:28.637000 |
129,912 | 130,179 | Getting Python to use the ActiveTcl libraries | Is there any way to get Python to use my ActiveTcl installation instead of having to copy the ActiveTcl libraries into the Python/tcl directory? | Not familiar with ActiveTcl, but in general here is how to get a package/module to be loaded when that name already exists in the standard library: import sys dir_name="/usr/lib/mydir" sys.path.insert(0,dir_name) Substitute the value for dir_name with the path to the directory containing your package/module, and run th... | Getting Python to use the ActiveTcl libraries Is there any way to get Python to use my ActiveTcl installation instead of having to copy the ActiveTcl libraries into the Python/tcl directory? | TITLE:
Getting Python to use the ActiveTcl libraries
QUESTION:
Is there any way to get Python to use my ActiveTcl installation instead of having to copy the ActiveTcl libraries into the Python/tcl directory?
ANSWER:
Not familiar with ActiveTcl, but in general here is how to get a package/module to be loaded when that... | [
"python",
"activetcl"
] | 1 | 2 | 568 | 1 | 0 | 2008-09-24T20:54:21.223000 | 2008-09-24T21:48:23.903000 |
129,915 | 979,528 | <ProjectName.ProjectUI sucks as a name for my Netbeans java OS X app | What property in Netbeans to I need to change to set the name of my java swing app in the OS X menubar and dock? I found info.plist, but changing @PROJECTNAMEASIDENTIFIEER@ in multiple keys here had no effect. Thanks, hating netbeans. | The answer depends on how you run your application. If you run it from the command line, use '-Xdock:name=appname' in the JVM arguments. See the section "More tinkering with the menu bar" in the article linked to by Dan Dyer. If you are making a bundled, double-clickable application, however, you just need to set the s... | <ProjectName.ProjectUI sucks as a name for my Netbeans java OS X app What property in Netbeans to I need to change to set the name of my java swing app in the OS X menubar and dock? I found info.plist, but changing @PROJECTNAMEASIDENTIFIEER@ in multiple keys here had no effect. Thanks, hating netbeans. | TITLE:
<ProjectName.ProjectUI sucks as a name for my Netbeans java OS X app
QUESTION:
What property in Netbeans to I need to change to set the name of my java swing app in the OS X menubar and dock? I found info.plist, but changing @PROJECTNAMEASIDENTIFIEER@ in multiple keys here had no effect. Thanks, hating netbeans... | [
"java",
"macos",
"netbeans",
"menubar"
] | 2 | 2 | 647 | 3 | 0 | 2008-09-24T20:55:10.410000 | 2009-06-11T05:44:10.170000 |
129,917 | 129,956 | What is the best way to launch a web browser with a custom url from a C# application? | It's common knowledge that using System.Diagnostics.Process.Start is the way to launch a url from a C# applicaiton: System.Diagnostics.Process.Start(" http://www.mywebsite.com "); However, if this url is invalid the application seems to have no way of knowing that the call failed or why. Is there a better way to launch... | Try an approach as below. try { var url = new Uri("http://www.example.com/");
Process.Start(url.AbsoluteUri); } catch (UriFormatException) { // URL is not parsable } This does not ensure that the resource exist, but it does ensure the URL is wellformed. You might also want to check if the scheme is matching http or ht... | What is the best way to launch a web browser with a custom url from a C# application? It's common knowledge that using System.Diagnostics.Process.Start is the way to launch a url from a C# applicaiton: System.Diagnostics.Process.Start(" http://www.mywebsite.com "); However, if this url is invalid the application seems ... | TITLE:
What is the best way to launch a web browser with a custom url from a C# application?
QUESTION:
It's common knowledge that using System.Diagnostics.Process.Start is the way to launch a url from a C# applicaiton: System.Diagnostics.Process.Start(" http://www.mywebsite.com "); However, if this url is invalid the ... | [
"c#",
".net",
"browser"
] | 1 | 7 | 718 | 3 | 0 | 2008-09-24T20:55:49.007000 | 2008-09-24T21:01:58.133000 |
129,919 | 130,025 | Populating a database with file names from directories | I have an application which behaves as a slideshow for all pictures in a folder. It is written in Borland's C++ Builder (9). It currently uses some borrowed code to throw the filenames into a listbox and save the listbox items as a text file. I want to update this so that the filenames are stored in a proper database s... | You basically neeed to write a recursive function with a TDataSet parameter. (I could not compile my code, so you get it "as is") void AddFiles(AnsiString path, TDataSet *DataSet) { TSearchRec sr; int f; f = FindFirst(path+"\\*.*", faAnyFile, sr); while(!f ) { if(sr.Attr & faDirectory) { if(sr.Name!= "." && sr.Name!= "... | Populating a database with file names from directories I have an application which behaves as a slideshow for all pictures in a folder. It is written in Borland's C++ Builder (9). It currently uses some borrowed code to throw the filenames into a listbox and save the listbox items as a text file. I want to update this ... | TITLE:
Populating a database with file names from directories
QUESTION:
I have an application which behaves as a slideshow for all pictures in a folder. It is written in Borland's C++ Builder (9). It currently uses some borrowed code to throw the filenames into a listbox and save the listbox items as a text file. I wa... | [
"c++",
"sql",
"c++builder"
] | 0 | 1 | 1,254 | 1 | 0 | 2008-09-24T20:56:03.840000 | 2008-09-24T21:12:41.413000 |
129,920 | 355,791 | How do you sign your Firefox extensions? | I have developed a couple of extensions for Firefox, and am annoyed that it is so hard to get the extension signed. When an extension isn't signed, it says "Author not verified" when it is installed, and to me that just looks wrong. I have a simple build script that builds my.xpi file from sources, and I have a licence... | I've used the comodo certificate to sign XPIs. It was the cheapest option at the time. I've written a few posts on the XPI Forma t and a howto for signing using a java commandline tool. My tool XPISigner simplifies the process considerably and is integratable into build systems. I've removed the tool as it no longer wo... | How do you sign your Firefox extensions? I have developed a couple of extensions for Firefox, and am annoyed that it is so hard to get the extension signed. When an extension isn't signed, it says "Author not verified" when it is installed, and to me that just looks wrong. I have a simple build script that builds my.xp... | TITLE:
How do you sign your Firefox extensions?
QUESTION:
I have developed a couple of extensions for Firefox, and am annoyed that it is so hard to get the extension signed. When an extension isn't signed, it says "Author not verified" when it is installed, and to me that just looks wrong. I have a simple build script... | [
"firefox",
"build-automation",
"certificate",
"code-signing"
] | 16 | 3 | 4,621 | 6 | 0 | 2008-09-24T20:56:05.930000 | 2008-12-10T11:42:27.273000 |
129,927 | 129,998 | What's the best way to generate a Text file in a .net website? | I have a page in my vb.net web application that needs to toss a bunch of data into a text file and then present it to the user for download. What's the best / most efficient way to build such a text file on a.net web server? Edit: to answer a question down below, this is going to be a download once and then throw-away ... | The answer will depend on whether, as Forgotten Semicolon mentions, you need repeated downloads or once-and-done throwaways. Either way, the key will be to set the content-type of the output to ensure that a download window is displayed. The problem with straight text output is that the browser will attempt to display ... | What's the best way to generate a Text file in a .net website? I have a page in my vb.net web application that needs to toss a bunch of data into a text file and then present it to the user for download. What's the best / most efficient way to build such a text file on a.net web server? Edit: to answer a question down ... | TITLE:
What's the best way to generate a Text file in a .net website?
QUESTION:
I have a page in my vb.net web application that needs to toss a bunch of data into a text file and then present it to the user for download. What's the best / most efficient way to build such a text file on a.net web server? Edit: to answe... | [
".net",
"vb.net",
"download",
"text-files"
] | 3 | 4 | 3,823 | 4 | 0 | 2008-09-24T20:57:15.803000 | 2008-09-24T21:08:38.647000 |
129,945 | 129,986 | What does "0 but true" mean in Perl? | Can someone explain what exactly the string "0 but true" means in Perl? As far as I understand, it equals zero in an integer comparison, but evaluates to true when used as a boolean. Is this correct? Is this a normal behavior of the language or is this a special string treated as a special case in the interpreter? | It's normal behaviour of the language. Quoting the perlsyn manpage: The number 0, the strings '0' and "", the empty list (), and undef are all false in a boolean context. All other values are true. Negation of a true value by! or not returns a special false value. When evaluated as a string it is treated as "", but as ... | What does "0 but true" mean in Perl? Can someone explain what exactly the string "0 but true" means in Perl? As far as I understand, it equals zero in an integer comparison, but evaluates to true when used as a boolean. Is this correct? Is this a normal behavior of the language or is this a special string treated as a ... | TITLE:
What does "0 but true" mean in Perl?
QUESTION:
Can someone explain what exactly the string "0 but true" means in Perl? As far as I understand, it equals zero in an integer comparison, but evaluates to true when used as a boolean. Is this correct? Is this a normal behavior of the language or is this a special st... | [
"perl",
"integer",
"boolean"
] | 63 | 60 | 22,169 | 14 | 0 | 2008-09-24T21:00:46.497000 | 2008-09-24T21:06:27.763000 |
129,968 | 129,995 | How can I convert a JTS-Geometry into an AWT-Shape? | Is it possible to convert a com.vividsolutions.jts.geom.Geometry (or a subclass of it) into a class that implements java.awt.Shape? Which library or method can I use to achieve that goal? | According to: http://lists.jump-project.org/pipermail/jts-devel/2007-May/001954.html There's a class: com.vividsolutions.jump.workbench.ui.renderer.java2D.Java2DConverter which can do it? | How can I convert a JTS-Geometry into an AWT-Shape? Is it possible to convert a com.vividsolutions.jts.geom.Geometry (or a subclass of it) into a class that implements java.awt.Shape? Which library or method can I use to achieve that goal? | TITLE:
How can I convert a JTS-Geometry into an AWT-Shape?
QUESTION:
Is it possible to convert a com.vividsolutions.jts.geom.Geometry (or a subclass of it) into a class that implements java.awt.Shape? Which library or method can I use to achieve that goal?
ANSWER:
According to: http://lists.jump-project.org/pipermail... | [
"java",
"geometry",
"awt",
"shapes",
"jts"
] | 4 | 2 | 3,271 | 2 | 0 | 2008-09-24T21:03:32.577000 | 2008-09-24T21:08:24.047000 |
129,972 | 130,009 | Convert an image to XAML? | Does anyone know of any way to convert a simple gif to xaml? E.G. A tool that would look at an image and create elipses, rectangles and paths based upon a gif / jpg / bitmap? | Illustrator has a trace tool which will do this a cheaper option might be http://vectormagic.com it will export a svg that you should be able to convert to xaml | Convert an image to XAML? Does anyone know of any way to convert a simple gif to xaml? E.G. A tool that would look at an image and create elipses, rectangles and paths based upon a gif / jpg / bitmap? | TITLE:
Convert an image to XAML?
QUESTION:
Does anyone know of any way to convert a simple gif to xaml? E.G. A tool that would look at an image and create elipses, rectangles and paths based upon a gif / jpg / bitmap?
ANSWER:
Illustrator has a trace tool which will do this a cheaper option might be http://vectormagic... | [
"wpf",
"silverlight",
"xaml",
"expression-blend"
] | 11 | 11 | 32,727 | 4 | 0 | 2008-09-24T21:04:30.123000 | 2008-09-24T21:10:17.833000 |
129,993 | 130,010 | Initial skeleton for Firefox extensions? | I always seem to have a hard time starting a new Firefox extension. Can anyone recommend a good extension skeleton, scaffold, or code generator? Ideally one that follows all the best practices for FF extensions? | This one works nice: https://addons.mozilla.org/en-US/developers/tools/builder Of course googling for "firefox extension generator" is where I found it;) | Initial skeleton for Firefox extensions? I always seem to have a hard time starting a new Firefox extension. Can anyone recommend a good extension skeleton, scaffold, or code generator? Ideally one that follows all the best practices for FF extensions? | TITLE:
Initial skeleton for Firefox extensions?
QUESTION:
I always seem to have a hard time starting a new Firefox extension. Can anyone recommend a good extension skeleton, scaffold, or code generator? Ideally one that follows all the best practices for FF extensions?
ANSWER:
This one works nice: https://addons.mozi... | [
"firefox",
"firefox-addon",
"scaffolding"
] | 9 | 4 | 1,443 | 2 | 0 | 2008-09-24T21:08:06.107000 | 2008-09-24T21:10:33.510000 |
130,015 | 130,772 | Need to run a TCP server besides a Rails app | I have a Rails 2.0.2 application running with a postgresql db. The machine will receive data on a TCP port. I already have coded a working ruby multithreaded tcp server to receive the requests, but I need this code to run alongside my Rails app. So I guess I need to know how to span a new process inside Rails, or how t... | Why complicate things? Just run the applications -- your TCP server and the Rails application -- side by side. Either pull the model tier (and ActiveRecord) into your TCP server (svn::externals or Piston might work well for that) and let the communication between the two applications happen through the database, or let... | Need to run a TCP server besides a Rails app I have a Rails 2.0.2 application running with a postgresql db. The machine will receive data on a TCP port. I already have coded a working ruby multithreaded tcp server to receive the requests, but I need this code to run alongside my Rails app. So I guess I need to know how... | TITLE:
Need to run a TCP server besides a Rails app
QUESTION:
I have a Rails 2.0.2 application running with a postgresql db. The machine will receive data on a TCP port. I already have coded a working ruby multithreaded tcp server to receive the requests, but I need this code to run alongside my Rails app. So I guess ... | [
"ruby-on-rails",
"windows",
"tcp"
] | 1 | 1 | 1,482 | 3 | 0 | 2008-09-24T21:10:55.443000 | 2008-09-25T00:24:18.707000 |
130,020 | 130,046 | Dropdownlist control with <optgroup>s for asp.net (webforms)? | Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks | I've used the standard control in the past, and just added a simple ControlAdapter for it that would override the default behavior so it could render s in certain places. This works great even if you have controls that don't need the special behavior, because the additional feature doesn't get in the way. Note that thi... | Dropdownlist control with <optgroup>s for asp.net (webforms)? Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks | TITLE:
Dropdownlist control with <optgroup>s for asp.net (webforms)?
QUESTION:
Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks
ANSWER:
I've used the standard control in the past, and just added a simple ControlAdapter for it that would override the default behavior ... | [
"asp.net",
"drop-down-menu",
"custom-server-controls",
"webforms"
] | 65 | 47 | 53,500 | 12 | 0 | 2008-09-24T21:12:08.420000 | 2008-09-24T21:19:06.173000 |
130,021 | 130,096 | How can I make two browser windows share the same "session"? | I have an app that needs to open a new window (in the same domain) so the user can view a report, but on some browsers* the new window doesn't share the non-persistent cookie of the original window, which causes the user to have to sign in again. Is there anything I can do to stop the user having to sign in again in th... | IE7 does seem to generate new processes with a different algorithm than IE6, and can cause issues with session cookies. The most reliable solution is probably going to be to architect around it - either with cookieless sessions, a persistent cookie, or just serializing the data you need in the page. | How can I make two browser windows share the same "session"? I have an app that needs to open a new window (in the same domain) so the user can view a report, but on some browsers* the new window doesn't share the non-persistent cookie of the original window, which causes the user to have to sign in again. Is there any... | TITLE:
How can I make two browser windows share the same "session"?
QUESTION:
I have an app that needs to open a new window (in the same domain) so the user can view a report, but on some browsers* the new window doesn't share the non-persistent cookie of the original window, which causes the user to have to sign in a... | [
"session",
"browser"
] | 4 | 2 | 4,296 | 5 | 0 | 2008-09-24T21:12:22.943000 | 2008-09-24T21:29:23.293000 |
130,032 | 130,168 | Multi-line string in a PropertyGrid | Is there a built-in editor for a multi-line string in a PropertyGrid. | I found that System.Design.dll has System.ComponentModel.Design.MultilineStringEditor which can be used as follows: public class Stuff { [Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))] public string MultiLineProperty { get; set; } } | Multi-line string in a PropertyGrid Is there a built-in editor for a multi-line string in a PropertyGrid. | TITLE:
Multi-line string in a PropertyGrid
QUESTION:
Is there a built-in editor for a multi-line string in a PropertyGrid.
ANSWER:
I found that System.Design.dll has System.ComponentModel.Design.MultilineStringEditor which can be used as follows: public class Stuff { [Editor(typeof(MultilineStringEditor), typeof(UITy... | [
"c#",
".net",
"winforms",
"propertygrid"
] | 35 | 57 | 19,983 | 4 | 0 | 2008-09-24T21:14:46.760000 | 2008-09-24T21:46:15.250000 |
130,058 | 130,156 | how are serial generators / cracks developed? | I mean, I always was wondered about how the hell somebody can develop algorithms to break/cheat the constraints of legal use in many shareware programs out there. Just for curiosity. | Apart from being illegal, it's a very complex task. Speaking just at a teoretical level the common way is to disassemble the program to crack and try to find where the key or the serialcode is checked. Easier said than done since any serious protection scheme will check values in multiple places and also will derive cr... | how are serial generators / cracks developed? I mean, I always was wondered about how the hell somebody can develop algorithms to break/cheat the constraints of legal use in many shareware programs out there. Just for curiosity. | TITLE:
how are serial generators / cracks developed?
QUESTION:
I mean, I always was wondered about how the hell somebody can develop algorithms to break/cheat the constraints of legal use in many shareware programs out there. Just for curiosity.
ANSWER:
Apart from being illegal, it's a very complex task. Speaking jus... | [
"reverse-engineering",
"cracking"
] | 30 | 30 | 31,636 | 8 | 0 | 2008-09-24T21:21:22.330000 | 2008-09-24T21:43:10.233000 |
130,074 | 161,385 | Is there an inverse function for time.gmtime() that parses a UTC tuple to seconds since the epoch? | python's time module seems a little haphazard. For example, here is a list of methods in there, from the docstring: time() -- return current time in seconds since the Epoch as a float clock() -- return CPU time since process start as a float sleep() -- delay for a number of seconds given as a float gmtime() -- convert ... | There is actually an inverse function, but for some bizarre reason, it's in the calendar module: calendar.timegm(). I listed the functions in this answer. | Is there an inverse function for time.gmtime() that parses a UTC tuple to seconds since the epoch? python's time module seems a little haphazard. For example, here is a list of methods in there, from the docstring: time() -- return current time in seconds since the Epoch as a float clock() -- return CPU time since proc... | TITLE:
Is there an inverse function for time.gmtime() that parses a UTC tuple to seconds since the epoch?
QUESTION:
python's time module seems a little haphazard. For example, here is a list of methods in there, from the docstring: time() -- return current time in seconds since the Epoch as a float clock() -- return C... | [
"python"
] | 23 | 36 | 14,289 | 4 | 0 | 2008-09-24T21:24:04.727000 | 2008-10-02T08:42:45.617000 |
130,092 | 141,086 | CouchDB Document Model Changes? | Rails uses the concept of migrations to deal with model changes using the ActiveRecord API. CouchDB uses JSON (nested maps and arrays) to represent its model objects. In working with CouchDB so far, I don't see good ways of recognizing when the document's structure has changed (other than being disciplined as a develop... | Time for RDBMS de-brainwashing.:) One of the biggest points of couchdb's schema-less design is directly aimed at preventing the need for migrations. The JSON representation of objects makes it easy to just duck type your objects. For example, given that you have a blog type web app with posts and whatever fancy things ... | CouchDB Document Model Changes? Rails uses the concept of migrations to deal with model changes using the ActiveRecord API. CouchDB uses JSON (nested maps and arrays) to represent its model objects. In working with CouchDB so far, I don't see good ways of recognizing when the document's structure has changed (other tha... | TITLE:
CouchDB Document Model Changes?
QUESTION:
Rails uses the concept of migrations to deal with model changes using the ActiveRecord API. CouchDB uses JSON (nested maps and arrays) to represent its model objects. In working with CouchDB so far, I don't see good ways of recognizing when the document's structure has ... | [
"ruby-on-rails",
"ruby",
"couchdb"
] | 9 | 9 | 2,028 | 3 | 0 | 2008-09-24T21:28:28.710000 | 2008-09-26T18:19:22.380000 |
130,112 | 130,118 | Command line .cmd/.bat script, how to get directory of running script | How can you get the directory of the script that was run and use it within the.cmd file? | Raymond Chen has a few ideas: https://devblogs.microsoft.com/oldnewthing/20050128-00/?p=36573 Quoted here in full because MSDN archives tend to be somewhat unreliable: The easy way is to use the %CD% pseudo-variable. It expands to the current working directory. set OLDDIR=%CD%.. do stuff.. chdir /d %OLDDIR% &rem restor... | Command line .cmd/.bat script, how to get directory of running script How can you get the directory of the script that was run and use it within the.cmd file? | TITLE:
Command line .cmd/.bat script, how to get directory of running script
QUESTION:
How can you get the directory of the script that was run and use it within the.cmd file?
ANSWER:
Raymond Chen has a few ideas: https://devblogs.microsoft.com/oldnewthing/20050128-00/?p=36573 Quoted here in full because MSDN archive... | [
"batch-file"
] | 87 | 60 | 119,945 | 4 | 0 | 2008-09-24T21:32:26.483000 | 2008-09-24T21:34:20.770000 |
130,116 | 130,298 | Windows batch command(s) to read first line from text file | How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line. | Here's a general-purpose batch file to print the top n lines from a file like the GNU head utility, instead of just a single line. @echo off
if [%1] == [] goto usage if [%2] == [] goto usage
call:print_head %1 %2 goto:eof
REM REM print_head REM Prints the first non-blank %1 lines in the file %2. REM:print_head setlo... | Windows batch command(s) to read first line from text file How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line. | TITLE:
Windows batch command(s) to read first line from text file
QUESTION:
How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line.
ANSWER:
Here's a general-purpose batch file to print the top n lines from a file like the GNU head uti... | [
"batch-file",
"cmd"
] | 100 | 52 | 387,275 | 16 | 0 | 2008-09-24T21:33:27.730000 | 2008-09-24T22:20:14.950000 |
130,117 | 130,123 | If you shouldn't throw exceptions in a destructor, how do you handle errors in it? | Most people say never throw an exception out of a destructor - doing so results in undefined behavior. Stroustrup makes the point that "the vector destructor explicitly invokes the destructor for every element. This implies that if an element destructor throws, the vector destruction fails... There is really no good wa... | Throwing an exception out of a destructor is dangerous. If another exception is already propagating the application will terminate. But said "terminate" is a very well specified behaviour of majority of compilers, hence it's almost never "Undefined Behaviour" (depending on compiler). #include class Bad { public: // Add... | If you shouldn't throw exceptions in a destructor, how do you handle errors in it? Most people say never throw an exception out of a destructor - doing so results in undefined behavior. Stroustrup makes the point that "the vector destructor explicitly invokes the destructor for every element. This implies that if an el... | TITLE:
If you shouldn't throw exceptions in a destructor, how do you handle errors in it?
QUESTION:
Most people say never throw an exception out of a destructor - doing so results in undefined behavior. Stroustrup makes the point that "the vector destructor explicitly invokes the destructor for every element. This imp... | [
"c++",
"exception",
"destructor",
"raii"
] | 320 | 236 | 154,903 | 18 | 0 | 2008-09-24T21:34:01.177000 | 2008-09-24T21:35:59.893000 |
130,120 | 130,473 | Starteam 2005 COM API | Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#). I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views. Has anyone else tried this? | the Starteam object model is heirachical, projects contain views, views contain folders, folders contain items (child folders, files, cr's etc) So once you have your view list you can get the folders that belong to the view, then you have a few properties that determine how they map to the local file system, both the v... | Starteam 2005 COM API Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#). I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views. Has anyone else tried this? | TITLE:
Starteam 2005 COM API
QUESTION:
Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#). I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views. Has anyone else tried this?
ANSWER:... | [
"starteam"
] | 3 | 2 | 788 | 3 | 0 | 2008-09-24T21:35:01.610000 | 2008-09-24T23:00:02.013000 |
130,132 | 130,175 | Windows Forms Threading and Events - most efficient way to hand off events? | My form receives asynchronous callbacks from another object on random worker threads. I have been passing the data to the main thread (where it can be used to update onscreen controls) using delegates as shown below. Performance is dreadful -- once I reach 500 updates per second, the program completely locks up. My GUI... | You probably don't need to update UI on every event, but rather "not as often as X times per second". You may utilize StopWatch or other timing system to collect events during a period of time, and then update UI when appropriate. If you need to capture all events, collect them in the Queue and fire event every so ofte... | Windows Forms Threading and Events - most efficient way to hand off events? My form receives asynchronous callbacks from another object on random worker threads. I have been passing the data to the main thread (where it can be used to update onscreen controls) using delegates as shown below. Performance is dreadful -- ... | TITLE:
Windows Forms Threading and Events - most efficient way to hand off events?
QUESTION:
My form receives asynchronous callbacks from another object on random worker threads. I have been passing the data to the main thread (where it can be used to update onscreen controls) using delegates as shown below. Performan... | [
".net",
"winforms",
"multithreading"
] | 1 | 1 | 807 | 4 | 0 | 2008-09-24T21:38:04.100000 | 2008-09-24T21:47:25.123000 |
130,161 | 130,184 | IE6 issues with transparent PNGs | I've gotten used to the idea that if I want/need to use alpha-trans PNGs in a cross-browser manner, that I use a background image on a div and then, in IE6-only CSS, mark the background as "none" and include the proper "filter" argument. Is there another way? A better way? Is there a way to do this with the img tag and... | The bottom line is, if you want alpha transparency in a PNG, and you want it to work in IE6, then you need to have the AlphaImageLoader filter applied. Now, there are numerous ways to do it: Browser specific hacks, Conditional Comments, Javascript/JQuery/JLibraryOfChoice element iteration, Server-Side CSS-serving via U... | IE6 issues with transparent PNGs I've gotten used to the idea that if I want/need to use alpha-trans PNGs in a cross-browser manner, that I use a background image on a div and then, in IE6-only CSS, mark the background as "none" and include the proper "filter" argument. Is there another way? A better way? Is there a wa... | TITLE:
IE6 issues with transparent PNGs
QUESTION:
I've gotten used to the idea that if I want/need to use alpha-trans PNGs in a cross-browser manner, that I use a background image on a div and then, in IE6-only CSS, mark the background as "none" and include the proper "filter" argument. Is there another way? A better ... | [
"html",
"css",
"internet-explorer-6",
"png"
] | 14 | 13 | 1,443 | 7 | 0 | 2008-09-24T21:44:00.980000 | 2008-09-24T21:49:44.383000 |
130,165 | 130,181 | ASP.NET not seeing Radio Button value change | I have a form with some radio buttons that are disabled by default. When a value gets entered into a text box, the radio buttons are enabled via javascript. The user then selects one of the radio buttons and clicks on a submit button which posts back to the server. When I get back to the server, the radio button that u... | This has to do with how ASP.NET postback data. If a control is disabled control.enabled = false when the page is rendered than the values will not be posted back to the server. How I have solved it in the past is to set the disabled flag using attributes tags instead of using the Enabled property. So instead of control... | ASP.NET not seeing Radio Button value change I have a form with some radio buttons that are disabled by default. When a value gets entered into a text box, the radio buttons are enabled via javascript. The user then selects one of the radio buttons and clicks on a submit button which posts back to the server. When I ge... | TITLE:
ASP.NET not seeing Radio Button value change
QUESTION:
I have a form with some radio buttons that are disabled by default. When a value gets entered into a text box, the radio buttons are enabled via javascript. The user then selects one of the radio buttons and clicks on a submit button which posts back to the... | [
"asp.net",
"javascript"
] | 2 | 6 | 7,452 | 3 | 0 | 2008-09-24T21:44:54.770000 | 2008-09-24T21:48:45.837000 |
130,169 | 130,189 | config file syntax for configuring WCF Webservice Client Target EndPoint | What is the web config syntax for specifying a WCF WebService Proxy's Default Target Endpoint? Specifically, I'm trying to configure the address that the client uses for locating the.asmx of the webservice | Nevermind - found it. The answer is: Set the address attribute of the endpoint element. I.E. For anyone else who's challenged at searching MSDN like myself, the rest of the documentation for configuring client endpoints can be found at: http://msdn.microsoft.com/en-us/library/ms731762(VS.85).aspx | config file syntax for configuring WCF Webservice Client Target EndPoint What is the web config syntax for specifying a WCF WebService Proxy's Default Target Endpoint? Specifically, I'm trying to configure the address that the client uses for locating the.asmx of the webservice | TITLE:
config file syntax for configuring WCF Webservice Client Target EndPoint
QUESTION:
What is the web config syntax for specifying a WCF WebService Proxy's Default Target Endpoint? Specifically, I'm trying to configure the address that the client uses for locating the.asmx of the webservice
ANSWER:
Nevermind - fo... | [
".net",
"asp.net",
"wcf"
] | 1 | 1 | 1,648 | 1 | 0 | 2008-09-24T21:46:18.463000 | 2008-09-24T21:51:24.067000 |
130,170 | 130,194 | Is there a free/pay web service that I can query to get MLS data? | Given an MLS #, I'd like to get an XML document with details about the listing, like address, price and such. Not a NAR or CREA member. Mostly interested in North American rental property listing data. | If you're an NAR member, you can utilize their Internet Data Exchange (IDX) system, but it isn't available to non-members. | Is there a free/pay web service that I can query to get MLS data? Given an MLS #, I'd like to get an XML document with details about the listing, like address, price and such. Not a NAR or CREA member. Mostly interested in North American rental property listing data. | TITLE:
Is there a free/pay web service that I can query to get MLS data?
QUESTION:
Given an MLS #, I'd like to get an XML document with details about the listing, like address, price and such. Not a NAR or CREA member. Mostly interested in North American rental property listing data.
ANSWER:
If you're an NAR member, ... | [
"xml",
"web-services"
] | 10 | 3 | 15,152 | 3 | 0 | 2008-09-24T21:46:27.963000 | 2008-09-24T21:52:16.233000 |
130,186 | 827,264 | IE TextRange select method not working properly | I'm having an unusual problem with an IE document with contentEditable set to true. Calling select() on a range that is positioned at the end of a text node that immediately precedes a block element causes the selection to be shifted to the right one character and appear where it shouldn't. I've submitted a bug to Micr... | I've figured out a few methods for dealing with IE ranges like this. If all you want to do is save where the cursor is, and then restore it, you can use the pasteHTML method to insert an empty span at the current position of the cursor, and then use the moveToElementText method to put it back at that position again: //... | IE TextRange select method not working properly I'm having an unusual problem with an IE document with contentEditable set to true. Calling select() on a range that is positioned at the end of a text node that immediately precedes a block element causes the selection to be shifted to the right one character and appear ... | TITLE:
IE TextRange select method not working properly
QUESTION:
I'm having an unusual problem with an IE document with contentEditable set to true. Calling select() on a range that is positioned at the end of a text node that immediately precedes a block element causes the selection to be shifted to the right one cha... | [
"javascript",
"internet-explorer"
] | 7 | 12 | 12,522 | 4 | 0 | 2008-09-24T21:50:36.067000 | 2009-05-05T22:48:10.040000 |
130,193 | 130,202 | Is it possible to modify a registry entry via a .bat/.cmd script? | Is it possible to modify a registry value (whether string or DWORD) via a.bat/.cmd script? | You can use the REG command. From http://www.ss64.com/nt/reg.html: Syntax:
REG QUERY [ROOT\]RegKey /v ValueName [/s] REG QUERY [ROOT\]RegKey /ve --This returns the (default) value
REG ADD [ROOT\]RegKey /v ValueName [/t DataType] [/S Separator] [/d Data] [/f] REG ADD [ROOT\]RegKey /ve [/d Data] [/f] -- Set the (defaul... | Is it possible to modify a registry entry via a .bat/.cmd script? Is it possible to modify a registry value (whether string or DWORD) via a.bat/.cmd script? | TITLE:
Is it possible to modify a registry entry via a .bat/.cmd script?
QUESTION:
Is it possible to modify a registry value (whether string or DWORD) via a.bat/.cmd script?
ANSWER:
You can use the REG command. From http://www.ss64.com/nt/reg.html: Syntax:
REG QUERY [ROOT\]RegKey /v ValueName [/s] REG QUERY [ROOT\]R... | [
"windows",
"batch-file",
"cmd",
"automation",
"registry"
] | 53 | 42 | 192,522 | 8 | 0 | 2008-09-24T21:52:10.540000 | 2008-09-24T21:54:20.847000 |
130,208 | 130,241 | What's the best way to instantiate a generic from its name? | Assuming I have only the class name of a generic as a string in the form of "MyCustomGenericCollection(of MyCustomObjectClass)" and don't know the assembly it comes from, what is the easiest way to create an instance of that object? If it helps, I know that the class implements IMyCustomInterface and is from an assembl... | Once you parse it up, use Type.GetType(string) to get a reference to the types involved, then use Type.MakeGenericType(Type[]) to construct the specific generic type you need. Then, use Type.GetConstructor(Type[]) to get a reference to a constructor for the specific generic type, and finally call ConstructorInfo.Invoke... | What's the best way to instantiate a generic from its name? Assuming I have only the class name of a generic as a string in the form of "MyCustomGenericCollection(of MyCustomObjectClass)" and don't know the assembly it comes from, what is the easiest way to create an instance of that object? If it helps, I know that th... | TITLE:
What's the best way to instantiate a generic from its name?
QUESTION:
Assuming I have only the class name of a generic as a string in the form of "MyCustomGenericCollection(of MyCustomObjectClass)" and don't know the assembly it comes from, what is the easiest way to create an instance of that object? If it hel... | [
".net",
"vb.net",
"generics",
"reflection",
".net-2.0"
] | 3 | 8 | 3,909 | 3 | 0 | 2008-09-24T21:55:38.660000 | 2008-09-24T22:04:08.280000 |
130,227 | 130,449 | What is a good algorithm for compacting records in a blocked file? | Suppose you have a large file made up of a bunch of fixed size blocks. Each of these blocks contains some number of variable sized records. Each record must fit completely within a single block and then such records by definition are never larger than a full block. Over time, records are added to and deleted from these... | This sounds like a variation of the bin packing problem, but where you already have an inferior allocation that you want to improve. So I suggest looking at variations of the approaches which are successful for the bin packing problem. First of all, you probably want to parameterize your problem by defining what you co... | What is a good algorithm for compacting records in a blocked file? Suppose you have a large file made up of a bunch of fixed size blocks. Each of these blocks contains some number of variable sized records. Each record must fit completely within a single block and then such records by definition are never larger than a... | TITLE:
What is a good algorithm for compacting records in a blocked file?
QUESTION:
Suppose you have a large file made up of a bunch of fixed size blocks. Each of these blocks contains some number of variable sized records. Each record must fit completely within a single block and then such records by definition are n... | [
"algorithm",
"language-agnostic",
"np-complete",
"defragmentation",
"knapsack-problem"
] | 3 | 2 | 1,132 | 4 | 0 | 2008-09-24T22:01:19.690000 | 2008-09-24T22:54:37.580000 |
130,233 | 130,282 | Is it possible to do a SVN export without shell access? | I started using subversion for one of my projects and it would be absolutely amazing if I could just export the latest version from the repository on my production server by for example running a php or perl script. The production site is hosted with a shared hosting provider who doesn't allow shell access or for examp... | As far as I know there is no SVN client fully written in PHP or Perl. SO without exec you're out of luck. Workarounds: Depending on your own OS and what methods you have to access your web space you might be able to mount the web space in your local file system and just use your system's SVN client for checking out/upd... | Is it possible to do a SVN export without shell access? I started using subversion for one of my projects and it would be absolutely amazing if I could just export the latest version from the repository on my production server by for example running a php or perl script. The production site is hosted with a shared host... | TITLE:
Is it possible to do a SVN export without shell access?
QUESTION:
I started using subversion for one of my projects and it would be absolutely amazing if I could just export the latest version from the repository on my production server by for example running a php or perl script. The production site is hosted ... | [
"php",
"svn",
"export"
] | 1 | 1 | 1,641 | 3 | 0 | 2008-09-24T22:02:04.807000 | 2008-09-24T22:12:50.333000 |
130,237 | 130,255 | How to package a Linux binary for my Open Source application? | I have an Open Source app and I currently only post the binary for the Windows build. At this point Linux users have to get the source and compile it. Is there a standard way for posting a Linux binary? My app is in c / c++ and compiled with gcc, the only external Linux code I use is X Windows and CUPS. | The most common way would be to package it in a.rpm file for RedHat -based distros like Fedora, or a.deb file for Debian -based distros like Ubuntu. | How to package a Linux binary for my Open Source application? I have an Open Source app and I currently only post the binary for the Windows build. At this point Linux users have to get the source and compile it. Is there a standard way for posting a Linux binary? My app is in c / c++ and compiled with gcc, the only ex... | TITLE:
How to package a Linux binary for my Open Source application?
QUESTION:
I have an Open Source app and I currently only post the binary for the Windows build. At this point Linux users have to get the source and compile it. Is there a standard way for posting a Linux binary? My app is in c / c++ and compiled wit... | [
"c++",
"linux",
"binary",
"publish"
] | 6 | 4 | 1,317 | 7 | 0 | 2008-09-24T22:03:25.817000 | 2008-09-24T22:07:42.250000 |
130,240 | 130,244 | Can I use a generated variable name in PHP? | I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add all the values together with something like: $total = $value1 + $value2 +... + $value11; All the values I want to add together are coming from an H... | for ($i = 1; $i <= 3; $i++){ $varName = "pBalance".$i; $tempTotal += $$varName; } This will do what you want. However you might indeed consider using an array for this kind of thing. | Can I use a generated variable name in PHP? I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add all the values together with something like: $total = $value1 + $value2 +... + $value11; All the values... | TITLE:
Can I use a generated variable name in PHP?
QUESTION:
I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add all the values together with something like: $total = $value1 + $value2 +... + $value... | [
"php"
] | 1 | 7 | 1,408 | 9 | 0 | 2008-09-24T22:03:57.483000 | 2008-09-24T22:05:12.457000 |
130,262 | 130,309 | How do I efficiently filter computed values within a Python list comprehension? | The Python list comprehension syntax makes it easy to filter values within a comprehension. For example: result = [x**2 for x in mylist if type(x) is int] Will return a list of the squares of integers in mylist. However, what if the test involves some (costly) computation and you want to filter on the result? One optio... | If the calculations are already nicely bundled into functions, how about using filter and map? result = filter (None, map (expensive, mylist)) You can use itertools.imap if the list is very large. | How do I efficiently filter computed values within a Python list comprehension? The Python list comprehension syntax makes it easy to filter values within a comprehension. For example: result = [x**2 for x in mylist if type(x) is int] Will return a list of the squares of integers in mylist. However, what if the test in... | TITLE:
How do I efficiently filter computed values within a Python list comprehension?
QUESTION:
The Python list comprehension syntax makes it easy to filter values within a comprehension. For example: result = [x**2 for x in mylist if type(x) is int] Will return a list of the squares of integers in mylist. However, w... | [
"python",
"list-comprehension"
] | 24 | 23 | 8,199 | 10 | 0 | 2008-09-24T22:08:57.363000 | 2008-09-24T22:23:50.137000 |
130,273 | 130,319 | .cmd and .bat file converting return code to an error message | I'm trying to automate a program I made with a test suite via a.cmd file. I can get the program that I ran's return code via %errorlevel%. My program has certain return codes for each type of error. For example: 1 - means failed for such and such a reason 2 - means failed for some other reason... echo FAILED: Test case... | You can do this quite neatly with the ENABLEDELAYEDEXPANSION option. This allows you to use! as variable marker that is evaluated after %. REM Turn on Delayed Expansion SETLOCAL ENABLEDELAYEDEXPANSION
REM Define messages as variables with the ERRORLEVEL on the end of the name SET MESSAGE0=Everything is fine SET MESSAG... | .cmd and .bat file converting return code to an error message I'm trying to automate a program I made with a test suite via a.cmd file. I can get the program that I ran's return code via %errorlevel%. My program has certain return codes for each type of error. For example: 1 - means failed for such and such a reason 2 ... | TITLE:
.cmd and .bat file converting return code to an error message
QUESTION:
I'm trying to automate a program I made with a test suite via a.cmd file. I can get the program that I ran's return code via %errorlevel%. My program has certain return codes for each type of error. For example: 1 - means failed for such an... | [
"batch-file",
"cmd",
"build-automation"
] | 6 | 14 | 30,836 | 6 | 0 | 2008-09-24T22:11:03.507000 | 2008-09-24T22:29:37.190000 |
130,287 | 130,365 | streaming wav files | I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible? Bonus question: how would I do it if the stream was in mp3 or other format? This is for windows in nativ... | Because you've said WMP, I'm assuming the question applies to trying to play a wav file on a windows machine. If not, this answer isn't relevant. What you want to do isn't trivial. There is a good article here on code project that describes the windows audio model. It describes how to set up the audio device and how to... | streaming wav files I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible? Bonus question: how would I do it if the stream was in mp3 or other format? This is ... | TITLE:
streaming wav files
QUESTION:
I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible? Bonus question: how would I do it if the stream was in mp3 or othe... | [
"c++",
"stream",
"wav"
] | 4 | 3 | 5,417 | 3 | 0 | 2008-09-24T22:15:55.567000 | 2008-09-24T22:38:36.620000 |
130,306 | 130,401 | Getting stated with NHibernate. Real world project example? | One of my goals over the next few months is to get familiar with NHibernate and am curious if anyone out there has any suggestions of where to begin. Preferably, I'd like to find a example project that demonstrates what you would see in an in-the-field application. | I pretty much based the first iteration of an application architecture solely on this article from CodeProject: NHibernate Best Practices. Also check out this blog: Ayende @ Rahien | Getting stated with NHibernate. Real world project example? One of my goals over the next few months is to get familiar with NHibernate and am curious if anyone out there has any suggestions of where to begin. Preferably, I'd like to find a example project that demonstrates what you would see in an in-the-field applica... | TITLE:
Getting stated with NHibernate. Real world project example?
QUESTION:
One of my goals over the next few months is to get familiar with NHibernate and am curious if anyone out there has any suggestions of where to begin. Preferably, I'd like to find a example project that demonstrates what you would see in an in... | [
"nhibernate"
] | 4 | 3 | 7,831 | 3 | 0 | 2008-09-24T22:23:37.033000 | 2008-09-24T22:46:46.040000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.