How to check string array elements with a string with in one forEach tag ?
Hi All,
I am new to JSTL and EL. I need to change the following Java code into JSTL and EL.. I struggled to change this code into JSTL.
How can i change the if loop which tests the string array element with one bean property ?
-------------------------------------------------------------------------------------------------------------for(int j=0 ; j < iSelectedCount; j++)
if(strSelectedRoleId[j].equals(lineRole.getRoleID()))
isAvailable = true;
Please help me on this.
It is very urgent......
Thank you for ur help,
Natraj
import java.util.Calendar;
Calendar rightNow = Calendar.getInstance(); // gets the current date and time to millisec
Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
// do something
}Try this.
Similar Messages
-
How to make 1D Array but with only one element filled in Real Time
Hi folks,
here I am with another question. I want to implement an prediction discrete state space observer which is going to run on a CRIO real time target. I am going to do it just like in the example which comes with LV.
I have some questions regarding the input and outputs which in the example those are "dummy".
My model is a SISO model, but the function "Construct SS model" returns parameters (A,B,C,D Matrices) as 2D arrays, so once you connect the cluster model into the Discrete Observer model, it takes y and u as 1D arrays despite of the fact that there is a SISO model.
I realized that the function I am using in the simulations, uses 1D arrays but with only one element filled:
Does anyone knows how to implement such 1D arrays in Real Time? I guess the way to do it is preallocating one array of zeros of size 1, and then recirculating it through some SR, and replacing the element with my real input and output, but at the dummy.vi, they are using a simple "build array"
function.Ok, I did it that way. But I am facing another problem right now...
At some point the Discrete Observer return a NAN array, you will see the code in the code snippet?
I get rid of that component by component, but the observer gets "stuck" in it. So my Control law is zero... but the state stimate is NAN.
Also I am attaching the VI.
I do not know why, since in the simulation program all runs well. any thoughts? Maybe the internal numeric precision of the State Space Model?
Attachments:
RT - Pole Placement + Complete Observer.vi 40 KB -
How to set an array element in an object type of array??
Hi,
I have set attribute as follow:
Color[] colors;
Color[] colors = new Color[20];
colors[0] = "Red";
colors[1] = "blue";I can't compile this code. It said:
"Incompatible type -found java.lang.String but expected Colors
Could you tell me how to set an array elements when the array type is an object?in your case, the array shouldn't be Color[] but String[] since you re intending to put strings into it
by the way, you could also use a hashmap to map a string to a color:
HashMap<String, Color> hm = new HashMap<String, Color>();
hm.put("Red", Color.RED);
hm.put("Blue", Color.BLUE);
etc. -
SAP Script - How to check a text element is empty in Script.
Hello Friends,
I like to display a text element when it is not empty, otherwise I like to display some other text.
I know how to read text element in Script, but
How to check a text element is empty in Script
Thank you for your time.
SenthilHi Senthil,
Inside text element, we print the variables.
Variables actually gets printed in the form.
if the variable contains value the variable gets printed on script. if not, then variable not gets printed.
hope this helps. -
How to check-in multiple files with same name having different revision num
Hi
Can anyone please tell me, how to check-in multiple files with the same name with different revision number using RIDC API.
For eg:
First I will check-in a file(TestFile.txt) into a content server with revision number 1 using RIDC API in ADF application. Then after some time, will modify the same file(TestFile.txt) and check-in again. I tried to check-in same file multiple times, however first time its checking-in correctly into server showing revision as 1, while checking-in same file again, its not giving any errror message, and also its not reflecting in server. Only one file(TestFile.txt) is reflecting in server.
How to implement this functinality using RIDC API? Any suggestions would be helpful.
Regards
Raj
Edited by: 887680 on Mar 6, 2013 10:48 AMHi Srinath
Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
Regards
Raj -
Hello all,
may be the following question is very simple, but I am relatively new in labview and it would be great if somebody could help me:
I have a acquaried 1D array of data-points. Now, I have to find the element in this array which value is the closest to a calculated "target value".
After finding the element with the value close to the "target value", I have to get the position of this element (i.e. the index) in the 1D array.
Now, I have to use this index to find and extract the element at this position in an other 1D array.
It would be very nice if somebody could help me with this problem.
Thank you,
beamFind attached a sample vi that you can modify.
Attachments:
select_target_value.vi 22 KB -
How do I access array elements in one method from another method?
Hi all!
How do I access the array's elements from another method so that method 2 can have access to method 1's array elements? Thanks for any help!
I am trying to create a simply program that will use a method to create an array and a SEPARATE method that will sort the array's elements (without using java's built in array features). I can create the program by simply having one method and sorting the array within that same method, BUT I want to sort the array from another method.
Here's my code so far:
public class ArraySort {
public static void createArray(int size){
double myArray[] = new double[size]; //create my new array
for(int j=0; j < myArray.length; j++)
myArray[j] = (200.0 * Math.random() + 1.0); //fill the array with random numbers
public static void sortArray(){
// I WANT THIS METHOD TO ACCESS THE ARRAY ELEMENTS IN THE METHOD ABOVE, BUT DON'T KNOW
// HOW???? Please help!
public static void main(String[] args) {
createArray(4); //call to create the array
}Thanks again!
- JohnnyThanks for the help all! I ve managed to get the program working, using java's built in array sort, but when i try to call on the array sort method from WITHIN my main method, nothing happens!
Can somebody please tell me why I am not able to call on the sort method from within my main class???? Thanks!
public class ArraySort {
public void createArray(double[] arrayName, int size){
double myArray[] = new double[size]; //create new array
for(int j=0; j < myArray.length; j++)
myArray[j] = (200.0 * Math.random() + 1.0); //populate array with
} //random Numbers
sortArray(myArray);
} //Sort array(if I delete this & try to use it in Main method --> doesn't work???
public void sortArray(double[] arrayName){
DecimalFormat time = new DecimalFormat("0.00");
Arrays.sort(arrayName); //sort array using Java's built in array method
for(int i = 0; i <arrayName.length; i++)
System.out.println(time.format(arrayName)); //print arary elements
public static void main(String[] args) {
ArraySort newArray = new ArraySort(); //create a new instance
double myArray[] = new double[0]; //create a new double array
newArray.createArray(myArray,4); //build the array of indicated size
//newArray.sortArray(myArray); //This will not work???? WHY?????// -
How to copy an array element in one class to an array in another class?
Hi,
I have a ClassRoom class that stores a list of Student objects in an array. How would I copy a Student object from the Student[] array in the ClassRoom class to an array in another class?
Is it something like this:
System.arraycopy(Students, 2, AnotherClass.Array, 0, 2);In an array do the items get copied over existing array elements or can the be added to the end? If so, how would I specify add copied object reference to the end of the array in the other class?drew22299 wrote:
Hi,
I have a ClassRoom class that stores a list of Student objects in an array. How would I copy a Student object from the Student[] array in the ClassRoom class to an array in another class?
Is it something like this:
System.arraycopy(Students, 2, AnotherClass.Array, 0, 2);In an array do the items get copied over existing array elements or can the be added to the end? If so, how would I specify add copied object reference to the end of the array in the other class?System.arrayCopy will overwrite whatever is already in the array. It is your job to make sure it copies into the proper array location.
That being said, you're only moving a single student. This is not something you would use arrayCopy for, as you can just do that with simple assignment. Also, you should consider giving Class a method to add a student to its student list, as the class should know how many students it has and can easily "append" to the array.
Note: I hope you noticed the quotes around append. Java's arrays are fixed size. Once allocated, their size cannot change. You may want to consider using one of the List implementations (ArrayList, for example) instead. -
HOW TO CHECK THE CHECKBOX VALUE WITH SQLCE DATABASE
Hai All,
Good Day! I am using VB in Visual Studio 2008. I have a form with check boxes and one button control. If i selected the check box and then click the button, check the database table field and check box text are equal. if both are equal then
how to check?
I have tried it. The code is:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New SqlCeConnection
Dim cmd As New SqlCeCommand
conn.ConnectionString = "DataSource = E:\Vbprojectex\WindowsApplication3\WindowsApplication3\Database1.sdf"
Try
cmd.Connection = conn
conn.Open()
If CheckBox1.CheckState = 1 Then
cmd.CommandText = "SELECT Aerator FROM ttabpagelist where Aerator = CheckBox1.Text"
TextBox1.Text = 1
End If
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try
End Sub
End Class
Thanks & Regards Sasi ................. Go Greenprobably something like (ofc below will never give result since Aerator can't have 2 values, you will have to adjust the second check box column obviously)
Try
cmd.Connection = conn
conn.Open()
dim strsql as string = "= "SELECT Aerator FROM ttabpagelist "
Dim whereConcatenator As String = " WHERE "
Dim Wherestatement As String = String.Empty
If checkbox1.checked = True Then
Wherestatement += whereConcatenator
Wherestatement += "Aerator = " & checkbox1.Text
whereConcatenator = " AND "
End If
If checkbox2.checked = True Then
Wherestatement += whereConcatenator
Wherestatement += "Aerator = " & checkbox2.Text
End If
cmd.commandtext = strsql & wherestatement
TextBox1.Text = 1
End If
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try -
How to Check System Preference Settings with Time Machine
I just found and fixed a problem caused by a bad System Preference/Universal Access
setting and would like to go back in my Time Machine backup to see where the
error was made. I may have been too quick to blame the 10.5.3 update on the
problem so wanted to look back in time.
The problem is i don't know how to check System Preferences using the Time Machine.
Any suggestion?If you're looking for specific settings, the short answer is you cannot. You can open the .plist files and try to find the specific option you're looking for, though it might not be too easy to decipher some of the contents of the .plist file. For the most part they're just lists of attributes and settings. For instance, here's a very small chunk of my Finder .plist file:
<key>All Images.cannedSearch</key>
<dict>
<key>SidebarWidth</key>
<integer>162</integer>
<key>ToolbarVisible</key>
<true/>
<key>ViewHeight</key>
<integer>1116</integer>
<key>ViewStyle</key>
<string>icnv</string>
<key>WindowBounds</key>
<dict>
<key>bottom</key>
<integer>1200</integer>
<key>left</key>
<integer>56</integer>
<key>right</key>
<integer>1920</integer>
<key>top</key>
<integer>84</integer>
</dict>
</dict>
<key>AnimateInfoPanes</key>
<true/>
<key>AnimateSnapToGrid</key>
<string>true</string>
<key>AnimateWindowZoom</key>
<true/>
Each "key" is followed by an attribute, so for instance the "SideBar Width" key is given the "Width" integer attribute of 162. However, some keys have multiple entries, such as the "WindowBounds" key having sub-keys of "bottom", "left", "right", and "top".
These values are finder preferences, though are not accessible via the finder's preference settings. However, buried deep in the Finder's .plist file are some of the user-editable settings:
<key>ShowHardDrivesOnDesktop</key>
<true/>
<key>ShowMountedServersOnDesktop</key>
<true/>
<key>SidebarSearchesSectionDisclosedState</key>
<false/>
If you can find the attribute you're looking for, then that may help you narrow down which version of a .plist file to restore, though not all of them are straightforward legible text. Some have bizarre strings of seemingly random characters that only the application can interpret.
Message was edited by: Topher Kessler -
How to check Tablespace in DB2 with AS400
Hi Guru,
Can u please tell me how to check tablespace in db2 database with ecc5.Hi,
very simple:
DB2 on iSeries just has NO tablespaces ))
=> no check necessary
Regards
Volker Gueldenpfennig, consolut international ag
http://www.consolut.de - http://www.4soi.de - http://www.easymarketplace.de -
How to save the array elements
hi,every body
I need to save the array elements,for later use,can you tell me how?here you go.
Message Edited by Root Canal on 10-21-2008 02:50 PM
global variables make robots angry
Attachments:
write some stuff and read some stuff.vi 47 KB
write some stuff and read some stuff.PNG 19 KB -
How to check In a file with folder structure
Hi,
Is it possible to check in "a file with its complete folder structure".
For Ex: folder A contains Folder B and B contains a file , Then is there an option to check in the file in content server with the same structure A-->B-->file.
Thanks In advance.JRS, this will copy ALL the files and folders from folder A to the content server.
If he only wants to copy file A that is inside folder B than your way is somewhat overkill unless you are sure that the file is the only one in the complete structure but that i doubt...
I haven't checked it before but perhaps someone can tell if this is possible...
If you check in a file, perhpas you can get the original file and foldername from the metadata. If this is possible, you can create your own code that hooks on the check in and then create a directory or just move the file in the directory.
I have written such a component but it's based on some custom metadata we use, not on the original filename.
If i find the time, i will try some things and tell you if it works -
How do I download Photoshop Elements with the Adobe Download Assistant?
It used to be pretty straight forward, you would launch ADA and it would show all the programs available for download.
Now it just shows "Products you may like", which doesn't show Elements (at least not that I can find).
So how do I get Photoshop Elements? Am I looking in the wrong place?If you have tried a different web browser and are still facing problems please try initiating a direct download of the software by following the steps listed at http://prodesigntools.com/photoshop-elements-11-direct-download-links-pse-premiere-pre.htm l. Please be advised that you need to complete the Very Important Instructions section prior to clicking on the link to download the software.
-
How to check apple care warranty with Serial Number without registering
How to check the warranty of the apple macbook pro (mid 2009 release) without actually registering the product.
I have the serial number of the machine.
I looked into this link ,it seems that it requires you to register the product .
Earlier that was not the case. You could just check the warranty by entering the serial number and location .
Link : https://selfsolve.apple.com/GetWarranty.doIf the product was never registered, you won't be able to check warranty, because as far as Apple is concerned, it's still new and has not been sold yet.
Dave M.
MacOSG Founder/Ambassador An Apple User Group iTunes: MacOSG Podcast
Macsimum News Associate Editor Creator of 'Mac611 - Mobile Mac Support'
Maybe you are looking for
-
Cannot get Itunes to open in windows 7 64 bit
I have installed after a complete reformating of my hard disk, installed and reinstalled itunes several times after a complete unistall of all related programs and tried just about everything that is recommended. What can I do to get itunes to open o
-
File name from text field value
Is it possible to save a file with the value of a Text field? Thank you
-
HP 4700dn Printing Blank Pages
iMAC running OS X 10.9.2 Printing Blank pages with one saying "%! PS- Adobe - 3.0 %APL_DSC_Encoding: UTF8 %APLProducer: (Version 10.9.2 (Build 13C102"
-
What type of memory cards can be used on hp6510
what memory cards are used in hp 6510
-
How to create top level classes
what is the meaning of top level classes. and how to create toplevel classes.