instruction stringlengths 0 30k ⌀ |
|---|
How can you tell programmatically if a Flex App is running in debug mode? |
|apache-flex|actionscript-3|flash|debugging| |
Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger?
Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines? |
|apache-flex|flash|debugging|actionscript-3| |
Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger?
Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines?
The app is not necessarily running in a web page. |
Best solution for using EJBs from Excel |
|java|excel|vba|ejb|corba| |
We would like to give access to some of our EJBs from Excel. The goal is to give an API usable from VBA.
Our EJBs are mostly Stateless Session Beans that do simple CRUD operations with POJOs.
Some possible solutions:
* Exposing the EJBs as WebServices and create a VB/C# dll wrapping them,
* Using Corba to ac... |
@Mike - that would compare everything, including the content of the page, which isn't want the original poster wanted.
Assuming that you have access to the browser's DOM (by writing a Firefox/IE plugin or whatever), I would probably put all of the HTML elements into a tree, then compare the two trees. If the tag nam... |
> 1. …
> 2. …
> 3. Do not match if in the middle of a string (thanks nohat).
> 4. Do not match if in a comment. (// or /**/)
No can do with a *simple* regex. For that, you need to actually look at *every single* character left-to-right and decide what kind of thing it is, at least well enough to tell apart commen... |
> 1. …
> 2. …
> 3. Do not match if in the middle of a string (thanks nohat).
> 4. Do not match if in a comment. (// or /**/)
No can do with a *simple* regex. For that, you need to actually look at *every single* character left-to-right and decide what kind of thing it is, at least well enough to tell apart commen... |
Possibly a problem with underscores in the hostname?
<http://www.exim.org/lurker/message/20041124.113314.c44c83b2.en.html> |
In a server-side application running on Tomcat, I am generating full HTML pages (with header) based on random user-requested sites pulled down from the Internet. The client-side application uses asynchronous callbacks for requesting processing of a particular web page. Since processing can take a while, I want to infor... |
|java|tomcat|servlets|rpc| |
In a server-side application running on Tomcat, I am generating full HTML pages (with header) based on random user-requested sites pulled down from the Internet. The client-side application uses asynchronous callbacks for requesting processing of a particular web page. Since processing can take a while, I want to infor... |
Vim - For me it's best choice, regardless of technology I'm using at the moment.
It's not so hard to learn as it looks and during the work you are becoming more and more productive. |
[Resharper][1] will do this for you (and so so much more!)
[1]: http://www.jetbrains.com/resharper/ |
I do not use them and as they are not supported by any major browsers I doubt that anybody else will use them very often either. |
If you're dealing with two existing objects, you might get some mileage with the CopyTo method: http://msdn.microsoft.com/en-us/library/cc645053.aspx
Use the Add method of the other collection (receiver) to absorb them. |
is Microsoft sort.exe able to sort unicode UTF-16 (LE) files? |
|command-line|shell|microsoft|sorting| |
Well, it depends on the kind of structure, but you have to make the structure so that it carefully and silently detects and handles possible conflicts.
I doubt you can make one that is 100% lock-free, but again, it depends on what kind of structure you need to build.
You might also need to shard the structure so ... |
Another option is to use Firewire (IEEE1394) cameras, such as most common DV camcorders. They tend to work really well and give a lot better video than cheap web cams, and there is a plethora of tools in Linux for working with dv video, such as **dvgrab**. |
Use CreateDIBitmap rather than CreateDIBSection. |
I am using SSMS version 9.00.3042.00 as well, which probably explains why it is working on my machine. |
AFAIK, when a .NET web service returns a DataSet, it returns its XML representation (which is pretty friendly). The fact that a .NET client can consume the DataSet directly only abstracts the fact that an Xml Serialization-Deserialization is taking place.
So I would manually query the web services you require, obse... |
Writing thread-safe lock free code is hard; but [this article from Herb Sutter][1] will get you started.
[1]: http://www.ddj.com/cpp/210600279 |
As far as I know, the most pythonic/efficient method would be:
import string
filtered_string = filter(lambda x: x in string.printable, myStr) |
Running JIRA on a VM |
|version-control|vm|jira| |
Anyone have any success or failure running Jira on a VM?
I am setting up a new source control and defect tracking server. My server room is near full and my services group suggested a VM. I saw that a bunch of people are running SVN on VM (including NCSA). The VM would also free me from hardware problems and gi... |
I'll plug [Building Skills in Python][1]. Plus, if you want something more challenging, [Building Skills in OO Design][2] is a rather large and complex series of exercises.
[1]: http://homepage.mac.com/s_lott/books/python.html
[2]: http://homepage.mac.com/s_lott/books/oodesign.html |
This is documented at <a href="http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html#//apple_ref/doc/uid/30001215">developer.apple.com</a>. |
As mentioned, it really depends on what type of structure you're talking about. For instance, you can write a limited lock-free queue, but not one that allows random access. |
I need to know how to turn on Code Coverage when running TFS builds on a solution with a .testrunconfig file.
There is an option in the testrunconfig file that is for code coverage, but when running a TFS build there is no code coverage results.
I am running my tests using the *Tests.dll mask and NOT using Test... |
IF you're not the manager or owner of the project, I prescribe the following:
If they want it, do it. Make sure they pay you on payday. I've learned that sometimes the battle to get things to conform to what *you* would like, isn't worth fighting. Enjoy life, after work and plan & code your own personal projects ... |
Some browsers will cache SSL content. Firefox 2.0+ does not cache SSL resources on disc by default (for increased privacy). Firefox 3+ doesn't cache them on disc unless the Cache-control:public header appears.
So set the Expires: header correctly and Cache-control:public. e.g.
<Files ~ "\.(gif|jpe?g|png|ico|c... |
I think that the idea with .NET is that it is a "Write Once, Run Anywhere (that Microsoft chooses)". However, the [Mono][1] project is slowly changing the situation.
[1]: http://www.mono-project.com/Main_Page |
It will never be supported on as many platforms as Java, IMHO.
The only effort is Mono, not sponsored by Microsoft.
Check [here on SO][1] and on the [official site][2]
[1]: http://stackoverflow.com/tags/mono
[2]: http://www.mono-project.com |
This should work after you modify the field and table names to correspond to your database.
SELECT
BIRTHDATE AS BIRTHDAY
,BIRTHDATE + 7 AS ONE_WEEK_LATER
,DATEDIFF(dd,BIRTHDATE,GETDATE())/365 AS YEARS_AGO
,DATEDIFF(dd,BIRTHDATE+7,GETDATE())/365 AS YEARS_AGO_IN_A_WEEK
FROM
"... |
*Note: I've edited this to fix what I believe was a significant bug. The currently posted version works for me.*
This should work after you modify the field and table names to correspond to your database.
SELECT
BRTHDATE AS BIRTHDAY
,FLOOR(DATEDIFF(dd,EMP.BRTHDATE,GETDATE()) / 365.25) AS AGE_NO... |
Is Microsoft sort.exe 5.1.2600.0 (xpclient.010817-1148) able to sort UTF-16 (LE) files? |
Craig Larman's *Applying UML and Patterns*. While the Gang of Four book *Design Patterns* is very instructive, I found that I didn't "get" how to use design patterns until I ran across Larman's book in a programming class. |
[Looks like you cant][1]
[1]: http://forums.sun.com/thread.jspa?threadID=587299&messageID=4257939 |
[Google told me this][1]
[1]: http://forums.sun.com/thread.jspa?threadID=587299&messageID=4257939 |
*EDIT: Cleanup info and summarize*
Summary:
- Its a feature, not a bug
- It can be turned of with -XX:-UsePerfData which might hurt performance
Relevant info:
- [Sun forum][1]
- [Bugreport][2]
[1]: http://forums.sun.com/thread.jspa?threadID=587299&messageID=4257939
[2]: http://bugs.sun.com... |
> This however carries overhead as throwing exceptions in .NET can be quite costly.
You're serializing and de-serializing objects to XML and sending them over a slow network.. the overhead from throwing an exception is negligable compared to that.
I usually stick to throwing exceptions, since they clearly communi... |
> This however carries overhead as throwing exceptions in .NET can be quite costly.
You're serializing and de-serializing objects to XML and sending them over a slow network.. the overhead from throwing an exception is negligable compared to that.
I usually stick to throwing exceptions, since they clearly communi... |
are you talking about email clients? If so then you can set rules in outlook and I am sure there mustbe ways in other email cleints too!! If u are asking something else. sorry |
Look, I understand full well what I'm doing with the assignment trick.
You are telling me that the size of a bitfield type is rounded up to the cloest byte count, which is one option I listed in the initial question. But you didn't back it up with references.
In particular, I have tried various compilers which gi... |
If you "improve design" by introducing new relations/tables, you'll certainly have the need for different entities. If so, you'll need to deal with their semantics.
In the previous solution you were able to just update the LeadSource name to whatever you wanted in the appropriate SalesLead row. If you update the na... |
Take a look at SVN Work Bench, it's decent but not perfect
> sudo apt-get install svn-workbench |
The DOM is a data structure - it's a tree. |
"Branch" ?
Keeps the "tree" analogy and also hints at departments etc |
Branch ?
Keeps the tree analogy and also hints in this case at departments etc
Thinking about class heirarchies, Root is probably a special case of Branch, which is a special case of Node, special case of Leaf. The Branch/Node distinction is one you get to make for your special situation. |
Here are some simple rules:
* less clicks is better
* frequently used features should be easier to find
* features for "advanced" users can be harder to find than the ones above
Think about the number of mouse/keyboard clicks it takes a user to get to something.
PS - please don't tell the Office 2008 peo... |
Perhaps this is not what you are looking for, but reconsider the kind you are using exception handling. At first exception handling should not be treated to be "user-friendly", at least as long as you think of a programmer as user.
A sum-up for that may be the following article http://goit-postal.blogspot.com/2007/0... |
Javascript array reference |
|javascript| |
If I have the following:
{"hdrs": ["Make","Model","Year"],
"data" : [
{"Make":"Honda","Model":"Accord","Year":"2008"}
{"Make":"Toyota","Model":"Corolla","Year":"2008"}
{"Make":"Honda","Model":"Pilot","Year":"2008"}]
}
And I have a "hdrs" name (i.e. "Make"), how can I refere... |
|javascript|json| |
If I have the following:
{"hdrs": ["Make","Model","Year"],
"data" : [
{"Make":"Honda","Model":"Accord","Year":"2008"}
{"Make":"Toyota","Model":"Corolla","Year":"2008"}
{"Make":"Honda","Model":"Pilot","Year":"2008"}]
}
And I have a "hdrs" name (i.e. "Make"), how can I refere... |
Sun Studio version 12 is a free download(FREE and paid support available) -- http://developers.sun.com/sunstudio/downloads/thankyou.jsp?submit=%A0FREE+Download%A0%BB%A0.
I'm sure you have code completion and debugging support including plugin support in this IDE.
Sun Studio is available for Linux as well as S... |
You could do an HTTP HEAD request to the server for the files. This will return the header info (including file size) but not the actual file. You could then make a GET request to load the files.
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html>
(Check out section 9.4 HEAD)
What I would probably do is a ... |
Unit-testing is well worth the initial investment. Since starting to use unit-testing a couple of years ago, I've found some real benefits:
- **regression testing** removes the fear of
making changes to code
code (there's nothing
like the warm glow of seeing code
work or explode every time a ch... |
Unit-testing is well worth the initial investment. Since starting to use unit-testing a couple of years ago, I've found some real benefits:
- **regression testing** removes the fear of
making changes to code (there's nothing
like the warm glow of seeing code
work or explode every time a change is
... |
> The problem right now is that I'm running with -Werror
This is your real problem, IMO. You can try some automated ways of moving from (char *) to (const char *) but I would put money on them not just working. You will have to have a human involved for at least some of the work.
For the short term, just ignore the... |
there is a non vba solution as well that can also be controlled from the vba code as well.
In excel a data point represented by a #N/A will not display. Thus you can use a formula - the easiest is an IF function - that returns an #N/A as text in the graph data. this data point will then not display which means you don... |
You mean [Client Profile][1]?
*The .NET Framework Client Profile setup contains just those assemblies and files in the .NET Framework that are typically used for client application scenarios. For example: it includes Windows Forms, WPF, and WCF. It does not include ASP.NET and those libraries and components used p... |
I would try running it through ghostscript with appropriate parameters. |
I would try running it through ghostscript with appropriate parameters.
Something like `gs -dBATCH -dNOPAUSE -sDEVICE=pdfwriter -dCompatibilityLevel=1.2` |
Have you checked whether the `ArgumentOutOfRangeException` is thrown from your handler itself? May be worthwhile doing a simple write to the event log or trace at the entry of your exception handler and confirm you're actually hitting it.
***Edit:*** Information to writing to the event log can be found at:
http... |
I'd be tempted to run the soundex algorithm over a dictionary of English words and cache the results, then soundex your candidate string and match against the cache.
Depending on performance requirements, you could work out a distance algorithm for soundex codes and accept strings within a certain tolerance.
Sou... |
I'd be tempted to run the soundex algorithm over a dictionary of English words and cache the results, then soundex your candidate string and match against the cache.
Depending on performance requirements, you could work out a distance algorithm for soundex codes and accept strings within a certain tolerance.
Sou... |
I'd be tempted to run the soundex algorithm over a dictionary of English words and cache the results, then soundex your candidate string and match against the cache.
Depending on performance requirements, you could work out a distance algorithm for soundex codes and accept strings within a certain tolerance.
Sou... |
In theory, yes. .Net Assemblies are bytecodes, which are converted to native code upon startup, using a JIT ("just-in-Time") compiler.
In practice, there aren't many platforms beyond Windows which have a .Net JIT compiler. There's one for Linux, called MONO.
Don't know about Mac, Sun etc...
|
Since .NET is only available (officially) on Windows, then not, it isn't write one, run anywhere. However the Mono team are making a good go at helping spread .NET beyond Windows, but they are always way behind the official stuff. |
I don't think that it was the original plan, for Microsoft, to create runtimes for every platform and device, but they encouraged this by using a documented (?) intermediate language. |
What is idiomatic code? |
|c#|idiomatic|readable| |
I'd be interested in some before-and-after c# examples, some non-idiomatic vs idiomatic examples. Non-c# examples would be fine as well if they get the idea across. Thanks. |
Yes, this was a goal of .NET although I don't think it had the same emphasis as it did in Java. Currently, the only effor that I know of is the Mono project that is creating a version of the CLI which runs on Linux.
Interestingly enough, Silverlight actually has a slimmed down version of the CLR which can run on bot... |
Multiplatform was of course in the vision.. right now [mono][1] does a good job of implementing the runtime for other os.
[Mono][2]
[1]: http://www.mono-project.com/Main_Page
[2]: http://www.mono-project.com/Main_Page |
I would check disk performance on the virtual server. If that's one of the issues, I would recommend putting the database on a separate spindle. |
I would check disk performance on the virtual server. If that's one of the issues, I would recommend putting the database on a separate spindle.
Update: Move to separate spindle or Upgrade SQL Server version as Gulzar aptly suggests. |
make sure you close connections after retrieving data. |
You should be able to pass a logger around, so you create a logger based on some "common" for the task data - i.e. username, etc. Then, pass this logger as parameter to all methods you need. That way, you'll be able to set different filters and/or rules in your log4j config file. Or to scrape the output file based on t... |
You should be able to pass a logger around, so you create a logger based on some "common" for the task data - i.e. username, etc. Then, pass this logger as parameter to all methods you need. That way, you'll be able to set different filters and/or rules in your log4j config file. Or to scrape the output file based on t... |
Short answer -- no, Microsoft only supports MS operating systems (including Windows Mobile) for .NET.
Long answer -- there are public open-source projects to replicate the .NET framework for linux and other OSs, notably Rotor and [Mono][1]. They don't support everything, but you can deploy a lot of .NET code, inclu... |
Are you trying to make just CHM or other output formats too?
Take a look at DocBook. You can make (from one source file) pdf, html and chm - and some others, too. I've used it in the past but it's not very easy or convenient to use. If you only want to output chm (and need to use a free solution), see if you can get... |
How to Programmatically Build a TemplateColumn |
|asp.net| |
How does one go about programatically building a TemplateColumn object and adding it to a DataGrid. I know how to add it, but not how to build the contents of the TemplateColumn. There are no useful looking methods on the ITemplate the column class exposes. |
You'll probably want to consume someone else's component for this purpose rather than trying to roll your own, and there's no native WinForms way to do this.
There is a free library on CodeProject for this purpose, but I haven't tried it.
<http://www.codeproject.com/KB/toolbars/DockContainer.aspx> |
Calculate and track the [standard deviation](http://en.wikipedia.org/wiki/Standard_deviation) for a while. After you have a decent backlog, you can disregard the outliers by seeing how many standard deviations away they are from the mean. Even better, if you've got the time, you could use the info to do some [naive Bay... |
You could measure the standard deviation in your existing population and exclude those that are greater than 1 or 2 standard deviations from the mean?
It's going to depend on what your data looks like to give a more precise answer... |
You can integrate the new work at the sprint's start date, to have a great looking Burndown chart.
You can tag with a specific marker the additional work and evaluate at the sprint's end why you haven't be able to identify those tasks before. |
Looks like DBI (or a DBD, not sure where bind parameters are used) isn't honoring tie magic. |
From the example you gave, this is *not* a scoping issue, or none of the parameters would work.
Looks like DBI (or a DBD, not sure where bind parameters are used) isn't honoring tie magic.
The workaround would be to stringize or copy what you pass to it, like your second and third parameters do.
Care to share wh... |
From the example you gave, this is *not* a scoping issue, or none of the parameters would work.
Looks like DBI (or a DBD, not sure where bind parameters are used) isn't honoring tie magic.
The workaround would be to stringize or copy what you pass to it, like your second and third parameters do.
A simple test us... |