instruction stringlengths 0 30k ⌀ |
|---|
Avoiding first chance exception messages when the exception is safely handled |
|c#|.net|exception| |
The following bit of code catches the EOS Exception
using (var reader = new BinaryReader(httpRequestBodyStream)) {
try {
while (true) {
bodyByteList.Add(reader.ReadByte());
}
} catch (EndOfStreamException) { }
}
So why do I still receive ... |
When should you use full-text indexing? |
|full-text-search|indexing| |
We have a whole bunch fo queries that "search" for clients, customers, etc. You can search by firstname, email, etc. We're using LIKE statements in the following manner:
<pre>
select * from customer where fname like '%someName%'
</pre>
Does full-text indexing help in the scenario? |
We have a whole bunch fo queries that "search" for clients, customers, etc. You can search by firstname, email, etc. We're using LIKE statements in the following manner:
<pre>
select * from customer where fname like '%someName%'
</pre>
Does full-text indexing help in the scenario?
**Edit:**
I failed to me... |
|sql-server|full-text-search|indexing| |
We have a whole bunch fo queries that "search" for clients, customers, etc. You can search by firstname, email, etc. We're using LIKE statements in the following manner:
select * from customer where fname like '%someName%'
Does full-text indexing help in the scenario?
**Edit:**
I failed to mention w... |
When using an ORM you typically select an object before updating it.
You can use DataContext.ExecuteCommand(...) to bypass the ORM if you do not want to do a select. |
You could have a hidden input that you set to a known value on the server side if it's a postback/callback - and your javascript could check that value.
That said, I really hope that there's a client-only solution for this. |
You could have a hidden input that you set to a known value on the server side if it's a postback/callback - and your javascript could check that value.
That said, I really hope that there's a client-only solution for this.
**Edit:** @mmattax - I believe he's looking for a client-side solution - the JavaScript eq... |
You can still use Page.IsPostback during an async call. |
Personally I like to use [XMLStarlet](http://xmlstar.sourceforge.net/) which has a command line interface, and works on streams. It is a set of tools built on Libxml2. |
Redirecting ".local" subdomain to unicast DNS |
|dns|mdns|bonjour|zeroconf| |
I regularly access Windows domains that have been setup to use a domain under the ".local" top level name. This conflicts with Bonjour/Zeroconf which reserves ".local" for it's own use. A number of platforms support Bonjour out of the box (including Mac OS, iPhone, and Ubuntu) and there's numerous name resolution issue... |
|dns|bonjour|mdns|zeroconf| |
I regularly access Windows domains that have been set up to use a domain under the `.local` top level name. This conflicts with Bonjour/Zeroconf which reserves `.local` for it's own use. A number of platforms support Bonjour out of the box (including Mac OS, iPhone, and Ubuntu) and there's numerous name resolution issu... |
You could parse `/proc/net/route`. |
Where can I find the time and memory efficencies of the built-in sequence types in Python |
|python|efficiency|big-o|sequences| |
I have been unable to find a resource with this information, aside looking through the Python source code myself to determine how the objects work themselves. Though I may end up doing this anyway out of curiosity, does anyone know where I could find this online? |
|python|performance|efficiency|big-o|sequences| |
I'd recommend [Redgate][1] SQL Compare for this - it allows you to compare database versions and generate change scripts - it's also fairly easily scriptable.
[1]: http://www.red-gate.com/ |
This is nitpicking, but `int`, `String`, `Number` and the others _are_ passed by reference, it's just that they are immutable. Of course, the effect is the same as if they were passed by value. |
You can create a batch file and schedule it:
- delete the contents of your scripts directory
- using something like [ExportSQLScript][1] to export all objects to script/scripts
- svn commit
Please note: That although you'll have the objects under source control, you'll not have the data or it's progressio... |
Install [Worpress][1]. It is the most common engine for a reason. It's PHP but will play just fine in your environment.
[1]: http://wordpress.org/ |
Install [Wordpress][1]. It is the most common engine for a reason. It's PHP but will play just fine in your environment.
[1]: http://wordpress.org/ |
Of course there is a `PATH` environment variable [in Windows][1].
>> `%PATH%`
>> This variable contains a semicolon-delimited list of directories in which the command interpreter will search for executable files. Equivalent to the UNIX $PATH variable.
[1]: http://en.wikipedia.org/wiki/Environment_variable#Sy... |
Windows does indeed have a PATH environment variable. It has a different syntax from the Unix one because it uses semicolon (;) as a separator instead of colon (:) and you have to watch for quoted strings that might contain spaces. But, it's there.
If this other program's installer adds its own directory to the PATH... |
|.net|asp.net|web-services|exception|soap| |
I have a simple web service operation like this one:
[WebMethod]
public string HelloWorld()
{
throw new Exception("HelloWorldException");
return "Hello World";
}
And then I have a client application that consumes the web service and then calls the opera... |
How to get number of occurrences in a SQL IN clause |
|sql| |
Let say i have four tables PAGE, USER, TAG and PAGE-TAG
PAGE has fields ID, CONTENT ...
TAG has fields ID, NAME ...
USER has fields ID, NAME ...
PAGE-TAG has fields ID, PAGE-ID, TAG-ID, USER-ID
Let say i have four pages
PAGE#1 'Content page 1' tagged with tag#1 by user1, tagged with tag#1 by user2
... |
General-purpose comparison of floating-point numbers is generally meaningless. How to compare really depends on a problem at hand. In many problems, numbers are sufficiently discretized to allow comparing them within a given tolerance. Unfortunately, there are just as many problems, where such trick doesn't really work... |
What's at:
at MyDeliveryExtension.MailDelivery.SendMail(SubscriptionData data, Stream reportStream, String reportName, String smptServerHostname, Int32 smtpServerPort)
in C:\inetpub\wwwroot\CustomReporting\MyDeliveryExtension\MailDelivery.cs:line 48
at MyDeliveryExtension.MyDelivery.Deliver(N... |
You can just make the program counter point to the code you want to execute. Remember that data can be data or code. On x86 this would be the EIP register. The IP part of EIP stands for instruction pointer. |
You can just make the program counter point to the code you want to execute. Remember that data can be data or code. On x86 the program counter is the EIP register. The IP part of EIP stands for instruction pointer. The JMP instruction is called to jump to an address. After the jump EIP will contain this address. |
You can just make the program counter point to the code you want to execute. Remember that data can be data or code. On x86 the program counter is the EIP register. The IP part of EIP stands for instruction pointer. The JMP instruction is called to jump to an address. After the jump EIP will contain this address.
> ... |
You can just make the [program counter][1] point to the code you want to execute. Remember that data can be data or code. On x86 the program counter is the EIP register. The IP part of EIP stands for instruction pointer. The JMP instruction is called to jump to an address. After the jump EIP will contain this address.
... |
I just placed both swaps (as macros) in hand written quicksort I've been playing with. The XOR version was much faster (0.1sec) then the one with the temporary variable (0.6sec). The XOR did however corrupt the data in the array (probably the same address thing Ant mentioned).<p>
As it was a fat pivot quicksort, the X... |
I just placed both swaps (as macros) in hand written quicksort I've been playing with. The XOR version was much faster (0.1sec) then the one with the temporary variable (0.6sec). The XOR did however corrupt the data in the array (probably the same address thing Ant mentioned).<p>
As it was a fat pivot quicksort, the X... |
I think the stream is throwing this exception, so your try is scoped to narrow to catch it.
Add a few more try catch combos around the different scopes until you catch it where its actually being thrown, but it appears to be happening either at our outside of your using, since the stream object is not created in the... |
Saving an open generic type in an array? |
|.net|generics| |
I am facing a problem with .NET generics. The thing I want to do is saving an array of generics types (GarphicsItem):
public class GraphicsItem<T>
{
private T _item;
public void Load(T item)
{
_item = item;
}
}
How can I save such open generic t... |
The point of "first-chance" exceptions is that you're seeing them pre-handler so that you can stop on them during debugging at the point of throwing. A "second-chance" exception is one that has no appropriate handler. Sometimes you want to catch "first-chance" exceptions because it's important to see what's happening w... |
Recent Projects panel on VS2008 not working for fresh installs |
|visual-studio-2008| |
The Recent Projects panel on the Start Page of VS2008 Professional doesn't appear to work, and constantly remains empty.
I've noticed this on 3 of our developers VS2008 installations, in fact all the installations that weren't updated from 2005 but installed from scratch. I generally treat this as a bit of a curiosi... |
The Recent Projects panel on the Start Page of VS2008 Professional doesn't appear to work, and constantly remains empty.
I've noticed this on 3 of our developers VS2008 installations, in fact all the installations that weren't updated from 2005 but installed from scratch. I generally treat this as a bit of a curiosi... |
The Recent Projects panel on the Start Page of VS2008 Professional doesn't appear to work, and constantly remains empty.
I've noticed this on 3 of our developers VS2008 installations, in fact all the installations that weren't updated from 2005 but installed from scratch. I generally treat this as a bit of a curiosi... |
Recursive definitions need to appear in the same file. If you want to separate definitions, statements, and expressions into separate modules, you can do so using [recursive modules][1], but they will still need to appear in the same file. DAG-ifying inter-file dependencies is one of the annoyances of OCaml.
[1]... |
Bash reg-exp substitution |
|bash| |
Is there a way to run a regexp-string replace on the current line in the bash?
I find myself rather often in the situation, where I have typed a long commandline and then realize, that I would like to change a word somewhere in the line.
My current approach is to finish the line, press Ctrl-A (to get to the start... |
Is there a way to run a regexp-string replace on the current line in the bash?
I find myself rather often in the situation, where I have typed a long commandline and then realize, that I would like to change a word somewhere in the line.
My current approach is to finish the line, press Ctrl-A (to get to the start... |
|bash|regexp| |
|regex|bash| |
How do I resolve a System.Security.SecurityException with custom code in SSRS? |
|reporting-services| |
I've created an assembly and referenced it in my Reporting Services report. I've tested the report locally (works), and I then uploaded the report to a report server (doesn't work).
Here is the error that is thrown by the custom code I've written.
> System.Security.SecurityException:
> Request for the permission... |
The Internet Explorer box model has been "fixed" since Internet Explorer 6 so long as your pages are in standard compliants mode.
See: [Quirks mode][1] and [Internet Explorer box model bug][2].
Until I learnt about doctype declerations getting IE to work properly was a real PAIN, because IE runs in "quirks mode" ... |
@[Robbie Rocketpants][1]
> "but my instincts tell me that this
> would cut a maximum of two type casts
> operations down to a maximum of one."
If you do the cast as you were suggesting in example 1 (using is & as), it results in 2 calls to the "is" operator. Because when you do "c = obj as MyClass", first it ca... |
[Howto: (Almost) Everything In Active Directory via C#][1] is very helpfull and also includes instructions on how to iterate AD members in a group.
public ArrayList Groups(string userDn, bool recursive)
{
ArrayList groupMemberships = new ArrayList();
return AttributeValuesMultiString("me... |
I've been using NHibernate for the last year or so, and it's proved to be a really quick way of getting basic CRUD (almost) for free.
If this is something you're looking to get into, I can recommend Billy McCafferty's NHibernate best practices article on CodeProject:
http://www.codeproject.com/KB/architecture/NHi... |
Try setting wmode to transparent - see [here][1]
[1]: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15523 |
1) In Visual Studio you can change the settings for the way the Debugger handles (breaks on) exceptions.
Go to Debug > Exceptions. (Note this may not be in your menu depending on your Visual Studio Environment setting. If not just add it to your menu using the Customize menu.)
There you are presented with a dialo... |
The iframe-trick is only for IE (below IE7), so it probably would never help in Firefox.
I'd try to enable wmode=transparent, so that the Flash content won't get its own HWND |
My info may be a bit out of date (last used these servers 2 years ago) but as I recall one big gotcha was that all the cores on a single CPU all shared the *same* FPU unit, so if your code did a lot of floating point (we were doing GIS) the FPU was a massive bottleneck and you didn't get much benefit from the large num... |
Not sure if this is a setup, but of course, Safari on Windows renders using the OS X rendering algorithm. |
If you want to store heterogeneous GrpahicsItem's i.e. GraphicsItem< X> and GrpahicsItem< Y> you need to derive them from common base class, or implement common interface. Another option is to store them in List< object> |
This is really the same as the question, should I learn a low level language like C (or even assembler).
Coding in it is certainly slower (though of course the result is much faster), but its true advantage is you gain an insight into what is happening at close to the system level, rather than than just understandin... |
I like to go over a code the person actually wrote and have them explain it to me. |
Are you trying to create an array of GraphicsItem in a non-generic method?
You cannot do the following:
static void foo()
{
var _bar = List<GraphicsItem<T>>();
}
and then fill the list later.
More probably you are trying to do something like this?
static GraphicsItem<T>[] Create... |
In Asp.net 3.5, you should be able to set up the Link tag in the header as a server tag. Then in the codebehind you can set the href property for the link element, based on a cookie value, querystring, date, etc.
In your aspx file:
<head>
<link id="linkStyles" rel="stylesheet" type="text/css" runat="se... |
>Why are pointers such a leading factor of confusion for many new, and even old, college level students in the C/C++ language?
The concept of a placeholder for a value - variables - maps onto something we're taught in school - algebra.
>Are there any tools or thought processes that helped you understand how poin... |
>Why are pointers such a leading factor of confusion for many new, and even old, college level students in the C/C++ language?
The concept of a placeholder for a value - variables - maps onto something we're taught in school - algebra. There isn't an existing parallel you can draw without understanding how memory ... |
>Why are pointers such a leading factor of confusion for many new, and even old, college level students in the C/C++ language?
The concept of a placeholder for a value - variables - maps onto something we're taught in school - algebra. There isn't an existing parallel you can draw without understanding how memory ... |
|reporting-services|securityexception| |
|reporting-services|securityexception| |
|reporting-services|securityexception| |
I've created an assembly and referenced it in my Reporting Services report. I've tested the report locally (works), and I then uploaded the report to a report server (doesn't work).
Here is the error that is thrown by the custom code I've written.
> System.Security.SecurityException:
> Request for the permission... |
|reporting-services|securityexception| |
Does the Microsoft Report Viewer Redistributable 2008 really require .NET Framework version 3.5? |
|reportviewer2008|deployment|webdeploymentproject|.net-3.5| |
I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package. Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer. When I check the [download page for Report Viewer 2008][1], it lists .NET 3.5 as a requirement.
Is havi... |
|.net-3.5|webdeploymentproject|reportviewer2008| |
|gui-automation|guid-testing|window-handle| |
Introducing Python |
|php|python|languages| |
The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP t... |
|python|php|language| |
Suitable alternative to CryptEncrypt |
|win32api|c++|windowssdk| |
We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function [CryptEncrypt.][1] (direct and decryptable)
The problem is that CryptEncrypt can produce NU... |
|win32api|c++|windowssdk|encryption| |
|winapi|c++|windowssdk|encryption| |