instruction
stringlengths
0
30k
Without knowing details of your COM library, I'd look into creating a facade class in .Net and exposing it to COM, if necessary. Your facade would take a double[,,] and have an indexer that will map from [] to [,,].
Without knowing details of your COM library, I'd look into creating a facade class in .Net and exposing it to COM, if necessary. Your facade would take a double[,,] and have an indexer that will map from [] to [,,]. Edit: I agree about the points made in the comments, Lorens suggestion is better.
If you don't care about abandoned carts and have things in place for someone messing with the data on the client side... I think a cookie would be good -- especially if it's just a cookie of JSON data.
Well developed web site architecture using linq to sql?
|architecture|linq-to-sql|
Anybody found yet a good web site architecture using linq to sql? Any help will be very helpful!
As JohnMcG's answer, but *Disadvantage is you will have a copy of this in your binary for every Typename, Size combination.* That's why you'd make it an **inline** template function.
If you want it to look professional, you need to use an actual browser component. VB.NET comes with one. If you are using an older version of VB, you'd need to go third party. If you want to stay with a shell open, you would have to individually target the browser [command-line and pass arguments](http://blogs.msdn.com...
I need to be able to find the last occurrance of a character within an element. for example: `<mediaurl>http://www.blah.com/path/to/file/media.jpg</mediaurl>` If I try to locate through using `substring-before(mediaurl, '.')` and `substring-after(mediaurl, '.')` then it will, of course, match on the first dot....
I need to be able to find the last occurrance of a character within an element. for example: <mediaurl>http://www.blah.com/path/to/file/media.jpg</mediaurl> If I try to locate through using `substring-before(mediaurl, '.')` and `substring-after(mediaurl, '.')` then it will, of course, match on the first do...
How should I handle autolinking in wiki page content?
|database|html|wiki|hyperlink|
What I mean by autolinking is the process by which wiki links inlined in page content are generated into either a hyperlink to the page (if it does exist) or a create link (if the page doesn't exist). With the parser I am using, this is a two step process - first, the page content is parsed and all of the links to w...
How about tokenize with "/" and take the last element from the array ? Example: tokenize("XPath is fun", "\s+") Result: ("XPath", "is", "fun") Was an XSLT fiddler sometime back... lost touch now. But HTH
SSRS scheduled reports not working.
|sql-server|reporting-services|
My scheduled reports in SQL server won't run. I checked the logs and found the job that was failing. The error message in the log was: >'EXECUTE AS LOGIN' failed for the requested login 'NT AUTHORITY\NETWORK SERVICE'. The step failed. I'm using SQL authentication for the report so it shouldn't be issues with t...
For basic data retrieval I would be going for Linq without hesitation. Since moving to Linq I've found the following advantages: 1. Debugging my DAL has never been easier. 2. Compile time safety when your schema changes is priceless. 3. Deployment is easier because everything is compiled into DLL's. No more man...
> Why is this interface used? Because it supports the basic operations that would allow a client programmer to iterate over any kind of collection (note: not a `Collection` in the `Object` sense). > Why are the methods... not directly > coded to the data structure > implementation itself? They are, they're ...
> Why is this interface used? Because it supports the basic operations that would allow a client programmer to iterate over any kind of collection (note: not necessarily a `Collection` in the `Object` sense). > Why are the methods... not directly > coded to the data structure > implementation itself? They a...
Compiling on multiple hosts
|build-process|build-automation|
Say that you're developing code which needs to compile and run on multiple hosts (say Linux and Windows), how would you go about doing that in the most efficient manner given that: - You have full access to hardware for each host you're compiling for (in my case a Linux host and a Windows host standing on my desk) ...
Sharepoint custom content feature with Word Quick Parts and Document Information Panel
Err... try the method: std::vector<T>::reserve(x) It will enable you to reserve enough memory for x items without initializing any (your vector is still empty). Thus, there won't be reallocation until to go over x. The second point is that vector won't initialize the values to zero. Are you testing your...
A simple & fair algorithm for shuffling would be to assign a random floating-point number (e.g., between 0 and 1) to each card in the deck, then sort the deck by the assigned numbers. This is actually a perfect example for students to realize that just because something is intuitive, the naive shuffle in our case, d...
In .Net 2.0 or better, make everything internal, and then use Friend Assemblies [http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx
In .Net 2.0 or better, make everything internal, and then use Friend Assemblies [http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx This will not stop reflection. I want to incorporate some of the information from below. If you absolutely ...
If you don't actually need any of the features of macros (`__FILE__`, `__LINE__`, token-pasting, etc.) you may want to consider writing a variadic function using `stdargs.h`. Instead of calling `printf()`, a variadic function can call `vprintf()` in order to pass along variable argument lists.
Having a single database is best for data integrity because then you can use foreign keys. You can't have this built-in data integrity if you split the data into multiple databases. This isn't an issue if your data isn't related, but if it is related, it would be possible for your one database to contain data that is...
I've used "TrueTime - part of Compuware's DevPartner suite for years. There's a [free version](you could try Compuware DevPartner Performance Analysis Community Edition.) available.
Somehow I prefer using svcutil.exe directly than to use the "Add Service Reference" feature of Visual Studio :P This is what we're doing on our WCF projects.
It looks like the summaryFunction has to return a number. According to the [Adobe bug tracker][1], it is a bug in the documentation: > Comment from Sameer Bhatt: > In the documentation it is mentioned that - The built-in summary functions for SUM, MIN, MAX, AVG, and COUNT all return a Number containing the summa...
As someone else specified, there is a [jQuery plugin][1] to do this nicely. If performance in a big issue, doing it manually involves two steps: 1. Finding the position of the element you are scrolling to. 2. Scrolling to that position. [quirksmode][2] gives a good explanation of the mechanism behind the former....
For your case, you're probably best off doing this with a-href tags and a-name tags in your links and footers, respectively. In the general case of scrolling to a DOM element, there is a [jQuery plugin][1]. But if performance is an issue, I would suggest doing it manually. This involves two steps: 1. Finding the ...
|sharepoint|moss|quickparts|infopath|word|
I am creating a custom content type feature for MOSS that will also include a Word 2007 document as the document template. The same Word document will also have a Document Information Panel (DIP) and Quick Parts for all the fields in the content type. The problem I am having is that when I deploy my feature the Word...
|sharepoint|moss|ms-word|infopath|quickparts|
Simple solutions are the best: #include <stdexcept>; long fact(long f) { static long fact [] = { 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 1932053504, 1278945280, 2004310016, 2004189184 }; static long max = sizeof(fact)/sizeof(long); ...
Doing that is only safe if you are not running on a 64 bit version of windows. The LONG type is 32 bits, but the HANDLE type is probably 64 bits. You'll need to make your code 64 bit clean. In short, you will want to change the LONG to a LONG_PTR. [Rules for using pointer types][1]: > Do not cast pointers to int,...
What's the syntax for mod in java
|java|
As an example in pseudocode: if ( (a mod 2) == 0) { isEven = true } else { isEven = false }
I would check firewall configuration on that machine.
I would check firewall configuration on that machine. It is possible for iptables (I guess your SUSE has iptables firewall) to be setup to let trough only ping ICMP packets.
Scott Guthrie said (at Remix UK Sept 18 2008) that Silverlight is currently downloaded 1.5 million times per day. Over 115 million downloads since the version 1 release. The Version 1 installed base will automatically update to version 2 when it is out of beta.
When you want to change the program flow (`return`, `break` and `continue`) code in a function behaves differently than code that is actually inlined in the function. #define ASSERT_RETURN(condition) \ if (!condition, ret_val) { \ assert(false && #condition); \ return ret_val; } // ...
I suggest using uniqueidentifier type instead of identity. I this case you can generate IDs before insertion: update B set NewID = NEWID() insert into A(fname,lname,id) select fname,lname,NewID from B
If a relatively short time-out (around 2 hours, depending on your server config) is OK for the cart, then I'd say the server-side session. It's faster and more efficient than accessing the DB. If you need a longer persistence (say some users like to leave and come back the next day), then store it in a cookie that i...
There are many javascript unit test framework out there (jsUnit, scriptaculous, ...) but jsUnit is the only one I know that may be used with an automated build. If you are doing 'true' unit test you should not need AJAX support. For example, if you are using an RPC ajax framework such as DWR, you can easyli write a ...
What, apart from StackOverflow? ;-)
Often times I end up with code like: int SomeAPICallbackMethod(long a, long b, SomeCrazyClass c, long d, string e, string f, long double yx) { ... } int AnotherCallback(long a, long b, SomeCrazyClass c, long d, string e, string f, long double yx) { ... } int YetAnotherCallback(long a, long b, SomeCrazy...
public static long GetCommitCharge() { var p = new System.Diagnostics.PerformanceCounter("Memory", "Committed Bytes"); return p.RawValue; }
I really like Qt. Have been working with it in several projects now. Although the project, I am currently working on, will be released for windows only, some of our developers code under Mac OS X using the gcc. And using different compilers and environments is an extra benefit for locating errors & bugs.
I really like Qt. Have been working with it in several projects now. Although the project, I am currently working on, will be released for windows only, some of our developers code under Mac OS X using the gcc. And using different compilers and environments is an extra benefit for locating errors & bugs. I forgot...
Type checking on Caché Objects
|intersystems|
What is the point of type definition on method parameters on Caché Object (from Intersystems) since after it's pre-compiled to the .int format, it removes any typing information, thus making no difference at all?
![alt text][1] [1]: http://imgs.xkcd.com/comics/travelling_salesman_problem.png
Here's the search string. /abc \(defg\)\@! The concept you're looking for is called a negative look-ahead assertion. Try this in vim for more info: :help \@!
How to open Eclipse project as read-only?
|eclipse|
Does anyone know is there a way to open a project in Eclipse in read-only mode? If there is a lot of similar projects open it is easy to make changes to a wrong one.
I don't think STL is your answer. You're going to need to roll your own sort of solution using realloc().
I don't think STL is your answer. You're going to need to roll your own sort of solution using realloc(). You'll have to store a pointer and either the size, or number of elements, and use that to find where to start adding elements after a realloc(). int *memberArray; int arrayCount; void GetsCalled...
For pointers and classes, here is my analogy. I'll use a deck of cards. The deck of cards has a face value and a type (9 of hearts, 4 of spades, etc.). So in our C++ like programming language of "Deck of Cards" we'll say the following: HeartCard card = 4; // 4 of hearts! Now, you know where the 4 of hearts is...
For example, [Reductio](http://reductiotest.org/) (for Java/Scala) and [QuickCheck](http://www.cs.chalmers.se/~rjmh/QuickCheck/) (for Haskell). The kind of framework I'm thinking of would provide "generators" for built-in data types and allow the programmer to define new generators. Then, the programmer would define ...
|c#|testing|automated-tests|.net|
Is there a specification-based testing framework for C# .Net 2.0?
|c#|.net|testing|automated-tests|
For example, [Reductio](http://reductiotest.org/) (for Java/Scala) and [QuickCheck](http://www.cs.chalmers.se/~rjmh/QuickCheck/) (for Haskell). The kind of framework I'm thinking of would provide "generators" for built-in data types and allow the programmer to define new generators. Then, the programmer would define ...
I do believe this is an issue connected to a general problem. When HTML was born no one could foresee its widespread use. Another technology which almost collapsed under the weight of its own success. When HTML pages were written in **vi** on a green text terminal a TABLE was all that was needed to present data to the ...
As an example in pseudocode: if ( (a mod 2) == 0) { isEven = true } else { isEven = false }
How to prevent the ObjectDisposedException in C# when drawing and application exits
|c#|graphics|exception|
I'm a CompSci student, and fairly new at C#, and I was doing a "Josephus Problem" program for a class, and I created an Exit button that calls Application.Exit() to exit at anytime, but if C# is still working on painting and the button is pressed it throws an ObjectDisposedExeception for the Graphics object. Is there a...
How to Create PCL file from MS word
|printer-control-language|file|ms|word|
How to create new PCL file similar to existing MS doc. I have Ms doc tamplate and replacing it with actual data. I need to achieve same for PCL format (Create PCL file as tamplate and replacing it with actual value from database and send it to fax).
|ms-word|file|printer-control-language|
The modulus operator is % To use you example: f ( (a % 2) == 0) { isEven = true } else { isEven = false }
The modulus operator is % To use you example: if ( (a % 2) == 0) { isEven = true } else { isEven = false }
I generally use what is sometimes called the 'right hand clockwise rule'. It goes like this: * Start from the identifier. * Go to the immediate right of it. * Then move clockwise and come to the left hand side. * Move clockwise and come to the right side. * Do this as long as the declaration has not been parsed...
I've just looked into this in depth, and the answer seems to be no. Specifically, there's no way to get at the response from the WARenderCanvas or anything it can access (it holds onto the WARenderingContext, which holds onto the WAHtmlStreamDocument, which holds onto the response's *stream* but not the response itsel...
"The World is Flat" by Thomas Friedman. Excellence in programming demands an investment of mental energy and a dedication to continued learning comparable to the professions of medicine or law. It pays a fraction of what those professions pay, much less the wages paid to the mathematically savvy who head into the f...
In a non-toy example another file may include the one you missed. Reviewing the output from the pre-processor is a nice way to see what you end up with compiling. /Allan
Terminate MySQL connections on shared host?
|sql|database|mysql|connection|
I'm using MediaTemple's Grid Server (shared/grid hosting) to run some MySQL/PHP sites I'm writing and noticed that I wasn't closing one of my MySQL connections, which caused my site to error out, "Too Many Connections". I can't log in anywhere to close the connections manually. **Is that any way to close open co...
use a view, function, or procedure that checks is_deleted=0, i.e. don't select directly on the table in case the table needs to change later for other reasons and index the is_deleted column for larger tables since you already have an audit trail, tracking the deletion date is redundant
I could be wrong, but I'm pretty sure that's impossible. The java byte code is different to the code produced to run on the CLR. **Snarky answer**: Get the source code, and port it.
I could be wrong, but I'm pretty sure that's impossible. The java byte code is different to the code produced to run on the CLR. **Snarky answer**: Get the source code, and port it. EDIT: A little poking comes up with <http://sourceforge.net/projects/ikvm/>, a Java Virtual Machine implementation for .NET. Not qui...
For pointers and classes, here is my analogy. I'll use a deck of cards. The deck of cards has a face value and a type (9 of hearts, 4 of spades, etc.). So in our C++ like programming language of "Deck of Cards" we'll say the following: HeartCard card = 4; // 4 of hearts! Now, you know where the 4 of hearts is...
For pointers and classes, here is my analogy. I'll use a deck of cards. The deck of cards has a face value and a type (9 of hearts, 4 of spades, etc.). So in our C++ like programming language of "Deck of Cards" we'll say the following: HeartCard card = 4; // 4 of hearts! Now, you know where the 4 of hearts is...
Try this: foreach ($_GET as $field => $label) { $datarray[]=$_GET[$field]; echo $_GET[$field]; // you don't really need quotes echo "With quotes: {$_GET[$field]}"; // but if you want to use them echo $field; // this is really the same thing as echo $_GET[$field], so...
Well, your example has several errors. Most importantly, you would need to change "char" to "Currency" in the IF statement; which as far as I can see would avoid the warning as well.
If the updates you are concerned with are primarily new insertions (for example, StackOverflow itself seems to suffer from this problem when paging through questions and new questions come in) one way to handle it is to capture a timestamp when you issue the first pagination query, and then limit the results of request...
[Spry][1] has a lot of effects that seem to be relatively easy to use. The downside (upside?) with Spry is its packaging. It's split into many separate pieces and parts. So if you want to use a lot of Spry, you'll either be making several calls to external javascript files, or you'll be gluing them together ...
We've used mBlox (http://www.mblox) in the past, as they provide comprehensive international coverage, premium SMS, various levels of Quality of Service vs Price, and a solid Java-based API for both inbound and outbound SMS.
It may depend on the xml parser you are using. I can't speak for anything but .NET 2003 parser where I did some informal performance tests on [push vs pull][1] XSLT code. This is similar to what you are asking: apply-template = push and call-template = pull. I was convinced push would be faster, but that was not the ca...