I know that the following is case sensitive:
if (StringA == StringB) {
So is there an operator which will compare two strings in an insensitive manner?
I am in the process of switching my development environment from sqlite3 to postgresql 8.4 and have one last hurdle.
In my original I had the following line in a helper method;
result = Users.find(:all, :order => "name collate NOCASE")
which provided a very nice case-insensitive search. I can't replicate this for postgresql. Should be easy -…
I'm fairly new to the C preprocessor. Is it possible to change the case of an argument provided to a function-like #define? For example, I want to write test(size) and then involve "Size" in the resulting replacement.
How can I efficiently and easily sort a list of tuples without being sensitive to case?
For example this:
[('a', 'c'), ('A', 'b'), ('a', 'a'), ('a', 5)]
Should look like this once sorted:
[('a', 5), ('a', 'a'), ('A', 'b'), ('a', 'c')]
The regular lexicographic sort will put 'A' before 'a' and yield this:
[('A', 'b'), ('a', 5), ('a', 'a'),…
I have lists of data such as
a = [1,2,3,4]
b = ["a","b","c","d","e"]
c = ["001","002","003"]
And I want to create new another list that was mixed from all possible case of a,b,c like this
d = ["1a001","1a002","1a003",...,"4e003"]
Is there any module or method to generate d without write many for loop?
Are there any CASE-tools for Erlang which help to improve the process of software development, in particular the process of automatic code generation based on information in various diagrams (IDEF, DFD etc.) ?
I have an sql statement that returns this result below,and I want that the num will drag the latest(by date) num that is not null. I can't get it right.
I want to add somthing like this:
case
when num is null then max(num where date<my_date)
my result now:
Date num
1.1 0
2.1 1
3.1 NULL
4.1 NULL
…
How can you sort a query using ORDER BY CASE WHEN REGEXP? or other alternatives?
I don't want to use UNION. Thank you
mysql> SELECT `floor_id`, `floor_number` FROM `floors`;
+----------+--------------+
| floor_id | floor_number |
+----------+--------------+
| 1 | 4 |
| 2 | 7 |
| 3 | G |
| …
function ag()
{
echo '2';
}
Ag();
class test {
function clMe()
{
echo 'hi';
}
}
$instance = new test;
$instance->clme();
But that's the not case with variables,
what's the rationale in it?
Hi
I need to check for
"Apple" = "Apple" TRUE
"Apple" = "APPLE" TRUE
"Apple" = "Apple1" FALSE
in ruby
I need a string comparison but for the check to not be case sensitive.
thks
The == is used to compare two string in shell script, however I want to compare two strings by ignoring case, how it can be done.Do we any standard command for this.
I'm trying to join the NAME and PHOTO from USERS table to the TRANSACTIONS table based on who is the payer or payee. It keeps telling me can't find the table this -- What am I doing wrong?
SELECT name,photo,amount,comment,
(
CASE payer_id
WHEN 72823 THEN payee_id
ELSE payer_id
END
) AS this
FROM transactions
RIGHT JOIN users ON (users.id=this)…
Hi guys,
it may be a nooby question, but I've never needed it before:
I have several strings and I want to compare them to given ones...
At first glance it would lead to a switch/case construction in what every available entry is checked.
Is there a more elegant way to swap those strings as key/value datas?
greets,
poeschlorn
There is a complete and detailed Telco Churn case study "How to" Blog Series just posted by Ari Mozes, ODM Dev. Manager. In it, Ari provides detailed guidance in how to leverage various strengths of Oracle Data Mining including the ability to:
mine Star Schemas and join tables and views together to obtain a complete 360 degree view of a…
I'm modeling a UCD where I have two actors ( a content producer and a developer).. the content producer is going to create and specify details of a storyboard functionality, and the other actor (developer) will only be able to view this storyboard ( he'll log in the application and read the storyboard to start developing what it says, outside…
I make use of generic views and I am attempting to query my MySQL db (utf8_bin collation) in a case insensitive manor to try to find all my song titles that start with a particular letter.
view.py
def tracks_by_title(request, starts_with):
return object_list(
request,
queryset =…
I need to somehow use the CASE syntax (which is beyond me) to affect the database results based on criteria.
I have a bunch of royalties in 0.# form (royalty)
I have a title ID # (title_id) and I need to show the new increase in royalties so that I can use the data.
IF: they have a current…
This question in mainly pointed at C/C++, but I guess other languages are relevant as well.
I can't understand why is switch/case still being used instead of if/else if. It seems to me much like using goto's, and results in the same sort of messy code, while the same results could be acheived with…
So I have some code here that takes user input from a standard web form:
$searchsport = $_POST['sport'];
$sportarray = array(
"Football" => "Fb01",
"Cricket" => "ck32",
"Tennis" => "Tn43",
);
if(isset($sportarray[$searchsport])){
header("Location: ".$sportarray[$searchsport].".html");…
Problem is as follows. I have a product that can be in one of three categories (defined by category_id). Each category table has category_id field related to category_id in product table. So I have 3 cases. I'm checking If my product.category_id is in table one. If yes, I take some values. If…
I have an accounts table and a records table where accounts have multiple records. I would like to break down the account totals by "count of records" range. i.e. show the breakdown of
Count of Records | Count
0-25 | 100
25 - 50 | 122
50 - 100 | 300
etc.
I am using the following query,…
i'm using this function to highlight the results from mysql query:
function highlightWords($string, $word)
{
$string = str_replace($word, "<span class='highlight'>".$word."</span>", $string);
/*** return the highlighted string ***/
return $string;
}
....
…