instruction
stringlengths
0
30k
From [here](http://blogs.x2line.com/al/articles/350.aspx): <a href="javascript:window.opener='x';window.close();">Close</a> You need to set window.opener to something, otherswise it complains.
use windows installer properties. will probably be easier. <http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx#system_folder_properties>
The browser is complaining because you're using JavaScript to close a window that wasn't opened with JavaScript, i.e. `window.open('foo.html');`.
You should probably use API for this, such as [SHGetFolderPath][1] [1]: http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx
The wikipedia article is actually rather nice. Not a full account of everything, but not too shabby either. http://en.wikipedia.org/wiki/Windows_Registry
Check the Debug tab on your project's properties page. There should be an "Enable unmanaged code debugging" checkbox. This worked for me when we developed a new .NET UI for our old c++ DLLs.
Check the Debug tab on your project's properties page. There should be an "Enable unmanaged code debugging" checkbox. This worked for me when we developed a new .NET UI for our old c++ DLLs. If your unmanaged DLL is being built from another project (for a while ours were being built using VS6) just make sure you ha...
I agree with John Millikin. You can add in `<span>` tags or something around each line with a CSS class defined, then make them display:block if necessary. The only other way I can think to do this is to make the `<input>` an inline-block and make them emit "very large" padding-right, which would make the inline conten...
String concatenation is slow, because it creates multiple `String` objects under the hood. When you need to concatenate many strings, you'd better use a `StringBuffer`.
One shouldn't be faster than the other. Some people believe that string concatenation is slow in Java, because it would create multiple `String` objects "under the hood". However, as the [JavaDoc for StringBuffer][1] states, at least since Java 5 using the "+" operator boils down to creating a `StringBuffer` and `appen...
One shouldn't be faster than the other. This wasn't true before Java 1.4.2, because when concatenating more than two strings using the "+" operator, intermediate `String` objects would be created during the process of building the final string. However, as the [JavaDoc for StringBuffer][1] states, at least since Jav...
The bug is not actually FCKeditors fault. As long as you let users edit HTML that will be displayed on your web site they will always have to possibility to do harm unless you check the data before you output it. Some people use HTMLencoding to do this, but that will destroy all the formatting done by FCKeditor, not...
The bug is not actually FCKeditors fault. As long as you let users edit HTML that will be displayed on your web site they will always have to possibility to do harm unless you check the data before you output it. Some people use HTMLencoding to do this, but that will destroy all the formatting done by FCKeditor, not...
Huh? I guess, I don't get the question? Can't you just end your pipe into a `>> ~file` For example echo "Foobar" >> /home/mo/dumpfile will append Foobar to the dumpfile (and create dumpfile if necessary). No need for a shell script... Is that what you were looking for?
If you want to analyze it in the script: while /bin/true; do read LINE echo $LINE > $OUTPUT done But you can simply use cat. If cat gets something on the stdin, it will echo it to the stdout, so you'll have to pipe it to cat >$OUTPUT. These will do the same. The second works for binary ...
I figured it out afterall... #define GCD(a,b) ((a>=b)*GCD_1(a,b)+(a<b)*GCD_1(b,a)) #define GCD_1(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_2((b), (a)%((b)+!(b)))) #define GCD_2(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_3((b), (a)%((b)+!(b)))) #define GCD_3(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_4((b), (a)%((b)+!(b)...
if you don't care about outputting the result cat - > filename or cat > filename
Adobe distributes a test framework themselves: [FlexUnit](http://opensource.adobe.com/wiki/display/flexunit/FlexUnit).
If you want a shell script, try this: #!/bin/sh exec cat >/path/to/file
REST is an architecture, SOAP is a protocol. That's the first problem. You can send SOAP envelopes in a REST application. SOAP itself is actually pretty basic and simple, it's the WSS-* standards on top of it that make it very complex. If your consumers are other applications and other servers, there's a lo...
If the compiler doesn't support 64 bit enums by compilation flags or any other means I think there is no solution to this one. You could create something like in your sample something like: namespace MyNamespace { const uint64 LARGE_VALUE = 0x1000000000000000; }; and using it just like an enum us...
A CDATA section is required if you are using XHTML in order for it to validate, as XHTML will parse the JavaScript code as parsed character data as opposed to character data by default. This is not an issue with scripts that are stored in external source files, but for any inline JavaScript in XHTML you will want to u...
How do I run a program as nobody?
|c|linux|security|ubuntu|
I want a user-privileged (not root) process to launch new processes as user "nobody". I've tried a straight call to setuid that fails with -1 EPERM on Ubuntu 8.04: #include <sys/types.h> #include <unistd.h> int main() { setuid(65534); while (1); return 0; } How s...
I would use bitkeeper. I've used bitkeeper, clearcase, accurev, perforce, subversion, cvs, sccs and rcs, and out of all of those bitkeeper was far and above the best. I've toyed with git and was impressed by its speed, but I thought its UI was a little cumbersome (though that opinion was formed after only using it fo...
Java applet cached forever, not downloading new version?
|java|caching|applet|
We have a case where clients seem to be eternally caching versions of applets. We're making use of the `<param name="cache_version">` tag correctly within our `<object>` tag, or so we think. We went from a version string of `7.1.0.40` to `7.1.0.42` and this triggered a download for only about half of our clients. ...
It sort of depends on what you're trying to do. If *all* you want is make-style target dependencies and command invocation, then Make is actually one of the better tools for the task. :-) Rake is very nice, but can be clumsy for some simple cases. Ant is of course verbosity city, but it has better support for build...
Google has excellent testing framework. <http://code.google.com/p/googletest/wiki/GoogleTestPrimer>
Google has excellent testing framework. <http://code.google.com/p/googletest/wiki/GoogleTestPrimer> And yes, as far as I see it will work with plain C, i.e. doesn't require C++ features (may require C++ compiler, not sure).
Also a return in finally will throw away any exception. [http://jamesjava.blogspot.com/2006/03/dont-return-in-finally-clause.html][1] [1]: http://jamesjava.blogspot.com/2006/03/dont-return-in-finally-clause.html
You've actually hit the nail on the head in your description. There is no single website that'll provide you with the detail you seek in every one of those facets. I find these three are incredibly useful when starting on a blank page: [Mozilla DOM Reference][1] (for general js syntax, etc), [w3schools x/html refere...
the following would give you the newlines. It would also put extra spaces out in front though... you'd have to mess up your source indentation by removing the tabbing. form { white-space: pre }
I would suggest to work with macros over subant/antcall because the main advantage I found with macros is that you're in complete control over the properties that are passed to the macro (especially if you want to add new properties). You simply refactor your Ant script starting with your target: <target name...
A logical way to think about this is: 1. Code placed in a finally block must be executed **whatever occurs** within the try block 2. So if code in the try block tries to return a value or throw an exception the item is placed 'on the shelf' till the finally block can execute 3. Because code in the finally block...
Perl Robot?
|java|perl|awt|bot|robot|
Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl?
How to load Many to many LINQ query?
|linq-to-sql|
I have the following (pretty standard) table structure: Post <-> PostTag <-> Tag Suppose I have the following records: PostID Title 1, 'Foo' 2, 'Bar' 3, 'Baz' TagID Name 1, 'Foo' 2, 'Bar' PostID TagID 1 1 1 2 2 2 ...
> **Amendment:** Sorry, I forgot to mention that the base class is a non-abstract class. In this new light, I'm pretty sure that you do not want to force anyone to override Clone() at all. For example, if my derived class does not add any fields it probably does not need its own specialized Clone() method.
Network Map Algorithm that Detects Unmanaged Layer 2 Switches?
|networking|topology|
I've inherited a network spread out over a warehouse/front office consisting of approximately 50 desktop PCs, various servers, network printers, and routers/switches. The "intelligent" routers live in the server room. As the company has grown, we've annexed additional space and not very elegantly run various lengths...
I've inherited a network spread out over a warehouse/front office consisting of approximately 50 desktop PCs, various servers, network printers, and routers/switches. The "intelligent" routers live in the server room. As the company has grown, we've annexed additional space and not very elegantly run various lengths...
Here's one idea: Open the Under `Advanced Delivery` options (`SMTP Virtual Server Properties` &gt; `Delivery` tab &gt; `Advanced`). There you can set a "Smart Host" which is the SMTP server that will be used to actually send the mail, so you could possibly have it deliver directly to the specific domain's incoming ...
Here's one idea: Under `Advanced Delivery` options (`SMTP Virtual Server Properties` &gt; `Delivery` tab &gt; `Advanced`). There you can set a "Smart Host" which is the SMTP server that will be used to actually send the mail, so you could possibly have it deliver directly to the specific domain's incoming SMTP serv...
your snipplet of code is not c++ standard: > enum MY_ENUM : unsigned __int64 does not make sense. use const __int64 instead, as Torlack suggests
Depending on the size of the databases speed of the drive can be a real factor. I would look into something like Drobo but with an eSata or SAS interface. There is nothing more entertaining than watching a terabyte go through USB 2.0. Also, you might consider something like hyperbac or RedGate SQL Backup to compress th...
Mixing C# Code and umanaged C++ code on Windows with Visual Studio.
|c#|unmanaged|windows|visual-c++|
I would like to call my umanaged C++ libraries from my C# code. What are the potential pitfalls and precautions that need to be taken. Thank you for your time.
|c#|windows|visual-c++|unmanaged|
I would like to call my unmanaged C++ libraries from my C# code. What are the potential pitfalls and precautions that need to be taken? Thank you for your time.
Only when you have at that late stage some independent (almost 0% interaction with other parts of the project) tasks not tackled yet by anybody and you can bring on the team somebody that is a specialist in that domain. The addition of a team member has to minimize the disruption for the rest of the team.
Scaling cheaply: MySQL and MS SQL
|sql|sql-server|mysql|scalability|scaling|
How cheap can MySQL be compared to MS SQL when you have tons of data (and joins/search)? Consider a site like stackoverflow full of Q&As already and after getting dugg. My ASP.NET sites are currently on SQL Server Express so I don't have any idea how cost compares in the long run. Although after a quick research, ...
If exim or sendmail is what's writing into the pipe, then procmail is a good answer because it'll give you file locking/serialization and you can put it all in the same file. If you just want to write into a file, then - tee > /tmp/log.$$ or - cat > /tmp/log.$$ might be good enough.
Cache... hard. Record hits, and if a spike occurs, write out a completely static copy of the page being hit, then serve that. Cutting DB queries from 100 to 2 with a good caching system can survive a weak slashdotting, but having any DB queries at all will still result in a dead site under serious load that you aren...
Assuming this is about Windows, NVIDIA has a [GLExpert](http://developer.nvidia.com/object/glexpert_home.html) tool. It can print various OpenGL warnings/errors. In some other cases, using [GLIntercept] (http://glintercept.nutty.org/) OpenGL call interceptor with error checking turned on can be useful. If the too...
You need to use the UIImagePickerController class, basically: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = pickerDelegate picker.sourceType = UIImagePickerControllerSourceTypeCamera the pickerDelegate object above needs to implement the following method...
I figured out a better way of doing this, using the CellFormatting event: Private Sub uxContacts_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles uxContacts.CellFormatting If uxContacts.CurrentCell IsNot Nothing Then If e.Ro...
Debian's .deb packages are just "ar" archives containing tarballs. You can manipulate both types of files using cygwin or msys quite easily: $ ar xv asciidoc_8.2.1-2_all.deb x - debian-binary x - control.tar.gz x - data.tar.gz $ tar -tzf control.tar.gz ./ ./conffiles ./md5...
asp.net dropDownBox selectedIndex not being maintained.
|asp.net|.net-2.0|
I have a weird problem with a dropdownbox selectedIndex always being set to 0 upon postback. I'm not accidentally rebinding it in my code. In fact I've placed a breakpoint at the very first line of the page_load event and the value is already set to zero. The dropdown is in the master page of my project, I don't know i...
I have a weird problem with a dropdownbox selectedIndex always being set to 0 upon postback. I'm not accidentally rebinding it in my code. In fact I've placed a breakpoint at the very first line of the page_load event and the value is already set to zero. The dropdown is in the master page of my project, I don't know i...
It'd be best to wrap all of your elements in label elements, then apply css to the labels. The :before and :after pseudo classes are not completely supported in a consistent way. Label tags have a lot of advantages including increased accessibility(on multiple levels) and more. <pre> <code> &lt;label for...
Every organization/group has it's own standard. The important thing is that you stick to whatever notation you choose otherwise your customers will be confused. Having said that I've used normally 3 numbers: x.yz.bbbbb. Where: x: is the major version (major new features) y: is the minor version number (small new f...
If excessive garbage collection is a concern, you can always reuse unused high-churn objects. Create a factory that keeps a queue of SoftReferences to recycled objects, using those before creating new objects. Then in code that uses these objects, explicitly return these objects to the factory for recycling.
The Objective-J Tools package (cappuccino.org/download) and the source on github now include vim highlight modules.
The Objective-J Tools package (http://cappuccino.org/download) and the source on github now include a vim highlight module.
If you hash in a time-stamp along with the user name and password, you can close the window for replay attacks to within a couple of seconds. I don't know if this meets your needs, but it is at least a partial solution.
In general, polling is less efficient than being notified when something happens. Additionally, if you're checking whether something is reading from a disk, you will probably be accessing said disk yourself, possibly influencing what you're trying to observe. Since 10.5, OSX includes something called the File System...
I'd like to add to bosnic's answer that any valid currency character is legal for an identifier in Java. th€is is a legal identifier, as is €this, and € as well. However, I can't figure out how to edit his or her answer, so I am forced to post this trivial addition.
Use the builtin `unichr` -- BeautifulSoup isn't necessary: >>> entity = '&#x01ce' >>> unichr(int(entity[3:],16)) u'\u01ce'
SQL/Oracle: when indexes on multiple columns can be used
|oracle-database|indexing|
If I create an index on columns (A, B, C), in that order, my understanding is that the database will be able to use it even if I search only on (A), or (A and B), or (A and B and C), but not if I search only on (B), or (C), or (B and C). Is this correct?
Don't use the registry to read this. Use <a href="http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx">SHGetFolderPath</a> with CSIDL_PROGRAMS.
Don't use the registry to read this. Use <a href="http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx">SHGetFolderPath</a> with CSIDL_PROGRAMS. For a reason why, see Raymond Chen's comments on the "Shell Folders" key: <http://blogs.msdn.com/oldnewthing/archive/2003/11/03/55532.aspx>
in addition to Lou's advise for starting the debugger, you can select which debug engines are used when attaching to an existing process by clicking on 'Select...' in the 'attach to process' dialog and choosing both 'managed code' and 'native code'. Debugging in this way is called mixed mode debugging. See this [bl...
ASP.NET MVC versus the Zeitgeist
|asp.net-mvc|model-view-controller|zend-framework|
ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarise how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of use...
|asp.net-mvc|model-view-controller|zend-framework|
WPF Databind Before Saving
|wpf|data-binding|
In my WPF application, I have a number of databound TextBoxes. The `UpdateSourceTrigger` for these bindings is `LostFocus`. The object is saved using the File menu. The problem I have is that it is possible to enter a new value into a TextBox, select Save from the File menu, and never persist the new value (the one vis...
In my WPF application, I have a number of databound TextBoxes. The `UpdateSourceTrigger` for these bindings is `LostFocus`. The object is saved using the File menu. The problem I have is that it is possible to enter a new value into a TextBox, select Save from the File menu, and never persist the new value (the one vis...
Do *not* use CDATA in HTML4 but you *should* use CDATA in XHTML and *must* use CDATA in XML if you have unescaped symbols like < and >.
As an aside, you might be interested to know that [Shawn Hargreaves][1], original developer of [Allegro][2], is one of the main developers on the XNA team :-) [1]: http://www.talula.demon.co.uk/ [2]: http://www.talula.demon.co.uk/allegro/index.html
How to test credit card interactions?
|testing|credit-card|
After reading [this answer][1], I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything. [1]: http://stackoverflow.com/questions/63668/confessions-of-your-worst-wtf-moment-what-not-to-do#63730
If you're happy with SQL as part of your life, CL-SQL provides a mapping into CLOS objects. It appears to be more mature than Elephant. I'm using it on my own website.