instruction stringlengths 0 30k ⌀ |
|---|
Unfortunately, no, there's not really a better way. If you're just tired of making the keystrokes, you can use macros to trim them down. Add the following to your `~/.inputrc`:
"\C-x6": "\C-a#\C-m^"
"\C-x7": "\C-m\C-P\C-a\C-d\C-m"
Now, in a new bash instance (or after reloading `.inputrc` in your curre... |
I'd bet it won't play any "important" role any time soon. The whole programming model with "morhps" is "alien" to anything in the commercial "surrounding". Just try to implement a small example in some Smalltalk like VisualWorks and than the same in Squeak. There are tried to get more "traditonal" GUI toolkit running w... |
Centered background image is off by 1px |
|html|css| |
My web page sits in a DIV that is 960px wide, I center this DIV in the middle of the page by using the code:
html,body{background: url(images/INF_pageBg.gif) center top repeat-y #777777;text-align:center;}
#container{background-color:#ffffff;width:960px;text-align:left;margin:0 auto 0 auto;}
I need t... |
Windows Server 2003 NLB drainstop notification on stop |
|windows|msnlb| |
How would I drainstop one of the nodes in a MS NLB via command line and then get notified of its completion?
If there's no way to callback, is there an easy way to poll? |
Limiting height of a Sytem.Windows.Form to an exact value |
|c#|winforms| |
What I am trying to achieve is a form that has a button on it that causes the Form to 'drop-down' and become larger, displaying more information. My current attempt is this:
private void btnExpand_Click(object sender, EventArgs e)
{
if (btnExpand.Text == ">")
{
btnExpand.Text ... |
How do you limit height of a Sytem.Windows.Form to an exact value? |
What I am trying to achieve is a form that has a button on it that causes the Form to 'drop-down' and become larger, displaying more information. My current attempt is this:
private void btnExpand_Click(object sender, EventArgs e)
{
if (btnExpand.Text == ">")
{
btnExpand.Text ... |
What I am trying to achieve is a form that has a button on it that causes the Form to 'drop-down' and become larger, displaying more information. My current attempt is this:
private void btnExpand_Click(object sender, EventArgs e)
{
if (btnExpand.Text == ">")
{
btnExpand.Text ... |
Is there a good reference on how java executes bytecode? |
|java|bytecode| |
I'm interested in how java organizes memory and executes code (like what gets put in the stack or the heap), from the start of main, to assigning variables, calling functions, passing parameters, returning values, instantiating objects, etc. Has anyone found a good, beginner-friendly article/reference on it? Preferably... |
How do I fix this Subversion MKCOL error? |
|svn| |
When I commit I get this error from Subversion:
bash-2.05b$ svn commit -m "testing subversion, still"
Adding baz
svn: Commit failed (details follow):
svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (http://svn.ex... |
C# has a "var" keyword used in the manner you describe, but it ends up being a strongly typed variable based on the types of values that type checking suggests will go into it. |
In terms of performance there is no upside/downside. Everything is resolved at compile time and the generated MSIL is identical whether you use fully-qualified names or not.
The reason why its use is prevalent in the .NET world is because of auto-generated code, such as designer markup. In that case it would be bett... |
Yes, it can be quite useful. I often do this kind of thing myself, but I only have it compile into non-production code, usually. |
The canonical reference is the [JVM spec][1]. However, different JVMs can implement the spec in different ways. You can also check out the open source Java platform implementation, [OpenJDK][2].
[1]: http://java.sun.com/docs/books/jvms/
[2]: http://openjdk.java.net/ |
This happens when you have added a directory that someone else has also added and already committed. The error message on a commit is really confusing, but if you do an `svn up` instead you'll see this message:
bash-2.05b$ svn up
svn: Failed to add directory 'baz': object of the same name already exists
... |
I don't know exactly how they execute their bytecode, but I found this [link][1] describing java's bytecode. I am not sure if it helps, but at least it's something to start on.
Quote:
> This article gives you an understanding of Java bytecode that will enable you to be a better programmer. Like a C or C++ compiler ... |
I largely use `to_param` as suggested by John Topley.
Remember to put indexes such that whatever you're using in to_param is quickly searchable, or you'll end up with a full table scan on each access. (**Not** a performance-enhancer!)
A quick work-around is to put the ID somewhere in there, in which case Act... |
The [proposal][1] (section IIIb.) states they will not be comparable in any way. If you attach some extra information to them, you can easily identify each callback. For instance, if you simply define a struct wrapping the function pointer, you can remove them (assuming you have the same struct you inserted). You can a... |
1 is right out - a full sort is slower than merging two sorted lists.
So you're looking at tweaking 2 (or something entirely new).
If you change the data structures to doubly linked lists, then you can merge them in constant working space.
Use a fixed-size heap allocator for the list nodes, both to reduce mem... |
1 is right out - a full sort is slower than merging two sorted lists.
So you're looking at tweaking 2 (or something entirely new).
If you change the data structures to doubly linked lists, then you can merge them in constant working space.
Use a fixed-size heap allocator for the list nodes, both to reduce mem... |
Take a look at [Red Gate's SQL Prompt][1] - it's a great product (as are most of Red Gate's contributions)
[1]: http://www.red-gate.com/Products/SQL_Prompt/index.htm |
Take a look at [Red Gate's SQL Prompt][1] - it's a great product (as are most of Red Gate's contributions)
[SQL Inform][2] is also a great free (online) tool for formatting long procedures that can sometimes get out of hand.
Apart from that, I've learned from painful experience it's a good thing to precede any `D... |
Take a look at [Red Gate's SQL Prompt][1] - it's a great product (as are most of Red Gate's contributions)
[SQL Inform][2] is also a great free (online) tool for formatting long procedures that can sometimes get out of hand.
Apart from that, I've learned from painful experience it's a good thing to **precede any*... |
Without knowing exactly how you did the switch and how your directory and repository layout is, it's hard to say what went wrong in your case.
There is no way to really "revert" a switch. Generally, <tt>svn switch</tt> can be undone by a switch back to the original location, i.e. when the original location is at <tt... |
Here is how to build a function that returns a result set that can be queried as if it were a table:
SQL> create type emp_obj is object (empno number, ename varchar2(10));
2 /
Type created.
SQL> create type emp_tab is table of emp_obj;
2 /
Type created.
... |
Like a previous poster, I also use ii, jj,.. mainly because in many fonts a single i looks very similar to 1. |
In addition to consistent sequence of lock acquisition - another path is explicit use of locking and isolation hints to reduce time/resources wasted unintentionally acquiring locks such as shared-intent during read. |
First, before you buy a commercial engine, check out Apache FOP it is a pretty solid XSL-FO engine. I've used it extensively for "government" form generation.
If you're just getting started. W3schools is invaluable in learning XSL-FO: http://www.w3schools.com/xslfo/default.asp
If you're new to XSL, I highly re... |
Method-naming: get or load |
|naming-conventions| |
I'm writing a desktop application that communicates with a web service. Would you name all web-service functions that that fetch data for **Load**XXXX since it takes a while to execute. Or would you use **Get**XXXX, for instance when getting just a single object.
|
|naming-conventions| |
|naming-conventions| |
I'm writing a desktop application that communicates with a web service. Would you name all web-service functions that that fetch data **Load**XXXX, since they take a while to execute. Or would you use **Get**XXXX, for instance when getting just a single object.
|
If all objects in your array are unique or you want to remove all occurrences of an object when found, you could fast enumerate on an array copy and use [NSMutableArray removeObject:] to remove the object from the original.
NSMutableArray *myArray;
NSArray *myArrayCopy = [NSArray arrayWithArray:myArray];
fo... |
Have you considered calling the loadOptions method in the onblur event of one of the other interrelated fields on the form? This would load the list into the drop down box before it is clicked, but the behavior should still be similar.
I think you are going to have explore slightly different options to obtain what... |
You can also include the bootstrapper 'setup.exe' that is created in VS. It'll detect whether you have the neccessary .net version, and if so, launch the installer; if not, it'll prompt you to download the framework. |
Yeah, it's known issue. Unfortunately you only can fix div and image width, or use script to dynamically change stye.backgroundPosition property. Another trick is to put expression to the CSS class definition. |
Just FYI,
This topic is already discussed. Unfortunately I can't find the link at the moment (SO search should be improved). |
Be careful! If you actually have utf stored as another encoding, you could have a real mess on your hands. Back up first. Then try some of the standard methods:
for instance
http://www.cesspit.net/drupal/node/898
http://www.hackszine.com/blog/archive/2007/05/mysql_database_migration_latin.html
I've had to resor... |
The value is in the maps, which are in iframes on a different domain. From Google's point of view, providing a user with one of your pages as a result is not likely to be useful to that user. |
Xampp is a self contained package for developments.
the latter two would be full production stacks installed on your server either gnu/linux or windows server 2k*
so if you want a one program install that can be removed go with xampp for development, otherwise you can fully install eash of them on your system. t... |
Instead of spending time on looking for tests that can't fail, how about extending the tests a bit - make the code fail in many ways. That would
- Show him how to write better tests
- Force him to fix his code, and prevent more bad code from being checked in
A piece of buggy code you have to use would be a g... |
I also like to check to see if the debugger is attached - if you call Debugger.Break when there is no debugger, it will prompt the user if they want to attach one. Depending on the behavior you want, you may want to call Debugger.Break() only if (or if not) one is already attached
using System.Diagnostics;
... |
Don't maintain the differences in code, but rather through a configuration file. That way they're all running the same code, just with different configuration values (ie. port to bind to) |
Don't maintain the differences in code, but rather through a configuration file. That way they're all running the same code, just with different configuration values (ie. port to bind to, hostname to answer to, etc.) |
Well, this really depends on which EJBs we are talking about. I would say that MDBs can still be useful even now. For entity beans and session beans you can surely find a better approach.
Maybe one feature which I still like in EJBs is scalability. Using "remote" option you can deploy EJBs to different servers if nece... |
Okay, try this:
<pre>
use CGI;
my %in;
CGI::ReadParse(\%in);
</pre>
That might help as it's actually using a variable that you've declared, and therefore can control the scope of (plus it'll let you `use strict` without other nastiness that could be muddying the waters) |
What happens to the time slice if you disable preemption in vxWorks? |
|vxworks| |
If you have round robin scheduling enabled in VxWorks, and you use taskLock() to disable preemption, what happens when your timeslice expires? |
Can you reliably set or delete a cookie during the server side processing of an Ajax (XHR) call? |
|ajax|cookies|xmlhttprequest|server-side|dwr| |
I have done a bit of testing on this myself (During the server side processing of a DWR Framework Ajax request handler to be exact) and it seems you CAN successfully manipulate cookies, but this goes against much that I have read on Ajax best practices and how browsers interpret the response from an XmlHttpRequest. No... |
127.0.0.1,6283 add a comma between the ip and port |
When preemption is disabled via taskLock, the timeslice counter will not increment. Your timeslice will never expire until preemption is re-enabled. |
AssignProcessToJobObject fails with "Access Denied" error when running under the debugger |
|c++|c|winapi|createprocess| |
You do `AssignProcessToJobObject` and it fails with "access denied" but only when you are running in the debugger. Why is this? |
This one puzzled me for for about 30 minutes.
First off, you probably need a UAC manifest embedded in your app ([as suggested here][1]). Something like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!... |
You can use the the [Shade Plugin][1] to create an uber jar in which you can bundle all your 3rd party dependencies.
[1]: http://maven.apache.org/plugins/maven-shade-plugin/ |
How to send mail from ASP.NET with IIS6 SMTP in a dedicated server? |
|asp.net|iis|smtp| |
I'm trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server but mail is getting stuck in the Queue folder and doesn't get delivered.
I'm using this code in an .aspx page to test:
<%@ Page Language="C#" AutoEventWireup="true" %>
<% new System.Net.Mail.Smtp... |
How do I use my own compiler with Nant? |
|c++|nant|build|cross-platform|makefile| |
Nant seems very compiler-centric - which is guess is because it's considered a .NET development system. But I know it can be done! I've seen it. The platform we're building on has its own compiler and doesn't use 'cl.exe' for c++. We're building a C++ app on a different platform and would like to override <cl> with our... |
Resizing an Image without losing any quality |
|c#|image| |
I need to re size an image, but they image quality cannot be effected by this. (C#) |
I need to resize an image, but the image quality cannot be affected by this. (C#) |
Use a [CASE][1] statement instead of IF.
[1]: http://msdn.microsoft.com/en-us/library/ms181765.aspx |
any cookie given to a browser will be readable by server processing the request --- they're language agnostic.
try $_COOKIE in PHP |
Where do I find Error.pm for broken git-svn on Slackware 12.1 |
|perl|git-svn|slackware|error.pm| |
It is obviosly some Perl extension. I downloaded one version of the file from CPAN, but it does not seem to be compatible with Perl in Slackware 12.1. Perl version is 5.8.8.
And while we're at it: once I do find the right Error.pm, what is the correct way to install it?
|
Where do I find Error.pm and Core.pm for broken git-svn on Slackware 12.1 |
|perl|git-svn|slackware|error.pm|core.pm| |
It is obviosly some Perl extensions. Perl version is 5.8.8.
I found Error.pm, but now I'm looking for Core.pm.
While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks. |
Make git-svn work on Slackware 12.1 |
|perl|git-svn|core.pm|error.pm|slackware| |
Unless you resize up, you cannot do this with raster graphics.
What you can do with good filtering and smoothing is to resize without losing any **noticable** quality.
You can also alter the DPI metadata of the image (assuming it has some) which will keep exactly the same pixel count, but will alter how image edi... |
Just FYI,
This topic is already discussed. Unfortunately I can't find the link at the moment (SO search should be improved).
---
Ok I found similar question:
http://stackoverflow.com/questions/11199/net-framework-dependency
I recall that there was exactly the same question, but I can't find it :( |
[http://auctomatic.com/][1]
[1]: http://auctomatic.com/ |
[ImageMagick][1] all the way. It's a codebase with nearly every image-related operation you could possibly want to do, implemented fairly efficiently in C. This includes various types of resizing, both interpolated (bilinear, trilinear, adaptive, etc.), and not (just decimating (sampling) or replicating pixels. Ther... |
[ImageMagick][1] all the way. It's a codebase with nearly every image-related operation you could possibly want to do, implemented fairly efficiently in C. This includes various types of resizing, both interpolated (bilinear, trilinear, adaptive, etc.), and not (just decimating (sampling) or replicating pixels. Ther... |
LINQ supports some set operations. See [LINQ 101 page][1] for examples
And there is a class [HashSet][2]
Here is Microsoft guidelines on set operations in .NET:
### [HashSet and LINQ Set Operations][3]
List of set operations supported by HasSet class:
### [HashSet Collection Type][4]
[1]: http://msd... |
LINQ supports some set operations. See [LINQ 101 page][1] for examples.
Also there is a class [HashSet][2] (.NET 3.5)
---
Here is Microsoft guidelines for set operations in .NET:
### [HashSet and LINQ Set Operations][3]
List of set operations supported by HasSet class:
### [HashSet Collection Type][4]... |
Just a followup to [smashery][1]'s answer. The ephemeral port range (on Linux at least, and I suspect other Unices as well) is not a fixed. This can be controlled by writing to
`/proc/sys/net/ipv4/ip_local_port_range`
The only restriction (as far as IANA is concerned) is that ports below 1024 are designated to be ... |
[Shadowbox][] is a nice script for inline "popups". It can work with any of the usual JS libraries if you use any (jQuery, Prototype, etc) or on its own, has a pretty comprehensive skinning system so you can adapt the looks without having to go into the source code itself.
It won't disable scrolling for you (you ca... |