instruction stringlengths 0 30k ⌀ |
|---|
Remove the [L] from the previous rules:
RewriteBase /appRoot
RewriteRule ^$ app/webroot/
RewriteRule (.*) app/webroot/$1
[L] means "Stop the rewriting process here and don't apply any more rewriting rules." |
It really depends on your brother's learning style. Many people learn faster by getting their hands dirty & just getting into it, crystallising the concepts and the big picture as they progress and build their knowledge.
Me, I prefer to start with the big picture and drill down into the nitty-gritty. The first thing... |
When I was working for myself doing my consulting business I signed up for a hosted account and honestly I couldn't have done without it.
What I liked most about it was it took 30 seconds to sign up for an account and I was then able to integrate source control using sourcegear vault (which is an excellent source c... |
One of the things about SubVersion that irks me is that it puts its own folder in each directory of a project, whereas git only puts one in the root directory. It's not *that* big of a deal, but little things like that add up.
Of course, SubVersion has Tortoise, which is [usually] very nice. |
I would use the dayofyear function of datepart:
<pre><code>
Select *
from mytable
where datepart(dy,date1) = datepart(dy,date2)
and
year(date1) = year(date2) --assuming you want the same year too
</code></pre>
See the datepart reference [here](http://www.tizag.com/sqlTutorial/sqldatepart.php). |
This will do it, in one line (note the '*' wildcard at the end)
@files = </path/to/directory/*>;
# To demonstrate:
print join(", ", @files);
|
Don't move to UpdatePanels. Especially after coming from jQuery, [the drop in performance][1] would be untenable. Especially on a page as complex as yours sounds.
If you have 2,000 lines of JavaScript code, the solution is to refactor that code. If you put 2,000 lines of C# code in one file, it would be difficult... |
Don't move to UpdatePanels. After coming from jQuery, [the drop in performance][1] would be untenable. Especially on a page as complex as yours sounds.
If you have 2,000 lines of JavaScript code, the solution is to refactor that code. If you put 2,000 lines of C# code in one file, it would be difficult to maintai... |
It is <a href="http://blogs.vmware.com/vmtn/2008/01/virtual-leopa-1.html">legal</a> to run Mac OS X **Server** in a virtual machine *on Apple hardware*. All other forms of Mac OS X virtualization are currently forbidden. |
I usually use `keys` and I can't think of the last time I used or read a use of `each`.
Don't forget about `map`, depending on what you're doing in the loop!
map { print "$_ => $hash{$_}\n" } keys %hash;
|
You should look at the .NET Framework Configuration Tool. It's in the .NET SDK, and you can find instructions on running it here...
<http://msdn.microsoft.com/en-us/library/2bc0cxhc.aspx>
In the _Runtime Security Policy_ section you'll find 3 policy levels: Enterprise, Machine and User. If you drill into Machine ... |
From the simple test I have tried, aku is right, dispose is called as soon as the foreach block exit.
@David : However call stack is kept between call, so the connection would not be closed because on the next call we would return to the next instruction after the yield, which is the while block.
My understandi... |
Static libraries, that makes life more difficult in this regard. In case of dynamic libraries you could just have used ldd on the resulting executable and be done with it. The best bet would be some kind of configuration file. Alternatively you could try to look for -l arguments to gcc/ld. Those are used to specify lib... |
It is probably possible to do something useful using e.g. Perl, but you would have to provide more details. On the other hand, it could be easier to simply analyze the script... |
MSDN describes [how to enable streaming over WCF][1] rather well.
Note, if the link between client and server needs to be encrypted, then you'll need to "roll your own" encryption mechanism. The default `net.tcp` encryption requires X.509 certificates, which won't work with streams as this kind of encryption needs ... |
Install-base of Java JRE? |
|java|deployment| |
Is there an online resource somewhere that maintains statistics on the install-base of Java including JRE version information? If not, is there any recent report that has some numbers?
I'm particularly interested in Windows users, but all other OSs are welcome too. |
You can use [ResourceManager][1] class. See "ResourceManager and ASP.NET" article at http://msdn.microsoft.com/en-us/library/aa309419(VS.71).aspx
[1]: http://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.aspx |
I was trying to set the property from markup on an outside user control. When I took the property to OnLoad, it worked. |
1. Ditto on the SaveAs
2. Whenever I have to do Interop I create a separate VB.NET class library and write the logic in VB. It is just not worth the hassle doing it in C# |
Why do I receive a q[num] error when aborting a jQuery queue pipeline? |
|jquery|ajax| |
When creating and executing a ajax request queue with $.manageAjax, I call ajaxManager.abort();, to abort the entire queue due to error, at which time I get an error stating q[num] has no properties (jquery.ajaxmanager.js line 75) here is the calling code:
var ajaxManager = $.manageAjax({manageType:'sync', maxRe... |
If you don't mind working with older libraries there are quite a few. For example, there's a no-frills GUI kit for Ansi-C called [IUP][1]. Also, check out [this list][2] -- Search on that page for 'C API'. I think the most modern and well-known is the above-mentioned GTK+.
[1]: http://www.tecgraf.puc-rio.br/iu... |
That's a great question. ( There is a high chance this is going to end up a normalised versus denormalised database debate..which I am not going to start... okay now for some input.)
some off the top of my head things I have done (will add more when I have some more time or need a break)
client design - this is w... |
That's a great question. ( There is a high chance this is going to end up a normalised versus denormalised database debate..which I am not going to start... okay now for some input.)
some off the top of my head things I have done (will add more when I have some more time or need a break)
client design - this is w... |
For what it's worth, there is also [Google Docs][1]. I guess it's not a perfect fit, but it's versioning is **very** convenient.
[1]: http://docs.google.com/ |
Hope this helps a little, but at my college our web applications course just got revamped. So now we are going the jsp, servlet, hibernate route with the second part of the course on mostly JBoss Seam. So who knows, it probably just needs time to grow in the community. |
This can be quite tricky.
When attempting to figure out how to map route data into a route, the system currently searches top-down until it finds something where all the required information is provided, and then stuffs everything else into query parameters.
Since the required information for the route "Content/{... |
Is there a (preferably free) Java analogue of .NET's XML serialization? |
Most of these kinds of things can be determined programatically in Python, using modules like <tt>sys</tt>, <tt>os</tt>, and the special [<tt?_\_file_\_</tt>][1] identifier which tells you where you are in the filesystem path.
It's important to keep in mind that when a module is first imported it will execute everyt... |
Or
find . -name '*.as' -or -name '*.mxml' | xargs wc -l
Or if you use zsh
wc -l **/*.{as,mxml}
It won't give you what fraction of those lines are comments, or blank lines, but if you're only interested in how one project differs from another and you've written them both, it's a useful metric. |
No, there is not any facility to enumerate named events. You could enumerate all objects in the respective object manager directory using ZwOpenDirectoryObject and then filter for events. But this routine is undocumented and therefore should not be used without good reason.
Why not use a separate mechanism to share ... |
Yea FogBugz is great for process-light, quick and easy task management. It seems especially well suited for soloing, where you don't need or want a lot of complexity in that area.
By the way, if you want to keep track of what you're doing at the computer all day, check out TimeSprite, which integrates with FogBug... |
I see nothing wrong with using the async version. I can agree that the second version is shorter, but I'm not sure that I think it's easier to follow. The test does a lot of things that you wouldn't normally do, whereas the first example is more true to how you would use the component outside the test environment.
A... |
For warnings to be "flagged" to PHP natively would require changes to the mysql/mysqli driver, which is obviously beyond the scope of this question. Instead you're going to have to basically check every query you make on the database for warnings:
$warningCountResult = mysql_query("SELECT @@warning_count");
... |
For warnings to be "flagged" to PHP natively would require changes to the mysql/mysqli driver, which is obviously beyond the scope of this question. Instead you're going to have to basically check every query you make on the database for warnings:
$warningCountResult = mysql_query("SELECT @@warning_count");
... |
This looks like a job for [clearfix][1] to me ...
[1]: http://www.positioniseverything.net/easyclearing.html |
BigTable which is the database back end for App Engine will scale to millions of records. Due to this, App Engine will not allow you to do any query that will result in a table scan, as performance would be dreadful for a well populated table.
In other words Every query must use a index. This is why you can only do... |
This may sound like insanity, but if you are using NAnt (or Ant or some other automated build system), you can use NAnt properties as CSS variables in a hacky way. Start with a CSS template file (maybe styles.css.template or something) containing something like this:
a {
color: ${colors.blue};
}
... |
You should look at the .NET Framework Configuration Tool. It's in the .NET SDK, and you can find instructions on running it here...
<http://msdn.microsoft.com/en-us/library/2bc0cxhc.aspx>
In the _Runtime Security Policy_ section you'll find 3 policy levels: Enterprise, Machine and User. If you drill into Machine ... |
You may also use:
try
{
// Dangerous code
}
finally
{
// clean up, or do nothing
}
And any exceptions thrown will bubble up to the next level that handles them. |
For the really gritty problems that would be too time consuming to use print_r/echo to figure out I use my IDE's (PhpEd) debugging feature. Unlike other IDEs I've used, PhpEd requires pretty much no setup. the only reason I don't use it for any problems I encounter is that it's *painfully* slow. I'm not sure that sl... |
Please don't put your self in that world of pain. Instead use [UFRAME][1] which is a lot faster and is implemented in jQuery.
Now, to manage those 2000 lines of Javascript code I recommend splitting the code in different files and set up your build process to join them using JSMin or Yahoo Compressor into chunks.
... |
The way I see it is this.
You have a Windows Service, which is playing the role of a scheduler and in it there are some classes which simply call the webservices and put the data in your databases.
So, you can use these classes directly from the WebUI as well and import the data based on the WebUI trigger.
I d... |
Familiarity with the alogrithms/data structures I use and/or quick glance analysis of iteration nesting. The difficulty is when you call a library function, possibly multiple times - you can often be unsure of whether you are calling the function unnecessarily at times or what implementation they are using. Maybe lib... |
@Vaibhav
Unfortunately, the physical architecture of the solution will not allow any direct communication between the components, other than Web UI to Database, and database to service (which can then call out to the web services). I do, however, agree that re-use of the communication classes would be the ideal her... |
You could apply some [Standard Devision][1] to your logic and take notice of peaks over x%.
[1]: http://en.wikipedia.org/wiki/Standard_deviations |
@KP
After your update to the original question, the only real option available to you is to do some jiggery-pokery in Javascript on the client. The only issue with that would be provicing graceful degredation for non-javascript enabled clients.
e.g. You could add some AJAX-y goodness that reads a hidden form f... |
Static methods cannot be inherited or overridden, and that is why they can't be abstract. Since static methods are defined on the type, not the instance, of a class, they must be called explicitly on that type. So when you want to call a method on a child class, you need to use its name to call it. This makes inheritan... |
If you're talking about automatic XML serialization of objects, check out [Castor][1]:
> Castor is an Open Source data binding framework for Java[tm]. It's the shortest path between Java objects, XML documents and relational tables. Castor provides Java-to-XML binding, Java-to-SQL persistence, and more.
[1]... |
Python is considered (among Python programmers :) to be a great language for rapid prototyping. There's not a lot of extraneous syntax getting in the way of your thought processes, so most of the work you do tends to go into the code. (There's far less idioms required to be involved in writing good Python code than in ... |
Python is considered (among Python programmers :) to be a great language for rapid prototyping. There's not a lot of extraneous syntax getting in the way of your thought processes, so most of the work you do tends to go into the code. (There's far less idioms required to be involved in writing good Python code than in ... |
Here's an example of recursing through a directory structure and copying files froma backup script I wrote.
sub copy_directory {
my ($source, $dest) = @_;
my $start = time;
# get the contents of the directory.
opendir(D, $source);
my @f = readdir(D);
closedir(D);
# recurse throug... |
I couldn't agree with you more, HollyStyles. I also used to be a TSQL guy, and find some of Oracle's idiosyncrasies more than a little perplexing. Unfortunately, temp tables aren't as convenient in Oracle, and in this case, other existing SQL logic is expecting to directly query a table, so I give it this view instead.... |
Manual debugging is generally quicker for me - `var_dump()` and `debug_print_backtrace()` are all the tools you need to arm your logic with. |
Do not ***ever*** assume your user has access to certain key areas of the disc (i.e. program files, windows directory etc). Instead the default user account will only be able to write to a small section of their application data. Also, they won't be able to write to global areas of the registry - only the current user ... |
Is there a benefit to not having foreign keys? Unless you are using a crappy database, FKs aren't that hard to set up. So why would you have a policy of avoiding them? It's one thing to have a naming convention that says a column references another, it's another to know the database is actually verifying that relations... |
Alternative SSH Application to Plink |
|cvs|ssh|tortoisecvs|plink| |
The Iterator that the compiler synthesises implements IDisposable, which foreach calls when the foreach loop is exited.
The Iterators Dispose() method will clean up the using statements on early exit.
|
The Iterator that the compiler synthesises implements IDisposable, which foreach calls when the foreach loop is exited.
The Iterator's Dispose() method will clean up the using statements on early exit.
As long as you use the iterator in a foreach loop, using() block, or call the Dispose() method in some other way... |
Judging from [this technical explanation][1], your code will not work as expected, but abort on the second item, because the connection was already closed when returning the first item.
[1]: http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx |
Judging from [this technical explanation][1], your code will not work as expected, but abort on the second item, because the connection was already closed when returning the first item.
@Joel Gauvreau : Yes, I should have read on. [Part 3][2] of this series explains that the compiler adds special handling for finall... |
Having a very descriptive name helps to instantly see what is not working correctly, so that you don't actually need to look at the unit test code.
Also, a list of all the unit tests describes the intended behavior of the unit, and can be used (more or less) as documentation to the behavior of the unit under test.
... |
John's answer is good (that list comprehensions are better when you want to iterate over something multiple times). However, it's also worth noting that you should use a list if you want to use any of the list methods. For example, the following code won't work:
def gen():
return (something for someth... |
HTML Compression and SEO? |
|seo|html-compression| |
At work, we have a dedicated SEO Analyst who's job is to pour over lots of data (KeyNote/Compete etc) and generate up fancy reports for the executives so they can see how we are doing against our competitors in organic search ranking. He also leads initiatives to improve the SEO rankings on our sites by optimizing thin... |
[XStream][1] is pretty good at serializing object to XML without much configuration and money! (it's under BSD license).
We used it in one of our project to replace the plain old java-serialization and it worked almost out of the box.
[1]: http://xstream.codehaus.org/ |
Techniques to detect Polymorphic and Metamorphic viruses? |
|antivirus|virus| |
What techniques can be applied to detect [Polymorphic][1] and [Metamorphic][2] viruses?
How difficult is to implement these techniques?
Are these techniques being applied in modern day anti-virus softwares?
[1]: http://en.wikipedia.org/wiki/Computer_virus#Polymorphic_code
[2]: http://en.wikipedia.org/wi... |
[ProcessExplorer][1] is able to enumerate all the named events held by some specific process. You could go over the entire process list and do something similar although I have now clue as to what API is used to get the list...
[1]: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx |
[Tracker][1] ships with Ubuntu 8.04 -- it was a significant switch from Beagle which users believed was too resource (CPU) intensive and didn't yield good enough results. It indexes both pdf and chm and according to [this bug report][2] it also indexes djvu.
[1]: https://wiki.ubuntu.com/Tracker
[2]: http://bu... |
Oracle - What TNS Names file am I using? |
|oracle-database|connection|tns|tnsnames| |
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.
What's the best way to figure this out? ++happy for various platform solutions.
|
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.
What's the best way to figure this out? ++happy for various platform solutions.
|
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.
What's the best way to figure this out? ++happy for various platform solutions.
|
|oracle-database|connection|tns|tnsnames| |
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.
What's the best way to figure this out? ++happy for various platform solutions.
|
It seems like the answer is in the question - the method you suggested seems to be the right direction to go, except that if you have a big number of those shared members you might want to gather them into a struct or class and past that as the argument to the constructor of the base class.
If you insist on having t... |
To add to the previous explanations, static method calls are bound to a specific method at *compile-time*, which rather rules out polymorphic behavior. |
Static methods are not *instantiated* as such, they're just available without an object reference.
A call to a static method is done through the class name, not through an object reference, and the IL code to call it will call the abstract method through the name of the class that defined it, not necessarily the nam... |
Break down the algorithm into pieces you know the big O notation for, and combine through big O operators. That's the only way I know of.
For more information, check the [Wikipedia page](http://en.wikipedia.org/wiki/Big_O_notation) on the subject. |
I think you want to [cross-correlate][1] your signal with an expected, exemplar signal. But, it has been such a long time since I studied signal processing and even then I didn't take much notice.
[1]: http://en.wikipedia.org/wiki/Cross-correlation |
I don't know very much about instrumentation, so this might be totally impractical, but then again it might be a helpful different direction. If you know how the readings can fail, and there is a certain interval between peaks given such failures, why not do gradient descent at each interval. If the descent brings yo... |
Thanks guys!
For the record, this is line 176 in C:\xampp\apache\conf\httpd.conf
Note that you also have to edit line 203.
Also note that you have to use forward slashes "/" instead of back slashes "\" and restart your server. |
|unix|search| |
If the option exists to **not** do an XML signature and instead just to treat the XML as a byte stream and to sign that, do it. It will be easier to implement, easier to understand, more stable (no canonicalization, transform, policy, ...) and faster.
If you absolutely must have XML DSIG (sadly, some of us must), i... |
This blog entry references to something similar to what you need [here](http://blog.corunet.com/english/automatic-css-the-stylizator).
It contains a link to a Perl script called '[stylizator.pl](http://blog.corunet.com/uploads/stylizator/stylizator.zip)'. This script parses the html to look for possible CSS elements... |
Just a word of warning with:
<pre><code>DBCC CHECKIDENT (MyTable, RESEED, 0)</code></pre>
If you did not truncate the table, and the identity column is the PK, you will get an error when reaching pre-existing identites.
For example, you have identities (3,4,5) in the table already. You then reset the identity c... |
Aptana more or less is RadRails, or it's based on it. I've used it, and it's really good, but it does have some problems. For instance, it breaks the basic search dialog on my system (giving a raw java exception to the end user), and it clutters the interface with add like notices and upgrade bars and news feeds and...... |
What is the best way to partition terabyte drive in a linux development machine? |
|linux|storage|partition| |
I have a new 1 TB drive coming in tomorrow. What is the best way to divide this space for a development workstation?
The biggest problem I think I'm going to have is that some partitions (probably /usr) will become to small after a bit of use. Other partitions are probably to huge. The swap drive for example is curr... |
This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-3339 representation. The only restriction it has is that the DateTime is in Coordinated Universal Time (UTC).
using System;
using System.Globalization;
namespace DateTimeConsoleApplication
{
/... |
The latest Netbeans IDE (6.1) has a pretty solid Ruby support.
You can check it out [here](http://www.netbeans.org/features/ruby/index.html). |