instruction stringlengths 0 30k ⌀ |
|---|
Perforce/Emacs Integration
http://p4el.sourceforge.net/p4.el.html |
Have you ever looked at [Processing.org][1]? It's basically a simplified application framework for developing "artsy" applications and physical computing platforms, but it's based on Java and you can dig down to the "real" Java underneath.
The reason it came to mind is that there are several video [libraries][2] for... |
I use [HTTPWatch][1]. It provides all of the information like Firefox LiveHeaders, but in a much more useful manner. It is also a great tool to determine if you have any content that are blocking operations for downloading further content for a page.
[1]: http://www.httpwatch.com/ |
If I can get away with it I will just use the App.Config, however, if I need something more complex I will use custom configuration sections. Yes it is a pain to get an understanding of in the beginning, but a unified configuration source, and familiar configuration for all settings is worth the time investment in my ... |
Which configuration method do you prefer in .net? Why? |
|.net|configuration| |
- You can use App.config; but it only supports key/value pairs.
- You can use .Net configuration, configuration sections; but it can be really complex.
- You can use Xml Serialization/Deserialization by yourself; your classes-your way.
- You can use some other method; what can they be? ...
Which of these ... |
|.net|configuration| |
you could dynamically feed the image by calling an aspx page in the SRC.
Ex;
<img src="provideImage.aspx?someparameter=x" />
On the page side, you`ll need to put the image in the response and change the content type for an image.
The only "problem" is that your images won't be indexed a you better put ... |
Determine whether the default collation is case-sensitive like this:
select charindex('If the result is 0 you are in a case-sensitive collation mode', 'RESULT')
A result of 0 indicates you are in a case-sensitive collation mode, 1 indicates it is case-insensitive.
If the collation is case-insensitive, you need... |
You are probably better off using just a generic collection<Control> anyways. Bieng Control Collection doesnt really do anything special for it.
puclic class MyCollection : Collection<Control> |
The best approach I've found to creating both Flex and AIR applications from the same source, is to use a core library project for almost all code, with separate small projects for the Flex and AIR applications.
There are two key concepts that make this very powerful and maintainable, allowing for not just two appli... |
How do I perform a case-sensitive search and replace in SQL 2000/2005? |
|sql|collation| |
In order to perform a case-sensitive search/replace on a table in a SQL 2000/2005 database, you must use the correct collation.
How do you determine whether the default collation for a database is case-sensitive, and if it isn't, how to perform a case-sensitive search/replace? |
First off let me say that I don't think that the subtle differences between Java bytecode and MSIL is something that should bother a novice .NET developer. They both serve the same purpose of defining an abstract target machine which is a layer above the physical machine being used in the end.
MSIL and Java bytecod... |
How to route in linux |
|linux|routes|ip|ip-address| |
I have 20 ips from my isp. I have them bound to a router box running centos. What commands, and in what order, do I set up so that the other boxes on my lan, based either on their mac addresses or 192 ips can I have them route out my box on specific ips. For example I want mac addy xxx:xxx:xxx0400 to go out 72.049.12.1... |
The rules of C# are very different from that of Java and C++.
When you are in the constructor for some object in C#, that object exists in a fully initialized (just not "constructed") form, as its fully derived type.
namespace Demo
{
class A
{
public A()
{
... |
This is a perfect example of porting a C idiom to C++ (and why it might not always work...)
The problem you will have with using memset is that in C++, a struct and a class are exactly the same thing except that by default, a struct has public visibility and a class has private visibility.
Thus, what if later on,... |
I personally use SpiderMonkey, but here's an extensive list of [ECMAScript shells][1].
[1]: http://burstproject.org/build/doc/shells.html |
I personally use SpiderMonkey, but here's an extensive list of [ECMAScript shells][1]
Example spidermonkey install and use on Ubuntu:
$ sudo apt-get install spidermonkey
$ js myfile.js
output
$ js
js> var f = function(){};
js> f();
[1]: http://burstproject.org/build/doc/shells.... |
Try this:
var s = ["<a href='", url, "'>click here</a>"].join("");
|
If you'd like more sample code on using JavaMail with Gmail (e.g. converting Gmail labels to IMAP folder names, or using IMAP IDLE), do check out my program [GmailAssistant][1] on [SourceForge][2].
[1]: http://gmailassistant.sourceforge.net/
[2]: http://www.sourceforge.net/ |
JavaScript doesn't have a native StringBuffer object, so I'm assuming this is from a library you are using, or a feature of an unusual host environment (i.e. not a browser).
I doubt a library (written in JS) would produce anything faster, although a native StringBuffer object might. The definitive answer can be foun... |
Your problem seems to be the C core in C++, not C++ itself. Get yourself the Kernighan & Richie (The C programming language). Inhale it. It's very good stuff, one of the best programming language books ever written.
|
Perhaps during development you could use an IPC remoting channel which uses named pipes instead of TCP. If your remoting channels are set up via a config file then you won't even have to recompile.
I found the link below was useful when setting up an IPC channel.
[http://www.danielmoth.com/Blog/2004/09/ipc-with-r... |
Yes, according to the usual benchmarks. E.G : http://mckoss.com/jscript/SpeedTrial.htm.
But for the small strings, this is irrelevant. You will only care about performances on very large strings. What's more, in most JS script, the bottle neck is rarely on the string manipulations since there is not enough of it.
... |
We use [Bamboo][1].
For a rather extensive feature matrix of the various major CI servers, have a look at: [http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix][2]
[1]: http://www.atlassian.com/software/bamboo/
[2]: http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix |
I believe it's not possible to use these kind of operators on CLOB fields, because of the way they're stored. |
How to convert from Decimal to T? |
|c#| |
I've built a wrapper over NumbericUpDown control.
The wrapper is generic and can support int? and double?
I would like to write a method that will do the following.
private T? Getvalue()
{
T? value = numericUpDown.Value as T?;
return value;
}
of course there is no cast between decimal and double? or i... |
I've built a wrapper over NumbericUpDown control.
The wrapper is generic and can support int? and double?
I would like to write a method that will do the following.
public partial class NullableNumericUpDown<T> : UserControl where T : struct
{
private NumbericUpDown numericUpDown;
... |
How to allow different content types in different folders of the same document library in wss 3.0? |
|wss|sharepoint| |
I have a document library with about 50 available content types. This document library is divided into several folders. When a user cliks the "New" button in a folder, all available content types are offered. I need to limit the content types according to the folder. For example, in the folder "Legal" a want to have o... |
How to allow different content types in different folders of the same document library in WSS 3.0? |
|sharepoint|wss| |
I would probably just move all the apps to mod_rails, as the performance seems comparable to Mongrel and there's less administration overhead.
With regards to configuration gotchas, just make sure that you allow your public directory, or you'll find static assets failing:
<Directory "/var/www/app/current/publ... |
|sql|sql-server-2005|sql-server-2000|collation| |
How do I find out what collations are available in SQL 2000/2005 |
|sql|collation| |
If I need to choose a collation mode to work with, how do I know what collations are available? |
Use this query to list the available collation modes:
SELECT *
FROM fn_helpcollations() |
You should take a look at [C5 Generic Collection Library][1]. This library is a systematic approach to fix holes in .NET class library by providing missing structures, as well as replacing existing ones with set of well designed interfaces and generic classes.
Among others, there is `HashSet<T>` - generic Set class ... |
If you want to stick to command line FTP, you should try NcFTP. Then you can use get -R to recursively get a folder. You will also get completion. |
After doing some Googling on bugs.sun.com, this looks like this might be a JDK bug that was only fixed in JDK 6.
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434148 |
Some advice on merging the changes back if someone makes changes the branch multiple times (pre 1.5): **remember at which revision you did the merge**! Either write the revision numbers down somewhere, **or** (which is easier) **make a tag**. (you can of course find it out later, but thats a pita)
Example:
you ha... |
Scalability is also very important factor for pusing business logic in middle or app layer than to database layer.It should be understood that DatabaseLayer is only for interacting with Database not manipulating which is returned to or from database.
|
>> Simple, parse MP3 binary blob to calculate something, in Python
That sounds like a pretty tall order. I don't know Python, but here's some code I've refactored from another program I once tried to write.
**Note:** It's in C++ (sorry, it's what I've got). Also, as-is, it'll only handle constant bit rate MPEG 1 ... |
You can define the _CRT_SECURE_NO_WARNINGS symbol to suppress them and undefine it to reinstate them back. |
While there is no one right answer - it depends on the project in question, I would recommend the approach advocated in "[Domain Driven Desig][1]n" by Eric Evans. In this approach the business logic is isolated in its own layer - the domain layer - which sits on top of the infrastructure layer(s) - which could include ... |
in addition to all the other comments about the practicalities of getting the project under source control I'd encourage you to take a look at [Streamed Lines: Branching Patterns for Parallel Software Development][1] as guide to code line and branching policies - might save you some re-work later.
Also [Eric Sink ][... |
Where is a good place to brush up on some math? |
|math|computer-science|algebra|discrete-mathematics| |
Math skills are becoming more and more essential, I'm wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff?
A sight with lots of video's as well as practise exercises would be a double win but I cant seem to find one. |
For very simple cases you can put your business logic in stored procedures. Usually even the simple cases tend to get complicated over time. Here are the reasons I don't put business logic in the database:
Putting the business logic in the database tightly couples it to the technical implementation of the database. ... |
Embedding the interpreter is no issue. I am more interested in features and performance at this point in time. LUA and Squirrel are both interpreted, which is nice because one of the games i am building out is to include modifiable code, which has an editor in game.
I would love to hear about python, as i have seen ... |
Are you sure you've checked out the head and not a lower revision? Also, have you done an update to make sure you've got the latest version?
There's a discussion about this on <a href="http://svn.haxx.se/users/archive-2007-01/0170.shtml">http://svn.haxx.se/users/archive-2007-01/0170.shtml</a>.
|
There isn't a good way to do this in SQL. Some approaches I have seen:
1) Use CASE combined with boolean operators:
WHERE
OrderNumber = CASE
WHEN (IsNumeric(@OrderNumber) = 1)
THEN CONVERT(INT, @OrderNumber)
ELSE -9999 -- Some numeric value that just cannot exi... |
Use a [CASE][1] statement
WHERE
CASE IsNumeric(@OrderNumber) = 1 THEN
OrderNumber = @OrderNumber
ELSE
OrderNumber LIKE '%' + @OrderNumber
END
[1]: http://msdn.microsoft.com/en-us/library/ms181765.aspx |
Use a [CASE][1] statement
**UPDATE:** The previous syntax (as pointed out by a few people) doesn't work. You can use CASE as follows:
WHERE OrderNumber LIKE
CASE WHEN IsNumeric(@OrderNumber) = 1 THEN
@OrderNumber
ELSE
'%' + @OrderNumber
END
Or you can use an IF sta... |
Perform the move directly in the repository. |
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
That should do the trick. |
Does the unmodifiable wrapper for java collections make them thread safe? |
|java|multithreading|collections|unmodifiable| |
I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection? |
Define PC, what do you consider a PC?
I am currently typing this from an Linux distribution that is running on an arm 9 processor, which can be set into different endianness, but the default is big endian. Little endian is used by Intel, AMD and Via (x86 compatible).
Endian-ness won't go away any time soon, anyti... |
Yes, always. You should be able to recreate your production database structure with a useful set of sample data whenever needed. If you don't, over time minor changes to keep things running get forgotten then one day you get bitten, big time. Its insurance that you might not think you need but the day you do it it wort... |
EJB3 Transaction Propogation |
|jakarta-ee|ejb-3.0|transactions| |
I have a stateless bean something like:
@Stateless
public class MyStatelessBean implements MyStatelessLocal, MyStatelessRemote {
@PersistenceContext(unitName="myPC")
private EntityManager mgr;
@TransationAttribute(TransactionAttributeType.NEVER)
public void processObjec... |
|transactions|ejb-3.0|jakarta-ee| |
I have a stateless bean something like:
@Stateless
public class MyStatelessBean implements MyStatelessLocal, MyStatelessRemote {
@PersistenceContext(unitName="myPC")
private EntityManager mgr;
@TransationAttribute(TransactionAttributeType.SUPPORTED)
public void processO... |
[SqlServerCentral][1] - great source of articles, scripts, advice
Unfortunately to access the articles you need to register (it is free though)
I guess one thing they could learn from StackOverflow is to remove [login barrier][2]
[1]: http://www.sqlservercentral.com/
[2]: http://www.codinghorror.com/blo... |
Modern JVM/JIC compilers have removed the performance hit of most of the traditionally "slow" operations, including instanceof, exception handling, reflection, etc.
As Donald Knuth wrote, "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." The perf... |
Generally the reason why the "instanceof" operator is frowned upon in a case like that (where the instanceof is checking for subclasses of this base class) is because what you should be doing is moving the operations into a method and overridding it for the appropriate subclasses. For instance, if you have:
if ... |
UTF-16 is still a variable length character encoding (there are more than 2^16 unicode codepoints), so you can't do O(1) string indexing operations. If you're doing lots of that sort of thing, you're not saving anything in speed over UTF-8. On the other hand, if your text includes a lot of codepoints in the 256-65535 r... |
'instanceof' is actually an operator, like + or -, and I believe that it has its own JVM bytecode instruction. It should be plenty fast.
I should not that if you have a switch where you are testing if an object is an instance of some subsclass, then your design might need to be reworked. Consider pushing the subcl... |
static_cast means that you can't accidentally const_cast or reinterpret_cast, which is a good thing. |
I've had a problem similar to this happen before. Are you using an plugins like ReSharper or DevExpress? |
You might also want to check out [Tie::IxHash][1], which implements ordered associative arrays. That would allow you to do both types of lookups (hash and index) on one copy of your data.
[1]: http://search.cpan.org/~gsar/Tie-IxHash-1.21/lib/Tie/IxHash.pm |
Salesforce.com - Why uploading of Apex class is not working? |
|apex|force.com|salesforce| |
I have an Apex class (controller) originally developed under Developer Edition and need to upload it to production which is Enterprise Edition.
The upload fails with following message
classes/RenewalController.cls(RenewalController):An error occurred on your page.
package.xml(RenewalController):An ... |
You might also find the suggestions [here][1] helpful - elements of this were covered on Stack Overflow a few weeks ago.
Personally I'd say don't bother trying to give the VM more than 2Gb of ram (I've had mixed results giving it more than 1, but your mileage may vary, and my experience is all with VMware Fusion 1).... |
Can I return the 'id' field after a LINQ insert? |
|c#|linq|linq-to-sql| |
When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call? I am assuming this is pretty easy, I just don't know how.
Thank you. |
Get Performance Counter Instance Name (w3wp#XX) from ASP.NET worker process ID |
|asp.net|iis-6|performancecounter| |
I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple application pools on that server, they are differentiated using an index (#1, #2 etc.) but I don't know how to match a process ID (which I have) to that ... |
No. If you let them view it, they can always make a copy of what they saw. You can make it harder for this to happen, but in the end, you can't stop a suitably determined attacker. |
the answer is simple : no |
Simply put, no, there isn't. Any content that can be viewed can be copied. There's no exception to this at all, unless you can bend the laws of physics in your favor :) |
You need to read about MSXML parser. Here is a link to a good all-in-one example <http://oreilly.com/pub/h/466>
Some reading on XPath will help as well. You could get all the information you need in MSDN. |
You need to read about MSXML parser. Here is a link to a good all-in-one example <http://oreilly.com/pub/h/466>
Some reading on XPath will help as well. You could get all the information you need in MSDN.
Stealing the code from [Luke](http://stackoverflow.com/users/17602/luke) excellent reply for aggregation purp... |
You need to read about MSXML parser. Here is a link to a good all-in-one example <http://oreilly.com/pub/h/466>
Some reading on XPath will help as well. You could get all the information you need in MSDN.
Stealing the code from [Luke](http://stackoverflow.com/users/17602/luke) excellent reply for aggregation purp... |