instruction stringlengths 0 30k ⌀ |
|---|
Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed. |
JavaScript RegEx Help |
|javascript|regex| |
I'm trying to match elements with a name that is 'container1$container2$chkChecked', using a regex of '.+\$chkChecked', but I'm not getting the matches I expect when the element name is as described. What am I doing wrong? |
A workaround for this paypal is to use the [Paypal Integration Code][1] as Paypal is not always the most friendly to integrate. The hard work is basically done for you.
[1]: http://www.spiderweblogic.com/Paypal-Integration-Code.aspx |
Well, first of all, it's right that Ruby does not have Interface as is, but they have mixin, wich takes somehow the best of both interfaces and abstract classes from other languages.
The main goal of interface is to ensure that your object SHALL implement ALL the methods present in the interface itself.
Of course... |
It must be very, very easy to write a test, and equally easy to run them. That, to me, is the single most important feature of a testing harness. If someone has to fire up a GUI or jump through a bunch of hoops to write a test, they won't use it.
|
System.Type propertyType = typeof(Boolean);
System.TypeCode typeCode = Type.GetTypeCode(propertyType);
switch (typeCode)
{
case TypeCode.Boolean:
//doStuff
break;
case TypeCode.String:
... |
I have experience with two telephony standards TAPI, and CSTA, as far as I know there is no such agreement between vendors (e.g. Cisco, Nortel, NEC) regarding THE standard API.
I would recommend looking at the availability of [SMDR][1] (Station Messaging Detail Recording) on the PBX platforms you are targeting, assu... |
If you're not worried about removing redundant parentheses, then the following Lisp code will work:
(defun rpn-to-inf (pre)
(if (atom pre)
pre
(cond ((eq (car (last pre)) 'setf)
(list (rpn-to-inf (first pre)) '= (rpn-to-inf (second pre))))
((eq (car (last pre)) '... |
If you're not worried about removing redundant parentheses, then the following Lisp code will work:
(defun rpn-to-inf (pre)
(if (atom pre)
pre
(cond ((eq (car (last pre)) 'setf)
(list (rpn-to-inf (first pre)) '= (rpn-to-inf (second pre))))
((eq (car (last pre)) '... |
Same source code on two machines yield different executable behavior |
|.net|datetime|compiler-construction| |
Here's the scenario:
A C# Windows Application project stored in SVN is checked out on two different machines and compiled.
The first one is a build server. I'm not entirely sure if the build server modifies the project files, but I know it creates a tag in SVN of the source code it used to compile the executabl... |
Here's the scenario:
A C# Windows Application project stored in SVN is checked out on two different machines and compiled.
The first one is a build server. I'm not entirely sure if the build server modifies the project files, but I know it creates a tag in SVN of the source code it used to compile the executabl... |
Try changing the first line to:
#include <stdio.h>
without the spaces. It is trying to look for a file called " stdio.h " with a space at the beginning and end. |
How do I kill a VMware virtual machine that won't die? |
|vmware| |
I've got a virtual machine running on a server that I can't stop or reboot - I can't log onto it anymore and I can't stop it using the VMware server console. There are other VM's running so rebooting the host is out of the question. Is there any other way of forcing one machine to stop? |
You should try to install MinGW in the default install directory (i.e. C:\MinGW) I read many times it was recommended to avoid problems. There may be a (wrongly) hardcoded path in gcc. |
I'm not sure that there is a single path to which all non-administrator users have permission to write to.
I think the correct one would be `<User>\Application Data` |
Well, it's safe to assume that if a thread is running somewhere that something has a reference to it so wouldn't that be enough to stop the garbage collection? |
Assuming you're using Visual Studio, you can insert `DataContext.Log = Console.Out` into your code. You can then watch the SQL as it's executed, in the output window.
I'm not sure whether it's possible to programatically test whether the query has been executed. You can force it to execute, for example by calling ... |
asp.net Convert CSV string to string[] |
|c#|string| |
Is there an easy way to convert a string from csv format into a string[] or list<string>? |
|c#|string|csv| |
Is there an easy way to convert a string from csv format into a string[] or list<string>?
**Please keep in mind that splitting on a comma isn't good enough, because there could be commas in the data.** |
Is there an easy way to convert a string from csv format into a string[] or list<string>?
I can guarantee that there are no commas in the data.
**Please keep in mind that splitting on a comma isn't good enough, because there could be commas in the data.** |
You can just replace `<T extends AbstractNode> T` with `AbstractNode` thanks to the magic of [covariant returns](http://en.wikipedia.org/wiki/Covariant_return_type). Java 5 added support, but it didn't receive the pub it deserved. |
The virtual machine should have it's own process that is visible in task manager. Use sysinternals [Process Explorer][1] to find the right one and then kill it from there.
[1]: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx |
The ISO C and C++ standards are bloody expensive. On the other hand, the INCITS republishes them for a lot less. http://www.techstreet.com/ seems to have the PDF for $30
(search for INCITS/ISO/IEC 14882:2003).
Hardcopy versions are available, too. Look for the British Standards Institute versions, published by Wile... |
Is there a single resource which explains windows memory thoroughly? |
|windows|memory| |
Seriously, I've trawled MSDN and only got half answers - what do the columns on the Task Manager mean? Why can't I calculate the VM Usage by enumerating threads, modules, heaps &c.? How can I be sure I am accurately reporting to clients of my memory manager how much address space is left? Are their myriad collisions... |
Seriously, I've trawled MSDN and only got half answers - what do the columns on the Task Manager mean? Why can't I calculate the VM Usage by enumerating threads, modules, heaps &c.? How can I be sure I am accurately reporting to clients of my memory manager how much address space is left? Are their myriad collisions... |
Getting a full list of the URLS in a rails application |
|ruby-on-rails|urls| |
How do I get a a complete list of all the urls that my rails application could generate?
I don't want the routes that I get get form rake routes, instead I want to get the actul URLs corrosponding to all the dynmically generated pages in my application...
Is this even possible?
(Background: I'm doing this bec... |
Using the default in-memory session management, yes. |
I have not used Intel's compiler, however, Herb Sutter had some interesting comments on it...
From [Sutter Speaks: The Future of Concurrency][1]
**Do you see a lot of interest in and usage of transactional memory, or is the concept too difficult for most developers to grasp?**
It's not yet possible to answer w... |
>Stop the MySQL process.
>Start the MySQL process with the --skip-grant-tables option.
>Start the MySQL console client with the -u root option.
List all the users;
SELECT * FROM mysql.user;
Reset password;
UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';
---
... |
>Stop the MySQL process.
>Start the MySQL process with the --skip-grant-tables option.
>Start the MySQL console client with the -u root option.
List all the users;
SELECT * FROM mysql.user;
Reset password;
UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';
---
... |
This is a fantastic book which my little brothers used to learn:
<http://pine.fm/LearnToProgram/>
Of course, the most important thing is to start on a real, useful program of some kind IMMEDIATELY after finishing the book. |
I recommend starting them off with C/C++. I find that it is a good foundation for just about every other language. Also, the different versions of BASIC can be pretty dodgy, at best, and have no real correlation to actual programming. |
Should be part of the .NET 3 SDK (and later version as well). If you've already installed this, the path might look something like
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\wca.exe
More info on [Guy Burstein's blog][1].
[1]: http://blogs.microsoft.co.il/blogs/bursteg/archive/2006/12/24/wca.aspx |
On my machine, with Visual Studio 2008 installed, it's in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin |
I wasn't able to get mine working from the command line switch but I have been able to do it just by setting my HTTP_PROXY environment variable (note that case seems to be important). I have a batch file that has a line like this in it:
SET HTTP_PROXY=http://%USER%:%PASSWORD%@%SERVER%:%PORT%
I set the four re... |
You could instead add the comma as the first thing inside your foreach.
if (sb.Length > 0) sb.Append(","); |
How about tracking whether you are on the first item, and only add a comma *before* the item if it is not the first one.
public string ReturnAsCSV(ContactList contactList)
{
StringBuilder sb = new StringBuilder();
bool isFirst = true;
foreach (Contact c in contactList) {
... |
For a banking system I helped develop, I was responsible for the "interest accrual" part of the system. Each day, my code calculated how much interest had been accrued (earnt) on the balance that day.
For that calculation, extreme accuracy and fidelity was required (we used Oracle's FLOAT) so we could record the "b... |
There is a change to the theading model in .Net 2.0 onwards where unhandled exceptions in a thread will cause the whole app to terminate. I ran into this when updating an app that did lots of threading and occasionally crashed. Obviously the .Net 2.0 model is more robust as you should certainly be catching these anyway... |
Martin Fowler is writing a book on DSLs. You can read his work so far [here][1] http://www.martinfowler.com/dslwip/
I also went to a good presentation by [Jay Fields][2] (His slides are [here][3]).
[1]: http://www.martinfowler.com/dslwip/
[2]: http://blog.jayfields.com/
[3]: http://manchestergeeknights.... |
How can I find the current DNS server? |
|windows|delphi|dns| |
I'm using Delphi and need to get the current Windows DNS server IP address so I can do a lookup. What function should I call to find it? The only solution I have right now does an ipconfig/all to get it, which is horrible. |
|windows|delphi|networking|dns| |
What is a Covered Index? |
|sql|database|indexing| |
I've just heard the term covered index in some database discussion - what does it mean? |
See *[GetNetowrkParams][1]* method (Platform SDK: IP Helper)
[1]: http://msdn.microsoft.com/en-us/library/aa365968(VS.85).aspx |
A *covering index* is an index that contains all, and possibly more, the columns you need for your query.
For instance, this:
SELECT *
FROM tablename
WHERE criteria
will typically use indexes to speed up the resolution of which rows to retrieve using *criteria*, but then it will go to the full ta... |
Both of them can be configured into detail. I have no idea why perltidy wouldn't like it, **it has nothing to do with it**. You should either change your style or change the perltidy configuration using the .perltidyrc file.
I don't know what problems perlcritic has with it (lvalue methods perhaps?), but you could c... |
Both of them can be configured into detail.
I have no idea why perltidy wouldn't like it, **it has nothing to do with it**. Perltidy only governs style. You can change the style of your code without changing any functionality, it's mostly a matter of whitespace really. You should either change your style or change t... |
The service would need to gain an established legal identity of some description before a bank account could be opened in it's name.
It could be a possibility once that occurs. |
Another way of putting this is that you want to turn all pairs of spaces into two non-breaking spaces, tabs into four non-breaking spaces and all line breaks into `<br>` elements. In XSLT 1.0, I'd do:
<xsl:template name="replace-spaces">
<xsl:param name="text" />
<xsl:choose>
<xsl:when tes... |
The common wisdom says 'yes'. Your page rank is a direct representation of the worth of your contribution to the internet. If you're trying to appear like you have more content by creating duplicate, or near duplicate pages, expect to be chastised appropriately. |
I like top-level exception handlers in general (regardless of language). They're a great place to cleanup resources that may not be immediately related to resources consumed inside the method that throws the exception.
It's also a fantastic place to **log** those exceptions if you have such a framework in place. Top... |
Try doing a clean-up and then an update. If that not work, please explain better your issue. |
I believe Texture2D.FromFile(); is what you are looking for.
It does not look like you can do this with a Model though.
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.fromfile.aspx |
You have code that is compliled into some IL (intermediate language). When you run your program, the computer doesn't understand this code. It only understands native code. So the JIT compiler compiles your IL into native code on the fly. It does this at the method level. |
Not many. The only time I've ever had to change thread priorities in a *positive* direction was with a user interface thread. UIs must be extremely snappy in order for the app to feel right, so a lot of times it is best to prioritize painting threads higher than others. For example, the Swing Event Dispatch Thread r... |
Are you by chance using TortoiseSVN and some other client (Such as subversive or the commandline client?). Sometimes Tortoise can unintentionally gum up other clients. I don't remember what exactly causes this to happen. |
Possibility 1:
Your program is marked as needing admin rights in its manifest
Possibility 2:
Your program is called setup.exe or install.exe - such program names always cause administrator rights to be required
For detailed explanation of those and other possibilities why you see this check [Getting to Know... |
It's good practice is to **translate the exceptions**. Don't just log them. If you want to know the specific reason an exception was thrown, throw specific exceptions:
public void connect() throws ConnectionException {
try {
File conf = new File("blabla");
...
} catch (Fil... |
That seems like a reasonable approach, and more straightforward and reliable than a destructor on a singleton class. You might also look at the "[atexit][1]" module. (Pronounced "at exit", not "a tex it" or something like that. I confused that for a long while.)
[1]: http://docs.python.org/lib/module-atexit.h... |
|.net|compiler-construction|datetime| |
Here's the scenario:
A C# Windows Application project stored in SVN is used to create an executable. Normally, a build server handles the build process and creates builds at regular intervals which are used by testing. In this particular instance I was asked to modify a specific build and create the executable.
... |
Here's the scenario:
A C# Windows Application project stored in SVN is used to create an executable. Normally, a build server handles the build process and creates builds at regular intervals which are used by testing. In this particular instance I was asked to modify a specific build and create the executable.
... |
Not sure why, but it's 0x0d, 0x0a, aka "\r\n". |
This is more complex but also more generic:
<xsl:template match="z:row">
<xsl:variable name="attr" select="@A"/>
<xsl:for-each select="@*[(local-name() != 'A')]">
<xsl:element name="z:row">
<xsl:copy-of select="$attr"/>
<xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>... |
What Causes Flash Error #2012 (Can't instantiate class)? |
|apache-flex|flash|actionscript-3|flexbuilder| |
I am new to ActionScript 3 and have run into a problem:
Using Flex Builder 3, I have a created a project with a few simple classes. If code in class A instantiates an object of class B (class B is in its own source file) then the code compiles fine, but I get the following run time error:
ArgumentError: Error #20... |
I am new to ActionScript 3 and have run into a problem:
Using Flex Builder 3, I have a created a project with a few simple classes. If code in class A instantiates an object of class B (class B is in its own source file) then the code compiles fine, but I get the following run time error:
ArgumentError: Error #20... |
For Visual Studio you can download the Windows Mobile SDK which comes with starter kits and emulators. You can program either native C++ or .Net applications quite easily and quickly. Take a look at the samples provided with the SDK for a good entry point. This is likely going to be the best resource out there for ge... |
Any reccomendation on tools for doing translations / localization in .NET? |
|.net| |
We have made use of Passolo for a number of years, But its kind of clunky and over priced.
It's got to be able to handle winforms and WPF....
Is there any open source alternatives? |
Any recommendation on tools for doing translations / localization in .NET? |
|.net|internationalization| |
We have made use of Passolo for a number of years, but it's kind of clunky and overpriced.
It's got to be able to handle winforms and WPF....
Are there any open source alternatives? |
The easiest keystrokes for me for "last argument of the last command" is !$
echo what the heck?
what the heck?
echo !$
heck? |
My solution would be not to let Access modify the data with linked tables.
I would only create the UI in Access and create an ADO connection to the server using windows authenticated in the connection string. Compile you Access application as dbe to protect the VB code.
I would not issue SQL statement, but I wo... |
yes, unless you are using out of process session state. |
I develop and maintain a large PHP/MySQL application. Here is my experience with stored procedures.
Over time our application has grown very complex. And with all the logic on the php side, some operations would query the database with over 100 short queries.
MySQL is so quick that the performance was still acc... |
You could do this with JavaScript quite easily. It would help to know the deployment environment. Is it a kiosk or something?
For the JavaScript solution, serve up a page that contains a JavaScript that will pop open a new browser window. The controller page will then cause the new browser window to cycle through... |
You could do this with JavaScript quite easily. It would help to know the deployment environment. Is it a kiosk or something?
For the JavaScript solution, serve up a page that contains a JavaScript that will pop open a new browser window. The controller page will then cause the new browser window to cycle through... |
Is it unsafe to allow users to embed any flash file (swf)? |
|security|flash|embed| |