1 == [1] returns false instead of true
The [The JavaFX Script Programming Language Reference (Draft)|http://javafx.com/releases/preview1/docs/reference/sequences.html] says:
"a single object is equal to a sequence of one object:
{code}1 == [1]; // returns true
{code}
But when I try the following in NetBeans 6.1:
{code}System.out.println("1 == [1] is {1 == [1]}");{code}
it returns the following:
{code}1 == [1] is false
{code}
So again my question, who is wrong? Me, the reference or my SDK?
Looks like the doco is wrong, I guess thats why they say draft
Similar Messages
-
Boolean showing false instead of true
Hello,
I am monitering flag sensors on a rotary motor and I want a simple way to show which flag sensors are triggered continuously while the vi is running.
Attached is a pic of when the vi is running. The Boolean (probe 81) is signaling false when it should be signaling true. The data coming out of the DAQ vi is measuring the correct voltage (probe 80). I would post this on the Multifunction DAQ page however I think it is a programming issue rather than a DAQ issue.
Any help on why this is happening? Suggestions to fix this?
Thanks,
Andrew
Attachments:
flagsensor.JPG 23 KBAndrew Aji wrote:
I'm an idiot.
Thanks guys
That response made my day. Andrew, your a good guy to be able to laugh at yourself.
- tbob
Inventor of the WORM Global -
Display Yes / No instead of True or false for radio buttons in SSRS 2008R2
Hi All,
I have one report with two radio buttons as parameters. In the report display I see True / false beside the radio buttons. Is there a way where I can display it as
YES instead of True and NO for False beside radio buttons?
Thanks,
RH
sqlHi sql9,
According to your description, you want to show "Yes" and "No" in Boolean parameter instead of "True" and "False". Right?
In Reporting Services, it doesn't has any property for the text of radio button in a Boolean parameter. So we can't modify the "True" and "False" into "Yes" and "No". For your requirement, a workaround is changing the type into drop down
list and put the "Yes" and "No" into values.
Reference:
SSRS boolean
parameter Yes and NO instead of True and False in prompt area
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
ExternalInterface.available returns false on a Mac
Hi there!
I'm triyng to get the browsers back-button to work with my
flash site. The general principle is this:
There is an index.html page containing an (not yet) hidden
Iframe and the flash movie.
The Iframe contains page A, which starts with JavaScript
calling a BACK-function on the index-page.
The BACK-function triggers an AS-function in the flash-movie
that activates its own back-button, and then changes the URL of the
Iframe to Page B. This causes a new History to be added to the
browser.
The flash movie now contains 5 frames (labeled in the middle
of the stage) and two navigation buttons: back (Terug) and forward
(Verder). Those buttons do exactly what you'd expect them to do
(prevFrame and nextFrame).
On a PC (IE) this seems to work pretty well. But on a mac
nothing seems to work propperly.
I've got a testpage at:
http://www.multimediamatters.nl/test
Here's the code I have on the first frame.
stop();
_root.terug.onRelease = function(){
prevFrame();
terugF = function(){
trace(_root._currentframe);
if (_root._currentframe > 1){
_root.terug.onRelease();
else {
_root.getURL("javascript::history.go(-2)");
import flash.external.*;
var isAvailable:Boolean = ExternalInterface.available;
var txtField2:TextField = this.createTextField("txtField",
this.getNextHighestDepth(), 300, 0, 200, 50);
txtField2.border = true;
txtField2.text = "ExternalInterface.available =
"+isAvailable.toString();
var methodName:String = "goHome";
var instance:Object = null;
var method:Function = terugF;
var wasSuccessful:Boolean =
ExternalInterface.addCallback(methodName, instance, method);
var txtField:TextField = this.createTextField("txtField",
this.getNextHighestDepth(), 0, 0, 200, 50);
txtField.border = true;
txtField.text = "ExternalInterface.addCallback =
"+wasSuccessful.toString();
Somehow the ExternalInterface doesn't seem to get loaded. Any
suggestions to solve this?
Thanks in advance.
Yours,
Andra
P.S.
The condition
if (_root._currentframe > 1){ doesn't work on a PC
either. It always calls
_root.terug.onRelease(). I can't figure out why...Woops!! I guess I wasn't paying enough attention...
On a mac using Internet Explorer, both
ExternalInterface.available and
ExternalInterface.addCallback return false. Using the back
button does reload Page A into the Iframe, but doesn't execute any
AS-functions.
Using Safari, they both return true. However, using the back
button reloads the entire index.html instead of loading Page A back
into the Iframe. This means the flash-movie is reloaded aswell, so
you're automatically back at frame 1.
Is there any way I could get this working properly?
Yours,
Andra -
Bug Report: ResultSet.isLast() returns false when queries return zero rows
When calling the method isLast() on a resultset that contains zero (0) rows, false is returned. If a resultset contains no rows, isLast() should return true because returning false would indicate that there are more rows to be retrieved.
Try the following Java source:
import java.io.*;
import java.sql.*;
import java.util.*;
import oracle.jdbc.driver.*;
public class Test2 {
public static void main (String [] args) throws Exception {
Connection conn = null;
String jdbcURL = "jdbc:oracle:thin:@" +
"(DESCRIPTION=(ADDRESS=(HOST=<host computer>)"+
"(PROTOCOL=tcp)(PORT=<DB port number>))"+
"(CONNECT_DATA=(SID=<Oracle DB instance>)))";
String userId = "userid";
String password = "password";
try{
// Load the Oracle JDBC Driver and register it.
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
// *** The following statement creates a database connection object
// using the DriverManager.getConnection method. The first parameter is
// the database URL which is constructed based on the connection parameters
// specified in ConnectionParams.java.
// The URL syntax is as follows:
// "jdbc:oracle:<driver>:@<db connection string>"
// <driver>, can be 'thin' or 'oci8'
// <db connect string>, is a Net8 name-value, denoting the TNSNAMES entry
conn = DriverManager.getConnection(jdbcURL, userId, password);
} catch(SQLException ex){ //Trap SQL errors
// catch error
//conn = new OracleDriver().defaultConnection(); // Connect to Oracle 8i (8.1.7), use Oracle thin client.
PreparedStatement ps = conn.prepareStatement("select 'a' from dual where ? = ?", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); // Use any query that will return zero rows.
ps.setInt(1, 1); // Set the params so that the query returns 0 rows.
ps.setInt(2, 2);
ResultSet rs = ps.executeQuery();
System.out.println("1. Last here? " + rs.isLast());
while (rs.next()) {
// do whatever
System.out.println("2. Last here? " + rs.isLast());
ps.close();
rs.close();
EXPECTED RESULT -
1. Last here? true
2. Last here? true
ACTUAL RESULT -
1. Last here? false
2. Last here? false
This happens to me on Oracle 9.2.0.1.0.387561,
For your information, I discovered this problem from
running a query that did access an actual DB table.
Try it and let me know.I did say I was only guessing, and yes, I did try it (after I posted my reply, and before I read yours). And I did check the query plan for the queries I tried -- to verify that they were actually doing some database "gets".
In any case, the usual way that I determine whether a "ResultSet" is empty is when the very first invocation of method "next()" returns 'false'. Is that not sufficient for you?
Good Luck,
Avi. -
How do I find a word in all my document, return false if it's not in there.
Hi,
I struggle with something that should be easy, and didn't find any answer on this forum.
I have a list of word that I want to search in a 300 pages catalogue in InDesign. I'd like to know how can i:
1) Look for the word
2) Return true if it's in the document
3) Return false if it's not
FYI, the words i'm searching are product code, so if they're not in the catalogue, the product isn't in the catalogue.
Thanks a lot,
OlivierHi Oliver,
Use this,
var doc = app.documents;
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = "Text";
var foundtext = app.activeDocument.stories.everyItem().paragraphs.everyItem().findText();
for (var i=0;i<foundtext.length;i++){
if (foundtext[i].length != 0){
alert("True");
else{
alert("False")
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing; -
Hi,
I have the following problem: I want to transfer a file from the application server to the client. I use the following code:
DECLARE
l_cache_filename VARCHAR2(150) := 'Q:\OracleReportsTemp\123.html';
l_report_desname VARCHAR2(150) := 'C:\pcedownload\456.html';
BEGIN
IF NOT webutil_file_transfer.is_as_readable(l_cache_filename)
THEN
message('error in configuration');
ELSE
IF NOT webutil_file_transfer.as_to_client_with_progress(l_report_desname, l_cache_filename, 'Transferring to '||l_report_desname, 'Transferring to '||l_report_desname)
THEN
message('error while transferring');
END IF;
END IF;
END;
The file Q:\OracleReportsTemp\123.html exists on the application server and the directory C:\pcedownload exists on the client PC.
This is the extract from webutil.cfg from the application server:
transfer.database.enabled=FALSE
transfer.appsrv.enabled=TRUE
transfer.appsrv.workAreaRoot=Q:\OracleReportsTemp
transfer.appsrv.accessControl=TRUE
transfer.appsrv.read.1=Q:\OracleReportsTemp
Although this code works fine on my local OC4J, webutil_file_transfer.as_to_client_with_progress always return FALSE on the Application Server. The function webutil_file_transfer.is_as_readable returns true on both environments. Other webutil function such as client_text_io also work fine on both environments.
Versions:
Forms 10g Release 2
Application Server 10g Release2 using OID and SSL
Webutil 1.0.6
Jinitiator 1.3.1.22Hi,
You can try as follows in your webutil.cfg file:
transfer.database.enabled=TRUE
transfer.appsrv.enabled=TRUE
transfer.appsrv.workAreaRoot=
transfer.appsrv.accessControl=FALSE
transfer.appsrv.read.1=
transfer.appsrv.write.1=
In formsweb.cfg you might have:
[webutil]
WebUtilArchive=frmwebutil.jar,jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
archive=frmall.jar
lookAndFeel=oracle
userid=user/pwd@mbcprod10g
width=100%
height=100%
then try with the following link:
http://localhost:8889/forms/frmservlet?config=webutil&form=<Form_Name>
Hopefully it will work.
Regards
Kausar Iqbal -
Default hostnameverifier always returns false ...
Hi,
I am trying to run wsdl2java by supplying an https URL. The JVM args that I am using are:
javax.net.ssl.trustStore=E:/Romil/projects/AirDeccanPlugin/localhost.ks
java.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
On running wsdl2java, I end up getting the following exception:
java.io.IOException: wrong hostname : should be <...>
I've verified that the hostname (IP address) in the URL exactly matches the CN (IP address) in the server certificate .
When I look at the JSSE code, it seems like the default HostnameVerifier always returns "false".
I also couldnt figure out a non-programatical way of supplying my own
HostnameVerfier to JSSE that returns a "true"
Any solutions/thoughts ?
Thanks and regards,
Romiltry this code before creating a connection
com.sun.net.ssl.HostnameVerifier hv=new com.sun.net.ssl.HostnameVerifier() {
public boolean verify(String urlHostname, String certHostname) {
System.out.println("Warning: Hostname is not matched for cert: "+urlHostname+ certHostname);
return true;
com.sun.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(hv);
this should solve your problem
cheers -
How can I send an email when a function returns false?
Im trying to make this code work, but i still receive an email when the function is equal to false. Can anyone assist me in finding the issue? What the program does is look for servers that has a set limit (in GB) on specific drives.
#This Program goes through all the servers and informs any level below the limit
$ErrorActionPreference = "SilentlyContinue";
$scriptpath = $MyInvocation.MyCommand.Definition
$dir = Split-Path $scriptpath
#=================Function============
Function isLow($server, $drive, $limit)
$disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'";
[float]$size = $disk.Capacity;
[float]$freespace = $disk.FreeSpace;
$sizeGB = [Math]::Round($size / 1073741824, 2);
$freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
if($freeSpaceGB -lt $limit){
return $true;
else{
return $false;
#================Servers==============
#------------------###server1--------------
$server = "###server1";
$drive = "C:";
$lim = 25;
if(isLow $server $drive $lim)
$Alert += $server + " || " + $drive + " is low<br>"
$server = "###server1";
$drive = "D:";
$lim = 35;
if(isLow $server $drive $lim)
$Alert += $server + " || " + $drive + " is low<br>"
#-----------------###(more servers ect.)--------------
#================EMAIL===============
$smtpServer = "192.168.x.x"
$ReportSender = "[email protected]"
$users = "[email protected]"
$MailSubject = "ALERT!!! Low DiskSpace"
foreach($user in $users){
if($true){
Write-Host "Sending Email notification to $user"
$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$msg = New-Object Net.Mail.MailMessage
$msg.To.Add($user)
$msg.From = $ReportSender
$msg.Subject = $MailSubject
$msg.IsBodyHTML = $True
$msg.Body = $Alert
$smtp.Send($msg)
else($false){
Write-Host "No one is pass the limit"Using a CSV is good. Just load the "$servers" hash array from a CSV and the rest will work the same. The overall structure would work better if it was more like this.
Function isLow($server, $drive, $limit){
$disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'"
if($disk.FreeSSpace -lt $limit){
$true
}else{
$false
$servers=@()
$servers=@{
Server="###server1"
Drive='C:'
Limit=25Gb
$servers=@{
Server="###server2"
Drive='D:'
Limit=15Gb
$servers=@{
Server="###server3"
Drive='C:'
Limit=50Gb
$results=foreach($servers in $servers){
if(isLow $server.Server $server.Drive $server.Limit){
'{0} || {1} is low<br>' -f $servers.Server,$server.Drive
if($results){
Write-Host 'Sending Email notification' -fore green
$mailprops=@{
SmtpServer='192.168.x.x'
From='[email protected]'
To=$users
Subject='ALERT!!! Low DiskSpace'
Body=$results
BodyAsHtml=$true
Send-MailMessage @mailprops
}else{
Write-Host 'No one is past the limit' -ForegroundColor green
The biggest issue is to realize that this is a computer. If you type the same thing more than once then consider that the computer can do it for you. Once you learn to think like a computer all of this becomes easier.
¯\_(ツ)_/¯ -
ServletAuthentication.weak() makes isUserInRole() always return false
I have a problem with SSO and authentification. If I authenticate with the weak()
method(have tried alle of them) authentication works fine and it seem to be single
signed-on, but
if we call the isUserInRole() method it always return false.
If I try to "call" pages from the client the declerativ security-constraints also
works fine preventing the user from accessing the pages. It is only when we use
the forward() method that we also use isUserInRole() to check if the user is permitted
to be forwarded(). WLS 6.1 sp2 tells us that the user is never in Role, no matter
what, if we use the weak() method to authenticate.
If I switch to using a j_sec_check form to authenticate the isUserInRole() works
fine. I can't use j_sec_check as a permanent solution though, because I need to
do a lot of pre- and post- processing in the login/authenication process.
Have any of you figured out a solution to this problem? Shouldn't isUserInRole()
work the same way regardless of if you logged in using SA.weak() or a j_security_check
form?Hi ,
If I switch to using a j_sec_check form to authenticate the isUserInRole()works
fine. I can't use j_sec_check as a permanent solution though, because Ineed to
do a lot of pre- and post- processing in the login/authenication process.You can use the j_security_check and still do the pre and post processing as
you want.
You have to following code,
package examples.servlets;
import java.io.PrintStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import weblogic.servlet.security.AuthFilter;
public class AuthFilterImpl extends AuthFilter
public AuthFilterImpl()
System.out.println("New AuthFilterImpl has been created.");
public void doPreAuth(ServletRequest servletrequest, ServletResponse
servletresponse)
System.out.println("AuthFilterImpl.doPreAuth has been called.");
System.out.println("Password is " +
servletrequest.getParameter("j_password"));
public boolean doSuccessAuth(ServletRequest servletrequest,
ServletResponse servletresponse)
System.out.println("AuthFilterImpl.doSuccessAuth has been called.");
return true;
public void doFailAuth(ServletRequest servletrequest, ServletResponse
servletresponse)
System.out.println("AuthFilterImpl.doFailAuth has been called.");
In your weblogic.xml have this entry,
<weblogic-web-app>
<auth-filter>
examples.servlets.AuthFilterImpl
</auth-filter>
</weblogic-web-app>
I am not sure about problem with SA.weak().
-utpal
"Morten" <[email protected]> wrote in message
news:[email protected]...
>
I have a problem with SSO and authentification. If I authenticate with theweak()
method(have tried alle of them) authentication works fine and it seem tobe single
signed-on, but
if we call the isUserInRole() method it always return false.
If I try to "call" pages from the client the declerativsecurity-constraints also
works fine preventing the user from accessing the pages. It is only whenwe use
the forward() method that we also use isUserInRole() to check if the useris permitted
to be forwarded(). WLS 6.1 sp2 tells us that the user is never in Role, nomatter
what, if we use the weak() method to authenticate.
If I switch to using a j_sec_check form to authenticate the isUserInRole()works
fine. I can't use j_sec_check as a permanent solution though, because Ineed to
do a lot of pre- and post- processing in the login/authenication process.
Have any of you figured out a solution to this problem? Shouldn'tisUserInRole()
work the same way regardless of if you logged in using SA.weak() or aj_security_check
form? -
SelectInputMethod() method of InputContext always returning false in JWS
Hi,
I am setting the Locale on a textArea using the api:
TextArea.getInputContext().selectInputMethod(Locale).
This api is always returning false, when run on Java Web Start.
However, it returns the correct value, when run on Java.
Has any one faced such issue?
Thanks,
Charanjeet
Message was edited by:
jannyguyWhen I trace the nativePath of the file I am trying to find it shows "C:\Users\User\AppData\Roaming\Arakaron.debug\Local Store". This is the exact path I am following in Explorer. Now, instead of applicationStorageDirectory I can do documentsDirectory and it reads that the file is in fact there. With the applicationStorageDirectory it only registers that the file exists after I copy from the embedded db file.
-
Boolean always returning false;
Ok so i have this
public static boolean testAuth(){
try{
BufferedReader authReader = new BufferedReader(new FileReader("auth.txt"));
String auth = authReader.readLine();
authReader.close();
URL authUrl = new URL("http://hvc3.com/authTest.php?auth="+auth);
BufferedReader urlReader = new BufferedReader(new InputStreamReader(authUrl.openStream()));
String authResponse = urlReader.readLine();
System.out.println(authResponse);
if(authResponse == "active"){
return true;
}else{
return false;
}catch (IOException e){
return false;
}this is my console outpot:
kevin-roses-computer:~/Desktop kevinrose$ java test
active
NOO
sorry its not the exception i dot knw whats wong:
Message was edited by:
krrose27if(authResponse.equalsIgnoreCase("active"))
{And in this case just write:
return authResponse.equalsIgnoreCase("active");:-)
-Puce -
File.exists returns false
File.exists returns false if the File object represents a symlink that is pointing to a non existing file.
How can I make it return true? I am using File.exists in a condition to
check if a symlink exists before calling File.delete.
I am using JDK 1.1.8.
Any help is appreciated.
AnilInteresting. But it doesn't hurt to call delete() even the File doesn't exist, does it? Could you clarify why you need to confirm that before calling delete()?
PC -
Applet selection return false?
Hi,
In the spec, there may be cases that the applet select() method return false. I am suspecting which cases cause the applet return false?
In my mind, before selection, the applet is in idle state so that it should be ready to be selected. Hence invoking its select() method should always return true in all cases.
regards,
Hoang LongFor some applicative reasons, an applet may refuse to be selected:
- it could be a "server" applet, whose only purpose is to provide a shareable object to other applets
- the applet may have been "invalidated" by the card issuer (expiration date, theft/loss, etc...)
It's up to the application provider to define the cases where an applet refuses selection. -
PartialPageUtils.isPartialRequest(fctx) always return false
Hi All ,
I am using Jdeveloper 11g and i can't solve the problem with getting always false from
PartialPageUtils.isPartialRequest(fctx);
If i use partialSubmit="true" PartialPageUtils.isPartialRequest(fctx) return false.
If i don't use partialSubmit PartialPageUtils.isPartialRequest(fctx) return false.
Could you please give me a solution.
Thanks in advance,
JavaDeveLoperHi Mr. Frank Nimphius
I have a creation form with 7 input text fields. 3 of them are required fields.
These 3 fields have valueChangeListener , validator and autoSubmit="true".
The problem is that when i enter info in field 1 and tab to the next field after passing the validator for field1 i get error message, because i've entered nothing in the other required fields.
Also i've ovveride public void validateModelUpdates(LifecycleContext lifecycleContext) {...}
public void validateModelUpdates(LifecycleContext lifecycleContext) {
FacesContext fctx = FacesContext.getCurrentInstance();
boolean isPPR = PartialPageUtils.isPartialRequest(fctx);
if (isPPR) {
System.out.println("No Refresh");
} else {
super.validateModelUpdates(lifecycleContext);
This method always return false.
Maybe you are looking for
-
Creating sales order using scheduling agreement eencountered this error
Copying SHUM LPN to OR is not defined Message no. V1473 Diagnosis The system does not have any settings for copying from SHUM LPN to OR. System Response The system does not copy the item from the reference document. Procedure If you want to be able
-
Stop Lightroom 2.4 from Importanting Images w/camera connected
I want to stop LR 2.4 from auto importing images when I connect my camera. I have tried many times to set "Preferences" so it would not auto import images when I connect my camera (Edit > Preferences... > Import > (uncheck box) next to "Show import d
-
Spot colors to be turned on/off
10.6.3. CS4. I have created a mask in a spot color and want to be able to turn it off and on in InDesign. What method would you use? I added a new spot color and used it to crate the maske i a new layer. It seems that I don't need to choose Multichan
-
1084 Syntax errors. Very basic.
I am very new to flash and I have some very basic code that I need help with. Here; var paddlepos:int = paddle.x.position if; (paddlepos > 253) paddle.x.postition = 253; The errors are: Scene 1, Layer 'Actions', Frame 1, Line 28 1084: Syntax e
-
Installing Crystal Reports 2008 fix pack 2.6 is breaking Crystal 2008 exe.
I have a package created to deploy Crystal 2008. I have included in my package SP1 and SP2 and that all works great. However, the issue is when I push fix pack 2.6, once that is pushed, and done running, then I try and open up Crystal 2008 I get an