PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71,850 | 09/16/2008 12:49:32 | 4,227 | 09/02/2008 13:08:22 | 82 | 5 | Enterprise Design Patterns for .NET | I was told that [this book][1] is a standard when it comes to enterprise design patterns (sort of like the GoF book). Is there a book that covers exactly what this book does only with .NET?
[1]: http://www.amazon.com/Patterns-of-Enterprise-Application-Architecture/dp/0321127420/ref=sr_1_1?ie=UTF8&s=books-intl-de&qid=1221568813&sr=8-1 | .net | design-patterns | enterprise | null | null | null | open | Enterprise Design Patterns for .NET
===
I was told that [this book][1] is a standard when it comes to enterprise design patterns (sort of like the GoF book). Is there a book that covers exactly what this book does only with .NET?
[1]: http://www.amazon.com/Patterns-of-Enterprise-Application-Architecture/dp/0321127420/ref=sr_1_1?ie=UTF8&s=books-intl-de&qid=1221568813&sr=8-1 | 0 |
71,864 | 09/16/2008 12:52:22 | 12,015 | 09/16/2008 12:52:22 | 1 | 0 | Delete all but the 4 newest directories | How would you do this in bash | bash | shell | null | null | null | null | open | Delete all but the 4 newest directories
===
How would you do this in bash | 0 |
71,885 | 09/16/2008 12:54:52 | 6,414 | 09/15/2008 09:37:56 | 49 | 9 | .NET Framework versions | I've had a little search and I was wondering if there is back compatibility for the .NET framework.
The real question is, if there's a program that uses .NET Framework 1.1, can I install 3.5 and be done, or do I have to install 1.1 and then if something uses 3.5 I have to install 3.5 as well? | .net | installation | framework | null | null | null | open | .NET Framework versions
===
I've had a little search and I was wondering if there is back compatibility for the .NET framework.
The real question is, if there's a program that uses .NET Framework 1.1, can I install 3.5 and be done, or do I have to install 1.1 and then if something uses 3.5 I have to install 3.5 as well? | 0 |
71,906 | 09/16/2008 12:57:33 | 6,618 | 09/15/2008 12:22:19 | 1 | 3 | Java Documentation | I have a school project which has to be coded in java and I'm having a little trouble getting started, mainly finding good documentation for this language.
Is there anything for java like what http://www.php.net is for php?
| java | documentation | null | null | null | null | open | Java Documentation
===
I have a school project which has to be coded in java and I'm having a little trouble getting started, mainly finding good documentation for this language.
Is there anything for java like what http://www.php.net is for php?
| 0 |
71,913 | 09/16/2008 12:58:07 | 11,972 | 09/16/2008 12:41:05 | 1 | 0 | Why do we use extra expression? | Actually, I'm new at C-programming, so there is the sample from Kernighan & Ritchie's "The C Programming Language":
int getline(char s[], int lim)
{
int c, i;
i=0;
while (--lim > 0; && (c=getchar()) !=EOF && c !='\n')
s[i++] = c;
if (c =='\n')
s[i++] = c;
s[i] = '\0';
return i;
}
Why do we should check if c != '\n', despite we use s[i++] = c after that? | ansi-c | null | null | null | null | null | open | Why do we use extra expression?
===
Actually, I'm new at C-programming, so there is the sample from Kernighan & Ritchie's "The C Programming Language":
int getline(char s[], int lim)
{
int c, i;
i=0;
while (--lim > 0; && (c=getchar()) !=EOF && c !='\n')
s[i++] = c;
if (c =='\n')
s[i++] = c;
s[i] = '\0';
return i;
}
Why do we should check if c != '\n', despite we use s[i++] = c after that? | 0 |
71,919 | 09/16/2008 12:58:55 | 6,065 | 09/12/2008 07:45:05 | 48 | 5 | How do I get the text size of a string on a WPF canvas? | I'm trying to find the amount of space/width that a string would take when its drawn on a WPF canvas? | .net | wpf | null | null | null | null | open | How do I get the text size of a string on a WPF canvas?
===
I'm trying to find the amount of space/width that a string would take when its drawn on a WPF canvas? | 0 |
71,920 | 09/16/2008 12:59:00 | 103,373 | 09/15/2008 16:23:52 | 13 | 0 | How to implement a Digg-like algorithm? | How to implement a website with a recommendation system similar to stackoverflow/digg/reddit? I.e., users submit content and the website needs to calculate some sort of "hotness" according to how popular the item is. The flow is as follows:
- Users submit content
- Other users view and vote on the content (assume 90% of the users only views content and 10% actively votes up or down on content)
- New content is continuously submitted
How do I implement an algorithm that calculates the "hotness" of a submitted item, preferably in real-time? Are there any best-practices or design patterns?
I would assume that the algorithm takes the following into consideration:
- When an item was submitted
- When each vote was cast
- When the item was viewed
E.g. an item that gets a constant trickle of votes would stay somewhat "hot" constantly while an item that receives a burst of votes when it is first submitted will jump to the top of the "hotness"-list but then fall down as the votes stop coming in.
(I am using a MySQL+PHP but I am interested in general design patterns).
| sql | stackoverflow | algorithms | digg | recommendations | null | open | How to implement a Digg-like algorithm?
===
How to implement a website with a recommendation system similar to stackoverflow/digg/reddit? I.e., users submit content and the website needs to calculate some sort of "hotness" according to how popular the item is. The flow is as follows:
- Users submit content
- Other users view and vote on the content (assume 90% of the users only views content and 10% actively votes up or down on content)
- New content is continuously submitted
How do I implement an algorithm that calculates the "hotness" of a submitted item, preferably in real-time? Are there any best-practices or design patterns?
I would assume that the algorithm takes the following into consideration:
- When an item was submitted
- When each vote was cast
- When the item was viewed
E.g. an item that gets a constant trickle of votes would stay somewhat "hot" constantly while an item that receives a burst of votes when it is first submitted will jump to the top of the "hotness"-list but then fall down as the votes stop coming in.
(I am using a MySQL+PHP but I am interested in general design patterns).
| 0 |
71,944 | 09/16/2008 13:01:15 | 51 | 08/01/2008 13:31:13 | 2,010 | 84 | How do I Validate the File Type of a File Upload? | I am using <code><input type="file" id="fileUpload" runat="server"></code> to upload a file in an asp.net app. I would like to limit the file type of the upload (example: limit to xls or xlsx 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 very large files uploaded, so any validation needs to take place before the actual files are uploaded). | asp.net | javascript | validation | file | upload | null | open | How do I Validate the File Type of a File Upload?
===
I am using <code><input type="file" id="fileUpload" runat="server"></code> to upload a file in an asp.net app. I would like to limit the file type of the upload (example: limit to xls or xlsx 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 very large files uploaded, so any validation needs to take place before the actual files are uploaded). | 0 |
71,956 | 09/16/2008 13:03:22 | 12,035 | 09/16/2008 12:57:21 | 1 | 0 | VB.Net Tutorials | My company's moving to VB.Net in the near future and I need to make the move from "Classic" ASP (i.e. VBScript)
I've had a look at www.asp.net but most of the tutorials appear to be in video format which I can't access at the office. And I'm currently looking at http://www.dotnetjunkies.com/quickstart/aspplus/doc/quickstart.aspx
Ideally what I'm looking for is a tutorial that will show me how to build a simple site from start to finish so I can get my head around the techniques used - I learn better by "Doing"!
Also if anyone has any recommendations for books (my Boss is buying!) That'd be great.
Thanks in advance for your help | vb.net | tutorials | books | null | null | null | open | VB.Net Tutorials
===
My company's moving to VB.Net in the near future and I need to make the move from "Classic" ASP (i.e. VBScript)
I've had a look at www.asp.net but most of the tutorials appear to be in video format which I can't access at the office. And I'm currently looking at http://www.dotnetjunkies.com/quickstart/aspplus/doc/quickstart.aspx
Ideally what I'm looking for is a tutorial that will show me how to build a simple site from start to finish so I can get my head around the techniques used - I learn better by "Doing"!
Also if anyone has any recommendations for books (my Boss is buying!) That'd be great.
Thanks in advance for your help | 0 |
71,971 | 09/16/2008 13:05:20 | 11,707 | 09/16/2008 10:27:54 | 1 | 1 | 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 is ok. Does anybody know why this is happening and how can I stop it.
Thanks | asp.net | iis | null | null | null | null | open | 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 is ok. Does anybody know why this is happening and how can I stop it.
Thanks | 0 |
71,985 | 09/16/2008 13:06:39 | 9,831 | 09/15/2008 20:08:04 | 1 | 0 | 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. | emacs | editor | tips-and-tricks | shortcuts | null | null | open | 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. | 0 |
71,989 | 09/16/2008 13:06:46 | 11,886 | 09/16/2008 12:03:35 | 1 | 0 | How to run TAP::Harness tests written in Guile? | The usual approach of
<pre>test:
$(PERL) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INCDIRS)')" $(TEST_FILES)</pre>
fails to run Guile scripts, because it passes to Guile the extra parameter "-w".
One possible approach is to set up your project as follows.
Your directory structure is as follows:
<pre>./project Your project files
./project/t/*.t Your unit test scripts
./project/t/scripts/* Auxiliary scripts used by your unit tests</pre>
Your ./project/Makefile contains the following:
<pre>PERL = /usr/bin/perl
TEST_LIBDIRS = ./lib
RUN_GUILE_TESTS = ./t/scripts/RunGuileTests.pl
TEST_FILES = ./t/*.t
test:
$(PERL) -I$(TEST_LIBDIRS) $(RUN_GUILE_TESTS) $(TEST_FILES)</pre>
Your ./project/t/scripts/RunGuileTests.pl contents are:
<pre>#!/usr/bin/perl -w
# Run Guile tests - filenames are given as arguments to the script.
use TAP::Harness;
my @tests = @ARGV;
my %args = (
verbosity => 0,
timer => 1,
show_count => 1,
exec => ['/usr/bin/guile', '-s'],
);
my $harness = TAP::Harness->new( \%args );
$harness->runtests(@tests);
# End of RunGuileTests.pl</pre>
Your Guile test scripts should start with:
<pre>#!/usr/bin/guile -s
!#
; Description of your tests</pre> | guile | unit-testing | null | null | null | null | open | How to run TAP::Harness tests written in Guile?
===
The usual approach of
<pre>test:
$(PERL) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INCDIRS)')" $(TEST_FILES)</pre>
fails to run Guile scripts, because it passes to Guile the extra parameter "-w".
One possible approach is to set up your project as follows.
Your directory structure is as follows:
<pre>./project Your project files
./project/t/*.t Your unit test scripts
./project/t/scripts/* Auxiliary scripts used by your unit tests</pre>
Your ./project/Makefile contains the following:
<pre>PERL = /usr/bin/perl
TEST_LIBDIRS = ./lib
RUN_GUILE_TESTS = ./t/scripts/RunGuileTests.pl
TEST_FILES = ./t/*.t
test:
$(PERL) -I$(TEST_LIBDIRS) $(RUN_GUILE_TESTS) $(TEST_FILES)</pre>
Your ./project/t/scripts/RunGuileTests.pl contents are:
<pre>#!/usr/bin/perl -w
# Run Guile tests - filenames are given as arguments to the script.
use TAP::Harness;
my @tests = @ARGV;
my %args = (
verbosity => 0,
timer => 1,
show_count => 1,
exec => ['/usr/bin/guile', '-s'],
);
my $harness = TAP::Harness->new( \%args );
$harness->runtests(@tests);
# End of RunGuileTests.pl</pre>
Your Guile test scripts should start with:
<pre>#!/usr/bin/guile -s
!#
; Description of your tests</pre> | 0 |
72,010 | 09/16/2008 13:09:10 | 12,083 | 09/16/2008 13:09:10 | 1 | 0 | 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.
class A
{
public:
int DoSomething() {return 0;};
};
class B : public A
{
public:
int DoSomething(int x) {return 1;};
};
int main()
{
B* b = new B();
b->A::DoSomething(); //why this?
//b->DoSomething(); //why not this? (gives compiler error)
delete b;
return 0;
} | c++ | function | overloading | resolution | null | null | open | 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.
class A
{
public:
int DoSomething() {return 0;};
};
class B : public A
{
public:
int DoSomething(int x) {return 1;};
};
int main()
{
B* b = new B();
b->A::DoSomething(); //why this?
//b->DoSomething(); //why not this? (gives compiler error)
delete b;
return 0;
} | 0 |
72,014 | 09/16/2008 13:09:32 | 11,947 | 09/16/2008 12:33:17 | 1 | 1 | 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 common pitfalls to avoid, etc. | .net | sql-server-2005 | assemblies | null | null | null | open | 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 common pitfalls to avoid, etc. | 0 |
72,016 | 09/16/2008 13:09:48 | 5,903 | 09/11/2008 15:49:15 | 360 | 24 | Windows Forms Test Automation | We are looking for a way to automate windows forms acceptance testing. Our requirements are:
- **Must be usable by non-developers** (ie: people with no development environment installed)
- Must have a recorder
- Must support third-party controls
- Must have basic functionality (allow clicking on buttons, inputing text, validating results, accros multiple windows if necessary)
Basically, something like [Selenium][1], but for windows forms.
[1]: http://selenium.openqa.org/ | winforms | testing | null | null | null | null | open | Windows Forms Test Automation
===
We are looking for a way to automate windows forms acceptance testing. Our requirements are:
- **Must be usable by non-developers** (ie: people with no development environment installed)
- Must have a recorder
- Must support third-party controls
- Must have basic functionality (allow clicking on buttons, inputing text, validating results, accros multiple windows if necessary)
Basically, something like [Selenium][1], but for windows forms.
[1]: http://selenium.openqa.org/ | 0 |
72,036 | 09/16/2008 13:13:14 | 3,747 | 08/30/2008 14:33:59 | 328 | 30 | 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.net | webforms | null | null | null | null | open | 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. | 0 |
72,057 | 09/16/2008 13:16:47 | 11,886 | 09/16/2008 12:03:35 | 1 | 0 | How to build unit tests in Guile, which output to the TAP standard? | The following script, to be named guiletap.scm, implements the frequently-needed functions for using the TAP protocol when running tests.
<pre>; Define functions for running Guile-written tests under the TAP protocol.
; Copyright © 2008 by Omer Zak
; Released under the GNU LGPL 2.1 or (at your option) any later version.
;;;
;;; To invoke it:
;;; (use-modules (guiletap))
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-module (guiletap))
(export plan)
(export ok)
(export bail_out)
(export diag)
(export is_ok)
(use-modules (ice-9 format))
; n is the number of tests.
(define plan
(lambda (n) (display (format "1..~d~%" n))))
; n - test number
; testdesc - test descriptor
; res - result which is #f at failure, other at success.
(define ok
(lambda (n testdesc res)
(if (not res)(display "not "))
(display (format "ok ~d - ~a~%" n testdesc))))
; testdesc - test descriptor
(define bail_out
(lambda (testdesc)
(display (format "Bail out! - ~a~%" testdesc))))
; diagmsg - diagnostic message
(define diag
(lambda (diagmsg)
(display (format "# ~a~%" diagmsg))))
; n - test number
; testdesc - test descriptor
; expres - expected test result
; actres - actual test result
(define is_ok
(lambda (n testdesc expres actres)
(ok n testdesc (equal? expres actres))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; !!! TODO:
; !!! To be implemented also:
; plan_no_plan
; plan_skip_all [REASON]
;
; is RESULT EXPECTED [NAME]
; isnt RESULT EXPECTED [NAME]
; like RESULT PATTERN [NAME]
; unlike RESULT PATTERN [NAME]
; pass [NAME]
; fail [NAME]
;
; skip CONDITION [REASON] [NB_TESTS=1]
; Specify TODO mode by setting $TODO:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; End of guiletap.scm</pre> | guile | unit-testing | tap | null | null | null | open | How to build unit tests in Guile, which output to the TAP standard?
===
The following script, to be named guiletap.scm, implements the frequently-needed functions for using the TAP protocol when running tests.
<pre>; Define functions for running Guile-written tests under the TAP protocol.
; Copyright © 2008 by Omer Zak
; Released under the GNU LGPL 2.1 or (at your option) any later version.
;;;
;;; To invoke it:
;;; (use-modules (guiletap))
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-module (guiletap))
(export plan)
(export ok)
(export bail_out)
(export diag)
(export is_ok)
(use-modules (ice-9 format))
; n is the number of tests.
(define plan
(lambda (n) (display (format "1..~d~%" n))))
; n - test number
; testdesc - test descriptor
; res - result which is #f at failure, other at success.
(define ok
(lambda (n testdesc res)
(if (not res)(display "not "))
(display (format "ok ~d - ~a~%" n testdesc))))
; testdesc - test descriptor
(define bail_out
(lambda (testdesc)
(display (format "Bail out! - ~a~%" testdesc))))
; diagmsg - diagnostic message
(define diag
(lambda (diagmsg)
(display (format "# ~a~%" diagmsg))))
; n - test number
; testdesc - test descriptor
; expres - expected test result
; actres - actual test result
(define is_ok
(lambda (n testdesc expres actres)
(ok n testdesc (equal? expres actres))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; !!! TODO:
; !!! To be implemented also:
; plan_no_plan
; plan_skip_all [REASON]
;
; is RESULT EXPECTED [NAME]
; isnt RESULT EXPECTED [NAME]
; like RESULT PATTERN [NAME]
; unlike RESULT PATTERN [NAME]
; pass [NAME]
; fail [NAME]
;
; skip CONDITION [REASON] [NB_TESTS=1]
; Specify TODO mode by setting $TODO:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; End of guiletap.scm</pre> | 0 |
72,070 | 09/16/2008 13:17:49 | 8,741 | 09/15/2008 16:46:16 | 13 | 0 | 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 FMTONLY ON.
Can anyone please tell me what's going on here?
| sql-server | null | null | null | null | null | open | 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 FMTONLY ON.
Can anyone please tell me what's going on here?
| 0 |
72,090 | 09/16/2008 13:20:58 | 394 | 08/05/2008 12:36:16 | 594 | 55 | 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](http://stackoverflow.com/questions/59205/enhancing-stackoverflow-user-experience) is the full script that I'm trying to modify, changing:
window.addEventListener ("load", doStuff, false);
to
window.addEventListener ("DOMContentLoaded", doStuff, false);
| javascript | firefox | greasemonkey | null | null | null | open | 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](http://stackoverflow.com/questions/59205/enhancing-stackoverflow-user-experience) is the full script that I'm trying to modify, changing:
window.addEventListener ("load", doStuff, false);
to
window.addEventListener ("DOMContentLoaded", doStuff, false);
| 0 |
72,103 | 09/16/2008 13:22:02 | 5,496 | 09/10/2008 02:49:33 | 18 | 1 | 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 around by just embedding it.)
I have been googling over the course of several days and can't seem to find an answer to the title question.
I tried using a relative reference: the app exe is in the bin\debug. The images live in the "Images" directory at the root of the project. I've set the images to be copied to the output directory on compile, so they end up in bin\debug\Images\*. So I then use a reference like this "Images\..." thinking it will be relative to the exe. However, when I look at the image properties in the embedded browser window, I see the image URL to be "about:blankImages/*". Everything seems to be relative to "about:blank" when HTML is written to the control. Lacking a location context, I can't figure out what to use for a relative file resource reference.
I poked around the properties of the control to see if there is a way to set something to fix this. I created a blank html page, and pointed the browser at it using the "Navigate()" method, using the full local path to the file. This worked fine with the browser reporting the local "file:///..." path to the blank page. Then I again wrote to the browser, this time using Document.Write(). Again, the browser now reports "about:blank" as the URL.
Short of writing the dynamic HTML results to a real file, is there no other way to reference a file resource?
I am going to try one last thing: constructing absolute file paths to the images and writing those to the HTML. My HTML is being generated using an XSL transform of a serialized object's XML so I'll need to play with some XSL parameters which will take a little extra time as I'm not that familiar with them. | winforms | webbrowser | null | null | null | null | open | 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 around by just embedding it.)
I have been googling over the course of several days and can't seem to find an answer to the title question.
I tried using a relative reference: the app exe is in the bin\debug. The images live in the "Images" directory at the root of the project. I've set the images to be copied to the output directory on compile, so they end up in bin\debug\Images\*. So I then use a reference like this "Images\..." thinking it will be relative to the exe. However, when I look at the image properties in the embedded browser window, I see the image URL to be "about:blankImages/*". Everything seems to be relative to "about:blank" when HTML is written to the control. Lacking a location context, I can't figure out what to use for a relative file resource reference.
I poked around the properties of the control to see if there is a way to set something to fix this. I created a blank html page, and pointed the browser at it using the "Navigate()" method, using the full local path to the file. This worked fine with the browser reporting the local "file:///..." path to the blank page. Then I again wrote to the browser, this time using Document.Write(). Again, the browser now reports "about:blank" as the URL.
Short of writing the dynamic HTML results to a real file, is there no other way to reference a file resource?
I am going to try one last thing: constructing absolute file paths to the images and writing those to the HTML. My HTML is being generated using an XSL transform of a serialized object's XML so I'll need to play with some XSL parameters which will take a little extra time as I'm not that familiar with them. | 0 |
72,104 | 09/16/2008 13:22:10 | 3,590 | 08/29/2008 08:09:23 | 161 | 23 | 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!) | debugging | crash | pdb | null | null | null | open | 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!) | 0 |
72,106 | 09/16/2008 13:22:21 | 3,086 | 08/26/2008 15:04:57 | 1 | 1 | What can I use as a Notepad++ alternative in Linux (ubuntu)? | I got addicted to notepad++ on windows and I've recently moved to Ubuntu. I'm missing a tool as such. | linux | null | null | null | null | null | open | What can I use as a Notepad++ alternative in Linux (ubuntu)?
===
I got addicted to notepad++ on windows and I've recently moved to Ubuntu. I'm missing a tool as such. | 0 |
72,108 | 09/16/2008 13:22:58 | 5,552 | 09/10/2008 13:38:06 | 248 | 10 | Sharepoint best practices | I am starting becoming a sharepoint developer... I am not sure what I did in a previous life to warrant this, it must have been bad!
Anyway I am getting buried in a world of xml and guids that it seems should be automated, each time I add something to a folder I have to add little bits to a number of different xml files, and WOE betide you if get the wrong GUID in one of them (or hack the wrong key out the GAC)
Please tell me someone has worked out how to take the pain from sharepoint! No human can put up with this for long! | sharepoint | guide | null | null | null | null | open | Sharepoint best practices
===
I am starting becoming a sharepoint developer... I am not sure what I did in a previous life to warrant this, it must have been bad!
Anyway I am getting buried in a world of xml and guids that it seems should be automated, each time I add something to a folder I have to add little bits to a number of different xml files, and WOE betide you if get the wrong GUID in one of them (or hack the wrong key out the GAC)
Please tell me someone has worked out how to take the pain from sharepoint! No human can put up with this for long! | 0 |
72,121 | 09/16/2008 13:24:55 | 383 | 08/05/2008 10:46:37 | 3,359 | 268 | Finding the Variable Name passed to a Function in C# | Let me use the following example to explain my question:
public string ExampleFunction(string Variable) {
return something;
}
string WhatIsMyName = "Hello World"';
string Hello = ExampleFunction(WhatIsMyName);
When I pass the variable "WhatIsMyName" to the example function, I want to be able to get a string of the original variables name. Perhaps something like:
Variable.OriginalName.ToString()
Is there any way to do this? | c# | null | null | null | null | null | open | Finding the Variable Name passed to a Function in C#
===
Let me use the following example to explain my question:
public string ExampleFunction(string Variable) {
return something;
}
string WhatIsMyName = "Hello World"';
string Hello = ExampleFunction(WhatIsMyName);
When I pass the variable "WhatIsMyName" to the example function, I want to be able to get a string of the original variables name. Perhaps something like:
Variable.OriginalName.ToString()
Is there any way to do this? | 0 |
72,123 | 09/16/2008 13:25:06 | 11,979 | 09/16/2008 12:42:54 | 1 | 1 | What are some common misunderstandings about TDD? | Reading over the responses to this question http://stackoverflow.com/questions/64333/what-is-the-downside-to-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. | tdd | null | null | null | null | null | open | What are some common misunderstandings about TDD?
===
Reading over the responses to this question http://stackoverflow.com/questions/64333/what-is-the-downside-to-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. | 0 |
72,125 | 09/16/2008 13:25:10 | 7,952 | 09/15/2008 14:46:14 | 1 | 0 | How do you pass an authenticaticated 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 that user to the other site as the status of isAuthenticated, so that the site www.xyz.com does not ask for the credentials of said user again.
What would be needed for this to work? A shared user DB, duplicate user records, what is needed here? A link to a relevant article will suffice. | c# | membership | asp.net-member | asp.net | null | null | open | How do you pass an authenticaticated 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 that user to the other site as the status of isAuthenticated, so that the site www.xyz.com does not ask for the credentials of said user again.
What would be needed for this to work? A shared user DB, duplicate user records, what is needed here? A link to a relevant article will suffice. | 0 |
10,350,676 | 04/27/2012 12:33:05 | 1,354,323 | 04/24/2012 16:59:49 | 1 | 0 | Retrieving action's title using graph API | I am using the following query in Graph API explorer and i only want to get the title fields of previously posted actions on timeline, but the problem is that using the code below i am getting all fields like: title, image, URL etc.
https://graph.facebook.com/me/kinewssocialreader:read/article?fields=title | php5 | facebook-graph-api | facebook-opengraph | null | null | null | open | Retrieving action's title using graph API
===
I am using the following query in Graph API explorer and i only want to get the title fields of previously posted actions on timeline, but the problem is that using the code below i am getting all fields like: title, image, URL etc.
https://graph.facebook.com/me/kinewssocialreader:read/article?fields=title | 0 |
10,350,677 | 04/27/2012 12:33:08 | 1,361,077 | 04/27/2012 12:19:58 | 1 | 0 | PayPal Direct Payments Recurring disabled for this merchant | I'm trying to create recurring profiles with Direct Payment, but I get this error (command `CreateRecurringPaymentsProfile`):
Array
(
[TIMESTAMP] => [not-relevant]
[CORRELATIONID] = [not-relevant]
[ACK] => Failure
[VERSION] => 50.0
[BUILD] => 2764190
[L_ERRORCODE0] => 11586
[L_SHORTMESSAGE0] => DPRP is disabled.
[L_LONGMESSAGE0] => DPRP is disabled for this merchant.
[L_SEVERITYCODE0] => Error
)
Non-recurring transactions and Express Checkout Recurring Payments are processed normally. Everything is working in SandBox. I've tried to contact PayPal's support, but they didn't know what the problem is. The error is self-descriptive, but I just can't find out how to enable the recurring payments. Any suggestions?
| paypal | paypal-api | null | null | null | null | open | PayPal Direct Payments Recurring disabled for this merchant
===
I'm trying to create recurring profiles with Direct Payment, but I get this error (command `CreateRecurringPaymentsProfile`):
Array
(
[TIMESTAMP] => [not-relevant]
[CORRELATIONID] = [not-relevant]
[ACK] => Failure
[VERSION] => 50.0
[BUILD] => 2764190
[L_ERRORCODE0] => 11586
[L_SHORTMESSAGE0] => DPRP is disabled.
[L_LONGMESSAGE0] => DPRP is disabled for this merchant.
[L_SEVERITYCODE0] => Error
)
Non-recurring transactions and Express Checkout Recurring Payments are processed normally. Everything is working in SandBox. I've tried to contact PayPal's support, but they didn't know what the problem is. The error is self-descriptive, but I just can't find out how to enable the recurring payments. Any suggestions?
| 0 |
10,350,681 | 04/27/2012 12:33:10 | 966,638 | 09/27/2011 08:52:12 | 793 | 22 | Position of top bar and browser window size | Here is the master page:
<div id="top">
<div id="left">
<!-- menu with 5 items -->
</div>
<div id="rigth">
<!-- menu with 3 items -->
</div>
</div>
<div id="title">
<h1>My MVC Application</h1>
</div>
</div>
And here is my Css:
#left
{
float: left;
margin-left:-100px;
height: 30px;
}
#rigth
{
float: right;
height: 30px;
right:0px;
margin-right: 0px;
}
#top
{
top: 0px;
left: 100px;
position: fixed;
width: 95%;
background: url(../../Content/images/myImage.png) no-repeat center center;
}
And everything is fine when by browser window is big. But when I minimize it, the bar enlarges its height and "right" comes below "left". How to change this?
I want right not to be visible. Kinda like when gmail's top bar.
The position is fixed because I want the bars to be shown when I scroll. | html | css | position | null | null | null | open | Position of top bar and browser window size
===
Here is the master page:
<div id="top">
<div id="left">
<!-- menu with 5 items -->
</div>
<div id="rigth">
<!-- menu with 3 items -->
</div>
</div>
<div id="title">
<h1>My MVC Application</h1>
</div>
</div>
And here is my Css:
#left
{
float: left;
margin-left:-100px;
height: 30px;
}
#rigth
{
float: right;
height: 30px;
right:0px;
margin-right: 0px;
}
#top
{
top: 0px;
left: 100px;
position: fixed;
width: 95%;
background: url(../../Content/images/myImage.png) no-repeat center center;
}
And everything is fine when by browser window is big. But when I minimize it, the bar enlarges its height and "right" comes below "left". How to change this?
I want right not to be visible. Kinda like when gmail's top bar.
The position is fixed because I want the bars to be shown when I scroll. | 0 |
10,350,683 | 04/27/2012 12:33:18 | 971,094 | 09/29/2011 12:22:12 | 1 | 0 | WinSock Error 10061 | I have written a simple client/server application using winsock. The server and client connect and communicate over TCP port 76567 (just a random number I chose) on the localhost. I've tested it on three desktops, two running XP and the other running Win7, I've also tested it on four laptops, three running Win7 and one running XP. The application works fine on all the desktop machines and on the XP laptop, but on all three Win7 laptops I get Error 10061 when the client tries to connect to the server!
I've turned off the firewall but the problem persists, I've also looked around to see what causes this error and it looks like the client is trying to connect to a non-listening server. However, the server call to listen() returns succesfully! It's very odd that the problem only seems to happen on Win7 laptops, any ideas?
Here's my socket initialisation code:
// Initialise Winsock
iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
if(iResult != 0)
{
printf("WSAStartup failed: %d\n", iResult);
}
// Create a server socket
ZeroMemory(&hints, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = AI_PASSIVE;
iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result);
if(iResult != 0)
{
printf("getaddrinfo failed: %d\n", iResult);
WSACleanup();
}
// Create a socket to listen for clients
listenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
if(listenSocket == INVALID_SOCKET)
{
printf("Error at socket(): %d\n", WSAGetLastError());
freeaddrinfo(result);
WSACleanup();
}
// Bind socket to ip address and port
iResult = bind(listenSocket, result->ai_addr, (int) result->ai_addrlen);
if(iResult == SOCKET_ERROR)
{
printf("bind failed with error: %d\n", WSAGetLastError());
freeaddrinfo(result);
closesocket(listenSocket);
WSACleanup();
}
freeaddrinfo(result);
// Listen for connection requests
if(listen(listenSocket, SOMAXCONN) != 0)
{
printf("Listen failed with error: %d\n", WSAGetLastError());
closesocket(listenSocket);
WSACleanup();
}
Many thanks :) | winsock | winsock2 | winsockets | null | null | null | open | WinSock Error 10061
===
I have written a simple client/server application using winsock. The server and client connect and communicate over TCP port 76567 (just a random number I chose) on the localhost. I've tested it on three desktops, two running XP and the other running Win7, I've also tested it on four laptops, three running Win7 and one running XP. The application works fine on all the desktop machines and on the XP laptop, but on all three Win7 laptops I get Error 10061 when the client tries to connect to the server!
I've turned off the firewall but the problem persists, I've also looked around to see what causes this error and it looks like the client is trying to connect to a non-listening server. However, the server call to listen() returns succesfully! It's very odd that the problem only seems to happen on Win7 laptops, any ideas?
Here's my socket initialisation code:
// Initialise Winsock
iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
if(iResult != 0)
{
printf("WSAStartup failed: %d\n", iResult);
}
// Create a server socket
ZeroMemory(&hints, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = AI_PASSIVE;
iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result);
if(iResult != 0)
{
printf("getaddrinfo failed: %d\n", iResult);
WSACleanup();
}
// Create a socket to listen for clients
listenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
if(listenSocket == INVALID_SOCKET)
{
printf("Error at socket(): %d\n", WSAGetLastError());
freeaddrinfo(result);
WSACleanup();
}
// Bind socket to ip address and port
iResult = bind(listenSocket, result->ai_addr, (int) result->ai_addrlen);
if(iResult == SOCKET_ERROR)
{
printf("bind failed with error: %d\n", WSAGetLastError());
freeaddrinfo(result);
closesocket(listenSocket);
WSACleanup();
}
freeaddrinfo(result);
// Listen for connection requests
if(listen(listenSocket, SOMAXCONN) != 0)
{
printf("Listen failed with error: %d\n", WSAGetLastError());
closesocket(listenSocket);
WSACleanup();
}
Many thanks :) | 0 |
10,350,685 | 04/27/2012 12:33:19 | 1,246,987 | 03/03/2012 15:15:55 | 71 | 3 | Symfony2: Best practise for large forms | I going to set up some large forms with up to 100 fields.
Now my question is if there is some best practise about handling such forms.
Especially:
1. Entity relations
2. Form object it self
Does somebody have experience about such tasks?
Should I put all together in one entity, one form, structured with jQuery in subforms or should I group the attributes to arrays as much as possible?
Regards,
Bodo
| forms | model | symfony-2.0 | entity | null | null | open | Symfony2: Best practise for large forms
===
I going to set up some large forms with up to 100 fields.
Now my question is if there is some best practise about handling such forms.
Especially:
1. Entity relations
2. Form object it self
Does somebody have experience about such tasks?
Should I put all together in one entity, one form, structured with jQuery in subforms or should I group the attributes to arrays as much as possible?
Regards,
Bodo
| 0 |
10,350,660 | 04/27/2012 12:32:08 | 806,076 | 10/30/2009 05:28:58 | 983 | 22 | How to create C# class from Multiple XML files | I am looking for a tool (preferably freeware) which can help me to create C# DTOs(classes) from multiple xml files.
Some of these xml files contains same complex type so to avoid duplication of classes i have to make one XSD from multiple files.
I tried xsd.exe (provided with visual studio) tool but it doesn't takes multiple xml files.
please help. | xml | c#-4.0 | xsd | xsd.exe | null | null | open | How to create C# class from Multiple XML files
===
I am looking for a tool (preferably freeware) which can help me to create C# DTOs(classes) from multiple xml files.
Some of these xml files contains same complex type so to avoid duplication of classes i have to make one XSD from multiple files.
I tried xsd.exe (provided with visual studio) tool but it doesn't takes multiple xml files.
please help. | 0 |
10,350,661 | 04/27/2012 12:32:12 | 1,145,954 | 01/12/2012 16:28:14 | 19 | 2 | Backout unwanted changes and make a patch out of them | I'am collaborating with someone on remote repo. We realized that changes I made should be removed out of repo. But those changes are in many changesets and mixed with someone's changes.
We decided to remove my changes just before I commit another changeset. So I've made a **patch** out of uncommited changes and `qpop` it.
Now I want to backout rest of my changes out of remote and selectively make patch out of those changes leaving my colleague changes untouched.
Moreover I want to somehow 'merge' this **new patch** with the one that I've made to have all my changes in one **patch**
Then after I do it, I will `commit`/`push` cleared changes into the repository.
How this could be done with Mercurial Queues? | mercurial | patch | mercurial-queue | mercurial-extension | null | null | open | Backout unwanted changes and make a patch out of them
===
I'am collaborating with someone on remote repo. We realized that changes I made should be removed out of repo. But those changes are in many changesets and mixed with someone's changes.
We decided to remove my changes just before I commit another changeset. So I've made a **patch** out of uncommited changes and `qpop` it.
Now I want to backout rest of my changes out of remote and selectively make patch out of those changes leaving my colleague changes untouched.
Moreover I want to somehow 'merge' this **new patch** with the one that I've made to have all my changes in one **patch**
Then after I do it, I will `commit`/`push` cleared changes into the repository.
How this could be done with Mercurial Queues? | 0 |
10,350,699 | 04/27/2012 12:34:21 | 365,251 | 06/12/2010 13:37:57 | 3,295 | 6 | Replace the first occuration in a string | I have this string :
Hello my name is Marco
and I'd like to replace the first space (between `Hello` and `my`) with `<br />`. Only the first.
What's the best way to do it on C#/.NET 3.5? | c# | .net | replace | null | null | null | open | Replace the first occuration in a string
===
I have this string :
Hello my name is Marco
and I'd like to replace the first space (between `Hello` and `my`) with `<br />`. Only the first.
What's the best way to do it on C#/.NET 3.5? | 0 |
10,350,700 | 04/27/2012 12:34:25 | 1,004,893 | 10/20/2011 09:34:12 | 41 | 15 | PIE does just not apply at all | So I try to use PIE.htc to render box-shadow for IE7/8. I set everything up according to the documentation, but it just won't work, no shadows, whether in IE8 nor 7. I quatriple checked the documentation and demos on [css3 pie][1], I googled a LOT and analysed my implementation, but I just can't find the source of the problem. There's another thread here about the same problem from two months ago, but no solution either. I really hope someone sees what I may have made wrong, oh and just to avoid useless comments, i already tried using PIE.php, doesn't work either.
Some images attached for more information.
Inspect with IE Developer Tools
![IE Developer Tools][2]
Trying to get the source directly
![Trying to get the source][3]
Directory listing
![Directory listing][4]
My CSS
![CSS][5]
[1]: http://css3pie.com/
[2]: http://i.stack.imgur.com/euVhC.png
[3]: http://i.stack.imgur.com/4kYSw.png
[4]: http://i.stack.imgur.com/MLmcd.png
[5]: http://i.stack.imgur.com/pHnGi.png | internet-explorer | css3 | behavior | box-shadow | null | null | open | PIE does just not apply at all
===
So I try to use PIE.htc to render box-shadow for IE7/8. I set everything up according to the documentation, but it just won't work, no shadows, whether in IE8 nor 7. I quatriple checked the documentation and demos on [css3 pie][1], I googled a LOT and analysed my implementation, but I just can't find the source of the problem. There's another thread here about the same problem from two months ago, but no solution either. I really hope someone sees what I may have made wrong, oh and just to avoid useless comments, i already tried using PIE.php, doesn't work either.
Some images attached for more information.
Inspect with IE Developer Tools
![IE Developer Tools][2]
Trying to get the source directly
![Trying to get the source][3]
Directory listing
![Directory listing][4]
My CSS
![CSS][5]
[1]: http://css3pie.com/
[2]: http://i.stack.imgur.com/euVhC.png
[3]: http://i.stack.imgur.com/4kYSw.png
[4]: http://i.stack.imgur.com/MLmcd.png
[5]: http://i.stack.imgur.com/pHnGi.png | 0 |
72,128 | 09/16/2008 13:25:23 | 2,796 | 08/25/2008 07:37:57 | 178 | 12 | 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, so I need to store the processed coordinates in a container which will ensure that checking if a 3D coordinate is already contained in the container is fast.
I was thinking of using a map of a map of a map, storing the x coordinate, then the y coordinate then the z coordinate, but this makes it quite tedious to use, so I'm actually hoping there is a much better way to do it that I cannot think of. | c++ | null | null | null | null | null | open | 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, so I need to store the processed coordinates in a container which will ensure that checking if a 3D coordinate is already contained in the container is fast.
I was thinking of using a map of a map of a map, storing the x coordinate, then the y coordinate then the z coordinate, but this makes it quite tedious to use, so I'm actually hoping there is a much better way to do it that I cannot think of. | 0 |
72,151 | 09/16/2008 13:27:53 | 10,589 | 09/16/2008 00:10:23 | 1 | 0 | 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', 0, TO_DATE('03/23/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '51', TO_DATE('03/23/2002', 'MM/DD/YYYY'), 0.000000, 0.000)
The first insert succeeds. The second insert gives me an error:
ORA-00933: SQL command not properly ended
What am I doing wrong?
Thanks!! | oracle | null | null | null | null | null | open | 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', 0, TO_DATE('03/23/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '51', TO_DATE('03/23/2002', 'MM/DD/YYYY'), 0.000000, 0.000)
The first insert succeeds. The second insert gives me an error:
ORA-00933: SQL command not properly ended
What am I doing wrong?
Thanks!! | 0 |
72,153 | 09/16/2008 13:28:06 | 5,777 | 09/11/2008 11:10:19 | 1 | 1 | 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:
<ItemGroup>
<LibraryFiles Include="$(LibrariesReleaseDir)\**\*.*" Exclude=".svn" />
</ItemGroup>
At the moment, but this does not exclude anything! | .net | continuous-integration | msbuild | cruisecontrol.net | null | null | open | 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:
<ItemGroup>
<LibraryFiles Include="$(LibrariesReleaseDir)\**\*.*" Exclude=".svn" />
</ItemGroup>
At the moment, but this does not exclude anything! | 0 |
72,166 | 09/16/2008 13:29:35 | 12,178 | 09/16/2008 13:29:35 | 1 | 0 | Penetration testing tools | We have 100s 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 loop holes.
Are there any (good) software (paid or free) to do this?
or.. are there any tehnical articles which can help me develop this tool. | sql | security | injection | null | null | 07/14/2012 01:59:58 | not constructive | Penetration testing tools
===
We have 100s 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 loop holes.
Are there any (good) software (paid or free) to do this?
or.. are there any tehnical articles which can help me develop this tool. | 4 |
72,167 | 09/16/2008 13:29:37 | 1,810 | 08/18/2008 17:05:20 | 396 | 16 | How to play a standard windows sound? | How do I find out which sound files the user has configured in the control panel?
Example: I want to play the sound for "Device connected".
Which API can be used to query the control panel sound settings?
I see that there are some custom entries made by third party programs in the control panel dialog, so there has to be a way for these programs to communicate with the global sound settings. | audio | winapi | null | null | null | null | open | How to play a standard windows sound?
===
How do I find out which sound files the user has configured in the control panel?
Example: I want to play the sound for "Device connected".
Which API can be used to query the control panel sound settings?
I see that there are some custom entries made by third party programs in the control panel dialog, so there has to be a way for these programs to communicate with the global sound settings. | 0 |
72,168 | 09/16/2008 13:29:40 | 1,115,144 | 09/15/2008 16:09:15 | 112 | 9 | Does LINQ 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 also been a rock-solid standard in great database application programming. Many programmers I know use a data layer that simplifies development, however, not to the extent LINQ does. Is it time to give up on the SP's and go LINQ? | sql | server | database | application | null | null | open | Does LINQ 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 also been a rock-solid standard in great database application programming. Many programmers I know use a data layer that simplifies development, however, not to the extent LINQ does. Is it time to give up on the SP's and go LINQ? | 0 |
72,183 | 09/16/2008 13:31:07 | 8,017 | 09/15/2008 14:55:40 | 1 | 0 | Any good interview questions to ask prospective Junior java developers? | Does anyone have a good interview question to ask prospective junior java developers? They will have a two year minimum experience requirement. The questions will be on a written test and they will have five to ten minutes to answer each question.
Limit to one interview question per response for voting purposes please. | java | interview-questions | null | null | null | 12/01/2011 18:58:58 | not constructive | Any good interview questions to ask prospective Junior java developers?
===
Does anyone have a good interview question to ask prospective junior java developers? They will have a two year minimum experience requirement. The questions will be on a written test and they will have five to ten minutes to answer each question.
Limit to one interview question per response for voting purposes please. | 4 |
72,185 | 09/16/2008 13:31:16 | 8,741 | 09/15/2008 16:46:16 | 13 | 0 | 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 [cpExportRecordType_ListByExportAgentID] null, null
It returns no column information. I have just now replaced building the query without a where clause to just executing the same query directly, and now I get column information. I would love to know what causes this, anyone? | sql-server | null | null | null | null | null | open | 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 [cpExportRecordType_ListByExportAgentID] null, null
It returns no column information. I have just now replaced building the query without a where clause to just executing the same query directly, and now I get column information. I would love to know what causes this, anyone? | 0 |
72,198 | 09/16/2008 13:32:29 | 12,058 | 09/16/2008 13:01:26 | 1 | 0 | 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 tabs would be an easy way to create the second column, but I discovered things just don't work that well.
There seems to be two problems with the way I tried to do this (see below). First, I read on numerous websites that the MeasureString function isn't very precise due to how complex fonts are, with kerning issues and all. The second is that I have no idea what the TextBox control is using as its StringFormat underneath.
Anyway, the result is that I invariably end up with items in the right column that are off by a tab. I suppose I could roll my own text window and do everything myself, but gee, isn't there a simple way do do this?
Thanks for any help!
TextBox textBox = new TextBox();
textBox.Font = new Font("Calibri", 11);
textBox.Dock = DockStyle.Fill;
textBox.Multiline = true;
textBox.WordWrap = false;
textBox.ScrollBars = ScrollBars.Vertical;
Form form = new Form();
form.Text = "Recipe";
form.Size = new Size(400, 600);
form.FormBorderStyle = FormBorderStyle.Sizable;
form.StartPosition = FormStartPosition.CenterScreen;
form.Controls.Add(textBox);
Graphics g = form.CreateGraphics();
float targetWidth = 230;
foreach (PropertyInfo property in properties)
{
string text = String.Format("{0}:\t", Description);
while (g.MeasureString(text,textBox.Font).Width < targetWidth)
text += "\t";
textBox.AppendText(text + value.ToString() + "\n");
}
g.Dispose();
form.ShowDialog(); | c# | tabs | textbox | meaurestring | stringformat | null | open | 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 tabs would be an easy way to create the second column, but I discovered things just don't work that well.
There seems to be two problems with the way I tried to do this (see below). First, I read on numerous websites that the MeasureString function isn't very precise due to how complex fonts are, with kerning issues and all. The second is that I have no idea what the TextBox control is using as its StringFormat underneath.
Anyway, the result is that I invariably end up with items in the right column that are off by a tab. I suppose I could roll my own text window and do everything myself, but gee, isn't there a simple way do do this?
Thanks for any help!
TextBox textBox = new TextBox();
textBox.Font = new Font("Calibri", 11);
textBox.Dock = DockStyle.Fill;
textBox.Multiline = true;
textBox.WordWrap = false;
textBox.ScrollBars = ScrollBars.Vertical;
Form form = new Form();
form.Text = "Recipe";
form.Size = new Size(400, 600);
form.FormBorderStyle = FormBorderStyle.Sizable;
form.StartPosition = FormStartPosition.CenterScreen;
form.Controls.Add(textBox);
Graphics g = form.CreateGraphics();
float targetWidth = 230;
foreach (PropertyInfo property in properties)
{
string text = String.Format("{0}:\t", Description);
while (g.MeasureString(text,textBox.Font).Width < targetWidth)
text += "\t";
textBox.AppendText(text + value.ToString() + "\n");
}
g.Dispose();
form.ShowDialog(); | 0 |
72,204 | 09/16/2008 13:32:47 | 1,801 | 08/18/2008 16:01:48 | 228 | 23 | Have you used Rhino Igloo? | Has anyone used [Rhino igloo](http://www.ayende.com/Blog/archive/2007/09/03/Rhino-Igloo-ndash-MVC-Framework-for-Web-Forms.aspx) 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. | asp.net-mvc | mvc | null | null | null | null | open | Have you used Rhino Igloo?
===
Has anyone used [Rhino igloo](http://www.ayende.com/Blog/archive/2007/09/03/Rhino-Igloo-ndash-MVC-Framework-for-Web-Forms.aspx) 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. | 0 |
72,209 | 09/16/2008 13:33:24 | 11,193 | 09/16/2008 06:02:43 | 35 | 0 | Recursion or loop | Is there a performance hit if we use loop instead of recursion in algorithms where both can serve the same purpose?? Eg : Check if given string is palindrome.
| java | null | null | null | null | null | open | Recursion or loop
===
Is there a performance hit if we use loop instead of recursion in algorithms where both can serve the same purpose?? Eg : Check if given string is palindrome.
| 0 |
72,218 | 09/16/2008 13:34:25 | 9,198 | 09/15/2008 18:01:45 | 1 | 2 | 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 page is "ContactList", next page is "Contact/C0001" which shows the contact details and the list of telephone numbers.
We have to implement telepone numbers edit form. The first approximation thought is to add some page which will be navigable like 'ThelephoneNumber/T0001'.
But ThelephoneNumber is is Value Object class and its instance couldn't be identified this way.
What is the best practice for resolving this issue? How can we identify non-identifieble objects in the stateless applications? | architecture | web-applications | domain-driven-design | null | null | null | open | 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 page is "ContactList", next page is "Contact/C0001" which shows the contact details and the list of telephone numbers.
We have to implement telepone numbers edit form. The first approximation thought is to add some page which will be navigable like 'ThelephoneNumber/T0001'.
But ThelephoneNumber is is Value Object class and its instance couldn't be identified this way.
What is the best practice for resolving this issue? How can we identify non-identifieble objects in the stateless applications? | 0 |
72,220 | 09/16/2008 13:34:37 | 4,110 | 09/01/2008 20:20:54 | 21 | 3 | Mocking constructors in Ruby | I'm a Java-developer toying with Ruby, and loving it. I have understood that because of Ruby's metaprogramming facilities my unit-tests become much cleaner and I don't need nasty mocking frameworks. I have a class which needs the `File` class's services and in my test I don't want to touch my real filesystem. In Java I would use some virtual file system for easier "seams" to pass fake-objects in but in Ruby that's obviously overkill. What I come up seems already really nice compared to the Java-world. In my class under test I have an optional constructor parameter:
def initialize(file_class=File)
When I need to open files within my class, I can then do this:
@file_class.open(filename)
And the call goes to either the real File-class, or in case of my unit-test, it goes to a fake-class which doesn't touch the filesystem. I know there must be a better way to do this with metaprogramming?
| ruby | null | null | null | null | null | open | Mocking constructors in Ruby
===
I'm a Java-developer toying with Ruby, and loving it. I have understood that because of Ruby's metaprogramming facilities my unit-tests become much cleaner and I don't need nasty mocking frameworks. I have a class which needs the `File` class's services and in my test I don't want to touch my real filesystem. In Java I would use some virtual file system for easier "seams" to pass fake-objects in but in Ruby that's obviously overkill. What I come up seems already really nice compared to the Java-world. In my class under test I have an optional constructor parameter:
def initialize(file_class=File)
When I need to open files within my class, I can then do this:
@file_class.open(filename)
And the call goes to either the real File-class, or in case of my unit-test, it goes to a fake-class which doesn't touch the filesystem. I know there must be a better way to do this with metaprogramming?
| 0 |
72,237 | 09/16/2008 13:36:11 | 12,204 | 09/16/2008 13:36:11 | 1 | 0 | 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 handshake. (In a nutshell, the server breaks the message into chunks of 2^14 bytes, as per RFC 2246 sec. 6.2.1, but Schannel wasn't written to support that. I've gotten confirmation from Microsoft support that this is a flaw in Schannel and that they're considering fixing it in a future release.)
So I'm trying to find a way to easily parse through my trusted certificates (I use Apache as my server, so all of them are in PEM format) to get the total ASN.1-format length of the DNs (which is how they get sent over the wire during the handshake), and thereby see if I'm getting too close to the limit. I haven't yet been able to find a way to do this, though: the OpenSSL asn1parse function comes close, but it doesn't seem to provide a way to get the ASN.1 sequence for just the issuer name, which is what I need.
Any suggestions? | apache | openssl | asn.1 | schannel | null | null | open | 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 handshake. (In a nutshell, the server breaks the message into chunks of 2^14 bytes, as per RFC 2246 sec. 6.2.1, but Schannel wasn't written to support that. I've gotten confirmation from Microsoft support that this is a flaw in Schannel and that they're considering fixing it in a future release.)
So I'm trying to find a way to easily parse through my trusted certificates (I use Apache as my server, so all of them are in PEM format) to get the total ASN.1-format length of the DNs (which is how they get sent over the wire during the handshake), and thereby see if I'm getting too close to the limit. I haven't yet been able to find a way to do this, though: the OpenSSL asn1parse function comes close, but it doesn't seem to provide a way to get the ASN.1 sequence for just the issuer name, which is what I need.
Any suggestions? | 0 |
72,240 | 09/16/2008 13:36:20 | 7,722 | 09/15/2008 14:17:47 | 1 | 0 | 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
call BizTalkApplication1.Orchestration1(param1,param2);
I'm looking for some way to specify calling orchestration name, coming from the incoming message or from SSO config store. | biztalk | null | null | null | null | null | open | 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
call BizTalkApplication1.Orchestration1(param1,param2);
I'm looking for some way to specify calling orchestration name, coming from the incoming message or from SSO config store. | 0 |
72,242 | 09/16/2008 13:36:34 | 7,473 | 09/15/2008 13:48:50 | 1 | 3 | How do I set the HttpOnly flag on cookie in rails | The page <a href="http://www.codinghorror.com/blog/archives/001167.html"> explains why making HttpOnly cookies is a good idea
How do I set this property in RubyOnRails | rubyonrails | null | null | null | null | null | open | How do I set the HttpOnly flag on cookie in rails
===
The page <a href="http://www.codinghorror.com/blog/archives/001167.html"> explains why making HttpOnly cookies is a good idea
How do I set this property in RubyOnRails | 0 |
72,254 | 09/16/2008 13:37:33 | 12,211 | 09/16/2008 13:37:33 | 1 | 0 | How to determine visible region of a Windows in X Windows / Linux? | I am developing a plugin for Mozilla and I need to determine the region that describes the visible area of "my" window, i.e. the one that is passed from the Mozilla system as plugin viewport. | linux | x-windows | mozilla | null | null | null | open | How to determine visible region of a Windows in X Windows / Linux?
===
I am developing a plugin for Mozilla and I need to determine the region that describes the visible area of "my" window, i.e. the one that is passed from the Mozilla system as plugin viewport. | 0 |
72,275 | 09/16/2008 13:39:04 | 3,389 | 08/28/2008 11:59:00 | 18 | 2 | When should the volatile keyword should be used in C#? | Can anyone provide a good explanation of the volatile keyword in C#? Which problems does it solve and which it doesn't? In which cases will it save me the use of locking? | c# | multithreading | null | null | null | null | open | When should the volatile keyword should be used in C#?
===
Can anyone provide a good explanation of the volatile keyword in C#? Which problems does it solve and which it doesn't? In which cases will it save me the use of locking? | 0 |
72,281 | 09/16/2008 13:39:33 | 3,400 | 08/28/2008 13:02:35 | 16 | 2 | Error Running CLR Stored Proc | Receiving the following error when attempting to run a CLR stored proc. Any help is much appreciated.
Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65752. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'orders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
System.IO.FileLoadException:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString) | sql-server | sqlclr | null | null | null | null | open | Error Running CLR Stored Proc
===
Receiving the following error when attempting to run a CLR stored proc. Any help is much appreciated.
Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65752. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'orders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
System.IO.FileLoadException:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString) | 0 |
72,288 | 09/16/2008 13:40:04 | 1,175 | 08/13/2008 10:21:54 | 2,237 | 130 | 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 well.
I've found the book _OpenGL ES 2.0 Programming Guide_, but I am concerned that it might not be the best approach because it focuses on 2.0 rather than 1.x. My understanding is that 2.0 is not backwards-compatible with 1.x, so I may miss out on some important concepts.
Note: For answers about learning general OpenGL, see http://stackoverflow.com/questions/62540/learning-opengl | opengl | opengl-es | 3d | iphone | null | null | open | 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 well.
I've found the book _OpenGL ES 2.0 Programming Guide_, but I am concerned that it might not be the best approach because it focuses on 2.0 rather than 1.x. My understanding is that 2.0 is not backwards-compatible with 1.x, so I may miss out on some important concepts.
Note: For answers about learning general OpenGL, see http://stackoverflow.com/questions/62540/learning-opengl | 0 |
72,298 | 09/16/2008 13:40:42 | 203 | 08/03/2008 13:26:47 | 164 | 5 | 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. Does anyone know exactly what data these files contain? I've also been wondering whether I should be adding these files to source control (Subversion in my case). If I don't add these files and another developer checks out the solution, will Visual Studio automatically create new user files? | visual-studio | svn | null | null | null | null | open | 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. Does anyone know exactly what data these files contain? I've also been wondering whether I should be adding these files to source control (Subversion in my case). If I don't add these files and another developer checks out the solution, will Visual Studio automatically create new user files? | 0 |
72,304 | 09/16/2008 13:41:03 | 4,893 | 09/06/2008 12:55:06 | 328 | 22 | How do I set the HttpOnly flag on JSF/Richfaces | I'd like to add the HttpOnly flag to my cookies to up the level of security on my web app. Any ideas? | security | jsf | richfaces | null | null | null | open | How do I set the HttpOnly flag on JSF/Richfaces
===
I'd like to add the HttpOnly flag to my cookies to up the level of security on my web app. Any ideas? | 0 |
72,312 | 09/16/2008 13:41:32 | 423,836 | 09/16/2008 13:34:57 | 1 | 0 | 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. | perl | null | null | null | null | 09/14/2011 11:01:15 | off topic | 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. | 2 |
72,358 | 09/16/2008 13:44:50 | 2,959 | 08/26/2008 09:00:33 | 21 | 4 | 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?
| performance | tomcat | ssl | internet-explorer | https | null | open | 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?
| 0 |
72,360 | 09/16/2008 13:44:54 | 10,833 | 09/16/2008 02:11:56 | 1 | 0 | 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`.
The best solution I came up with was:
if (obj.GetType().Equals(type) || obj.GetType().IsSubclassOf(type))
Isn't there a way to use operator `is` to make the code cleaner?
| c# | null | null | null | null | null | open | 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`.
The best solution I came up with was:
if (obj.GetType().Equals(type) || obj.GetType().IsSubclassOf(type))
Isn't there a way to use operator `is` to make the code cleaner?
| 0 |
72,369 | 09/16/2008 13:46:03 | 1,115,144 | 09/15/2008 16:09:15 | 127 | 10 | What's the best CDN for image hosting on a high-volume web site? | Akamai is way too expensive. Photobucket is not reliable. Is there a great content delivery network that I can use just to host my images? | content | delivery | networking | cdn | null | null | open | What's the best CDN for image hosting on a high-volume web site?
===
Akamai is way too expensive. Photobucket is not reliable. Is there a great content delivery network that I can use just to host my images? | 0 |
72,372 | 09/16/2008 13:46:13 | 11,538 | 09/16/2008 08:59:15 | 3 | 0 | 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? | visual-studio-2008 | multiple-monitors | null | null | null | null | open | 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? | 0 |
72,380 | 09/16/2008 13:46:51 | 12,261 | 09/16/2008 13:46:51 | 1 | 0 | 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? | speech-recognition | null | null | null | null | null | open | 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? | 0 |
72,381 | 09/16/2008 13:46:58 | 2,443 | 08/22/2008 10:53:30 | 1,225 | 53 | 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();
| java | date | null | null | null | null | open | 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();
| 0 |
72,383 | 09/16/2008 13:47:06 | 423,836 | 09/16/2008 13:34:57 | 1 | 0 | What's the point of Perl golf? | Perl golf is a programmers' game which involves solving a problem with the shortest perl program possible. (ie, the winner is the person who completes the round in the lowest number of (key)strokes).
| perl | philosophy | null | null | null | null | open | What's the point of Perl golf?
===
Perl golf is a programmers' game which involves solving a problem with the shortest perl program possible. (ie, the winner is the person who completes the round in the lowest number of (key)strokes).
| 0 |
72,393 | 09/16/2008 13:47:48 | 1,384,652 | 08/01/2008 12:01:23 | 2,121 | 87 | 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.
After much head scratching I found out the issue, it automatically expects your pattern to be at the start of the string. I have found a fix but I would like to know how to change:
regex = ".*(a_regex_of_pure_awesomeness)"
into
regex = "a_regex_of_pure_awesomeness"
Okay, it's a standard URL regex but I wanted to avoid any potential confusion about what I wanted to get rid of and possibly pretend to be funny. | python | regex | re | null | null | null | open | 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.
After much head scratching I found out the issue, it automatically expects your pattern to be at the start of the string. I have found a fix but I would like to know how to change:
regex = ".*(a_regex_of_pure_awesomeness)"
into
regex = "a_regex_of_pure_awesomeness"
Okay, it's a standard URL regex but I wanted to avoid any potential confusion about what I wanted to get rid of and possibly pretend to be funny. | 0 |
72,394 | 09/16/2008 13:47:53 | 3,043 | 08/26/2008 13:24:14 | 2,503 | 248 | What should a developer know _before_ building a public web site? | I saw an HttpOnly question today, and that had me thinking back to Jeff's CodingHorror post about it, and how it was kinda funny that he had a site up for nearly a month before addressing it. Of course, no one can know _everything_, but it got me wondering: what could _I_ be missing? What other things should _always_ be done before opening a public-facing web site that aren't necessarily enforced by tools? What do you need to know when implementing the site? Here are some ideas to get the ball rolling, though they don't all need to be security-related. Let's try to keep it language agnostic, too:
* HttpOnly cookies
* SQL Injection protection
* Cross site scripting protection
* How to correctly handle authentication/store passwords | web-development | security | crossplatform | null | null | null | open | What should a developer know _before_ building a public web site?
===
I saw an HttpOnly question today, and that had me thinking back to Jeff's CodingHorror post about it, and how it was kinda funny that he had a site up for nearly a month before addressing it. Of course, no one can know _everything_, but it got me wondering: what could _I_ be missing? What other things should _always_ be done before opening a public-facing web site that aren't necessarily enforced by tools? What do you need to know when implementing the site? Here are some ideas to get the ball rolling, though they don't all need to be security-related. Let's try to keep it language agnostic, too:
* HttpOnly cookies
* SQL Injection protection
* Cross site scripting protection
* How to correctly handle authentication/store passwords | 0 |
72,422 | 09/16/2008 13:50:25 | 9,510 | 09/15/2008 19:01:05 | 1 | 1 | 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)
>>> unittest.main()
.F
======================================================================
FAIL: testB (__main__.MyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<pyshell#61>", line 8, in testB
AssertionError: 1 != 3
----------------------------------------------------------------------
Ran 2 tests in 0.016s | python | unittest | null | null | null | null | open | 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)
>>> unittest.main()
.F
======================================================================
FAIL: testB (__main__.MyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<pyshell#61>", line 8, in testB
AssertionError: 1 != 3
----------------------------------------------------------------------
Ran 2 tests in 0.016s | 0 |
72,442 | 09/16/2008 13:51:38 | 6,776 | 09/15/2008 12:37:02 | 1 | 3 | What is the null value of Nullable(Of T) ? | I have a nullable property, and I want to return a null value. How do I do that in VB.NET ?
Currently I use this solution, but I think there might be a better way.
Public Shared ReadOnly Property rubrique_id() As Nullable(Of Integer)
Get
If Current.Request.QueryString("rid") <> "" Then
Return CInt(Current.Request.QueryString("rid"))
Else
Return (New Nullable(Of Integer)).Value
End If
End Get
End Property | vb.net | null | null | null | null | null | open | What is the null value of Nullable(Of T) ?
===
I have a nullable property, and I want to return a null value. How do I do that in VB.NET ?
Currently I use this solution, but I think there might be a better way.
Public Shared ReadOnly Property rubrique_id() As Nullable(Of Integer)
Get
If Current.Request.QueryString("rid") <> "" Then
Return CInt(Current.Request.QueryString("rid"))
Else
Return (New Nullable(Of Integer)).Value
End If
End Get
End Property | 0 |
72,458 | 09/16/2008 13:52:30 | 5,343 | 09/09/2008 09:57:56 | 56 | 7 | How do I use .htaccess to redirect to a URL containing HTTP_HOST? | **Problem**
I need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions.
I would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don't have to create a custom .htaccess file for each host.
**Host-specific Example (snipped from .htaccess file)**
Redirect /terms http://support.dev01.example.com/articles/terms/
This example works fine for the development version running at dev01.example.com. If I use the same line in the main .htaccess file for the development version running under dev02.example.com I'd end up being redirected to the wrong place.
**Ideal rule (not sure of the correct syntax)**
Redirect /terms http://support.{HTTP_HOST}/articles/terms/
This rule does not work and merely serves as an example of what I'd like to achieve. I could then use the exact same rule under many different hosts and get the correct result.
**Answers?**
- Can this be done with mod\_alias or does it require the more complex mod\_rewrite?
- How can this be achieved using mod\_alias or mod\_rewrite? I'd prefer a mod\_alias solution if possible. | .htaccess | mod-rewrite | mod-alias | null | null | null | open | How do I use .htaccess to redirect to a URL containing HTTP_HOST?
===
**Problem**
I need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions.
I would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don't have to create a custom .htaccess file for each host.
**Host-specific Example (snipped from .htaccess file)**
Redirect /terms http://support.dev01.example.com/articles/terms/
This example works fine for the development version running at dev01.example.com. If I use the same line in the main .htaccess file for the development version running under dev02.example.com I'd end up being redirected to the wrong place.
**Ideal rule (not sure of the correct syntax)**
Redirect /terms http://support.{HTTP_HOST}/articles/terms/
This rule does not work and merely serves as an example of what I'd like to achieve. I could then use the exact same rule under many different hosts and get the correct result.
**Answers?**
- Can this be done with mod\_alias or does it require the more complex mod\_rewrite?
- How can this be achieved using mod\_alias or mod\_rewrite? I'd prefer a mod\_alias solution if possible. | 0 |
72,462 | 09/16/2008 13:52:50 | 12,251 | 09/16/2008 13:45:07 | 1 | 0 | Automated testing of FLEX based applications | What tools, preferably open source, are recommended for driving an automated test suite on a FLEX based web application? The same tool also having built in capabilities to drive Web Services would be nice. | web-services | testing | flex | web-applications | null | null | open | Automated testing of FLEX based applications
===
What tools, preferably open source, are recommended for driving an automated test suite on a FLEX based web application? The same tool also having built in capabilities to drive Web Services would be nice. | 0 |
72,479 | 09/16/2008 13:53:33 | 12,178 | 09/16/2008 13:29:35 | 6 | 2 | equivalent vb code for a java code | Can anyone tell me what exactly does thi 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 | vb | java | null | null | null | null | open | equivalent vb code for a java code
===
Can anyone tell me what exactly does thi 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 | 0 |
72,482 | 09/16/2008 13:53:44 | 12,259 | 09/16/2008 13:46:27 | 1 | 0 | gwt lazy loading | Is it possible in large GWT project, load some potion of JavaScript lazy, on the fly?
Like overlays.
PS: Iframes is not a solution. | gwt | lazy | null | null | null | null | open | gwt lazy loading
===
Is it possible in large GWT project, load some potion of JavaScript lazy, on the fly?
Like overlays.
PS: Iframes is not a solution. | 0 |
72,515 | 09/16/2008 13:55:47 | 2,533 | 08/22/2008 17:24:00 | 1 | 0 | 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. | c# | .net | windows | null | null | null | open | 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. | 0 |
72,537 | 09/16/2008 13:58:03 | 12,318 | 09/16/2008 13:58:03 | 1 | 0 | Auto number column in SharePoint list | In a SharePoint list I want an auto number column that as I add to the list get's incremented. How best can I go about this?
All the best
Kieran | sharepoint | moss | null | null | null | null | open | Auto number column in SharePoint list
===
In a SharePoint list I want an auto number column that as I add to the list get's incremented. How best can I go about this?
All the best
Kieran | 0 |
72,540 | 09/16/2008 13:58:32 | 8,223 | 09/15/2008 15:27:55 | 11 | 3 | 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 <a href="http://en.wikipedia.org/wiki/Two-factor_authentication">multi-factor authentication</a> 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 misunderstood to be a two-factor authentication system. We are now exploring ways to continue providing multi-factor security without issuing hardware devices to the users.
Is it possible to write a software-based token system to be installed on the user's PCs that would constitute a true second factor in a multi-factor authentication system? Would this be considered "something the user has", or would it simply be another form of "something the user knows"? | authentication | null | null | null | null | null | open | 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 <a href="http://en.wikipedia.org/wiki/Two-factor_authentication">multi-factor authentication</a> 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 misunderstood to be a two-factor authentication system. We are now exploring ways to continue providing multi-factor security without issuing hardware devices to the users.
Is it possible to write a software-based token system to be installed on the user's PCs that would constitute a true second factor in a multi-factor authentication system? Would this be considered "something the user has", or would it simply be another form of "something the user knows"? | 0 |
72,541 | 09/16/2008 13:58:43 | 1,768 | 08/18/2008 13:32:15 | 396 | 23 | 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. Now my web page has multiple UpdatePanels.
I am wondering if it would be best to just wrap the entire form in a single UpdatePanel, or keep the individual UpdatePanels.
What are the best practices for using the ASP.NET UpdatePanel? | asp.net | ajax | web-forms | null | null | null | open | 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. Now my web page has multiple UpdatePanels.
I am wondering if it would be best to just wrap the entire form in a single UpdatePanel, or keep the individual UpdatePanels.
What are the best practices for using the ASP.NET UpdatePanel? | 0 |
72,552 | 09/16/2008 13:59:45 | 4,240 | 09/02/2008 13:51:18 | 177 | 7 | C++: When Has The volatile Keyword Ever Helped You? | I'd like to know of an example of a problem which was solved by adding the __volatile__ keyword.
I'm sure it has helped *somebody* solve *something*, but I don't know where I would actually apply it.
In my case, it has __never__ been the answer. | c++ | quiz | null | null | null | null | open | C++: When Has The volatile Keyword Ever Helped You?
===
I'd like to know of an example of a problem which was solved by adding the __volatile__ keyword.
I'm sure it has helped *somebody* solve *something*, but I don't know where I would actually apply it.
In my case, it has __never__ been the answer. | 0 |
72,556 | 09/16/2008 14:00:02 | 12,333 | 09/16/2008 14:00:02 | 1 | 0 | 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 Save button I want to be able to commit the node's label I was editing. | treeview | editing | commit | null | null | null | open | 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 Save button I want to be able to commit the node's label I was editing. | 0 |
72,562 | 09/16/2008 14:00:10 | 11,300 | 09/16/2008 06:58:13 | 1 | 0 | Exception handling in Delphi | 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 that detects unhandled exceptions? | delphi | exception-handling | null | null | null | null | open | Exception handling in Delphi
===
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 that detects unhandled exceptions? | 0 |
72,564 | 09/16/2008 14:00:14 | 9,021 | 09/15/2008 17:31:26 | 965 | 27 | 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 top for this sort of thing, plus PHP4 does not offer this.
Basically the technique involves returning true for success, and _something_ which _equates_ to false for failure. Here's an example to show what I mean:
define ('DUPLICATE_USERNAME', false);
define ('DATABASE_ERROR', 0);
define ('INSUFFICIENT_DETAILS', 0.0);
define ('OK', true);
function createUser($username) {
// create the user and return the appropriate constant from the above
}
The beauty of this is that in your calling code, if you don't care WHY the user creation failed, you can write simple and readable code:
if (createUser('fred')) {
// yay, it worked!
} else {
// aww, it didn't work.
}
If you particularly want to check why it didn't work (for logging, display to the user, or do whatever), use identity comparison with ===
$status = createUser('fred');
if ($status) {
// yay, it worked!
} else if ($status === DUPLICATE_USERNAME) {
// tell the user about it and get them to try again.
} else {
// aww, it didn't work. log it and show a generic error message? whatever.
}
The way I see it, the benefits of this are that it is a normal expectation that a successful execution of a function like that would return true, and failure return false.
The downside is that you can only have 7 "error" return values: false, 0, 0.0, "0", null, "", and `(object) null`. If you forget to use identity checking you could get your program flow all wrong. Someone else has told me that using constants like an enum where they all equate to false is "ick".
----------
So, to restate the question: how acceptable is a practise like this? Would you recommend a different way to achieve the same thing? | php | php4 | null | null | null | null | open | 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 top for this sort of thing, plus PHP4 does not offer this.
Basically the technique involves returning true for success, and _something_ which _equates_ to false for failure. Here's an example to show what I mean:
define ('DUPLICATE_USERNAME', false);
define ('DATABASE_ERROR', 0);
define ('INSUFFICIENT_DETAILS', 0.0);
define ('OK', true);
function createUser($username) {
// create the user and return the appropriate constant from the above
}
The beauty of this is that in your calling code, if you don't care WHY the user creation failed, you can write simple and readable code:
if (createUser('fred')) {
// yay, it worked!
} else {
// aww, it didn't work.
}
If you particularly want to check why it didn't work (for logging, display to the user, or do whatever), use identity comparison with ===
$status = createUser('fred');
if ($status) {
// yay, it worked!
} else if ($status === DUPLICATE_USERNAME) {
// tell the user about it and get them to try again.
} else {
// aww, it didn't work. log it and show a generic error message? whatever.
}
The way I see it, the benefits of this are that it is a normal expectation that a successful execution of a function like that would return true, and failure return false.
The downside is that you can only have 7 "error" return values: false, 0, 0.0, "0", null, "", and `(object) null`. If you forget to use identity checking you could get your program flow all wrong. Someone else has told me that using constants like an enum where they all equate to false is "ick".
----------
So, to restate the question: how acceptable is a practise like this? Would you recommend a different way to achieve the same thing? | 0 |
72,565 | 09/16/2008 14:00:28 | 10,776 | 09/16/2008 01:46:23 | 56 | 6 | Do you know any good distributed database systems? | What's the best way to scale a single database horizontally? | databse | distribution | null | null | null | null | open | Do you know any good distributed database systems?
===
What's the best way to scale a single database horizontally? | 0 |
72,573 | 09/16/2008 14:01:15 | 12,346 | 09/16/2008 14:01:15 | 1 | 0 | Can you use CMFCVisualManager with a dialog based application? | Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done? | mfc | null | null | null | null | null | open | Can you use CMFCVisualManager with a dialog based application?
===
Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done? | 0 |
72,580 | 09/16/2008 14:01:31 | 8,047 | 09/15/2008 15:01:43 | 1 | 1 | Future of Winforms? | I have an app that I've written in C#/WinForms ([my little app][1]). 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?
[1]: http://www.thekbase.com "TheKBase" | c# | winforms | cross-platform | null | null | null | open | Future of Winforms?
===
I have an app that I've written in C#/WinForms ([my little app][1]). 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?
[1]: http://www.thekbase.com "TheKBase" | 0 |
72,593 | 09/16/2008 14:02:14 | 4,466 | 09/03/2008 23:37:58 | 1 | 1 | 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. | sql | performance | null | null | null | null | open | 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. | 0 |
72,615 | 09/16/2008 14:03:46 | 9,323 | 09/15/2008 18:24:44 | 1 | 0 | How do I invoke an exe that is an embedded resource in a .Net assembly? | I have an 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. | .net | null | null | null | null | null | open | How do I invoke an exe that is an embedded resource in a .Net assembly?
===
I have an 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. | 0 |
72,616 | 09/16/2008 14:03:58 | 12,193 | 09/16/2008 13:32:36 | 11 | 1 | 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 it were for Windows.)
Is there any simple way to do it, or will it effectively require me to write my own resource system for Linux? (Easily possible, but it would take a lot longer.) | data | c | c++ | null | null | null | open | 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 it were for Windows.)
Is there any simple way to do it, or will it effectively require me to write my own resource system for Linux? (Easily possible, but it would take a lot longer.) | 0 |
72,624 | 09/16/2008 14:04:30 | 12,318 | 09/16/2008 13:58:03 | 1 | 0 | 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)
----This Site
------Agenda #1
----That Site
------Agenda #2
-- Report (Content Type)
----This Site
------Report #1
------Report #2
Does anyone know the best way to achieve this?
All the best
Kieran
| sharepoint | query | moss | list | null | null | open | 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)
----This Site
------Agenda #1
----That Site
------Agenda #2
-- Report (Content Type)
----This Site
------Report #1
------Report #2
Does anyone know the best way to achieve this?
All the best
Kieran
| 0 |
72,626 | 09/16/2008 14:04:41 | 3,397 | 08/28/2008 12:49:13 | 66 | 8 | "Could not find file" when using isolated storage | I'm saving some stuff in an 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 FileNotFoundException. What do I do wrong? I've tried the following scopes:
IsolatedStorageFile.GetMachineStoreForApplication();
IsolatedStorageFile.GetMachineStoreForAssembly();
IsolatedStorageFile.GetMachineStoreForDomain();
But none of them seem to work. | .net | c# | null | null | null | null | open | "Could not find file" when using isolated storage
===
I'm saving some stuff in an 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 FileNotFoundException. What do I do wrong? I've tried the following scopes:
IsolatedStorageFile.GetMachineStoreForApplication();
IsolatedStorageFile.GetMachineStoreForAssembly();
IsolatedStorageFile.GetMachineStoreForDomain();
But none of them seem to work. | 0 |
72,639 | 09/16/2008 14:05:39 | 12,231 | 09/16/2008 13:41:00 | 1 | 1 | What is the best way to process all versions of MS Excel spreadsheets with php on a non-Windows machine. | I am importing data from MS Excel spreadsheets into a php/mySQL application. Several different parties are supplying the spreadsheets and they are in formats ranging from Excel 4.0 to Excel 2007.
I am having trouble finding a technique to read ALL versions. | excel | php | null | null | null | null | open | What is the best way to process all versions of MS Excel spreadsheets with php on a non-Windows machine.
===
I am importing data from MS Excel spreadsheets into a php/mySQL application. Several different parties are supplying the spreadsheets and they are in formats ranging from Excel 4.0 to Excel 2007.
I am having trouble finding a technique to read ALL versions. | 0 |
72,667 | 09/16/2008 14:08:49 | 7,565 | 09/15/2008 13:58:28 | 9 | 1 | 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 the Excel data, create PDFs from the Word document, and email them out.
This process is very easily represented in a sequence workflow and that's how I have it so far, with COM automation to handle the Excel and Word pieces automatically. The wrench in the gears is that there is a human step between "create agenda" and "send it out," wherein I review the change details and formulate questions about them, which are added to the agenda. I currently have a Suspend activity to suspend the workflow while I manually do this piece of the process.
My question is, should I rewrite my workflow to make it a state machine to follow a best practice for human interaction in a business process, or is the Suspend activity a reasonable solution? | .net-3.5 | com | interop | workflow | bpm | null | open | 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 the Excel data, create PDFs from the Word document, and email them out.
This process is very easily represented in a sequence workflow and that's how I have it so far, with COM automation to handle the Excel and Word pieces automatically. The wrench in the gears is that there is a human step between "create agenda" and "send it out," wherein I review the change details and formulate questions about them, which are added to the agenda. I currently have a Suspend activity to suspend the workflow while I manually do this piece of the process.
My question is, should I rewrite my workflow to make it a state machine to follow a best practice for human interaction in a business process, or is the Suspend activity a reasonable solution? | 0 |
72,672 | 09/16/2008 14:09:38 | 12,376 | 09/16/2008 14:09:38 | 1 | 0 | Is there an 'Unformat' method in delphi | Has anyone written an 'Unformat' routine for Delphi?
What I'm imagining is the opposite of 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, but I've never used assembly so it doesn't mean a lot to me. | delphi | null | null | null | null | null | open | Is there an 'Unformat' method in delphi
===
Has anyone written an 'Unformat' routine for Delphi?
What I'm imagining is the opposite of 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, but I've never used assembly so it doesn't mean a lot to me. | 0 |
72,677 | 09/16/2008 14:10:07 | 5,369 | 09/09/2008 11:14:39 | 413 | 28 | how to remove this kind of symbols from string? | Imagine I have String in C#: "I Don’t see ya.."
I want to remove (replace to nothing or etc...) these "’" symbols.
Any ideas how to do this? :) | string | algorithm | unicode | null | null | null | open | how to remove this kind of symbols from string?
===
Imagine I have String in C#: "I Don’t see ya.."
I want to remove (replace to nothing or etc...) these "’" symbols.
Any ideas how to do this? :) | 0 |
72,682 | 09/16/2008 14:10:30 | 3,043 | 08/26/2008 13:24:14 | 2,538 | 249 | Is there a name for this anti-pattern? | 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 choice, but for whatever reason you want an error code instead. Remember, I'm playing devil's advocate here. So you create a generic class, like this:
class FunctionResult<T>
{
public T payload;
public int result;
}
And then declare your functions like this:
FunctionResult<string> MyFunction()
{
FunctionResult<string> result;
//...
return result;
}
One variation on this pattern is to use an enum for the error code instead of a string. Now, back to my question: does this anti-pattern have a name, and if so what is it? | anti-patterns | null | null | null | null | null | open | Is there a name for this anti-pattern?
===
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 choice, but for whatever reason you want an error code instead. Remember, I'm playing devil's advocate here. So you create a generic class, like this:
class FunctionResult<T>
{
public T payload;
public int result;
}
And then declare your functions like this:
FunctionResult<string> MyFunction()
{
FunctionResult<string> result;
//...
return result;
}
One variation on this pattern is to use an enum for the error code instead of a string. Now, back to my question: does this anti-pattern have a name, and if so what is it? | 0 |
72,696 | 09/16/2008 14:11:39 | 7,072 | 09/15/2008 13:07:03 | 1 | 0 | Which is generally best to use -- StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase? | If I have some code like this:
If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then
' .. do something ..
And I don't care about the case, should I use OrdinalIgnoreCase, InvariantCultureIgnoreCase, or CurrentCultureIgnoreCase? | vb.net | null | null | null | null | null | open | Which is generally best to use -- StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase?
===
If I have some code like this:
If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then
' .. do something ..
And I don't care about the case, should I use OrdinalIgnoreCase, InvariantCultureIgnoreCase, or CurrentCultureIgnoreCase? | 0 |
72,699 | 09/16/2008 14:11:53 | 12,386 | 09/16/2008 14:11:53 | 1 | 0 | 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
<br>or<br>
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. | sql | join | null | null | null | null | open | 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
<br>or<br>
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. | 0 |
72,719 | 09/16/2008 14:13:03 | 1,192 | 08/13/2008 12:17:17 | 91 | 12 | Good book for a C# developer going over to Java? | I'm pretty fluent in C#, but maybe need to go over to the dark^H^H^H^H other side and code some Java again. I'm ok with the Java language, as well as OO in general. But I want to learn some more about whats special in Java, as well as, if possible, whats different for me as a C# developer. Especially I need to catch up on some GUI stuff.
This would sort of be the opposite of the this question: [Can you recommend a good C# windows programming book (for Java developer)][1]
[1]: http://stackoverflow.com/questions/65720/can-you-recommend-a-good-c-windows-programming-book-for-java-developer | java | books | null | null | null | null | open | Good book for a C# developer going over to Java?
===
I'm pretty fluent in C#, but maybe need to go over to the dark^H^H^H^H other side and code some Java again. I'm ok with the Java language, as well as OO in general. But I want to learn some more about whats special in Java, as well as, if possible, whats different for me as a C# developer. Especially I need to catch up on some GUI stuff.
This would sort of be the opposite of the this question: [Can you recommend a good C# windows programming book (for Java developer)][1]
[1]: http://stackoverflow.com/questions/65720/can-you-recommend-a-good-c-windows-programming-book-for-java-developer | 0 |
72,732 | 09/16/2008 14:13:58 | 423,836 | 09/16/2008 13:34:57 | 30 | 0 | How do I get TextMate style quotes in Emacs? | In textmate, when there's a current selection, I hit the " key and the selection gets surrounded by quotes. The same thing happens with other balanced characters like (, {, [ and '.
Am I missing something obvious in Emacs configuration that would enable similar behaviour when using transient mark mode, or do I need to break out elisp and write something? | emacs | null | null | null | null | null | open | How do I get TextMate style quotes in Emacs?
===
In textmate, when there's a current selection, I hit the " key and the selection gets surrounded by quotes. The same thing happens with other balanced characters like (, {, [ and '.
Am I missing something obvious in Emacs configuration that would enable similar behaviour when using transient mark mode, or do I need to break out elisp and write something? | 0 |
72,768 | 09/16/2008 14:16:43 | 12,382 | 09/16/2008 14:10:53 | 1 | 1 | 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 it's number. Does anyone know of a definitive, reliable way to find this? | e-commerce | null | null | null | null | null | open | 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 it's number. Does anyone know of a definitive, reliable way to find this? | 0 |
72,769 | 09/16/2008 14:16:47 | 2,341 | 08/21/2008 17:50:42 | 1 | 0 | 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 TheFunction method:
int Managed::CallLibFunc()
{
return TheFunction();
}
3. Test app has a reference to managed.dll and creates multiple domains that call C++/CLI wrapper:
static void Main(string[] args)
{
Managed c1 = new Managed();
int val1 = c1.CallLibFunc();
// value is zero
AppDomain ad = AppDomain.CreateDomain("NewDomain");
Managed c = ad.CreateInstanceAndUnwrap(a.FullName, typeof(Managed).FullName) as Managed;
int val2 = c.CallLibFunc();
// value is one
}
Question:
Based on what I have read in Essential .NET Vol1 The CLR by Don Box, I would expect val2 to be zero since a brand new copy of managed.dll/static.lib is loaded when CreateInstanceAndUnwrap is called. Am I misunderstanding what is happening? The static library does not seem to be respecting the appdomain boundaries since it's unmanaged code. Is there a way to get around this issue other than by creating a brand new process for instantiating Managed?
Thank you very much everyone! | c# | managed | c+ | null | null | null | open | 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 TheFunction method:
int Managed::CallLibFunc()
{
return TheFunction();
}
3. Test app has a reference to managed.dll and creates multiple domains that call C++/CLI wrapper:
static void Main(string[] args)
{
Managed c1 = new Managed();
int val1 = c1.CallLibFunc();
// value is zero
AppDomain ad = AppDomain.CreateDomain("NewDomain");
Managed c = ad.CreateInstanceAndUnwrap(a.FullName, typeof(Managed).FullName) as Managed;
int val2 = c.CallLibFunc();
// value is one
}
Question:
Based on what I have read in Essential .NET Vol1 The CLR by Don Box, I would expect val2 to be zero since a brand new copy of managed.dll/static.lib is loaded when CreateInstanceAndUnwrap is called. Am I misunderstanding what is happening? The static library does not seem to be respecting the appdomain boundaries since it's unmanaged code. Is there a way to get around this issue other than by creating a brand new process for instantiating Managed?
Thank you very much everyone! | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.