instruction
stringlengths
0
30k
Get Home Premium unless you need to connect to a domain controller (if you don't know what that is, you don't need it).
I did pretty much exactly what you want to do a few years ago. Im trying to find some code for it, though it was at a previous job so that code is at home. I do remember though i used [this article][1] as my starting point. You set up the LDAP provider so you can actually run a check of the user vs the LDAP. One thi...
This is a harder problem than it might at first appear, since you need to consider comment tokens inside strings, comment tokens that are themselves commented out etc. I wrote a string and comment parser for C#, let me see if I can dig out something that will help... I'll update if I find anything.
This is a harder problem than it might at first appear, since you need to consider comment tokens inside strings, comment tokens that are themselves commented out etc. I wrote a string and comment parser for C#, let me see if I can dig out something that will help... I'll update if I find anything. EDIT: ... o...
This is called a [Reservoir Sampling][1] problem. The simple solution is to assign a random number to each element of the list as you see it, then keep the top (or bottom) k elements as ordered by the random number. [1]: http://gregable.com/2007/10/reservoir-sampling.html
You could do it yourself. Some MMS companies just have a SOAP API that you can call. All you need to do is construct the XML and send it off via a URL. I have done this once before, but can't remember the name of the company I used.
You should take a look at the UNPIVOT clause.
You should take a look at the UNPIVOT clause. **Update**: GateKiller, strangely enough I read an article (about something unrelated) about it this morning and I'm trying to jog my memory where I saw it again, had some decent looking examples too. It'll come back to me I'm sure.
You should take a look at the UNPIVOT clause. **Update1**: GateKiller, strangely enough I read an article (about something unrelated) about it this morning and I'm trying to jog my memory where I saw it again, had some decent looking examples too. It'll come back to me I'm sure. **Update2**: Found it: [http://web...
There are <a href="http://validator.w3.org/docs/why.html">many reasons</a> to use valid markup. My favorite is that it allows you to use validation as a form of regression testing, preventing the markup equivalent of "delta rot" from leading to real rendering problems once the errors reach some critical mass. And rea...
There are <a href="http://validator.w3.org/docs/why.html">many reasons</a> to use valid markup. My favorite is that it allows you to use validation as a form of regression testing, preventing the markup equivalent of "delta rot" from leading to real rendering problems once the errors reach some critical mass. And rea...
Naming conventions allow the development team to design discovereability and maintainability at the heart of the project. A good naming convention takes time to evolve but once it’s in place it allows the team to move forward with a common language. A good naming convention grows organically with the project. A goo...
Naming conventions allow the development team to design discovereability and maintainability at the heart of the project. A good naming convention takes time to evolve but once it’s in place it allows the team to move forward with a common language. A good naming convention grows organically with the project. A goo...
Naming conventions allow the development team to design discovereability and maintainability at the heart of the project. A good naming convention takes time to evolve but once it’s in place it allows the team to move forward with a common language. A good naming convention grows organically with the project. A goo...
(This isn't really iPhone specific - the same thing will happen in regular Cocoa). NSUnknownKeyException is a common error when using [Key-Value Coding][1] to access a key that the object doesn't have. The properties of most Cocoa objects can be accessing directly: [@"hello world" length] // Objective-C...
I'm not sure if you are asking only about .NET or other frameworks, my experience is mostly with Java but I'm sure similar tools exist for .NET. On the level of classes you can get an auto-generated visualization using UML tools that can typically reverse engineer source code into a diagram. [Netbeans][1] is free a...
I agree that the sub-domain idea is the best, but if for some reason it doesn't work for you you could also have the php page at /test proxy requests to a URL at the dotted quad machine (using fopen to access the dotted quad URL).
Thanks, *IainMH*, *Till*. I'm without a formal computer science qualification and find large blanks in my knowledge. Over the past couple of years I've gone surprisingly far, though knowing the underlining foundation of projects I've created pollute their efficiency and success. Being a bit of a perfectionist doesn...
Oh, bummer. I just saw, you select AS FOO. Don't you need a HAVING claus in this case? SELECT whatever AS value FROM table HAVING value > 1; I still would not use "value". But to be sure, look it up in your docs!
Windows packet sniffer that can capture loopback traffic?
|.net|windows|networking|remoting|
(This is a followup to my [previous question][1] about measuring .NET remoting traffic.) When I am testing our Windows service / service controller GUI combination, it is often most convenient to run both pieces on my development box. With this setup, the remoting traffic between the two is via loopback, not through...
|web-application|
|web-applications|
Get the DefaultView DataRowView from a DataRow
|wpf|dataset|binding|datarowview|defaultview|
Here's the situation: I need to bind a WPF FixedPage against a DataRow. Bindings don't work against DataRows; they work against DataRowViews. I need to do this in the most generic way possible, as I know nothing about and have no control over what is in the DataRow. What I need is to be able to get a DataRowVie...
|wpf|dataset|binding|datarowview|defaultview|
Developing and Testing a Facebook application
|facebook|webapp|testing|
Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website. With a Facebook application things are a bit tricky. As you can't view a Facebook application through a normal we...
|testing|web-application|facebook|
|testing|web-applications|facebook|
Tips for database design in a web application
|database-design|web-application|
Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, the application is a strategy game (browser based, just text)...
Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, the application is a strategy game (browser based, just text)...
You can also check out [Sync Services for Sql Server and Compact edition][1]. The benefit of Sync Services is that you don't need a replication server or IIS and you can also sync between compact edition databases. This method involves writing a fair bit more code and is fairly involved, but I'd recommend looking into ...
I recommend checking out Microsoft's SQL Server sample databases: <http://codeplex.com/SqlServerSamples> The AdventureWorks sample uses a very clear and consistent naming convention that uses schema names for the organization of database objects. 1. Singular names for tables 2. Singular names for columns 3. Sc...
What are the options for delivering Flash video?
|flash|video|
I'd like a concise introduction to the different options.
Something like this? dim cars(2) cars(0)="Volvo" cars(1)="Saab" cars(2)="BMW" For Each x in cars document.write(x & "<br />") Next See [www.w3schools.com][2]. If you want to associate keys and values [use a dictionary object][1] instead: Dim objDictionary S...
Something like this? dim cars(2),x cars(0)="Volvo" cars(1)="Saab" cars(2)="BMW" For Each x in cars response.write(x & "<br />") Next See [www.w3schools.com][2]. If you want to associate keys and values [use a dictionary object][1] instead: Dim objDictionary ...
How to display unicode text in OpenGL?
|windows|unicode|opengl|
Is there a good way for displaying unicode text in opengl under Windows? For example, when you have to deal with different languages. The most common approach like #define FONTLISTRANGE 128 GLuint list; list = glGenLists(FONTLISTRANGE); wglUseFontBitmapsW(hDC, 0, FONTLISTRANGE, list); just won'...
Ends up this resolved my issue: SearchButton.UseSubmitBehavior = False
There are <a href="http://validator.w3.org/docs/why.html">many reasons</a> to use valid markup. My favorite is that it allows you to use validation as a form of regression testing, preventing the markup equivalent of "delta rot" from leading to real rendering problems once the errors reach some critical mass. And rea...
I've worked on a SAN system in the past with telephony audio recordings which had issues with numbers of files in a single folder - that system became unusable somewhere near 5,000 (on Windows 2000 Advanced Server with an application in C#.Net 1.1)- the only sensible solution that we came up with was to change the fold...
I don't believe there is any easy way to make a Windows Installer project have the ease or upgradability of ClickOnce. I use ClickOnce for all the internal .NET apps I develop (with the exception of Console Apps). I find that in an enterprise environment, the ease of deployment outweighs the lack of flexibility.
> **[Brian Deacon][1]** wrote: > > Dvorak is so... Spolsky. I can't describe why, but I agree. [1]: http://stackoverflow.com/users/409/brian-deacon
Nope. The reason ActiveX can do it is because ActiveX is a little application that runs on the client's machine. I would imagine access to such information via JavaScript would be a security vulnerability.
Have you seen WiX yet? <http://wix.sourceforge.net/> It builds windows installers using an XML file and has additional libraries to use if you want to fancify your installers and the like. I'll admit the learning curve for me was medium-high in getting things started, but afterwards I was able to build a second i...
Code completion for Perl in vim?
|perl|vim|vi|
Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions. Is there any way to enable code completion for Perl in vim?
If you're in a posix shell environment (I'm really thinking of bash), you can redirect any file descriptor to any other file descriptor, so to redirect, you can just: $ myprogram 2>&5 to redirect stderr to the file represented by fd=5. Edit: on second thought, I like @Konrad Rudolph's answer about redirec...
If you're in a posix shell environment (I'm really thinking of bash), you can redirect any file descriptor to any other file descriptor, so to redirect, you can just: $ myprogram 2>&5 to redirect stderr to the file represented by fd=5. Edit: on second thought, I like @Konrad Rudolph's answer about redirec...
Does it need to be formatted nicely, or will an automated system pick up the mail message on the other end? If the latter, just use the datatable's .WriteXml() method.
In theory, yes, I can single out a script tag that way. The problem is that we potentially have dozens of situations where this occurs, so I am trying to find some cause or documentation of this behavior. Also, the `script` tag does not seem to be a part of the DOM anymore after it gets loaded. In our environment, m...
View TFS checkin history across branches?
|tfs|merge|branch|
In TFS when you merge branch A to branch B and checkin, you get a single changeset on B (typically with a comment like "merged A->B"). This means B doesn't have any of the checkin history from A. So if someone created a new file on branch A, you can't tell who created it from branch B. And if someone updated a f...
In TFS when you merge branch A to branch B and checkin, you get a single changeset on B (typically with a comment like "merged A->B"). This means B doesn't have any of the checkin history from A. So if someone created a new file on branch A, you can't tell who created it from branch B. And if someone updated a f...
How do I specify multiple constraints on a generic type in C#?
|c#|.net|oop|
What is the syntax for placing constraints on multiple types? The basic example: class Animal<SpeciesType> where SpeciesType : Species I would like to place constraints on both types in the following definition such that SpeciesType must inherit from Species and OrderType must inherit from Order: clas...
I'm not sure if it can or not, but have you looked at [Microsoft Network Monitor][1]? It *might* be an option. [1]: http://www.microsoft.com/downloads/details.aspx?familyid=18b1d59d-f4d8-4213-8d17-2f6dde7d7aac&displaylang=en
This should work: SELECT A.Value FROM ( SELECT "Ugly OLAP name" as "Value" FROM OpenQuery( OLAP, 'OLAP Query') ) AS a WHERE a.Value > 0 It's not that Value is a reserved word, the problem is that it's a column alias, not the column name. By making it an inline view, "Value" becomes ...
Delete all but top n from database table in SQL
|sql|
What's the best way to delete all rows from a table in sql but to keep n number of rows on the top?
I don't know about other flavors but MySQL [DELETE](http://dev.mysql.com/doc/refman/5.0/en/delete.html) allows LIMIT. If you could order things so that the n rows you want to keep are at the bottom, then you could do a DELETE FROM table LIMIT tablecount-n. **Edit** Oooo. I think I like [Cory Foy's](http://sta...
One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values. Functional programming involves writing code that does not change state. The primary reason for doing so is so that successive calls to...
I think that it sounds like this could be done using [SSIS packages][1]. They're similar to SQL 2000's DTS packages. I've used them to successfully transform everything from plain text CSV files, from existing SQL tables, and even from XLS files with 6-digit rows spanned across multiple worksheets. You could use C# to ...
If your code uses lot of functions that operate on those attributes (name/height/weight), then using class could be a good option.
If you're using a language with first-class functions like Scheme, you can add memoization without changing the initial algorithm: (define (memoize fn) (letrec ((get (lambda (query) '(#f))) (set (lambda (query value) (let ((old-get get)) (set...
If you're using a language with first-class functions like Scheme, you can add memoization without changing the initial algorithm: (define (memoize fn) (letrec ((get (lambda (query) '(#f))) (set (lambda (query value) (let ((old-get get)) (set...
|web-applications|database-design|
If you are talking about Windows Forms, this article should help you build you tri-state TreeView: <http://www.codeproject.com/KB/tree/treeviewex2003.aspx?display=Print>
If you are talking about Windows Forms, this article should help you build you tri-state TreeView: <http://www.codeproject.com/KB/tree/treeviewex2003.aspx?display=Print> If you need tri-state checkboxes on a treeview on asp.net i think you need to use a third-party component. Take a look a this one, and click "tr...
Large Python Includes
|python|
I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements. Is there some way to group together several files and include all at once?
If you ever receive values at the maximum or minimum, then you are, by definition, clipping. Those values represent their particular value as well as all values beyond, and so they are best used as outside bounds detectors. -Adam
Readability always wins. Always. Except when it doesn't. And that should be very rarely.
Ask yourself the following question: *why do you want to store credit card numbers in the first place*? Chances are that you don't. In fact, if you *do* store them and manage to have one stolen, you could be looking at some serious liability. I've written an app that does store credit card numbers (since the transac...
Ask yourself the following question: *why do you want to store credit card numbers on a publicly accessible webserver in the first place*? Trust me, you don't. Even if you think you do, you don't. That's what [accounting software][1] is for. Furthermore, you're looking at some serious liability if your webserver ever g...
When the separator String for the command is allways the same String or char (like the ";") y recomend you use the StrinkTokenizer class: [StringTokenizer][1] but when the separator varies or is complex y recomend you to use the regular expresions, wich can be used by the String class itself, method split, sinc...
None. .NET relies on underlying Windows API calls that really, really hate that amount of files themselves. As Ronnie says: split them up.
If I understand your question, you want to affect what columns are returned first, second, third, etc in **existing** queries, right? If all of your queries are written with SELECT * FROM TABLE - then they will show up in the output as they are layed out in SQL. If your queries are written with SELECT Field1, Field...
Select Table_Name From Information_Schema.Columns Where Column_Name = 'YourFieldName'
I'm old-school: select distinct object_name(id) from syscolumns where name = 'FIELDNAME'
The following query will bring back a unique list of Tables where Column_Name is equal to the column you are looking for: Select Table_Name From INFORMATION_SCHEMA.COLUMNS Where Column_Name = 'Desired_Column_Name' Group By Table_Name
Depending on the issue I like a combination of error_reporting(E_ALL) mixed with echo tests (to find the offending line/file the error happened in initally; you KNOW it's not always the line/file php tells you right?), IDE brace matching (to resolve "Parse error: syntax error, unexpected $end" issues), and print_r(); e...
ClickOnce can be problematic if you have 3rd party components that need to be installed along with your product. You can skirt this to some extent by creating installers for the components however with ClickOnce deployment you have to create the logic to update said component installers. I've in a previous life used...
Go to [http://www.fogbugz.com/][1] then at the bottom under "Try It", sign up. under Settings => Your FogBugz Hosted Account, it should either already say "Payment Information: Using Student and Startup Edition." or there should be some option/link to turn on the Student and Startup Edition. And yes, it's not onl...
As mentioned d will be `IEnumerable<MyProduct>` while f is `List<MyProduct>` The conversion is done by the C# compiler var d = from mp in MyProducts where mp.Price < 50d select mp; Is converted to (before compilation to IL and with generics expanded): var d = My...
1. Definitely keep table names singular, person not people 2. Same here 3. No. I've seen some terrible prefixes, going so far as to state what were dealing with is a table (tbl_) or a user store procedure (usp_). This followed by the database name... Don't do it! 4. Yes. I tend to UpperCamelCase all my table nam...