if-statement

Testing if a file exists in a make file

自作多情 提交于 2020-01-16 01:58:46
问题 I need to add some logic to a make file and I am stuck. I see several examples out there but I'm not sure which one is the right one for me. What I have: $(UBIN)/%: $(CC) $(CFLAGS) -o $(UBIN)/$* $(OBJS) -L $(ORAHOME) $(ORALIBS) \ $(LNKPATH) $(DSTN_LIBS) @echo "" What I want: $(UBIN)/%: If the file $(UBIN)/$* exists then $(CC) $(CFLAGS) -o $(UBIN)/$* $(OBJS) -L $(ORAHOME) $(ORALIBS) \ $(LNKPATH) $(DSTN_LIBS) @echo "" endif But I can't figure out what the right syntax is. Some idea were to use

Batch SetLocal EnableDelayedExpansion and Math problems

…衆ロ難τιáo~ 提交于 2020-01-16 00:54:08
问题 C:\WINDOWS\system32>SetLocal EnableDelayedExpansion C:\WINDOWS\system32>set/a Number1=3+9 12 C:\WINDOWS\system32>if !Number1!==9+3 (echo Good) else (echo Bad) Bad C:\WINDOWS\system32>if !Number1!==3+9 (echo Good) else (echo Bad) Bad C:\WINDOWS\system32>set/a i=9+3 12 C:\WINDOWS\system32>if !Number1!==%i% (echo Good) else (echo Bad) Bad I expected to see the last results (and maybe some others) to show Good as a result but did not! I think this is because it is a error with the SetLocal

Counting the number of common elements in integer arrays located at different positions

随声附和 提交于 2020-01-15 12:25:07
问题 For my assignment, I need to write a method that returns the number of cows (see definition below) found between 2 arrays. If the input arrays have a different number of elements, then the method should throw an IllegalArgumentException with an appropriate message. A bull is a common number in int arrays found at the same position while a cow is a common number in int arrays found at different position. Note that if a number is already a bull, it cannot be considered as a cow. For example,

work around to specifying date range in ifelse statement in R

落爺英雄遲暮 提交于 2020-01-15 12:15:30
问题 I am trying to create a new column denoting quarter in my data.frame using an ifelse statement on a date column of class as.POSIXct . this is a short verion of the date a spot.id local.date q12014local.1 11824267 2013-12-30 q12014local.2 11825708 2013-12-30 q12014local.3 11823669 2013-12-30 q12014local.4 11825407 2013-12-30 q12014local.5 11824268 2013-12-30 q12014local.6 11825709 2013-12-30 q12014local.7 11823670 2013-12-30 q12014local.8 11825408 2013-12-30 q12014local.9 11824266 2013-12-31

if($_FILES['files']['name']!=“”) run if files, don't run if no files headache

邮差的信 提交于 2020-01-15 10:45:41
问题 Not having any luck with my other thread with specific code so if I can I'd like to ask how people would go about getting this to work. I have an page where my client edits details of a property displayed on a property list, say they edit text and don't add any images to this property. HTML form works fine, I'm just looking at the php. Example: If files selected then run this script as an include If no files selected then exit Something like this... if($_FILES['files']['name']!="") { Do this

Why is Django template loop nesting my divs?

≯℡__Kan透↙ 提交于 2020-01-15 09:47:06
问题 I am using Bootstrap with Django and want the .item-container.col-md-4 to be three boxes inside a row. It should look something like this: <div class="row"> <div class="item-container col-md-4> Stuff</div> <div class="item-container col-md-4> Another Thing</div> <div class="item-container col-md-4> This Next One</div> </div> I am getting something more like this: <div class="row"> <div class="item-container col-md-4> Stuff <div class="item-container col-md-4> Another Thing</div> </div> </div>

SQL conditional statement

烂漫一生 提交于 2020-01-15 06:57:12
问题 I'm trying to create a conditional statement in an ORACLE sql code I have a function in java that takes 2 parameters. getchildren(child1,child2) ..this function's parameters are used to create a query statement public ResultSet getchildren(String Child1, String child2) throws SQLException { stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); query ="select * from table1 if child1 is not null and child2 is null { where child1 = 1 } else if child2 is not

SQL conditional statement

耗尽温柔 提交于 2020-01-15 06:56:25
问题 I'm trying to create a conditional statement in an ORACLE sql code I have a function in java that takes 2 parameters. getchildren(child1,child2) ..this function's parameters are used to create a query statement public ResultSet getchildren(String Child1, String child2) throws SQLException { stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); query ="select * from table1 if child1 is not null and child2 is null { where child1 = 1 } else if child2 is not

MVC + Razor: how to add starting <div> conditionally?

时光毁灭记忆、已成空白 提交于 2020-01-15 05:19:04
问题 I want to amend a div based on whether a variable is set or not. So I would like to do something like this: @if (SomethingIsSet) { <div style="background:red"> } else { <div style="background:blue"> } But I get the following error message in Visual Studio: The div element was not closed. All elements must be either self-closing or have a matchig end tag. My div element is closed later on in the page. 回答1: You can use a ternary operator in Razor. <div style="@(SomethingIsSet ? "background:red"

Python break down a super long IF statement

倾然丶 夕夏残阳落幕 提交于 2020-01-15 03:25:38
问题 How to simplify or break down the super long IF Condition in Python pandas? my_dataframes = {'d1': d1, 'd2': d2,'d3': d3} good_dataframes = [] for df_name, df in my_dataframes.items(): if ((df.loc[1:4, 'test'] <= 6).all() and (df.loc[5:9, 'dif'] < 9).all()) or ((df.loc[1:5, 'test'] <= 6).all() and (df.loc[5:8, 'dif'] < 8).all()) or ((df.loc[1:8, 'test'] <= 6).all() and (df.loc[5:8, 'dif'] < 9).all()): good_dataframes.append(df_name) the challenge for me is put the right indent 回答1: you can