instruction stringlengths 0 30k ⌀ |
|---|
@Jon Limjap: Unfortunately, this tells you the .NET CLR (runtime library) version, *not* the version of the .NET Framework. These two version numbers are not always the same; in particular, the .NET Framework 3.0 and 3.5 both use the .NET CLR 2.0. So the OP may indeed have only .NET 2.0 SP1, as the Environment.Versio... |
What does the generated Javascript look like?
Sounds (at first glance) like it's not being escaped. |
What steps can I give a windows user to make a given file writeable |
|windows|filesystems| |
Imagine we have a program trying to write to a particular file, but failing.
On the Windows platform, what are the possible things which might be causing the file to be un-writable, and what steps could be suggested to an end user/administrator to fix it. |
|windows|filesystems| |
Imagine we have a program trying to write to a particular file, but failing.
On the Windows platform, what are the possible things which might be causing the file to be un-writable, and what steps could be suggested to an end user/administrator to fix it.
----------
Please include steps which might require... |
For this to work, you'd have to detail how you would want to find all cycles, apparently without any iterative constructs, because that is a non-trivial task. I'm not sure that's possible. If you really want to find a MST algorithm that doesn't use iterative constructs, take a look at [Prim's][1] or [Kruskal's][2] al... |
I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references.
I've looked a... |
Good Featurs for an ORM |
|c#|orm| |
I'm currently working on putting together a fairly simple ORM tool to serve as a framework for various web projects for a client. Most of the projects are internal and will not require massive amounts of concurrency and all will go against SQL Server. I've suggested that they go with ORM tools like SubSonic, NHiberna... |
Good Features for an ORM |
TFS is great, if you don't need non-developers, to get to pm stuff.
Our helpdesk needs to be involved in the process, and it just wasn't cutting it.
Also the build management in tfs 2005 at least, is attrotious, and it can't even build vs 2008 slns. I really don't like that my source control choice, affects my de... |
If it's short, I think you're better off re-writing the code in java. Downloading one 50Mb runtime is bad enough. |
Take a look at [Sourcegear DiffMerge][1]. DiffMerge is the compare and merge tool from their Vault and Fortress products, but they make it available for free as a standalone tool.
[1]: http://www.sourcegear.com/diffmerge/ |
I would rewrite it if it's not too much trouble.
The web service would work, but it seems like that would be a lot of overhead just to reuse a little code.
|
[Araxis Merge][1] is expensive, but great. Handles 3 way merges on files or folders really well. I find the way it displays diffs much more helpful than Windiff or P4's tool.
[1]: http://www.araxis.com/merge/index.html |
Another way to do it is to use `urllib2` module to parse some other page's whois service (many sites like that exist). But that seems like even more of a hack that what you do now, and would give you a dependency on whatever whois site you chose, which is bad.
I hate to say it, but unless you want to re-implement `... |
How do I add existing comments to RDoc in Ruby? |
|ruby| |
I've got all these comments that I want to make into 'RDoc comments' so they can be formatted appropriately and viewed using 'Ri.' Can anyone get me started on understanding how to use RDoc? |
|ruby|rdoc| |
What extra bits? They are going from 6 to 4.
EDIT: Whoops! I'm an idiot. This is kinda like a 2nd grade multiplication table. They strip the outer bits off of the 6-bit block to be encypted, and leave the middle 4. Just like a table for an arithmatic operation, they go down one side, and find the outer bit seque... |
What extra bits? They are going from 6 to 4.
EDIT: Whoops! I'm an idiot. This is kinda like a 2nd grade multiplication table. They strip the outer bits off of the 6-bit block to be encypted, and leave the middle 4. Just like a table for an arithmatic operation, they go down one side, and find the outer bit seque... |
The reference you have listed for Ruby is for Ruby on Rails. While still ruby deep down, it is definitely not a place to start for people wanting to learn Ruby.
For Ruby tutorials, I would suggest [Why's (Poignant) Guide to Ruby][1] as a great starting point for anyone interested in the language.
If you would w... |
Try using a hash, n is the key and its corresponding Fibonacci number is the value. |
Try using a map, n is the key and its corresponding Fibonacci number is the value.
@Paul
Thanks for the info. I didn't know that. From the [Wikipedia link][1] you mentioned:
> This technique of saving values that
> have already been calculated is called
> memoization
[1]: http://en.wikipedia.org/w... |
Try using a map, n is the key and its corresponding Fibonacci number is the value.
@Paul
Thanks for the info. I didn't know that. From the [Wikipedia link][1] you mentioned:
> This technique of saving values that
> have already been calculated is called
> memoization
Yeah I already looked at the code ... |
Setting Attributes in Webby Layouts |
|ruby|webby| |
I'm working with [Webby][1] and am looking for some clarification. Can I define attributes like `title` or `author` in my layout?
[1]: http://webby.rubyforge.org "Webby" |
I uploaded it and got an internal error
Premature end of script headers
After much playing around, I found that if I had
import cgi
import cgitb; cgitb.enable()
import MySQLdb
It would give me a much more useful answer and say that it was not installed, you can see it yourself -> [http://w... |
I uploaded it and got an internal error
Premature end of script headers
After much playing around, I found that if I had
import cgi
import cgitb; cgitb.enable()
import MySQLdb
It would give me a much more useful answer and say that it was not installed, you can see it yourself -> [http://w... |
It is possible to skip the step of creating the empty database. You can create the new database as part of the restore process.
This is actually the easiest and best way I know of to clone a database. You can eliminate errors by scripting the backup and restore process rather than running it through the SQL Server M... |
MySQLdb is what I have used before.
If you host is using Python version 2.5 or higher, support for sqlite3 databases is built in (sqlite allows you to have a relational database that is simply a file in your filesystem). But buyer beware, sqlite is not suited for production, so it may depend what you are trying to ... |
@ Mark Harrison : SQL Server does not support that syntax (SELECT ... FOR UPDATE). The SQL Server equivalent is the SELECT statement hint UPDLOCK. See [SQL Server Books Online](http://msdn.microsoft.com/en-us/library/ms187373.aspx) for more information. |
You can not do this programatically (in a safe way that is) without creating a new table.
What Enterprise Manager does when you commit a reordering is to create a new table, move the data and then delete the old table and rename the new table to the existing name.
If you want your columns in a particular order (... |
You can not do this programatically (in a safe way that is) without creating a new table.
What Enterprise Manager does when you commit a reordering is to create a new table, move the data and then delete the old table and rename the new table to the existing name.
If you want your columns in a particular ord... |
What can I do to resolve a "Row not found or changed" Exception in LINQ to SQL on a SQL Server Compact Edition Database? |
|linq-to-sql| |
|.net|linq|linq-to-sql| |
When executing SubmitChanges to the DataContext after updating a couple properties with a LINQ to SQL connection (against SQL Server Compact Edition) I get a "Row not found or changed." ChangeConflictException.
var ctx = new Data.MobileServerDataDataContext(Common.DatabasePath);
var deviceSe... |
The documentation on [IDisposable][1] gives a pretty clear and detailed explaination of the behavior, as well as example code. The GC will NOT call the `Dispose()` method on the interface, but it will call the finalizer for your object.
[1]: http://msdn.microsoft.com/en-us/library/system.idisposable.aspx |
How do I suppress firefox password field completion? |
|html|firefox| |
I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to... |
I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to... |
How do I get list of recent files in GNU Emacs? |
|ide|emacs| |
When I use Emacs I want to be able to easily display and navigate through a list of files I worked on from not just the current session but from previous sessions. (BTW, running Emacs 22.2 on Windows) |
The CLR has a 'profiling API' that hooks into pretty much everything - it is what the commercial .NET memory profiling products use, I believe. Here is an MSDN link to the top level of the documentation: [.NET Framework General Reference: About the Profiling API][1]
See this MSDN magazine article for an introduction... |
I had to import `scala.collection.mutable.Set`. It seems the compiler thought the Set in `HashMap[Integer, Set[TreeNode]]` was `scala.collection.Set`. The Set in the MultiMap def is `scala.collection.`**`mutable`**`.Set`. |
The problem here is that you've accepted the burden of proof. You're unlikely to change someone's mind like that. Like it or not, people--even programmers-- are just too emotional to be easily swayed by logic. You need to put the burden of proof back on him- get him to convince you otherwise- and that will force him... |
The problem here is that you've accepted the burden of proof. You're unlikely to change someone's mind like that. Like it or not, people--even programmers-- are just too emotional to be easily swayed by logic. You need to put the burden of proof back on him- get him to convince you otherwise- and that will force him... |
(C) How do I determine the size of my array? |
|c|memory| |
i.e., the number of elements the array can hold? |
executive summary:
int a[17];
n = sizeof(a)/sizeof(a[0]);
To determine the size of your array in bytes, you can use the sizeof
operator:
int a[17];
int n = sizeof(a);
On my computer, ints are 4 bytes long, so n is 68.
To determine the number of elements in the array, we can divide
the... |
sizeof(array) / sizeof(array[0]) |
By taking a C string, the fstream class reduces dependency on the `std::string` class. Now, you may wonder then why isn't there a transparent conversion from a `std:string` to a C string, so a class that expects a C string could still take a `std::string` just like a class that expects a `std::string` can take a C str... |
> Is there a way to determine at what
> point I would encounter a stack
> overflow?
Depends how deep you go, and how large the actual recursion is. I take it you understand what recursion does? |
@John (37479):
Very close, but then I lose everything from ClassX. Below is something a collegue gave me that does do the trick, but it's hideous. There has to be a better way.
import cgi
from math import sqrt
class ClassX(object):
def __repr__(self):
return "Best Guess"
... |
Is solving the halting problem easier than people think? |
|computability|language-agnostic|types|inference| |
Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.
In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.
I also have se... |
|language-agnostic|types|computability|inference| |
Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.
In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.
I also have se... |
I'm an idiot. I forgot the whole "a function can't own another function" thing, so I figured out another way to do it. Thanks! |
How do you give a C# Auto-Property a default value? |
|c#| |
How do you give a C# Auto-Property a default value? I either use the constructor, or revert to the old syntax.
<strong> Using the Constructor:</strong>
class Person
{
public Person()
{
Name = "Default Name";
}
public string Name { get; set; }
}
<s... |
Well, of course you could always implement the spec yourself. It's just that there's nothing built-in to support it. If you use Nathan Lee's solution, do it as an http handler (.ashx) rather than an aspx. You can just about copy/paste his code into a new handler file. |
We're in a very similar situation at the moment. Dozens of crystal reports in place and we're shifting to Reporting Services (mainly for its ease of deployment and more flexible UI for the end user) - our solution is to leave them be, but anything new is being created in RptgSvcs. Ideally we'd translate them, but the .... |
I would forget about server side caching in this instance and rely on the simplicity of client side caching.
Your Javascript code could be client side cached just as easily as HTML, either by linking to an external javascript file and adding the necessary headers/expiries, or by embedding the script within the page ... |
@Dana & @John
Actually, `svn log -v -r <#> http://my.svn.server/repository-root` will work and show you all modified files within this repository. Or if you wanted this to work from within a working copy, you could use the output of `svn info | grep Repository Root` or something to find the actual repository root.
... |
Many times the caller wants access just to iterate over the collection. Take a page out of Ruby's book and make the iteration a private aspect of your class.
#include <algorithm>
#include <boost/function.hpp>
class Blah
{
public:
void for_each_data(boost::function1<void, co... |
No idea on the cause, but I just reconstructed my .dbml from scratch and it fixed itself.
Oh for a "refresh" feature... |
[@Ethan](http://stackoverflow.com/questions/42966/google-suggestish-text-box#45014)
I forgot about the fact that you would want to save that so it wasn't a per session only thing :P But yes, you are completely correct.
This is easily done, especially since it's just basic strings, just write out the contents of A... |
From an object-oriented perspective, sealing a class clearly documents the author's intent without the need for comments. When I seal a class I am trying to say that this class was designed to encapsulate some specific piece of knowledge or some specific service. It was not meant to be enhanced or subclassed further.... |
I can't speak to anything other than SQL Server, but the performance argument is **not** significantly valid there unless you're on 6.5 or earlier. SQL Server has been caching ad-hoc execution plans for roughly a decade now. |
It is the way s-boxes work. They can be m * n ==> m bit input , n bit output.
For example, in the [AES][1] S-box the number of bits in input is equal to the number of bits in output.
In [DES][2], m=6 and n=4.
The input is expanded from 32 to 48 bits in the first stages of DES. So it is be reduced to 32 bits ag... |
It is the way s-boxes work. They can be m * n ==> m bit input , n bit output.
For example, in the [AES][1] S-box the number of bits in input is equal to the number of bits in output.
In [DES][2], m=6 and n=4.
The input is expanded from 32 to 48 bits in the first stages of DES. So it is be reduced to 32 bits ag... |
I'm looking for a Windows hosting provider that supports custom os images (like AMZN EC2) |
|windows2003server|hosting|virtual|cloud|amazon-ec2| |
I've come to love [Amazon's EC2 service][1] and I'm looking for something similar that supports the ability to save a running Windows server image and start new instances from it.
I contacted [GoGrid][2] (the feature is planned in future) and [Mosso][3] (no joy)
Anyone know of any hosting/cloud providers that can... |
|hosting|windows-server-2003|cloud|amazon-ec2|virtual| |
how to allow files starting with period and no extension in windows 2003 server? |
|mercurial|windows2003server| |
How can I create this file in a directory in windows 2003 SP2:
.hgignore
I get error: You must type a file name.
|
|windows-server-2003|mercurial| |
Personally, I try to always use *this* when referring to member variables. It helps clarify the code and make it more readable. Even if there is no ambiguity, someone reading through my code for the first time doesn't know that, but if they see *this* used consistently, they will know if they are looking at a member ... |
Your SEO guru is slightly off the mark, but I understand the concern. This has nothing to do with whether or not the practice is proper, or whether or not a certain number of script tags is looked upon poorly by Google, but everything to do with page weight. Google stops caching after (I think) 150KB. The more inline s... |
I've spent some time working on search engines (not Google), but have never really done much from an SEO perspective.
Anyway, here are some factors which Google could reasonably use to penalise the page which should be increased by including big blocks of javascript inline.
- Overall page size.
- Page downlo... |
I have tested many ways to remove the load of view state from the page and between all hacks and some software out there the only thing that it is truly scalable is the [StrangeLoops As10000 appliance][1]. Transparent, no need to change the underlying application.
[1]: http://www.strangeloopnetworks.com/products... |
Is there a .NET Control Similar to the Access 2007 Split Form? |
|.net|ms-access| |
Is there a .NET Control Similar to the Access 2007 Split Form?
Or has anyone built such a control?
I upgraded a small personal Name and Address DB to Access 2007 and noticed the Form had a property called “Default View” which can be set to “Split Form”. “Split Form” mode has a GridView and a Form together in one ... |
Do you have access to any programmable hardware on the embedded device? Like counters and such? If so, you might be able to write a hardware based mod unit, instead of using the simulated %. (I did that once in VHDL. Not sure if I still have the code though.)
Mind you, you did say that division was 5-10 times faster... |
Do you have access to any programmable hardware on the embedded device? Like counters and such? If so, you might be able to write a hardware based mod unit, instead of using the simulated %. (I did that once in VHDL. Not sure if I still have the code though.)
Mind you, you did say that division was 5-10 times faster... |