Why does this class not read and write at same time???
I had another thread where i was trying to combine two class files together
http://forum.java.sun.com/thread.jspa?threadID=5146796
I managed to do it myself but when i run the file it does not work right. If i write a file then try and open the file it says there are no records in the file, but if i close the gui down and open the file everything get read in as normal can anybody tell me why?
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import bank.BankUI;
import bank.*;
public class testing extends JFrame {
private ObjectOutputStream output;
private BankUI userInterface;
private JButton SaveToFile, SaveAs, Exit; //////////savetofile also saves to store need to split up and have 2 buttons
//private Store store; MIGHT BE SOMETHING TO DO WITH THIS AS I HAD TO COMMENT THIS STORE OUT TO GET IT WORKING AS STORE IS USED BELOW
private Employee record;
//////////////////////////////////////from read
private ObjectInputStream input;
private JButton nextButton, openButton, nextRecordButton ;
private Store store = new Store(100);
private Employee employeeList[] = new Employee[100];
private int count = 0, next = 0;
/////////////////////////////////////////////from read end
// set up GUI
public testing()
super( "Employee Data" ); // appears in top of gui
// create instance of reusable user interface
userInterface = new BankUI( 9 ); // nine textfields
getContentPane().add( userInterface, BorderLayout.CENTER );
// configure button doTask1 for use in this program
SaveAs = userInterface.getSaveAsButton();
SaveAs.setText( "Save as.." );
//////////////////from read
openButton = userInterface.getOpenFileButton();
openButton.setText( "Open File" );
openButton.addActionListener(
// anonymous inner class to handle openButton event
new ActionListener() {
// close file and terminate application
public void actionPerformed( ActionEvent event )
openFile();
} // end anonymous inner class
); // end call to addActionListener
// register window listener for window closing event
addWindowListener(
// anonymous inner class to handle windowClosing event
new WindowAdapter() {
// close file and terminate application
public void windowClosing( WindowEvent event )
if ( input != null )
closeFile();
System.exit( 0 );
} // end anonymous inner class
); // end call to addWindowListener
// get reference to generic task button doTask2 from BankUI
nextButton = userInterface.getDoTask2Button();
nextButton.setText( "Next Record" );
nextButton.setEnabled( false );
// register listener to call readRecord when button pressed
nextButton.addActionListener(
// anonymous inner class to handle nextRecord event
new ActionListener() {
// call readRecord when user clicks nextRecord
public void actionPerformed( ActionEvent event )
readRecord();
} // end anonymous inner class
); // end call to addActionListener
//get reference to generic task button do Task3 from BankUI
// get reference to generic task button doTask3 from BankUI
nextRecordButton = userInterface.getDoTask3Button();
nextRecordButton.setText( "Get Next Record" );
nextRecordButton.setEnabled( false );
// register listener to call readRecord when button pressed
nextRecordButton.addActionListener(
// anonymous inner class to handle nextRecord event
new ActionListener() {
// call readRecord when user clicks nextRecord
public void actionPerformed( ActionEvent event )
getNextRecord();
} // end anonymous inner class
); // end call to addActionListener
///////////from read end
// register listener to call openFile when button pressed
SaveAs.addActionListener(
// anonymous inner class to handle openButton event
new ActionListener() {
// call openFile when button pressed
public void actionPerformed( ActionEvent event )
SaveLocation();
} // end anonymous inner class
); // end call to addActionListener
// configure button doTask2 for use in this program
SaveToFile = userInterface.getSaveStoreToFileButton();
SaveToFile.setText( "Save to store and to file need to split this task up" );
SaveToFile.setEnabled( false ); // disable button
// register listener to call addRecord when button pressed
SaveToFile.addActionListener(
// anonymous inner class to handle enterButton event
new ActionListener() {
// call addRecord when button pressed
public void actionPerformed( ActionEvent event )
addRecord(); // NEED TO SPLIT UP SO DONT DO BOTH
} // end anonymous inner class
); // end call to addActionListener
Exit = userInterface.getExitAndSaveButton();
Exit.setText( "Exit " );
Exit.setEnabled( false ); // disable button
// register listener to call addRecord when button pressed
Exit.addActionListener(
// anonymous inner class to handle enterButton event
new ActionListener() {
// call addRecord when button pressed
public void actionPerformed( ActionEvent event )
addRecord(); // adds record to to file
closeFile(); // closes everything
} // end anonymous inner class
); // end call to addActionListener
// register window listener to handle window closing event
addWindowListener(
// anonymous inner class to handle windowClosing event
new WindowAdapter() {
// add current record in GUI to file, then close file
public void windowClosing( WindowEvent event )
if ( output != null )
addRecord();
closeFile();
} // end anonymous inner class
); // end call to addWindowListener
setSize( 600, 500 );
setVisible( true );
store = new Store(100);
} // end CreateSequentialFile constructor
// allow user to specify file name
////////////////from read
// enable user to select file to open
private void openFile()
// display file dialog so user can select file to open
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode( JFileChooser.FILES_ONLY );
int result = fileChooser.showOpenDialog( this );
// if user clicked Cancel button on dialog, return
if ( result == JFileChooser.CANCEL_OPTION )
return;
// obtain selected file
File fileName = fileChooser.getSelectedFile();
// display error if file name invalid
if ( fileName == null || fileName.getName().equals( "" ) )
JOptionPane.showMessageDialog( this, "Invalid File Name",
"Invalid File Name", JOptionPane.ERROR_MESSAGE );
else {
// open file
try {
input = new ObjectInputStream(
new FileInputStream( fileName ) );
openButton.setEnabled( false );
nextButton.setEnabled( true );
// process exceptions opening file
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error Opening File",
"Error", JOptionPane.ERROR_MESSAGE );
} // end else
} // end method openFile
public void readRecord() // need to merger with next record
Employee record;
// input the values from the file
try {
record = ( Employee ) input.readObject();
employeeList[count++]= record;
store.add(record);/////////ADDS record to Store
store.displayAll();
System.out.println("Count is " + store.getCount());
// create array of Strings to display in GUI
String values[] = {
String.valueOf(record.getName()),
String.valueOf(record.getGender()),
String.valueOf( record.getDateOfBirth()),
String.valueOf( record.getID()),
String.valueOf( record.getStartDate()),
String.valueOf( record.getSalary()),
String.valueOf( record.getAddress()),
String.valueOf( record.getNatInsNo()),
String.valueOf( record.getPhone())
// i added all those bits above split onto one line to look neater
// display record contents
userInterface.setFieldValues( values );
// display message when end-of-file reached
catch ( EOFException endOfFileException ) {
nextButton.setEnabled( false );
nextRecordButton.setEnabled( true );
JOptionPane.showMessageDialog( this, "No more records in file",
"End of File", JOptionPane.ERROR_MESSAGE );
// display error message if class is not found
catch ( ClassNotFoundException classNotFoundException ) {
JOptionPane.showMessageDialog( this, "Unable to create object",
"Class Not Found", JOptionPane.ERROR_MESSAGE );
// display error message if cannot read due to problem with file
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this,
"Error during read from file",
"Read Error", JOptionPane.ERROR_MESSAGE );
} // end method readRecord
private void getNextRecord()
Employee record = employeeList[next++%count];//cycles throught accounts
//create aray of string to display in GUI
String values[] = {String.valueOf(record.getName()),
String.valueOf(record.getGender()),
String.valueOf( record.getStartDate() ), String.valueOf( record.getAddress()),
String.valueOf( record.getNatInsNo()),
String.valueOf( record.getPhone()),
String.valueOf( record.getID() ),
String.valueOf( record.getDateOfBirth() ),
String.valueOf( record.getSalary() ) };
//display record contents
userInterface.setFieldValues(values);
//display record content
///////////////////////////////////from read end
private void SaveLocation()
// display file dialog, so user can choose file to open
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode( JFileChooser.FILES_ONLY );
int result = fileChooser.showSaveDialog( this );
// if user clicked Cancel button on dialog, return
if ( result == JFileChooser.CANCEL_OPTION )
return;
File fileName = fileChooser.getSelectedFile(); // get selected file
// display error if invalid
if ( fileName == null || fileName.getName().equals( "" ) )
JOptionPane.showMessageDialog( this, "Invalid File Name",
"Invalid File Name", JOptionPane.ERROR_MESSAGE );
else {
// open file
try {
output = new ObjectOutputStream(
new FileOutputStream( fileName ) );
SaveAs.setEnabled( false );
SaveToFile.setEnabled( true );
Exit.setEnabled( true );
// process exceptions from opening file
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error Opening File",
"Error", JOptionPane.ERROR_MESSAGE );
} // end else
} // end method openFile
// close file and terminate application
private void closeFile()
// close file
try {
//you want to cycle through each recordand add them to store here.
int storeSize = store.getCount();
for (int i = 0; i<storeSize;i++)
output.writeObject(store.elementAt(i));
output.close();
input.close();// from read!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
System.exit( 0 );
// process exceptions from closing file
catch( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error closing file",
"Error", JOptionPane.ERROR_MESSAGE );
System.exit( 1 );
} // end method closeFile
// add record to file
public void addRecord()
int employeeNumber = 0;
String fieldValues[] = userInterface.getFieldValues();
// if account field value is not empty
if ( ! fieldValues[ BankUI.IDNUMBER ].equals( "" ) ) {
// output values to file
try {
employeeNumber = Integer.parseInt(
fieldValues[ BankUI.IDNUMBER ] );
String dob = fieldValues[ BankUI.DOB ];
String[] dateofBirth = dob.split ("-"); // what used to put between number chnage to /
String sDate = fieldValues[ BankUI.START ];
String[] startDate = sDate.split ("-");
String sex = fieldValues[ BankUI.GENDER ];
char gender = (sex.charAt(0)); // check if m or f prob check in employee
if ( employeeNumber >= 0 ) {
/* create new record =String name, char gender, Date dob, String add, String nin, String phone, String id, Date start, float salary*/
record = new Employee(
fieldValues[ BankUI.NAME ],
gender,
new Date( Integer.parseInt(dateofBirth[0]),
Integer.parseInt(dateofBirth[1]),
Integer.parseInt(dateofBirth[2])),
fieldValues[ BankUI.ADDRESS ],
fieldValues[ BankUI.NATINTNO ],
fieldValues[ BankUI.PHONE ],
fieldValues[ BankUI.IDNUMBER ],
new Date( Integer.parseInt(startDate[0]),
Integer.parseInt(startDate[1]),
Integer.parseInt(startDate[2])),
Float.parseFloat( fieldValues[ BankUI.SALARY ] ));
if (!store.isFull())
store.add(record);
else
JOptionPane.showMessageDialog( this, "The Store is full you cannot add\n"+
"anymore employees. \nPlease Save Current File and Create a New File." );
System.out.println("Store full");
store.displayAll();
System.out.println("Count is " + store.getCount());
// output record and flush buffer
//output.writeObject( record );
output.flush();
else
JOptionPane.showMessageDialog( this,
"Account number must be greater than 0",
"Bad account number", JOptionPane.ERROR_MESSAGE );
// clear textfields
userInterface.clearFields();
} // end try
// process invalid account number or balance format
catch ( NumberFormatException formatException ) {
JOptionPane.showMessageDialog( this,
"Bad ID number, Date or Salary", "Invalid Number Format",
JOptionPane.ERROR_MESSAGE );
// process exceptions from file output
catch ( ArrayIndexOutOfBoundsException ArrayException ) {
JOptionPane.showMessageDialog( this, "Error with Start Date or Date of Birth\nPlease enter like: 01-01-2001",
"IO Exception", JOptionPane.ERROR_MESSAGE );
// process exceptions from file output
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error writing to file",
"IO Exception", JOptionPane.ERROR_MESSAGE );
closeFile();
} // end if
} // end method addRecord
public static void main( String args[] )
new testing();
} // end class CreateSequentialFile
Sure you can read and write at the same time. But normally you would be reading from one place and writing to another place.
I rather regret avoiding the OP's earlier post asking how to combine two classes. I looked at the two classes posted and realized the best thing to do was actually to break them into more classes. But I also realized it was going to be a big job explaining why and how, and I just don't have the patience for that sort of thing.
So now we have a Big Ball Of Tar™ and I feel partly responsible.
Similar Messages
-
When I open about this mac -> more info and I switch through the tabs (display,memory,storage,support,service) it lags (fps drops, animation looks choppy not smooth) even though all the mac (programs , interface ) works smooth . Why does this happen? (over 300 gb free,same programs installed,free desktop-downloads -no garbage there- everything neat and tidy.) Need some help. Only there it the animations goes like 2 fps and is not smooth. I do not understand why because the programs are the same so its the usage. Nothing is changed, yet i experience this little issue for a couple of days.
OK, I'm confused. When I do About this Mac > More Info in OS10.9, I don't see any animation other than the window resizing. Is that the animation you are describing?
Which if any of the following apply to your computer:
1) Are you running any anti-virus/internet security applications?
2) Are you running any "cleaning/tune-up/optimizations" applications?
3) Any peer-to-peer or torrent downloading software?
4) Any third-party disk backup software that came bundled with an external hard drive?
5) Any online backup scheme other than iCloud (Carbonite; GoogleDrive; MS One Drive)?
6) Did your financial institution ask you to install Trusteer EndPoint Protection (also known as Trusteer Rapport)? -
Why does the installer not open and finish the install after it downloads?
I do not not understand why the downloader will not open and finish the install after it downloads - all I get is more advertising junk trying to sell me things I don't need.
The Adobe Download Assistant. I took a screen shot, and it is just kind of stuck here.
-
Why are my Datasocket OPC reads and writes so slow?
I am creating an application (in LabView 6.1) that has to interface with 15-30 OPC tags (about half and half read and write) on a KepWare OPC server. It seems like the DSC Module would be overkill, but the datasocket write VIs seem to slow the system to a halt at about 6 tags. I saw something about using the legacy datasocket connect VIs, but would I really see a large performance boost from switching?
In the existing code we have, I have seen that even the legacy VIs (our old code uses the older VIs) sometimes grind the system to a halt or lock it up completely if it loses sight of the OPC server. Has anyone else had problems with this?Hi IYUS,
What OPC Server are you using? What methods are you using to communicate? If you are using IAOPC, have you installed the latest patch?
Also, this post is nearly 2 years old. You will probably get more visibility (and more help) if you post your questions in a new thread.
Cheers,
Spex
National Instruments
To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be... -
Help. After updating my software my external disc is "read" only. How do I change it back to Read and Write?
ThanksHave you formatted it for Mac using Disk Utility?
If not, open Disk Utility (Applications>Utilities folder) and select the drive to the left. Make sure that you select "Mac OS Extended (Journaled)" and then the erase button.
If you have already formatted the drive, call back...
Clinton -
I've finished the programming of the process read and write for the PCI6025E, I can read and write the data now, I wanna synchronize both of the processes, writing the data into the card just after the reading from the card, and check the wave in the oscilloscope. when I use the SEC , it works, but when I changed to MSEC, the wave only come out for a few seconds, even if I bloc 60sec, and also the wave is not steady. why?
so now the problem is how could I write the data immediately which just read and it's for a long time I asked?
Thanks in advance!Hi Jack,
aiex4.cpp doesn't exist, as far as I can tell. I believe that while the examples were being named, the developer mis-numbered them and just skipped 4 :-S
At any rate, if you already have AI and AO working separately, and you have the I/O performance you application requires, then you may not need to add DMA to your driver. However, if you want to add DMA, it won't be very difficult. In essence, you would need mix code from the S and M Series examples. The S Series example aiex2.cpp shows two things: the few lines of code you need to add DMA objects (lines 70-78), and how to program the STC to use DMA (line 114). And aiex3.cpp from the M Series examples gives a clearer picture of how to control and read the DMA channel.
Thanks, Rolf, for your time and help :-) I'm grateful for your contributions, and I'm glad to see active developers in the DDK forum.
Joe Friedchicken
NI VirtualBench Application Software
Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
Senior Software Engineer :: Multifunction Instruments Applications Group
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008) -
Why does this websites not work on our Mac products?
http://www.gordonbennett2012.ch/
We are working on the above website: We cannot get it to work on the following Mac devises. Would you please advise the reason for this and how we can fix it?
From: FLY GAS
Subject: Fwd: Website of Gordon Bennett 2012
Date: August 11, 2012 1:52:22 PM MDT
To: René Louis Cc: Mark Sullivan
Hello René, Thank you very much for your email. I am happy to work with you. I have been working on this all day. I still have not figured out why this is not working. I am Mark Sullivan and Cheri White's Crew Chief/Technical Support for the USA.
The following products are being used:
MacBook Pro,Mac OS X Version 10.7.4, Processor 2.8 GHz Intel Core 2 Duo
Mac iPad, Version 5.1.1 (9B206)
Non of these prodects will upload your site http://www.gordonbennett2012.ch/
I have tried the following browsers:
Opera: Could not connect to remote server,
Safari: no responce
Firefox: The connection has timed out The server at gordonbennett2012.ch is taking too long to respond.
Google Chrome: Oops! Google Chrome could not connect to www.gordonbennett2012.ch
I have had all our crew do the same. They are in different parts of the USA.
And the response has been the following:
North Carolina on PC and Android: Site uploaded
New Mexico on PC and iPhone: Site did not upload on either
New Mexico on PC and iPhone: Site did upload
I have also contacted Mac. Please let me know your thoughts so we can sort this out. In the past I have been able to get your site. Just in the past month I have not been able to. I am getting a timed out error from ALL the above browsers.
Kind regards, Letitia
Ms. Letitia Hill
TEAM USA/FLY GAS
PO Box 7186
Albuquerque, New Mexico 87194 USA
TEL: 505-270-6759
FAX: 505-503-8430
E-Mail: [email protected]
Website: www.flygas.net
Begin forwarded message:
From: René Louis
Subject: Website of Gordon Bennett 2012 Date: August 11, 2012 1:25:13 PM MDT
To: [email protected]
Dear Letitia Thank you very much for your message about our website.
I am also working with a Mac and could not find any problems. I would be very interested to know which products you are using and what is not working so I could have a detailed look at it.
Thank you very much.
Best Regards
René
Gordon Bennett 2012 Secretariat / Postfach 280 / CH-9650 Nesslau / Switzerland www.gordonbennett2012.ch René Louis / Kirchweg 672 / CH-9650 Nesslau / SwitzerlandThere seems to be a block with the Internet server in the United States as other Internet and cell servers i.e. Verizon and Century-Link DSL work with Mac, Andriod and PC. It just seems to be Mac on Comcast that is not...
Without more data I'm inclined to say it's more likely to be Comcast itself, rather than 'Macs on Comcast'.
For example, do other devices (PCs, Android, iOS) on that Comcast network also have problems connecting? or do they connect fine?
I'd expect that any device at that network has a problem, which indicates a problem with Comcast. It might be their DNS not resolving properly, or them not routing data correctly, but that should be your focus.
Perform a DNS lookup on the www.gordonbennett2012.ch hostname. What result do you get? Is it the expected address?
If that returns the right address, what do you get with a traceroute?
That will test the routing befween your system and the server, and may indicate other problems on the network. -
Why does ipod touch not appear and sync in iTunes?
Why is ipod touch not appearing in itunes under devices after installing Snow Leopard? The ipod touch charges when plugged into the usb port but does not show on itunes and does not sync.
GemzoeTry here:
iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X
Make sure you also look at the additiona Information topic. -
Why does this script not work when run with osascript cli?
I wrote the following to interface with geektool to display a list of todo's on my desktop (i'm sure it's been done elsewhere, but I wanted to try it myself). I had it working fine until I tried ordering the output to place the highest priority items at the top of the list. The following code works properly during development in Script Editor, but when geektool launches the command using osascript ~/Library/Scripts/todos.scpt it only displays the initial "TODOS:" without displaying the rest of the info. Searching the Applescript Release notes, I found that some versions of Applescript 1.8 had issues with null characters when using the osascript cli, however, I'm running 1.10.7 so it shouldn't be an issue (and I'm not sure how to check for null characters in Applescript even if it were). Anybody have any ideas on what's going on here?
set output to {"TODOS:
set highpri to {}
set medium to {}
set low to {}
set nada to {}
tell application "iCal"
repeat with i in calendars
repeat with j in todos of i
if (completion date of j as string) is equal to "" then
if priority of j as string is equal to "high priority" then
copy summary of j & "
" to end of highpri
end if
if priority of j as string is equal to "medium priority" then
copy summary of j & "
" to end of medium
end if
if priority of j as string is equal to "low priority" then
copy summary of j & "
" to end of low
end if
if priority of j as string is equal to "no priority" then
copy summary of j & "
" to end of nada
end if
end if
end repeat
end repeat
end tell
return (output & highpri & medium & low & nada) as stringwell, i'd been pulling my hair out for quite a while with this and decided it was time to ask for help, but I thought I'd give it one last shot and found a resolution almost immediately. I figured that problem had to be caused by the way applescript was concatenating the lists, so I got rid of the lists completely and it still wouldn't work. This convinced me that it must be newline related since that was the only special character left in the string. I opened up the script in vi, but the default compiled script format is not human readable. The osascript man page indicated that it would accept both compiled and text scripts, so I gave it a try, and osascript handled the raw text file wonderfully.
-
Why does Adobe X not read an Adobe 9 file?
I have an ISPL for a vehicle that could be read by Adobe Reader 9 (not 9.5). Since upgrading my computer and using Adobe Reader X, I no longer have access to my files. Does anyone have a copy of Adobe Reader 9. I've tried Adobe.com but the earliest version they have is Adobe Reader 9.5
My old computer had Windows XP as the OS with Adobe Reader 9. My new computer now uses Windows 7. Using XP, I could read a disc with a ISPL (Illustrated Spare Parts List) on it.My new computer had Adobe Reader X installed on it but it would not read the disc, I kept getting error messages. Now, using the new computer, with the earliest available reader from Adobe for Windows 7, Adobe Reader 9.5, I still get an error message saying that the file is corrupt or has been sent as an email attachment.The disc where the files are was created by Heritage Motor Centre and contains General information, the ISPL and a Workshop manual for a Landrover Discovery. These are the files referred to as I own a Landrover Discovery 300Tdi. Should I now need any spares or information to repair my vehicle, I have to resort to a Landrover specialist.
[private data removed] -
HT1414 WHY DOES MY IMESSAGE NOT WORK AND CANNOT ACTIVATE MY PHONE
I HAVE AN APPLE IPHONE AND CAN NOT GET IT TO USE IMESSAGE AS IT SAY WAITING FOR ACTIVATION BUT WHEN I SEND A MESSAGE IT SAYS ERROR
Both you and the recipient have to have active data connections, and both devices have to have iOS 5 or higher to be able to use iMessage. Also, they both have to have iMessage activated. If that is already the case, there is a possiblility that iMessage is down. It has gone up and down several times in the past week. Check this page for status, and if necessary you can report a problem with a link in the lower right corner. http://www.apple.com/support/icloud/systemstatus/
-
Why does this expression not work as I'd hoped?
I have a Black Solid 3 with a CC Particle World placed within it. I have some particles set up to run at 0.01 velocity outward from the center of my composition. I've put the following expression on the Velocity setting:
value = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
if (value > 50) 20 else 0.01
The Audio Amplitude layer it is linked to is a auto-keyframe layer created from a .mp3 file - the values that it hits during the most intense part of the song range from 1 to around 85-90.
Why does my velocity setting remain at 0.01 consistently, despite it being clearly evident that the Audio Amplitude layer is going far over 50.
P.S.: If I change the > sign to a < sign, it stays at 20. Why?
EDIT: Okay, it seems the issue was having the variable named as 'value'. Now that it works, it still doesn't seem to work as intended - I'd wanted the particles to move very slowly outward, and then whenever bass was detected, to speed up, until the bass was no longer detected, in which case it would return to a slow pace again, anyone have any idea how I'd go about doing this?
Message was edited by: James WingateOne way is to prepare a "Remap Speed" slider somewhere in the comp that will control the remapping speed, and animate it.
0 = time lock, 1 = normal speed, 2 = speedx2, etc
Then in the time remap property of the layer, set this expression:
s = [pickwhip the "Remap Speed" slider]
t=inPoint; // normal time
T=inPoint; // remapped time
dt = thisComp.frameDuration;
TIME = time-0.001;
while (t<TIME){
T+= s.valueAtTime(t) * dt;
t+=dt;
T;
Ok i reread the original post again, in your case the "Remap Speed" slider could have the expression:
value = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
if (value > 50) 1 else 0.01 // above 50 : normal speed, under : very small speed -
The page listed above pops up in a Firefox browser window with five tabs open usually when checking email but sometimes while surfing the net and repeatedly. Some include a 'problem loading page' notice with the following:
Firefox can't find the server at www.xn---jca9qmb.com.
or
Firefox can't find the server at www.xn--dx%if-61a864d.com.
These are the last two of the five tabs that pop up together.
This has happened nine times in the past five to ten minutes.
Since my Norton is up to date and I have recently updated Firefox and plug-ins, I assume this is a software problem however disabling plug-ins and other items has not solved the problem. Any help would be appreciated.Hi
YES it does, HOWEVER in the past Most (not all) Beta auto updates did not trigger Comodo Firewall problem (BUT occasionally did) and I resolved the same way (namely uninstalling and installing a full install.
I do not know if having Aurora AND BETA both installed causes any conflicts regarding this issue
I am NOW going to uninstall Maintenance service, Beta and Aurora retaining only my add-on and preferences. I will delete all Comodo rules for them Then I will download an older update of both Beta and Aurora and see what happens
Will report back in 30 mins -
Why does this iPad not save sent messages and won't allow a message to be sent to trash?
Received a used iPad as a gift. In email, it won't save any sent messages, nor will it allow me to Trash a message. Sent email goes out, but no copy saved in any folder. When I try to delete a message, it temporarily disappears but comes back when I open mail again. Also get message that says "Unable to move message to Trash."
Thanks for your help
ClearheartFor the deleting emails, try turning the account off and on : Settings > Mail, Contacts, Calendars , then tap the account on the right, slide Mail to 'off', exit settings and go back into the Mail app, and then go back to Settings and slide Mail back to 'on'
A second option if that doesn't work then try closing the Mail app via the taskbar : double-click the home button to open the taskbar and then swipe or drag the Mail app's 'screen' up and off the top of the screen to close it, and click the home button to close the taskbar.
And a third thing to try is to go into Settings > Mail, Contacts, Calendars. Then select the account on the right-hand side of that screen, select Account, then Advanced, Deleted Mailbox, and under On The Server tap the 'Trash' folder so that it gets a tick against it - then come out of that series of popups by tapping on the relevant buttons at the top of them and then see if you can delete emails.
For the sent emails check what folder they are being stored, in a similar way to the above third option for deleting emails. -
Why does this code not work?
String answer = new String("");
in = new BufferedReader(new InputStreamReader( connection.getInputStream ()));
String test = new String("");
for (int i = 0 ; i < 1000 ; i++)
answer = in.readLine();
if (answer == null)
System.out.println ("null");
break;
else
test += answer;
System.out.println ("answer: " + answer);
System.out.println ("test: " + test);
Many times, the loop will go through 2 iterations but each time, test is only equal to the first answer. The second, third, fourth etc.time it goes through the loop, it should concatenate the value of answer to the end of the string variable test. So why is it that whenever i run the program that has this code, the loop might lloop many times (let's say 2 time) but the value of test is only the first answer, and not the first answer concatenated with the second answer.It worked for me...my code looks like this...i used FileInputStream instead of connection..
import java.io.*;
class Forum {
public static void main(String a[]) throws IOException{
String answer = new String("");
BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream("hi.txt")));
String test = new String("");
for (int i = 0 ; i < 1000 ; i++)
answer = in.readLine();
if (answer == null)
System.out.println ("null");
break;
else
test += answer;
System.out.println ("answer: " + answer);
System.out.println ("test: " + test);
my hi.txt is like this:
fasd rea reks krie
fsdfasd
asdfasd
sfasdf
asdfasd
The output is
answer: fasd rea reks krie
answer: fsdfasd
answer: asdfasd
answer: sfasdf
answer: asdfasd
null
test: fasd rea reks kriefsdfasdasdfasdsfasdfasdfasd
Is this not the way u want???
Maybe you are looking for
-
ICal in Leopard uses max CPU and must be force-quit
I'm having a problem with iCal 3.0 in Leopard. When left running, eventually it will start to use my entire CPU for no reason. I have tried wiping out all of its preference files, and deleted all my "subscribed" calendars (in case it was maybe stuck
-
Multiple SOAP fault support in PI?
Hi Guys, We have a webservice that has multiple SOAP faults as part of the WSDL. Normally a sync WS will have a request, a response and a fault. My question is does PI support multiple faults? If i look at the SI, it lets me add multiple fault messag
-
HTMLLoader problem with comboBox
hi guys I'm trying to loader pdf file using XML to retrieve the URL and I have CombBox to list all the files ,and I need to load another file every time I change the silder for the CombBox the problem is the pdf file load only first time and dosent
-
Hp c7280 all in one printer fax option stopped working
My fax option worked until yesterday afternoon. Now I have a fax text report and it tells me that I am not using the correct type of phone cord. It has always worked with the phone cord I have plugged in before. Is there a certain phone cord I sh
-
Currently I have client/server software that sends messages to each other. These messages are delimited strings. Now I have a need to make one of the delimited fields binary data. I am using a BufferedReader and BufferedWriter to read the strings. Ca