Need Help With Home Please
If anyone here is good with Java, I need serious help with my homework, please give me your instant messenger screen name and we can chat, thanks alot!!
Angela
I don't understand how people get themselves into
these situations as school, if you don't want to learn
it don't sign up for the class.....You never got yourself into this situation.... I think everyone has on occassion.
My very first "serious" university program was to solve a second order, non-linear differential equation using the Runge-Kutta method. This is NOT the easy way to learn a computer language and I have to admit I did take "shortcuts" using more experienced people than me.
That was before the web though...
God am I really that old?
Similar Messages
-
I have need help with something Please respond Quickly :)
I have need help with something Please respond Quickly ok so i have the linksys wrt54g Version 2.2 and i upgraded the firmware to V4.21.4 from this site http://homesupport.cisco.com/en-us/wireless/lbc/WRT54G and i clicked V2.2 for the router. So after i upgraded i lost internet ability i can't use the internet so i had to downgrade back to V4.21.1 but i want the things that newer update sloves. Please Help. Everything thing says DNS error? aka Modem.
$$Cgibbons$$Ya i tried that i tried restoring and redoing everything when i downgrade back to .1 it works fine though?
$$Cgibbons$$ -
Need help with home work see what you got
1. The MEMBERS table has the phone number broken into three fields:
CountryCode - e,g., '1' for the United States
AreaCode - e.g., three digits for the United States
Phone - e.g., 7 digits, with or without a dash between the first three digits (Exchange) and last four digits (Line)
Any or all of the fields may be missing (null) or blank or contain only spaces.
Write a T-SQL statement to concatenate the three fields into a complete phone number
with the format: CountryCode(AreaCode)Exchange-Line, e.g., 1(816)123-4567
If no Phone is present, return a blank string.
If no area code is present, return only the Phone number. Do not return an empty pair of parentheses or the CountryCode.
2. The PERSON_CAMPAIGN table contains a row for each war/conflict the member served in. A member may have served in multiple conflicts
For this purpose, each row contains:
PersonID - unique member identifier
Campaign - name of war/conflict
Write a T-SQL statement to return one row per member with all campaigns concatenated into a single field and separated by commas
E.g., PersonID Campaigns
12345678 Global War on Terror, Iraq, Afghanistan
3. The MEMBER_STATISTICS table contains one row per post.
For this purpose, each row contains the post's:
Division - a way of grouping posts by their member size
Department - the state in which the post is located
PostNumber - unique post identifier
Reinstated - count of members whose annual subscription had lapsed for at least two years but who have now subscribed for the current year
Write a T-SQL statement to determine the top ten posts in each division based on the number of reinstated members, with a minimum of 50 reinstated members.
Rank them by highest to lowest reinstated count.
Return their Division, Rank, Department, PostNumber, ReinstatedI got 3 home work questions think i have the first two need help with the last one please.
Kinda stuck on #3 hard I can see data not sure witch to sum or count?
1. The MEMBERS table has the phone number broken into three fields:
CountryCode - e,g., '1' for the United States
AreaCode - e.g., three digits for the United States
Phone - e.g., 7 digits, with or without a dash between the first three digits (Exchange) and last four digits (Line)
Any or all of the fields may be missing (null) or blank or contain only spaces.
Write a T-SQL statement to concatenate the three fields into a complete phone number
with the format: CountryCode(AreaCode)Exchange-Line, e.g., 1(816)123-4567
If no Phone is present, return a blank string.
If no area code is present, return only the Phone number. Do not return an empty pair of parentheses or the CountryCode.
ANSWER******************
Notes: created a funtion to format the phone
Then used the this function in a select to concatenate Phone
CREATE FUNCTION dbo.FORMATPHONE (@CountryCode int, @AreCode int, @Phone VARCHAR(14))
RETURNS VARCHAR(14)
AS BEGIN
DECLARE @ReturnPhone VARCHAR(14)
DECLARE @NewPhone VARCHAR(14)
-- Note case sets newphone to null if phone null or '' also to see if phone has '-' in it if not inserts into newphone
case
when @Phone is null or @Phone = ''
Then SET @NewPhone = Null
when @Phone = substring(@Phone,4,1)='-'
Then SET @NewPhone = @Phone
else
SET @NewPhone = substring(@Phone,1,3)+'-'+ substring(@Phone,4,4)
End
case
when @NewPhone is null then SET @ReturnPhone = @NewPhone
elese case
when @AreCode is null or @AreCode = '' then SET @ReturnPhone = @NewPhone
else
SET @ReturnPhone = @CountryCode + '(' + @AreCode + ')' + @NewPhone
END
END
RETURN @ReturnPhone
END
select dbo.FORMATPHONE(CountryCode,AreCode,Phone)
from MEMBERS
2. The PERSON_CAMPAIGN table contains a row for each war/conflict the member served in. A member may have served in multiple conflicts
For this purpose, each row contains:
PersonID - unique member identifier
Campaign - name of war/conflict
Write a T-SQL statement to return one row per member with all campaigns concatenated into a single field and separated by commas
E.g., PersonID Campaigns
12345678 Global War on Terror, Iraq, Afghanistan
ANSWER******************
SELECT PersonID,
STUFF(( SELECT ',' + Campaign AS [text()]
FROM PERSON_CAMPAIGN
WHERE (PersonID = Results.ID)
FOR XML PATH('')
), 1, 1, '' )
AS Campaigns
FROM PERSON_CAMPAIGN Results
3. The MEMBER_STATISTICS table contains one row per post.
For this purpose, each row contains the post's:
Division - a way of grouping posts by their member size
Department - the state in which the post is located
PostNumber - unique post identifier
Reinstated - count of members whose annual subscription had lapsed for at least two years but who have now subscribed for the current year
Write a T-SQL statement to determine the top ten posts in each division based on the number of reinstated members, with a minimum of 50 reinstated members.
Rank them by highest to lowest reinstated count.
Return their Division, Rank, Department, PostNumber, Reinstated -
Need help with Fancybox please
Hola
I need some help with Fancybox.
I bought this template and it came without facybox, so I thought
that this will be a great help to learn some about jQuerry, but I'm lost
Why is NOT working on my page?
I just cannot figure this out.
Can you please check my page?
http://tummytime.biz/pages/portfolio_fancy.html
I got Windows 8, Dreamweaver CC
Thanks a lot.There are a couple things that could be causing a couple browsers' collective heads to implode.
Remove the <! right before your </head> tag...
</script>
<!
</head>
<body>
You have two calls to the fancybox css file, you only need one.
Aside from that I'm not seeing any code problems jump out at me.
EDIT: Ah, didn't scroll far enough. You have more than one reference to the jquery library. Typically, only one is needed and two or more will cause them all to fail. Usually, you can use the "latest" link and cover all your bases.
If you aren't using those referenced scripts at the bottom of your page, delete them. -
HT3702 need help with purchase please!!!
My husband mistakenly hit the purchase button las night for an apple app and now it has been taken out of our account, but was deleted off the phone as soon has he realized that he hit the purchase button how do we get a refund please we need HELP!!!
All sales are final
You can try contacting itunes and asking for an exception -
javax.servlet.ServletException
at com.evermind.server.http.EvermindPageContext.handlePageThrowable(EvermindPageContext.java:595)
at com.evermind.server.http.EvermindPageContext.handlePageException(EvermindPageContext.java:537)
at jsp.addservice._jspService(addservice.jsp:515)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:847)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:229)
at mil.usmc.m4l.servlets.M4LServlet.forward(M4LServlet.java:34)
at mil.usmc.m4l.servlets.EditService.doGet(EditService.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at mil.usmc.m4l.filters.M4LCMSFilter.doFilter(M4LCMSFilter.java:150)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
Edited by: user11237193 on Apr 27, 2010 10:58 AM
I am getting error and I ned help with it Thank you for your help.I'd enter the dell service tags in here to find out what OS the pc was designed for.
http://www.dell.com/support/contents/us/en/19/Category/Product-Support/Self-support-Knowledgebase/locate-service-tag?~ck=mn
For windows I'd ask over here.
http://answers.microsoft.com/en-us/windows
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
Need help with debugging PLEASE
Hi,
I'm new to Java and was given an assignment to debug a program. I am completely lost and really havent gone over most of the stuff that is in this program. I would greatly appreciate any help with this that I can get.
Here is my code:
import java.util.*;
import javax.swing.*;
public class IndexHitFrequency
private final int NUMBER_OF_SIMULATIONS = 1000;
private int indexHit[] = new int [10];
public IndexHitFrequency()
Random generator = new Random(); // for generating random number
int array[] = {6, 2, 4, 8, 5, 0, 1, 7, 3, 9 };
//convert to ArrayList and sort it
List list = new ArrayList(Arrays.asList(array));
for (int i = 0; i < NUMBER_OF_SIMULATIONS; i++)
//generate random number
int randomNumber = generator.nextInt(array.length);
// get index hit
int index = Collections.binarySearch(list, randomNumber) ;
// save index hit to array
if(index > -1)
indexHit[index]++;
}//end for
String output = "Index\tFrequency\t\n";
//append the frequency of index hit to output
for (int i = 0; i < indexHit.length; i++)
output += i + "\t" + indexHit[i] + "\t\n";
//display result
JTextArea outputArea = new JTextArea();
outputArea.setText(output);
JOptionPane.showMessageDialog(null, outputArea, "Search random number 1000 times" ,
JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}// end constructor
public static void main (String [] args)
new IndexHitFrequency();
} // end class IndexHitFrequency
I get these errors after trying to compile:
"IndexHitFrequency.java": Error #: 300 : method asList(int[]) not found in class java.util.Arrays at line 17, column 40
"IndexHitFrequency.java": Error #: 300 : method binarySearch(java.util.List, int) not found in class java.util.Collections at line 24, column 34C:\Java\Tutorial\rem>javac IndexHitFrequency.java
IndexHitFrequency.java:15: asList(java.lang.Object[]) in java.util.Arrays cannot
be applied to (int[])
List list = new ArrayList(Arrays.asList(array));
^
IndexHitFrequency.java:22: cannot find symbol
symbol : method binarySearch(java.util.List,int)
location: class java.util.Collections
int index = Collections.binarySearch(list, randomNumber) ;
^
2 errors
C:\Java\Tutorial\rem>Copied source and compiled in DOS window ( XP's cmd.exe) and got these error messages...
I think these error are more clear than the ones you posted, so this should help you resolve the problem...
- MaxxDmg...
- ' He who never sleeps... ' -
Need help with home ad rotator webapp please
i am trying to add text below the header in this home page ad rotator
this is where i set up the ad rotator. shouldn't that description text be showing up underneath the word "synergies?"
can you tell me what i am doing wrong? i am completely lost on this one.
thanks!Hello again,
It's a css issue: one of the margin values is set to 415 px (.intro-a div.two ul.items li span)
http://screencasteu.worldsecuresystems.com/AP/2013-06-20_1031.swf
Kind Regards,
Alex -
New to itunes and need help with library please
some of my albums have various artists. i cant get them to show up as 1 album it shows as an album for every song. can anyone help me please?
another problem i am having is my album artwork does not show up when I insert a cd to rip. I am also having trouble with the itunes suddenly getting all garbled up so i cant even see the screen untill I close itunes and open it back up. grrrr!! i sold my Zune to get this ipod touch and am wondering if I have made a mistake.
thanks for any help you can give me
Carriaccording to you we are on the same page here. When you rip a regular cd into itunes, it does not have the album artwork engrained into the song file. This is just an example, Say you ripped a Metallica cd into itunes such as "Master of Puppets." The song on the album "Disposable Heroes" will not have the album artwork with it.
You need to get an apple account, just go to the itunes store and sign up. After you do that you can click on one of the songs from the album you ripped. Right click it, and go to the choice "get album artwork". itunes will automatically modify the artwork for all the songs on that album. That is it. I may have a post later on your other problems. Ask me if you don't fully understand what i said. -
I need help with hyperlink PLEASE!!!!!!!
I hope somebody can help me with this question. I create some
button in flash 8. My web page is divided in three frames( using
the frame tag), two rows and the second row has two colums. My
question is how can i make one of my buttons to open a new web page
but in a different frame. The button is in column number 1 of row 2
and when the user click this button i want that this new page open
in column number 2 of row 2. How can ia do that? please help
mevalla23 wrote:
> I hope somebody can help me with this question. I create
some button in flash
> 8. My web page is divided in three frames( using the
frame tag), two rows and
> the second row has two colums. My question is how can i
make one of my buttons
> to open a new web page but in a different frame. The
button is in column number
> 1 of row 2 and when the user click this button i want
that this new page open
> in column number 2 of row 2. How can ia do that? please
help me
Always best to google before posting, especially if you
urgent to meet deadline.
Forum archives:
http://groups.google.com/advanced_group_search?q=group:macromedia.flash.*&hl=en&lr=&ie=UTF -8
Search "flash in frames"
the very second result, so happen to be from me, exhaling
exactly how to set it up.
http://groups.google.com/group/macromedia.flash/browse_thread/thread/6b0047b0a65be8a0/9f8f c0765bf2297e?lnk=st&q=&rnum=2&hl=en#9f8fc0765bf2297e
Personally posted that couple of hundreds of times in past 8
years.
Please try to utilize the search before posting so we don't
need to hammer same
topic over and over and over and over and over .....again...
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
Happy New Year
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Need help with dates please-urgent
Hi folks, please help me with this if you can.
I run a weekly job, and need to have my java code create and use 2 dates to capture data for the whole week.
begin_date mm/dd/yyyy (String) to be 7 days prior to current date
end_date mm/dd/yyyy (String) to be the currecnt date
Note: please take into account the cases where the CURRENT_DATE is the first week of the month. As a result the 7 days prior will fall into the previous month. i.e if end_date="06/04/2003" then the begin_date will be "05/29/2003 Thanks a bunchhttp://java.sun.com/j2se/1.4.1/docs/api/index.html
See the Calendar and DateFormat classes. -
I am a new MAC user. So please, if you have a solution for me, speak slowly. (LOL)
I have the new G5. Bought the Epson printer to go with it. It's the CX4200.
I loaded the software for it. But can't get it to print. It seems the computer won't or can't find it in their list of printers.
Ok, so I go to a Word Doc., for example. And select print. The window says that I need to select a printer. I hit the arrow down button and there's my printer listed. So I choose that, but still won't print. Seems I have to go down to another line in the same box and find the printer in this long list. There are many Epsons listed but not mine, which is the CX4200.
And darn-it, tech support on the phone is closed at 6pm!!!??? I sure hope to see a reply soon. I really need to print something tonight.
Thanks for any help you can provide.
My personal e-mail is
[email protected]
Thanks!
Cary
PS: This process asked me to choose an OS for my G5. I have no idea what my OS is. All's I know is I have a G5. Gosh, I feel soooo dumb!What have you done so far?
I suggest you connect it via a usb cable first. Once you get the printer working, move to wifi. You will have to use an existing printer usb cable or purchase a cable. Be sure to get the correct cable. Ask for help.
The warrenty indicates there is phone support. Give HP a call.
Warranty
One-year limited hardware warranty; 24-hour, 7 days a week phone support
Robert -
Need help with Program Please!
// Name: John Weir 02/03/2006
Please read the comments as they will explain what help I need.
All help greatly appreciated! Am new to working with GUI.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class FeverDiagnosis extends JFrame
// diagnoisis constants
private final String MENIGITIS = "menigitis";
private final String DIGESTIVE_TRACT_INFECTION = "digestive tract infection";
private final String PNEUMONIA_OR_AIRWAYS_INFECTION ="pneumonia or airways infection";
private final String VIRAL_INFECTION = "viral infection";
private final String THROAT_INFECTION = "throat infection";
private final String KIDNEY_INFECTION = "kidney infection";
private final String URINARY_INFECTION = "urinary tract infection";
private final String SUNSTROKE_OR_HEAT_EXHAUSTION = "sunstroke or heat exhaustion";
// symptom constants
private final String FEVER = "fever";
private final String COUGHING = "coughing";
private final String HEADACHE = "headache";
private final String BREATHING_WITH_DIFFICULTY = "shortness of breath, wheezing, or coughing up phlegm";
private final String ACHING_BONES_JOINTS = "aching bones or joints";
private final String RASH = "rash";
private final String SORE_THROAT = "sore throat";
private final String BACK_PAIN_AND_CHILLS_AND_FEVER = "back pain just above the waist with chills and fever";
private final String URINARY_DIFFICULTY = "pain urinating or are urinating more often";
private final String TOO_MUCH_SUN = "sun overexposure due to spending the day in the sun or in hot conditions";
public final String VOMITING_OR_DIARRHEA = "vomitting spell or diarrhea";
private final String MENIGITIS_POSSIBILITIES =
"pain when bending your head forward,\n"
+ " nausea or vomiting, eye ache from \n"
+ " bright lights, drowsiness or confusion";
// GUI varibles
private JTextArea textArea;
private JFrame theFrame;
private JLabel stuff2;
private JButton b1;
private JButton b2;
// instance variable
private String symptoms = "";
private Scanner cin = new Scanner (System.in);
char response;
String input;
public FeverDiagnosis()
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame theFrame = new JFrame("John Weir");
theFrame.setSize(650, 400);
Dimension frameSize = theFrame.getSize();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
theFrame.setLocation((screenSize.width - frameSize.width)/2,(screenSize.height - frameSize.height)/2);
theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = theFrame.getContentPane();
theFrame.getContentPane().setLayout(new FlowLayout());
JLabel stuff2 = new JLabel("Test");
textArea = new JTextArea(12,50);
textArea.setEditable(true);
textArea.setBackground(Color.black);
textArea.setForeground(Color.green);
textArea.setFont(new Font("Serif", Font.ITALIC, 16));
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
b1 = new JButton("Yes");
b2 = new JButton("No");
contentPane.add(stuff2);
contentPane.add(new JScrollPane(textArea));
contentPane.add(b1);
b1.setEnabled(true);
contentPane.add(b2);
b2.setEnabled(true);
ActionListener l = new ActionListener()
public void actionPerformed(ActionEvent e)
if((e.getSource() == b1))
// HELP NEEDED
// NEED BUTTON TO PASS
// STRING VALUE "Y" TO
// METHOD: have(String s)
input.equals("y");
else
if((e.getSource() == b2))
b1.addActionListener(l);
b2.addActionListener(l);
theFrame.setVisible(true);
theRules();
public void theRules()
displayNote();
if (! have(FEVER) )
displayUnsure();
else
if(are(COUGHING))
if( are(BREATHING_WITH_DIFFICULTY))
addSymptom( PNEUMONIA_OR_AIRWAYS_INFECTION );
displayDiagnosis(PNEUMONIA_OR_AIRWAYS_INFECTION);
}else
if(have(HEADACHE))
addSymptom( VIRAL_INFECTION );
displayDiagnosis(VIRAL_INFECTION);
}else
if(have(ACHING_BONES_JOINTS))
addSymptom( VIRAL_INFECTION );
displayDiagnosis(VIRAL_INFECTION);
}else
if(have(RASH))
displayUnsure();
}else
if(have(SORE_THROAT))
addSymptom( THROAT_INFECTION );
displayDiagnosis(THROAT_INFECTION);
}else
if(have(BACK_PAIN_AND_CHILLS_AND_FEVER))
addSymptom( KIDNEY_INFECTION );
displayDiagnosis(KIDNEY_INFECTION);
}else
if(have(URINARY_DIFFICULTY))
addSymptom( URINARY_INFECTION );
displayDiagnosis(URINARY_INFECTION);
}else
if(have(TOO_MUCH_SUN))
addSymptom( SUNSTROKE_OR_HEAT_EXHAUSTION );
displayDiagnosis(SUNSTROKE_OR_HEAT_EXHAUSTION);
}else
displayUnsure();
else
if(have(HEADACHE))
addSymptom(VIRAL_INFECTION);
displayDiagnosis(VIRAL_INFECTION);
}else
if(are(MENIGITIS_POSSIBILITIES))
addSymptom( MENIGITIS );
displayDiagnosis(MENIGITIS);
}else
if(are(VOMITING_OR_DIARRHEA))
addSymptom( DIGESTIVE_TRACT_INFECTION );
displayDiagnosis(DIGESTIVE_TRACT_INFECTION);
}else
displayUnsure();
public void displayNote()
textArea.append("\n\n"
+ "Fever Diagnostic Tool\n"
+ "---------------------\n\n"
+ "Please note that this program performs no true diagnostic activity.\n"
+ "No decisions should be made based upon the tool's analysis. If users\n"
+ "have a fever, they should contact their doctor.\n\n");
public boolean have(String s)
// prompt and extract
textArea.append("Do you have you " + s + " (y, n): " + "\n");
// NEED BUTTON TO PASS STRING FROM ActionPerformed
// AND HAVE IT RETURNED AS A CHAR RESPONCE!
input = cin.nextLine();
response = (char) Character.toLowerCase(input.charAt(0));
while ( (response != 'y') && (response != 'n') )
textArea.append("Are you " + s + " (y, n): " + "\n");
input = cin.nextLine();
response = (char) Character.toLowerCase(input.charAt(0));
textArea.append("");
return response == 'y';
private boolean are(String s)
textArea.append("Are you " + s + " (y, n): " + "\n");
input = cin.nextLine();
char response = (char) Character.toLowerCase(input.charAt(0));
while ( (response != 'y') && (response != 'n') )
textArea.append("Are you " + s + " (y, n): " + "\n");
input = cin.nextLine();
response = (char) Character.toLowerCase(input.charAt(0));
textArea.append("");
return response == 'y';
public void addSymptom(String s)
symptoms += "* " + s + "\n";
public void displayDiagnosis(String diagnosis)
textArea.setText("");
textArea.append("\nSymptoms:\n" + symptoms + "\n" + "Diagnosis"
+ "\n Possibilities include " + diagnosis + "\n");
textArea.append("\n");
//System.exit(0);
public void displayUnsure()
textArea.append("\nInsufficient information to make a diagnosis" + "\n");
textArea.append("\n");
//System.exit(0);
public static void main(String[] args)
new FeverDiagnosis();
}If you're looking to use a JTextArea as a console you can use these two classes
you are free to use and modify these classes but please do not change the package or take credit for it as your own work.
TextAreaReader.java
=================
* Created on Jul 7, 2005 by @author Tom Jacobs
package tjacobs;
import java.awt.TextArea;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.TextEvent;
import java.awt.event.TextListener;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class TextAreaReader extends Reader implements KeyListener {
JTextArea mJArea;
TextArea mAWTArea;
Object mKeyLock = new Object();
Object mLineLock = new Object();
String mLastLine;
int mLastKeyCode = 1;
public TextAreaReader(JTextArea area) {
super();
mJArea = area;
mJArea.addKeyListener(this);
public TextAreaReader(TextArea area) {
super();
mAWTArea = area;
mAWTArea.addKeyListener(this);
public void keyPressed(KeyEvent ke) {
mLastKeyCode = ke.getKeyCode();
synchronized(mKeyLock) {
mKeyLock.notifyAll();
if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
if (mJArea != null) {
String txt = mJArea.getText();
int idx = txt.lastIndexOf('\n', mJArea.getCaretPosition() - 1);
mLastLine = txt.substring(idx != -1 ? idx : 0, mJArea.getCaretPosition());//txt.length());
synchronized(mLineLock) {
mLineLock.notifyAll();
else {
String txt = mAWTArea.getText();
int idx = txt.lastIndexOf('\n', mAWTArea.getCaretPosition() - 1);
mLastLine = txt.substring(idx != -1 ? idx : 0, mAWTArea.getCaretPosition());//txt.length());
synchronized(mLineLock) {
mLineLock.notifyAll();
public void keyReleased(KeyEvent ke) {
public void keyTyped(KeyEvent ke) {
public int read(char[] arg0, int arg1, int arg2) throws IOException {
throw new IOException("Not supported");
public String readLine() {
synchronized(mLineLock) {
try {
mLineLock.wait();
catch (InterruptedException ex) {
return mLastLine;
public int read() {
synchronized(mKeyLock) {
try {
mKeyLock.wait();
catch (InterruptedException ex) {
return mLastKeyCode;
public void close() throws IOException {
// TODO Auto-generated method stub
public static void main(String args[]) {
JFrame f = new JFrame("TextAreaInput Test");
JTextArea area = new JTextArea();
final TextAreaReader tar = new TextAreaReader(area);
f.add(area);
Runnable r1 = new Runnable() {
public void run() {
while (true) {
int code = tar.read();
System.out.println("read: " + code);
Runnable r2 = new Runnable() {
public void run() {
while (true) {
String line = tar.readLine();
System.out.println("read line: " + line);
Thread t1 = new Thread(r1);
Thread t2 = new Thread(r2);
t1.start();
t2.start();
f.setBounds(100, 100, 200, 200);
f.setVisible(true);
public InputStream toInputStream() {
return new MyInputStream();
private class MyInputStream extends InputStream {
public int read() {
return TextAreaReader.this.read();
==================
TextAreaOutputStream
==================
* Created on Mar 13, 2005 by @author Tom Jacobs
package tjacobs;
import java.io.IOException;
import java.io.OutputStream;
import javax.swing.JTextArea;
import javax.swing.text.JTextComponent;
public class TextAreaOutputStream extends OutputStream {
public static final int DEFAULT_BUFFER_SIZE = 1;
JTextArea mText;
byte mBuf[];
int mLocation;
public TextAreaOutputStream(JTextArea component) {
this(component, DEFAULT_BUFFER_SIZE);
public TextAreaOutputStream(JTextArea component, int bufferSize) {
mText = component;
if (bufferSize < 1) bufferSize = 1;
mBuf = new byte[bufferSize];
mLocation = 0;
@Override
public void write(int arg0) throws IOException {
//System.err.println("arg = " + (char) arg0);
mBuf[mLocation++] = (byte)arg0;
if (mLocation == mBuf.length) {
flush();
public void flush() {
mText.append(new String(mBuf, 0, mLocation));
mLocation = 0;
try {
Thread.sleep(1);
catch (Exception ex) {}
} -
AE "newbie" needs help with effect - (please!)
Hi all:
I'm working on a highlight video of my daughter - she's the goalie for her H.S. Lacrosse team. I recently bought the Creative Cloud subscription. I'm editing the video in Premiere Pro CC on an iMac - OSX 10.7.5.
I'm putting together a short intro/open, and trying to add some effect to my daughter in the clip shown below. She is running/jumping - I want to be able to isolate just her and add some sort of color effect, a glow (or even just make everything else b&w). Obviously, my problem is with masking or roto brushing. I've spent many hours (probably too many!) watching tutorials and reading the help articles -- and I just can't seem to get it right. I saw a video talking about the much anticipated October update - and wondering if the new Mask Tracker will do what I need/want?
Here is the clip - (my daughter is #11 - the only one wearing a helmet)
Thanks in advance for any guidance/help/suggestions you can provide,
KimThanks again for pointing me in the direction of the Motion Tracking and Rotoscoping tutorial.
I successfully (in my opinion, anyway!) was able to apply an effect to the moving object (my daughter ). There are a few places that I could tighten up the mask, but it's not too bad - and I just realized I forgot to feather the mask - so that will help as well.
I tried a bunch of different effects -- but really wasn't happy with any of them. I went ahead and just made her B&W just for illustrative purposes.
What I'd really like to do is make the background B&W and keep her in color.
I tried applying the B&W effect onto the footage layer -- but it seemed to make everything b&w - including my masked/rotoscoped object. I am sure that it is very simple to do -- but haven't been able to find the right instructions.
(I looped the clip a few times - since it is only about 1.5 seconds long)..
So - again - thanks in advance for helping me figure out how to apply the B&W to just the background!
Kim -
Hello all,
i created some accountlists for accountclasses:
"Kontenklasse_2" is one of my accountlists and it contains all accounts wich begin with a 2 or H2.
So i have an account called "sum_kokl2" and for this i want to calculate the sum of all accounts included in my accountlist "Kontenklasse_2" but i don´t know how.
I hope someone can help me, many thanks in advance.
Martin
Edited by: user7324125 on 21.01.2010 17:06Hello kostasn,
thanks for you post, i tried it but it doesn´t work.
I am sure that my memberlists are accurate, if i use one in my data grid, i gett all correct accounts which must be in the selected accountlist.
Perhaps the difficulty is where i want to calculate the sum. I try to describe more detailed:
I have an entity structure for our companies, for each parent of my entity structure i need a sum of all accounts which begin with a 2. So i wrote an accountlist which include all these accounts and named it "Kontenklasse_2". I try your written code and change the necessary parts. For this accountlist i only use the custom2 dimension all other is None. I don´t use ICP. The calculated account is named sum_kokl2 but neither my base entities nor the parent entities show me any values on the account sum_kokl2. So i think somewhere i forgot an important line in my rulefile.
Perhaps do you have another idea where is my bug? I´m happy for every help and idea.
Many thanks for every help in advance.
Kind regards / Best wishes
Martin
Btw my used Version is HFM Version 11.1.1.3, i used EPMA-Applications, the Windows-Client is installed to use the rules editor and SmartView 11 is already installed.
Maybe you are looking for
-
Messages not working since HDD replacement
Hello! So my MBPr stopped booting a week ago and I had to have both fans, the motherboard, HDD, and back plate replaced. That's done, everything works now except Messages. I rely on messages to communicate with my team and my family, so this is a b
-
Why to save standard texts in customization requests only?
Hi Experts, I have copied standard text of SAP SCRIPTfrom one system to other development system through the report RSTXSCRP.But I want to save the standard text in Transport Request. I have tried to do it by using report RSTXTRAN.But Its asking for
-
hi all Anybody can help with the Timestamp constructor, which can come up with this answer exacly like this one... Here are the source code. java.util.Date my = new java.util.Date(); String myString; DateFormat df = DateFormat.getDate
-
Error when manually selecting ship-to in sales orders
For my project, I've a scenario like this way: 1. enter transaction code VA01 2. enter order type ZPEA 3. press enter 4. enter sold-to number "1234" 5. press enter 6. deleted the defaulted ship-to number "1234" 7. enter ship-to number "5678" 8. press
-
We have mac os x 10.6.8 I wanted to load iCloud but it is not in system preferences. Does that mean I cannot add it to my imac? If I can, what do I need to do?