How to write this code ?
I need to write 3 classes that each one can get to the other with the same instance of the class , so how do i write this code ?
thanks a lot
try out singleton pattern with all the three classes. following link may help...
http://www.javareference.com/jrexamples/viewexample.jsp?id=25
Similar Messages
-
Who can help me? write this code?
Write java code print prime number like this
Sample Screen Print:
Initial matrix with N = 37
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37
Intermediate results (after 1st iteration)
2 3 5 7 9
11 13 15 17 19
21 23 25 27 29
31 33 35 37
Intermediate results (after 2nd iteration)
2 3 5 7
11 13 17 19
23 25 29
31 35 37
Intermediate results (after 7th iteration)
2 3 5 7
11 13 17 19
23 29
31 37
Final results
2 3 5 7 11 13 17 19 23 29
31 37
How to write this code ?
Please Help me!
Thank you so muchhh ?????Looks like The Sieve of Eratosthenes.
A google search for that should help you with some logic.
Wikipedia has a really nice animation of how it works.
Post back when you have some source code that you need help with.
Thanks k???? lullzz??? -
How to write this sql query in php code ?
for example:
insert into temp
select *
from testtable;
after this, i will query data from sql below:
select *
from temp;
how to write this php code ?
who can help me ?
thanks!Have a look at the manual to find out how to issue queries.
http://us3.php.net/oci8 -
How to write source code in smart forms?
hi friends,
can anyone can help me in writing sorcecode in smartforms r
any materail link.
if it is helpful points can b rewarded.Thanks in advance.Hi,
Check this link for
how to write source code in smart forms?
http://****************/Tutorials/Smartforms/GettingStarted/SimpleText.htm
You can write Source Code in smartforms By Choosing Program Lines.
Check this link with Screen Shots
http://****************/Tutorials/Smartforms/PO/page1.htm
Reward All Helpfull Answers
Regards
Fareedas
Edited by: Fareeda Tabassum S on May 21, 2008 3:09 PM -
How to write the code to send the report output to the local file.
dear all,
how to write the code to send the report output to the local file.
Thanks & Regards,
Jyothi.Hi,
Try this , it will display report and download the file as well. Just vhange the path and execute
TYPE-POOLS : SLIS.
DATA : IT_SCARR TYPE TABLE OF SCARR,
IT_FCAT TYPE SLIS_T_FIELDCAT_ALV.
SELECT *
FROM SCARR
INTO TABLE IT_SCARR.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
* I_PROGRAM_NAME =
* I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'SCARR'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_INCLNAME =
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FCAT
* EXCEPTIONS
* INCONSISTENT_INTERFACE = 1
* PROGRAM_ERROR = 2
* OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_STRUCTURE_NAME =
* IS_LAYOUT =
IT_FIELDCAT = IT_FCAT
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_SCARR
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
* BIN_FILESIZE =
FILENAME = 'C:\Documents and Settings\sap\Desktop\Hi.xls' " Change path
* FILETYPE = 'ASC'
* APPEND = SPACE
* WRITE_FIELD_SEPARATOR = SPACE
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = SPACE
* WRITE_LF = 'X'
* COL_SELECT = SPACE
* COL_SELECT_MASK = SPACE
* DAT_MODE = SPACE
* CONFIRM_OVERWRITE = SPACE
* NO_AUTH_CHECK = SPACE
* CODEPAGE = SPACE
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = SPACE
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* IMPORTING
* FILELENGTH =
CHANGING
DATA_TAB = IT_SCARR
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* NOT_SUPPORTED_BY_GUI = 22
* ERROR_NO_GUI = 23
* others = 24
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = 'C:\Documents and Settings\sap\Desktop\Hi.xls' "Change path
* APPLICATION =
* PARAMETER =
* DEFAULT_DIRECTORY =
* MAXIMIZED =
* MINIMIZED =
* SYNCHRONOUS =
* OPERATION = 'OPEN'
* EXCEPTIONS
* CNTL_ERROR = 1
* ERROR_NO_GUI = 2
* BAD_PARAMETER = 3
* FILE_NOT_FOUND = 4
* PATH_NOT_FOUND = 5
* FILE_EXTENSION_UNKNOWN = 6
* ERROR_EXECUTE_FAILED = 7
* SYNCHRONOUS_FAILED = 8
* NOT_SUPPORTED_BY_GUI = 9
* others = 10
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Hello
can someone please tell me how to modify this code so that I dont have to enter the file path at all? When i give the same file path constants to both the read and write VIs I'm getting an error message.
Attachments:
read and write.vi 11 KBYup use the low level File I/O opening the reference once, and closing it once.
As for the path selection you have an unwired input which is the path to use. Programatically set that and you won't be prompted to select a path. Usually this is done with a path constant to a folder, then using the Build Path, to set the file name in that folder.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously. -
How to write a code for open new txt file in swing
hai all,
now i do one project in java.that project's GUI is Swing. But i don't known swing (basic).So how to write a code for open new txt file and "Open window " in menu item on swing.that means when i click the "New" on menu that time open a new txt file. open also like that type.
plz give me that code ! very urgent
Advance Thanks !
RSKSwing Tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/index.html
Since you don't know the basic of swing read the tutorial, it is for your own good because it is useless if we provide you with a code you don't even understand and how it works.
If you want a menu read the tutorial about using menus and for opening a file read using JFileChooser.
note: don't use the word urgent because it implies that your problem is more important than others. -
How to write this query to filter combination of few values
Hi,
I have a table CHIMM which is a transaction table and contains information of the vaccines given to a child.
columns are: child_id, vacc_id, vacc_given_dt. I have to query for remaining vaccines.
HEXA is a vaccine_id which is composite vaccine of DPT1,POL1,HBV1 & HIB1 (vaccine ids).
I want to write to query if any of DPT1,POL1,HBV1 & HIB1 given then HEXA should not be displayed in the result.
OR
if HEXA is given then of course any of DPT1,POL1,HBV1 & HIB1 should not be displayed in the result.
How to write this query?
RegardsHi,
I'm still not sure what the output you want from that sample data is. Do you just want the child_ids, like this
CHILD_ID
3
4? If so, here's one way to get them:
WITH all_vacc_ids AS
SELECT c.child_id
, c.vacc_id AS child_vacc_id
, v.vacc_id
, COUNT ( CASE
WHEN c.vacc_id = 'HEXA'
THEN 1
END
) OVER ( PARTITION BY c.child_id
) AS hexa_itself
FROM vacc v
LEFT OUTER JOIN chimm c PARTITION BY (c.child_id)
ON c.vacc_id = v.vacc_id
WHERE v.vacc_desc = 'HEXA' -- See note below
SELECT child_id
FROM all_vacc_ids
WHERE child_vacc_id IS NULL
AND vacc_id != 'HEXA'
AND hexa_itself = 0
GROUP BY child_id
rha2 wrote:there are alot of vaccines, i just put 3 for example. this query gives error: invalid relational operatorAre you saying that the vacc table contains other rows, but those other rows are not needed for this problem? It would be good if you included an example in the sample data. The query above considers only the rows in vacc where vacc_desc='HEXA'. You can have other rows in the vacc table, but they won't affect the output of this query. The query above makes no assumptions about the number of rows that have vacc_desc='HEXA'; it will report all child_ids who are missing any of them, regardless of the number (assuming the child does not have the 'HEXA' vacc_id itself, like child_id=1).
You still haven't said which version of Oracle you're using. The query above will work in Oracle 10 (and higher). -
How to write this query ?
how to write this query ?
list the emp name who is working for the highest avg sal department.
I can use row_number over to get correct result. If we don't use this row_number function, just plain sql, how to do it ?
the row_number version is like this
select emp.* from emp ,
select deptno, row_number() over (order by avg(sal) desc) r from emp
group by deptno
)e
where e.r = 1
and emp.deptno = e.deptnoHi,
806540 wrote:
how to write this query ?
list the emp name who is working for the highest avg sal department.
I can use row_number over to get correct result. If we don't use this row_number function, just plain sql, how to do it ?ROW_NUMBER is just plain SQL, and has been since Oracle 8.1.
ROW_NUMBER (or its close relative, RANK) is the simplest and most efficient way to solve this problem. Why not do this the right way?
the row_number version is like this
select emp.* from emp ,
select deptno, row_number() over (order by avg(sal) desc) r from emp
group by deptno
)e
where e.r = 1
and emp.deptno = e.deptno
If there happens to be a tie (that is, two or more departments have the same average sal, and it is the highest), then the query above will only arbitrarily treat one of them (no telling which one) as the highest. Change ROW_NUMBER to RANK to get all departments with a claim to having the highest average sal.
You could use the ROWNUM pseudo-column instead of ROW_NUMBER, if all you want to do is avoid ROW_NUMBER.
Without using ROW_NUMBER or RANK, there are lots of ways involving other analytic functions, such as AVG and MAX.
If you really, really don't want to use analytic functions at all, you can do this:
SELECT *
FROM scott.emp
WHERE deptno IN (
SELECT deptno
FROM scott.emp
GROUP BY deptno
HAVING AVG (sal) = (
SELECT MAX (AVG (sal))
FROM scott.emp
GROUP BY deptno
; -
Which planning function i have to use and how to write this planning fucnti
Hi Bi Guru's,
I have rolled out BW SEM-BPS Planning Layout's for the Annual Budget in my organistaion.
There are two levels of layout given for the each sales person.
1) Sales quantity to be entered Material and country wise for all 12 months ( April 2009 to March 2010)
2) Rate per unit and to entered in second sheet, Material and country wise for the total qty entered in the first layout.
Now i need to calculate the sales vlaue for each period and for the each material.
Which planning function i have to use and how to write this planning fucntion.
Please suggest me some solution ASAP.
Thanks in Advance,
NileshHi Deepti,
Sorry to trouble you...
I require your help for the following scenario for caluclating Sales Value.
I have Plan data in the following format.
Country Material Customer Currency Fiscyear Fiscper Qty Rate Sales Value
AZ M0001 CU001 # 2009 001.2009 100.00
AZ M0001 CU002 # 2009 001.2009 200.00
BZ M0001 CU003 # 2009 001.2009 300.00
BZ M0001 CU003 # 2009 002.2009 400.00
BZ M0002 CU003 # 2009 002.2009 300.00
AZ M0001 # USD 2009 # 10.00
BZ M0001 # USD 2009 # 15.50
BZ M0002 # USD 2009 # 20.00
In the Above data the Rate lines are entered in the Second Layout, Where the user enters on the Country Material Level with 2009 value for FISCYEAR.
I am facing problem with this type of data.
I want to store the sales value for each Material Qty.
Please suggest some solution.
Re
Nilesh -
How to write C# code in HTML code?
Hi,
I want that write C# code in script tag in html document. I write this code:
<script>
function AddNewLinkfn()
var LinkName = prompt("Please enter Link Name:", "");
var LinAddress = prompt("Please enter Link Address:", "");
if (LinkName != "" && LinAddress != "" && LinkName != null && LinAddress != null) {
<% string esmelink=%> LinkName <% ,adreselink= %> LinkAddress<%;%>
</script>
but this has error.
I Thanks anyOne that guide me. :)
Good luck!Hi Bahare,
The <script> tag is used to define a client-side script, such as a JavaScript.
The <script> element either contains scripting statements or it points to an external script file through the src attribute.Common
uses for JavaScript are image manipulation, form validation, and dynamic changes of content.
You should write C# code inside asp.net (C#)(.cs).page. For more infomation,Please check
http://msdn.microsoft.com/en-us/library/vstudio/k33801s3(v=vs.100).aspx
In addition,
This forum is to discuss problems of C# development.
You'll need to post it in
ASP.NET forum for more efficient responses, where you can contact ASP.NET experts.
Best Regards,
Kristin -
How to write html code in narrative
Hi,
How to write html code in narrative to get following format
desc value1 Value2 totalvalue
a 10 20 30
b 20 30 50
Totalvalue 30 50 80
Total % 0.3 0.5 0.8
Can any one help guide on writing HTMl code for above table format in narrative type of display data at report level
Thank you
ManuHi Balu,
If you are using the Web Application server (WEBAs), Then you can create applications using BSP( Bussiness server pages). Which is some what luike JSP.
Or
In SE80 , Try to create internet service files uisng BHTML. In the dropdown select internet service. And then try to create the HTML templates
Thanks,
Sarayoodharan.K -
Hi, I've checked how to use Kannada keyboard in Yosemite. But, there are some 'vattu forms' and other grammar in Kannada language that I don't know how to use it. I know how to change between the keyboards and can also view keyboard. However, For eg, 'Preetiya taatanige nimma muddu mommagalu maduva namaskara' How to write this? If anybody can answer this, very much appreciated.
Thanks in advance for your reply.In general, you need to use the "f" (kannada qwerty keyboard) or "d" key (kannada) between letters to make special forms. Also you may need to adjust the typography settings of the font, which is done by doing Format > Font > Show Fonts > Gear Wheel > Typography as shown below. If you can provide screenshots or more detailed info on things you cannot make, I can perhaps help.
It is important to note that MS Word for Mac does not support Indic scripts -- any other app should work OK. -
Anyone knows how to make this code to netbeans??
anyone knows how to make this code to netbeans?? i just want to convert it into netbeans... im not really advance with this software... anyway..just reply if you have any idea...or steps how to build it... etc.... thanks guys...
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;
import java.util.regex.*;
public class FilterTable {
public static void main(String args[]) {
Runnable runner = new Runnable() {
public void run() {
JFrame frame = new JFrame("Sorting JTable");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Object rows[][] = {
{"AMZN", "Amazon", 41.28},
{"EBAY", "eBay", 41.57},
{"GOOG", "Google", 388.33},
{"MSFT", "Microsoft", 26.56},
{"NOK", "Nokia Corp", 17.13},
{"ORCL", "Oracle Corp.", 12.52},
{"SUNW", "Sun Microsystems", 3.86},
{"TWX", "Time Warner", 17.66},
{"VOD", "Vodafone Group", 26.02},
{"YHOO", "Yahoo!", 37.69}
Object columns[] = {"Symbol", "Name", "Price"};
TableModel model =
new DefaultTableModel(rows, columns) {
public Class getColumnClass(int column) {
Class returnValue;
if ((column >= 0) && (column < getColumnCount())) {
returnValue = getValueAt(0, column).getClass();
} else {
returnValue = Object.class;
return returnValue;
JTable table = new JTable(model);
final TableRowSorter<TableModel> sorter =
new TableRowSorter<TableModel>(model);
table.setRowSorter(sorter);
JScrollPane pane = new JScrollPane(table);
frame.add(pane, BorderLayout.CENTER);
JPanel panel = new JPanel(new BorderLayout());
JLabel label = new JLabel("Filter");
panel.add(label, BorderLayout.WEST);
final JTextField filterText =
new JTextField("SUN");
panel.add(filterText, BorderLayout.CENTER);
frame.add(panel, BorderLayout.NORTH);
JButton button = new JButton("Filter");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String text = filterText.getText();
if (text.length() == 0) {
sorter.setRowFilter(null);
} else {
try {
sorter.setRowFilter(
RowFilter.regexFilter(text));
} catch (PatternSyntaxException pse) {
System.err.println("Bad regex pattern");
frame.add(button, BorderLayout.SOUTH);
frame.setSize(300, 250);
frame.setVisible(true);
EventQueue.invokeLater(runner);
}its okay onmosh.....what we need to
this...forum....is to have a good......relationship
of programmers......and to start with .....we need to
have a good attitude........right.....???.....no
matter how good you are in programming but if you did
not posses the right kind of attitude....everything
is useless.....in the first place....all we
want....is just to ask...some....help....but
conflicts......but unluckily......we did not expect
that there are members in here which......not
good...to follow.....just as suggestion for those
people not having the right kind of attidude...why
can't you do in a very nice message sharing in a very
nice....way....why we need to put some
stupid....stuff...words.....can't you live with out
******* ****....its not.....lastly especially you
have your children right now and people around...that
somehow......idiolize...you even me....is one of
them......but showing but attitude....is not
good......tnx....hope you'll take it this....in the
positive side.....be optimistic...guys....the
world..is not yours....all of us will just past
away....always..remember that one.....treasure..our
stay in this....temporary home.....which...is
world....Whoa. That post seems to be killing my brain.
URK
Join........us..........do not be..........afraid....... -
i can not find information about how to write agal2 coding.
conditional forward jump code 'IFE' or 'ELS', 'EIF'... I cant know how to write agal code.
and how to use Fragment depth.
please give me writing agal code, or lecture page.In addition to Gary's excellent blog posts that Anton references, we also have these posts created by the developers that implemented these features:
Stage3D “standard” profile
Relaxing Render Target Clear operation in Stage3D
Maybe you are looking for
-
New imac to tv help: mDVI to DVI cable, DVI to component video adapter?
I am getting my new imac tomorrow, very excited. I would love to be able to hook it up to my HD tv which has component video inputs. It has two by the way, one says component video, one says component video HD. (that's the one my xbox is hooked up to
-
Re: loop condition using length
Hi friends, in a loop condition i am using below coding. LOOP AT I_FORM1 INTO W_FORM1. A = STRLEN( W_FORM1-LOTNO ). LOOP AT I_AUFM INTO W_AUFM WHERE CHARG+0(A) = W_FORM1-LOTNO. ENDLOOP. ENDLOOP. But coming error is The length specification "(A)" is n
-
Itunes crashes after download apps
AFter I try to download a app, Itunes crashes and then when I restart the downloaded app is gone.
-
Adding PHP to transformer.xslt
Specifically I would like to add a php function to the header of the individual images page and echo a call to it later in the page. I can't get the php formated properly for this. Do I add it in as a simple xsl string since xml does not understand p
-
Composite Planning Forms Rule Logic
Hi, I have a composite form. Now I select an entity on form 1. Enter some numbers. On form 2, I select some other entity and enter some numbers. Now I have a logic that should calculate based on the entities i have selected on the two forms. Is it po