How can I write this small function to create number of Array(s), please?
Guys,
How can I have a function create Array depending upon the passed argument. Am I doing this right?
function createArray(n:int):Array
for(var i:int=0; i<n; i++)
var nArr = new Array();
return nArr[i];
Thanks a lot.
var aArraySet:Array = createArraySets(5); //create 5 arrays
// Array 1 -> aArraySet[0]
// Array 2 -> aArraySet[1]
// Array 3 -> aArraySet[2]
// Array 4 -> aArraySet[3]
// Array 5 -> aArraySet[4]
function createArraySets(n:uint):Array
var aArraySet:Array = new Array();
for(var i:uint=0; i<n; i++)
aArraySet.push(new Array());
return aArraySet;
Similar Messages
-
List v = new Vector() how can i write this ?
List v = new Vector() how can i write this ?
vector does not 'extends' List rather it 'implements' only ......so how can write this way ? ( polymorphism applies only for 'extends' ).my question in a simple way is :
List some_list extends Vector
No, List is an interface; Vector is a concrete class. Read the javadocs.
Vector implements List
>
AND
List some_list implements Vector
are these two same in behaviour
our apart from theoretical differences ?thanks
Interfaces don't have any implementation; they're pure method signatures. When a concrete class implements an interface, it makes a promise that says "I will provide implementations for exactly these methods. Any client can call a method from the interface and I will do something 'sensible' if I'm written correctly."
From the point of view of static and dynamic types, there's no difference between interfaces and classes.
C++ has interfaces, too - they're classes with all pure virtual methods. If you understand how C++ works, the concept shouldn't be hard.
ArrayList is preferred precisely because it isn't synchronized by default. (You can always make it so using java.util.Collections if you wish later on.) If you don't need synchronization, why pay the performance penalty? -
How can i write this C-Code in G-Code
hallo
how can I write this C-Code in LabVIew ,
for a=0; a=<10; a++
for b=0; b=5 ; b+2
X= 3+b;
Y=1+a;
please see the attachment and tell me where is the problem
Attachments:
Unbenannt 11.vi 43 KBWell, at least you tried and got some of it right.
I think this should do what you want, but my C is rusty. Is the increment performed before or after the loop executes? If it's after, then I believe the loop should iterate 11 times, not 10.
In any case, you should note that for a literal translation, you would need to add a sequence structure to guarantee that Y was written to only after the inner loop finished because of the way data-flow works.. Also, note that controls and indicators in LabVIEW are not equivalent to variables. They can be used as such, but they usually should not be.
Another point about this is that you probably want to use the correct data type - the orange terminals are floating point indicators (of double precision, in this case) and you want integers.
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
Try to take over the world!
Attachments:
C.png 4 KB -
How can we write the excel function =Normsdist() in Java?
Hi,
I need to use one function in my java program to compute N(z) . In excel the function is =Normsdist(z). Is there any built-in library function for this in Java? How can I accomplish this? Please give me some solutions...
Thanks.I need to use one function in my java program to
compute N(z) . In excel the function is
=Normsdist(z). Is there any built-in library
function for this in Java? No.
How can I accomplish
this? Please give me some solutions...
Thanks.Write your own, or use a 3rd party library. -
How can I write this string to a file as the ASCII representation in Hex format?
I need to convert a number ( say 16000 ) to Hex string ( say 803E = 16,000) and send it using Visa Serial with the string control in Hex Mode. I have no problem with the conversion (see attached). My full command in the hex display must read AA00 2380 3E...
I can easily get the string together when in Normal mode to read AA0023803E... but how can I get this to hex mode without converting? (i.e. 4141 3030 3233 3830 3345 3030 3030 3031 )
Attachments:
volt to HEX.vi 32 KBSorry, The little endian option was probably introduced in 8.0 (?).
In this special case it's simple, just reverse the string before concatenating with the rest.
It should be in the string palette, probably under "additional string functions".
(note that this only works in this special case flattening a single number as we do here. If the stat structure is more complex (array, cluster, etc.) you would need to do a bit more work.
Actually, you might just use typecast as follows. Same difference.
I only used the flatten operation because of the little endian option in my version.
Message Edited by altenbach on 11-16-2007 11:53 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
littleendian71.png 4 KB
littleEndiancast71.png 4 KB -
How can I use this RFC function
I just wanna create a monitor as same as TCODE ST06
so
I Added a TextBox, a Button and a DataGrid. and then everything has finished.as same as following step for "RFC_CUSTOMER_GET" from SAP connector 2.0 help
but how can I use the function? (VB.net 2003) I debugged the function in SE37 the function only need 1 parameters
so,I scratched some statments... but it is still not correct
Dim num1 As Integer
Dim dst As CPUSAPUSAGE.CPU_SINGLETable
Me.SapProxy11.Get_Cpu_Single("local", "", num1, num1, num1, num1, "", num1, num1, num1, num1, dst)
please tell me details steps
Thank in advance.
Yi
Create a Windows Forms application.
Add an empty SAP Connection class with the ABAP functions
RFC_CUSTOMER_GET and RFC_CUSTOMER_UPDATE.
Leave the proxy designer open. Go to the SAP Proxy toolbox and drag the Proxy field icon to the designer.
Rename the new Field1 to Tab. Change the Type property to BRFCKNA1Table. To do this, use the drop down icon.
Note that the ReadOnly property automatically changes to true and the default value changes to new BRFCKNA1Table().
Add a second Proxy Field with the name Filter, the type String and the default value A*.
Select the Rfc_Customer_Get function and click on the button of the Parameters property.
Set the default values of the three parameters with the drop-down icon as follows:
Name1: Filter
Kunnr: Customer_T: _Tab
Save the proxy designer and switch to your Windows form. Add a TextBox, a Button and a DataGrid.
Add an instance of your SAP proxy to your Windows form, add a Destination and set the Connection property as described in A4.
Set the DataSource property of the datagrid to sapProxy11. Set the DataMember property of the datagrid to Tab. Alternatively you can set the DataSource to sapProxy11.Tab and leave the DataMember empty.
For textBox1 use the DataBinding feature to bind the Text property of the textbox to sapProxy11.Filter.
Double-click the button to create an event handler and add a single line:
this.sapProxy11.Rfc_Customer_Get_();
You are using sapProxy11 as a smart DataSet that contains the necessary state. You bind the state to the corresponding controls. The overload method Rfc_Customer_Get_() does not have any parameters, as the required state is already in the bound Proxy Fields.Dim dst As New CPUSAPUSAGE.CPU_SINGLETable
-
How can I write this SQL?
the statement have the question:
stxh-tdname length 70
itab-vbeln length 10
select tdobject into table it_stxh
from stxh
for all entries in itab
where ( tdid = 'Z006' and tdspras = 'E' and tdname+0(10) = itab-vbeln and tdobject = 'VBBK' ).
tdname+0(10) = itab-vbeln ???When you define the first Internal Table ITAB, define vbeln as the same type of stxh-tdname.
Eg.
data: begin of itab occurs 0,
vbeln like STXH-TDNAME,
erdat like vbak-erdat,
end of itab.
START-OF-SELECTION.
Select VBELN
ERDAT
from vbak
into CORRSPONDING FIELDS of table itab.
Then you can directly use this ITAB in the next query
select tdobject into table it_stxh
from stxh
for all entries in itab
where ( tdid = 'Z006' and tdspras = 'E' and tdname = itab-vbeln
and tdobject = 'VBBK' ).
Pls reward it if it is useful. -
How can we write this in analytical function..
select a.employee_id,a.last_name,b.count from employees a, (select manager_id, count(manager_id) as count from employees group by manager_id) b where a.employee_id=b.manager_id;
As per my requirement I need each manager name and no of employees reporting to him... above query works.. Could anybody help to write the same using analytic function.... Hw this same can be written in effiect way??? (quick performance)
Please also share the link to download some doc to have good understanding of analytical function..
Thanks in advance....are you trying to do a hierarchical type of query?
select ename, count(ename) -1 numr_of_emps_under_this_mgr from emp
connect by empno =prior mgr
group by ename
order by count(ename) desc ;
ENAME NUMR_OF_EMPS_UNDER_THIS_MGR
KING 13
BLAKE 5
JONES 4
CLARK 1
FORD 1
SCOTT 1
ADAMS 0
TURNER 0
MARTIN 0
JAMES 0
SMITH 0
MILLER 0
ALLEN 0
WARD 0Here is the table structure I used (I think you can download it from oracle somewhere)
CREATE TABLE EMP
EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10 BYTE),
JOB VARCHAR2(9 BYTE),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2)
SET DEFINE OFF;
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7369, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
800, 20);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
(7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
1600, 300, 30);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
(7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
1250, 500, 30);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
2975, 20);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
(7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
1250, 1400, 30);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
2850, 30);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
2450, 10);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('12/09/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
3000, 20);
Insert into EMP
(EMPNO, ENAME, JOB, HIREDATE, SAL, DEPTNO)
Values
(7839, 'KING', 'PRESIDENT', TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
5000, 10);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
(7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
1500, 0, 30);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7876, 'ADAMS', 'CLERK', 7788, TO_DATE('01/12/1983 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
1100, 20);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7900, 'JAMES', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
950, 30);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
3000, 20);
Insert into EMP
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
(7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
1300, 10);
COMMIT; -
Customer Trans Transaction Invoice
Code Date Type Amount
A001 01-JAN-2004 invoice 1000
A001 01-FEB-2004 Receipt -1500
A001 01-MAR-2004 invoice 2000
A001 01-APR-2002 invoice 2500
OUTPUT wanted to be...
Customer Trans Transaction Invoice
Code Date Type Amount Balance
A001 01-JAN-2004 invoice 1000 1000
A001 01-FEB-2004 receipt -1500 500
A001 01-MAR-2004 invoice 2000 2500
A001 01-APR-2002 invoice 2500 5000
Hi All,
Please look into the above data, If analytic function LAG(),CASE expression are possible to locate the cursor position in the single query, then any one can help me out about it. I tried but could not.
Regards,
Neel.You can do this with the SUM analytic function. Taking the emp table, for example,
1 select ename, sal, SUM(sal) OVER (order by empno)
2 from emp
3* order by empno
SQL> /
ENAME SAL SUM(SAL)OVER(ORDERBYEMPNO)
SMITH 800 800
ALLEN 1600 2400
WARD 1250 3650
JONES 2975 6625
MARTIN 1250 7875
BLAKE 2850 10725
CLARK 2450 13175
SCOTT 3000 16175
KING 5000 21175
TURNER 1500 22675
ADAMS 1100 23775
JAMES 950 24725
FORD 3000 27725
MILLER 1300 29025
14 rows selected.Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
How can I write this short/simple bit of php so it will work?
Hello!
I have this code in template.php...
<?php @ require_once ("$pagename.php"); ?>
...to bring content into the template.
I've got a folder called 'news' for all the news articles so
how could I edit the code to say 'look for files in the news folder
as well as the current folder'?
I guess I would need something like:
<?php @ require_once ("$pagename.php" or
"news/$pagename.php"); ?>
...but that doesn't work. How would I change it to work?
Thank you very much and hope to hear from you.
MarkYou would need to use the "or" operator in PHP. I'm not too
sure if that
will work or not but you can give it a go - I'm currently at
work now, so I
can't really test anything at this moment in time.
This is the operator for "or" in PHP: ||
Shane H
[email protected]
http://www.avenuedesigners.com
===============================
Proud GAWDS Member
http://www.gawds.org
Delivering accessible websites to all...
===============================
"Spindrift" <[email protected]> wrote in
message
news:e5fhh5$sgv$[email protected]..
> Hello!
>
> I have this code in template.php...
>
> <?php @ require_once ("$pagename.php"); ?>
>
> ...to bring content into the template.
>
> I've got a folder called 'news' for all the news
articles so how could I
> edit
> the code to say 'look for files in the news folder as
well as the current
> folder'?
>
> I guess I would need something like:
>
> <?php @ require_once ("$pagename.php" or
"news/$pagename.php"); ?>
>
> ...but that doesn't work. How would I change it to work?
>
> Thank you very much and hope to hear from you.
>
> Mark
> -
How can i write this syntax in script logic....
hi all
i need to write below syntax in bpc script logic..
If Headcount = 0, then Salary = 0 Else:
If Month <> March and Month <> September:
Salary = Salaryprevious month1 + [(Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)]
If Month = March:
Salary = [Salaryprevious month1 + [(Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)] ] * (100% + Band Annual Increase + Band Annual Increase Factor)
in the above code headcount,salary,bandrate etc all got ids.
thanks guysHi,
In your query, when you say that headcount = 0, do you mean the signed data? In this case, it will difficult to do. When you have a signed data as 0 in SQL, once you optimize the application or compress it, that particular record will go and your logic will not work.
If I look at your logic,
If Headcount = 0, then Salary = 0 Else:
If Month March and Month September:
Salary = Salaryprevious month1 + (Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)
If Month = March:
Salary = [Salaryprevious month1 + (Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)] * (100% + Band Annual Increase + Band Annual Increase Factor)
If the application has been compressed or optimized, it will not get any record for that particular headcount and will directly go into the "else" loop. Though, its not correct.
I hope you got my point. -
How can I convert this small pl/sql block in a single query?
Hello,
I need to have a single SQL query which gives the same output as the following piece of code, which uses a cursor to iterate on the rows in order to get the informations I need:
declare
cursor c(p varchar2) is
select context_id, id, parent_id
from CONTEXT_CONTEXT
start with parent_id is null
and context_id = p
connect by prior id = parent_id
and context_id = p;
begin
for r in (select context_id from ALL_CONTEXTS where context_type in ('MYTYPE'))
loop
for j in c(r.context_id)
loop
-- I want to obtain the values of the following colums from a query:
dbms_output.put_line(j.context_id || ' ' || j.id || ' ' || j.parent_id);
end loop;
end loop;
end;
Additional informations:
CONTEXT_CONTEXT.context_id references ALL_CONTEXTS.id
CONTEXT_CONTEXT.id references ALL_CONTEXTS.id as well
CONTEXT_CONTEXT.parent_id references ALL_CONTEXTS.id as well
id is primary key of ALL_CONTEXTS
(context_id, id) is primary key of CONTEXT_CONTEXT
*/user10047839 wrote:
Unfortunately, the CONNECT_BY_ROOT is not supported by my version of the DB 9i.
SELECT context_id,
SUBSTR(
SYS_CONNECT_BY_PATH(context_id,'/'),
2,
INSTR(
SYS_CONNECT_BY_PATH(context_id,'/') || '/',
1,
2
) - 2
) AS parent_context_id
FROM CONTEXT_CONTEXT
START WITH parent_id IS NULL
AND context_id IN (
SELECT context_id
FROM all_contexts
WHERE context_type IN ('MYTYPE')
CONNECT BY PRIOR ID = parent_id
AND context_id = PRIOR context_id;SY. -
How can I write this query In parameterize form so That I can prevent sql Injection
String strQry = "INSERT INTO tblVoucherType (VhrTypeCode,moduleCode,transCCode,"
+ "voucherType,OrderNumber,active,AccountId) "
+ " values('" + txtVhrCode.Text + "','" + ddlModule.SelectedValue.ToString() + "',"
+ "'" + ddlTrans.SelectedValue.ToString() + "','" + txtVhrName.Text + "','" + btnRadio.SelectedValue + "'"
+ ", '" + status.Checked + "', '" + txtAccount.Text + "')";Basically it will look like:
String strQry = "INSERT INTO tblVoucherType (VhrTypeCode,moduleCode,transCCode, ...)"
+ " values(@VhrCode, @moduleCode, @transCCode, ....)";
sqlCommand.Parameters.AddWithValue("@VhrCode", txtVhrCode.Text );
sqlCommand.Parameters.AddWithValue("@moduleCode", ddlModule.SelectedValue.ToString() );
sqlCommand.Parameters.AddWithValue("@transCCode", ddlTrans.SelectedValue.ToString() );
.. and so on
sqlCommand.ExecuteNonQuery();
Olaf Helper
[ Blog] [ Xing] [ MVP] -
How can I make this a smaller file?
Hi,
I was wondering how I can make this movie smaller.
I don't understand why it is so big.
The sound is a .wav that comes in at 596 kb recorded at 22.5
khz in mono.
The rest must be the video. How can I get this smaller?
Thanks
The movie is at the link below:
www.kapowdesign.com/leosbday.htmHere are tools that can help you reduce the size of your SWF
http://www.flashjester.com/index.php?section=faq&cPath=50#318
Try it.
Regards
FlashJester Support Team
e. - [email protected]
w. -
http://www.flashjester.com
There is a very fine line between "hobby" and
"mental illness." -
How can I write the analogous code to the logic:iterate tag functionality
Hai This is Rayalu .And I am very new to the Java World. I have a doubt?.How can I write the analogous code to the<logic:iterate> tag functionality using the JSP Tag Libraries . Pleae Send me some examples .
Hi,
SELECT objnr objid aufnr
from afih
into table t_afih.
SELECT objnr
from JEST
into table t_JEST
where stat = 'A0045'
OR stat = 'A0046'
AND inact 'X'.
SELECT objnr
from COBRB
into table t_cobrb.
SELECT arbpl werks objid objty
from crhd
INTO table it_crhd
FOR ALL ENTRIES IN it_afih
WHERE objty eq 'D'
AND gewrk = it_afih-objid.
SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
FROM caufv
INTO table t_caufv
FOR ALL ENTRIES IN it_afih
WHERE aufnr = it_afih-aufnr
And pspel = ' '
AND txjcd = ' '
ANd objnr ne it_crhd-objnr
AND auart in s_wtype
AND werks in s_plant.
AND objnr ne it_jest-objnr.
dont use NE in the select statements, it may effect performance also. Instead use if statements inside
loops.
loop at t_caufv.
read table it_chrd............
if t_caufv-objnr ne it_chrd-objnr.
read table it_jest..........
if if t_caufv-objnr ne it_jest-objnr.
(proceed further).
endif.
endif.
endloop.
hope this helps.
Reward if useful.
Regards,
Anu
Maybe you are looking for
-
So i haven't been able to sort my Apple ID for some time as of personal and work issues Tonight i was going to select some songs from gift voucher from Christmas (who knew!) and first got my password wrong in which i got that sorted as an email came
-
I get to step 2 of 3 at Finish of the Reader load. I've waited 5 minutes for Step 3 to display but no luck. What's wrong?
-
Downloading trial error.
Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example, ERROR: DW050 ... -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 5 error(s), 0 warning(s) --
-
I've installed the latest Flash plugin (11.3.300.214). Still, all videos appear as blank in all Firefox versions, although they work properly with Chrome. What might be the reason? I have only AdBlock addon, and it cannot be the cause of this flaw.
-
Sound Problems with MSI 648 Max ( MS-6585 ) Board - Help !!!
Hi, i have the MSI Mainboard: MSI 648 Max ( MS-6585 ) and when I put on the microphone i have a bad sound on my soundboxes like scratching or beeping. I have installed a new BIOS update and new Sounddrivers. I have Win2000 with SP3. Anybody can help