Help in code optimization?
Hi there.
Almost embarrassing question, but it will help me with make
my code MUCH more efficient.
I am a newbie, but writing a pretty complex piece in which
the code repeats itself many times with a minor change.
Basically at this part I am telling many different Movie
Clips to pop up in different X and Y's.
I know my code (see example attached) is the long way to do
it.
The 2 paragraphs below are repeating 12(!) more times in my
code and they are exactly the same (but the X and Y's)
I am hoping to find a way to concise the 14 blocks of code (2
here on the example) to one block with +1, and for the different X
and Y's add an if statement for each different situation.
but i am heaving trouble executing it.
Any thought?
Will appreciate any help!
Thanks
Thanks again for replying.
The last piece of code is doing a great job in shortening the
code.
But I still have issues with the earlier help, although it
makes sense I have been spending the past two days in trying to
solve it…
The older 12 blocks version works great with the collision
detection solution. So I am trying to get the amazing result of
shortening them both, but I am out of luck.
I believe it might have to do with the vars I am using of the
makeTile…
hoping you are not getting tired of reading my posts..
I really don’t know what to do.
here is some code to make it more clear.
again any help will be great, I am loosing it :-(
Similar Messages
-
Need Help in code optimization
Hi Experts,
Its a performance issue. I used simple program to find the combinations based on the input.
For Example if input is : 123,
then the possible combinations are,
23 - without 1.
13 - without 2.
12 - without 3.
123
1
2
3
Like wise i need to find the combination for each input. I developped the code and its working fine upto
13 digit input[1234567890123].
But for then 13 digit it took long time to find the combination. Im in the need of reduce the of execution.
Please find the code below. The Do.. End do is used or input. If Do 3 times means the input is 123. if do 15 times means the input is [123456789012345].
DATA : lv_input_str TYPE string VALUE '1111'.
TYPES : BEGIN OF ls_ret_tab,
docno TYPE vbeln,
price TYPE netpr,
END OF ls_ret_tab.
TYPES : BEGIN OF it_tab,
index TYPE sy-index,
docno TYPE vbeln,
price TYPE netpr,
END OF it_tab.
DATA : lt_ret_tab TYPE TABLE OF ls_ret_tab WITH HEADER LINE,
it_tab TYPE STANDARD TABLE OF it_tab WITH HEADER LINE.
DATA : BEGIN OF gt_main OCCURS 0,
index TYPE sy-index,
level TYPE i,
table LIKE TABLE OF it_tab,
total TYPE netpr,
diffe TYPE netpr,
END OF gt_main.
DATA : t1 TYPE i,
t2 TYPE i,
t3 TYPE i.
START-OF-SELECTION.
DO 13 TIMES.
it_tab-index = sy-index.
APPEND it_tab.
ENDDO.
CLEAR t1.
GET RUN TIME FIELD t1.
PERFORM get_possible_values.
gt_main-index = 0.
gt_main-table = it_tab[].
APPEND gt_main.
SORT gt_main BY table.
SORT gt_main BY total DESCENDING.
DELETE ADJACENT DUPLICATES FROM gt_main COMPARING table.
GET RUN TIME FIELD t2.
END-OF-SELECTION.
DATA : lines TYPE i.
t3 = t2 - t1.
WRITE :/ 'time', t3.
LOOP AT gt_main.
WRITE :/5 gt_main-index, 20 gt_main-total.
LOOP AT gt_main-table INTO it_tab.
WRITE :/15 it_tab-docno.
WRITE :/15 it_tab-index.
ENDLOOP.
ENDLOOP.
FORM get_possible_values.
DATA : l_lines TYPE i.
DESCRIBE TABLE it_tab LINES l_lines.
IF l_lines <= 1.
"Append Return Table.
EXIT.
ELSE.
PERFORM get_all_values TABLES it_tab.
ENDIF.
ENDFORM. " GET_POSSIBLE_VALUES
FORM get_all_values TABLES it_tab STRUCTURE it_tab.
DATA : lv_pos TYPE i,
lv_pos1 TYPE i.
DATA : it_com TYPE STANDARD TABLE OF it_tab WITH HEADER LINE,
lv_input_str_index TYPE i,
it_main_temp LIKE TABLE OF gt_main WITH HEADER LINE,
lt_tab TYPE STANDARD TABLE OF it_tab WITH HEADER LINE..
CLEAR : lv_input_str_index.
STATICS : l_level TYPE i.
DATA : l_lines TYPE i.
DESCRIBE TABLE it_tab LINES l_lines.
DO l_lines TIMES.
lv_input_str_index = lv_input_str_index + 1.
REFRESH it_com.
LOOP AT it_tab.
IF sy-tabix EQ lv_input_str_index.
CONTINUE.
ENDIF.
APPEND it_tab TO it_com.
it_main_temp-total = it_main_temp-total + it_tab-price.
ENDLOOP.
READ TABLE gt_main WITH KEY table = it_com[].
IF sy-subrc NE 0.
it_main_temp-index = lv_input_str_index.
it_main_temp-table = it_com[].
APPEND it_main_temp.
ENDIF.
CLEAR : it_main_temp-total.
ENDDO.
SORT it_main_temp BY table.
DELETE ADJACENT DUPLICATES FROM it_main_temp[] COMPARING table.
APPEND LINES OF it_main_temp[] TO gt_main.
LOOP AT it_main_temp.
DESCRIBE TABLE it_main_temp-table[] LINES l_lines.
IF l_lines <= 1.
CONTINUE.
ELSE.
PERFORM get_all_values TABLES it_main_temp-table[].
ENDIF.
ENDLOOP.
ENDFORM. " GET_ALL_VALUES
Thanks,
Helps will be appreciated.
Edited by: Nandini on Mar 1, 2010 11:28 AMDATA : lv_input_str TYPE string VALUE '1111'.
TYPES : BEGIN OF ls_ret_tab,
docno TYPE vbeln,
price TYPE netpr,
END OF ls_ret_tab.
TYPES : BEGIN OF it_tab,
index TYPE sy-index,
docno TYPE vbeln,
price TYPE netpr,
END OF it_tab.
DATA : lt_ret_tab TYPE TABLE OF ls_ret_tab WITH HEADER LINE,
it_tab TYPE STANDARD TABLE OF it_tab WITH HEADER LINE.
DATA : BEGIN OF gt_main OCCURS 0,
index TYPE sy-index,
level TYPE i,
table LIKE TABLE OF it_tab,
total TYPE netpr,
diffe TYPE netpr,
END OF gt_main.
START-OF-SELECTION.
DO 13 TIMES.
it_tab-index = sy-index.
APPEND it_tab.
ENDDO.
PERFORM get_possible_values.
gt_main-index = 0.
gt_main-table = it_tab[].
APPEND gt_main.
SORT gt_main BY table.
* SORT gt_main BY total DESCENDING.
DELETE ADJACENT DUPLICATES FROM gt_main COMPARING table.
GET RUN TIME FIELD t2.
END-OF-SELECTION.
DATA : lines TYPE i.
LOOP AT gt_main.
WRITE :/5 gt_main-index, 20 gt_main-total.
LOOP AT gt_main-table INTO it_tab.
* WRITE :/15 it_tab-docno.
WRITE :/15 it_tab-index.
ENDLOOP.
ENDLOOP.
FORM get_possible_values.
DATA : l_lines TYPE i.
DESCRIBE TABLE it_tab LINES l_lines.
IF l_lines <= 1.
"Append Return Table.
EXIT.
ELSE.
PERFORM get_all_values TABLES it_tab.
ENDIF.
ENDFORM. " GET_POSSIBLE_VALUES
FORM get_all_values TABLES it_tab STRUCTURE it_tab.
DATA : lv_pos TYPE i,
lv_pos1 TYPE i.
DATA : it_com TYPE STANDARD TABLE OF it_tab WITH HEADER LINE,
lv_input_str_index TYPE i,
it_main_temp LIKE TABLE OF gt_main WITH HEADER LINE,
lt_tab TYPE STANDARD TABLE OF it_tab WITH HEADER LINE..
CLEAR : lv_input_str_index.
STATICS : l_level TYPE i.
DATA : l_lines TYPE i.
DESCRIBE TABLE it_tab LINES l_lines.
DO l_lines TIMES.
lv_input_str_index = lv_input_str_index + 1.
REFRESH it_com.
LOOP AT it_tab.
IF sy-tabix EQ lv_input_str_index.
CONTINUE.
ENDIF.
Edited by: Nandini on Mar 1, 2010 11:56 AM -
Optimizing the # of threads to do code optimization
Hi:
Is the number of threads used in the server to perform the code optimization tuneable? Cust has a large app and server startup is VERY long (1hour+)
vs 15 mins with -Xnoopt) due to optimization processing. Can the # threads used for this be increased via some start switch?
thx.
/WTry with -XXoptthreads, reference here:
http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/jrdocs/refman/optionXX.html#wp1024195
I believe the default is 1, try using 2 instead. More than that probably won't help much unless it's a large server (many CPUs).
Henrik -
Code optimization - how can I optimize ?
Basically i_mara has 19,000 records and it loops for all recors as coded.
The program is taking much time when i_mch1 has 300,000 records(approximately 40 minutes).
But in case i_mch1 had 18,000 records, it is fast.
Below is the code:
FORM output_itab4_normal .
FIELD-SYMBOLS : <lwa_makt_maktx> TYPE tt_makt_maktx,
<lwa_prfrq> TYPE tt_prfrq,
<lwa_mch1> TYPE tt_mch1,
<lwa_mvke> TYPE tt_mvke.
LOOP AT i_mara INTO wa_mara.
READ TABLE i_mch1 WITH KEY matnr = wa_mara-matnr
ASSIGNING <lwa_mch1>.
IF sy-subrc = 0.
*-----For Recurring Inspection, go to marc table.
READ TABLE i_prfrq WITH KEY matnr = wa_mara-matnr
ASSIGNING <lwa_prfrq>.
IF sy-subrc = 0.
wa_final_itab-prfrq = <lwa_prfrq>-prfrq.
READ TABLE i_mvke WITH KEY matnr = wa_mara-matnr
ASSIGNING <lwa_mvke>.
IF sy-subrc = 0.
wa_final_itab-mvgr1 = <lwa_mvke>-mvgr1.
ENDIF.
*-------For material description, go to makt table.
READ TABLE i_makt_maktx WITH KEY matnr = wa_mara-matnr
ASSIGNING <lwa_makt_maktx>.
IF sy-subrc = 0.
wa_final_itab-maktx = <lwa_makt_maktx>-maktx.
ENDIF.
wa_final_itab-matnr = wa_mara-matnr.
wa_final_itab-matkl = wa_mara-matkl.
wa_final_itab-bismt = wa_mara-bismt.
wa_final_itab-zzbismt = wa_mara-zzbismt.
wa_final_itab-mtart = wa_mara-mtart.
wa_final_itab-mhdhb = wa_mara-mhdhb.
wa_final_itab-zzshtdaysdom = wa_mara-zzshtdaysdom.
APPEND wa_final_itab TO i_final_itab.
CLEAR : wa_final_itab, wa_mara.
ENDIF. " IF sy-subrc = 0.
ENDIF.
ENDLOOP.
ENDFORM. " OUTPUT_ITAB4_NORMAL
Please help me . Thanks in advance.Hi,
You can refer to the following likns:
Code optimization
code optimization
Code Optimization
or
you can try this coding too As this avoids any looping and hence improve performance
Create another temporary internal table ie. i_final_temp.
then do the following:
referesh i_final_temp.
append lines of i_final to i_fianl_temp.
delete i_final_temp where v_box ne 'X'
describe table i_final_temp lines v_counter.
Thank You.
Regards,
Dhanalakshmi L -
Hi masters, nice to cyber with you agian.
I have just come back from NI DAY and I have heard there about Labview Code
Optimization.
I think this is really very interesting so I would like to learn more about
this but, where?
Do you know any good site ?
Maybe Greg could help?
Thanks in advance!
Francisco Javier Fernandez Luna
Ingeniero Tec. Industrial en Electronica.
Tel: 619 81 98 31
[email protected]
ó [email protected]
Would you like your answer in spanish? Please, let me know.
Si prefiere que conteste a sus preguntas en español, por favor, hagamelo
saber.
"Let's make things better" (PHILIPS)> I have just come back from NI DAY and I have heard there about Labview Code
> Optimization.
> I think this is really very interesting so I would like to learn more about
> this but, where?
> Do you know any good site ?
> Maybe Greg could help?
>
I did a presentation at NIWeek that covers some common performance
problems and has some VIs that show how different techniques compare.
Goto to
ftp://ftp.ni.com/support/niweek/software_track/
and you can find the Optimization presentation, or at least the VIs
used. I'm on a Mac; so I'm not certain what is in there.
The Optimization presentation isn't strictly focused on code speed, and
spends more time on things like panel appearance, but it does cover
performance to a certain extent. It tries to cover some of the mo
st
common issues. The performance chapter in the User manual, used to be
chapter 29, covers the issue pretty well too. Finally, there are some
low level Tech Notes somewhere on the NI web site.
If you have specific questions, post them away.
Greg McKaskle -
Help needed to optimize the query
Help needed to optimize the query:
The requirement is to select the record with max eff_date from HIST_TBL and that max eff_date should be > = '01-Jan-2007'.
This is having high cost and taking around 15mins to execute.
Can anyone help to fine-tune this??
SELECT c.H_SEC,
c.S_PAID,
c.H_PAID,
table_c.EFF_DATE
FROM MTCH_TBL c
LEFT OUTER JOIN
(SELECT b.SEC_ALIAS,
b.EFF_DATE,
b.INSTANCE
FROM HIST_TBL b
WHERE b.EFF_DATE =
(SELECT MAX (b2.EFF_DATE)
FROM HIST_TBL b2
WHERE b.SEC_ALIAS = b2.SEC_ALIAS
AND b.INSTANCE =
b2.INSTANCE
AND b2.EFF_DATE >= '01-Jan-2007')
OR b.EFF_DATE IS NULL) table_c
ON table_c.SEC_ALIAS=c.H_SEC
AND table_c.INSTANCE = 100;To start with, I would avoid scanning HIST_TBL twice.
Try this
select c.h_sec
, c.s_paid
, c.h_paid
, table_c.eff_date
from mtch_tbl c
left
join (
select sec_alias
, eff_date
, instance
from (
select sec_alias
, eff_date
, instance
, max(eff_date) over(partition by sec_alias, instance) max_eff_date
from hist_tbl b
where eff_date >= to_date('01-jan-2007', 'dd-mon-yyyy')
or eff_date is null
where eff_date = max_eff_date
or eff_date is null
) table_c
on table_c.sec_alias = c.h_sec
and table_c.instance = 100; -
Maestro need help also code is 75957252
maestro need help also code is 75957252 for bios password reset
This question was solved.
View Solution.Try
60635894
****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
2015 Microsoft MVP - Windows Experience Consumer -
Maestro need help also code is 75957252 for bios password reset
maestro need help also code is 75957252 for bios password reset
This question was solved.
View Solution.Check your other post. I replied there.
****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
2015 Microsoft MVP - Windows Experience Consumer -
Differnces between Search Help & Match Codes
Hi,
what is the Differences between Search Help & Match Codes ? which is goof to use ?Matchcodes were replaced with Search Helps starting with Release 4.0. Please use search helps to assign an input help to a field.
Existing matchcodes were automatically converted to search helps. A matchcode object is hereby converted to a collective search help with the same name. Each matchcode ID of the matchcode object is converted into an elementary search help with the same name and assigned to the collective search help created from the matchcode object.
A matchcode is a means of finding data records stored in the system. The matchcode is defined in the ABAP Dictionary in two steps:
You first define the relevant tables and fields for the search in a matchcode object. A matchcode object describes the set of all possible search paths for a search string.
You then create one or more matchcode IDs for a matchcode object. A matchcode ID describes a special search path for a search string. The matchcode ID defines the fields or field combinations to be used in the search.
Search Help
Use
With this function you can search for objects, thereby defining and linking different selection conditions for the search help.
Prerequisites
You can call this function by:
· Selecting Object ® Search... () in the main menu bar of the Integration Builder
· Placing the cursor on a software component version and selecting Search... () in the context menu (only in the Integration Repository)
In this case the software component version is defined as the search criteria.
Features
Defining the Object Type
You can select the object type in a dropdown list in field Object Type.
In the design (Integration Repository) you can
· Select an object type (for example Message Interface)
· Select a cross-object category (for example Interface Objects)
In the configuration (Integration Directory) you can select types Values Mapping Group and schema in addition to the individual object types.
CHECK THIS LINK TO CREATE A SEARCH HELP.
http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm
CHECK THIS LINK TO CREATE A MATCHCODE OBJECT
http://searchsap.techtarget.com/tip/1,289483,sid21_gci553386,00.html
more details... -
Search helps & match codes - Urgent plz
Hi ,
1. Could any one give me the difference between search helps & match codes.
2. assume that you are giving input matnr from selection screen.and executed based on input matnr you have generated an interactive report with fields matnr,etc...
if i want to change that particular matnr realted fields how can i do that from this report.Shell i call mm02 tcode.How to do that.how to pass the selected parameter to the transaction.(screen matnr field.please give me an example.
Regards
SAISRIHi,
Check this example for interactive reporting..which will take you MM02
TYPE-POOLS: slis.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF wa_material,
MATNR LIKE MARA-MATNR,
END OF wa_material.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
DATA it_material LIKE STANDARD TABLE OF wa_material WITH HEADER LINE.
SELECT * UP TO 100 ROWS
FROM MARA
INTO CORRESPONDING FIELDS OF TABLE it_material.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'WA_MATERIAL'
i_inclname = v_repid
CHANGING
ct_fieldcat = gt_fieldcat.
* have hotspot for a PO.
DATA: s_fieldcat LIKE LINE OF gt_fieldcat.
s_fieldcat-hotspot = 'X'.
MODIFY gt_fieldcat FROM s_fieldcat TRANSPORTING hotspot
WHERE fieldname = 'MATNR'.
* Pass the program.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = gt_fieldcat
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_material.
* FORM display_detail *
* --> UCOMM *
* --> SELFIELD *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
IF ucomm = '&IC1' AND selfield-fieldname = 'MATNR'.
READ TABLE it_material INDEX selfield-tabindex.
IF sy-subrc = 0.
SET PARAMETER ID 'MAT' FIELD it_material-matnr.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDFORM.
Thanks
Naren -
Hi all,
please help me to optimize following query,
SELECT HBD.HOTELBOOKINGID, HBD.ITEMREFERENCE, HBD.COUNTRYID, HBD.CITYID, HBD.LOCATIONID, HBD.CHECKINDATE,
HBD.CHECKOUTDATE, HBD.NOOFNIGHTS ,HBD.STARRATING, HBD.NOOFROOMS,
HBD.CURRENCY,
(SELECT CITYCM.CITYCODE FROM CITYCODEMAP CITYCM WHERE CITYCM.PROVIDERID=2 AND CITYCM.CITYID=HBD.CITYID) AS GTACITYCODE,
(SELECT CITYCM.CITYCODE FROM CITYCODEMAP CITYCM WHERE CITYCM.PROVIDERID=4 AND CITYCM.CITYID=HBD.CITYID) AS HBCITYCODE,
(SELECT XCM.CURRENCYCODE FROM XMLCOUNTRYMASTER XCM, COUNTRYCODEMAP CCM WHERE CCM.PROVIDERID=2 AND CCM.COUNTRYID= HBD.COUNTRYID AND XCM.COUNTRYCODE=CCM.COUNTRYCODE AND XCM.PROVIDERID=CCM.PROVIDERID) AS GTACURRENCY,
(SELECT LOCATIONCODE FROM LOCATIONANDZONEMAPPING WHERE LOCATIONID = HBD.LOCATIONID AND PROVIDERID = 2) AS GTALOCATION,
(SELECT LOCATIONCODE FROM LOCATIONANDZONEMAPPING WHERE LOCATIONID = HBD.LOCATIONID AND PROVIDERID = 4) AS HBZONE, CM.DESCRIPTION, CITM.DESCRIPTION,
(SELECT CITYCM.CITYCODE FROM CITYCODEMAP CITYCM WHERE CITYCM.PROVIDERID=5 AND CITYCM.CITYID=HBD.CITYID) AS TRAVCOCITYCODE,
(SELECT CCM.COUNTRYCODE FROM COUNTRYCODEMAP CCM WHERE CCM.PROVIDERID=5 AND CCM.COUNTRYID=HBD.COUNTRYID) AS TRAVCOCOUNTRYCODE
FROM BOOKINGHOTELDETAILS HBD, COUNTRYMASTER CM, CITYMASTER CITM WHERE HBD.HOTELBOOKINGID =124
AND CM.COUNTRYID = HBD.COUNTRYID
AND CITM.CITYID = HBD.CITYIDany help appriciated
Edited by: Pankaj M on Oct 8, 2008 3:40 PMJust taken a quick look anyway and you have a lot of nasty inline selects that would be better as joins...
Something like this... (untested)
SELECT HBD.HOTELBOOKINGID
, HBD.ITEMREFERENCE
, HBD.COUNTRYID
, HBD.CITYID
, HBD.LOCATIONID
, HBD.CHECKINDATE
, HBD.CHECKOUTDATE
, HBD.NOOFNIGHTS
, HBD.STARRATING
, HBD.NOOFROOMS
, HBD.CURRENCY
, MAX(DECODE(CITYCM.PROVIDERID,2,CITYCM.CITYCODE)) AS GTACITYCODE
, MAX(DECODE(CITYCM.PROVIDERID,4,CITYCM.CITYCODE)) AS HBCITYCODE
, MAX(DECODE(CCM2.PROVIDERID,2,XCM.CURRENCYCODE)) AS GTACURRENCY
, MAX(DECODE(LMZ.PROVIDERID,2,LMZ.LOCATIONCODE)) AS GTALOCATION
, MAX(DECODE(LMZ.PROVIDERID,4,LMZ.LOCATIONCODE)) AS HBZONE
, CM.DESCRIPTION
, CITM.DESCRIPTION
, MAX(DECODE(CITYCM.PROVIDERID,5,CITYCM.CITYCODE)) AS TRAVCOCITYCODE
, MAX(DECODE(CCM2.PROVIDERID,5,CCM2.COUNTRYCODE)) AS TRAVCOCOUNTRYCODE
FROM BOOKINGHOTELDETAILS HBD JOIN COUNTRYMASTER CM ON (CM.COUNTRYID = HBD.COUNTRYID)
JOIN CITYMASTER CITM ON (CITM.CITYID = HBD.CITYID)
JOIN CITYCODEMAP CITYCM ON (CITYCM.CITYID=HBD.CITYID AND CITYCM.PROVIDERID IN (2,4))
JOIN COUNTRYCODEMAP CCM2 ON (CCM2.COUNTRYID= HBD.COUNTRYID AND CCM2.PROVIDERID IN (2,5))
JOIN XMLCOUNTRYMASTER XCM ON (XCM.COUNTRYCODE=CCM2.COUNTRYCODE AND XCM.PROVIDERID=CCM2.PROVIDERID)
JOIN LOCATIONANDZONEMAPPING LMZ ON (LMZ.LOCATIONID = HBD.LOCATIONID AND LMZ.PROVIDERID IN (2,4))
WHERE HBD.HOTELBOOKINGID = 124
GROUP BY HBD.HOTELBOOKINGID
, HBD.ITEMREFERENCE
, HBD.COUNTRYID
, HBD.CITYID
, HBD.LOCATIONID
, HBD.CHECKINDATE
, HBD.CHECKOUTDATE
, HBD.NOOFNIGHTS
, HBD.STARRATING
, HBD.NOOFROOMS
, HBD.CURRENCY
, CM.DESCRIPTION
, CITM.DESCRIPTION; -
Combo box and Check box..help with code please?
Here is my problem...i have a list of check boxes and according to which one is checked, i need combo boxes to populate different choices.
as an easy example im only using 2 check boxes and two combo boxes.
the check boxes are named Choice 1or2 with export values of 1 and 2
the Combo Boxes are named List A and List B..
both containing options that say you checked box 1 and you checked box 2
any help would be greatly appreciatedImplode wrote:
"Help with code please."
In the future, please use a meaningful subject. Given that you're posting here, it's kind of a given that you're looking for help with the code. The whole point of the subject is to give people a high level idea of what KIND of help with what KIND of code you need, so they can decide if they're interested and qualified to help.
Exception in thread "main" java.lang.NumberFormatException: For input string: "fgg"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at assignment1.Game.Start(Game.java:120)
at assignment1.RunGame.main(RunGame.java:18)This error message is telling you exactly what's wrong. At line 120 of Game.java, in the Start method (which should start with lowercase "s" to follow conventions, by the way), you're calling Integer.parseInt, but "fgg" is not a valid int. -
My iphone wont turn on or restore,HELP error code 1015
My iphone wont turn on or restore,HELP error code 1015
jailbroken? if so we can't help here, try google.
-
Help with downhill optimization
Hi all,
I am trying to solve this one equation with one unknown using optimization. It's a non-linear equation and I was searching around for something that works like excel's solver. The downhill optimization seems close to what I want to do, but it is not optimizing. Would anyone mind looking at this code and try to determine what I'm doing wrong?
FYI, I've checked the answer by putting 0.02 as the X in my function and it is giving the right value. The function is set up to be like: Calc(X) - Actual = 0. The "=0" portion should be implied (maybe this is what is wrong?)
Thanks,
Matt
Solved!
Go to Solution.
Attachments:
Calc Mod.vi 13 KB
Calc Function.vi 23 KBThe problem seemed to be the initial value of your function and the type of your function. If you try to plot it, you will notice the discontinuity around 21.049 as shown below:
If you start from the left (like 21) then the minimization function will only be able to converge. If you start on the right (like 22), then you will find the X = 21.049 as minimum.
Here is the code for it:
Hope this helps
Barp - Control and Simulation Group - LabVIEW R&D - National Instruments -
Help with writing optimization
In my application, i have to create 3600 records. Here is my code :
uow is my unitOfWork.
for(int k = 1; k <=10;k ++) {
for(int i = 1 ; i <= 12; i++) {
for(int j = 1; j <=30; j++ {
MyRecord clone = (MyRecord) uow.registerObject(New MyRecord());
clone.setField1(k);
clone.setField2(i);
clone.setField1(j);
uow.commit();
To insert 3600 records in my database, it takes between 1 and 1,5 minutes. It seems to be very long.
How can i do to optimize this ? I know batch writing exist but i do not know it works.
Help please !!!I'm no SQL expert, but if your insert is really this straight-forward, you could probably just write an ad hoc SQL statement that does all this directly.
I assume there is more to your business domain for the sake of argument. There is no bulk-update/insert feature in TopLink (yet), so your only real option is to turn on batch writing, which should help minimize the number of database round trips in your app.
See these threads for more info on batch writing:
Batch Writing
Re: Performance Optimization for large batch updates
Maybe you are looking for
-
How do I export bookmarks from my ipod to my pc?
Hi there, I have a new laptop (Samsung N120 notebook) and am trying to upload my bookmarks from my iPhone 3GS. I have tried using iTunes and have downloaded v.10.5.3. I have just uploaded IOS 5 onto my iPhone so I should be ready to go. I've signed u
-
Can you use windows auto cad on a Mac?
Can you use windows auto cad on a Mac?
-
Changing the flow which is in process
hi There is some problem in one workflow which is running in production. now i have corrected that problem in development and transported to production . now its working fine. but the old process which is already in flow is referring only the old wor
-
Best way to Implement Internationalization
Hi All, I went through many forums to find out which is the recommended way to Internationalize a WDJ application. As far as I know there are 3 ways of achieving Internationalization: 1. using .xlf files 2. .properties file 3. Adding the language spe
-
I can watch 4OD and Demand 5 using Internet Explorer, but I get all the annoying adverts. I used to use iGoogle instead, which got rid of all the adverts, but recently this has stopped working, and now there is just a grey screen where the video shou