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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71,944 | 72,221 | How do I Validate the File Type of a File Upload? | I am using to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to.xls or.xlsx file extensions). Both JavaScript or server-side validation are OK (as long as the server side validation would take place before the files are being uploaded - there could be some ver... | Seems like you are going to have limited options since you want the check to occur before the upload. I think the best you are going to get is to use javascript to validate the extension of the file. You could build a hash of valid extensions and then look to see if the extension of the file being uploaded existed in t... | How do I Validate the File Type of a File Upload? I am using to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to.xls or.xlsx file extensions). Both JavaScript or server-side validation are OK (as long as the server side validation would take place before the ... | TITLE:
How do I Validate the File Type of a File Upload?
QUESTION:
I am using to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to.xls or.xlsx file extensions). Both JavaScript or server-side validation are OK (as long as the server side validation would take... | [
"asp.net",
"javascript",
"validation",
"file",
"upload"
] | 36 | 31 | 149,788 | 15 | 0 | 2008-09-16T13:01:15.260000 | 2008-09-16T13:34:40.967000 |
71,955 | 71,974 | When choosing an ORM, is LINQ to SQL or LINQ to Entities better than NHibernate? | I find I can do more with NHibernate, and even Castle than with the Linq to Entities, or linq to SQL. Am I crazy? | No you're not crazy. nHibernate is a full OR Mapper, Linq to SQL and Linq to Entities don't implement everything you'd expect from an OR mapper and targeted at a slightly different group of developers. But don't let that put you off linq though. Linq is still a pretty good idea.. Try Linq to nHibernate:-) | When choosing an ORM, is LINQ to SQL or LINQ to Entities better than NHibernate? I find I can do more with NHibernate, and even Castle than with the Linq to Entities, or linq to SQL. Am I crazy? | TITLE:
When choosing an ORM, is LINQ to SQL or LINQ to Entities better than NHibernate?
QUESTION:
I find I can do more with NHibernate, and even Castle than with the Linq to Entities, or linq to SQL. Am I crazy?
ANSWER:
No you're not crazy. nHibernate is a full OR Mapper, Linq to SQL and Linq to Entities don't implem... | [
"nhibernate",
"linq-to-sql",
"orm"
] | 7 | 18 | 5,293 | 6 | 0 | 2008-09-16T13:03:05.723000 | 2008-09-16T13:05:34.547000 |
71,971 | 72,268 | IIS is keeping hold of my generated files | My web application generates pdf files and either e-mails or faxes them to our customers. Somehow IIS6 is keeping hold of the file and blocking any other requests for it claiming the old '..the process cannot access the file 'xxx.pdf' because it is being used by another process.' When I recycle the application pool all... | As with everyone said, do call the Close and Dispose method on any IO objects you have open when reading/writing the PDF files. But I suppose you'd incorporated a 3rd party component? to do the PDF writing for you? If that's the case you might want to check with the vendor and/or its documentation to make sure that you... | IIS is keeping hold of my generated files My web application generates pdf files and either e-mails or faxes them to our customers. Somehow IIS6 is keeping hold of the file and blocking any other requests for it claiming the old '..the process cannot access the file 'xxx.pdf' because it is being used by another process... | TITLE:
IIS is keeping hold of my generated files
QUESTION:
My web application generates pdf files and either e-mails or faxes them to our customers. Somehow IIS6 is keeping hold of the file and blocking any other requests for it claiming the old '..the process cannot access the file 'xxx.pdf' because it is being used ... | [
"asp.net",
"iis"
] | 2 | 6 | 4,859 | 5 | 0 | 2008-09-16T13:05:20.740000 | 2008-09-16T13:38:26.917000 |
71,985 | 72,181 | Emacs equivalent of Vim's yy10p? | How can I copy a line 10 times easily in Emacs? I can't find a copy-line shortcut or function. I can use C-aC-spcC-eM-w to laboriously copy the line but how can I then paste it more than once? Any ideas before I go and write my own functions. | Copying: If you frequently work with lines, you might want to make copy ( kill-ring-save ) and cut ( kill-region ) work on lines when no region is selected: (defadvice kill-ring-save (before slickcopy activate compile) "When called interactively with no active region, copy a single line instead." (interactive (if mark-... | Emacs equivalent of Vim's yy10p? How can I copy a line 10 times easily in Emacs? I can't find a copy-line shortcut or function. I can use C-aC-spcC-eM-w to laboriously copy the line but how can I then paste it more than once? Any ideas before I go and write my own functions. | TITLE:
Emacs equivalent of Vim's yy10p?
QUESTION:
How can I copy a line 10 times easily in Emacs? I can't find a copy-line shortcut or function. I can use C-aC-spcC-eM-w to laboriously copy the line but how can I then paste it more than once? Any ideas before I go and write my own functions.
ANSWER:
Copying: If you f... | [
"emacs",
"editor",
"shortcut"
] | 23 | 11 | 10,864 | 11 | 0 | 2008-09-16T13:06:39.053000 | 2008-09-16T13:30:57.700000 |
72,010 | 72,075 | C++ overload resolution | Given the following example, why do I have to explicitly use the statement b->A::DoSomething() rather than just b->DoSomething()? Shouldn't the compiler's overload resolution figure out which method I'm talking about? I'm using Microsoft VS 2005. (Note: using virtual doesn't help in this case.) class A { public: int Do... | The two “overloads” aren't in the same scope. By default, the compiler only considers the smallest possible name scope until it finds a name match. Argument matching is done afterwards. In your case this means that the compiler sees B::DoSomething. It then tries to match the argument list, which fails. One solution wou... | C++ overload resolution Given the following example, why do I have to explicitly use the statement b->A::DoSomething() rather than just b->DoSomething()? Shouldn't the compiler's overload resolution figure out which method I'm talking about? I'm using Microsoft VS 2005. (Note: using virtual doesn't help in this case.) ... | TITLE:
C++ overload resolution
QUESTION:
Given the following example, why do I have to explicitly use the statement b->A::DoSomething() rather than just b->DoSomething()? Shouldn't the compiler's overload resolution figure out which method I'm talking about? I'm using Microsoft VS 2005. (Note: using virtual doesn't he... | [
"c++",
"function",
"overloading",
"resolution"
] | 42 | 44 | 13,748 | 9 | 0 | 2008-09-16T13:09:10.827000 | 2008-09-16T13:18:27.153000 |
72,014 | 72,113 | Best Practices for embedding .NET assemblies in SQL Server | What are some important practices to follow when creating a.NET assembly that is going to be embedded to SQL Server 2005? I am brand new to this, and I've found that there are significant method attributes like: [SqlFunction(FillRowMethodName = "FillRow", TableDefinition = "letter nchar(1)")] I'm also looking for commo... | Some that I remember: Keep its usage to a minimum, only use it when T-SQL proved too complex. Avoid pointers/cursors at all costs because a for loop is so easily abusable in CLR context. Only use the SQL-Server native data types unless totally necessary. Can't remember where I've found the information, but those are so... | Best Practices for embedding .NET assemblies in SQL Server What are some important practices to follow when creating a.NET assembly that is going to be embedded to SQL Server 2005? I am brand new to this, and I've found that there are significant method attributes like: [SqlFunction(FillRowMethodName = "FillRow", Table... | TITLE:
Best Practices for embedding .NET assemblies in SQL Server
QUESTION:
What are some important practices to follow when creating a.NET assembly that is going to be embedded to SQL Server 2005? I am brand new to this, and I've found that there are significant method attributes like: [SqlFunction(FillRowMethodName ... | [
".net",
"sql-server-2005",
"assemblies"
] | 1 | 2 | 738 | 3 | 0 | 2008-09-16T13:09:32.277000 | 2008-09-16T13:24:26.687000 |
72,036 | 72,095 | Best way to implement mutliple Default Buttons on a ASP.NET Webform | What is the best way to implement mutliple Default Buttons on a ASP.NET Webform? I have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a single search field with a search button. | asp:Panel has a property named DefaultButton. You just need to encapsulate your markup portions with appropriate panels and set the default buttons for each. | Best way to implement mutliple Default Buttons on a ASP.NET Webform What is the best way to implement mutliple Default Buttons on a ASP.NET Webform? I have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a single search fiel... | TITLE:
Best way to implement mutliple Default Buttons on a ASP.NET Webform
QUESTION:
What is the best way to implement mutliple Default Buttons on a ASP.NET Webform? I have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a ... | [
"asp.net",
"webforms"
] | 1 | 8 | 447 | 3 | 0 | 2008-09-16T13:13:14.997000 | 2008-09-16T13:21:15.617000 |
72,070 | 232,380 | Problem with SET FMTONLY ON | I'm executing stored procedures using SET FMTONLY ON, in order to emulate what our code generator does. However, it seems that the results are cached when executed like this, as I'm still getting a Conversion failed error from a proc that I have just dropped! This happens even when I execute the proc without SET FMTONL... | Some statements will still be executed, even with SET FMTONLY ON. You "Conversion failed" error could be from something as simple as a set variable statement in the stored proc. For example, this returns the metadata for the first query, but throws an exception when it runs the last statement: SET FMTONLY on
select 1 ... | Problem with SET FMTONLY ON I'm executing stored procedures using SET FMTONLY ON, in order to emulate what our code generator does. However, it seems that the results are cached when executed like this, as I'm still getting a Conversion failed error from a proc that I have just dropped! This happens even when I execute... | TITLE:
Problem with SET FMTONLY ON
QUESTION:
I'm executing stored procedures using SET FMTONLY ON, in order to emulate what our code generator does. However, it seems that the results are cached when executed like this, as I'm still getting a Conversion failed error from a proc that I have just dropped! This happens e... | [
"sql-server"
] | 1 | 1 | 8,042 | 3 | 0 | 2008-09-16T13:17:49.760000 | 2008-10-24T03:19:57.667000 |
72,090 | 72,245 | How to implement "DOM Ready" event in a GreaseMonkey script? | I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires. I'm using FireFox 2.0.0.16 / GreaseMonkey 0.8.20080609 This is the full script that I'm trying to modify, changing: window.addEventListener ("load", doStuff, false); to window.addEventListene... | So I googled greasemonkey dom ready and the first result seemed to say that the greasemonkey script is actually running at "DOM ready" so you just need to remove the onload call and run the script straight away. I removed the window.addEventListener ("load", function() { and }, false); wrapping and it worked perfectly.... | How to implement "DOM Ready" event in a GreaseMonkey script? I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires. I'm using FireFox 2.0.0.16 / GreaseMonkey 0.8.20080609 This is the full script that I'm trying to modify, changing: window.addEven... | TITLE:
How to implement "DOM Ready" event in a GreaseMonkey script?
QUESTION:
I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires. I'm using FireFox 2.0.0.16 / GreaseMonkey 0.8.20080609 This is the full script that I'm trying to modify, changi... | [
"javascript",
"firefox",
"greasemonkey"
] | 21 | 27 | 28,973 | 3 | 0 | 2008-09-16T13:20:58.083000 | 2008-09-16T13:36:42.850000 |
72,103 | 72,339 | How do I reference a local resource in generated HTML in WinForms WebBrowser control? | I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I want to use some images in the markup. (I also would prefer to use linked CSS and JavaScript, however, that can be worked aro... | Here's what we do, although I should mention that we use a custom web browser to remove such things as the ability to right-click and see the good old IE context menu: public class HtmlFormatter { /// /// Indicator that this is a URI referencing the local /// file path. /// public static readonly string FILE_URL_PREFIX... | How do I reference a local resource in generated HTML in WinForms WebBrowser control? I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I want to use some images in the markup. ... | TITLE:
How do I reference a local resource in generated HTML in WinForms WebBrowser control?
QUESTION:
I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I want to use some imag... | [
".net",
"winforms",
"webbrowser-control"
] | 3 | 5 | 10,518 | 5 | 0 | 2008-09-16T13:22:02.980000 | 2008-09-16T13:43:23.410000 |
72,104 | 72,190 | How do I use PDB files | I have heard using PDB files can help diagnose where a crash occurred. My basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?) Can someone please explain how it all works / what is involved? (Thank you!) | PDB files are generated when you build your project. They contain information relating to the built binaries which Visual Studio can interpret. When a program crashes and it generates a crash report, Visual Studio is able to take that report and link it back to the source code via the PDB file for the application. PDB ... | How do I use PDB files I have heard using PDB files can help diagnose where a crash occurred. My basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?) Can someone please explain how it all works / what is involved? (Thank you!) | TITLE:
How do I use PDB files
QUESTION:
I have heard using PDB files can help diagnose where a crash occurred. My basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?) Can someone please explain how it all works / what is involved? (Thank you!)
AN... | [
"debugging",
"crash",
"pdb-files"
] | 49 | 38 | 47,207 | 3 | 0 | 2008-09-16T13:22:10.687000 | 2008-09-16T13:31:34.610000 |
72,123 | 72,324 | What are some common misunderstandings about TDD? | Reading over the responses to this question Disadvantages of Test Driven Development? I got the impression there is alot of misunderstanding on what TDD is and how it should be conducted. It may prove useful to address these issues here. | I feel the accepted answer was one of the weakest ( Disadvantages of Test Driven Development? ), and the most up-modded answer smells of someone who might be writing over specified tests. Big time investment: for the simple case you lose about 20% of the actual implementation, but for complicated cases you lose much mo... | What are some common misunderstandings about TDD? Reading over the responses to this question Disadvantages of Test Driven Development? I got the impression there is alot of misunderstanding on what TDD is and how it should be conducted. It may prove useful to address these issues here. | TITLE:
What are some common misunderstandings about TDD?
QUESTION:
Reading over the responses to this question Disadvantages of Test Driven Development? I got the impression there is alot of misunderstanding on what TDD is and how it should be conducted. It may prove useful to address these issues here.
ANSWER:
I fee... | [
"tdd"
] | 11 | 13 | 1,296 | 6 | 0 | 2008-09-16T13:25:06.390000 | 2008-09-16T13:42:35.597000 |
72,125 | 73,077 | How do you pass an authenticated session between app domains | Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user goes to www.abc.com and they get authenticated through the normal ASP.NET membership provider. Then, from that site, they get sent to (redirection, linked, whatever works) site www.xyz.com, and the intent of site www.abc.com was to pass t... | Try using FormAuthentication by setting the web.config authentication section like so: Generate a machine key. Example: Easiest way to generate MachineKey – Tips and tricks: ASP.NET, IIS... When posting to the other application the authentication ticket is passed as a hidden field. While reading the post from the first... | How do you pass an authenticated session between app domains Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user goes to www.abc.com and they get authenticated through the normal ASP.NET membership provider. Then, from that site, they get sent to (redirection, linked, whatever works) site ... | TITLE:
How do you pass an authenticated session between app domains
QUESTION:
Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user goes to www.abc.com and they get authenticated through the normal ASP.NET membership provider. Then, from that site, they get sent to (redirection, linked, wha... | [
"c#",
"asp.net",
"asp.net-membership",
"membership"
] | 9 | 5 | 8,536 | 8 | 0 | 2008-09-16T13:25:10.240000 | 2008-09-16T14:41:42.460000 |
72,128 | 72,238 | Fastest way to find if a 3D coordinate is already used | Using C++ (and Qt), I need to process a big amount of 3D coordinates. Specifically, when I receive a 3D coordinate (made of 3 doubles), I need to check in a list if this coordinate has already been processed. If not, then I process it and add it to the list (or container). The amount of coordinates can become very big,... | Probably the simplest way to speed up such processing is to store the already-processed points in Octree. Checking for duplication will become close to logarithmic. Also, make sure you tolerate round-off errors by checking the distance between the points, not the equality of the coordinates. | Fastest way to find if a 3D coordinate is already used Using C++ (and Qt), I need to process a big amount of 3D coordinates. Specifically, when I receive a 3D coordinate (made of 3 doubles), I need to check in a list if this coordinate has already been processed. If not, then I process it and add it to the list (or con... | TITLE:
Fastest way to find if a 3D coordinate is already used
QUESTION:
Using C++ (and Qt), I need to process a big amount of 3D coordinates. Specifically, when I receive a 3D coordinate (made of 3 doubles), I need to check in a list if this coordinate has already been processed. If not, then I process it and add it t... | [
"c++",
"performance"
] | 3 | 7 | 5,112 | 19 | 0 | 2008-09-16T13:25:23.940000 | 2008-09-16T13:36:14.990000 |
72,151 | 72,179 | ORA-00933: SQL command not properly ended | I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert into ps_tl_compleave_tbl values('4327142'... | To me it seems you're missing a; between the two statements: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000); insert into ps_tl_compleave_tbl values('4327142', 0, TO_DATE('03/23/2002', 'MM/DD/YYYY'), ... | ORA-00933: SQL command not properly ended I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert... | TITLE:
ORA-00933: SQL command not properly ended
QUESTION:
I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000... | [
"sql",
"oracle",
"ora-00933"
] | 6 | 3 | 63,886 | 10 | 0 | 2008-09-16T13:27:53.823000 | 2008-09-16T13:30:55.970000 |
72,153 | 72,536 | MSBuild ItemGroup, excluding .svn directories and files within | How can I construct a MSBuild ItemGroup to exclude.svn directories and all files within (recursively). I've got: At the moment, but this does not exclude anything! | Thanks for your help, managed to sort it as follows: Turns out the pattern matching basically runs on files, so you have to exclude everything BELOW the.svn directories (.svn\\** ) for MSBuild to exclude the.svn directory itself. | MSBuild ItemGroup, excluding .svn directories and files within How can I construct a MSBuild ItemGroup to exclude.svn directories and all files within (recursively). I've got: At the moment, but this does not exclude anything! | TITLE:
MSBuild ItemGroup, excluding .svn directories and files within
QUESTION:
How can I construct a MSBuild ItemGroup to exclude.svn directories and all files within (recursively). I've got: At the moment, but this does not exclude anything!
ANSWER:
Thanks for your help, managed to sort it as follows: Turns out the... | [
".net",
"msbuild",
"continuous-integration"
] | 40 | 64 | 13,050 | 4 | 0 | 2008-09-16T13:28:06.710000 | 2008-09-16T13:57:29.650000 |
72,166 | 74,513 | Penetration testing tools | We have hundreds of websites which were developed in asp,.net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes. Are there any (good) software (paid or free) to do this? or.. are there any technical articles which can help me develop... | There are a couple different directions you can go with automated testing tools for web applications. First, there are the commercial web scanners, of which HP WebInspect and Rational AppScan are the two most popular. These are "all-in-one", "fire-and-forget" tools that you download and install on an internal Windows d... | Penetration testing tools We have hundreds of websites which were developed in asp,.net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes. Are there any (good) software (paid or free) to do this? or.. are there any technical articles... | TITLE:
Penetration testing tools
QUESTION:
We have hundreds of websites which were developed in asp,.net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes. Are there any (good) software (paid or free) to do this? or.. are there any ... | [
"sql",
"security",
"sql-injection"
] | 46 | 70 | 11,815 | 12 | 0 | 2008-09-16T13:29:35.473000 | 2008-09-16T16:56:22.403000 |
72,168 | 73,805 | Does LINQ To SQL provide faster response times than using ado.net and oledb? | LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan built, and then executed, which takes precious cycles. Stored procedures have a... | LINQ to SQL actually presents some alarming performance problems in the database. Basically, it creates multiple execution plans based on the length of the parameter you are using. I posted about it a while back on my blog LINQ to SQL may cause performance problems. Now, is that to say that LINQ doesn't have a place? H... | Does LINQ To SQL provide faster response times than using ado.net and oledb? LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan bu... | TITLE:
Does LINQ To SQL provide faster response times than using ado.net and oledb?
QUESTION:
LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-check... | [
"sql-server",
"database",
"linq-to-sql"
] | 8 | 6 | 6,138 | 7 | 0 | 2008-09-16T13:29:40.607000 | 2008-09-16T15:48:57.027000 |
72,176 | 72,822 | Using C#, what is the most efficient method of converting a string containing binary data to an array of bytes | While there are 100 ways to solve the conversion problem, I am focusing on performance. Give that the string only contains binary data, what is the fastest method, in terms of performance, of converting that data to a byte[] (not char[]) under C#? Clarification: This is not ASCII data, rather binary data that happens t... | I'm not sure ASCIIEncoding.GetBytes is going to do it, because it only supports the range 0x0000 to 0x007F. You tell the string contains only bytes. But a.NET string is an array of chars, and 1 char is 2 bytes (because a.NET stores strings as UTF16). So you can either have two situations for storing the bytes 0x42 and ... | Using C#, what is the most efficient method of converting a string containing binary data to an array of bytes While there are 100 ways to solve the conversion problem, I am focusing on performance. Give that the string only contains binary data, what is the fastest method, in terms of performance, of converting that d... | TITLE:
Using C#, what is the most efficient method of converting a string containing binary data to an array of bytes
QUESTION:
While there are 100 ways to solve the conversion problem, I am focusing on performance. Give that the string only contains binary data, what is the fastest method, in terms of performance, of... | [
"c#",
"arrays"
] | 3 | 3 | 3,671 | 4 | 0 | 2008-09-16T13:30:40.057000 | 2008-09-16T14:20:52.057000 |
72,185 | 81,367 | Column Info only Returned with FMTONLY set to OFF | I have a query that is dynamically built after looking up a field list and table name. I execute this dynamic query inside a stored proc. The query is built without a where clause when the two proc parameters are zero, and built with a where clause when not. When I execute the proc with SET FMTONLY ON exec [cpExportRec... | kristof: so you do not have data to build you dynamic query. With null parameters my dynamic query was a pure string literal, independent of data. Changing it to a static query solved the problem. | Column Info only Returned with FMTONLY set to OFF I have a query that is dynamically built after looking up a field list and table name. I execute this dynamic query inside a stored proc. The query is built without a where clause when the two proc parameters are zero, and built with a where clause when not. When I exec... | TITLE:
Column Info only Returned with FMTONLY set to OFF
QUESTION:
I have a query that is dynamically built after looking up a field list and table name. I execute this dynamic query inside a stored proc. The query is built without a where clause when the two proc parameters are zero, and built with a where clause whe... | [
"sql-server"
] | 1 | 0 | 1,578 | 2 | 0 | 2008-09-16T13:31:16.327000 | 2008-09-17T09:12:58.747000 |
72,198 | 72,283 | Is there an easy way to create two columns in a popup text window? | This seemed like an easy thing to do. I just wanted to pop up a text window and display two columns of data -- a description on the left side and a corresponding value displayed on the right side. I haven't worked with Forms much so I just grabbed the first control that seemed appropriate, a TextBox. I thought using ta... | If you want, you can translate this VB.Net code to C#. The theory here is that you change the size of a tab in the control. Private Declare Function SendMessage _ Lib "user32" Alias "SendMessageA" _ (ByVal handle As IntPtr, ByVal wMsg As Integer, _ ByVal wParam As Integer, ByRef lParam As Integer) As Integer
Private S... | Is there an easy way to create two columns in a popup text window? This seemed like an easy thing to do. I just wanted to pop up a text window and display two columns of data -- a description on the left side and a corresponding value displayed on the right side. I haven't worked with Forms much so I just grabbed the f... | TITLE:
Is there an easy way to create two columns in a popup text window?
QUESTION:
This seemed like an easy thing to do. I just wanted to pop up a text window and display two columns of data -- a description on the left side and a corresponding value displayed on the right side. I haven't worked with Forms much so I ... | [
"c#",
"winforms",
"controls",
"formatting"
] | 1 | 0 | 1,865 | 5 | 0 | 2008-09-16T13:32:29.850000 | 2008-09-16T13:39:37.697000 |
72,204 | 76,914 | Have you used Rhino Igloo? | Has anyone used Rhino igloo in a non-trivial project? I am curious if it's worth, what are its drawbacks, does it enhance testability a lot, is it easy to use. How would you compare it to a pure MVC framework (ASP.NET MVC)? Please share the experience. | Have you tried watching Ayende's Hibernating Rhinos on IT? Seems like he himself isn't all that happy with it. | Have you used Rhino Igloo? Has anyone used Rhino igloo in a non-trivial project? I am curious if it's worth, what are its drawbacks, does it enhance testability a lot, is it easy to use. How would you compare it to a pure MVC framework (ASP.NET MVC)? Please share the experience. | TITLE:
Have you used Rhino Igloo?
QUESTION:
Has anyone used Rhino igloo in a non-trivial project? I am curious if it's worth, what are its drawbacks, does it enhance testability a lot, is it easy to use. How would you compare it to a pure MVC framework (ASP.NET MVC)? Please share the experience.
ANSWER:
Have you trie... | [
"asp.net-mvc",
"model-view-controller"
] | 0 | 2 | 521 | 2 | 0 | 2008-09-16T13:32:47.243000 | 2008-09-16T20:50:35.927000 |
72,209 | 72,469 | Recursion or Iteration? | Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome. I have seen many programmers using recursion as a means to show off when a simple iteration algorithm can fit the bill. Does the compiler pla... | It is possible that recursion will be more expensive, depending on if the recursive function is tail recursive (the last line is recursive call). Tail recursion should be recognized by the compiler and optimized to its iterative counterpart (while maintaining the concise, clear implementation you have in your code). I ... | Recursion or Iteration? Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome. I have seen many programmers using recursion as a means to show off when a simple iteration algorithm can fit the bil... | TITLE:
Recursion or Iteration?
QUESTION:
Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome. I have seen many programmers using recursion as a means to show off when a simple iteration algorit... | [
"performance",
"algorithm",
"language-agnostic",
"recursion"
] | 273 | 208 | 185,623 | 31 | 0 | 2008-09-16T13:33:24.730000 | 2008-09-16T13:52:59.050000 |
72,218 | 72,310 | Entities and Value Objects in Web Applications | We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it has an identity field. TelephoneNumber is typical value object: hasn't any identity and couldn't be loaded separately from the Contact instance. From other side we have web application for manipulating the contacts. 1st... | Does the value objects state identify that particular instance? If not you could just pass back the old value and the new value when the edit form is submitted, then update any objects with the old state to the new state. I would rather have a page like Contact/C0001/ThelephoneNumber, and use both the contact id and th... | Entities and Value Objects in Web Applications We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it has an identity field. TelephoneNumber is typical value object: hasn't any identity and couldn't be loaded separately from the Contact instance. From other side we have web... | TITLE:
Entities and Value Objects in Web Applications
QUESTION:
We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it has an identity field. TelephoneNumber is typical value object: hasn't any identity and couldn't be loaded separately from the Contact instance. From othe... | [
"architecture",
"web-applications",
"domain-driven-design"
] | 2 | 2 | 365 | 4 | 0 | 2008-09-16T13:34:25.943000 | 2008-09-16T13:41:25.880000 |
72,237 | 86,714 | Getting ASN.1 Issuer strings from PEM files? | I recently came across an issue with Windows 2003 (apparently it also exists in other versions too), where if an SSL/TLS server is requesting client certificate authentication and it has more than 16KB of trusted certificate DNs, Internet Explorer (or any other app that uses schannel.dll) is unable to complete the SSL ... | Since ASN.1 is self describing, it's fairly easy to write an ASN.1 parser. As you probably know, ASN.1 data contains a tree of values, where each value type is identified by a globally assigned OID (Object ID). You can find a free ASN.1 decoder with source code at: http://www.geocities.co.jp/SiliconValley-SanJose/3377/... | Getting ASN.1 Issuer strings from PEM files? I recently came across an issue with Windows 2003 (apparently it also exists in other versions too), where if an SSL/TLS server is requesting client certificate authentication and it has more than 16KB of trusted certificate DNs, Internet Explorer (or any other app that uses... | TITLE:
Getting ASN.1 Issuer strings from PEM files?
QUESTION:
I recently came across an issue with Windows 2003 (apparently it also exists in other versions too), where if an SSL/TLS server is requesting client certificate authentication and it has more than 16KB of trusted certificate DNs, Internet Explorer (or any o... | [
"apache",
"openssl",
"asn.1",
"schannel"
] | 2 | 3 | 2,059 | 2 | 0 | 2008-09-16T13:36:11.260000 | 2008-09-17T19:30:18.700000 |
72,240 | 92,367 | How to Call BizTalk Orchestration Dynamically | How can I call a BizTalk Orchestration dynamically knowing the Orchestration name? The call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration name as Design Time like in expression shape, we can write as c... | The way I've accomplished something similar in the past is by using direct binding ports in the orchestrations and letting the MsgBox do the dirty work for me. Basically, it goes something like this: Make the callable orchestrations use a direct-bound port attached to your activating receive shape. Set up a filter expr... | How to Call BizTalk Orchestration Dynamically How can I call a BizTalk Orchestration dynamically knowing the Orchestration name? The call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration name as Design Ti... | TITLE:
How to Call BizTalk Orchestration Dynamically
QUESTION:
How can I call a BizTalk Orchestration dynamically knowing the Orchestration name? The call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration... | [
"biztalk",
"biztalk-2006"
] | 2 | 4 | 4,370 | 2 | 0 | 2008-09-16T13:36:20.463000 | 2008-09-18T13:08:58.097000 |
72,242 | 72,621 | How do I set the HttpOnly flag on a cookie in Ruby on Rails | The page Protecting Your Cookies: HttpOnly explains why making HttpOnly cookies is a good idea. How do I set this property in Ruby on Rails? | Set the 'http_only' option in the hash used to set a cookie e.g. cookies["user_name"] = {:value => "david",:httponly => true } or, in Rails 2: e.g. cookies["user_name"] = {:value => "david",:http_only => true } | How do I set the HttpOnly flag on a cookie in Ruby on Rails The page Protecting Your Cookies: HttpOnly explains why making HttpOnly cookies is a good idea. How do I set this property in Ruby on Rails? | TITLE:
How do I set the HttpOnly flag on a cookie in Ruby on Rails
QUESTION:
The page Protecting Your Cookies: HttpOnly explains why making HttpOnly cookies is a good idea. How do I set this property in Ruby on Rails?
ANSWER:
Set the 'http_only' option in the hash used to set a cookie e.g. cookies["user_name"] = {:va... | [
"ruby-on-rails",
"ruby"
] | 41 | 39 | 17,063 | 5 | 0 | 2008-09-16T13:36:34.630000 | 2008-09-16T14:04:18.010000 |
72,264 | 72,296 | How can a C++ windows dll be merged into a C# application exe? | I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE. What are the steps to create such an executable? | Single Assembly Deployment of Managed and Unmanaged Code Sunday, February 4, 2007.NET developers love XCOPY deployment. And they love single assembly components. At least I always feel kinda uneasy, if I have to use some component and need remember a list of files to also include with the main assembly of that componen... | How can a C++ windows dll be merged into a C# application exe? I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE. What are the steps to create such an executable? | TITLE:
How can a C++ windows dll be merged into a C# application exe?
QUESTION:
I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE. What are the steps to create such an executable?
ANSWER:
Single Assembly Deployment of Managed and Unmanaged Code Sunday, ... | [
"c#",
"dll",
"merge"
] | 41 | 21 | 48,633 | 9 | 0 | 2008-09-16T13:38:18.323000 | 2008-09-16T13:40:32.170000 |
72,271 | 72,409 | "No newline at end of file" compiler warning | What is the reason for the following warning in some C++ compilers? No newline at end of file Why should I have an empty line at the end of a source/header file? | Think of some of the problems that can occur if there is no newline. According to the ANSI standard the #include of a file at the beginning inserts the file exactly as it is to the front of the file and does not insert the new line after the #include after the contents of the file. So if you include a file with no newl... | "No newline at end of file" compiler warning What is the reason for the following warning in some C++ compilers? No newline at end of file Why should I have an empty line at the end of a source/header file? | TITLE:
"No newline at end of file" compiler warning
QUESTION:
What is the reason for the following warning in some C++ compilers? No newline at end of file Why should I have an empty line at the end of a source/header file?
ANSWER:
Think of some of the problems that can occur if there is no newline. According to the ... | [
"c++",
"compiler-construction",
"warnings",
"c-preprocessor"
] | 206 | 232 | 124,895 | 11 | 0 | 2008-09-16T13:38:42.160000 | 2008-09-16T13:49:29.917000 |
72,288 | 74,193 | Learning OpenGL ES 1.x | What is the quickest way to come up to speed on OpenGL ES 1.x? Let's assume I know nothing about OpenGL (which is not entirely true, but it's been a while since I last used OpenGL). I am most interested in learning this for iPhone-related development, but I'm interested in learning how it works on other platforms as we... | There is some documentation in iPhone SDK itself. Other than that, just take what you know about OpenGL (or learn that via other means), and forget about all things that are "old cruft" (display lists, immediate mode, things that are in OpenGL but are not directly related to just drawing triangles). Basically, unlearn ... | Learning OpenGL ES 1.x What is the quickest way to come up to speed on OpenGL ES 1.x? Let's assume I know nothing about OpenGL (which is not entirely true, but it's been a while since I last used OpenGL). I am most interested in learning this for iPhone-related development, but I'm interested in learning how it works o... | TITLE:
Learning OpenGL ES 1.x
QUESTION:
What is the quickest way to come up to speed on OpenGL ES 1.x? Let's assume I know nothing about OpenGL (which is not entirely true, but it's been a while since I last used OpenGL). I am most interested in learning this for iPhone-related development, but I'm interested in learn... | [
"iphone",
"3d",
"opengl-es"
] | 20 | 5 | 10,304 | 9 | 0 | 2008-09-16T13:40:04.527000 | 2008-09-16T16:22:55.180000 |
72,298 | 72,662 | Should I add the Visual Studio .suo and .user files to source control? | Visual Studio solutions contain two types of hidden user files. One is the solution.suo file which is a binary file. The other is the project.user file which is a text file. Exactly what data do these files contain? I've also been wondering whether I should add these files to source control (Subversion in my case). If ... | These files contain user preference configurations that are in general specific to your machine, so it's better not to put it in SCM. Also, VS will change it almost every time you execute it, so it will always be marked by the SCM as 'changed'. I don't include either, I'm in a project using VS for 2 years and had no pr... | Should I add the Visual Studio .suo and .user files to source control? Visual Studio solutions contain two types of hidden user files. One is the solution.suo file which is a binary file. The other is the project.user file which is a text file. Exactly what data do these files contain? I've also been wondering whether ... | TITLE:
Should I add the Visual Studio .suo and .user files to source control?
QUESTION:
Visual Studio solutions contain two types of hidden user files. One is the solution.suo file which is a binary file. The other is the project.user file which is a text file. Exactly what data do these files contain? I've also been ... | [
"visual-studio",
"version-control"
] | 911 | 715 | 232,854 | 22 | 0 | 2008-09-16T13:40:42.437000 | 2008-09-16T14:08:40.497000 |
72,312 | 72,348 | How should I capitalize Perl? | PERL? Perl? perl? What's good style? I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form. | The correct casing is "Perl" for the language and "perl" for the executable. Using "PERL" flags you as someone who isn't particularly familiar with the language or community. See also What's the difference between "perl" and "Perl"? in perlfaq1. | How should I capitalize Perl? PERL? Perl? perl? What's good style? I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form. | TITLE:
How should I capitalize Perl?
QUESTION:
PERL? Perl? perl? What's good style? I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form.
ANSWER:
The correct casing is "Perl" for the language and "perl" for the executable. Using "PERL" flags y... | [
"perl",
"coding-style",
"capitalization"
] | 12 | 36 | 3,897 | 8 | 0 | 2008-09-16T13:41:32.980000 | 2008-09-16T13:43:52.193000 |
72,358 | 83,182 | What must I do to make content such as images served over HTTPS be cached client-side? | I am using Tomcat as a server and Internet Explorer 6 as a browser. A web page in our app has about 75 images. We are using SSL. It seems to be very slow at loading all the content. How can I configure Tomcat so that IE caches the images? | If you are serving a page over https then you'll need to serve all the included static or dynamic resources over https (either from the same domain, or another domain, also over https) to avoid a security warning in the browser. Content delivered over a secure channel will not be written to disk by default by most brow... | What must I do to make content such as images served over HTTPS be cached client-side? I am using Tomcat as a server and Internet Explorer 6 as a browser. A web page in our app has about 75 images. We are using SSL. It seems to be very slow at loading all the content. How can I configure Tomcat so that IE caches the im... | TITLE:
What must I do to make content such as images served over HTTPS be cached client-side?
QUESTION:
I am using Tomcat as a server and Internet Explorer 6 as a browser. A web page in our app has about 75 images. We are using SSL. It seems to be very slow at loading all the content. How can I configure Tomcat so tha... | [
"performance",
"tomcat",
"ssl",
"https"
] | 6 | 10 | 6,896 | 7 | 0 | 2008-09-16T13:44:50.973000 | 2008-09-17T13:28:58.353000 |
72,360 | 72,550 | How to use the "is" operator in System.Type variables? | here is what a I'm doing: object ReturnMatch(System.Type type) { foreach(object obj in myObjects) { if (obj == type) { return obj; } } } However, if obj is a subclass of type, it will not match. But I would like the function to return the same way as if I was using the operator is. I tried the following, but it won't c... | I've used the IsAssignableFrom method when faced with this problem. Type theTypeWeWant; // From argument or whatever foreach (object o in myCollection) { if (theTypeWeWant.IsAssignableFrom(o.GetType)) return o; } Another approach that may or may not work with your problem is to use a generic method: private T FindObjec... | How to use the "is" operator in System.Type variables? here is what a I'm doing: object ReturnMatch(System.Type type) { foreach(object obj in myObjects) { if (obj == type) { return obj; } } } However, if obj is a subclass of type, it will not match. But I would like the function to return the same way as if I was using... | TITLE:
How to use the "is" operator in System.Type variables?
QUESTION:
here is what a I'm doing: object ReturnMatch(System.Type type) { foreach(object obj in myObjects) { if (obj == type) { return obj; } } } However, if obj is a subclass of type, it will not match. But I would like the function to return the same way... | [
"c#"
] | 5 | 5 | 2,705 | 5 | 0 | 2008-09-16T13:44:54.233000 | 2008-09-16T13:59:35.743000 |
72,372 | 72,544 | In Visual Studio 2008, is it possible to mix vertical tab groups with horizontal tab groups? | I have a 1920x1200 screen an would like to customize VS2008 code windows to have some areas split vertically and horizontally (tab groups). I can only seem to do all vertical or all horizontal in VS2008. Is there any crafty way of getting a mixing both? | I don't believe this is possible in Visual Studio. However, you should check out this nice product for splitting applications: http://www.winsplit-revolution.com/ | In Visual Studio 2008, is it possible to mix vertical tab groups with horizontal tab groups? I have a 1920x1200 screen an would like to customize VS2008 code windows to have some areas split vertically and horizontally (tab groups). I can only seem to do all vertical or all horizontal in VS2008. Is there any crafty way... | TITLE:
In Visual Studio 2008, is it possible to mix vertical tab groups with horizontal tab groups?
QUESTION:
I have a 1920x1200 screen an would like to customize VS2008 code windows to have some areas split vertically and horizontally (tab groups). I can only seem to do all vertical or all horizontal in VS2008. Is th... | [
"visual-studio-2008",
"multiple-monitors"
] | 0 | 0 | 365 | 1 | 0 | 2008-09-16T13:46:13.890000 | 2008-09-16T13:59:02.733000 |
72,380 | 72,674 | Speech Recognition for Searching Files | Here is the problem I have: I have a lot (tens of thousands) of mp3 files that my users would like to be able to search. Is there is software out there that you've used or heard good things about that would allow me to index that content and put it in a database so I can search on it later? | I've heard very good reviews of Dragon Naturally Speaking, by Nuance. They offer a software development kit, but I couldn't find out any information about pricing for small projects. | Speech Recognition for Searching Files Here is the problem I have: I have a lot (tens of thousands) of mp3 files that my users would like to be able to search. Is there is software out there that you've used or heard good things about that would allow me to index that content and put it in a database so I can search on... | TITLE:
Speech Recognition for Searching Files
QUESTION:
Here is the problem I have: I have a lot (tens of thousands) of mp3 files that my users would like to be able to search. Is there is software out there that you've used or heard good things about that would allow me to index that content and put it in a database ... | [
"speech-recognition"
] | 0 | 1 | 815 | 2 | 0 | 2008-09-16T13:46:51.733000 | 2008-09-16T14:09:52.223000 |
72,381 | 72,438 | Given a Date Object how do I determine the last day of its month? | I'm trying to use the following code but it's returning the wrong day of month. Calendar cal = Calendar.getInstance(); cal.setTime(sampleDay.getTime()); cal.set(Calendar.MONTH, sampleDay.get(Calendar.MONTH)+1); cal.set(Calendar.DAY_OF_MONTH, 0); return cal.getTime(); | Get the number of days for this month: Calendar cal = Calendar.getInstance(); cal.setTime(sampleDay.getTime()); int noOfLastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); Set the Calendar to the last day of this month: Calendar cal = Calendar.getInstance(); cal.setTime(sampleDay.getTime()); cal.set(Calendar.DAY_OF_... | Given a Date Object how do I determine the last day of its month? I'm trying to use the following code but it's returning the wrong day of month. Calendar cal = Calendar.getInstance(); cal.setTime(sampleDay.getTime()); cal.set(Calendar.MONTH, sampleDay.get(Calendar.MONTH)+1); cal.set(Calendar.DAY_OF_MONTH, 0); return c... | TITLE:
Given a Date Object how do I determine the last day of its month?
QUESTION:
I'm trying to use the following code but it's returning the wrong day of month. Calendar cal = Calendar.getInstance(); cal.setTime(sampleDay.getTime()); cal.set(Calendar.MONTH, sampleDay.get(Calendar.MONTH)+1); cal.set(Calendar.DAY_OF_M... | [
"java",
"date"
] | 6 | 20 | 11,772 | 8 | 0 | 2008-09-16T13:46:58.630000 | 2008-09-16T13:51:21.317000 |
72,393 | 72,470 | Python and "re" | A tutorial I have on Regex in python explains how to use the re module in python, I wanted to grab the URL out of an A tag so knowing Regex I wrote the correct expression and tested it in my regex testing app of choice and ensured it worked. When placed into python it failed: result = re.match("a_regex_of_pure_awesomen... | In Python, there's a distinction between "match" and "search"; match only looks for the pattern at the start of the string, and search looks for the pattern starting at any location within the string. Python regex docs Matching vs searching | Python and "re" A tutorial I have on Regex in python explains how to use the re module in python, I wanted to grab the URL out of an A tag so knowing Regex I wrote the correct expression and tested it in my regex testing app of choice and ensured it worked. When placed into python it failed: result = re.match("a_regex_... | TITLE:
Python and "re"
QUESTION:
A tutorial I have on Regex in python explains how to use the re module in python, I wanted to grab the URL out of an A tag so knowing Regex I wrote the correct expression and tested it in my regex testing app of choice and ensured it worked. When placed into python it failed: result = ... | [
"python",
"regex"
] | 7 | 20 | 1,064 | 4 | 0 | 2008-09-16T13:47:48.550000 | 2008-09-16T13:53:03.187000 |
72,410 | 120,364 | Storing content in multiple languages? E.g. English, French, German | How should I store (and present) the text on a website intended for worldwide use, with several languages? The content is mostly in the form of 500+ word articles, although I will need to translate tiny snippets of text on each page too (such as "print this article" or "back to menu"). I know there are several CMS pack... | Firstly put all code for all languages under one domain - it will help your google-rank. We have a fully multi-lingual system, with localisations stored in a database but cached with the web application. Wherever we want a localisation to appear we use: <%$ Resources: LanguageProvider, Path/To/Localisation %> Then in o... | Storing content in multiple languages? E.g. English, French, German How should I store (and present) the text on a website intended for worldwide use, with several languages? The content is mostly in the form of 500+ word articles, although I will need to translate tiny snippets of text on each page too (such as "print... | TITLE:
Storing content in multiple languages? E.g. English, French, German
QUESTION:
How should I store (and present) the text on a website intended for worldwide use, with several languages? The content is mostly in the form of 500+ word articles, although I will need to translate tiny snippets of text on each page t... | [
"asp.net",
"internationalization"
] | 3 | 5 | 726 | 7 | 0 | 2008-09-16T13:49:42.210000 | 2008-09-23T11:12:42.440000 |
72,422 | 73,791 | Python's unittest logic | Can someone explain this result to me. The first test succeeds but the second fails, although the variable tested is changed in the first test. >>> class MyTest(unittest.TestCase): def setUp(self): self.i = 1 def testA(self): self.i = 3 self.assertEqual(self.i, 3) def testB(self): self.assertEqual(self.i, 3)
>>> unitt... | Each test is run using a new instance of the MyTest class. That means if you change self in one test, changes will not carry over to other tests, since self will refer to a different instance. Additionally, as others have pointed out, setUp is called before each test. | Python's unittest logic Can someone explain this result to me. The first test succeeds but the second fails, although the variable tested is changed in the first test. >>> class MyTest(unittest.TestCase): def setUp(self): self.i = 1 def testA(self): self.i = 3 self.assertEqual(self.i, 3) def testB(self): self.assertEqu... | TITLE:
Python's unittest logic
QUESTION:
Can someone explain this result to me. The first test succeeds but the second fails, although the variable tested is changed in the first test. >>> class MyTest(unittest.TestCase): def setUp(self): self.i = 1 def testA(self): self.i = 3 self.assertEqual(self.i, 3) def testB(sel... | [
"python",
"unit-testing"
] | 4 | 9 | 776 | 5 | 0 | 2008-09-16T13:50:25.343000 | 2008-09-16T15:47:30.993000 |
72,456 | 78,068 | What facets have I missed for creating a 3 person guerilla dev team? | Sorry for the Windows developers out there, this solution is for Macs only. This set of applications accounts for: Usability Testing, Screen Capture (Video and Still), Version Control, Task Lists, Bug Tracking, a Developer IDE, a Web Server, A Blog, Shared Doc Editing on the Web, Team and individual Chat, Email, Databa... | You've got most of it covered. I always add space, time and money for 2 more things you might consider strange. A machine set up just like the average user. No development or debugging tools installed. Make it look like someone just bought it from the Apple store. I do image switching but I've know people who swear by ... | What facets have I missed for creating a 3 person guerilla dev team? Sorry for the Windows developers out there, this solution is for Macs only. This set of applications accounts for: Usability Testing, Screen Capture (Video and Still), Version Control, Task Lists, Bug Tracking, a Developer IDE, a Web Server, A Blog, S... | TITLE:
What facets have I missed for creating a 3 person guerilla dev team?
QUESTION:
Sorry for the Windows developers out there, this solution is for Macs only. This set of applications accounts for: Usability Testing, Screen Capture (Video and Still), Version Control, Task Lists, Bug Tracking, a Developer IDE, a Web... | [
"macos"
] | 6 | 7 | 576 | 8 | 0 | 2008-09-16T13:52:21.517000 | 2008-09-16T22:43:37.653000 |
72,479 | 72,590 | equivalent vb code for a java code | Can anyone tell me what exactly does this Java code do? SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] bytes = new byte[20]; synchronized (random) { random.nextBytes(bytes); }
return Base64.encode(bytes); Step by step explanation will be useful so that I can recreate this code in VB. Thanks | Using code snippets you can get to something like this Dim randomNumGen As RandomNumberGenerator = RNGCryptoServiceProvider.Create() Dim randomBytes(20) As Byte randomNumGen.GetBytes(randomBytes) return Convert.ToBase64String(randomBytes) | equivalent vb code for a java code Can anyone tell me what exactly does this Java code do? SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] bytes = new byte[20]; synchronized (random) { random.nextBytes(bytes); }
return Base64.encode(bytes); Step by step explanation will be useful so that I can recre... | TITLE:
equivalent vb code for a java code
QUESTION:
Can anyone tell me what exactly does this Java code do? SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] bytes = new byte[20]; synchronized (random) { random.nextBytes(bytes); }
return Base64.encode(bytes); Step by step explanation will be useful s... | [
"java",
"vba",
"random"
] | 5 | 5 | 4,638 | 5 | 0 | 2008-09-16T13:53:33.277000 | 2008-09-16T14:02:01.743000 |
72,515 | 72,651 | How do I change the type of control that is used in a .NET PropertyGrid | I have a Windows application that uses a.NET PropertyGrid control. Is it possible to change the type of control that is used for the value field of a property? I would like to be able to use a RichTextBox to allow better formatting of the input value. Can this be done without creating a custom editor class? | To add your own custom editing when the user selects a property grid value you need to implement a class that derives from UITypeEditor. You then have the choice of showing just a small popup window below the property area or a full blown dialog box. What is nice is that you can reuse the existing implementations. So t... | How do I change the type of control that is used in a .NET PropertyGrid I have a Windows application that uses a.NET PropertyGrid control. Is it possible to change the type of control that is used for the value field of a property? I would like to be able to use a RichTextBox to allow better formatting of the input val... | TITLE:
How do I change the type of control that is used in a .NET PropertyGrid
QUESTION:
I have a Windows application that uses a.NET PropertyGrid control. Is it possible to change the type of control that is used for the value field of a property? I would like to be able to use a RichTextBox to allow better formattin... | [
"c#",
".net",
"windows"
] | 2 | 4 | 741 | 3 | 0 | 2008-09-16T13:55:47.640000 | 2008-09-16T14:06:37.553000 |
72,537 | 72,641 | Auto number column in SharePoint list | In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this? | Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it. | Auto number column in SharePoint list In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this? | TITLE:
Auto number column in SharePoint list
QUESTION:
In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
ANSWER:
Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modi... | [
"sharepoint",
"moss"
] | 30 | 56 | 236,652 | 9 | 0 | 2008-09-16T13:58:03.080000 | 2008-09-16T14:05:52.530000 |
72,540 | 74,145 | Is a software token a valid second factor in multi-factor security? | We are changing our remote log-in security process at my workplace, and we are concerned that the new system does not use multi-factor authentication as the old one did. (We had been using RSA key-fobs, but they are being replaced due to cost.) The new system is an anti-phishing image system which has been misunderstoo... | I would say "no". I don't think you can really get the "something you have" part of multi-factor authentication without issuing something the end user can carry with them. If you "have" something, it implies it can be lost - not many users lose their entire desktop machines. The security of "something you have", after ... | Is a software token a valid second factor in multi-factor security? We are changing our remote log-in security process at my workplace, and we are concerned that the new system does not use multi-factor authentication as the old one did. (We had been using RSA key-fobs, but they are being replaced due to cost.) The new... | TITLE:
Is a software token a valid second factor in multi-factor security?
QUESTION:
We are changing our remote log-in security process at my workplace, and we are concerned that the new system does not use multi-factor authentication as the old one did. (We had been using RSA key-fobs, but they are being replaced due... | [
"language-agnostic",
"authentication"
] | 1 | 2 | 562 | 6 | 0 | 2008-09-16T13:58:32.940000 | 2008-09-16T16:18:54.583000 |
72,541 | 72,697 | One Update Panel vs. Multiple Update Panels | I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to avoid visible postbacks. Originally there was only one area that needed this ability... that soon expanded to other fields. ... | Multiple panels are much better. One of the main reasons for using UpdatePanels at all is to reduce the traffic and to only send the pieces that you need back and forth across the wire. By only using one update panel, you're pretty much doing a full post back every time, you're just using a little Javascript to update ... | One Update Panel vs. Multiple Update Panels I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to avoid visible postbacks. Originally there was only one area that needed this abi... | TITLE:
One Update Panel vs. Multiple Update Panels
QUESTION:
I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to avoid visible postbacks. Originally there was only one area th... | [
"asp.net",
"asp.net-ajax",
"webforms"
] | 49 | 50 | 36,199 | 7 | 0 | 2008-09-16T13:58:43.297000 | 2008-09-16T14:11:43.780000 |
72,552 | 72,617 | Why does volatile exist? | What does the volatile keyword do? In C++ what problem does it solve? In my case, I have never knowingly needed it. | volatile is needed if you are reading from a spot in memory that, say, a completely separate process/device/whatever may write to. I used to work with dual-port ram in a multiprocessor system in straight C. We used a hardware managed 16 bit value as a semaphore to know when the other guy was done. Essentially we did th... | Why does volatile exist? What does the volatile keyword do? In C++ what problem does it solve? In my case, I have never knowingly needed it. | TITLE:
Why does volatile exist?
QUESTION:
What does the volatile keyword do? In C++ what problem does it solve? In my case, I have never knowingly needed it.
ANSWER:
volatile is needed if you are reading from a spot in memory that, say, a completely separate process/device/whatever may write to. I used to work with d... | [
"c++",
"volatile",
"c++-faq"
] | 280 | 332 | 60,762 | 19 | 0 | 2008-09-16T13:59:45.667000 | 2008-09-16T14:04:06.047000 |
72,556 | 72,908 | Hot to commit changes for a TreeView while editing a node (C#)? | I am playing with Microsoft's TreeView control and I am trying to force a data update of some sorts while editing a node's label, similar to UpdateData for a grid. Basically, in my editor, I have a Save button and this TreeView control: what I want is when I am editing a node's label in the TreeView, if I click on the ... | The node label editing is performed with a text box and when that text box loses focus the change in name will be committed as the new label for the node. So if the 'Save' button you are clicking on takes the focus then it will cause the update automatically because the text box will lose focus. If the 'Save' button do... | Hot to commit changes for a TreeView while editing a node (C#)? I am playing with Microsoft's TreeView control and I am trying to force a data update of some sorts while editing a node's label, similar to UpdateData for a grid. Basically, in my editor, I have a Save button and this TreeView control: what I want is when... | TITLE:
Hot to commit changes for a TreeView while editing a node (C#)?
QUESTION:
I am playing with Microsoft's TreeView control and I am trying to force a data update of some sorts while editing a node's label, similar to UpdateData for a grid. Basically, in my editor, I have a Save button and this TreeView control: w... | [
"c#",
"treeview",
"commit",
"editing"
] | 2 | 0 | 3,700 | 3 | 0 | 2008-09-16T14:00:02.560000 | 2008-09-16T14:28:24.177000 |
72,562 | 72,839 | How can I find out which exceptions a Delphi function might throw? | Is there a good way to find out which exceptions a procedure/function can raise in Delphi (including it's called procedures/functions)? In Java you always have to declare which exceptions that can be thrown, but this is not the case in Delphi, which could lead to unhandled exceptions. Are there any code analysis tools ... | (Edit: It is now obvious that the question referred only to design-time checking.) New answer: I cannot state whether there are any tools to check this for you. Pascal Analyzer, for one, does not. I can tell you, however, that in most Delphi applications, even if there was a tool to check this for you, you would get no... | How can I find out which exceptions a Delphi function might throw? Is there a good way to find out which exceptions a procedure/function can raise in Delphi (including it's called procedures/functions)? In Java you always have to declare which exceptions that can be thrown, but this is not the case in Delphi, which cou... | TITLE:
How can I find out which exceptions a Delphi function might throw?
QUESTION:
Is there a good way to find out which exceptions a procedure/function can raise in Delphi (including it's called procedures/functions)? In Java you always have to declare which exceptions that can be thrown, but this is not the case in... | [
"delphi",
"exception"
] | 13 | 12 | 10,528 | 10 | 0 | 2008-09-16T14:00:10.830000 | 2008-09-16T14:22:27.873000 |
72,564 | 72,730 | Multiple return values to indicate success/failure. | I'm kind of interested in getting some feedback about this technique I picked up from somewhere. I use this when a function can either succeed or fail, but you'd like to get more information about why it failed. A standard way to do this same thing would be with exception handling, but I often find it a bit over the to... | I agree with the others who have stated that this is a little on the WTFy side. If it's clearly documented functionality, then it's less of an issue, but I think it'd be safer to take an alternate route of returning 0 for success and integers for error codes. If you don't like that idea or the idea of a global last err... | Multiple return values to indicate success/failure. I'm kind of interested in getting some feedback about this technique I picked up from somewhere. I use this when a function can either succeed or fail, but you'd like to get more information about why it failed. A standard way to do this same thing would be with excep... | TITLE:
Multiple return values to indicate success/failure.
QUESTION:
I'm kind of interested in getting some feedback about this technique I picked up from somewhere. I use this when a function can either succeed or fail, but you'd like to get more information about why it failed. A standard way to do this same thing w... | [
"php"
] | 5 | 14 | 4,193 | 14 | 0 | 2008-09-16T14:00:14.730000 | 2008-09-16T14:13:53.900000 |
72,580 | 385,653 | Making a C#/Winform application cross-platform - should I use AIR, Mono, or something else? | I have an app that I've written in C#/WinForms ( my little app ). To make it cross-platform, I'm thinking of redoing it in Adobe AIR. Are there any arguments in favor of WinForms as a cross-platform app? Is there a cross-platform future for Winforms (e.g., Mono, etc.)? Suggestions for cross-platform UI development? By ... | I'm thinking of redoing it in Adobe AIR Not having spent much time with AIR, my personal opinion is that it is best for bringing a webapp to the desktop and provide a shell to it or run your existing flash/flex project on the desktop. Btw, if you don't know ActionScript, I mean its details, quirks, etc, don't forget to... | Making a C#/Winform application cross-platform - should I use AIR, Mono, or something else? I have an app that I've written in C#/WinForms ( my little app ). To make it cross-platform, I'm thinking of redoing it in Adobe AIR. Are there any arguments in favor of WinForms as a cross-platform app? Is there a cross-platfor... | TITLE:
Making a C#/Winform application cross-platform - should I use AIR, Mono, or something else?
QUESTION:
I have an app that I've written in C#/WinForms ( my little app ). To make it cross-platform, I'm thinking of redoing it in Adobe AIR. Are there any arguments in favor of WinForms as a cross-platform app? Is the... | [
"c#",
"winforms",
"cross-platform"
] | 6 | 4 | 10,231 | 9 | 0 | 2008-09-16T14:01:31.170000 | 2008-12-22T06:06:19.753000 |
72,593 | 75,707 | Temp tables and SQL SELECT performance | Why does the use of temp tables with a SELECT statement improve the logical I/O count? Wouldn't it increase the amount of hits to a database instead of decreasing it. Is this because the 'problem' is broken down into sections? I'd like to know what's going on behind the scenes. | There's no general answer. It depends on how the temp table is being used. The temp table may reduce IO by caching rows created after a complex filter/join that are used multiple times later in the batch. This way, the DB can avoid hitting the base tables multiple times when only a subset of the records are needed. The... | Temp tables and SQL SELECT performance Why does the use of temp tables with a SELECT statement improve the logical I/O count? Wouldn't it increase the amount of hits to a database instead of decreasing it. Is this because the 'problem' is broken down into sections? I'd like to know what's going on behind the scenes. | TITLE:
Temp tables and SQL SELECT performance
QUESTION:
Why does the use of temp tables with a SELECT statement improve the logical I/O count? Wouldn't it increase the amount of hits to a database instead of decreasing it. Is this because the 'problem' is broken down into sections? I'd like to know what's going on beh... | [
"sql",
"performance"
] | 4 | 3 | 2,221 | 4 | 0 | 2008-09-16T14:02:14.863000 | 2008-09-16T18:57:07.980000 |
72,615 | 72,742 | How do I invoke an exe that is an embedded resource in a .Net assembly? | I have a non-.Net executable file that is included in my.net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it? This is.Net 2.0. | You can load a.NET assembly from a byte array using an overload of Assembly.Load. However, there are implications for the security model that need to be considered which make things more complex. See the discussion here, and also this thread. If your embedded executable is not.NET then I think you will have to write it... | How do I invoke an exe that is an embedded resource in a .Net assembly? I have a non-.Net executable file that is included in my.net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it? This is.Net 2.0. | TITLE:
How do I invoke an exe that is an embedded resource in a .Net assembly?
QUESTION:
I have a non-.Net executable file that is included in my.net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it? This is.Net 2.0.
ANSWER:
You can ... | [
".net"
] | 4 | 3 | 3,316 | 2 | 0 | 2008-09-16T14:03:46.687000 | 2008-09-16T14:15:07.143000 |
72,616 | 72,786 | Embed data in a C++ program | I've got a C++ program that uses SQLite. I want to store the SQL queries in a separate file -- a plain-text file, not a source code file -- but embed that file in the executable file like a resource. (This has to run on Linux, so I can't store it as an actual resource as far as I know, though that would be perfect if i... | You can use objcopy to bind the contents of the file to a symbol your program can use. See, for instance, here for more information. | Embed data in a C++ program I've got a C++ program that uses SQLite. I want to store the SQL queries in a separate file -- a plain-text file, not a source code file -- but embed that file in the executable file like a resource. (This has to run on Linux, so I can't store it as an actual resource as far as I know, thoug... | TITLE:
Embed data in a C++ program
QUESTION:
I've got a C++ program that uses SQLite. I want to store the SQL queries in a separate file -- a plain-text file, not a source code file -- but embed that file in the executable file like a resource. (This has to run on Linux, so I can't store it as an actual resource as fa... | [
"c++",
"linux",
"sqlite"
] | 18 | 26 | 8,683 | 6 | 0 | 2008-09-16T14:03:58.277000 | 2008-09-16T14:17:44.077000 |
72,624 | 77,139 | SharePoint Content Query Web Part | I have a content query web part that queries by content type against a site collection. I have grouped it by content type so I have: -- Agenda (Content Type) ----Agenda #1 ----Agenda #2 -- Report (Content Type) ----Report #1 ----Report #2 I would like to show a second grouping for site, so: -- Agenda (Content Type) ---... | You have full access to change the xslt for the content query webpart. I reccomend exporting the webpart, saving the inline xslt into the style library and changing the webpart from using inline xslt to using a link to the file in the style library. This allows you to edit the xslt file using sharepoint designer which ... | SharePoint Content Query Web Part I have a content query web part that queries by content type against a site collection. I have grouped it by content type so I have: -- Agenda (Content Type) ----Agenda #1 ----Agenda #2 -- Report (Content Type) ----Report #1 ----Report #2 I would like to show a second grouping for site... | TITLE:
SharePoint Content Query Web Part
QUESTION:
I have a content query web part that queries by content type against a site collection. I have grouped it by content type so I have: -- Agenda (Content Type) ----Agenda #1 ----Agenda #2 -- Report (Content Type) ----Report #1 ----Report #2 I would like to show a second... | [
"list",
"sharepoint",
"moss"
] | 2 | 3 | 1,108 | 1 | 0 | 2008-09-16T14:04:30.757000 | 2008-09-16T21:09:42.403000 |
72,626 | 72,736 | "Could not find file" when using Isolated Storage | I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well, and I can retrieve the saved values when calling the saving and retrieving methods in my DAL layer from my GUI layer. However, when I try to retrieve the same settings from another assembly in the same project, it gives me a File... | When you instantiated the IsolatedStorageFile, did you scope it to IsolatedStorageScope.Machine? Ok now that you have illustrated your code style and I have gone back to retesting the behaviour of the methods, here is the explanation: GetMachineStoreForAssembly() - scoped to the machine and the assembly identity. Diffe... | "Could not find file" when using Isolated Storage I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well, and I can retrieve the saved values when calling the saving and retrieving methods in my DAL layer from my GUI layer. However, when I try to retrieve the same settings from anothe... | TITLE:
"Could not find file" when using Isolated Storage
QUESTION:
I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well, and I can retrieve the saved values when calling the saving and retrieving methods in my DAL layer from my GUI layer. However, when I try to retrieve the same se... | [
"c#",
".net"
] | 5 | 4 | 5,252 | 2 | 0 | 2008-09-16T14:04:41.193000 | 2008-09-16T14:14:44.100000 |
72,667 | 72,929 | Should I use a state machine or a sequence workflow in WF? | I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word document from an agenda template, update the agenda with th... | No, I don't think that you have to use a state machine for this workflow. But, I propose to change the Suspend activity because: The SuspendActivity activity temporarily stops the execution of the current workflow. Typically, you use the SuspendActivity activity to reflect an error condition that requires attention by ... | Should I use a state machine or a sequence workflow in WF? I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word ... | TITLE:
Should I use a state machine or a sequence workflow in WF?
QUESTION:
I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a mac... | [
".net-3.5",
"com",
"interop",
"workflow",
"business-process-management"
] | 2 | 2 | 1,556 | 2 | 0 | 2008-09-16T14:08:49.763000 | 2008-09-16T14:29:44.890000 |
72,671 | 72,796 | How to create batch file in Windows using "start" with a path and command with spaces | I need to create a batch file which starts multiple console applications in a Windows.cmd file. This can be done using the start command. However, the command has a path in it. I also need to pass paramaters which have spaces as well. How to do this? E.g. batch file start "c:\path with spaces\app.exe" param1 "param wit... | Actually, his example won't work (although at first I thought that it would, too). Based on the help for the Start command, the first parameter is the name of the newly created Command Prompt window, and the second and third should be the path to the application and its parameters, respectively. If you add another "" b... | How to create batch file in Windows using "start" with a path and command with spaces I need to create a batch file which starts multiple console applications in a Windows.cmd file. This can be done using the start command. However, the command has a path in it. I also need to pass paramaters which have spaces as well.... | TITLE:
How to create batch file in Windows using "start" with a path and command with spaces
QUESTION:
I need to create a batch file which starts multiple console applications in a Windows.cmd file. This can be done using the start command. However, the command has a path in it. I also need to pass paramaters which ha... | [
"windows",
"batch-file",
"scripting"
] | 79 | 168 | 173,512 | 7 | 0 | 2008-09-16T14:09:28.950000 | 2008-09-16T14:18:17.663000 |
72,672 | 72,713 | Is there an inverse function of *SysUtils.Format* in Delphi | Has anyone written an 'UnFormat' routine for Delphi? What I'm imagining is the inverse of SysUtils.Format and looks something like this UnFormat('a number %n and another %n',[float1, float2]); So you could unpack a string into a series of variables using format strings. I've looked at the 'Format' routine in SysUtils, ... | This is called scanf in C, I've made a Delphi look-a-like for this: function ScanFormat(const Input, Format: string; Args: array of Pointer): Integer; var InputOffset: Integer; FormatOffset: Integer; InputChar: Char; FormatChar: Char;
function _GetInputChar: Char; begin if InputOffset <= Length(Input) then begin Resul... | Is there an inverse function of *SysUtils.Format* in Delphi Has anyone written an 'UnFormat' routine for Delphi? What I'm imagining is the inverse of SysUtils.Format and looks something like this UnFormat('a number %n and another %n',[float1, float2]); So you could unpack a string into a series of variables using form... | TITLE:
Is there an inverse function of *SysUtils.Format* in Delphi
QUESTION:
Has anyone written an 'UnFormat' routine for Delphi? What I'm imagining is the inverse of SysUtils.Format and looks something like this UnFormat('a number %n and another %n',[float1, float2]); So you could unpack a string into a series of va... | [
"delphi",
"function",
"scanf"
] | 10 | 12 | 3,059 | 3 | 0 | 2008-09-16T14:09:38.590000 | 2008-09-16T14:12:51.780000 |
72,677 | 73,302 | How to remove these kind of symbols (junk) from string? | Imagine I have String in C#: "I Don’t see ya.." I want to remove (replace to nothing or etc.) these "’" symbols. How do I do this? | That 'junk' looks a lot like someone interpreted UTF-8 data as ISO 8859-1 or Windows-1252, probably repeatedly. ’ is the sequence C3 A2, E2 82 AC, E2 84 A2. UTF-8 C3 A2 = U+00E2 = â UTF-8 E2 82 AC = U+20AC = € UTF-8 E2 84 A2 = U+2122 = ™ We then do it again: in Windows 1252 this sequence is E2 80 99, so the char... | How to remove these kind of symbols (junk) from string? Imagine I have String in C#: "I Don’t see ya.." I want to remove (replace to nothing or etc.) these "’" symbols. How do I do this? | TITLE:
How to remove these kind of symbols (junk) from string?
QUESTION:
Imagine I have String in C#: "I Don’t see ya.." I want to remove (replace to nothing or etc.) these "’" symbols. How do I do this?
ANSWER:
That 'junk' looks a lot like someone interpreted UTF-8 data as ISO 8859-1 or Windows-1252, p... | [
"algorithm",
"string",
"unicode"
] | 1 | 18 | 12,818 | 12 | 0 | 2008-09-16T14:10:07.170000 | 2008-09-16T15:01:26.890000 |
72,682 | 72,922 | Is there a name for this anti-pattern/code smell? | Let me start by saying that I do not advocate this approach, but I saw it recently and I was wondering if there was a name for it I could use to point the guilty party to. So here goes. Now you have a method, and you want to return a value. You also want to return an error code. Of course, exceptions are a much better ... | I'd agree that this isn't specifically an antipattern. It might be a smell depending upon the usage. There are reasons why one would actually not want to use exceptions (e.g. the errors being returned are not 'exceptional', for starters). There are instances where you want to have a service return a common model for it... | Is there a name for this anti-pattern/code smell? Let me start by saying that I do not advocate this approach, but I saw it recently and I was wondering if there was a name for it I could use to point the guilty party to. So here goes. Now you have a method, and you want to return a value. You also want to return an er... | TITLE:
Is there a name for this anti-pattern/code smell?
QUESTION:
Let me start by saying that I do not advocate this approach, but I saw it recently and I was wondering if there was a name for it I could use to point the guilty party to. So here goes. Now you have a method, and you want to return a value. You also wa... | [
"design-patterns",
"anti-patterns"
] | 19 | 17 | 4,016 | 13 | 0 | 2008-09-16T14:10:30.087000 | 2008-09-16T14:29:08.450000 |
72,696 | 72,766 | Which is generally best to use — StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase? | I have some code like this: If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I don't care about the case. Should I use OrdinalIgnoreCase, InvariantCultureIgnoreCase, or CurrentCultureIgnoreCase? | Newer.Net Docs now has a table to help you decide which is best to use in your situation. From MSDN's " New Recommendations for Using Strings in Microsoft.NET 2.0 " Summary: Code owners previously using the InvariantCulture for string comparison, casing, and sorting should strongly consider using a new set of String ov... | Which is generally best to use — StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase? I have some code like this: If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I don't care about the case. Should I use OrdinalIgnoreCase, InvariantCultureIgnoreCase, o... | TITLE:
Which is generally best to use — StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase?
QUESTION:
I have some code like this: If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I don't care about the case. Should I use OrdinalIgnoreCase, InvariantCu... | [
".net",
"vb.net",
"localization"
] | 209 | 223 | 88,194 | 5 | 0 | 2008-09-16T14:11:39.130000 | 2008-09-16T14:16:42.160000 |
72,699 | 74,676 | Is it better to join two fields together, or to compare them each to the same constant? | For example which is better: select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id or select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id better as in less work for the database, faster results. Note: Sybase, and there's an index on both tables of country+id. | I had a situation similar to this and this was the solution I resorted to: Select * FROM t1 INNER JOIN t2 ON t1.id = t2.id AND t1.country = t2.country AND t1.country = 'US' I noticed that my query ran faster in this scenario. I made the assumption that joining on the constant saved the engine time because the WHERE cla... | Is it better to join two fields together, or to compare them each to the same constant? For example which is better: select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id or select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id better as in less work for the databa... | TITLE:
Is it better to join two fields together, or to compare them each to the same constant?
QUESTION:
For example which is better: select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id or select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id better as in less w... | [
"sql",
"join"
] | 2 | 1 | 620 | 11 | 0 | 2008-09-16T14:11:53.530000 | 2008-09-16T17:13:44.640000 |
72,768 | 72,801 | How do you detect Credit card type based on number? | I'm trying to figure out how to detect the type of credit card based purely on its number. Does anyone know of a definitive, reliable way to find this? | The credit/debit card number is referred to as a PAN, or Primary Account Number. The first six digits of the PAN are taken from the IIN, or Issuer Identification Number, belonging to the issuing bank (IINs were previously known as BIN — Bank Identification Numbers — so you may see references to that terminology in some... | How do you detect Credit card type based on number? I'm trying to figure out how to detect the type of credit card based purely on its number. Does anyone know of a definitive, reliable way to find this? | TITLE:
How do you detect Credit card type based on number?
QUESTION:
I'm trying to figure out how to detect the type of credit card based purely on its number. Does anyone know of a definitive, reliable way to find this?
ANSWER:
The credit/debit card number is referred to as a PAN, or Primary Account Number. The firs... | [
"algorithm",
"language-agnostic",
"e-commerce"
] | 597 | 890 | 565,125 | 29 | 0 | 2008-09-16T14:16:43.923000 | 2008-09-16T14:18:30.457000 |
72,769 | 73,075 | Static libraries with managed code issue | Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has a function that increments: extern int CallCount = 0; int TheFunction() { void *p = &CallCount printf("Function called"); return CallCount++; } 2. static.lib is linked into a managed C++/CLI managed.dll that wraps TheFunc... | My hunch was that, as you suspected, unmanaged DLLs are loaded in the context of the process and not in the context of the AppDomain, so any static data in unmanaged code is shared among AppDomains. This link shows someone with the same problem you have, still not 100% verification of this, but probably this is the cas... | Static libraries with managed code issue Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has a function that increments: extern int CallCount = 0; int TheFunction() { void *p = &CallCount printf("Function called"); return CallCount++; } 2. static.lib is linked into a manag... | TITLE:
Static libraries with managed code issue
QUESTION:
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has a function that increments: extern int CallCount = 0; int TheFunction() { void *p = &CallCount printf("Function called"); return CallCount++; } 2. static.lib is l... | [
"c#",
"c++",
"managed"
] | 4 | 3 | 3,661 | 6 | 0 | 2008-09-16T14:16:47.433000 | 2008-09-16T14:41:35.253000 |
72,789 | 72,877 | Change app icon in Visual Studio 2005? | I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Icon i... | According to this page you may use preprocessor directives in your *.rc file. You should write something like this #ifdef _DEMO_VERSION_ IDR_MAINFRAME ICON "demo.ico" #else IDR_MAINFRAME ICON "full.ico" #endif | Change app icon in Visual Studio 2005? I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio ... | TITLE:
Change app icon in Visual Studio 2005?
QUESTION:
I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can m... | [
"c++",
"visual-studio-2005",
"icons",
"visual-c++-2005"
] | 8 | 8 | 14,568 | 4 | 0 | 2008-09-16T14:17:51.800000 | 2008-09-16T14:25:35.883000 |
72,799 | 82,202 | Qt or Delphi... If you were to choose one over the other? | If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a bit more time working with Builder C++. Please take out the cross platform ... | Edit: This answer was written in 2008. It probably is no longer so apt, though probably it is not entirely useless. Take with salt. I have used both and have ended up going the Qt route. These are the reasons: Trolltech offer quick and one-to-one support via email Qt innovates, and introduces powerful new features regu... | Qt or Delphi... If you were to choose one over the other? If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a bit more time wor... | TITLE:
Qt or Delphi... If you were to choose one over the other?
QUESTION:
If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a... | [
"delphi",
"qt"
] | 16 | 19 | 12,806 | 10 | 0 | 2008-09-16T14:18:25.527000 | 2008-09-17T11:32:42.423000 |
72,831 | 72,862 | How do I capitalize first letter of first name and last name in C#? | Is there an easy way to capitalize the first letter of a string and lower the rest of it? Is there a built in method or do I need to make my own? | TextInfo.ToTitleCase() capitalizes the first character in each token of a string. If there is no need to maintain Acronym Uppercasing, then you should include ToLower(). string s = "JOHN DOE"; s = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower()); // Produces "John Doe" If CurrentCulture is unavailable, use:... | How do I capitalize first letter of first name and last name in C#? Is there an easy way to capitalize the first letter of a string and lower the rest of it? Is there a built in method or do I need to make my own? | TITLE:
How do I capitalize first letter of first name and last name in C#?
QUESTION:
Is there an easy way to capitalize the first letter of a string and lower the rest of it? Is there a built in method or do I need to make my own?
ANSWER:
TextInfo.ToTitleCase() capitalizes the first character in each token of a strin... | [
"c#",
"string",
"capitalize"
] | 142 | 262 | 137,781 | 17 | 0 | 2008-09-16T14:21:37.017000 | 2008-09-16T14:24:58.943000 |
72,832 | 73,369 | Can I suppress FX Cop code analysis violations globally? | When you use Visual Studio's code analysic (FxCop), and want to suppress a message there are 3 options. Suppress a violation in code. Suppress a violation in a GlobalSupression.cs file. Disable the violation check in the project file (via Project -> Properties -> Code Analysic). The later is very hard to review when ch... | Suppressing multiple violations with a single SuppressMessage attribute is officially not supported. Apparently, this is by design. I agree, it might be annoying at times, but I can't say I disagree with the decision, since the attribute is their way to force you to say, "Yes, I know what I am doing", which should be e... | Can I suppress FX Cop code analysis violations globally? When you use Visual Studio's code analysic (FxCop), and want to suppress a message there are 3 options. Suppress a violation in code. Suppress a violation in a GlobalSupression.cs file. Disable the violation check in the project file (via Project -> Properties ->... | TITLE:
Can I suppress FX Cop code analysis violations globally?
QUESTION:
When you use Visual Studio's code analysic (FxCop), and want to suppress a message there are 3 options. Suppress a violation in code. Suppress a violation in a GlobalSupression.cs file. Disable the violation check in the project file (via Projec... | [
".net",
"visual-studio",
"code-analysis"
] | 9 | 9 | 2,576 | 2 | 0 | 2008-09-16T14:21:38.967000 | 2008-09-16T15:07:44.863000 |
72,852 | 73,149 | How can I do relative imports in Python? | Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2. How should I do it? I tried from..sub2 import mod2, but I'm getting an "Attempted relative import in non-package". I googled around, but I found only " sys.pa... | The problem is that you're running the module as '__main__' by passing the mod1.py as an argument to the interpreter. From PEP 328: Relative imports use a module's __name__ attribute to determine that module's position in the package hierarchy. If the module's name does not contain any package information (e.g. it is s... | How can I do relative imports in Python? Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2. How should I do it? I tried from..sub2 import mod2, but I'm getting an "Attempted relative import in non-package". I ... | TITLE:
How can I do relative imports in Python?
QUESTION:
Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2. How should I do it? I tried from..sub2 import mod2, but I'm getting an "Attempted relative import i... | [
"python",
"python-import",
"python-module"
] | 620 | 384 | 417,016 | 17 | 0 | 2008-09-16T14:24:02.330000 | 2008-09-16T14:48:56.873000 |
72,872 | 72,890 | ASP.Net Redirect Response to a IFrame | How can I redirect the response to an IFrame? | Do you mean from the server-side? - You can't! You'll have to do it on the client side. Say, use a javascript that sends an AJAX request and then embed your response information in the AJAX response. And have the javascript read the response and changes the page in the intended frame accordingly | ASP.Net Redirect Response to a IFrame How can I redirect the response to an IFrame? | TITLE:
ASP.Net Redirect Response to a IFrame
QUESTION:
How can I redirect the response to an IFrame?
ANSWER:
Do you mean from the server-side? - You can't! You'll have to do it on the client side. Say, use a javascript that sends an AJAX request and then embed your response information in the AJAX response. And have ... | [
"asp.net"
] | 2 | 2 | 2,322 | 3 | 0 | 2008-09-16T14:25:22.080000 | 2008-09-16T14:27:02.060000 |
72,895 | 73,944 | Is Async Messaging (In particular pub/sub style messaging) viable as a domain service architecture or only in an SOA-focused environment? | I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts more explicit. But is it a viable pattern for general domain-driven development (at least in the service/application/controller layer), or is the design overhe... | Great question:). The main problem with asynchronous messaging is that when folks use procedural or object oriented languages, working in an asynchronous or event based manner is often quite tricky and complex and hard for the programmer to read & understand. Business logic is often way simpler if its built in a kinda ... | Is Async Messaging (In particular pub/sub style messaging) viable as a domain service architecture or only in an SOA-focused environment? I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts more explicit. But is... | TITLE:
Is Async Messaging (In particular pub/sub style messaging) viable as a domain service architecture or only in an SOA-focused environment?
QUESTION:
I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts mor... | [
"soa",
"messaging"
] | 3 | 5 | 598 | 3 | 0 | 2008-09-16T14:27:26.520000 | 2008-09-16T16:01:12.723000 |
72,899 | 73,050 | How to sort a list of dictionaries by a value of the dictionary in Python? | How do I sort a list of dictionaries by a specific key's value? Given: [{'name': 'Homer', 'age': 39}, {'name': 'Bart', 'age': 10}] When sorted by name, it should become: [{'name': 'Bart', 'age': 10}, {'name': 'Homer', 'age': 39}] | The sorted() function takes a key= parameter newlist = sorted(list_to_be_sorted, key=lambda d: d['name']) Alternatively, you can use operator.itemgetter instead of defining the function yourself from operator import itemgetter newlist = sorted(list_to_be_sorted, key=itemgetter('name')) For completeness, add reverse=Tru... | How to sort a list of dictionaries by a value of the dictionary in Python? How do I sort a list of dictionaries by a specific key's value? Given: [{'name': 'Homer', 'age': 39}, {'name': 'Bart', 'age': 10}] When sorted by name, it should become: [{'name': 'Bart', 'age': 10}, {'name': 'Homer', 'age': 39}] | TITLE:
How to sort a list of dictionaries by a value of the dictionary in Python?
QUESTION:
How do I sort a list of dictionaries by a specific key's value? Given: [{'name': 'Homer', 'age': 39}, {'name': 'Bart', 'age': 10}] When sorted by name, it should become: [{'name': 'Bart', 'age': 10}, {'name': 'Homer', 'age': 39... | [
"python",
"list",
"sorting",
"dictionary",
"data-structures"
] | 2,781 | 3,650 | 1,358,498 | 22 | 0 | 2008-09-16T14:27:47.470000 | 2008-09-16T14:39:44.273000 |
72,913 | 73,007 | Is it possible to advance an enumerator and get its value in a lambda? | If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called? | e => e.MoveNext()? e.Current: null This will advance the enumerator and return the current value, and return null when the enumeration is complete. | Is it possible to advance an enumerator and get its value in a lambda? If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called? | TITLE:
Is it possible to advance an enumerator and get its value in a lambda?
QUESTION:
If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called?
ANSWER:
e => e.MoveNext()? e.Current: null This will... | [
"c#",
"lambda"
] | 1 | 4 | 2,071 | 4 | 0 | 2008-09-16T14:28:35.970000 | 2008-09-16T14:36:12.427000 |
72,921 | 73,723 | How can you find all the IP addresses in a selected block of text with a javascript bookmarklet? | I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem. I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. Internet Duct Tape's Greasemonkey tools, like Co... | In Firefox, you could do something like this: javascript:alert( document.getSelection().match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g).join("\n")) How this works: Gets the selection text from the browser ("document.getSelection()" in FF, in IE it would be "document.selection.createRange().text") Applies a regular exp... | How can you find all the IP addresses in a selected block of text with a javascript bookmarklet? I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem. I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together ... | TITLE:
How can you find all the IP addresses in a selected block of text with a javascript bookmarklet?
QUESTION:
I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem. I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying... | [
"javascript",
"ip-address",
"bookmarklet"
] | 2 | 4 | 1,026 | 5 | 0 | 2008-09-16T14:29:07.983000 | 2008-09-16T15:40:12.663000 |
72,936 | 72,988 | can't delete directory under linux due to broken files | kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-update: No such file or directory ls: cannot access commit-msg: No such file or directory ls: cannot access pre-re... | First off, here's your question, nicely formatted (surround it in < pre > tags to get this): kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-update: No such file ... | can't delete directory under linux due to broken files kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-update: No such file or directory ls: cannot access commit-... | TITLE:
can't delete directory under linux due to broken files
QUESTION:
kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-update: No such file or directory ls: can... | [
"linux",
"system-administration",
"rm"
] | 4 | 5 | 8,986 | 4 | 0 | 2008-09-16T14:30:15.717000 | 2008-09-16T14:34:32.417000 |
72,943 | 72,997 | Possible to set tab focus in IE7 from JavaScript | Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab? Here's what I'm doing today: var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); try { // Not all window types support the focus() property. winRef.... | Jay, You are seeing designed behavior. To limit opportunities for malicious behavior, scripts running in tabbed windows cannot affect other tabs. For more information, please see Tabbed Browsing for Developers at http://msdn.microsoft.com/en-us/library/ms537636.aspx: "The ability to open multiple documents within the s... | Possible to set tab focus in IE7 from JavaScript Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab? Here's what I'm doing today: var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); try { // Not all w... | TITLE:
Possible to set tab focus in IE7 from JavaScript
QUESTION:
Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab? Here's what I'm doing today: var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); ... | [
"javascript",
"internet-explorer-7",
"focus"
] | 1 | 4 | 8,537 | 5 | 0 | 2008-09-16T14:31:04.310000 | 2008-09-16T14:35:19.480000 |
72,945 | 77,898 | How to create a triple-join table with Django | Using Django's built in models, how would one create a triple-join between three models. For example: Users, Roles, and Events are the models. Users have many Roles, and Roles many Users. (ManyToMany) Events have many Users, and Users many Events. (ManyToMany) But for any given Event, any User may have only one Role. H... | zacherates writes: I'd model Role as an association class between Users and Roles (...) I'd also reccomed this solution, but you can also make use of some syntactical sugar provided by Django: ManyToMany relation with extra fields. Example: class User(models.Model): name = models.CharField(max_length=128)
class Event(... | How to create a triple-join table with Django Using Django's built in models, how would one create a triple-join between three models. For example: Users, Roles, and Events are the models. Users have many Roles, and Roles many Users. (ManyToMany) Events have many Users, and Users many Events. (ManyToMany) But for any g... | TITLE:
How to create a triple-join table with Django
QUESTION:
Using Django's built in models, how would one create a triple-join between three models. For example: Users, Roles, and Events are the models. Users have many Roles, and Roles many Users. (ManyToMany) Events have many Users, and Users many Events. (ManyToM... | [
"python",
"django",
"model-view-controller",
"model"
] | 11 | 11 | 6,224 | 4 | 0 | 2008-09-16T14:31:21.737000 | 2008-09-16T22:22:52.757000 |
72,961 | 74,480 | The log file for database is full | So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space." How do I go about fixing this without deleting the log like some other sites have mentioned? Additional Info: Enable AutoGrowth is enabled growing by 10% and is res... | Scott, as you guessed: truncating the log is a bad move if you care about your data. The following, free, videos will help you see exactly what's going on and will show you how to fix the problem without truncating the logs. (These videos also explain why that's such a dangerous hack and why you are right to look for a... | The log file for database is full So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space." How do I go about fixing this without deleting the log like some other sites have mentioned? Additional Info: Enable AutoGrowth is... | TITLE:
The log file for database is full
QUESTION:
So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space." How do I go about fixing this without deleting the log like some other sites have mentioned? Additional Info: En... | [
"sql-server",
"sql-server-2000"
] | 9 | 4 | 46,686 | 12 | 0 | 2008-09-16T14:32:49.237000 | 2008-09-16T16:53:21.287000 |
72,983 | 85,050 | Which logging library is better? | I was wondering; which logging libraries for Delphi do you prefer? CodeSite SmartInspect Log4Delphi TraceFormat Please try to add a reasoning why you prefer one over the other if you've used more than one. I'll add suggestions to this question to keep things readable. | SmartInspect is really useful. It is the only one I have used. The logging library is good, but the console and the remote TCP/IP logging takes it over the top. I think CodeSite has some similar features. | Which logging library is better? I was wondering; which logging libraries for Delphi do you prefer? CodeSite SmartInspect Log4Delphi TraceFormat Please try to add a reasoning why you prefer one over the other if you've used more than one. I'll add suggestions to this question to keep things readable. | TITLE:
Which logging library is better?
QUESTION:
I was wondering; which logging libraries for Delphi do you prefer? CodeSite SmartInspect Log4Delphi TraceFormat Please try to add a reasoning why you prefer one over the other if you've used more than one. I'll add suggestions to this question to keep things readable.
... | [
"delphi",
"logging"
] | 23 | 10 | 9,983 | 10 | 0 | 2008-09-16T14:34:25.037000 | 2008-09-17T16:30:06.327000 |
73,000 | 93,914 | Modal dialogs in IE gets hidden behind IE if user clicks on IE pane | I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds all IE threads IE pane does not refresh and dialog window is still painted on top of I... | What argument are you using for the parent? You may have better luck if you use the parent of the Applet. javax.swing.SwingUtilities.getWindowAncestor(theApplet) Using the getWindowAncestor will skip the applet parents (getRoot(component) will return applets). In at least some versions of Java there was a Frame that wa... | Modal dialogs in IE gets hidden behind IE if user clicks on IE pane I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds all IE threads IE ... | TITLE:
Modal dialogs in IE gets hidden behind IE if user clicks on IE pane
QUESTION:
I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds ... | [
"java",
"internet-explorer",
"swing",
"applet",
"modal-dialog"
] | 2 | 1 | 2,429 | 4 | 0 | 2008-09-16T14:35:25.313000 | 2008-09-18T16:01:56.573000 |
73,008 | 73,158 | How much data can/should you store in a users session object? | We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until the end of th... | Assuming the information is not sensitive then you could store the information in a cookie which would reduce the amount of information required to be stored server side. This would also allow you to access the information via JavaScript. Alternatively you could use the viewstate to store the information although this ... | How much data can/should you store in a users session object? We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during each form submissio... | TITLE:
How much data can/should you store in a users session object?
QUESTION:
We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during e... | [
"asp.net",
"session"
] | 9 | 3 | 9,193 | 5 | 0 | 2008-09-16T14:36:22.597000 | 2008-09-16T14:49:44.937000 |
73,022 | 954,873 | CodeFile vs CodeBehind | What is the difference between CodeFile ="file.ascx.cs" and CodeBehind ="file.ascx.cs" in the declaration of a ASP.NET user control? Is one newer or recommended? Or do they have specific usage? | CodeBehind: Needs to be compiled (ASP.NET 1.1 model). The compiled binary is placed in the bin folder of the website. You need to do a compile in Visual Studio before you deploy. It's a good model when you don't want the source code to be viewable as plain text. For example when delivering to a customer to whom you don... | CodeFile vs CodeBehind What is the difference between CodeFile ="file.ascx.cs" and CodeBehind ="file.ascx.cs" in the declaration of a ASP.NET user control? Is one newer or recommended? Or do they have specific usage? | TITLE:
CodeFile vs CodeBehind
QUESTION:
What is the difference between CodeFile ="file.ascx.cs" and CodeBehind ="file.ascx.cs" in the declaration of a ASP.NET user control? Is one newer or recommended? Or do they have specific usage?
ANSWER:
CodeBehind: Needs to be compiled (ASP.NET 1.1 model). The compiled binary is... | [
"asp.net"
] | 148 | 176 | 104,138 | 3 | 0 | 2008-09-16T14:37:04.360000 | 2009-06-05T08:46:27.083000 |
73,024 | 73,083 | What is this delegate call doing in this line of code (C#)? | This is from an example accompanying the agsXMPP.Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why delegate(0) accomplishes this, in the kind of simple te... | The delegate(object o){..} tells the compiler to package up whatever is inside the brackets as an object to be executed later, in this case when OnLogin is fired. Without the delegate() statement, the compiler would think you are tying to execute an action in the middle of an assignemnt statement and give you errors. | What is this delegate call doing in this line of code (C#)? This is from an example accompanying the agsXMPP.Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of... | TITLE:
What is this delegate call doing in this line of code (C#)?
QUESTION:
This is from an example accompanying the agsXMPP.Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is a... | [
"c#",
"delegates"
] | 4 | 1 | 1,247 | 9 | 0 | 2008-09-16T14:37:12.317000 | 2008-09-16T14:42:04.190000 |
73,032 | 73,090 | How can I sort by multiple conditions with different orders? | I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. However, in this... | How about: ordered_list = [[1, "b"], [1, "a"], [2, "a"]] ordered_list.sort! do |a,b| [a[0],b[1]] <=> [b[0], a[1]] end | How can I sort by multiple conditions with different orders? I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an arra... | TITLE:
How can I sort by multiple conditions with different orders?
QUESTION:
I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sor... | [
"ruby",
"sorting"
] | 18 | 33 | 11,156 | 5 | 0 | 2008-09-16T14:38:02.657000 | 2008-09-16T14:43:03.393000 |
73,037 | 78,318 | What's the best approach to embed RegEx in Oracle or SQL Server 2005 SQL? | This is a 3 part question regarding embedded RegEx into SQL statements. How do you embed a RegEx expression into an Oracle PL/SQL select statement that will parse out the “DELINQUENT” string in the text string shown below? What is the performance impact if used within a mission critical business transaction? Since embe... | Why would you need regular expressions here? INSTR and SUBSTR will do the job perfectly. But if you convinced you need Regex'es you can use: REGEXP_INSTR REGEXP_REPLACE REGEXP_SUBSTR (only available in Oracle 10g and up) SELECT emp_id, text FROM employee_comment WHERE REGEXP_LIKE(text,'...-....'); | What's the best approach to embed RegEx in Oracle or SQL Server 2005 SQL? This is a 3 part question regarding embedded RegEx into SQL statements. How do you embed a RegEx expression into an Oracle PL/SQL select statement that will parse out the “DELINQUENT” string in the text string shown below? What is the performance... | TITLE:
What's the best approach to embed RegEx in Oracle or SQL Server 2005 SQL?
QUESTION:
This is a 3 part question regarding embedded RegEx into SQL statements. How do you embed a RegEx expression into an Oracle PL/SQL select statement that will parse out the “DELINQUENT” string in the text string shown below? What ... | [
"sql",
"sql-server",
"regex",
"oracle"
] | 1 | 1 | 544 | 5 | 0 | 2008-09-16T14:38:41.530000 | 2008-09-16T23:24:42.330000 |
73,039 | 73,428 | What's the best way to handle long running process in an ASP.Net application? | In my web application there is a process that queries data from all over the web, filters it, and saves it to the database. As you can imagine this process takes some time. My current solution is to increase the page timeout and give an AJAX progress bar to the user while it loads. This is a problem for two reasons - 1... | To avoid excessive architecture astronomy, I often use a hidden iframe to call the long running process and stream back progress information. Coupled with something like jsProgressBarHandler, you can pretty easily create great out-of-band progress indication for longer tasks where a generic progress animation doesn't c... | What's the best way to handle long running process in an ASP.Net application? In my web application there is a process that queries data from all over the web, filters it, and saves it to the database. As you can imagine this process takes some time. My current solution is to increase the page timeout and give an AJAX ... | TITLE:
What's the best way to handle long running process in an ASP.Net application?
QUESTION:
In my web application there is a process that queries data from all over the web, filters it, and saves it to the database. As you can imagine this process takes some time. My current solution is to increase the page timeout... | [
"c#",
".net",
"asp.net",
"asp.net-ajax"
] | 1 | 7 | 8,809 | 7 | 0 | 2008-09-16T14:38:46.727000 | 2008-09-16T15:15:30.040000 |
73,051 | 73,108 | How to retrieve error when launching sqlcmd from C#? | I need to run a stored procedure from a C# application. I use the following code to do so: Process sqlcmdCall = new Process(); sqlcmdCall.StartInfo.FileName = "sqlcmd.exe"; sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":EXIT(sp_test)\"" sqlcmdCall.Start(); sqlcmdCall.WaitForExit(); From the... | If you are trying to call a stored procedure from c# you would want to use ADO.Net instead of the calling sqlcmd via the command line. Look at SqlConnection and SqlCommand in the System.Data.SqlClient namespace. Once you are calling the stored procedure via SqlCommand you will be able to catch an exception raised by th... | How to retrieve error when launching sqlcmd from C#? I need to run a stored procedure from a C# application. I use the following code to do so: Process sqlcmdCall = new Process(); sqlcmdCall.StartInfo.FileName = "sqlcmd.exe"; sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":EXIT(sp_test)\"" s... | TITLE:
How to retrieve error when launching sqlcmd from C#?
QUESTION:
I need to run a stored procedure from a C# application. I use the following code to do so: Process sqlcmdCall = new Process(); sqlcmdCall.StartInfo.FileName = "sqlcmd.exe"; sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":... | [
"c#",
"sql-server"
] | 2 | 1 | 3,302 | 3 | 0 | 2008-09-16T14:39:49.877000 | 2008-09-16T14:44:32.330000 |
73,063 | 249,501 | How do I add Debug Breakpoints to lines displayed in a "Find Results" window in Visual Studio | In Visual Studio 2005-2015 it is possible to find all lines containing certain references and display them in a "Find Results" window. Now that these result lines are displayed, is there any keyboard shortcut that would allow adding debug breakpoints to all of them? | This answer does not work for Visual Studio 2015 or later. A more recent answer can be found here. You can do this fairly easily with a Visual Studio macro. Within Visual Studio, hit Alt-F11 to open the Macro IDE and add a new module by right-clicking on MyMacros and selecting Add|Add Module... Paste the following in t... | How do I add Debug Breakpoints to lines displayed in a "Find Results" window in Visual Studio In Visual Studio 2005-2015 it is possible to find all lines containing certain references and display them in a "Find Results" window. Now that these result lines are displayed, is there any keyboard shortcut that would allow ... | TITLE:
How do I add Debug Breakpoints to lines displayed in a "Find Results" window in Visual Studio
QUESTION:
In Visual Studio 2005-2015 it is possible to find all lines containing certain references and display them in a "Find Results" window. Now that these result lines are displayed, is there any keyboard shortcut... | [
"visual-studio",
"debugging",
"breakpoints"
] | 20 | 18 | 10,824 | 4 | 0 | 2008-09-16T14:40:36.783000 | 2008-10-30T07:35:29.687000 |
73,072 | 78,897 | Report templates for Team Foundation Server 2008 | Does anybody have links to site or pre built report running on the SQL Analysis Service provided by TFS2008? Creating a meaningful Excel report or a new report sometime is a very boring and difficult taks, maybe finding a way to share reports could be a good idea? | Try this download: Creating and Customizing TFS Reports, it includes a few samples and some guidance. More here. Also try the TFS Reporting Samples.zip linked from this site. This site links to a large number of TFS reporting resources: http://blogs.msdn.com/teams_wit_tools/archive/2007/03/26/tfs-report-developer-resou... | Report templates for Team Foundation Server 2008 Does anybody have links to site or pre built report running on the SQL Analysis Service provided by TFS2008? Creating a meaningful Excel report or a new report sometime is a very boring and difficult taks, maybe finding a way to share reports could be a good idea? | TITLE:
Report templates for Team Foundation Server 2008
QUESTION:
Does anybody have links to site or pre built report running on the SQL Analysis Service provided by TFS2008? Creating a meaningful Excel report or a new report sometime is a very boring and difficult taks, maybe finding a way to share reports could be a... | [
"tfs"
] | 2 | 4 | 2,689 | 2 | 0 | 2008-09-16T14:41:21.027000 | 2008-09-17T01:22:43.510000 |
73,078 | 73,239 | How does one unit test sections of code that are procedural or event-based | I'm convinced from this presentation and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently working on, I walk away confused. It is a x... | The idea of unit testing is to test small sections of code with each test. In an event based system, one form of unit testing you could do, would be to test how your event handlers respond to various events. So your unit test might set an aspect of your program into a specific state, then call the event listener method... | How does one unit test sections of code that are procedural or event-based I'm convinced from this presentation and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in... | TITLE:
How does one unit test sections of code that are procedural or event-based
QUESTION:
I'm convinced from this presentation and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it... | [
"unit-testing"
] | 8 | 5 | 3,263 | 7 | 0 | 2008-09-16T14:41:49.887000 | 2008-09-16T14:55:44.643000 |
73,086 | 73,094 | Three column web design with variable sides | I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. I haven't been able to get this working properly in all current browsers. A... | Use this technique, and simply specify a fixed width for the centre column. | Three column web design with variable sides I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. I haven't been able to get this... | TITLE:
Three column web design with variable sides
QUESTION:
I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. I haven't bee... | [
"html",
"css",
"multiple-columns"
] | 2 | 2 | 2,749 | 4 | 0 | 2008-09-16T14:42:29.043000 | 2008-09-16T14:43:24.780000 |
73,087 | 73,155 | X/Gnome: How to measure the geometry of an open window | Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it. I'm running on Red Hat Enterprise Linux 4.4. Thanks! | Yes, you're looking for the program 'xwininfo'. Run it in another terminal and then click on the window you want info about and it will give it to you. Hope this helps! | X/Gnome: How to measure the geometry of an open window Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it. I'm running on Red Hat Enterprise Lin... | TITLE:
X/Gnome: How to measure the geometry of an open window
QUESTION:
Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it. I'm running on Red ... | [
"linux",
"x11",
"gnome"
] | 18 | 23 | 7,384 | 2 | 0 | 2008-09-16T14:42:32.863000 | 2008-09-16T14:49:28.090000 |
73,095 | 73,616 | How to implement a simple auto-complete functionality? | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be: void add(String) void remove(String) String complete(String) What's the best way to do this in terms of algorith... | you should consider to use a PATRICIA trie for the data structure. Search for 'patricia trie' on google and you'll find a lot of information... | How to implement a simple auto-complete functionality? I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be: void add(String) void remove(String) String complete(Stri... | TITLE:
How to implement a simple auto-complete functionality?
QUESTION:
I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be: void add(String) void remove(String) St... | [
"java",
"autocomplete"
] | 3 | 4 | 7,132 | 6 | 0 | 2008-09-16T14:43:37.463000 | 2008-09-16T15:31:32.403000 |
73,110 | 89,428 | How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit? | For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be using a differe... | Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form. It's not quite perfect but ought to work for you. using System; using System.Drawing; using System.Windows.Forms;
public class MyTextBox: TextBox { private bool mScrollbars; public ... | How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit? For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is the... | TITLE:
How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit?
QUESTION:
For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy th... | [
"winforms",
"textbox",
"scrollbar"
] | 28 | 14 | 23,495 | 6 | 0 | 2008-09-16T14:44:41.050000 | 2008-09-18T02:18:22.637000 |
73,117 | 73,537 | Making a game in C++ using parallel processing | I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the states must c... | What you should do is first to read and understand the "fixed time-step" game loop (Here's a good explanation: http://www.gaffer.org/game-physics/fix-your-timestep ). Then what you do is to keep a list of list of pairs of frame counter and action. STL example: std::list > > state; Or maybe a vector of lists of pairs. T... | Making a game in C++ using parallel processing I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing ... | TITLE:
Making a game in C++ using parallel processing
QUESTION:
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is cre... | [
"c++",
"opengl",
"graphics",
"directx",
"sdl"
] | 2 | 6 | 3,164 | 7 | 0 | 2008-09-16T14:45:19.893000 | 2008-09-16T15:25:19.173000 |
73,123 | 73,315 | Is it possible to use .htaccess to send six digit number URLs to a script but handle all other invalid URLs as 404s? | Is it possible to use.htaccess to process all six digit URLs by sending them to a script, but handle every other invalid URL as an error 404? For example: http://mywebsite.com/132483 would be sent to: http://mywebsite.com/scriptname.php?no=132483 but http://mywebsite.com/132483a or http://mywebsite.com/asdf would be ha... | RewriteEngine on RewriteRule ^([0-9]{6})$ scriptname.php?no=$1 [L] To preserve the clean URL http://mywebsite.com/132483 while serving scriptname.php use only [L]. Using [R=301] will redirect you to your scriptname.php?no=xxx You may find this useful http://www.addedbytes.com/download/mod_rewrite-cheat-sheet-v2/pdf/ | Is it possible to use .htaccess to send six digit number URLs to a script but handle all other invalid URLs as 404s? Is it possible to use.htaccess to process all six digit URLs by sending them to a script, but handle every other invalid URL as an error 404? For example: http://mywebsite.com/132483 would be sent to: ht... | TITLE:
Is it possible to use .htaccess to send six digit number URLs to a script but handle all other invalid URLs as 404s?
QUESTION:
Is it possible to use.htaccess to process all six digit URLs by sending them to a script, but handle every other invalid URL as an error 404? For example: http://mywebsite.com/132483 wo... | [
"php",
".htaccess",
"redirect"
] | 3 | 4 | 1,500 | 3 | 0 | 2008-09-16T14:46:03.887000 | 2008-09-16T15:02:41.210000 |
73,128 | 73,192 | FileSystemWatcher Dispose call hangs | We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to.NET3.5 SP1 so I'm trying to find out if anyone else has seen this behavior. Here is the code that creates t... | Just a thought... Any chance there's a deadlock issue here? You're calling TreeView.Invoke, which is a blocking call. If a filesystem change happens just as you're clicking whatever button causes the FileSystemWatcher.Dispose() call, your FileWatcherFileChanged method will get called on a background thread and call Tre... | FileSystemWatcher Dispose call hangs We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to.NET3.5 SP1 so I'm trying to find out if anyone else has seen this beha... | TITLE:
FileSystemWatcher Dispose call hangs
QUESTION:
We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to.NET3.5 SP1 so I'm trying to find out if anyone else ... | [
"c#",
".net",
"winforms",
"filesystemwatcher"
] | 11 | 9 | 5,922 | 3 | 0 | 2008-09-16T14:46:47.270000 | 2008-09-16T14:52:27.397000 |
73,134 | 73,163 | Will this C++ code cause a memory leak (casting array new) | I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting array new thus: STRUCT* pStruct = (STRUCT*)new BYTE[sizeof(STRUCT) + nPaddingSize]; Later on however the memory is freed using... | Technically I believe it could cause a problem with mismatched allocators, though in practice I don't know of any compiler that would not do the right thing with this example. More importantly if STRUCT where to have (or ever be given) a destructor then it would invoke the destructor without having invoked the correspo... | Will this C++ code cause a memory leak (casting array new) I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting array new thus: STRUCT* pStruct = (STRUCT*)new BYTE[sizeof(STRUCT) ... | TITLE:
Will this C++ code cause a memory leak (casting array new)
QUESTION:
I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting array new thus: STRUCT* pStruct = (STRUCT*)new BY... | [
"c++",
"memory-management",
"memory-leaks"
] | 10 | 12 | 7,591 | 24 | 0 | 2008-09-16T14:47:22.913000 | 2008-09-16T14:50:18.320000 |
73,162 | 73,383 | How to make the taskbar blink my application like Messenger does when a new message arrive? | Is there an API call in.NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with? | FlashWindowEx is the way to go. See here for MSDN documentation [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
[StructLayout(LayoutKind.Sequential)] public struct FLASHWINFO { public UInt32 cbSize; public IntPtr hwnd; public UInt32 dwFlags; publ... | How to make the taskbar blink my application like Messenger does when a new message arrive? Is there an API call in.NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with? | TITLE:
How to make the taskbar blink my application like Messenger does when a new message arrive?
QUESTION:
Is there an API call in.NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with?
ANSWER:
FlashWindowEx is the way to go. See here... | [
"windows",
"winapi"
] | 20 | 23 | 18,860 | 5 | 0 | 2008-09-16T14:50:05.200000 | 2008-09-16T15:10:14.670000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.