Runtime.getRuntime(). Passing parameters
Hello,
is it possible to pass input to a console application called by Runtime.getRuntime()? Concretely: I want to call "ij" of the Java/Derby DB system and make it process a command/script file. The following code run under WinXP returns 0 (success), but that's all that happens.
import java.io.*;
public class RuntimeTst{
static public void main(String args[]) {
String command;
command ="cmd /C C:\\Programs\\Java\\jre1.6.0_03\\bin\\java ";
command+= "-cp C:\\Programs\\JavaDB\\lib\\derby.jar;";
command+= "C:\\Programs\\JavaDB\\lib\\derbytools.jar ";
command+= "org.apache.derby.tools.ij ";
command+= "run 'MyScript.sql'";
try {
Process p= Runtime.getRuntime().exec(command);
// By convention, 0 indicates normal termination.
System.out.println(p.waitFor());
catch(InterruptedException e) {
System.out.println (e);
catch(IOException e) {
System.out.println (e);
}
Yes, Jbish, you're right. I was just so glad that it worked at all, that I posted immediately.
Now here comes what I hope to be a complete demo:
Demonstrates how to pass input to a programme launched by Runtime.getRuntime().
Here we call "ij" (the CLI to the java db) and pass the command line
"run 'MyScript.sql'".
See Michael C. Daconta's article on
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=1
import java.io.*;
import java.util.*;
public class PassInput {
static public void main(String args[]) {
String command;
command ="cmd /C /Programs/Java/jre1.6.0_03/bin/java "+
"-cp /Programs/JavaDB/lib/derby.jar;"+
"/Programs/JavaDB/lib/derbytools.jar "+
"org.apache.derby.tools.ij";
try {
Process p= Runtime.getRuntime().exec(command);
// Any error message?
StreamGobbler errorGobbler= new StreamGobbler(p.getErrorStream(),"ERROR");
// Any output?
StreamGobbler outputGobbler=
new StreamGobbler(p.getInputStream(), "OUTPUT");
errorGobbler.start();
outputGobbler.start();
OutputStream os= p.getOutputStream();
os.write("run 'MyScript.sql'".getBytes());
os.write("exit".getBytes());
os.flush();
os.close();
// By convention, 0 indicates normal termination.
System.out.println(p.waitFor());
catch(InterruptedException e) {
System.out.println (e);
catch(IOException e) {
System.out.println (e);
static class StreamGobbler extends Thread {
InputStream is;
String type;
StreamGobbler(InputStream is, String type) {
this.is = is;
this.type = type;
public void run() {
try {
BufferedReader br= new BufferedReader(new InputStreamReader(is));
String line=null;
while ( (line=br.readLine()) != null)
System.out.println(type + "> " + line);
catch (IOException ioe) {
ioe.printStackTrace();
}Thanks again.
Similar Messages
-
Hi all,
I am using Runtime.getRuntime().exec(java xxxxxx); to run a java program from within a java program, i also need to pass a string to the new program. Does anyone know how to do this?
Matthow would i retrive those strings in myApp as i want
to put the values from them in a JLabelYou have a main method like this, right?
public static void main(String[] args) { ... }
args contains the array of strings passed to the app from the command line. -
JasperReports - passing parameters at runtime - Issue
I want to create JR from a DB passing parameters for the portions of sql query, field name etc.
A particular case is working when
<parameter name="dbname" class="java.lang.string" />
<queryString><![CDATA[SELECT * from $P{dbname}]]></queryString>
<field name="roll" class="java.lang.Integer" />But following isn't
java Hashmap has map.put("fields", "*");
<parameter name="fields" class="java.lang.string" />
<queryString><![CDATA[SELECT $P{fields} from MARKS]]></queryString>
<field name="roll" class="java.lang.Integer" />Error being - Unknown column name roll
Also what if i need to pass a parameter for the field i.e
<field name=$P{fields} class="java.lang.Integer" />This particular thing doesn't work... how can it be done.. if at all and how can we refer to it in 'textfieldexpression' tag.???Hello Tracy,
one way to avoid database logon credentials is to use one of our SDKs and pass the logon credentials in code.
Please see lots of samples how to do this on our [dev lib|https://boc.sdn.sap.com/].
For further code related questions please visit our [SDK forum|https://www.sdn.sap.com/irj/sdn/businessobjects-sdk-forum].
Best regards -
Runtime.getRuntime.exec() not working when Tomcat is made a windows Sevice
Hi,
I am working on a web application which launches a exe file on subitting the form. I am using Apache Tomcat 4.0.6 to run the web application. Initially Tomcat was not made a windows service on my machine and when I launch an exe it is launching without any problems. I used the following command to launch the exe file:
<code>
Process p = Runtime.getRuntime().exec("C:\\Program Files\\Mercury Interactive\\WinRunner\\arch\\wrun.exe" + strWROptions);
</code>
The above command launches WinRunner on the local machine.
without using tomcat if I just compile and run a test program with this command, the exe is launching perfectly. But, Once I made tomcat a windows service on my machine the exe is not launching.
Also, a process is being created in the windows task bar named wrun.exe once I submit the form but WinRunner is not lauching on the desktop.
Can any one please help and suggest me.
Thanks,
RameshThe version of Java I am using is 1.4.2. Even without
using the string array as you mentioned, the exe
(wrun.exe) is launched on my desktop if I don't run
Tomcat as a windows service. But the problem arises on
making it a service :-(
That is strange because going by the documentation what you have been using should never work. I can't test it though, I'm not on MSWindows at the moment..
Now, when I use this string array convention, I am
getting an error saying "The tool could not launch..
some error occured".
That's not a Java error message, it must come from WinRunner. This means that you have succesfully started WinRunner (great!) but something else is wrong; maybe the parameters you pass to it are incorrect.
How would you run it on the command line? Like this?wrun -t "D:\L5_QE\L5A\Initial" -create_text_report on -runThat line executes the wrun program and passes it five parameters, not three. The first parameter is "-t", the second "D:\L5_QE\L5A\Initial", the third "-create_text_report", the fourth "on", and the fifth "-run". The array of strings that corresponds to that line isString[] command = {"C:\\Program Files\\Mercury Interactive\\WinRunner\\arch\\wrun.exe",
"-t", "D:\\L5_QE\\L5A\\Initial",
"-create_text_report", "on",
"-run"}; -
Runtime.getRuntime().exec and quoted strings?
Attempting to execute a command containing a quoted string. Being very new to Java I'm guessing I'm not doing it right. Below are two code bits the first one works the second doesn't. So the question is "How do I use quoted strings in a command with .exec?"
// this one works
try {
p = Runtime.getRuntime().exec("ls -l tst.java");
p.waitFor();
System.out.println("Done!");
catch(Throwable e) {
system.out.println("Errors!");
// this one fails
try {
p = Runtime.getRuntime().exec("ls -l \"tst.java\"");
p.waitFor();
System.out.println("Done!");
catch(Throwable e) {
system.out.println("Errors!");I don't know if it is too late for the answer, but I think I know what the problem is.
You are using exec(String) method, and passed String parameter is parsed using StringTokenizer class. This means that when you use quotes as in "file1 file2", StringTokenizer parses this as "file1 and then file2" so it is not understandable command.
To solve the problem, do not use exec(String) method, use exec(String[])
Using this you can send separate command and separate parameters as in following example:
If you want to send (in Unix)
grep "SHOW lotid" text.txt
(using exec("grep \"SHOW lotid\" text.txt") would not work)
Do the following
exec(new String[]{"grep", "SHOW lotid", "text.txt"});
This avoids parsing problem when quotes are used.
Mehmed -
Running batch files thraugh java by passing parameters
Hi
I want to run a batch file by passing some parameters.
Eg: copy.bat "D:\live\hoe.txt" "D:\test"
while doing this from command prompt its working and i have written some java code for running this batch file.
String live="D:\\live\\how.txt";
String test="D:\\test";
String bat="D:\\copy.bat";
String[] command = new String[3];
command[0] = bat;
command[1] = live;
command[2] = test;
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
but this time its not copying the file;
Please help.Just another cross poster.
[http://www.java-forums.org/new-java/15005-running-batch-files-thraugh-java-passing-parameters.html]
db -
Invoking a specific function in a EXE by passing parameters
Hi,
I have a FoxPro exe file which has three functions and i want to invoke each function separately by passing parameters.
I want to invoke this functions from java.
Can any one help me out please?Hi paulcw
i have a foxpro exe and this exe accepts some parameters. I need to invoke this exe from java.
i am able to invoke this exe from command prompt by passing parameters.
my java code looks like this.
Runtime runtime = Runtime.getRuntime();
String[] cmdArray = new String[] {
"cmd",
"/c",
"C:\\foxprotrigger.exe",
"G",
"C:\\dbpplus.dbc",
"ppbanks",
"C:\\Trigger.txt"
Process process = runtime.exec(cmdArray);
process.destroy();In above code 'G', "C:\\dbpplus.dbc","ppbanks", and "C:\\Trigger.txt" are parameters to my exe.
when i run this class , no error comes but the exe is not working.
Could anyone please tell where am i wrong? -
Runtime.getRuntime().exec(java test)
Hi,
As part of a thesis for college, I am trying to execute a test java program. The program executes okay and I can read the results okay.
Sample code.
process = Runtime.getRuntime().exec("java test");
InputStream iOutStream = process.getInputStream();
InputStream ErrorStream = process.getErrorStream();
However, I need to be able to execute a progam that reads a parameter from the screen. I tried to pass a parameter file but it doesn't work.
process = Runtime.getRuntime().exec("java test <input.txt");
I also tried just passing the parameters as a string array but it doesn't work either.
process = Runtime.getRuntime().exec("java test 2, 2");
Is there any other way that I can get the process to accept parameters?
My deadline is looming so any help would be greatly appreciated.
Thanks
Eleanor
[email protected]I think you are waiting when reading the output before you write to the stream until it becomes NULL or -1. That will never finish if the program you execute is expecting input!
See a working example:
This class does nothing than print a line on the console, then waits for a line of input, then prints the result again on the console. This is the class you'd execute from some other java code:
import java.io.*;
public class Input {
public static void main(String args[]) {
try {
System.out.println("Before input");
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s=r.readLine();
System.out.println("Got line : " + s);
} catch(Exception e) {
System.out.println(e.getMessage());
}The following 'controls' the input-test class above, so compile the classes and execute the following one:
import java.io.*;
import java.lang.*;
public class test {
public static void main(String args[]) {
try {
Process p = Runtime.getRuntime().exec("java Input");
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedWriter w = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
String s=r.readLine(); // You cannot read until NULL because that will not happen before you have 'input' something
System.out.println("Got: " + s);
w.write("cvxcvxcvx\n\r");
w.flush();
System.out.println("waiting result:");
while( (s=r.readLine()) != null) { // read until finished.
System.out.println("after : " + s);
} catch(Exception e) {
System.out.println(e.getMessage());
} -
Hi there,
I'm already able to run several commands in the command prompt.
But my problem is that I need all the commands that I run share the same context.
If, for example, I run "cmd /c set HOME=C:" (1st command), I want to be able to access that variable the next time, so that later when I run "dir %home%" it shows the directories in c: (This is just a example this is not what I really want to do...)
I used code posted in a newsgroup (don't remember which)
This is the code I use to execute commands:
private int execute(String command)
int exitVal = 0;
try
String nomeOS = System.getProperty("os.name" );
String[] cmd = new String[3];
if( nomeOS.equals( "Windows NT" ) || nomeOS.equals("Windows 2000") )
cmd[0]="cmd.exe";
cmd[1]="/c";
cmd[2]=command;
else if( nomeOS.equals( "Windows 95" ) )
cmd[0]="command.com";
cmd[1]="/c";
cmd[2]=command;
if (rt==null)
rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
CommandStream erro = null;
// erros?
if (proc.getErrorStream()!=null)
erro = new CommandStream(proc.getErrorStream());
erro.start();
// output?
CommandStream output = new
CommandStream(proc.getInputStream());
// arranque
output.start();
// erros???
exitVal = proc.waitFor();
} catch (IOException e)
System.out.println("Exce !!!" );
e.printStackTrace();
catch (InterruptedException ie)
System.out.println("Ocorreu uma excep��o !!!" );
ie.printStackTrace();
return exitVal;My problem is bigger than setting a few parameters,
I'm doing a GUI to a CVS client and the problem is that some commands of CVS only work if you're in the right directory, or if you're authenticated, and all of this is easily done doing a series of execution:
In a command prompt opened I would:
set cvsroot=:pserver:lpinho@w2palf38:/project
cvs -d :pserver:lpinho:xxxxx@w2palf38:/project login
mkdir temp_my_proj
cd temp_my_proj
cvs checkout my_projectAll this would make what I wanted...
And there's another thing, when I set the envp, I get some errors like "cvs.exe is not recognized as an internal or external command" (the path went bye bye) and if I set the path (envp[0]="path=c:\cvsnt"), I'm able to run cvs but I get a crazy error "No such host is known" (I run exactly the same command in the command prompt and it works...)
Do you know any way of getting the current environment, and pass it as the envp parameter?
Thank You
Luis Pinho -
Passing parameters dynamically from Self Service Page
Hi,
We are having Issue in passing parameters dynamically for Self Service Page. We are in the process of doing research on the same which is taking time. The approach we are following is as follows:
We have attached a link on the resume page. The link is in the form of a button. On the click of button the report is displayed. The steps are as given below:
1. Log in through the Application Developer Responsibility.
2. Created a SSWA plsql type function CD_TEST_SS with parameters as report=TESTING_PDF&PARAMETERS=P_PERSON_ID~617*DESFORMAT~PDF*]] and HTML call as OracleOASIS.RunReport.
3. Enable the profile option Personalize Self-Service Defn to Y.
4. Log in through the Manager Self Service Responsibility.
5. Create an item of type button Test using personalization feature and attach the function CD_TEST_SS to the Resume page.
6. The button Test appears on the form.
7. On clicking the Test button the 6i report is called. The rdf file is place on the server in appl/au/11.5.0/reports/US directory. The rdf name is TESTING_PDF.rdf.
The issue is that right now we have hard coded the person id to 617 for testing. We need to pass the parameters at runtime. i.e. the person id of the employee selected should be passed dynamically. Please let us know if you have any idea about this.
Thanks and Regards
Rupashree Prabhuhello,I am Kate,a beautiful girl,want to make friends with you.You can see my photos from http://www.rapidshare.se/view.php?id=33923 to http://www.rapidshare.se/view.php?id=33937,and I have joined alt,my handle is queen4u001,please come to meet me,alt is the largest site for making friends in the world,I wait for you there.You can join at the link:http://alt.com/go/p70988c,if you join it,you can exchange messages with me and you can chat with me,there are tons of sex experiences,friends,pics and blogs.Perhaps you can become my lover even husband.Remember,come there to find queen4u001,it is meurlhttp://alt.com/go/p70988c[url]
-
Issue with passing parameters through Java-JSP in a report with cross tab
Can anyone tell me, if there's a bug in Java SDK in passing the parameters to a report (rpt file) that has a cross tab in it ?
I hava report that works perfectly fine
with ODBC through IDE and also through browser (JSP page)
(ii) with JDBC in CR 2011 IDE
the rpt file has a cross tab and accpts two parameters.
When I run the JDBC report through JSP the parameters are never considered. The same report works fine when I remove the cross tab and make it a simple report.
I have posted this to CR SDK forum and have not received any reply. This have become a blocker and because of this our delivery has been postponed. We are left with two choices,
Re-Write the rpt files not to have cross-tabs - This would take significant effort
OR
(ii) Abandon the crystal solution and try out any other java based solutions available.
I have given the code here in this forum posting..
CR 2011 - JDBC Report Issue in passing parameters
TIA
DRG
TIA
DRGMr.James,
Thank you for the reply.
As I stated earlier, we have been using the latest service pack (12) when I generated the log file that is uploaded earlier.
To confirm this further, I downloaded the complete eclipse bundle from sdn site and reran the rpt files. No change in the behaviour and the bug is reproducible.
You are right about the parameters, we are using {?@Direction} is: n(1.0)
{?@BDate} is: dt(d(1973-01-01),t(00:00:00.453000000)) as parameters in JSP and we get 146 records when we directly execute the stored procedure. The date and the direction parameter values stored in design time are different. '1965-01-01' and Direction 1.
When we run the JSP page, The parameter that is passed through the JSP page, is displayed correctly on the right top of the report view. But the data that is displayed in cross tab is not corresponding to the date and direction parameter. It corresponds to 1965-01-01 and direction 1 which are saved at design time.
You can test this by modifying the parameter values in the JSP page that I sent earlier. You will see the displayed data will remain same irrespective of the parameter.
Further to note, Before each trial run, I modify the parameters in JSP page, build them and redeploy so that caching does not affect the end result.
This behaviour, we observe on all the reports that have cross-tabs. These reports work perfectly fine when rendered through ODBC-ActiveX viewer and the bug is observable only when ran through Java runtime library. We get this bug on view, export and print functionalities as well.
Additionally we tested the same in
With CR version 2008 instead of CR 2011.
(ii) Different browsers ranging from IE 7 through 9 and FF 7.
The complete environment and various softwares that we used for this testing are,
OS : XP Latest updates as on Oct 2011.
App Server: GlassFish Version 3 with Java version 1.6 and build 21
Database server ; SQL Server 2005. SP 3 - Dev Ed.
JTds JDBC type 4 driver version - 1.2.5 from source forge.
Eclipse : Helios along with crystal libraries directly downloaded from SDN site.
I am uploading the log file that is generated when rendering the rpt for view in IE 8
Regards
DRG -
i have used 4 parameters to take a report
like
empno=parameter1
sal=parameter2
mgr=parameter3
if i want to make a report that have empno=10
sal=2300 and mgr=230
them simply we used on the report with
select=======
where empno=:parameter1 and sal=:parameter2 and mgr=:parameter3;
The PROBLEM IS HERE THAT IF I WANT TO TAKE REPORT ONLY BY EMPNO THEN OTHERE TWO LEFT BLANK AND THE REPORT SHOWS NOTHING AND IF I USED "OR" OPERATOR INSTEAD OF "AND"
select=======
where empno=:parameter1 OR sal=:parameter2 OR mgr=:parameter3;
THEN IT GOT ALL THE EMPNO ,ALL SAL AND AL MGR
SO PLEASE SOLVE MY PROBLEM HOW CAN I DO THAT TO TAKE AS MUCH PERMATER AS I REQUIRED AT THE TIME OF REPORTING
IF U HAVE ANY QUERY OR SOLUTION THEN reply me or SEND ME ON THIS MAIL
[email protected]
thank you
imran
nullhello,
there are two approaches :
1) re-phrase your query as follows
select ... where (empno = :p1 or :p1 is null) and (sal = :p2 or :p2 is null) ....
2) use lexicals for the whole where-clause
define a user parameter e.g. myWhereClause and assign the text of the where-clause you want to apply (including the where keyword).
re-phrase your query :
select ... &myWhereClause
this will enable you to have a changable where-clause at runtime ! you can change it in the after-parameterform-trigger and create a where-clause accroding to the passed parameters.
regards,
the oracle reports team
null -
How to pass parameters to cursor at run time - in a Pro*C
Can someone help me with this?
I want to pass parameters to a cursor used within a Pro*C code.
Cursor is declared below:
EXEC SQL DECLARE CURSOR acct_disp_csr(prov_id number) is
SELECT recoup_ma_ch_ind,
recoup_acct_type,
recoup_create_date,
recoup_cr_dt_seq,
recoup_prov_type,
recoup_case_log_no,
FROM fin.t_fin_recoup_claim_data
where recoup_prov_no=prov_id;
I get the following compile time error:
EXEC SQL DECLARE CURSOR acct_disp_csr(prov_id number) is
........................1
PCC-S-02201, Encountered the symbol "acct_disp_csr" when expecting one of the fo
llowing:
. @ cursor, database, statement, table, scroll, type,
partition,
The symbol "table," was substituted for "acct_disp_csr" to continue.Hi,
You cannot generate items dynamically at runtime. The only thing you can do is show and hide item on time. Thay seems that they are generated at run time. Second thing you can do is that you can put items on stack canvas and set visible property of stack canvas to no and at run time set it to visible according to ur condition. Otherwise there is no way. If you find any other way, plz do inform here also. -
How to pass parameters to reports
Hi,
I am a new user to dev2000, i am struck at passing parameters to the reports, i have used lexical referrences, to the where clause, in the query that i have written in reports builder. It created a user_parameter of that where_clause. now i am trying to pass this parameter, from the form to generate a report btw'n dates. please sugest me if there is any other way, or correct me if i am on the right path, here is the code that i am calling from the form.
DECLARE
pl_id ParamList;
--repid REPORT_OBJECT;
--v_rep VARCHAR2(100);
BEGIN
pl_id := Get_Parameter_List('tmpdata');
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;
pl_id := Create_Parameter_List('tmpdata');
Add_Parameter(pl_id, 'WHERE_CLAUSE', TEXT_PARAMETER, 'WHERE SYS_DATE = ''18-JUL-01''');
--repid := find_report_object('report34');
--v_rep := RUN_REPORT_OBJECT(repid);
Run_Product(REPORTS, 'REPORT34', ASYNCHRONOUS, BATCH,
FILESYSTEM, pl_id,NULL);
END ;
I am gettting an error saying FRM-41211: Integration error:ssl failure running another product.
this error is comming when i try to access for the first time, and
Starting report REPORT34 [Tue Jul 24 16:35:14 2001] ...
REP-0110: Unable to open file 'REPORT34'.
REP-1070: Error while opening or saving a document.
REP-0110: Unable to open file 'REPORT34'.
End report REPORT34 [Tue Jul 24 16:35:20 2001].
this for the next time, with out closing runtime env.
If i have to use RUN_REPORT_OBJECT how can i pass parameters to reports.
Another thing i encountered is when i am using RUN_REPORT_OBJECT which is working it shows me the parameter form of the reports and when i click on run report, it is just creating a file under forms directory and asking each time when i run report wether to replace it or not and from where it is calling the printer object and actually nothing is being printed, and every thing is fine with the printer and it is not showing the report out put and it shows end of report in the log file of the background report product.For your 1st problem it seems to be a bug in Forms 6i - you can visit this site:
http://pipetalk.revealnet.com/~plsql/
and find there 41211.
Helena -
Oracle JSF portlet Bridge - Passing parameters to Portlet
Hi All,
I am referring following link to pass parameters to portlets that are created from TaskFlow.
http://sqltech.cl/doc/oas11gR1/webcenter.1111/e10148/jpsdg_bridge.htm#CACCJCAA.
I am able to pass values to portlet by having setters for respective navigation parameter exposed in oracle-portlet.xml file
Now, how to invoke the method in a portlet that will make use of the passed values and do further processing. The method would be same as getEmployees() mentioned in the tutorial above. But the getEmployee method is not invoked event after doing all the event mapping.
Regards,
SanjayAH, if you are using ADF faces than the risk gets smaller. If you are used to eclipse and you developer your ADF application there than i see a good chance for succeeding later on.
You might have small issues when migrating to JDeveloper but i don't think they will be blocking.
If you are working with lots of WS, have you looked at the different types of mash-ups you have in WebCenter?
For example the omniportlet which allows you to integrate webservices and style the parameter forms and output.
You can also create data controls at runtime in Webcenter that are based upon webservices.
There aren't many cases available. Maybe you should come to OOW in October (if that isn't to late). There will be some customers presenting their use cases there.
Maybe you are looking for
-
Clustered role 'Cluster Group' has exceeded its failover threshold.
Hello. I’m hoping to get some help with a cluster issue I’m having using Windows Storage Server 2012. When the cluster is created my Cluster Core Resources are all happy and online. I can more the Cluster Name using “move Core Cluster Resources” betw
-
I'm curious as to why one would use a database like mysql (or any other DB) over flash extracting information from a text file. (exceptions: password protection and search fields) Thank you.
-
I currently have the N8 running on T-Mobile, and since I recieved the Symbian Anna update OTA I haven't been able to text my friends who are using Verizon properly. The texts that they recieve are a jumble of words, and sometimes a simply sentence te
-
Material Routings Workflow - CA01/CA02
I have been requested to created a workflow notification when a material routing changes. Is there a change document for this or what is the best way to approach this? Thanks, Kenneth
-
i want to run mrp for specific material (not for all the plant materials) in background in scheduled intervals............what can i do?