instruction stringlengths 0 30k ⌀ |
|---|
1) Use a build system that doesn't use timestamps to detect modifications, like [scons][1]
2) Use [ccache][2] to speed up your build system that does use timestamps (and rebuild all).
In either case it is using md5sum's to verify that a file has been modified, not timestamps.
[1]: http://www.scons.org
[... |
PHP does not parameterize your command line parameters for you. See the output where your 2nd entry in ARGV is "param=test".
What you most likely want is to use the PEAR package [http://pear.php.net/package/Console_CommandLine][1]: "A full featured command line options and arguments parser".
Or you can be masochi... |
There are a number of commercial packages that will do what you want. I'm not sure from reading your question if free is a requirement. But here are some applications I've found that are reasonably priced and which do exactly what you want. I have not used them myself, but they have free trial downloads so you can e... |
You could use [Google AJAX Libraries API][1].
It provides a common distribution network and a loading architecture for jQuery, prototype, script.aculo.us, MooTools and dojo
[1]: http://code.google.com/apis/ajaxlibs/ |
Well, in a major brazilian bank corporation (Banco do Brasil) which is known by having one of the world´s most secure and efficient home banking software, they simply put history.go(1) in every page.So, if you hit the back button, you will be returned. Simple. |
You can do something like:
if($argc > 1){
if($argv[1] == 'param=test'){
$param = 'test';
}
}
Of course, you can get much more complicated than that as needed.
|
There are a few options, and which one you want depends on the context.
The simplest way is
std::cout << text << i;
or if you want this on a single line
std::cout << text << i << endl;
If you are writing a single threaded program and if you aren't calling this code a lot (where "a lot" is thousan... |
If the path can be a relative path, you should be able to use '.' or './' as the path. I'm not sure if it will work, but you could try it. |
In my builds, the configuration manager specifies the desired changelist number, and then the build script syncs to that, and imbeds it in build artifacts.
If they don't specify a changelist (or label), I use `p4 counter change` to get the current change number, and record it. Then I sync everything using that chan... |
In my builds, the configuration manager specifies the desired changelist number, and then the build script syncs to that, and imbeds it in build artifacts.
If they don't specify a changelist (or label), I use `p4 counter change` to get the current change number, and record it. Then I sync everything using that chan... |
In my builds, the configuration manager specifies the desired changelist number, and then the build script syncs to that, and imbeds it in build artifacts.
If they don't specify a changelist (or label), I use `p4 counter change` to get the current change number, and record it. Then I sync everything using that chan... |
With java generics using wildcards, you are allowed the above declaration assuming you are only going to read from it.
You aren't allowed to add/write to it, because all generic types must be stripped at compile time, and at compile time there isn't a way the compiler knows List<? extends Object> are only strings, ... |
httpd.conf is in /private/etc/apache2
Enable PHP by uncommenting line:
LoadModule php5_module libexec/apache2/libphp5.so
|
Toad, from ToadSoft.com -> [http://www.toadsoft.com/toad_oracle.htm][1]
For someone like me who likes to work with a DBA tool like Microsoft's SQL Management Studio, it's a life saver.
[1]: http://www.toadsoft.com/toad_oracle.htm |
As mentioned, <tt>Test::Differences</tt> is one of the standard ways of accomplishing this, but I needed to mention PerlUnit: please do not use this. It's "abandonware" and does not integrate with standard Perl testing tools. Thus, for all new test modules coming out, you would have to port their functionality if yo... |
Correct me if I'm wrong but I'm reading the question again and again and still think that Angus McCoteup was asking how to set an element to be position: fixed.
Angus McCoteup, check out http://www.cssplay.co.uk/layouts/fixed.html - if you want your DIV to behave like a menu there, have a look at a CSS there |
A simple RMagick example to convert a PDF to a PNG would be:
require 'RMagick'
pdf = Magick::ImageList.new("doc.pdf")
thumb = pdf.scale(300, 300)
thumb.write "doc.png"
To convert a MS Word document, it won't be as easy. Your best option may be to first convert it to a PDF before generating the... |
What is the best way to implement constants in Java ? |
|java|constants| |
I've seen examples like this:
public class MaxSeconds {
public static final int MAX_SECONDS = 25;
}
and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the best way to create constants. ... |
|java|constants| |
The file associations are defined in the registry under HKEY_CLASSES_ROOT.
There's a VB.NET example <a href="http://www.devx.com/vb2themax/Tip/19554?type=kbArticle&trk=MSCP">here</a> that I'm you can port easily to C#. |
We have a requirement to build a tool for users in an Intranet scenario.
The tool should check how much percentage of the Mailbox Quota (set in Active Directory) is being used.
Currently, they can check their Folder size using Outlook 2003 but this does not show the Quota Limit set for them or the percentage being u... |
We have a requirement to build a tool for users in an Intranet scenario.
The tool should check how much percentage of the Mailbox Quota (set in Active Directory) is being used.
Currently, they can check their Folder size using Outlook 2003 but this does not show the Quota Limit set for them or the percentage being u... |
The {$WARN NO_RETVAL OFF} is what you are looking for, but generally I like to find out why stuff like this happens. You might consider formatting it differently and seeing if that helps.
Do you have any flow altering commands like Exit in there? Do you directly raise exceptions, etc? Does your case statement h... |
I would vote for Java being more portable than C#. Java definitely also has a very rich set of standard libraries. There is also a broad set of open source 3rd party libraries out there such as those provided by the Jakarta project (http://jakarta.apache.org/).
All the usual suspects exist for CI, Unit testing, et... |
I've not used Fusion, just workstation and server
1) Yes, you can create a linked clone from current vm state, or from a saved state (snapshot) in VMware Workstation
2) Yes, revert to snapshots
3) There's a number of different network setups, NAT's one of them
4) VMware virtual machines created with VMware ... |
VMWare server is free, but only allows for one snapshot, a serious deficiency. VMWare Workstation allows multiple snapshots and can perform most of the same functionality. |
found this
[http://www.netnewsgroups.net/group/microsoft.public.dotnet.framework.aspnet/topic34203.aspx][1]
basically
protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (HttpContext.Current.Request.IsSecureConnection.Equals(false))
{
Response.Redirect("ht... |
Prepared statements are the best answer. You have testing because you can make mistakes!
See [this][1] question.
[1]: http://stackoverflow.com/questions/1284/catching-sql-injection-and-other-malicious-web-requests |
First off, System.XML provides some excellent ways to work with XML.
I'm assuming you loaded your XML into an XMLDocument, doing so allows you to use XPath Selectors, or just walk through the DOM.
Something like this would walk from whatever element back up to the top using recursion:
public XmlNode WalkTo... |
First off, System.XML provides some excellent ways to work with XML.
I'm assuming you loaded your XML into an XMLDocument, doing so allows you to use XPath Selectors, or just walk through the DOM.
Something like this would walk from whatever element back up to the top using recursion:
public XmlNode WalkTo... |
It looks to me like "type" has been created by some subversion aware copy command, then has been moved into the current directory using a subversion unaware copy. In my experience this sort of thing typically occurs when package refactoring operations have been chained together in eclipse without committing inbetween.... |
When you do "git clone git://location", all branches and tags are fetched.
In order to work on top of a specific remote branch, assuming it's the origin remote:
git checkout -b branch origin/branchname |
Try [this][1] or [this][2].
[1]: http://www.codelifter.com/main/javascript/capturemouseposition1.
[2]: http://snipplr.com/view/3032/get-mouse-position-from-quirksmodeorg/ |
I suppose you tried reading from a `FileInputStream` like this:
<pre><code>ZipInputStream in = new ZipInputStream(new FileInputStream(...));</code></pre>
This **WON'T** work!
Anyway, use [ZipFile][3] and also **don't reinvent the wheel**. Use **[commons-io][1]** where possible!
This usually looks like this:
... |
A couple of people mentioned the cpan utility, but it's more than just starting a shell. Just give it the modules that you want to install and let it do it's work.
<code>
$prompt> cpan Foo::Bar
</codE>
If you don't give it any arguments it starts the CPAN.pm shell. This works on Unix, Mac, and should be just f... |
The developers of ASP.NET Ajax took specific steps to make sure that the library could be used in conjunction with JQuery.
For example, the ATLAS CTP (the beta which became ASP.NET Atlas) used to have a $() function, but it was removed and replaced with $get(). |
The biggest problem are the people who don't know how to write proper unit tests. They write tests that depend on each other (and they work great running with Ant, but then all of sudden fail when I run them from Eclipse, just because they run in different order). They write tests that don't test anything in particular... |
Why are the hash codes generated by this function not unique? |
why hash codes generated by this function are not unique? |
|hash-code-uniqueness|hash-function| |
|hash-code-uniqueness|hash-function|vb6| |
Why are the hash codes generated by this function not unique? |
|vb6|hash-code-uniqueness|hash-function| |
I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings
"122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.208333333... |
I'm testing the below VB function, which I get from a Google search and plan to use it to generate hash codes for quick string comparison. However, there are occasion in which two different strings would have the same hash code. For example, these strings
"122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.20... |
I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings
"122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.208333333... |
apache axis ConfigurationException |
|java|apache|axis| |
I am using apache axis to connect my java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:
org.apache.axis.ConfigurationException: No service named <web service name> is available
any idea? |
No.
Answer here:
[http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx][1]
"ASP.NET is not available with Server Core installation option in any edition"
[1]: http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx |
Here's a script I use to generate resource files for testing in different languages. It just parses a response from babelfish so clearly the translation will be about as high quality as that done by a drunken monkey, but it's useful for testing and such
-------------------
for i in $trfile
do
key=`echo $i | ... |
I think the best way of doing this is to always pass the object as UTC, and convert to local time on the clients. By doing so, there is a common reference point for all clients.
To convert to UTC, call ToUniversalTime on the DateTime object. Then, on the clients, call ToLocalTime to get it in their current time zo... |
Grasshopper is really the best solution at this time, if the licensing works for you (the free version has some significant limitations). Its completely based on the Mono class libs (which are actually pretty good), but runs on top of standard Java VMs. Thats good as the Java VMs are generally a bit faster and more s... |
VB.Net
Function StackOverflow() As Integer
Return StackOverflow()
End Function
|
FFTs (Fast-Fourier Transforms) would indeed be involved. FFTs allow you to approximate any analog signal with a sum of simple sine waves of fixed frequencies and varying amplitudes. What you'll essentially be doing is taking a sample and decomposing it into amplitude->frequency pairs, and then taking the frequency th... |
I prefer Profont. |
If you have many folders in the root of repository and your local copy reflects the repository, then try to slit monolithic local copy into many separated downloadable folders and update these folders separately too, It will be really faster than one big folder. |
As per [this link][1] a good starting point is:
Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host
However, if the domain is http://www.domainname.com:500 this will fail.
The following resolves this:
Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host + (Request.Url... |
How about:
String domain = "http://" + Request.Url.Host
|
To Answer your question, Yes there exists several of libraries that do exactly what you are talking about. As far as which one you want to use is an entirely different question. PHPClasses and pear.org are good places to start looking for such libraries.
As for me, i just have everything already memorized and figure... |
To add a bit more to the conversation, Java is more portable if you remain about one version behind - Java 5 still has many excellent features so you can wait for Java 6 and still have a lot of range in terms of language and libraries to develop with. The Mac is the primary platform that can take some time to catch up... |
There was also a list of .NET profilers in the [What Are Some Good .NET Profilers][1] question.
[1]: http://stackoverflow.com/questions/3927/what-are-some-good-net-profilers |
Firstly, note that Python allows for the following (no need to assign to a tuple):
q, r = divide(22, 7)
Regarding your question, there's no hard and fast rule either way. For simple (and usually contrived) examples, it may seem that it's always possible for a given function to have a single purpose, resulting... |
Firstly, note that Python allows for the following (no need for the parenthesis):
q, r = divide(22, 7)
Regarding your question, there's no hard and fast rule either way. For simple (and usually contrived) examples, it may seem that it's always possible for a given function to have a single purpose, resulting ... |
Ban them from using any wireless device or laptop and keylog the machines? |
Slow SQL Query due to inner and left join? |
|sql-server|performance|freetext| |
Can anyone explain this behavior or how to get around it?
If you execute this query:
select *
from TblA
left join freetexttable ( TblB, *, 'query' ) on TblA.ID = [Key]
inner join DifferentDbCatalog.dbo.TblC on TblA.ID = TblC.TblAID
It will be very very very slow.
If you change that query... |
I've always used the first solution because 99% of the time, variables in $_GET, $_POST, and $_COOKIE are never outputted to the browser. You also won't ever mistakenly write code with an SQL injection (unless you don't use quotes in the query), whereas with the second solution you could easily forget to escape one of ... |
I'm working with C# and Postgres using <b>Npgsql2</b> component, and they work fast, I recommend you.
<b>Note:</b> If you want an application that works with any database you can use the <b>DbProviderFactory</b> class and make your queries using <b>IDbConnection</b>, <b>IDbCommand</b>, <b>IDataReader</b> and/or <b>I... |
I'm working with C# and Postgres using <b>Npgsql2</b> component, and they work fast, I recommend you.
You can download from http://pgfoundry.org/projects/npgsql
<b>Note:</b> If you want an application that works with any database you can use the <b>DbProviderFactory</b> class and make your queries using <b>IDbCon... |
Index the field you use to perform the join.
A good rule of thumb is to assign an index to any commonly referenced [foreign](http://en.wikipedia.org/wiki/Foreign_key) or [candidate keys](http://en.wikipedia.org/wiki/Candidate_key). |
as @Rob Walker states, parameterized queries are your best bet. If you're using the latest and greatest PHP, I'd highly recommend taking a look at [PDO][1] (PHP Data Objects). This is a native database abstraction library that has support for a wide range of databases (including MySQL of course) as well as prepared s... |
Today most languages/platforms (Java, .NET, PHP, Perl etc.) can work with almost any DBMS (SQL Server, Firebird, MySQL, Oracle, PostgresSQL etc.) so I wouldn't worry for one second. Sure there might be glitches and small problems but no showstopper.
As jalcom suggested you should program against a set of interfaces ... |
That's a fine solution. I just wanted to add
set -e
as a rudimentary error mechanism. It will immediately stop your script if a simple command fails. I think this should have been the default behavior: since such errors almost always signify something unexpected, it is not really 'sane' to keep executing the ... |
If it doesn't build only on the one machine, then either you've managed to make that machine different, or the VS2005 install is corrupted. If you take the error message at face-value, then the problem is probably the latter. Try running the repair feature of the VS2005 installer, or failing that, reinstall VS2005. ... |
Unfortunately, that error is the general catch-all error handler for setup projects. As a wild guess, I'd say that maybe the setup project got corrupted somehow, which is causing the "Invalid Syntax" error.
Try creating a new setup project and start by doing things one step at a time, and see if you can reproduce th... |
Introduction to Eclipse RCP: [link text][1]
[1]: http://www.vogella.de/articles/RichClientPlatform/article.html |
Split a list feature in C# (Possibly LINQ) |
|c#|linq| |
Another easy one hopefully.
Let's say I have a collection like this:
List<DateTime> allDates;
I want to turn that into
List<List<DateTime>> dividedDates;
where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year.
Is there a bit of LINQ trickery... |
Another easy one hopefully.
Let's say I have a collection like this:
List<DateTime> allDates;
I want to turn that into
List<List<DateTime>> dividedDates;
where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year.
Is there a bit of LINQ trickery... |
How do you use gnuplot's built-in fonts? |
|gnuplot| |
The gnuplot docs have this to say about fonts:
<pre> Five basic fonts are supported directly by the gd library. These are
`tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold),
`large` (8x16) or `giant` (9x15 pixels).</pre>
But when i try to use one:
<pre> gnuplot> set terminal p... |
The point of bounded wildcard types is their use in method signatures to increase API flexibility. If, for example, you implement a generic `Stack<E>`, you could provide a method to push a number of elements to the stack like so:
public void pushAll(Iterable<? extends E> elements) {
for(E element : ele... |
HotAdd CPU. http://msdn.microsoft.com/en-us/library/bb964703.aspx |
There's a great article on the new T-SQL features [here][1] (by SQL guru Itzik Ben-Gan). It covers
<ul>
<li>Declaring and initializing variables
<li>Compound assignment operators
<li>Table value constructor support through the VALUES clause
<li>Enhancements to the CONVERT function
<li>New date and time data typ... |
How about pdf2tiff? http://python.net/~gherman/pdf2tiff.html
|
You'll need some kind of abstract factory of one sort or another to pass the buck to:
interface Factory<E> {
E create();
}
class SomeContainer<E> {
private final Factory<E> factory;
SomeContainer(Factory<E> factory) {
this.factory = factory;
}
... |
You might want to start out with Cream. Cream describes itself as "a modern configuration" of vim. Basically, it is a special version of vim which looks and feels like any other text editor for all practical purposes. But enable the "expert mode" and you have all the power and behavior of vim.
So you can start using... |
Better terminal in Mac OS X -- reversing the control and command key-mappings |
|macos|terminal| |
I'm trying to have the same KDE Konsole experience within Mac OS X.
Here's my (overly complicated?) setup:
- I have Control and Command swapped at the System Preferences level. (Can't live without this)
- Parallels lets you, at the Parallels application level, also reverse Control and Command. So I can und... |
Most JVMs will kick of a GC (depending on the -XX:DiableExpliciteGC and -XX:+ExplicitGCInvokesConcurrent switch). But the specification is just less well defined in order to allow better implementations later on.
The spec needs clarification: [http://bugs.sun.com/view_bug.do?bug_id=6668279][1]
Internally the gc m... |
Git supposedly supports webdav, and should work with any webdav server. However, it's really slow compared to the native git protocols.
http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt |
Java Right Click does not make a selection. What is the easiest way to solve this globally? |
|java|swing| |