Assume color = "orange";
Ruby:
puts("My favorite color is #{color.downcase() + 'ish'} -- at least for now.");
PHP:
print("My favorite color is {strtolower( $color ) + 'ish'} -- at least for now.");
The PHP version does not work like I would like it to. I'm not looking for any language wars, I just want to know if anyone knows of a...
I'm wondering if there's an idiomatic one-liner or a standard-distribution package/function that I can use to compare two Perl hashes with only builtin, non-blessed types. The hashes are not identical (they don't have equivalent memory addresses).
I'd like to know the answer for both for shallow hashes and hashes with nested collections...
I am looking for an XML comparing tool that understands xml. It cannot be a line by line comparision like WinMerge or Beyond Compare.
An ideal solution would be one that shows changes similar to the way Word 2007 shows track changes. DeltaXML does this, but does not come with a real GUI 'out of the box' and is $500 per user!:
Xamxm...
(can you tell I'm learning Ruby today? :))
I want to determine if the multidimensional array I'm working with is a 'rectangle'--i.e., the rows are the same size. Here's what I'm doing, which works but feels clunky.
if @myArray[0].size != @myArray[[email protected]].size
raise "This array is not a rectangle."
end
Basically, I'm check...
I'm a C# .NET developer and I work on mostly ASP.NET projects.
I want to learn a new programming language,
to improve my programming skills by experiencing a new language,
to see something different then microsoft environment,
and maybe to think in a different way.
I focus on two languages for my goal. Python and Ruby.
Which one ...
I am looking at using Beyond Compare 3 with XML Tidy compare comparison format. XML Tidy formats all the nodes with proper line breaks and indentation if an XML file is all slopped onto one line. ...So I would love a tool that can do this and can ignore differences in attributes, or not even show attributes at all (this is because attr...
I'm putting together a presentation to my company on the reasons I'm adopting jQuery as the preferred JavaScript / AJAX library.
While most of the work is done, a comparison between different libraries would be of great use - especially against the Microsoft ASP.Net Ajax framework.
Now please note I'm not after a theological debate on ...
I've seen a few questions here related to determining the similarity of files, but they are all linked to a particular domain (images, sounds, text, etc). The techniques offered as solutions require knowledge of the underlying file format of the files being compared. What I am looking for is a method without this requirement, where arbit...
I have a custom object that maps a boolean value from a legacy database to a C# bool (and back again).
My custom bool object looks like this:
public class S2kBool : IUserDefinedType {
public bool Value { get; set; }
public Type SupportedType { get { return typeof(string); } }
// These are the values used to represent bool...
Is there any other MS Access DB comparison tool like Cross-Database comparator? I want a tool that does a mass comparison like CDB
...
What is the difference between == and === in php. I am unsure when to use both.
Updated note: So that it shows up in StackOverflow search, the difference between == and === is the same as the difference between != and !==.
...
Okay big brains here's something that's more of a challenge than a requirement. I am a bit stumped. I usually just need a prod in the right direction, so get your prodding sticks ready.
I have a tabcontrol covered in textboxes. I want to perform a check of the contents of all the textboxes during the SelectedIndexChanged event on a list...
I have a large directory that contains only stuff in CS and Math. It is over 16GB in size. The types are text, png, pdf and chm. I have currently two branches: a branch of my brother's and mine. The initial files were the same. I need to compare them. I have tried to use Git, but there is a long loading time.
What is the best way to co...
I tried to make character by character comparison under string type,
with the following code:
vector <int> getQuality(string seedTag, vector <string> &MuTag) {
vector <int> Quals;
for (unsigned i = 0; i<MuTag.size(); i++) {
Quals.push_back(-40);
cout << MuTag[i] << " " << seedTag[i] << endl;
if...
Update: In fact, the only acceptable solution for this problem would be sorting the array ascending and then reversing it.
Let S be the following sequence of events:
Event | Time
A | 0:00
B | 0:01
C | 0:01
D | 0:02
I have a simple Comparator to sort S, which sorts the elements according to the time value.
public int ...
In Java, the java.util.Arrays class have several static toString(...) methods that take an array and return its string representation (i.e. the string representation of the contents of the array separated by commas and the whole representation enclosed in square brackets -- e.g. "[1, 2, 3]").
Is there an equivalent method/functionality ...
I've started reading Algorithms and I keep wondering, when dealing with primitives of the same type, which is the more expensive operation, assignment or comparison? Does this vary a great deal between languages?
...
What are the advantages and disadvantages for Spring vs. Jboss for an enterprise web application.
...
Triple DES or RC4?
I have the choice to employ either one.
...
Does anyone know of a tool similiar to RedGate's SQL Data Compare that works with Microsoft SQL Server Compact 3.5?
...