if-statement

Conditional statement inside string inside php

人盡茶涼 提交于 2020-01-25 08:34:17
问题 I am trying to evaluate date[3] to determine selected option. All this is inside a php sql query. I am not able to find out an easy way to get a selected for the value returned in date[3] in my $options string variable. <?php //sql statement foreach( $db->query($sql) as $data ) { $options = "<select type='text' name='pagephone' select id='pagephone' > <option value=''></option> <option ". if ($data[3] == 'vtext.com' ){ echo 'selected' };. " value='vtext.com'>Verizon Wireless</option> <option

JAVA .equalsIgnoreCase not working

前提是你 提交于 2020-01-25 06:29:33
问题 In the main method of my server class I have a series of if statements for the reserved keywords of a chat program which I am trying traverse using the value of a variable along with the .equalsIgnoreCase method. The problem is that even though my variable holds a certain value, when executing the program the code always steps into the else clause even if there is an exact match between the variable and one of the if conditions. The code compiles fine but I just cant figure out why this is

Using If Large Statement and Populating Remainder of Table in Excel

此生再无相见时 提交于 2020-01-25 01:56:45
问题 I have a dataset that looks like the example below. I want to pull a list of the last ten transactions, ordered by Transaction Date, while capturing all columns of information in the original dataset; and I want to do this only IF the Salesman is Jimmy. I'm stumped. Any ideas how to do this? Example dataset below: Customer Name Customer Group Salesman Transaction Date Sam 1 Jimmy 3/21/2015 Jill 2 Johnny 3/21/2015 Scott 3 Joanny 3/21/2015 Sean 4 Slippy 3/24/2015 Dave 5 Slappy 3/25/2015 Amber 4

MediaPlayer pausing and playing error

帅比萌擦擦* 提交于 2020-01-25 01:22:16
问题 I'm building an application for Android with Java and XML. The user of the app must be able to listen to a tune and also pause it. So I made one button with which you can play and pause the tune. I made a function in which the src of the ImageView must be changed. However Eclipse gives me an error at the mp.start() and the mp.pause() , which says: "mp cannot be resolved" . I don't know what I'm doing wrong right now and I hope somebody can help me. Java code: import android.media.MediaPlayer;

jQuery - If ANY Select within a div has a value

被刻印的时光 ゝ 提交于 2020-01-25 00:13:45
问题 Been having lot's of trouble with this one. Let's say I had the following html: <div id='step_1'> <select name='select_1' id='choose'> <option value='select one'>Select One</option> <option value='yes'>Yes</option> <option value='no'>No</option> </select> <select name='select_2' id='choose_again'> <option value='select one'>Select One</option> <option value='yes'>Yes</option> <option value='no'>No</option> </select> <button id='submit'>button</button> </div> I have many of these, so what I'm

jQuery - If ANY Select within a div has a value

冷暖自知 提交于 2020-01-25 00:13:06
问题 Been having lot's of trouble with this one. Let's say I had the following html: <div id='step_1'> <select name='select_1' id='choose'> <option value='select one'>Select One</option> <option value='yes'>Yes</option> <option value='no'>No</option> </select> <select name='select_2' id='choose_again'> <option value='select one'>Select One</option> <option value='yes'>Yes</option> <option value='no'>No</option> </select> <button id='submit'>button</button> </div> I have many of these, so what I'm

Android spinner position and if statements

China☆狼群 提交于 2020-01-24 23:54:27
问题 Having an odd issue here and don't know why it doesn't work, I'm not that used to java yet. to determine the selected item what needs to be done? the spinner has 8 items and 'position' never = 1, or any other number. onItemSelected() is definitely getting fired so is the if statement wrong? public void onItemSelected(AdapterView parent, View v,int position, long id) { if (position == 1) //do something } EDIT: thanks Lion it turns out position doesnt seem to do anything. however, this works.

Better way to handle n number of if-else if in java

天大地大妈咪最大 提交于 2020-01-24 15:42:06
问题 I was wondering if there is any better way to handle n no. of if/else-if block in Java. I have a situation where I need to print different values based on n no. of if/else-if/conditions blocks like if(p==1 && q==r) System.out.println("Condition 1"); else if(r==p && q==9) System.out.println("Condition 2"); else if(z==1 && s==r) System.out.println("Condition 3"); else if(p==1 || x==r && y==7) System.out.println("Condition 4"); else if(q==z && y==r || p==4) System.out.println("Condition 5");

VHDL - PhysDesignRules:367

本小妞迷上赌 提交于 2020-01-24 13:18:21
问题 I am getting a warning when i try synthesize,implement, and generate program file from my VHDL Code. When i try to synthesize i get this error WARNING:Xst:647 - Input <BTN_3> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved. When i Implement it i get this WARNING:PhysDesignRules:367 - The signal <BTN_3_IBUF> is incomplete. The signal does not drive any load pins in

VHDL - PhysDesignRules:367

大城市里の小女人 提交于 2020-01-24 13:18:08
问题 I am getting a warning when i try synthesize,implement, and generate program file from my VHDL Code. When i try to synthesize i get this error WARNING:Xst:647 - Input <BTN_3> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved. When i Implement it i get this WARNING:PhysDesignRules:367 - The signal <BTN_3_IBUF> is incomplete. The signal does not drive any load pins in