instruction stringlengths 0 30k ⌀ |
|---|
|soap|c#|web-services| |
I have a web service that I created in C# and a test harness that was provided by my client. Unfortunately my web service doesn't seem to be parsing the objects created by the test harness. I believe the problem lies with serializing the soap packet.
Using TCPTrace I was able to get the soap packet passed to the we... |
|c#|web-services|soap| |
I have a web service that I created in C# and a test harness that was provided by my client. Unfortunately my web service doesn't seem to be parsing the objects created by the test harness. I believe the problem lies with serializing the soap packet.
Using TCPTrace I was able to get the soap packet passed to the we... |
@ebel
> thinking about it, you have 64 bit representing a number greater than 2^64 (double.maxvalue), so inaccuracy is expected.
2^64 is not the maximum value of a double. 2^64 is the number of unique values that a double (or any other 64-bit type) can hold. `Double.MaxValue` is equal to 1.79769313486232e308.
... |
@ebel
> thinking about it, you have 64 bit representing a number greater than 2^64 (double.maxvalue), so inaccuracy is expected.
2^64 is not the maximum value of a double. 2^64 is the number of unique values that a double (or any other 64-bit type) can hold. `Double.MaxValue` is equal to 1.79769313486232e308.
... |
Check the documentation for the switch you're using. Switches are constrained in the number of packets per second (pps) they can deliver and often can't sustain 1GBps if you're sending packets with significantly smaller than the maximum payload size.
Another thing to check is whether your network card is doing inter... |
IoC / DI to me is pushing out dependencies to the calling objects. Super simple.
The non-techy answer is being able to swap out an engine in a car right before you turn it on. If everything hooks up right (the interface), you are good. |
Check console log ( Applications/Utilities/Console.app ) . When program crashes on startup, and there's something wrong with initialization, it often writes out some helpful error messages there, before it crashes. |
Entities With or Without Behavior |
|oop| |
Should entities have behavior? or no?
Why or why not? |
Should entities have behavior or not? |
Should entities have behavior? or not?
Why or why not? |
Should entities have behavior? or not?
Why or why not?
If not, does that violate Encapsulation? |
SimpleDateFormatter is what you want. |
your approach is what i usually do because other option is to include the UIcomponent mediaDisplay into library and then attach that component using attachMovie but i found mediaDisplay i little buggy so i prefer to use the primitive video instance . |
As far as I know, it's possible to get clipboard data via javascript. Not sure how possible it is by default these days, but it was all the rage not long ago. I do believe IE still allows it.
People have a habit of leaving very important data in their clipboard, so this is pretty bad. |
**This is a good idea.**
Smalltalk does this.
There is a NULL object. It _doesn't_ descend from Object. (Smalltalk is a singly-rooted class hierarchy like Java)
For the advanced student, you can sub-class it for making proxies! |
I would recommend you download a copy of Reflector and compare the codebases for the SQL Server and Oracle providers (They shouldn't be that complicated.)
I'm going to guess that they're going to look almost identical and perform (from a .NET runtime perspective) similarly.
Whether the Oracle backend is any fa... |
If I understand your question correctly, you are looking for capturing groups. I'm not familiar with the .net api, but in java this would look something like:
Pattern pattern = Pattern.compile("command SPEED=(\d+) SIZE=(\d+)");
Matcher matcher = pattern.matcher(inputStr);
if (matcher.find()) {
... |
Yes, the best way to do it would probably be MageUI. Just open your manifests with MageUI, click **Save** and it should prompt you to resign the manifests.
You have two options when signing manifests. You can use a self-certificate or purchase a certificate. Self certificates are easy to use but when the app is i... |
li{width:100%;}
.a{}
.b{float: left;}
That should do as required from my knowledge of CSS |
Without checking to make sure, this should work
<pre><code>
LI { width: 100%; }
.a { float: left; }
.b { float: right; }
</code></pre> |
I'd consider code generation harmful as it bloats the codebase without adding new logic or insight. Ideally one should raise the level of abstraction, use data files, templates or macros etc. to avoid generating large amounts of boiler plate code. It helps you get things done quickly but can hurt maintainability in the... |
Some basic functionals:
public static class Functionals
{
// One-arugument Y-Combinator.
public static Func<T, TResult> Y<T, TResult>(Func<Func<T, TResult>, Func<T, TResult>> F)
{
return t => F(Y(F))(t);
}
// Two-arugument Y-Combinator.
pu... |
Some basic functionals:
public static class Functionals
{
// One-argument Y-Combinator.
public static Func<T, TResult> Y<T, TResult>(Func<Func<T, TResult>, Func<T, TResult>> F)
{
return t => F(Y(F))(t);
}
// Two-arugument Y-Combinator.
pub... |
Both these queries will be executes when you'll try to access final results. You can try to view original SQL generated from DataContext object properties. |
Working with .qr2 reports in .NET? |
|.net|reporting|quickreports| |
We use an ERP that has a bunch of reports in QuickReport format (.qr2). From what I could search, Quickreports has an interface for Delphi but not for .NET.
Anyone know if there's a (preferably free/OSS) solution for converting .qr2 reports to something I could work with in C#? Or a component for reading these repor... |
Beginner question about XCode 3.1.1 and static libraries |
|macos|xcode|c|c++| |
I'm an experienced VS.NET user and trying to get up and running on XCode 3.1.1.
Here's what I'm trying to accomplish:
I'd like a static library ("Lib") to have its own xcodeproj file. I'd an executable application ("App") that makes use of Lib to reference Lib's xcodeproj file so that changes to Lib cause App to... |
|macos|xcode| |
I think in this case [Wikipedia][1] have it right
> Windows SharePoint Services (WSS) is the basic part of Microsoft SharePoint, offering collaboration and document management functionality by means of web portals, by providing a centralized repository for shared documents, as well as browser-based management and a... |
The solution is to use Microsoft.VisualBasic.Devices, which does not suffer from this bug. Since it's Vista only, and the Event Viewer even managed to fail midway through logging the crash (process id 0x**%9** should have a hex value there instead), I point the blame at the new sound code in Vista.
BTW, connecting ... |
How about *PageTemplate* to embody the fact that its children have their own layout, CSS etc? |
`AreaNode` |
The first thing you should change are your calls to StreamWriter and StreamReader to wrap them in a using statement, like this:
using (StreamReader reader = file.OpenText())
{
List<string> text = new List<string>();
while (!reader.EndOfStream)
{
text.Add(reader.ReadLine())... |
Unfortunately, it looks like there's no simple way to do this.
See <http://www.jameskovacs.com/blog/DiggingDeepIntoReportingServices.aspx> for more info. If you look at the [comments of that post](http://www.jameskovacs.com/blog/CommentView.aspx?guid=31eeaafd-a118-4e76-917d-78d54441aee9#commentstart), there are some w... |
The word you are looking for is "Section". It's part of a whole and has the same stuff inside.
So, you have Nodes, which have children and a parent, and you have SectionNodes which are the roots of these special subtrees. |
See the 'Papers' section at [www.lua.org][1].
Especially [The Implementation of Lua 5.0][2]
Lua defines all standard functions in the underlying (ANSI C) code. I believe this is mostly for performance reasons. Recently, i.e. the 'string.*' functions got an alternative implementation in pure Lua, which may prove v... |
I'd imagine any method of sending fonts with a web page would pose some sort of security risk. I have heard of methods where, in the case that the client doesn't have the required font, the text can be dynamically replaced with an image of or some sort a flash displayed. The only one like this I can find now is at [ALi... |
If you're going to do some work on it if it is of that type, then TryCast is what I'd use.
Dim c as IInterface = TryCast(obj, IInterface)
If c IsNot Nothing
'do work
End if |
<pre>
The problem with learning C within Visual Studio is that you are compiling C
using the Visual Studio C++ compiler. You might want to try learning C using
the GNU GCC compiler from within the Cygwin environment in Windows.
</pre>
This is a legitimate response, I posted an IDE that uses the GNU compilers, s... |
@[Sean Chambers][1]
FYI, the .NET Timer class is not for diagnostics, it generates events at a preset interval, like this (from [MSDN][2]):
System.Timers.Timer aTimer;
public static void Main()
{
// Create a timer with a ten second interval.
aTimer = new System.Timers.Timer(10000);... |
How to avoid OutOfMemoryError when using Bytebuffers and NIO? |
|java|filechannel|nio|bytebuffer| |
I'm using ByteBuffers and FileChannels to write binary data to a file. When doing that for big files or successively for multiple files, I get a OutOfMemoryError exception.
I've read elsewhere that using Bytebuffers with NIO is broken and should be avoided. Does any of you already faced this kind of problem and found ... |
But when I need something like a Singleton, I often end up using a [Schwarz Counter][1] to instantiate it.
[1]: http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter
|
The major areas where VS Express lacks features compared to VS Pro:
- No Add-in/macros
- some Win32 tools missing
- no Team Explorer support
- limited refactoring support
- Debugging is much more limited (particularly problematic for server development is no remote debugging)
- Lack of support for setup p... |
The major areas where VS Express lacks features compared to VS Pro:
- No Add-in/macros
- some Win32 tools missing
- no Team Explorer support
- limited refactoring support
- Debugging is much more limited (particularly problematic for server development is no remote debugging)
- Lack of support for setup p... |
The name of the temporary directory is held in `$CGITempFile::TMPDIRECTORY` and initialised in the `find_tempdir` function in CGI.pm.
The algorithm for choosing the temporary directory is described in the CGI.pm documentation (search for **-private_tempfiles**).
IIUC, if a C:\Temp folder exists on the server, CGI.pm ... |
@Phillip - Thanks, your answer really got me started in the right direction.
After seeing your code, and doing a little more reading in Nish's book **C++/CLI in Action**, I think using an indexed property that returns a const tracking handle to a Local instance on the managed heap is probably the best approach. I e... |
Can I see your User class? This is just using restrictions below. I don't see why Restrictions would be really any different than Examples (I think null fields get ignored by default in examples though).
getCurrentSession().createCriteria(User.class)
.setProjection( Projections.distinct( Projections.proje... |
Some basic functionals:
public static class Functionals
{
// One-argument Y-Combinator.
public static Func<T, TResult> Y<T, TResult>(Func<Func<T, TResult>, Func<T, TResult>> F)
{
return t => F(Y(F))(t);
}
// Two-arugument Y-Combinator.
pub... |
Some basic functionals:
public static class Functionals
{
// One-argument Y-Combinator.
public static Func<T, TResult> Y<T, TResult>(Func<Func<T, TResult>, Func<T, TResult>> F)
{
return t => F(Y(F))(t);
}
// Two-argument Y-Combinator.
publ... |
Would the "is" keyword work?
if (myControl is ISomeInterface)
{
// do something
} |
Would the "is" operator work?
if (myControl is ISomeInterface)
{
// do something
} |
[C++]
I agree with the "use it when you have to" brigade. Decorating code unnecessarily with *this* isn't a great idea because the compiler won't warn you when you forget to do it. This introduces potential confusion for people expecting *this* to always be there, i.e. they'll have to *think* about it.
So, when w... |
I would say don't create a huge ByteBuffer that contains ALL of the data at once. Create a much smaller ByteBuffer, fill it with data, then write this data to the FileChannel. Then reset the ByteBuffer and continue until all the data is written. |
In Oracle, something like this works nicely to separate your counting and ordering a little better. I'm not sure if it will work in MySql 4.
select 'Tag', counts.cnt
from
(
select count(*) as cnt, 'Tag'
from 'images-tags'
group by 'tag'
) counts
order by counts.cnt d... |
There is a great post on using PowerShell and [TagLibSharp][1] on Joel "Jaykul" Bennet's [site][2]. You could use TagLibSharp to read the metatdata with any .NET based language, but PowerShell is quite appropriate for what you are trying to do.
[1]: http://www.taglib-sharp.com/Discover
[2]: http://huddledmas... |
There's a very good reason to learn C and C++. The reason is that there's a lot of C and C++ code out there that are performing very real and important tasks. Someone who considers themselves a programmer and a learner(doubtful that you can separate the two) can learn a lot from these lines of code.
You can learn a ... |
If you access files in a _random fashion_ (read here, skip, write there, move back) then you have a problem ;-)
But if you only write big files, you should **seriously** consider using streams. java.io.FileOutputStream can be used directly to write file byte after byte or wrapped in any other stream (i.e. DataOutput... |
It has been a **really** long time since I did anything with FileMaker Pro, but I know that it does have capabilities for an ODBC (and JDBC) connection to be made to it (however, I don't know how, or if, that translates to the linux/perl/python world though).
This article shows how to share/expose your FileMaker d... |
*{ margin: 0; padding: 0;}
li{ width: 100%: display: block; }
li:after{ clear: both; }
div.a{ width: 49%; float: left; }
div.b{ width: 49%; float: left; }
Should do the trick. |
According to [this][1] article on [delphi.about.com][2]
> Unfortunately, Delphi's implementation of the RichEdit control leaves out a lot of the functionality found in more recent versions of this control (from Microsoft).
You can add your own functionality as discussed [here][3].
NOTE: [Delphi 2009][4] has jus... |
Is there a .NET/C# wrapper for SQLite? |
|c#|.net|database|sqlite| |
I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper? |
Stripping Invalid XML characters in Java |
|java|xml| |
I have an XML file that's the output from a database. I'm using the Java SAX parser to parse the XML and output it in a different format. The XML contains some invalid characters and the parser is throwing errors like 'Invalid Unicode character (0x5)'
Is there a good way to strip all these characters out besides p... |
We use Codesmith and have had great success with it. I am now constantly trying to find where we can implement templates to speed up mundane processes. |
One of the best OpenGl/D3D debugging tools is nVidia's NvPerfHUD. It won't help you find your exact problem, but it does provide another view of what you are sending into the rendering pipeline.
However, I will say that I've only used it with D3D applications so I don't know if it helps as much with OpenGL programs... |
One of the best OpenGl/D3D debugging tools is nVidia's NvPerfHUD. It won't help you find your exact problem, but it does provide another view of what you are sending into the rendering pipeline.
However, I will say that I've only used it with D3D applications so I don't know if it helps as much with OpenGL programs... |
<%=%> by itself will be sent to the output, in the context of the JSTL it will be evaluated to a string |
Which language is useful to create a report for a valid C program |
|c|parsing|report| |
Can anyone suggest me a helpful programming language which can be used to create a tool which will analyse the given C program and generate a txt report or html report containing information about the given program (function list, variable list etc).
The program I intend to build is similar to doxygen but i want it fo... |
The .NET languages are more for show than actual usefulness. Each language has been so butchered, that they're all C# with a new face.
There are a variety of reasons to provide alternative languages for the Java VM:
- The JVM is multiplatform. Any language ported to the JVM gets that as a free bonus.
- There... |
for (Iterator<String> itr = someList.iterator(); itr.hasNext(); ) {<br/>
String item = itr.next();<br/>
System.out.println(item);<br/>
} |
As long as users understand that the underlying data is always changing, they won't be confused. So just do it the straightforward way.
You could cache the first few pages of the result and use that for subsequent views, but then the results will be out of sync with the database, which is even more confusing. |
Yes, you need to understand your OS' time quantums. On Windows, you won't even be getting 1ms resolution times unless you change the time quantum to 1ms. (Using for example timeBeginPeriod()/timeEndPeriod()) That still won't really guarantee anything. Even a little load or a single crappy device driver will throw ev... |
You can use `new Date().GetTimezoneOffset()/60` for the timezone. There is also a `toLocaleString()` method for displaying a date using the user's locale.
Here's the whole list: [Working with Dates][1]
[1]: http://www.elated.com/articles/working-with-dates/ |
Can I see your User class? This is just using restrictions below. I don't see why Restrictions would be really any different than Examples (I think null fields get ignored by default in examples though).
getCurrentSession().createCriteria(User.class)
.setProjection( Projections.distinct( Projections.proje... |
You could read this article and try to adopt it for your program:
[Sticky Windows - How to make your (top-level) forms to stick one to the other or to the screen][1]
The class presented in the article inherits from *System.Windows.Forms.NativeWindow*, thus no inheritance is required in order to make your class "S... |
Have you tried [CodeIgniter][1]?
I tested CakePHP but it's too much a la Rails style and i didn't like it.
CodeIgniter gives you more freedom to do whatever you whant.
[1]: http://codeigniter.com/ |
I doubt whether you have 3000 developers in your organisation all working on the same code base. I work for a medium-large software company, and we probably don't have that many in the entire company, but there are also many independent projects.
Internally some groups deliver releases to other groups to use in thei... |
I like to have a test per check in a method and have a meaningfull name for the test-method. For instance:
testAddUser_shouldThrowIllegalArgumentExceptionWhenUserIsNull |
Well, I found the source of the problem, and boy was it embarrassing. In the attribute keyContainerName, I spelled the name incorrectly.
That it. That's what caused the problem.
Apparently, the encryption will work even if you provide an incorrect keyContainerName, which I incorrectly assumed will fail. So, on... |
When it comes to database queries, always try and use prepared parameterised queries. The <code>mysqli</code> and <code>PDO</code> libraries support this. This is infinitely safer than using escaping functions such as mysql_real_escape_string.
Yes, mysql_real_escape_string is effectively just a string escaping funct... |
Mips - Is it important? |
|assembly|mips| |
My question: Is the mips programming language that benificial to know?
I'm a CS student and am taking a assembly class which focuses on Mips. I'm very comfortable writing in high level languages, but Mips has me a little bit down.
Is Mips something that I should really focus on and try to completely grasp it? W... |
Would Automatic Casts be useful? |
|java|compiler-construction| |
Is there any downside or problem potential to change the Java compiler to automatically cast? In the example below the result of list.get(0) would automatically be casted to the type of the variable hi.
List list = new ArrayList();
list.add("hi");
String hi = list.get(0);
I know that generics allo... |