11 questions
1 vote
2 answers
594 views
Using mutate, if_else, and rowSums to create a new var based on condition
I have a data frame which is in long format. I have multiple cities. Each of the cities has information for each month and information also for each code (this code goes from 100 up to 1,000). My ...
0 votes
2 answers
54 views
Is there a nested for loop aproach to inside parameters in a fcase() in R?
My code is like this: fcase(V2009 == 9L & V3006 == 2L, V1032, V2009 == 10L & V3006 == 3L, V1032, V2009 == 11L & V3006 == 4L, V1032, V2009 == 12L & V3006 == ...
0 votes
4 answers
264 views
Improving SQL query for covid-project
I was wondering if any of you could help me to improve this query SELECT IF(cases.country_region LIKE '%Korea%', 'South Korea', IF(upper(cases.country_region) = 'IRAN (ISLAMIC REPUBLIC OF)', 'Iran', ...
0 votes
0 answers
309 views
Expected ',' joining parts of a multi- clause condition in a Swift "If Case" [duplicate]
let age = 25 if case 18...35 = age where age >= 21 { print ("In Cool Demographic and of drinking age") } In Swift, when I type the code above, it says right before in "where", there's a ...
1 vote
2 answers
17k views
Bash scripting - if cases $? > 0
Sorry for possible spam, I'm finishing RHEL Security Hardening/Auditing script, where I want an overall result in the end. For example, # PermitEmptyPasswords grep -E '^\s*PermitEmptyPasswords\s+no\s*...
3 votes
1 answer
4k views
if-case pattern matching - Variable binding in a condition requires an initializer
I'm working through Big Nerd Ranch's Swift Programming book (2nd edition), and in the chapter on the Switch statement, there's a small section on in-cases and how to use them. When describing how to ...
0 votes
1 answer
186 views
select case, according to find text
I want to update a sheet with new data about every 15 minutes. the code I'm looking for is something like: case data is not exist in the sheet "do something" case else "do somthing else" The code i ...
1 vote
0 answers
334 views
Alternative for If conditions and replacing it with inheritance
So my problem is that you have a lot of if conditions to be checked and inside that if condition you have multiple lines of code. I want to eliminate it and use inheritance instead. For every if ...
-1 votes
1 answer
1k views
compare Value of cookie returns "false" every time
I got a function named getCookie(x) which returns the value of the cookie with name x. When i check with console.log(getCookie(foo)); it returns the correct term of either solved or an empty string if ...
3 votes
1 answer
311 views
complementery of an if case
How would you write this: if case .SomeEnum(3) = enumType where myInt == 3 { //I don't need this case } else { //This is the case I need } I know I could use guard: guard case .SomeEnum(3) = ...
3 votes
1 answer
254 views
Is it possible to use 'if-case' in place of a switch that has a coma delimited list as a case?
Swift 2 introduced if-case which is supposed to be a more terse way of expressing a switch that only has a few cases. I'm wondering if there is a way of expressing a switch statement with a comma ...