instruction stringlengths 0 30k ⌀ |
|---|
java.lang.VerifyError are the worst.
You would get this error if the bytecode size of your method exceeds the 64kb limit; but you would probably have noticed that.
Are you 100% sure this class isn't present in the classpath elsewhere in your application, maybe in another jar?
Also, from your stacktrace, is the... |
Install a custom KeyEventDispatcher. The KeyboardFocusManager class is also a good place for this functionality.
[KeyEventDispatcher][1]
[1]: http://java.sun.com/javase/6/docs/api/java/awt/KeyEventDispatcher.html |
It depends on the key mapping that you have set.
With default keymapping: Do CTRL+T to open a type and CTRL + Shift+T to open a file.
With IntelliJ like mapping : Do CTRL+N to open a type and CTRL + Shift + N to open a file.
Visit the following links for all your key mapping.
ReSharper 4 Default Keymap: Visual... |
I search so often that I've found it useful to map the underscore key to remove the search highlight:
nnoremap <silent> _ :nohl<CR> |
You can't really do it well, because the Mac interface simply isn't designed with focus-follows-mouse (with or without auto-raise) in mind. I doubt that's going to change any time soon, and unless it does, everybody who tries to implement focus-follows-mouse will run into the same hurdles and wind up with an unsatisfa... |
For the first issue - IIRC you can't sort a DataView with a comparer. If you just need to sort numerically a field you must be sure that the column type is numeric and not string. Some code would help to elucidate this.
For the second issue also you can't do that directly in the DataView. If you really need to sort ... |
Loading .Net Fx query... |
|.net| |
I have built a simple C#.Net app on a M/C with only .Net FX 1.1 present. Now when I execute this app on a M/C where there is :
Case 1) Only .Net fx 2.0 is installed
Case 2) Both .Net Fx 1.1 amd 2.0 are installed
How is it determined to load the appropriate .Net framework in the above cases. |
As many people have noted, the average case performance for quicksort is faster than mergesort. **But** this is only true if you are assuming constant time to access any piece of memory on demand.
In RAM this assumption is generally not too bad (it is not always true because of caches, but it is not too bad). Howe... |
You'll need to check $? after each command, since $? is updated after each command exits. This means that if you execute a pipeline, you'll only get the exit code of the last process in the pipeline.
See [here][1] or [here][2] for a little more discussion on this problem.
[1]: http://www.linuxquestions.org/q... |
If you want to work with $?, you'll need to check it after each command, since $? is updated after each command exits. This means that if you execute a pipeline, you'll only get the exit code of the last process in the pipeline.
Another approach is to do this:
set -e
set -o pipefail
If you put this a... |
The macro has a very misleading name - the expression in the macro will reutrn the number of elements in an array if an array's name is passed in as the macro parameter.
For other types you'll get the number of pointers that could be jammed into the memory occupied by the type (not a very useful number generally).
... |
Create many constrained, random permutation of a list |
|random|list|permutation| |
I need to make a random list of permutations. The elements can be anything but assume that they are the integers 0 through x-1. I want to make y lists, each containing z elements. The rules are that no list may contain the same element twice and that over all the lists, the number of times each elements is used is t... |
How to create a fast PHP library ? |
|php|include| |
For our online game, we have written tons of PHP classes and functions grouped by theme in files and then folders. In the end, we have now all our backend code (logic & DB access layers) in a set of files that we call **libs** and we include our libs in our GUI (web pages, presentation layer) using *include_once('patht... |
For our online game, we have written tons of PHP classes and functions grouped by theme in files and then folders. In the end, we have now all our backend code (logic & DB access layers) in a set of files that we call **libs** and we include our libs in our GUI (web pages, presentation layer) using *include_once('patht... |
Since you asked, I'd write your init event like this. I'll leave the Load event as an exercise:
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If IsPostBack AndAlso Session("ctl") IsNot Nothing Then
Dim MyControl As Control = Session("ctl")
... |
How can I set a timeout against a BufferedReader based upon a URLConnection in Java? |
The macro has a very misleading name - the expression in the macro will return the number of elements in an array if an array's name is passed in as the macro parameter.
For other types you'll get the number of pointers that could be jammed into the memory occupied by the type (not a very useful number generally).
... |
The macro has a very misleading name - the expression in the macro will return the number of elements in an array if an array's name is passed in as the macro parameter.
For other types you'll get something more or less meaningless if the type is a pointer or you'll get a syntax error.
Usually that macro is named... |
Yes you can: but you really should questions yourself why you're going to :)
There is actually only one case, where it can make sense and this is a UnitTest. |
One can think of delegates as an interface for a method which defines what arguments and return type a method must have to fit the delegate |
Yes you can access private fields via reflection. This is how a lot of ORMs go about populating an object without going through your properties (which will invoke business logic you might not have intended to be run on an object load).
Access modifiers are not a form of security! |
I think everyone working in internationalization should be familiar with the Common Locale Data Repository, which is now a sub-project of Unicode:
[Common Locale Data Repository][1]
Those folks are working hard to establish a standard resource for all kinds of i18n issues: currency, geographical names, tons of st... |
If you are getting all the results back from the webservice at once and can't include pagination into the actual web service call, you can try setting the list of items to a property on a managed bean. Then you can hook that up to the "value" attribute on a Tomahawk dataTable:
[http://myfaces.apache.org/tomahawk-pr... |
I've always believed that you should hide as much as you can. (Your application should be no more complex than what the user can/should do.)
If you display a menu option that a user shouldn't be using, they may click on it, but think your application is broken because nothing happens.
That's what I think at leas... |
I've always believed that you should hide as much as you can. (Your application shouldn't be any more complex than what the user can/should do.)
If you display a menu option that a user shouldn't be using, they may click on it, but think your application is broken because nothing happens.
That's what I think at ... |
How about having a tiny flash app on the page that streams a minuscule 'heartbeat' stream of data from the server....just enough to allow the server to know when a stream had been dropped, and hence when the client had navigated away from the page. |
A Google search turned up the following, additional methods:
(though I think I'd try Roddy's method first)
## [Manually fill the screen][1] (from: About Delphi) ##
procedure TSomeForm.FormShow(Sender: TObject) ;
var
r : TRect;
begin
Borderstyle := bsNone;
SystemParametersI... |
It's certainly possible to send binary files via web services (eg. SOAP), but you usually have to do some kind of encoding such as base64, which increases the amount of data to send. One of the most efficient ways to send an arbitrary binary file is via an HTTP PUT operation, since there is no encoding overhead. Not al... |
There's no known trick 'in the wild' for getting around this, other than using CTP-6 of SQL Server 2008 (in favour of the RTM).
the reasons for removing backward compatability (and a lot more discussion besides) are provided at the [relevant feedback in microsoft connect][1].
[1]: https://connect.microsoft.co... |
There's no known trick 'in the wild' for getting around this, other than using CTP-6 of SQL Server 2008 (in favour of the RTM).
the reasons for removing backward compatability (and a lot more discussion besides) are provided at the [relevant feedback in microsoft connect][1].
edit: sorry i don't know where this c... |
For the first issue - IIRC you can't sort a DataView with a comparer. If you just need to sort numerically a field you must be sure that the column type is numeric and not string. Some code would help to elucidate this.
For the second issue also you can't do that directly in the DataView. If you really need to sort ... |
A metaclass is the class of a class. Like a class defines how an instance of the class behaves, a metaclass defines how a class behaves. A class is an instance of a metaclass.
While in Python you can use arbitrary callables for metaclasses (like Jerub shows), the more useful approach is actually to make it an actual... |
Interfaces came from computer science. Or, let's say, from common sense in programming.
Interface is a logical group of methods of a class.
C++ didn't need a _separate language concept_ of "interface", because any class might be used as an interface -- just define a set of methods in it, make no implementation, call ... |
|java|sockets|url| |
**I want to read the contents of a URL but don't want to "hang" if the URL is unresponsive. I've created a BufferedReader using the URL...**
URL theURL = new URL(url);
URLConnection urlConn = theURL.openConnection();
urlConn.setDoOutput(true);
BufferedReader urlReader = new BufferedReader(newInpu... |
Either of these would work:
myControl.Attributes["style"] = "color:red";
myControl.Attributes.Add("style", "color:red");
But bear in mind that *this will replace any existing styles that are set on the style attribute*. This may be a problem if you try setting styles in more than one place in the code ... |
Either of these would work:
C#
myControl.Attributes["style"] = "color:red";
myControl.Attributes.Add("style", "color:red");
VB.NET
myControl.Attributes("style") = "color:red";
myControl.Attributes.Add("style", "color:red");
But bear in mind that *this will replace any existing style... |
According to the [W3CSchools][1] site:
> The style element goes in the head section. If you want to include a style sheet in your page, you should define the style sheet externally, and link to it using <link>.
So it's not a good idea to include style elements (e.g. a `<style type="text\css"></style>` block) in a... |
According to the [W3CSchools][1] site:
> The style element goes in the head section. If you want to include a style sheet in your page, you should define the style sheet externally, and link to it using <link>.
So it's not a good idea to include style elements (e.g. a `<style type="text\css"></style>` block) in a... |
Yes, it will work. The TAdsSettings component modifies settings in the Advantage Client Engine (ACE), and with ISAPI there will be one instance of ACE loaded that all threads use.
I wouldn't recommend it, however. Depending on the settings you are changing it would make more sense to just call the ACE APIs directly.... |
Tested with one of our tables that has nearly 1 million rows total. Indexes exist on both fields FIELD2 AND FIELD3. Query returned 83953 rows in under 3 seconds on our dev box.
select
FIELD1, FIELD2, FIELD3
from
OURTABLE (nolock) T1
WHERE FIELD3 =
(
SELECT MAX(FIELD3) FROM
OURTABLE T2 (nolock)
WHERE T1.FIE... |
Are you sure it is looking in the same directory as the dir command? They don't seem to have any files in common.
Also, this isn't the issue, but the correct wild card for "all files" is *
\*.* means "all files with at least one . in the name" |
Yes, a delegate can be thought of as an interface with one method. |
sys.path is python's internal representation of the PYTHONPATH, it sounds to me like you want to modify the PATH.
I'm not sure that this will work, but you can try:
import os
os.environ['PATH'] += os.pathsep + "C:\\oracle32\\bin" |
Not relevant to the onclick issue, but also related:
For html attributes whose name collide with javascript reserved words, an alternate name is chosen, eg. `<div class=''>`, but `div.className`, or `<label for='...'>`, but `label.htmlFor`.
In reasonable browsers, this doesn't affect `setAttribute`. So in gecko a... |
Variable storage classes or type specifiers (like volatile, auto and static) define how/where variables are saved during program execution. For example, variables defined in functions are usually saved on the stack, which means that it will be lost after the function returns. Using the "static" keyword, you can force t... |
Gotta read Roy Fielding's most excellent [dissertation][1] on the topic. He makes an excellent case and was definitely **WAY** ahead of his time when he wrote it (2000).
Piko
[1]: http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm |
I think the question is slightly confused as to terminology. A POJO (Plain Old Java Object) refers to a Java object unencumbered by dependencies on particular application servers or third party libraries. Using a good IOC (Inversion Of Control) framework, like Spring, allows you to write all your classes as POJOs so yo... |
[Steve Vinoski's blog][1] and his [latest articles][2] are definitely worth perusing. He's a former CORBA guru, who wrote probably the best book on the subject with Michi Henning, ["Advanced CORBA® Programming with C++"][3]. However, he has since seen the error of his client/server ways, and now swears by REST.
... |
Google Code also has some objective C things up. It depends on what you are looking for... |
I don't know if you're locked into std C++ and tr1, but if you aren't, it seems like your problem could be completely avoided if you just used something like boost::signal and boost::bind to solve your original problem - creating an event system - instead of trying to roll your own. |
RCDATA is a [pre-defined][1] resource type with an integer ID of RT_RCDATA (declared in Types unit).
Try accessing it this way:
rc := tResourceStream.Create(hInstance,'LOGO_GIF', MakeIntResource(RT_RCDATA));
[1]: http://msdn.microsoft.com/en-us/library/aa381039(VS.85).aspx |
Some more details please: operating system, language.
For example on Windows you can get it by using WMI and reading [Win32_Processor.ProcessorId][1].
[1]: http://msdn.microsoft.com/en-us/library/aa394373.aspx |
If you must override gdb and send a messgae to an object when it will not let you, you can use performSelector:
(gdb) print (int)[receivedData count]
Target does not respond to this message selector.
(gdb) print (int)[receivedData performSelector:@selector(count) ]
2008-09-15 00:46:35.854 Ex... |
If you must override gdb and send a message to an object when it will not let you, you can use performSelector:
(gdb) print (int)[receivedData count]
Target does not respond to this message selector.
(gdb) print (int)[receivedData performSelector:@selector(count) ]
2008-09-15 00:46:35.854 Ex... |
MSMQ (Microsoft Message Queueing) may be a great choice. It is part of the OS and present as an optional component (can be installed via Add/Remove Programs / Windows Components), meaning it's free (as long you already payed for Windows, of course). MSMQ provides Win32/COM and [System.Messaging][1] APIs. More modern Wi... |
Rogue Wave is very popular [ http://roguewave.com/products/hydra/ ]
So are IBM's Websphere offerings [ http://en.wikipedia.org/wiki/Mqseries ] |
Why do you want a makefile?
If you want to build your project without using the IDE, check out the `xcodebuild` command-line tool. |
To build your project outside of the IDE, check out the `xcodebuild` command-line tool. |
What is the best choice for .net inner process communication? |
|c#|.net|processes| |
Should I use Named Pipes, or .NET Remoting to communicate with a running process on my machine?
|
What is the best choice for .net inter-process communication? |
|c#|.net|duplicate|processes|ipc| |
|c#|.net|processes|ipc| |
This code won't compile, you need "class" constraint on T.
Also, this code requires public constructor on target class, which is not good for singleton, because you can't control at compile time that you obtain (single) instance only via Instance property (or field). If you don't have any other static members excep... |
[.NET Memory Profiler][1] is an excellent tool for profiling memory usage.
[1]: http://memprofiler.com/ |
DoSomethingToThing(Thing n) vs Thing.DoSomething() |
|language-agnostic|code-style| |
What factors determine which approach is more appropriate? |
|language-agnostic|code-style| |
One thing that you need to be aware of when reflecting on private members is that if your application is running in medium trust (as, for instance, when you are running on a shared hosting environment), it won't find them -- the BindingFlags.NonPublic option will simply be ignored. |
If you always want this behavior, you could put an AFTER INSERT trigger on TableA that will update table B. |
Without seeing your exact directory setup it's hard to say what is happening. One reason for this error message could be that one part of your merge command does refer to a directory that is not under version control.
Can you post the exact merge command that triggers the error? |
Get URL of ASP.Net Page in code-behind |
|asp.net| |
I have an ASP.Net page that will be hosted on a couple different servers, and I want to get the URL of the page (or even better: the site where the page is hosted) as a string for use in the code-behind. Any ideas? |
Isn't the "Cocoa version of MVC" the pattern used in ASP.NET MVC? So far, all the examples have pointed to communication b/w view and model through the controller with no direct interaction between V and M. Am I understanding this incorrectly? |
C#
myList<string>().ForEach(
delegate(string name)
{
Console.WriteLine(name);
});
Anonymous delegates are not currently implemented in VB.Net, but both C# and VB.Net should be able to do lambdas:
C#
myList<string>().ForEach(name => Console.WriteLine(name));
... |
C#
myList<string>().ForEach(
delegate(string name)
{
Console.WriteLine(name);
});
Anonymous delegates are not currently implemented in VB.Net, but both C# and VB.Net should be able to do lambdas:
C#
myList<string>().ForEach(name => Console.WriteLine(name));
... |
Thank you Suma. You're response is the best yet and helped me arrive at a solution.
I have determined that cause is explained by your first suggestion. Renaming the file to something not containing the word 'setup" did not help.
Turned out I was mistaken. I have both VS 2005 and VS 2008 installed and when I tr... |
It's easy, while in the paper-and-pen (or whatever non-code equivalent you prefer) to overstay, falling prey to the dreaded [YAGNI](http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It) syndrome. How many of us have carefully designed in some "sexy" feature that ended up never being used? (Raises hand. Hands.)
Sma... |
Has anyone tried either patching SSMS not to check the version (perhaps try looking at the binary differences between CTP 6 and RTM?), or patching SS 2005 to pretend to be 2008?
Unclean, I know, but I don't see any other way. |
some day i work in a company that use VSS (and in other companies that use other less unknow [SCM][1]) but i prefer use SVN (someday i'll try GIT) for active development, for me and my group.
First of all, this situation it's only good idea, if commit to VSS are few over month, because working with other SCM (than V... |
AfxGetMainWnd()->PostMessage(WM_CLOSE); |
Using a loop to iterate over a jQuery of one element is quite inefficient. When selecting an ID, you can just retrieve the first and unique element of the jQuery using get() or the [] notation.
var div = $("#thediv")[0];
// certain browsers have a bug such that scrollHeight is too small
// when c... |
This is ugly, but the best way is to look at the file and set the content type as appropriate:
switch ( fileExtension )
{
case "pdf": Response.ContentType = "application/pdf"; break;
case "swf": Response.ContentType = "application/x-shockwave-flash"; break;
case "gif": Response.Content... |
[RESTful][1] services are much simpler to consume than [SOAP][2] based (regular) web services. The reason for this is that REST is based on normal HTTP requests (GET, POST, etc...) and is completely stateless. Basically it is much simpler than SOAP. On the other hand you could argue that it is less flexible as it do... |
[RESTful][1] services are much simpler to consume than [SOAP][2] based (regular) services. The reason for this is that REST is based on normal HTTP requests which enables intent to be inferred from the type of request being made (GET = retrive, POST = write, DELTE = remove, etc...) and is completely stateless. On the ... |
Game Development Sound Frameworks |
|c++|audio|openal| |
I'm working with a team that's building an engine for a variety of 2D and eventually 3D mini-games. The problem we're facing is a solid, cross-platform, sound API. Obviously, DirectX is out of the question due to our needs for cross-platform capabilities. SDL is nice, and works great, but let's face it SDL_Mixer is a b... |
|language-agnostic|duplicate|code-style| |
|language-agnostic|code-style| |