instruction stringlengths 0 30k ⌀ |
|---|
I've got a load-balanced (not using Session state) ASP.Net 2.0 app on IIS5 running back to a single Oracle 10g server, using version 10.1.0.301 of the ODAC/ODP.Net drivers. After a long period of inactivity (a few hours), the application, seemingly randomly, will throw an Oracle exception:
Exception: ORA-03113:... |
Good question! I haven't tried this out at all, but my first shot would be this iterative method:
0. Create a set C ("contained") and N ("not contained"), and add all points in your set to N.
1. Pick 4 points from N at random to form an initial polygon P. Add them to C.
2. Use <a href="http://en.wikipedia.org/wiki... |
Is nAnt still supported and suitable for .net 3.5/VS2008? |
|.net|msbuild|nant| |
I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server.
Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year old now.... |
|.net|.net-3.5|msbuild|nant| |
Using the mouse scrollwheel in GLUT |
|opengl|glut|scrollwheel| |
I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom in and out of a scene? How do I do that? |
Note that venerable [Nate Robin's GLUT][1] library doesn't support the scrollwheel. But, later implementations of GLUT like [FreeGLUT][2] do.
Using the scroll wheel in FreeGLUT is dead simple. Here is how:
Declare a callback function that shall be called whenever the scroll wheel is scrolled. This is the prototyp... |
Try this:
using System.Data.Linq.Mapping;
public partial class MyEntity: IEntity
{ [Column(Storage="IDfield", DbType="int not null", IsPrimaryKey=true)]
public int ID
{
get { return this.IDfield; }
set { this.IDfield=val... |
It's been a while since I've done a CVS -> SVN conversion, and probably even longer since I did one with a nontrivial branch structure. Since SVN can move around directory trees fairly easily, you could do the whole conversion first, then sort out the trunk/branches structure entirely within SVN later.
If you do get... |
Mayhaps [System.Security.allowDomain][1] is what you need?
[1]: http://livedocs.adobe.com/flex/15/flex_docs_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flex_Documentation&file=00001750.htm "Flex Documentation: System.Security.allowDomain" |
|git|dvcs|bazaar| |
|version-control|git|dvcs|bazaar| |
|version-control|git|dvcs|bazaar| |
I know a slightly off topic answer, but might be interesting to you nonetheless.
(PDF WARNING)<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2310.pdf">The Boehm garbage collector</a>, which was originally said to make C++0x <a href="http://herbsutter.spaces.live.com/Blog/cns!2D4327CC297151BB!330... |
(PDF WARNING)<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2310.pdf">The Boehm garbage collector</a>, which was originally said to make C++0x <a href="http://herbsutter.spaces.live.com/Blog/cns!2D4327CC297151BB!330.entry">will not make it after all</a> (due to time constraints I suppose).
It's... |
<a href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">The Boehm garbage collector</a> is freely available, and supposedly rather good (no first hand experience myself)
([PDF WARNING]<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2310.pdf">Theoretical paper about the Boehm garbage collector</a>)... |
<a href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">The Boehm garbage collector</a> is freely available, and supposedly rather good (no first hand experience myself)
([PDF WARNING]Theoretical paper about <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2310.pdf">C++0x proposal for the Boehm gar... |
Good question! I haven't tried this out at all, but my first shot would be this iterative method:
0. Create a set N ("not contained"), and add all points in your set to N.
1. Pick 4 points from N at random to form an initial polygon P. Remove them from N.
2. Use <a href="http://en.wikipedia.org/wiki/Point_in_polyg... |
Good question! I haven't tried this out at all, but my first shot would be this iterative method:
0. Create a set N ("not contained"), and add all points in your set to N.
1. Pick 3 points from N at random to form an initial polygon P. Remove them from N.
2. Use <a href="http://en.wikipedia.org/wiki/Point_in_polyg... |
You could write your own appender that makes up its own filename, perhaps using the [File.createTempFile](http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String\)) method. If the `FileAppender` class was written correctly, you should be able to extend it—or `... |
You may need to use WMI. This may serve as a good starting point:
http://msdn.microsoft.com/en-us/library/aa394595.aspx |
The whole idea around semantic markup is the separation of markup and presentation, which includes layout.
Div's aren't replacing tables, they have their own use in separating content into blocks of related content (<div id="comments">, <div class="legend module">). When you don't have the skills and are relying on ... |
<blockquote>Phantom references can be used to perform pre-garbage collection actions such as freeing resources. Instead, people usually use the finalize() method for this which is not a good idea. Finalizers have a horrible impact on the performance of the garbage collector and can break data integrity of your applicat... |
There's a handy set of [comparison charts][1] on microsoft.com.
It depends on the particular express edition, of course (since there are several and they have different features). The limitations you're most likely to run into are source control integration (and TFS client license), debugging limitations, limited re... |
Two things: Check additivity and decide whether you want log events captured by more detailed levels of logging to propagate to the root logger.
Secondly, check the level for the root logger. In addition you can also add filtering on the appender itself, but this should normally not be necessary. |
Your code as displayed is not syntactically correct; it needs some commas. I got this to work:
$foo = {"hdrs": ["Make","Model","Year"],
"data" : [
{"Make":"Honda","Model":"Accord","Year":"2008"},
{"Make":"Toyota","Model":"Corolla","Year":"2008"},
{"Make":"Honda","Model":"Pilot","Y... |
I'm not sure I understand your question, but...
Assuming the above JSON is the var obj, you want:
obj.data[0]["Make"] // == "Honda"
If you just want to refer to the field referenced by the first header, it would be something like:
obj.data[0][obj.hdrs[0]] // == "Honda"
|
You should note, that you can use disable-output-escaping within the value of node or string/text like:
<xsl:value-of select="/node/here" disable-output-escaping="yes" />
or
<xsl:value-of select="'&'" disable-output-escaping="yes" />
<xsl:text disable-output-escaping="yes">Texas A&M</x... |
The main question is how you store and access the items you are going to put in the map (assuming this isn't just a picture display). Lookup scenegraph for some ideas.
Also if you want it to be more than a toy image viewer the lat long to XY scaling can get 'interesting'
|
The [DataSet][1] class is the place to start. As the linked article says, the steps for creating a DataSet, modifying it, then updating the database are typically:
<ol>
<li>Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter.
<li>Change the data in individual DataTable objec... |
I think you will have to add it as an attribute to the server control... for it to render to HTML.
So basically (in C#),
ControlName.Attributes["style"] = "color:red"; |
All the approaches suggested are valid, my point is if the way C# does it is appealing replicate it, create your own classes/interfaces to present the same abstraction, i.e. a simple linked list class with methods Contains and Add, using the sample code provided by other answers this should be relatively simple.
One... |
If you like emacs then [Xrefactory][1] is a good choice.
[1]: http://www.xref-tech.com/xrefactory/main.html |
How can I write a lock free structure? |
|multithreading|multicore| |
In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solve this.
How can I write a lock free structure? |
I use `java.awt.Robot`. Is not nice, is not easy but works every time.
Pros:
- You are in control
- Very fast
- Build your own FWK
- Portable
- No external dependencies
Cons:
- No nice GUI to build test
- You have to leave the GUI alone while you test
- Build your own FWK
- Diffic... |
Just shooting in the dark here - is it possible that the <tt>ArgumentOutOfRangeException</tt> is actually thrown from your exception <i>handler</i>?
Additionally, you didn't say what type of application is in question -- <tt>Application.ThreadException</tt> only affects WinForms threads, so if this isn't a GUI app... |
People tend to say something along the lines of "The best way to learn is by doing" but I've always found that unless you're specifically learning a language to contribute to some project it's difficult to actually find little problems to tackle to keep yourself going.
A good solution to this is [Project Euler][1], ... |
Migrating an Existing Application to accept Unicode. |
|sql-server|oracle-database|unicode|migration| |
We have in the process of upgrading our application to full Unicode comptibility as we have recently got Delphi 2009 which provides this out of the box. I am looking for anyone who has experience of upgrading an application to accept Unicode characters. Specifically answers to any of the following questions.
- W... |
The best thing is probably to _not_ commit any IDE related file (such as Eclipse's .project), that way everyone can checkout the project and do his thing as he wants.
That being said, I guess most IDEs have their own config file scheme, so maybe you can commit it all without having any conflict, but it feels messy ... |
How to clear connections in Sql Server 2005 |
|sql|sql-server|performance|sql-server-2005| |
My workplace has sales people using a 3rd party desktop application that connects directly the a Sql Server and the software is leaving hundreds of sleeping connections for each user. Is there anyway to clear these connection programmatically? |
Actually I wiredup the event the wrong way :|
I had
EventManager.RegisterClassHandler ( typeof ( MyClass )......
Instead of
EventManager.RegisterClassHandler ( typeof ( TheClassThatOwnedTheEvent )
So .. my bad.
|
An octree will work as long as you can specify the spheres by their centres - it hierarchically bins points into cubic regions with eight children. Working out neighbours in an octree data structure will require you to do sphere-intersecting-cube calculations (to some extent easier than they look) to work out which cu... |
Scott Guthrie explained it in this post "[ASP.NET MVC Framework][1]"
> - It enables clean separation of concerns, testability, and TDD by
> default. All core contracts within
> the MVC framework are interface based
> and easily mockable (it includes
> interface based
> IHttpRequest/IHttpResponse
> intrinsi... |
Serialised data represents the internal data of objects. There isn't enough information to work out what methods you would need to call on the objects to reproduce the internal state.
There are two obvious approaches:
* Encode the serialised data in a literal String and deserialise that.
* Use java.beans XML p... |
Use #pragma warning disable.
More info here: [http://msdn.microsoft.com/en-us/library/441722ys(VS.80).aspx][1]
[1]: http://msdn.microsoft.com/en-us/library/441722ys(VS.80).aspx |
Pause a DOS Console/GNU Makefile if an error occurs |
|windows|makefile|gnu|dos| |
Part of the install for an App I am responsible compiles some C code libraries. This is done in a DOS console using GNU Make.
So, as part of the install, a DOS Console window pops open, you see the make file output wiz by as it compiles and links, when finished the DOS Console window closes and the installer continu... |
[Themes][1] might be a good solution but having re-read your question I think you might be asking for a method for allowing customers to submit their own branding dynamically, i.e. without you having to modify any files, a hands-off approach? How about having an admin interface consisting of web forms where the custom... |
I tested your code with:
"i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)"
and there was no Problem.
Output:
t should be 0 but is 0
So there isn't a bug in you code. That doesn't mean that it is good code.
But I would add the returntype of the main-function and the "return 0;" at the e... |
With Mono we're getting pretty close, and with SilverLight we're allready there. |
I don't think the official "intention" of .NET was WORA. I think that you could safely say that .NET was designed so that it would always run on future MS OS's. But there is nothing that precludes .NET from running on other platforms. Mono is an example of an implementation of the .NET runtime for an OS other than Wind... |
Parse tree and grammars information |
|parsetree|concretesyntaxtree|syntaxtree|grammar| |
Do anyone know where to find good online resources with examples how to make grammars and parsetrees? Preferebly introductary materials.
Info that is n00b friendly, haven't found anything good with google myself. |
|parsing|concretesyntaxtree|syntaxtree|grammar| |
|parsing|grammar|concretesyntaxtree|syntaxtree| |
Do anyone know where to find good online resources with examples how to make grammars and parsetrees? Preferebly introductary materials.
Info that is n00b friendly, haven't found anything good with google myself.
edit: I'm thinking about theory, not a specific parser software.
|
It's theoretically possible, since the CLR (.Net's "virtual machine") complies with an open standard (the CLI). The question is what other implementations there are of that standard. Mono is another work in progress, but it's the only other one I know of. |
For accessing appointments, you can just access the Calendar folder on Exchange using WebDav. For creating appointments, please refer to RFC2445 for details. |
How do you turn on Code Coverage in Builds within TFS? |
|tfs|code-coverage|build-process| |
I need to know how to turn on Code Coverage when running TFS builds on a solution with a .testrunconfig file.
There is an option i the testrunconfig file that is for code coverage, but when running a TFS build there is no code coverage results |
|tfs|build-process|code-coverage| |
I don't see the point in checking for existence of a file and throwing a FileNotFoundException with no message. The framework will throw the FileNotFoundException itself, with a message.
Another problem with your example is that you should be using the try/finally pattern or the using statement to ensure your disp... |
Since RPN is also known as postfix notation, I tried googling [convert "postfix to infix"][1] and got quite a few results. The first several have code examples, but I found the [RubyQuiz entry][2] particularly enlightening.
[1]: http://www.google.com/search?hl=en&q=convert+%22postfix+to+infix%22&btnG=Search
... |
Be aware that if you are planning to eventually deploy on Windows Vista or Windows Server 2008, many ways that this can be done today will not work. This is because of the introduction of a new security feature called "Session 0 Isolation".
Most windows services have been moved to run in Session 0 now in order to p... |
Be aware that if you are planning to eventually deploy on Windows Vista or Windows Server 2008, many ways that this can be done today will not work. This is because of the introduction of a new security feature called "Session 0 Isolation".
Most windows services have been moved to run in Session 0 now in order to p... |
An octree will work as long as you can specify the spheres by their centres - it hierarchically bins points into cubic regions with eight children. Working out neighbours in an octree data structure will require you to do sphere-intersecting-cube calculations (to some extent easier than they look) to work out which cu... |
How can I set triggers for sendmail? |
|unix|sendmail| |
If my email id receives an email from a particular sender, can I ask sendmail to trigger a different program and pass on the newly arrived email to it for further processing? This is similar to filters in gmail. Wait for some email to arrive, see if it matches the criteria and take some action if it does. |
If you are not doing replication, Write ahead Logs are the simplest solution. |
remove unused references(!= "using") visual studio |
|.net|reference| |
How can I find and delete unused references in my projects?
I know you can easely remove the using statements in vs 2008, but this doesn't remove the actual reference in your projects.
The referenced dll will still be copied in your bin/setup package.
|
You might be trying to re-invent the wheel. Is there a reason you can't use the standard HTTP(s) authentication? |
How to avoid temporary file creation on server-side when pushing back full HTML content to clients? |
|java|servlets|rpc|tomcat| |
I found the programmatic answer that I was looking for. It has to do with stations. Apparently anything running on the desktop will run on a station with a particular name. Anything that isn't on the desktop (i.e. a process started by the task manager when logged off or on a locked workstation) will get started with... |
What should be done to make TFS send e-mails for events? |
|tfs| |
Our Tfs server (Tfs2008) has smtp server installed. But we could not make Tfs send e-mails after events to the subscribers (we are using [EventSubscriptionTool](http://www.codeplex.com/tfseventsubscription)).
Our appsettings includes these lines:
<add key="emailNotificationFromAddress" value="tfs@mail.com" ... |
CreateHiddenFolder(string name)
{
DirectoryInfo di = new DirectoryInfo(name);
di.Create();
di.Attributes |= FileAttributes.Hidden;
}
|
If your code says "int newVal=42" then you would reasonably expect that newVal is never uninitialised. But if you goto over this statement (which is what you're doing) then that's exactly what happens - newVal is in-scope but has not been assigned.
If that is what you really meant to happen then the language require... |
Inmutability would have this effect. Changes to the object result in a new object. Lisp works this way under the covers.
Item 13 of [Effective Java][1] explains this technique.
[1]: http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1221744203&sr=8-1 |
Consider:
switch(val)
{
case VAL:
int newVal = 42;
default:
int newVal = 23;
}
In the absence of break statements, sometimes newVal gets declared twice, and you don't know whether it does until runtime. My guess is that the limitation is because of this kind of confusion.... |
I am not aware of any libraries that will do this out of the box but you should be able to take one of the many object to XML serialisation libraries and customise the backend code to generate Java. Would probably not be much code.
For example a quick google turned up [XStream][1]. I've never used it but is seems to... |
On a related topic - I've seen several replies suggesting using synchronized collection in order to achieve thread safety.
Using synchronized version of a collection doesn't make it "thread safe" - although each operation (insert, count etc.) is protected by mutex when combining two operations there is no guarantee th... |
<code>mysql\_real\_escape_string</code> should be used when you are receiving binary data, <code>addslashes</code> is for text input.
You can see the differences here: [mysql-real-escape-string][1] and [addslashes][2]
[1]: http://www.php.net/function.mysql-real-escape-string
[2]: http://www.php.net/addslas... |
this should do the trick:
<your application goes here>
if not ERRORLEVEL 0 pause
type "help if" in dos for more info on errorlevel usage. |