All Questions
24,202,068
questions
1
vote
3
answers
3k
views
How can you tell if viewstate in an ASP.Net application has been tampered with?
During a discussion about security, a developer on my team asked if there was a way to tell if viewstate has been tampered with. I'm embarrassed to say that I didnt know the answer. I told him I would ...
11
votes
7
answers
15k
views
How do you write a C# Extension Method for a Generically Typed Class
This should hopefully be a simple one.
I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class.
How should this extension method look?
My first intuitive thought is ...
50
votes
11
answers
122k
views
Working with USB devices in .NET
Using .Net (C#), how can you work with USB devices?
How can you detect USB events (connections/disconnections) and how do you communicate with devices (read/write).
Is there a native .Net solution ...
11
votes
6
answers
18k
views
Good pattern or framework for adding auditing to an existing app? [closed]
I have an existing J2EE enterprise application to which I need to add auditing, i.e. be able to record CRUD operations on several important domain types (Employee, AdministratorRights, etc.).
The ...
11
votes
17
answers
1k
views
PHP: Can I reference a single member of an array that is returned by a function?
any idea how if the following is possible in PHP as a single line ?:
<?php
$firstElement = functionThatReturnsAnArray()[0];
... It doesn't seem to 'take'. I need to do this as a 2-stepper:
<?...
1
vote
6
answers
2k
views
What's the best way to extract table content from a group of HTML files?
After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?
1
vote
2
answers
1k
views
DefaultButton in ASP.NET forms
What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms?
42
votes
7
answers
51k
views
How can I print a binary value as hex in TSQL?
I'm using SQL Server 2000 to print out some values from a table using PRINT. With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the ...
64
votes
10
answers
30k
views
CLIPBRD_E_CANT_OPEN error when setting the Clipboard from .NET
Why does the following code sometimes causes an Exception with the contents "CLIPBRD_E_CANT_OPEN":
Clipboard.SetText(str);
This usually occurs the first time the Clipboard is used in the application ...
3
votes
8
answers
1k
views
Algorithm for finding characters in the same positions in a list of strings?
Suppose I have:
Toby
Tiny
Tory
Tily
Is there an algorithm that can easily create a list of common characters in the same positions in all these strings? (in this case the common characters are 'T' ...
93
votes
13
answers
49k
views
How to stop PHP replacing dot characters in GET, POST, or COOKIE names?
If I pass request fields or cookies with a period/dot in their names, PHP auto-replaces them with underscores. For example, if I put this code at https://example.com/test.php?x.y=a.b:
<?php
echo $...
2586
votes
27
answers
1.7m
views
Class (static) variables and methods
How do I create class (i.e. static) variables or methods in Python?
32
votes
4
answers
24k
views
Can you have a class in a struct?
Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?
20
votes
16
answers
34k
views
Regex that Will Match a Java Method Declaration
I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the ...
324
votes
9
answers
144k
views
Are tuples more efficient than lists in Python?
Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements?