instruction
stringlengths
0
30k
Pretty basic question, I'm trying to write a regex in Vim to match any phrase starting with `"abc "` preceeded by anything other than `"defg"`. I've used `"[^defg]"` to match any single character other than d, e, f or g. My first instinct was to try `/abc [^\(defg\)]` or `/abc [^\<defg\>]` but neither one of tho...
Pretty basic question, I'm trying to write a regex in Vim to match any phrase starting with `"abc "` directly followed by anything other than `"defg"`. I've used `"[^defg]"` to match any single character other than d, e, f or g. My first instinct was to try `/abc [^\(defg\)]` or `/abc [^\<defg\>]` but neither on...
I'm building a toy database in C# to learn more about compiler, optimizer, and indexing technology. I want to maintain maximum parallelism between (at least read) requests for bringing pages into the buffer pool, but I am confused about how best to accomplish this in .NET. Here are some options and the problems I...
Diagnosing Deadlocks in Win32 Program
|winapi|windbg|deadlock|production|
What are the steps and techniques to debug an apparent hang due to a deadlock in a Win32 production process. I heard that WinDbg can be used for this purpose but could you please provide clear hints on how this can be accomplished?
> * if it's a random value and the test fails, we need to a) fix the object and b) force ourselves to test for that value every time, so we know it works, but since it's random we don't know what the value was If your test case does not accurately record what it is testing, perhaps you need to recode the test ...
> * if it's a random value and the test fails, we need to a) fix the object and b) force ourselves to test for that value every time, so we know it works, but since it's random we don't know what the value was If your test case does not accurately record what it is testing, perhaps you need to recode the test cas...
How do I support SSL Client Certificate authentication?
|ruby-on-rails|apache|ssl|
I want to do what myopenid does -- once you've logged, you can click a button that generates you an SSL certificate; the browser then downloads this certificate and stores it. When you later go back to yourid.myopenid.com, your browser can use its stored certificate for authentication so you don't ever need a password...
I would assume that it is because your requests are not being sent asynchronously, since your requests are done iteratively on the server, blocking each time, you have to pay for the overhead of creating a connection each time, when you only have to do it once... In Flex, all web service calls are automatically call...
Rob Conery's MVC Storefront webcast series has [a video on this issue][1] (he gets to the database around 5:30). He stores a list of cultures, and then has a Product table for non-localized data and a ProductCultureDetail table for localized text. [1]: http://blog.wekeroad.com/mvc-storefront/mvcstore-part-5/
I personnally used [phpMyID][1] just for StackOverflow. It's a simple two-files PHP script to put somewhere on a subdomain. Of course, it's not as easy as installing a .deb, but since OpenID relies completely on HTTP, I'm not sure it's advisable to install a self-contained server... [1]: http://siege.org/project...
resource files
Setting up a DB connection is usually quite heavy. A lot of things are going on backstage **(DNS resolution/TCP connection/Handshake/Authentication/Actual Query)**. I've had an issue once with some weird DNS configuration that made every TCP connection took a few seconds before going up. My login procedure (because ...
C on Visual Studio
|c|c++|ide|compiler-construction|
I'm trying to learn C. As a C# developer, my IDE is Visual Studio. I've heard this is a good environment for C/C++ development. However, it seems no matter what little thing I try to do, intuition fails me. Can someone give good resources for how to either: - learn the ins and out of C in Visual Studio - recommend a ...
|c++|c|ide|compiler-construction|
Some sort of creational pattern needed in C#
|c#|.net|design-patterns|
I have the following type : // incomplete class definition public class Person { private string name; public string Name { get { return this.name; } } } I want this type to be **created** and **updated** with some sort of dedicated cont...
There's nothing wrong with a singleton in itself, and as a pattern it fills a vital role in recognising the need for certain objects to only be created a single time. What it is frequently used for is a euphemism for global variables as an attempt to get around global variable stigma, and it is this use that is inhe...
This is usually an exception while reading parameters into the web service method...are you sure you're passing the number/type of parameters the method is expecting?
I think a lot of people don't know about Generics, delegates, Linq and Lambda expressions. If you will tell then all at about the same time then they will just drop everything. Like you wouldn't teach a beginner programmer whats a DSL but you can let him know about SVN.
Others have already explained why learning more languages makes you a better programmer. As for convincing your boss it's worth it, this is probably just your company's culture. Some places make career and skill progress a policy (move up or out), some places value it but leave it up to the employee's initiative, a...
To find the sessions, as a DBA use > `select sid,serial# from v$session where username = '<your_schema>'` If you want to be sure only to get the sessions that use SQL Developer, you can add `and program = 'SQL Developer'`. If you only want to kill sessions belonging to a specific developer, you can add a restrictio...
How do you run CMD.exe under the Local System Account?
|windows|services|account|
I'm currently running Vista and I would like to manually complete the same operations as my Windows Service. Since the Windows Service is running under the Local System Account, I would like to emulate this same behavior. Basically, I would like to run CMD.EXE under the Local System Account. I found information onli...
Also, one way to get around the memory limitation mentioned by Skliwz is that if you are using this service outside of the normal application you can isolate it in it's own app pool. I have seen this done before which helps as well.
Need gcc/g++ working on SCO6
|c++|c|gcc|gnu|sco|
Has anyone found a way to get gcc to build/install on SCO6? With 2.95 and 4.3 I get to the point where it needs to use (2.95) or find (4.3) the assembler and that's where it fails. If anyone has figured this out I would appreciate the info! Thanks
This site gives a good introductory overview of how to structure your application. [http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/][1] We are currently using these ideas in two of our ASP.NET MVC / ExtJS applications. [1]: http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/
I would start here [http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/][1] This site gives a good introductory overview of how to structure your application. We are currently using these ideas in two of our ASP.NET MVC / ExtJS applications. [1]: http://blog.extjs.eu/know-how/writing-a-big-...
No one has mentioned load balancing... haproxy, etc. Optimize, cache and load balance should survive almost anything. That being said, I'm not sure if stackoverflow is behind a load balancer ;)
Literal Answer -- warning, performance may not be as good as just using an int to track the index. At least it is better than using IndexOf. You just need to use the indexing overload of Select to wrap each item in the collection with an anonymous object that knows the index. This can be done against anything th...
Add rss to any website!
|rss|
Is there any website/service which will enable me to add RSS subscription to any website? This is for my company I work.. We have a website which displays company related news! These news are supplied by an external agency and they gets updated to our DB automatically! Our website picks up random/new news and displa...
|rss|screen-scraping|
Perhaps you could draw (by hand) out your query and the results using [Venn Diagrams][1], and see if they produce the same diagram. Venn diagrams are good for representing sets of data, and SQL queries work on sets of data. Drawing out a Venn Diagram might help you to visualize if 2 queries are functionally equivalen...
Is there a particular reason why you are reading the file in the way that you do? If you're reading in an ASCII file you should really be using a Reader. I would do it something like: File inputFile = new File("somefile.txt"); BufferedReader reader = new BufferedReader(new FileReader(inputFile)); A...
Yes, IIS or the site is most likely configured for server-side debugging, which causes all requests to the site to go through a single thread. To check if this is the case/turn it off: 1. In the Properties pages for any Web site or Web virtual directory, click the Home Directory or Virtual Directory tab. 2...
You could use an expression (as suggested by HBoss), but if you are worried about performance then the best way to do this is to add a shim inside the element you want to apply a min-width to. <div id="container"> The "shim" div will hold the container div open to at least 500px! You should be able...
Is this happening across machines? Like if you start loading a page on one computer, then another, the second is blocked? I've seen this on a single computer, but only because the browser is limiting connections to the server
Anyone using WPF for real LOB applications?
|.net|wpf|
Anyone using WPF for real LOB applications? We have all seen the clever demos of WPF showing videos mapped onto 3D elements. These look great but what about the real world of line-of-business applications that make up the majority of developers efforts. Is WPF just for nice eye candy?
'Error' in this example could be any exception object. I think perhaps you have read a code example that used it as a metasyntatic placeholder to mean, "The Appropriate Exception Class". The baseclass of all exceptions is called 'Exception', and most of its subclasses are descriptive names of the type of error invol...
'Error' in this example could be any exception object. I think perhaps you have read a code example that used it as a metasyntatic placeholder to mean, "The Appropriate Exception Class". The baseclass of all exceptions is called 'Exception', and most of its subclasses are descriptive names of the type of error invol...
Your task will resume execution and finish the remainder of the time slice. Note that you will have some jitter that occurs for one time tick, since time slicing has a granularity of 1 clock tick. For example: You have round robin enabled with a 10 clock tick time slice. One clock tick is 10 ms. You expect 1...
Have you tried setting `!important` in the CSS file? Something like: #mydiv { overflow: hidden !important; }
It seems the best way to do this is to create a new CssClass. ASP.NET translates CheckBoxList into a table structure. Using something like Style.css .chkboxlist td { font-size:x-large; } Page.aspx <asp:CheckBoxList ID="chkboxlist1" runat="server" CssClass="chkboxlist" /> w...
New will throw an exception. Easy as that. The insert will not happen, and neither will the content of the dictionary be modified or corrupted.
The ODBC Bridge can produce a memory leak with some ODBC drivers. If you use a good JDBC driver then you should does not have any problems with closing the connection. But there are 2 problems: - Does you know if you have a good driver? - Will you use other JDBC drivers in the future? That the best practi...
What's the best freely available C# wrapper for BITS?
|c#|windows|interop|
BITS, the Windows background intelligent transfer service. Looks like there are a few C# wrappers around that manage the interop to BITS, does anybody have any opinions on the best one?
Raldi's solution can be tightened up to: my %hash = map { $_,1 } @array; This technique can also be used for turning text lists into hashes: my %hash = map { $_,1 } split(",",$line) Additionally if you have a line of values like this: "foo=1,bar=2,baz=3" you can do this: my %hash = map { spli...
Raldi's solution can be tightened up to this (the '=>' from the original is not necessary): my %hash = map { $_,1 } @array; This technique can also be used for turning text lists into hashes: my %hash = map { $_,1 } split(",",$line) Additionally if you have a line of values like this: "foo=1,bar=2,b...
Raldi's solution can be tightened up to this (the '=>' from the original is not necessary): my %hash = map { $_,1 } @array; This technique can also be used for turning text lists into hashes: my %hash = map { $_,1 } split(",",$line) Additionally if you have a line of values like this: "foo=1,bar=2,b...
Raldi's solution can be tightened up to this (the '=>' from the original is not necessary): my %hash = map { $_,1 } @array; This technique can also be used for turning text lists into hashes: my %hash = map { $_,1 } split(",",$line) Additionally if you have a line of values like this: "foo=1,bar=2,b...
There is no purpose for this in a non case sensitive database like SQL Server. This is a reusable database regardless of the type of database in which you are using. E.g. Informix is case-sensitive for all string data which is stored. Using this database on an Informix server would be a good reason to have/use this ...
Are there any large-scale commercial projects that use Squeak Smalltalk?
|smalltalk|squeak|
I've been learning Squeak Smalltalk & have noticed that it's got a really faithful community and is used in some large academic and open-source projects, but I haven't found any examples of it being used commercially in any significant way. I'm curious about how this environment is doing in the world commercially. Mayb...
WCF netTCPBinding - Is transport encryption enough?
|.net|wcf|encryption|tcp|
I've got a WCF service which handles some sensitive data. I'd like to make sure I keep that data from being exposed and so I'm looking at netTCPBinding... primarily because I can control the network it runs across and performance is a high priority. I recognize that there are two areas that can be encrypted: transp...
This is set when you compile your assembly. There are two types of optimizations: * IL optimization * JIT Native Code quality. The default setting is this /optimize- /debug- This means unoptimized IL, and optimized native code. /optimize /debug(+/full/pdbonly) This means unoptimized IL, an...
This is set when you compile your assembly. There are two types of optimizations: * IL optimization * JIT Native Code quality. The default setting is this /optimize- /debug- This means unoptimized IL, and optimized native code. /optimize /debug(+/full/pdbonly) This means unoptimized IL, an...
|.net|wpf|real-world|
I never used .NET Remoting but isn't that the kind of problem it could solve?
crti.o is the bootstrap library, it should be found in /usr/lib. Your not cross-compiling are you? If your running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it's not needed to run compiled programs, just to build them.
crti.o is the bootstrap library, generally quite small. It's usually statically linked into your binary. It should be found in /usr/lib. If your running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it's not needed to run compiled programs, just to build them....
crti.o is the bootstrap library, generally quite small. It's usually statically linked into your binary. It should be found in /usr/lib. If your running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it's not needed to run compiled programs, just to build them....
Main problem I've encountered with it is reporting. There just doesn't seem to be any way to run efficient reports against a db4o data source.
I'm not 100% sure how to do exactly what you have requested. But guessing the goal you have in mind there are a few possibilities. **1)** Make part (or all) of your Globals a separate text file that is distributed with the .XLA I would use this for external references such as the version of the rest of your app. Wri...
get the Frequency Analyzer at http://www.relisoft.com/Freeware/index.htm and run it and look at the code.
Use approach #1, *but* 1. When a request comes in, take lock A. Use it to protect a queue of pending read requests. Add it to the queue and return some new async result. If this results in the first addition to the queue, call step 2 before returning. Release lock A before returning. 2. When a read completes ...
Check [this thread](http://forums.microsoft.com/msdn/showpost.aspx?pageindex=2&siteid=1&postid=2044742&sb=0&d=1&at=7&ft=11&tf=0&pageid=0)
You probably want to send UDP packets with data that just happens to contain a TCP packet. A good place to start would be to use [Asio][1] which is a great cross-platform (incl Linux) library for network communication. [1]: http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/overview.html
A good place to start would be to use [Asio][1] which is a great cross-platform (incl Linux) library for network communication. [1]: http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/overview.html
Microsoft Office Sharepoint Server (MOSS) is a combination of two previous products, Microsoft SharePoint and Microsoft Content Management System. It has a large number of features out of the box that are very desirable for any single system, including hosting files with customisable metadata. Page and file publishi...
I would throw a file sharing server into the mix too. I thought version control was so basic, that I didn't even bother to put it there in the list. But its a good point version control.
What is the difference between Views and Materialized Views in Oracle?
|oracle-database|views|materialized-views|
What is the difference between Views and Materialized Views in Oracle?
Baseline snaplines in custom Winforms controls
|.net|winforms|user-controls|
I have a custom user control with a textbox on it and I'd like to expose the baseline (of the text in the textbox) snapline outside of the custom control. I know that you create a designer (inherited from ControlDesigner) and override SnapLines to get access to the snaplines, but I'm wondering how to get the text base...
Consider Cygwin and its version of "cron". It meets requirements #1 thru 4 (though without a nice UI for #3.)
- Manage all includes manually, only where needed - Set your include_path to only where it has to be, the default is something like .:/usr/lib/pear/:/usr/lib/php, point it only at where it has to be, php.net/set_include_path - Don't use autoload, it's slow and makes APC and equivalent caches jobs a lot harder - ...
- Manage all includes manually, only where needed - Set your include_path to only where it has to be, the default is something like .:/usr/lib/pear/:/usr/lib/php, point it only at where it has to be, php.net/set_include_path - Don't use autoload, it's slow and makes APC and equivalent caches jobs a lot harder - ...
@freespace and others: One of the things I remember from my cryptography classes is that you should not compress your data before encryption, because some repeatable chunks of compressed stream (like section headers for example) may make it easier to crack your encryption.
PropertyGrid, DefaultValueAttribute, dynamic object, and enumerations
|c#|reflection|enumeration|attributes|