instruction stringlengths 0 30k ⌀ |
|---|
The bar will keep being raised with problems that computers are bad at and humans are good at. Something like recognising emotions in a human face is something humans are particularly good at.
Another option could be along the lines of differentiating between disgusting or nice. It's totally subjective, but humans... |
I'm confused about 2 things:
- why do you have files that you don't want to check in that other people *might* want to check in? seems like you'd get a conflict if that happened anyway
- does just "ignoring" in the human sense not work for you?
I'm just having trouble seeing a scenario where you wouldn't wa... |
Thanks Mauro. I was hoping for a solution which doesn't require going to every site collection, but it looks like there may not be one. |
I'm not sure if the syntax is exactly right but, if I understood you then this will do what you're after.
1. Create the column allowing nulls in database2.
2. Perform an update:
UPDATE database2.dbo.tablename
SET database2.dbo.tablename.colname = database1.dbo.tablename.colname
FROM database2.dbo... |
Inserting won't do it since it'll attempt to insert new rows at the end of the table. What it sounds like your trying to do is add a column to the end of existing rows.
I'm not sure if the syntax is exactly right but, if I understood you then this will do what you're after.
1. Create the column allowing nulls in... |
If you would just like to know how much memory is being used in your JVM, and how much is free, you could try something like this:
// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();
// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
... |
If you would just like to know how much memory is being used in your JVM, and how much is free, you could try something like this:
// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();
// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
... |
At first blush it sounds more like you have two different types of users and they have different access levels. This could be solved by inheritance (PowerUser, User) or by containing a security object or token that sets the level for the user.
If you don't like inheritance as a rule, you could use a State pattern... |
@Keith,
I agree with all of your rules except #4. Adding a finalizer should only be done under very specific circumstances. If a class uses unmanaged resources, those should be cleaned up in your Dispose(bool) function. This same function should only cleanup managed resources when bool is true. Adding a finalizer ad... |
In general I try to have only a single exit point from a function. There are times, however, that doing so actually ends up creating a more complex function body than is necessary, in which case it's better to have multiple exit points. It really has to be a "judgement call" based on the resulting complexity, but the g... |
If you have half decent 3D acceleration on board, CompizFusion adds attractive desktop effects like mapping your workspaces onto a cube using that to switch between them/move windows between them. Looks pretty and improves general usability - great!
[http://en.wikipedia.org/wiki/Compiz][1]
[1]: http://en.wiki... |
Assuming you're using data binding, setting [Binding.IsAsync][1] property to True seems to be a standard way to achieve this.
If you're loading the bitmap in the code-behind file using background thread + Dispatcher object is a common way to update UI asynchronous
[1]: http://msdn.microsoft.com/en-us/library/syst... |
You want a left join, instead of an inner join, as that allows records to not exist. |
LEFT join is your friend.
To learn more about different join types refer to http://en.wikipedia.org/wiki/Join_(SQL)
|
Another vote up for [Dina][1]. As long as you use it at its optimum size (9 pt), it looks great.
![alt text][2]
[1]: http://www.donationcoder.com/Software/Jibz/Dina/
[2]: http://www.donationcoder.com/Software/Jibz/Dina/dina_c.png |
SQL Query, Count with 0 count |
|sql| |
I'm not 100% sure what you are asking, but here is an example that works with virtual functions:
#include <iostream>
using namespace std;
class A {
public:
virtual void foo() { cout << "A::foo\n"; }
};
class B : public A {
public:
virtual void foo() { cout << "B... |
Try actually looking at the output from your datacontext before you pass judgement.
DataContext.Log() will give you the generated SQL.
|
I agree with [Esteban](http://stackoverflow.com/questions/59974/implementing-large-system-changes#59985) that gradual releases are best. It's like remodeling a house: getting it over with seems like a good idea initially. But means you have to plan everything upfront, hire a bunch of contractors and move out. Then s... |
How do you resize an IE browser window to 1024 x 768 |
|javascript| |
In Firefox you can enter the following into the awesome bar and hit enter:
javascript:self.resizeTo(1024,768);
How do you do the same thing in IE? |
By far the easiest way is Red Gate's SQL Data Compare. You can set it up to do just what you described in a minute or two. |
Alas there is no built-in way to do this. Either use a for loop or create a temp variable that you increment on each pass. |
Try:
javascript:resizeTo(1024,768);
This works in IE7 at least. |
You cannot serialize IMessageHeader because you can't do Activator.CreateInstance(typeof(IMessageHeader)) which is what serialization is going to do under the covers. You need a concrete type.
You can do typeof(MessageHeader) or you could say, have an instance of MessageHeader and do
XmlSerializer serializer... |
It works in IE6, but I think IE7 added some security around this? |
Strange that I did not see WireShark when I visited SourceForge. The top result of the 60 returned was a bizarre german thing. |
Passing $_POST values with cURL |
|php| |
How do you pass $_POST values to a page using cURL? |
|php|post|curl| |
> Please let me know, if you have any (good or bad) experience with model-driven approaches or why you think it's not interesting at all.
I think the contributors here are part of the "No Silver Bullet" camp (I am definitely). If MDA worked (equals to "huge savings"), we would know it, that is for sure. The question... |
You can also use sys.platform if you already have imported sys and you don't want to import another module
>>> import sys
>>> sys.platform
'linux2' |
>select max_utilization from v$resource_limit where resource_name = 'sessions'
A good overview of Oracle system views can be found [here][1].
[1]: http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html |
select max__utilization from v$resource__limit where resource__name = 'sessions';
A good overview of Oracle system views can be found [here][1].
[1]: http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html |
> select max _ utilization from
> v$resource _ limit where resource _
> name = 'sessions';
A good overview of Oracle system views can be found [here][1].
[1]: http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html |
select max _ utilization
from
v$resource _ limit where resource _ name = 'sessions';
A good overview of Oracle system views can be found [here][1].
[1]: http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html |
select max_utilization from v$resource_limit where resource_name = 'sessions';
A good overview of Oracle system views can be found [here][1].
[1]: http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html |
How do I get the path where the user installed my Java application? |
|java| |
I want to bring up a file dialog in Java that defaults to the application installation directory. What's the best way to get that information programmatically? |
Also, another big issue with the IIf is that it will actually call any functions that are in the arguments [1], so if you have a situation like the following:
string results = IIf(Not oraData.IsDBNull(ndx), oraData.GetString(ndx), string.Empty)
It will actually throw an exception, which is not how most people... |
You could use [SWT](http://www.eclipse.org/swt) for your GUI. Its Browser control allows you to embed IE, Mozilla or Safari (depending on the platform you're running in) with little pain. |
Here are some <a href="http://c2.com/cgi/wiki?WikiPagesAboutRefactoring">Wiki pages about refactoring</a> that explore various principles and guidelines. |
Yes, we use Flex with .Net web services extensively.
Flex can't handle .Net DataSets, or indeed much by way of complex xml types. We found that it was best to keep to relatively simple xml output.
However, if you do that, it can handle .Net web service output fine:
<mx:WebService id="myDataService" showBus... |
I think if you reference SP1 assemblies, it should automatically target SP1. |
How do I *really* justify a horizontal menu in HTML+CSS? |
|html|css| |
You find plenty of tutorials on menu bars in HTML, but for this specific (though IMHO generic) case, I haven't found any decent solution:
# THE MENU ITEMS SHOULD BE JUSTIFIED JUST AS PLAIN TEXT WOULD BE #
# ^ ^ ... |
Xp maintains a routing table where it maps ranges of ip-adresses to networks and gateways.
you can view the table using "route print", with "route add" you can add a route to your embedded device. |
You could try setting an AsyncPostBackTrigger on the updatePanel to watch the value of a hidden field. Then in the javascript onMouseHover event, increment the hidden value. This would fire the AsyncPostBackTrigger, updating the UpdatePanel. |
Remember that PowerShell can access .Net objects. The Start-Sleep as suggested by [Blair Conrad][1] can be replaced by a call to [WaitForInputIdle][2] of the server process so you know when the server is ready before starting the client.
$sp = get-process server-application
$sp.WaitForInputIdle()
You cou... |
I have three tables *page*, *attachment*, *page-attachment*
i have data like this
page
ID NAME
1 first page
2 second page
3 third page
4 fourth page
attachment
ID NAME
1 foo.word
2 test.xsl
3 mm.ppt
page-attac... |
I have three tables *page*, *attachment*, *page-attachment*
i have data like this
page
ID NAME
1 first page
2 second page
3 third page
4 fourth page
attachment
ID NAME
1 foo.word
2 test.xsl
3 mm.ppt
page-attac... |
I second Consolas, Inconsolata, DejaVu Sans Mono, and Droid Sans Mono, with my preference going towards the Droid one. |
+1 on the template approach.
But since this question has tag Git, the distributed alternative
springs to mind, in which customizations are kept on a private testing
branch:
A---B---C---D--- <- mainline (public)
\ \
B'------D'--- <- testing (private)
In this sch... |
Sounds like a bug. If you can replicate this, I recommend you contact Microsoft Support or use the Microsoft Connect bug reporting web site. I did not find any mention of this in a preliminary search. |
Maybe not directly related if you were looking for only a JavaScript solution but you can use the free Windows utility [Sizer][1] to automatically resize any (browser) window to a predefined size like 800x600, 1024,768, etc.
![alt text][2]
[1]: http://www.brianapps.net/sizer.html
[2]: http://www.brianapps.... |
Google Maps in Flex Component |
|apache-flex|actionscript-3|google-maps| |
I'm embedding the Google Maps Flash API in Flex and it runs fine locally with the watermark on it, etc. When I upload it to the server (flex.mydomain.com) I get a sandbox security error listed below:
SecurityError: Error #2121: Security sandbox violation: Loader.content: http://mydomain.com/main.swf?Fri, 12 ... |
`myKey = Array.IndexOf(values, val);` |
**The client, of course, would likely balk at that number and might say no more than 1 hour of downtime per year is acceptable. That's 12 times more stable. Do you tell the customer, sorry, we can't do that for $100,000, or do you make your best attempt, hoping your analysis was conservative?**
Flat out tell the cus... |
Java sound recording and mixer settings question |
|java| |
I'm using the javax.sound.sampled package in a radio data mode decoding program. To use the program the user feeds audio from their radio receiver into their PC's line input. The user is also required to use their mixer program to select the line in as the recording input. The trouble is some users don't know how to do... |
A lot of people use VBScript for Classic ASP, but you can use JavaScript / JScript on the server as an alternative. As a matter of fact, this is my preferred way of doing Classic ASP before finally moving to .NET (except in some cases, you will have to mix in VBScript for special cases, i.e. Disconnected Recordset, Ex... |
You could also use a cursor. Assuming you want to iterate all the records in the first table and populate the second table with new rows then something like this would be the way to go:
DECLARE @FirstField nvarchar(100)
DECLARE ACursor CURSOR FOR
SELECT FirstField FROM FirstTable
OPEN ACursor
FETCH NEXT FRO... |
You could also use a cursor. Assuming you want to iterate all the records in the first table and populate the second table with new rows then something like this would be the way to go:
DECLARE @FirstField nvarchar(100)
DECLARE ACursor CURSOR FOR
SELECT FirstField FROM FirstTable
OP... |
If you're wanting the current framework version **in use** then you can see that via:
System.Environment.Version |
OK, Needleman-Wunsch(NW) is a classic end-to-end ("global") aligner from the bioinformatics literature. It was long ago available as "align" and "align0" in the FASTA package. The difference was that the "0" version wasn't as biased about avoiding end-gapping, which often allowed favoring high-quality internal matche... |
OK, Needleman-Wunsch(NW) is a classic end-to-end ("global") aligner from the bioinformatics literature. It was long ago available as "align" and "align0" in the FASTA package. The difference was that the "0" version wasn't as biased about avoiding end-gapping, which often allowed favoring high-quality internal matche... |
It's not necessarily running I would say. Since you can have .NET 1.1, 2.0, 3.0 and 3.5 installed on the same machine and they can run perfectly side-by-side. Meaning one of your app can be running on top of 1.1 and another web application is running on 2.0.
In IIS (for web app), this is quite easy, just go to the ... |
The fact that you can't migrate this over to a database or a text file is a bit of an issue as they would be the best solution for this type of data. However, if you have to have it in the code you could always try putting it into a matrix that you predefine. Then you could provide a function that returns the data from... |
At the prompt does:
osql -E -S <servername>
... get you a > prompt ?
|
I strongly recommend following Groky's advice and using a single-form interface rather than MDI for this.
If you must use MDI, you need to know that the MDI layout methods use the Z-order of MDI forms to determine where the forms end up. For example, if image 2 is behind image 1, then image 1 will be on the left an... |
Ruby, shorter than the other ones so far:
def a;a;end;a
(13 chars) |
What is the downside to Test Driven Development? |
|unit-testing|testing|tdd| |
What do I lose by adopting test driven design. I am not looking for the positives, only the negatives. |
Windows Form Ordering using MDILayout |
|c#|mdilayout|tilehorizontal|tilevertical| |
I have a very specific problem using C# and a Windows MDI Form application. I want to display two (or more) images to the user, a 'left' and a 'right' image. The names of the images are concealed from the user, and then the user selects which image they prefer (this is part of a study involving medical image quality,... |
|c#|winforms|mdi| |
Replication is the "right" way to go, so if migrating to another database is an option (is it really?), that's the best route.
You might consider a utility that queries all the tables for raw data (in CSV?), sending that to files. Then at least you don't have to take the database down to do the backup. |
The other integration I worked on was integrating to MS Project but the integration was a little messy requiring upload of .mpp files and then using MPXJ to extract project information from the .mpp file
The result was OK I suppose
<project file="AOZA_BEPPI_Billing_Project_Plan_v0.2.mpp" type="list" user="Mar... |
It really depends on a lot of factors. To mention but a few: the development methodology you are using, the amount of testing resource you have, the number of developers available at this stage in the project (many project managers will move people onto something new at the end).
As Rob Rolnick says 1:1 is a good ru... |
It really depends on a lot of factors. To mention but a few: the development methodology you are using, the amount of testing resource you have, the number of developers available at this stage in the project (many project managers will move people onto something new at the end).
As Rob Rolnick says 1:1 is a good ru... |
I would try something like the following subquery and forget about changing your data structures.
SELECT
*
FROM
Thing
WHERE
(ThingID, PriceDateTime) IN
(SELECT
ThingID,
max(PriceDateTime )
FROM
Thing
WHERE
ThingID IN (1,2,3,4... |
I would try something like the following subquery and forget about changing your data structures.
SELECT
*
FROM
Thing
WHERE
(ThingID, PriceDateTime) IN
(SELECT
ThingID,
max(PriceDateTime )
FROM
Thing
WHERE
ThingID IN (1,2,3,4... |
Quick combinatoric proof that you can't really save much space:
Suppose you have an arbitrary subset of n/2 bits set to 1 out of n total bits. You have (n choose n/2) possibilities. Using [Stirling's formula][1], this is roughly 2^n / sqrt(n) * sqrt(2/pi). If every possibility is equally likely, then there's no w... |
Usually I use [jaxb](https://jaxb.dev.java.net/) or [XMLBeans](http://xmlbeans.apache.org/) if I need to create objects serializable to XML. Now, I can see that [XStream](http://xstream.codehaus.org/) might be very useful as it's nonintrusive and has really simple api. I'll play with it soon and probably use it. The on... |
Firefox vs. IE: innerHTML handling |
|javascript|firefox|dom|internet-explorer| |
After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript).
Has anyone else found this to be true? Any interesting work-around... |
Have your initial create table statements in version controller, then add alter table statements, but never edit files, just more alter files ideally named sequentially, or even as a "change set", so you can find all the changes for a particular deployment.
The hardiest part that I can see, is tracking depend... |
This message my be tagged asp.net but I think it is a platform independent issue that pains all new web developers as they seek a 'clean' way to do this.
I think the two options in achieving this are:
1. A param in the url
2. A url stored in the session
I don't like the url method, it is a bit messy, and yo... |
Referencing back to the parent from a child object |