instruction
stringlengths
0
30k
Try to reset the Visual Studio settings (**Tools->Import and Export Settings->Reset All Settings**).
The limitation you're running into here is that C#, unlike some other OOP languages, lacks [multiple dispatch][1]. In other words, given these base classes: public class Base { public virtual void Go() { Console.WriteLine("in Base"); } } public class Derived : Base { pu...
"Network Places" doesn't really have an API, it's just a bunch of shortcuts, and the SharePoint share uses a Shell Extension, if I recall correctly. All of that to say: accessing Sharepoint as a file system from PowerShell *also* requires an extension, the [SharePoint Provider](http://www.codeplex.com/PSSharePoint)...
I came up with this:<br /> \b\w*\s*\w*\(.*?\)\s*\{[\x21-\x7E\s]*\} I tested it against a PHP function but it should work just the same, this is the snippet of code I used: <br/> function getProfilePic($url) { if(@open_image($url) !== FALSE) { @imagepng($image, 'images/profiles/...
This is what Procmail is for. Set Sendmail up to use procmail as the mail delivery agent (MDA), or set up your .forward to pipe stuff through procmail. (See the man page.) Then you can write your .procmailrc to do all sorts of things along these lines. This filter predates gmail. Still useful if you're running...
How can I hide/delete the "?" help button on the "title bar" of a QT Dialog?
|qt|qt4|dailog-help-button|
I am using QT Dialogs in one of my application. I need to hide/delete the help button. But i am not able to locate where exactly i get the handle to his help button. Not sure if its a particular flag on the QT window. Kindly let me know if you know how to achieve this.
Building a query string based radiobutton values
|asp.net|vb.net|
I'd like to build a query string based on values taken from 5 groups of radio buttons. Selecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1 The asp:Radiobuttonlist control does not like null values so I'm resorting to n...
I don't understand, why not using the Dictionary( Dictionary ) (as suggested by ageektrapped ). Do you want to perform a Swallow Copy or a Deep Copy? (that is, both Dictionaries pointing to the same references or new copies of every object inside the new dictionary?) If you want to create a *new* Dictionary poin...
I don't understand, why not using the Dictionary( Dictionary ) (as suggested by ageektrapped ). Do you want to perform a Shallow Copy or a Deep Copy? (that is, both Dictionaries pointing to the same references or new copies of every object inside the new dictionary?) If you want to create a *new* Dictionary poin...
Not particular constructive advice I know, but if I was you I'd get off WSE3.0 as soon as possible. We did some work with trying to get it to interoperate with WCF and a Java client earlier this year and it was an obsolute KNIGHTMARE. WCF on the other hand is practically sane and the documentation on areas like this...
New variables can be decalared only at block scope. You need to write something like this: case VAL: // This will work { int newVal = 42; } break; Of course, newVal only has scope within the braces... Cheers, Ralph
[There is a .NET version of QuickReports supported in Delphi 2005 and Delphi 2006][1]. You have to get the (non-free) "professional" version of QuickReports to get the .NET support, however. It's not included in the "standard" edition. Delphi 2005 and Delphi 2006 both support C#, but I have never tried the .NET versi...
For a long time I didn't understand pointers, but I understood array addressing. So I'd usually put together some storage area for objects in an array, and then use an index to that array as the 'pointer' concept. SomeObject store[100]; int a_ptr = 20; SomeObject A = store[a_ptr]; One problem with t...
Immutability is one approach to avoid locking. See [Eric Lippert's discussion][1] and implementation of things like immutable stacks and queues. [1]: http://blogs.msdn.com/ericlippert/archive/tags/Immutability/default.aspx
Here's another vote for JMeter. JMeter is an open-source load testing tool, written in Java. It's capable of testing a number of different server types (for example, web, web services, database, just about anything that uses requests basically). It does however have a steep learning curve once you start getting t...
I *strongly* discourage you from learning a layout that has been heavily optomized for any one programming language (or even a class of them..) it's much, much easier to change languages than keylayouts, and you'll have a lot of trouble finding the tweaked layouts on any random computers you need to use. That said, ...
Conceptually, an Interface is used to formally and semi-formally define a set of methods that an object will provide. Formally means a set of method names and signatures, semi-formally means human readable documentation associated with those methods. Interfaces are only descriptions of an API (after all, API stands for...
ESC\ works fine on AIX4.2 at least. One thing I noticed is that it only autocompletes to the unique part of the file name. So if you have the files x.txt, x171go and x171stop, the following will happen: Press keys: Command line is: x x <ESC>\ x 1 ...
ESC\ works fine on AIX4.2 at least. One thing I noticed is that it only autocompletes to the unique part of the file name. So if you have the files x.txt, x171go and x171stop, the following will happen: Press keys: Command line is: x x <ESC>\ x 1 ...
How do get element out of xml file
|vb.net|xpath|
From a service i get a xml-file. Now I want to get one of those element out of the file. I think I should go into some xpath - any good starter reference ?
Database Design Lookup tables.
|database-design|magicnumber|
I'm currently trying to improve the design of a legacy db and I have the following situation Currently I have a table SalesLead in which we store the the LeadSource. Create Table SalesLead( .... LeadSource varchar(20) .... ) The Lead Sources are helpfully stored in a table. ...
|database-design|magicnumber|
I'm currently trying to improve the design of a legacy db and I have the following situation Currently I have a table SalesLead in which we store the the LeadSource. Create Table SalesLead( .... LeadSource varchar(20) .... ) The Lead Sources are helpfully stored in a table. ...
You need to use `to_date` in your column listing as demonstrated <a href="http://www.orafaq.com/wiki/SQL%2ALoader_FAQ#Can_one_modify_data_as_the_database_gets_loaded.3F">here</a>. Something like: <pre> <code> LOAD DATA INFILE * INTO TABLE some_table FIELDS TERMINATED BY "," ( col1 col2 "to_date(:c...
I'd definitely change from text to binary but keep each day in a separate file still. You could name them in such a way that insertions in between don't cause any strangeness with indices, such as by including the date and possible time in the filename. You could also consider the file structure if you have several fie...
It's a very open ended question - for example, you could create your own static event Handler class which widgets subscribe themselves to. e.g: Class newMessageHandler { void update(Widget caller, Widget subscriber) { ... } } customEventHandler.addEventType("New Message...
How do I get a warning before killing a temporary buffer in Emacs?
|emacs|
More than once I've lost work by accidentally killing a temporary buffer in Emacs. Can I set up Emacs to give me a warning when I kill a buffer not associated with a file?
Using boost-python with C++ in Linux
|python|boost|c++|
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project. Building the boost librari...
Lots of good advice already. As people have mentioned, if you don't have single point involved, it's simple to just phase in changes by upgrading an app server at a time. But that's rarely the case, so let's ignore that and focus on the difficult bits. Usually there is a db in there which is common to everything ...
Check out these resources: Grant Skinners Introductory AS3 Workshop slidedeck http://gskinner.com/talks/as3workshop/ Lee Brimelow : 6 Reasons to learn ActionScript 3 http://www.adobe.com/devnet/actionscript/articles/six_reasons_as3.html Colin Moock : Essential ActionScript 3 (considered the "bible" for ActionS...
The BackColor property has an alpha property, which is the same as opacity. If it's pure html, there should be an opacity property or style.
For your own data, you'll want to implement a [custom tile overlay][1]. [1]: http://code.google.com/apis/maps/documentation/overlays.html#Tile_Overlays
Well, assuming you have a `System.Net.Sockets.TcpClient` connected to your client, you can (on the server) use `client.Client.RemoteEndPoint`. This will give you a `System.Net.EndPoint` pointing to the client; that *should* contain an instance of the `System.Net.IPEndPoint` subclass, though I'm not sure about the condi...
Strong SSL with Tomcat 6
|tomcat|ssl|aes|
I'm trying to create a self signed certificate for use with Apache Tomcat 6. Every certificate I can make always results in the browser connecting with AES-128. The customer would like me to demonstrate that I can create a connection at AES-256. I've tried java's keytool and openssl. I've tried with a variety of ...
This trigger should do the trick: create trigger update_increment for update as if not update(incrementID) UPDATE tb_users SET incrementID = incrementID + 1 from inserted WHERE tb_users.id = inserted.id
Intellisense won't give you hints but you can do this: <asp:Label ID="Label1" runat="server" Text="Label" style="color:Red;"></asp:Label>
Use a library such as [Intel's Threading Building Blocks][1], it contains quite a few lock -free structures and algorithms. I really wouldn't recommend attempting to write lock-free code yourself, it's extremely error prone and hard to get right. [1]: http://www.threadingbuildingblocks.org/
This function uses list comprehensions and str.join, so it runs in linear time instead of O(n^2): from curses.ascii import isprint def printable(input): return ''.join([char for char in input if isprint(char)])
Reduce or eliminate shared mutable state.
You can use the function function-avaliable() to determine which function you should use: <xsl:choose> <xsl:when test="function-avaliable('exslt:node-set')"> <xsl:apply-templates select="exslt:node-set($nodelist)" /> </xsl:when> <xsl:when test="function-avaliable('msxsl:node-set')">...
You can't specify an _exact_ sleep time in Windows. You need a real-time OS for that. The best you can do is specify a _minimum_ sleep time. Then it's up to the scheduler to wake up your thread after that. And **never** call .Sleep() on the GUI thread.
When I first started working with PDF, I found the [PDF reference][1] very hard to navigate. It might help you to know that the overview of the file structure is found in syntax, and what Adobe call the document structure is the object structure and not the file structure. That is also found in Syntax. The descripti...
For developing portable network programs of any sort in Python, [Twisted](http://twistedmatrix.com) is quite useful. One of its benefits is providing a convenient layer above low-level socket APIs.
Maybe you can try to reproduce this using a specific solution and csproject file and report it to Microsoft? That's the best shot you can ever have.
Automatic Internationalization Testing For Web
|testing|internationalization|
Does there exist a website service or set of scripts that will tell you whether your web page badly configured if your goal is to be internationally friendly? To be more precise, I'm wondering if something like this exists: Checking URL: http://www.example.com GET / HTTP/1.0 Accept-Charset: utf8 ...
Perl: sub is_palindrome { my $s = lc shift; # normalize case $s =~ s/\W//g; # strip non-word characters return $s eq reverse $s; }
most debuggers are just plug-ins that also have a command-line interface; try running the debugger from the command-line and see if it works. If it does, then check the plug-in configuration; you may have to re-install the plug-in. caveat: I have not used EclipseME, but had similar problems with the Gnu C debugger i...
There is no syntax in C++ for the second method you mentioned. There's nothing wrong with your first method. If however you have very big ranges, just use a series of if statements.
There is no syntax in C++ nor C# for the second method you mentioned. There's nothing wrong with your first method. If however you have very big ranges, just use a series of if statements. If you really wanted to try hard, you could create a range class in C# and test for that in each case statement.
There is no syntax in C++ nor C# for the second method you mentioned. There's nothing wrong with your first method. If however you have very big ranges, just use a series of if statements.
It really depends on the specific JVM implementation. I assume you're wondering about Sun's Windows JVM, and I can tell you with certainty that the Sun JVM maps a Java thread to an OS thread. You could try spawning up a couple of threads from Java code, open up Task Manager and see what happened.
I would say keep it as simple as possible. Internet on phones can be 3g/wifi or as slow as you can possibly imagine. I would keep the test large so it's easier to read, and links easy to click if you are targeting a touch device. I would also say no to images unless they are 1kb or less.
For the most part I'd agree with seldaek, but I'm also inclined to say that you should at least give a file that says what the dependencies are, what Java version to use to compile, etc, and anything extra that a NetBeans/Eclipse developer might need to compile in their IDE. We currently only use Eclipse and so we c...
In a typical application the user would be presented with a list of Lead Sources (returned by querying the LeadSource table) and the subsequent SalesLead query would be dynamically created by the application based upon the user's selection. Your application appears to have some 'well known' lead sources that you nee...
Not VB specific, but try: http://www.w3schools.com/xpath/default.asp
How to timeout a mysql++ query in c++
|c++|mysql|
I am using mysql++ in order to connect to a MySQL database to perform a bunch of data queries. Due to the fact that the tables I am reading from are constantly being written to, and that I need a consistent view of the data, I lock the tables first. However, MySQL has no concept of 'NOWAIT' in its lock query, thus if t...
If you're using Prototype you can use [bind()][1] and [bindAsEventListener()][2] to get around that problem. [1]: http://www.prototypejs.org/api/function/bind [2]: http://www.prototypejs.org/api/function/bindAsEventListener
One way would be to only extract the needed informations with an xslt file into a new xml and use this new xml as data basis for further processing
Clarification needed: Given the url: http://server/path/file Does that get redirected to: http://server/path/ Or does it get redirected to: http://server/path/file/ As in: Do you want the redirects to go to the parent path, or do you just want to add a slash and assume directory out of the current path?
Can a LINQ to SQL IsDiscriminator column NOT inherit?
|.net|asp.net|linq|linq-to-sql|inheritance|
I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have two types of pages: normal and root. Some pages are roots. Some pages are not. I have a Page database table and a RootPage database table: Page ---- PK PageId HtmlTitle PageHe...
Weird one that applied to sql server 2000 that might still apply today; make sure that you aren't trying to dynamically grow the db in production. There comes a point where the amount of time it takes to allocate that extra space and your normal load running will cause your queries to timeout (and the growth too!)
Your breakpoints aren't being hit because you are using Spring's AOP Proxies. See [understanding-aop-proxies][1] for a description of how AOP Proxies are special. Basically, the MVC framework is going to call the handleRequest method on your controller's proxy (which for example the MultiActionController you're usi...
In .NET 2.0 and later, use EventHandler if you have no arguments at all, and EventHandler&lt;T&gt; if you want to provide some custom data (you will need to derive a class from EventArgs with your additional data in it). If you have no EventArgs to use, pass EventArgs.Empty. Because EventArgs is a reference type, al...
I believe KDevelop is the only full IDE that supports Obj-C, but I'm not even sure how fully it supports it, having never used it myself. Worth a shot, maybe.
How do I fix a "broken" debugger in EclipseME?
|eclipse|eclipseme|java-me|debugging|
How do I fix a broken debugger, one that just won't start, in EclipseME? (This question has an answer which will be transferred from another question soon)
|c++|python|boost|
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project. Building the boost librari...
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project. Building the boost librari...
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project. Building the boost librari...
One of the best resources I know on the subject is the "threading in C#" book: [http://www.albahari.com/threading/][1] [1]: http://www.albahari.com/threading/ I has a great overview of all a .net developer need to understand in order to program multi threaded applications.
[Be Powerful and Simple](http://msdn.microsoft.com/en-us/library/aa511332.aspx) Oh, and hire a designer / learn design skills. :)
I have used WebRequest for interacting with websites. It is the right 'tool' I can't comment on the JSON aspect of your question.
Or graph a moving average of prices instead of the actual prices.
This is as it should be. If your burndown chart looks like the model chart, you're in trouble. The chart will help to see if you will be able to make you commitment and finish all the stories. Discovering stories during the sprint will always happen. Ideally you would be able to design and find out the tasks up fron...
Quoting from [here][1]: *Statisticians have devised several methods for detecting outliers. All the methods first quantify how far the outlier is from the other values. This can be the difference between the outlier and the mean of all points, the difference between the outlier and the mean of the remaining values, ...
in 3.5 there is a built-in jsonserializer. The webrequest is the right class your looking for. A few examples http://geekswithblogs.net/JuanDoNeblo/archive/2007/10/24/json_in_aspnetajax_part2.aspx http://dev.aol.com/blog/markdeveloper/ShareFileWithNETFramework http://geekswithblogs.net/JuanDoNeblo/archive/2007/10...
in perl: `$0`
in perl: `$0` As a matter of fact, this will work with any shell that supports the `cmd` syntax and stores its own name in $0