instruction stringlengths 0 30k ⌀ |
|---|
It's really late, and I only spent about 10 minutes on this, so its extremely sloppy, however it does work and will give you a good jumping off point:
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace TableGenerator
{
cla... |
Also... maybe you can use some tool such as Visio (not sure if Visio does this, but I think it does) to reverse engineer your classes into UML and then use the UML to generate the DB Schema... or maybe use a tool such as this <http://www.tangiblearchitect.net/visual-studio/> |
Sparc, MIPS, Alpha, and most other "classical RISC" architectures only allow aligned accesses to memory, even today. An unaligned access will cause an exception, but some operating systems will handle the exception by copying from the desired address in software using smaller loads and stores. The application code won'... |
Well, a little googling found this:
> The presentation framework includes a
> custom Web handler built in ASP.NET.
> Pages that use the presentation
> framework have the .mspx filename
> extension, which is registered in
> Microsoft Internet Information
> Services (IIS) on the Web servers.
> When one of the M... |
Well, a little googling found this:
> The presentation framework includes a
> custom Web handler built in ASP.NET.
> Pages that use the presentation
> framework have the .mspx filename
> extension, which is registered in
> Microsoft Internet Information
> Services (IIS) on the Web servers.
> When one of the M... |
On the [webdriver homepage](http://code.google.com/p/webdriver/wiki/GettingStarted) one can read
- Add $WEBDRIVER_HOME/common/build/webdriver-common.jar to the CLASSPATH
- Add $WEBDRIVER_HOME/htmlunit/build/webdriver-htmlunit.jar to the CLASSPATH
- Add all the Jar files under $WEBDRIVER_HOME/htmlunit/lib/runtim... |
Recursion is more costly in memory, as each recursive call generally requires a memory address to be pushed to the stack - so that later the program could return to that point.
Still, there are many cases in which recursion is a lot more natural and readable than loops - like when working with trees. In these cases... |
perl or Perl is fine. |
By default Microsoft's Visual SourceSafe does not include these files in the source control because they are user-specific settings files. I would follow that model if you're using SVN as source control. |
Here's what we do, although I should mention that we use a custom web browser to remove such things as the ability to right-click and see the good old IE context menu:
public class HtmlFormatter
{
/// <summary>
/// Indicator that this is a URI referencing the local
/// file path.
... |
.user is the user settings, and I think .suo is the solution user options. You don't want these files under source control; they will be re-created for each user. |
In General, this is not considered a safe thing to do unless your system provides for atomic operation (operations that are guaranteed to be executed in a single cycle).
The reason is that while the "C" statement looks simple, often there are a number of underlying assembly operations taking place.
Depending on you... |
Using Rational ClearCase the answer is no, only the .sln & .*proj should be registered in source code control, I can't answer for other vendors. If I recall correctly these files are "user" specific options, your environment. |
I have used [SVNBridge][1] with TortoiseSVN, which workes like a charm.
What I was looking for here is a way for anonymous access that is directly integrated with VS. Guess that's not possible at the moment.
[1]: http://www.codeplex.com/SvnBridge |
I have used [SVNBridge][1] with TortoiseSVN, which workes like a charm.
What I was looking for here is a way for anonymous access that is directly integrated with VS. Guess that's not possible at the moment.
Also just found out [you can connect directly][2] via TortoiseSVN, without SVNBridge. Look for the "SvnBri... |
The problem is your places the image inside of the content of the MenuHeader which means that you'll lose the accelerator key. If you're just trying to have an image in the menu header, do the following.
<MenuItem Header="_Open">
<MenuItem.Icon>
<Image Source="images/Open.png"/>
</MenuItem... |
The problem is you placed the image inside of the content of the MenuHeader which means that you'll lose the accelerator key. If you're just trying to have an image in the menu header, do the following.
<MenuItem Header="_Open">
<MenuItem.Icon>
<Image Source="images/Open.png"/>
</MenuItem.... |
If you're in the .NET space, Developer Express' [CodeRush][1] provides LOC, Cyclomatic Complexity and the (rather excellent, IMHO) [Maintenance Complexity][2] analysis of code in real-time.
(Sorry about the Maintenance Complexity link; it's going to Google's cache. The original seems to be offline ATM).
[1]: ... |
As the person primarily responsible for making anonymous access work against the TFS CodePlex servers, I can tell you that it isn't possible with Team Explorer. We tried to make it happen, but the way you get anonymous to work would've caused a pretty stellar-sized security hole with Team Explorer.
So, as others hav... |
|sql-server-2005|asp.net|database-connection| |
*An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*
Hell... |
|asp.net|database-connection|sql-server-2005| |
*An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*
Hell... |
|asp.net|sql-server-2005|database-connection| |
*An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*
Hell... |
Well, a little googling found this:
> The presentation framework includes a
> custom Web handler built in ASP.NET.
> Pages that use the presentation
> framework have the .mspx filename
> extension, which is registered in
> Microsoft Internet Information
> Services (IIS) on the Web servers.
> When one of the M... |
Note that even on IA-32 and the AMD64, some of the SSE instructions/intrinsics require aligned data. These instructions will throw an exception if the data is unaligned, so at least you won't have to debug "wrong data" bugs. There are equivalent unaligned instructions as well, but like Denton says, they're are slower.
... |
Along the lines of what I mentioned [in this post][1]; I recommend you use the [SIGAR API][2] ( I am not associated with it/them in any way - but, I use the SIGAR API in one of my own applications and it is great). You'll find it is stable, well supported, and full of useful examples. It is open-source with a GPL2 lic... |
Have you tried implementing [INotifyPropertyChanged][1]?
[1]: http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx |
Thanks to all for your help - I was off this issue for a couple of days and just came back to it - was able to cobble this together - not the most elegant code, but it works for my purposes - thought I'd share if anyone else encounters this issue:
public class Statistics
{
public Trendline Calculat... |
An option I haven't tried is the C++ based [Xapian][1]
[1]: http://www.xapian.org/ |
Best server-side framework for heavy AJAX Java application |
|java|ajax|web-applications|frameworks|dhtml| |
There are [zillions][1] of Java web application frameworks.
95% were designed before the modern era of AJAX/DHTML-based development, and that means these new methods are grafted on rather than designed in.
Has any framework been built from the ground up with e.g. [GWT + Extjs][2] in mind?
If not, which framewo... |
I recommend the approach of @Will and using the [Web Console of ActiveMQ](http://activemq.apache.org/web-console.html) which lets you post messages and browse queues or delete messages easily.
Another approach I often use is to use a directory of files as sample data and use a Camel route to move the messages from t... |
IANAL: There is no license. The original author (whoever it may be) retains copyright and all the rights associated with it, and has not granted any explicit license to anyone to do anything with their work. Please do check with an actual lawyer versed in copyright, though, since it seems like there should be a way to ... |
IANAL: There is no license. The original author (whoever it may be) retains copyright and all the rights associated with it, and has not granted any explicit license to anyone to do anything with their work. Please do check with an actual lawyer versed in copyright, though, since it seems like there should be a way to ... |
The IEEE 754 standard for floating point arithmetic makes a distinction between +0 and -0, this can be used when dealing with very small numbers rounded to zero where the sign still has an importance. |
**Assumptions**
The documentation for the Classic ASP system is rather light.
Management is not looking for a rewrite.
Since you have been doing ruby on rails, your (VB/C#) ASP.NET is passable at best.
**My experience**
I too inherited a classic ASP system that was slapped together willy-nilly by ex exce... |
In PHP is it possible to use a function inside a variable |
|php|html|function|variables| |
I know in php you can embed variables inside variables, like:
<? $var1 = "I\'m including {$var2} in this variable.."; ?>
But I was wondering how, and if it was possible to include a function inside a variable.
I know I could just write:
<?php
$var1 = "I\'m including ";
$var1 .= somefunc();... |
Thanks to all for your help - I was off this issue for a couple of days and just came back to it - was able to cobble this together - not the most elegant code, but it works for my purposes - thought I'd share if anyone else encounters this issue:
public class Statistics
{
public Trendline Calculat... |
The problem with a straight backup of the mysql database folder is that the backup will not necessarily be consistent, unless you do a write-lock during the backup.
I run a script that iterates through all of the databases, doing a mysqldump and gzip on each to a backup folder, and then backup that folder to tape.
... |
*An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*
Hell... |
*An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*
Hell... |
Since filled Datatables do not entertain a change in the schema a workaround can be applied as follows:
1. Make a new datatable
2. Use datatable's Clone method to
create the datatable with the same
structure and make changes to that
column
1. In the end use datatable's ImportR... |
What's the best way to pass data into a Flex chart from a Ruby on Rails application? |
|apache-flex|ruby|ruby-on-rails| |
There's at least three ways of passing data into a Flex binary from a Rails application. Right now, I'm using the old e4x resultFormat with a xml.erb template. I've done AMF before, but I feel like inlining parameters into the embed itself is a better solution because you don't have to wait for the browser to load a ... |
|ruby|ruby-on-rails|apache-flex| |
Quite a few methods exist for passing data into a Flex binary from a Rails application. Right now, I'm using the old e4x resultFormat with a xml.erb template. I've done AMF before, but I feel like inlining parameters into the embed itself is a better solution because you don't have to wait for the browser to load a s... |
I don't know of any native tool, but like Matt I am pretty happy with the web interface. |
@Codeslayer - That is not going to help. I'm trying to change the datatype inside of the DataSet designer before I compile my code. The dataset has not yet been filled since I'm not trying to make this change during runtime. I'm still at a loss as to why I'm getting the error message since the dataset has no data.
... |
You can use <code>get_absolute_url</code>, but that will only work for a particular object. Since your object hasn't been created yet, it won't work in this case.
You want to use [named URL patterns](http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns). Here's a quick intro:
Change the ... |
The preferred way of creating the URL is by adding a get_absolute_url method to your model classes. You can hardcode the path there so you at least get closer to following the KISS philosophy.
You can go further by utilizing the permalink decorator that figures the path based on the urls configuration.
You can re... |
I was also looking for a code metrics tool/plugin for my IDE but as far as I know there are none (for eclipse that is) that also show a graph of the complexity over a specified time period.
However, I did find the [eclipse metrics plugin][1], it can handle:
* McCabe's Cyclomatic Complexity
* Efferent Couplings... |
It's generally good to have the class as it's own instance and reduce tight coupling to something else (as in this case, it's parent). If you do something like parent.doSomething() it's not possible to use that class in container that doesn't have the doSometing() method. I think it's definitely better to pass in whate... |
For Python, [pylint](http://www.logilab.org/857) can provide some code quality metrics. |
Function calls within strings are supported since PHP5 by having a variable containing the name of the function to call:
<?
function somefunc($stuff)
{
$output = "<b>{$stuff}</b>";
return $output;
}
$somefunc='somefunc';
echo "foo {$somefunc("bar")} baz";
?>
wil... |
"bla bla bla".function("blub")." and on it goes" |
Do I really need to use transactions in stored procedures? [MSSQL 2005] |
|asp.net|sql|sql-server| |
I'm writing a pretty straightforward e-commerce app in asp.net, do i need to use transactions in my stored procedures? |
Im guessing that because when you publish, it is compiling your Web Site project and it is hitting a duplicate class name somewhere across different folders or sub folders. Make sure you check your inherit tags and class names so that you dont call 2 classes the same thing. This is fine and wont error when it happens i... |
To avoid excessive architecture astronomy, I often [use a hidden iframe to call the long running process and stream back progress information][1]. Coupled with something like [jsProgressBarHandler][2], you can pretty easily create great out-of-band progress indication for longer tasks where a generic progress animatio... |
To avoid excessive architecture astronomy, I often [use a hidden iframe to call the long running process and stream back progress information][1]. Coupled with something like [jsProgressBarHandler][2], you can pretty easily create great out-of-band progress indication for longer tasks where a generic progress animatio... |
Because a double can indeed have values -0, +0, -infinity, +infinity and NaN, which can be a result of various interesting expressions, like 0/0.
Look [here][1] for more information.
[1]: http://en.wikipedia.org/wiki/%E2%88%920_(number) |
Try Object.ReferenceEquals(foo1, null)
Anyway, I wouldn't recommend overloading the == operator; it should be used for comparing references, and use Equals for "semantic" comparisons. |
You could check the IsSpecialName property; it will be true for property getters and setters. However, it will also be true for other special methods, like operator overloads. |
You know - You asked this exact same question yesterday.
http://stackoverflow.com/questions/64723/what-is-a-good-non-recursive-algorithm-for-deciding-whether-a-passed-in-amount
I'm guessing that the answers you got (Including several lines of pCode written by myself) aren't good enough for you. You should stop w... |
You know - You asked this exact same question twice now.
http://stackoverflow.com/questions/64723/what-is-a-good-non-recursive-algorithm-for-deciding-whether-a-passed-in-amount
|
What is the dual table in Oracle? |
|oracle-database| |
I heard people reffering to this table and was not sure what is was about. |
*An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*
Hell... |
I know that models indicated in the question are used in production systems all over. A rather large one is in use at a large university/teaching institution that I work for. They specifically use the long narrow table approach to map data gathered by many varied data acquisition systems.
Also, Google recently rele... |
The preferred way of creating the URL is by adding a <code>get_absolute_url</code> method to your model classes. You can hardcode the path there so you at least get closer to following the KISS philosophy.
You can go further by utilizing the <code>permalink</code> decorator that figures the path based on the urls co... |
- C++
- Java
- REALbasic
- Eiffel
- Sather
- Modula-3 |
[Deeno][1],
Enjoy:
var foos = new List<Foo> {
new Foo{Bar = 1,Lum = 1},
new Foo{Bar = 1,Lum = 2},
new Foo{Bar = 2,Lum = 3},
};
// Using language integrated queries:
var q = from foo in foos
group foo by foo.Bar into groupedFoos
let lums = fr... |
I use Netbeans Profiler:
![alt text][1]
Its free, has task based profiling, a heap walker, allows the insertion of profiling points, tracks memory usage and threading, but best of all it allows you to profile remote JVM's. You can even attach to ones which are already running.
Oh, and it works really well if ... |
In general you should define your threat model before worrying about more exotic attacks. In this case: are you worried that somebody shuts down the computer and does a forensic analysis of the harddrive? Application memory can also be swapped out, so the simple fact that *one* process has it in memory, makes it potent... |
1. Escape user provided content to avoid [XSS][1] attacks.
2. Using [paremeterised SQL][2] or stored procedures to avoid [SQL Injections][3] attacks.
3. Running the webserver as an unprivilaged account to minimise attackes on the OS.
4. Setting the webserver directories to an unprivilaged account, again, to minimise... |
The correct casing is "Perl" for the language and "perl" for the executable. Using "PERL" flags you as someone who isn't particularly familiar with the language or community. |
These files are user-specific options, which should be independent of the solution itself. Visual Studio will create new ones as necessary, so they do not need to be checked in to source control. Indeed, it would probably be better not to as this allows individual developers to customize their environment as they see... |
Something in this direction maybe:
struct Coor {
Coor(double x, double y, double z)
: X(x), Y(y), Z(z) {}
double X, Y, Z;
}
struct coords_thesame
{
bool operator()(const Coor& c1, const Coor& c2) const {
return c1.X == c2.X && c1.Y == c2.Y && c1.Z == c2... |
Have you tried reading the answers for [this question](http://stackoverflow.com/questions/66840/integration-of-javascript-and-jms) which links to the [ActiveMQ Ajax support](http://activemq.apache.org/ajax.html). Basically ActiveMQ has native support for Ajax so you can use its JavaScript library to directly subscribe ... |
Look at ESB Guidance (www.codeplex.com/esb) This package provides the functionality you are looking for |
Try [Scribes][1] . It tries to be a TextMate replacement for Linux
[1]: http://scribes.sourceforge.net/ |
Thx, this is a first start. I assume there is no document that is more explicit that this DTD? This DTD only specyfies what (global) tags can be used. Especially for the tag <widget> i would like a have constraints on the attribute "class" (as supported by XSD). The XSD should cover that there are only certain va... |
Mocha (<http://mocha.rubyforge.org/>) is a very good mocking library for ruby. |
Mocha (<http://mocha.rubyforge.org/>) is a very good mocking library for ruby. Depending on what you're actually wanting to test (i.e. if you want to just fake out the File.new call to avoid the file system dependency or if you want to verify that the correct arguments are passed into File.new) you could do something ... |
I love Yacc, but the discriminating union stack does present a challenge.
I don't know whether you are using C or C++. I've modified Yacc to generate C++ for my own purposes, but this solution can be adapted to C.
My preferred solution is to pass an interface to the owner down the parse tree, rather than construc... |
[Luntbuild][1]
Supports a wide variety of source control and build systems. Very customizable. Open Source. Setup takes some time, but it's not too horrible.
[1]: http://luntbuild.javaforge.com/ |
What is a monad? |
|functional-programming|monads| |
Having briefly looked at Haskell recently I wondered whether anybody could give a *brief, succinct, practical* explanation as to what a monad essentially is? I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail, so could somebody here help me? |
|functional-programming|duplicate|monads| |
|functional-programming|monads| |
As mentioned in a previous comment, `find` is probably the easiest way to do this. There are actually three different "linear search" methods in Scala's collections, each returning a slightly different value. Which one you use depends upon what you need the data for. For example, do you need an index, or do you just... |