instruction stringlengths 0 30k ⌀ |
|---|
|stackoverflow|openid| |
I have more than one OpenID as I have tried out numerous. As people take up OpenID different suppliers are going to emerge I may want to switch provinders. As all IDs are me, and all are authenticated against the same email address, shouldn't I be able to log into stack overflow with any of them and be able to hit th... |
|stackoverflow|openid|belongs-on-uservoice| |
How do I use more than one OpenID? |
|openid| |
Windows Job Objects sounds like a good place to start. The name of the Job Object would have to be well-known, or passed to the children (or inherit the handle). The children would need to be notice when the parent dies, either through a failed IPC "heartbeat" or just WFMO/WFSO on the parent's process handle. At tha... |
Authentication with plain text can be done with CHAP style protocols. Is that possible over HTTP?
I'm asking, because I think that it would need some state on the server to foil replay-attacks - state on the server is something to be eliminated with RESTful architectures, right? |
if not a:
print "List is empty"
Using the implicit booleanness of the empty list is quite pythonic. |
Process this_process = Process.GetCurrentProcess();
int parent_pid = 0;
using (ManagementObject MgmtObj = new ManagementObject("win32_process.handle='" + this_process.Id.ToString() + "'"))
{
MgmtObj.Get();
parent_pid = Convert.ToInt32(MgmtObj["ParentProcessId"]);
}
string parent_p... |
Well, you need to be worried if you are not hosting it over HTTPS... because if it is straight HTTP, then yes it is being passed in plaintext.
I don't know Rails specifically, but I'm pretty sure it has nothing to do with whether you host it via HTTP or HTTPS.
Edit: I found [this link][1] which apparently provide... |
Well, you need to be worried if you are not hosting it over HTTPS... because if it is straight HTTP, then yes it is being passed in plaintext.
I don't know Rails specifically, but I'm pretty sure it has nothing to do with whether you host it via HTTP or HTTPS.
Edit: I found [this link][1] which apparently provide... |
Show us a small section of your code.
package inputverifier;
import javax.swing.*;
class Go {
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() { public void run() {
runEDT();
}});
}
priv... |
Well, after searching around and testing I don't think it is possible. It looks to me like IE does not allow the object tag access to a resource that is not on the same domain as the parent. It would have worked for me if the content I was trying to pull in was on same domain but it wasn't. If anyone could confirm m... |
At first one might think that reads and writes of the native machine size are atomic but there are a number of issues to deal with including cache coherency between processors/cores. Use atomic operations like Interlocked* on Windows and the equivalent on Linux. C++0x will have an "atomic" template to wrap these in a... |
At first one might think that reads and writes of the native machine size are atomic but there are a number of issues to deal with including cache coherency between processors/cores. Use atomic operations like Interlocked* on Windows and the equivalent on Linux. C++0x will have an "atomic" template to wrap these in a... |
Another option would be to something like this:
<form action="http://www.yacktrack.com/home" method="get" name="f">
<input type="hidden" name="query" />
</form>
then your javascript would be:
f.query.value=location.href; f.submit();
|
Another option would be to something like this:
<form action="http://www.yacktrack.com/home" method="get" name="f">
<input type="hidden" name="query" />
</form>
then your javascript would be:
f.query.value=location.href; f.submit();
or you could combine the [save link] with the submit li... |
In Subversion you can specify a range of versions to get an aggregate view of a series of commits. Is this possible in git? If so, how? |
|svn|git| |
|svn|git|diff| |
C (or any) compilers deterministic performance |
|c|compiler-construction|deterministic| |
Whilst working on a recent project, I was visited by a customer QA representitive, who asked me a question that I hadn't really considered before:
>How do you know that the compiler you are using generates machine code that matches the c code's functionality exactly and that the compiler is fully deterministic?
T... |
See if [twill][1] can help you. It can be used as a command line tool or as a python library.
[1]: http://twill.idyll.org/ |
What are the problems of using transactions in a database? |
|sql|transactions| |
From [this post][1]. One obvious problem is scalability/performance. What are the other problems that transactions use will provoke?
Could you say there are two sets of problems, one for long running transactions and one for short running ones? If yes, how would you define them?
[1]: http://stackoverflow.com/... |
From [this post][1]. One obvious problem is scalability/performance. What are the other problems that transactions use will provoke?
Could you say there are two sets of problems, one for long running transactions and one for short running ones? If yes, how would you define them?
EDIT: Deadlock is another problem,... |
|sql|transactions|deadlock| |
Try unit testing.
If that's not enough, use different compilers and compare the results of your unit tests. Compare strace outputs, run your tests in a VM, keep a log of disk and network I/O, then compare those.
Or propose to write your own compiler and tell them what it's going to cost. |
For Win32 debugging of memory leaks I have had very good experiences with the plain old CRT Debug Heap, that comes as a lib with Visual C.
In a Debug build malloc (et al) get redefined as _malloc_dbg (et al) and there are other calls to retrieve results, which are all undefined if _DEBUG is not set. It sets up all ... |
Visual studio automation: Enumerate opened windows upon solution loading. |
|visual-studio|vba|scripting|automation| |
How to enumerate opened code windows (i.e. those windows where you edit documents) upon solution loading using macros?
As you probably know, MSVS remembers opened documents, i.e. when you load solution, IDE will load previously opened files. What I want to do is to perform some actions with those windows upon soluti... |
Versioning your database is the way to go, but... Why conditionally create stored procedures. For Views, stored procedures, functions, just conditionally drop them and re-create them every time. If you conditionally create, then you will not clean-up databases that have a problem or a hack that got put in 2 years ago... |
This works well and supports multicore. <http://www.cpukiller.com/> |
Alternative:
[Excel OWC][1] is a great query and reporting tool if you are running OLAP. It's a little dated and poorly documented, but works well on the intranet and can squeak by over the net.
http://msdn.microsoft.com/en-us/magazine/cc164070.aspx
[1]: http://www.microsoft.com/downloads/details.aspx?family... |
ASP.NET - Performance Implications of a sql server database in the app_data folder |
|asp.net| |
The default asp.net membership provider uses a .mdf sql server database file in the app_code database. How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment? Is this recommended only for small/medium traffic sites? Thanks. |
|asp.net|sql-server|database| |
Can cout alter variables somehow? |
|c++|float|double|cout| |
Try the `bash` built-in help:
<pre><code>
$ help for
for: for NAME [in WORDS ... ;] do COMMANDS; done
The `for' loop executes a sequence of commands for each member in a
list of items. If `in WORDS ...;' is not present, then `in "$@"' is
assumed. For each element in WORDS, NAME is set to that el... |
You might find it's more efficient to traverse the DOM tree once when the page is loaded, get all elements' positions and sizes, and store them in an array/hash/etc. If you design the data structure well, you should be able to find an element at the given coordinates fairly quickly when you need it later.
Consider ... |
Printing a value to cout should not change the value of the paramter in any way at all.
However, I have seen similar behaviour, adding debugging statements causes a change in the value. In those cases, and probably this one as well my guess was that the additional statements were causing the compiler's optimizer to ... |
I dont think the cout has any effect on the variable, the problem would have to be somewhere else. |
You should definitely show them how to create a quick Grails application. Two domain classes that are related. Build a basic CRUD app. Explain that tables are being created behind the scenes using GORM(Hibernate). Then explain that you can create a war file and deploy it as you would any other Java war file. You ca... |
[Asirra][1] is the most adorable captcha ever.
[1]: http://research.microsoft.com/asirra/ |
The bash `for` consists on a variable (the iterator) and a list of words where the iterator will, well, iterate.
So, if you have a limited list of words, just put them in the following syntax:
for w in word1 word2 word3
do
doSomething($w)
done
Probably you want to iterate along some number... |
The answer I'm going with so far is a combination of the answers from fryguybob and Mendelt Siebenga.
Adding a base class would just pollute the namespace and introduce a similar problem, as Mendelt Siebenga pointed out. I would get more control over what items can go into the collection, but I'd still need to stor... |
Adding Items Using DataBinding from TreeView to ListBox WPF |
|wpf| |
I want to add the selected item from the TreeView to the ListBox control using DataBinding (If it can work with Databinding).
<TreeView HorizontalAlignment="Left" Margin="30,32,0,83" Name="treeView1" Width="133" >
</TreeView>
<ListBox Margin="208,36,93,0" ... |
|wpf|data-binding| |
To answer my own question (shamelessly), As already mentioned, access privileges are the only difference between them in C++.
I tend to use a struct for data-storage only. I'll allow it to get a few helper functions if it makes working with the data easier. However as soon as the data requires flow control (i.e.... |
Is there a ClientScriptManager.RegisterClientScriptInclude equivalent for CSS |
|asp.net|css| |
The [ClientScriptManager.RegisterClientScriptInclude][1] method allows you to register a JavaScript reference with the Page object (checking for duplicates).
Is there an equivalent of this method for CSS references?
Similar questions apply for [ClientScriptManager.RegisterClientScriptBlock][2] and [ClientScriptMa... |
How do I get an XML file as XML (and not a string) with Ajax in Prototype.js? |
|xml|prototype|javascript| |
This code is from Prototype.js. I've looked at probably 20 different tutorials, and I can't figure out why this is not working. The response I get is null.
new Ajax.Request( /path/to/xml/file.xml, {
method: "get",
contentType: "application/xml",
onSuccess: function( transport ) {
alert( ... |
For business apps, Windows Forms is very mature. It provides a gentle path from auto-generating a lot for you into allowing fine-grained control and rolling your own. There are tons of high-quality third party controls and a large body of examples, docs, etc out there. It's hard to run into a problem that someone else... |
If you're writing queries in SQL Management Studio you can enter: `SET STATISTICS TIME ON` and SQl Server will tell you how long the individual parts of a query took to parse, compile and execute.
You might be able to log this information by handling the InfoMessage event of the SqlConnection class (but I think using ... |
<p>The only way I can think of doing this without a second run through the data would be by creating some formulas to do running totals per group. The problem I assume you are running into with the existing running totals is that they are intended to follow each of the groups that they are totaling. Since you seem to w... |
The [dpUint][1] testing framework has a test runner built with AIR which can be integrated with a build script.
There is also my [FlexUnit][2] automation kit which does more or less the same for FlexUnit. It has an Ant macro that makes it possible to run the tests as a part of an Ant script, for example:
<tar... |
Is it specific to the app you're working on or do all breakpoints in any app break the debugger?
Is anything different if you attach the debugger manually after launching the app normally? |
Check out [GIT][1]. A talk on it [here][2].
[1]: http://git.or.cz/
[2]: http://www.youtube.com/watch?v=4XpnKHJAok8 |
It seems perception is important to you, in that case you might want to consider working with a perceptual color space such as YUV, YCbCr or Lab. Everytime I've used those, they have given me much better results than sRGB alone.
Converting to and from sRGB can be a pain but in your case it could actually make the a... |
How do I remotely get a checksum for a file on a Windows machine? |
|windows|jakarta-ee|wmi|checksum| |
I'm trying to check, using an automated discovery tool, when JAR files in remote J2EE application servers have changed content. Currently, the system downloads the whole JAR using WMI to checksum it locally, which is slow for large JARs.
For UNIXy servers (and Windows servers with Cygwin), I can just log in over SSH... |
I'm trying to check, using an automated discovery tool, when JAR files in remote J2EE application servers have changed content. Currently, the system downloads the whole JAR using WMI to checksum it locally, which is slow for large JARs.
For UNIXy servers (and Windows servers with Cygwin), I can just log in over SSH... |
Best way to copy the entire contents of a directory in C# |
|c#|.net|copy| |
I want to copy the entire contents of a directory from one location to another in C#.
There doesn't appear to be a way to do this using `System.IO` classes without lots of recursion.
There is a method in VB that we can use if we add a reference to `Microsoft.VisualBasic`:
new Microsoft.VisualBasic.Devices.... |
If you do actually HTML encode every single output, the user will see plain text of &lt;html&gt; instead of a functioning web app. |
If you do actually HTML encode every single output, the user will see plain text of &lt;html&gt; instead of a functioning web app.
EDIT: If you HTML encode every single input, you'll have problem accepting external password containing < etc.. |
Pretty good list in my opinion.
However I wouldn't ask *tricky* questions on interview. Interview gives enough stress itself, trick question can confuse even highly skilled person. |
If you're brave and willing to roll your own, you could start with a PostScript library and augment it to deal with PDF, taking advantage of Adobe's [free online PDF reference][1].
[1]: http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference_1-7.pdf |
How do I get raw logs from Google Analytics? |
|google-analytics| |
Is it possible to obtain raw logs from Google Analytic? Is there any tool that can generate the raw logs from GA? |
What is the best way to do per-user database connections in Rails |
|ruby-on-rails| |
Well, it looks like you can't. *(Thanks [Marcio][1] for the suggestion, but sadly that didn't add anything useful)*
[1]: http://stackoverflow.com/questions/53365/getting-hibernate-to-log-clob-parameters#53419 |
You can try writing a class of your own to plugin and write methods that do comparison based on what you define. For example:
class Validate {
public function validateName($c1, $c2) {
if($c1->FirstName == "foo" && $c2->LastName == "foo") {
return true;
} else i... |
Depending on your needs, you COULD abuse the web browser control to show local files and folders. It won't match all the functionality of the OpenFileDialog, but it could work.
Here's one that I remembered from way-back. [The Shell Mega-Pack][1]. It has ActiveX and .NET versions. It looks promising.
Alternati... |
This is possible to do but very difficult. There are several steps you'll have to take.
First off, this only works on Palm OS 5 and is sketchy on some of the early Palm OS 5 devices. The latest devices are better but not perfect.
Next, you will need to create an alarm for your application using AlmSetAlarm. Th... |
Install [Mozlab][1] in Firefox and enable the telnet server, then open a socket.
[1]: http://hyperstruct.net/projects/mozlab |
It all boils down to trust. Does your customer trust any compiler? Use that, or at least compare output code between yours and theirs.
If they don't trust any, is there a reference implementation for the language? Could you convince them to trust it? Then compare yours against the reference or use the reference.
... |
You can apply that argument at any level: do you trust the third party libraries? do you trust the OS? do you trust the processor?
A good example of why this may be a valid concern of course, is how Ken Thompson put a backdoor into the original 'login' program ... and modified the C compiler so that even if you rec... |
Terminal emulation in Flex |
|apache-flex| |
I need to do some emulation of some old DOS or mainframe terminals in Flex. Something like the image below for example.
![alt text][1]
The different coloured text is easy enough, but the ability to do different background colours, such as the yellow background is beyond the capabilities of the standard Flash text... |
1. Changing the optimization level of the compiler will change the output.
1. Slight changes to a function may make the compiler inline or no longer inline a function.
1. Changes to the compiler (gcc versions for example) may change the output
1. Certain library functions may be instrinic (i.e., emit optimized a... |
How to run executable at end of Setup Project? |
|winforms|installation| |
I have a Visual Studio Setup Project that I use to install a fairly simple WinForms application. At the end of the install I have a custom user interface page that shows a single check box which asks the user if they want to run the application. I've seen other installers do this quite often. But I cannot find a way to... |
Not sure if this will work, but you can try this:
<pre><code>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Jquery - Get, change and restore hover handlers</title>
<script src="jquery.js"></script>
<... |