instruction stringlengths 0 30k ⌀ |
|---|
Quick answer is no, there is no guaranteed technique.
I don't see how you can make any application deadlock proof in general as a design principle if it has any non-trivial throughput. If you pre-emptively lock all the resources you could potentially need in a process in the same order even if you don't end up need... |
For polygon shapes with a reasonable number of boundary points such as in a GIS or games application it might be quicker easier to do a series of tests.
For each point in the red polygon compute the distance to each point in the blue polygons and find the closest (hint, compare distance^2 so you don't need the sqrt(... |
For polygon shapes with a reasonable number of boundary points such as in a GIS or games application it might be quicker easier to do a series of tests.
For each vertex in the red polygon compute the distance to each vertex in the blue polygons and find the closest (hint, compare distance^2 so you don't need the sqr... |
RSS is XML. It has very specific rules for encoding HTML. If you're generating it, I'd recommend using an xml library to write the node containing HTML, to be sure you get the encoding right.
HTMLencode will only perform the escaping necessary for embedding data within HTML, XML rules are more strict. |
Remote Debugging, Server Explorer, Compact Development (With Device Emulator). It really does depend on your situation but I don't think you'll be without a paddle in general. |
Would it be useful to add extra info to stack traces? |
|java|language-agnostic| |
Would it be useful to be able to mark objects where the value ofString.valueOf() would included in any stack trace. In my example below I used "trace". Variables that aren't declared at the point of the stack trace would just be ingored.
It would make debugging much easier and make it much easier to write programs th... |
They're the same thing... `rmiregistry` is a separate program, which you can run from a command line or a script, while `LocateRegistry.createRegistry` does the same thing programatically.
In my experience, for "real" servers you will want to use `rmiregistry` so that you know it's always running regardless of wheth... |
The [msdn doc][1]'s suggest that you can bind a Crystal Report to an ICollection.
Might I recommend a List(T) ?
[1]: http://msdn.microsoft.com/en-us/library/ms227595(VS.80).aspx |
Get a *good* hex editor and start looking inside some files. Look for common structure. Do some detective work. Look for fields that might be counts, sizes or offsets within the file. Make trivial changes in Finale and observe the changes in the file. Make changes with the hex editor, then load the changed file back in... |
I think the [Import/Export Wizard][1] exists in SQL Server 2000. Wizards are generally irritating, but it only takes a few minutes and you probably already have it installed.
The wizard can be used to create a [DTS package][2] that can append all of the data from your production database to the end of tables in ano... |
RMI vs. Web Services. What's best for Java2Java remoting? |
|web-services|remoting|rmi|jax-ws| |
I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS).
While on the one hand I would guess that there'... |
Lots of threads equate to lots of stack space, which will eat your memory - check out your -Xss settings for just how much, then do the math.
And if you ever have to do a notifyAll() for some reason, then of course you are waking up loads of extra threads - though you may not need to do that in your proposed archite... |
Delphi 7 and Windows Vista |
|delphi|windows-vista| |
I have a simple software that is made in Delphi 7, and it crashes on Vista after a while. These are totally random crashes, nothing is written in any crash log, just stops working and then Vista tries to find a solution.
Does anyone have any ideas ? |
What you are trying to do is to replace a "core" package (one which is
contained in the CentOS repository) with a newer package from a "3rd
party" repository (RPMForge), which is what the priorities plugin is
designed to prevent.
The RPMForge repository contains both additional packages not found in
CentOS, as w... |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+(System.Drawing) or ... |
Image cropping Silverlight |
Image cropping C# without .net library |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+(System.Drawing) or ... |
|c#|silverlight|image-manipulation| |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+(System.Drawing) or ... |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+(System.Drawing) or ... |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+(System.Drawing) or ... |
Assuming you get the color as RGB, first convert it to HSV (hue, saturation, value) color space. Then increase/decrease the value to produce lighter/darker shade of the color. Then convert back to RGB. |
I've found the latest release of NetBeans, which includes C/C++ support, to be excellent.
[http://www.netbeans.org/features/cpp/index.html][1]
[1]: http://www.netbeans.org/features/cpp/index.html |
Whats a good way to trim the GUI of a ASP.NET website? |
|asp.net|security|user-interface| |
I've been trimming the UI of our website by doing the following in the onload event of that control:
btnDelete.isVisible = user.IsInRole("can delete");
This has become very tedious because there are so many controls to check again and again. As soon as I get it all working, designers request to change the UI... |
If you are trying just to measure where it's at within a page as the external user the only thing that pops into my mind is a Firefox extension called [MeasureIt][1] I've used it occasionally for various measuring on web pages.
Are you trying to do this programmatically from within the embedded page itself and if so... |
I have worked with some fairly large functional projects. They usually fall into two camps (at least, the ones I have used):
- Extreme scalability/reliability/concurrency. Transactional models can be built very tightly into the language. Concurrent ML is a great example of this, and projects that use it are very h... |
Even if the drive letters are hidden - the volumes are still accessible unless you change ACLs on the filesystem itself - why is this so unpalatable? |
How to implement closures without gc? |
|garbage-collection|lexical-closures|language-design|code-generation|spaghetti-stack| |
I'm designing a language. First, I want to decide what code to generate. The language will have lexical closures and prototype based inheritance similar to javascript. But I'm not a fan of gc and try to avoid as much as possible. So the question: Is there an elegant way to implement closures without resorting to alloca... |
|code-generation|garbage-collection|language-design|lexical-closures|spaghetti-stack| |
I'm designing a language. First, I want to decide what code to generate. The language will have lexical closures and prototype based inheritance similar to javascript. But I'm not a fan of gc and try to avoid as much as possible. So the question: Is there an elegant way to implement closures without resorting to alloca... |
I kept to standard C/C++ for years before learning Win32 API, and to be quite blunt, this is not the best technical experience of my life.
In one hand Win32 API is quite cool. It's like an extension of the C standard API (who needs <code>fopen</code> when you can have <code>CreateFile</code>. But I guess UNIX/Linux/... |
You can add !important to the end of your style, like this:
element {
overflow: auto !important;
}
This is something you should not rely on normally, but in your case that's the only option. |
You can add !important to the end of your style, like this:
element {
overflow: hidden !important;
}
This is something you should not rely on normally, but in your case that's the best option. Changing the value in Javascript strays from the best practice of separating data, presentation, and be... |
I'm not sure to fully understand what you want to do.
If you want something like a generic Page, you can use a generic BasePage and put your generic methods into that BasePage:
Partial Public Class MyPage
Inherits MyGenericBasePage(Of MyType)
End Class
Public Class MyGenericBasePage(Of T ... |
In cases like that I write everything incrementally into a variable or sometimes an array and then echo the variable/array. It has the added advantage that the page always renders in one go, rather than progressively. |
I use [Guiffy][1] and it works well.
![alt text][2]
[1]: http://guiffy.org/
[2]: http://guiffy.org/images/CompareReportInFFThumb.jpg |
What I end up doing in this situation is building 'template' files of HTML data that I Include, and then parse through with regular expressions. It keeps the code clean, and makes it easier to hand pieces off to a designer, or other HTML person.
Check out the ideals behind MVC programming practices at [Wikipedia][1... |
Historically with Microsoft, the betas have been stricter at rendering pages in standards mode than the browsers' final releases.
The idea is that in the preview stage developers are the only ones looking, and MS will try to make them fix their sites by making the stricter mode default on the browser. But when it co... |
Use a mvc approach.
http://www.phpmvc.net/
This is not something that you will pick up in a couple of hours. You really need to practice it. Main thing is the controller will access your model (the db layer), do stuff to your data and then send it to the view for rendering. This is oversimplified but you just ne... |
After deleting the first application in IIS and its associated files on the disk, try restarting IIS (or your server if possible). Then come back and recreate the whole setup. |
Selenium internals |
|.net|testing|selenium| |
How does selenium work? Can you explain the internal working of it. |
From the sound of your problem, it seems you might not have much separation between logic and presentation in your code. When designing an application this is a very important consideration, for reasons exactly demonstrated by the situation your currently facing.
If you haven't already I'd take a look at some PHP te... |
Rather than use some non-standard control, what you should be doing is using un-obtrusive javascript to do it after the fact. See http://code.google.com/p/jquery-checkbox/ for an example.
Using the standard ASP checkbox simplifies writing the code. You don't have to write your own user control, and all your existin... |
What you are trying to do is to replace a "core" package (one which is
contained in the CentOS repository) with a newer package from a "3rd
party" repository (RPMForge), which is what the priorities plugin is
designed to prevent.
The RPMForge repository contains both additional packages not found in
CentOS, as w... |
a | b: evaluate b in **any** case
a || b: evaluate b **only if** a evaluates to true |
If you're lucky, java.math.BigInteger may do everything for you.
String s = "11001010001010101110101001001110";
byte[] bytes = (new java.math.BigInteger(s)).toByteArray();
This does depend on the byte order (big-endian) and right-aligning (if the number of bits is not a multiple of 8) being what you want... |
If you're lucky, java.math.BigInteger may do everything for you.
String s = "11001010001010101110101001001110";
byte[] bytes = (new java.math.BigInteger(s, 2)).toByteArray();
This does depend on the byte order (big-endian) and right-aligning (if the number of bits is not a multiple of 8) being what you w... |
Choosing xpath version for .net IIS apps |
|.net|iis|installation|xpath| |
I think the [Import/Export Wizard][1] exists in SQL Server 2000. Wizards are generally irritating, but it only takes a few minutes and you probably already have it installed.
The wizard can be used to create a [DTS package][2] that can append all of the data from your production database to the end of tables in ano... |
A quick google search turned up a nice looking possibility, [TagSoup][1].
[1]: http://blog.foosion.org/2008/06/09/parse-html-the-groovy-way/ |
You may want to look into the VS 2008 Express editions. Install them and see if you can do everything you need to using the Express editions. Most things that you need/use are in the Express editions, and they're Free. Also, you can use them for commercial use all you want. |
Is there any downside to redundant qualifiers? Any benefit? |
|performance|qualifiers|redundant| |
For example, referencing something as System.Data.Datagrid as opposed to just Datagrid. Please provide examples and explanation. Thanks. |
Would it be useful to include the class name and variable name in any NullPointerException message? |
|java| |
Would it be useful to include the class name and variable name in any NullPointerException message? I know that it might not always be possible because of changes made by a JIT but is seems like the info should be available often (class members, etc).
From: [http://jamesjava.blogspot.com/2005/04/what-was-null.html]... |
Not that it probably matters in this case, but Compilers, VMs and CPU's normally have special optimization techniques they user under the hood that will make for loops performance better (and in the near future parallel), in general they don't do that with while loops (because its harder to determine how it's actually ... |
IMO WPF is just starting to become a viable path for real software companies.. companies that have to maintain existing install bases are just now easing into .net 3.5 in their next-gen projects, and as part of that WPF is being considered..
i think the real issue is that WPF isnt for web apps, its for distributed ... |
How can I get word wrap to work in Eclipse PDT for PHP files? |
|php|eclipse|word-wrap|eclipse-pdt| |
Programming PHP in Eclipse PDT is predominately a joy: code completion, templates, method jumping, etc.
However, one thing that drives me crazy is that I can't get my lines in PHP files to word wrap so on long lines I'm typing out indefinitely to the right.
I click on Windows|Preferences and type in "wrap" and ge... |
DTO's aren't a performance concern. I think what you are asking about is the performance implications of tiering. In particular, using an application tier between your web tier (web server) and data tier (database server).
Generally, the implications are that latency is increased (you have extra network roundtrips... |
Normally MS publish examples on CodePlex (http://www.codeplex.com/MSFTRSProdSamples). But I didn't see any example for RDCE.
Sorry, but MS had never good documentation for reporting extensions. |
You could easily write crop yourself in fjcore. Start with the code for Resizer
[http://code.google.com/p/fjcore/source/browse/trunk/FJCore/Resize/ImageResizer.cs][1]
[1]: http://code.google.com/p/fjcore/source/browse/trunk/FJCore/Resize/ImageResizer.cs
and FilterNNResize -- you can see how the image data... |
Frequent SystemExit in Ruby when making HTTP calls |
|ruby|rubyonrails|crash| |
I have a Ruby on Rails Website that makes HTTP calls to an external Web Service.
About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine.
It's been happening since the site went live and I'v... |
|ruby|ruby-on-rails|crash| |
I have a Ruby on Rails Website that makes HTTP calls to an external Web Service.
About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine.
It's been happening since the site went live and I'v... |
You can add `!important` to the end of your style, like this:
element {
overflow: hidden !important;
}
This is something you should not rely on normally, but in your case that's the best option. Changing the value in Javascript strays from the best practice of separating markup, presentation, an... |
Run MySQLDump without Locking Tables |
|database|mysql|mysqldump| |
I want to copy a live production database into my local development database. Is there a way to do this without locking the production database?
I'm currently using:
mysqldump -u root --password=xxx -h xxx my_db1 | mysql -u root --password=xxx -h localhost my_db1
But it's locking each table as it runs. |
Take out the readyState and status checks. jQuery only calls your callback upon success. |
Take out the readyState and status checks. jQuery only calls your callback upon success. Your callback is supplied the arguments `(data, textStatus)`, so you should use `data` instead of `req.responseText`.
`window.setTimeout()` as suggested by another answer won't do what you want - that only waits and then calls... |
Take out the readyState and status checks. jQuery only calls your callback upon success. Your callback is supplied the arguments `(data, textStatus)`, so you should use `data` instead of `req.responseText`.
`window.setTimeout()` as suggested by another answer won't do what you want - that only waits and then calls... |
Take out the readyState and status checks. jQuery only calls your callback upon success. Your callback is supplied the arguments `(data, textStatus)`, so you should use `data` instead of `req.responseText`.
`window.setTimeout()` as suggested by another answer won't do what you want - that only waits and then calls... |
Take out the readyState and status checks. jQuery only calls your callback upon success. Your callback is supplied the arguments `(data, textStatus)`, so you should use `data` instead of `req.responseText`.
`window.setTimeout()` as suggested by another answer won't do what you want - that only waits and then calls... |
We've got a .net CMS running on IIS 6 which uses xslt templates. It seems to be running xpath 1.0 (as we can't use any 2.0 functionality).
How do we go about installing or specifying that IIS should use xpath 2.0? Is it installed per server, or can we specify which version to use on a per-application pool or per-sit... |
![alt text][1]
[1]: http://www.processdevelopers.com/images/PM_Build_Swing.gif |
<img src="http://www.processdevelopers.com/images/PM_Build_Swing.gif" width="640"/> |
Pick a side :)
In short IOC is recommended. The problem with the code is that I cannot swap out the default implementation of the dependency without recompiling the code as you have stated at the end. IOC allows you to change the configuration or composition of your object in an external file without recompilation. ... |
I think the & in &pUnkReturn is needed, based on the hungarian prefix. I expect pUnkReturn to have type IUnknown*. The message receiver will provide the IUnknown*. The address where it will store that IUnknown* is an IUnknown**. Hence, this code passes in &pUnkReturn and the message receiver writes to *(IUnknown**)wPar... |
Besides loose coupling, an IoC will reduce code duplication. When you use an IoC and you want to change the default implementation of your interface, you have to change it at only one place. When you use default contructors to inject the default implementation, you have to change it everywhere the interface is used. |
![alt text][1]
[1]: http://i50.photobucket.com/albums/f324/ann1024/DevelopersAreBornBrave_Small.jpg |