I got bugs i can't figure the cause
sorry i can't paste my coding since forum deny pasting more than 7500 length so i uploaded it there and please help me solve this problem Thank you!!!
[https://docs.google.com/document/edit?id=1D5idS1FMeO8zXkN-mUwXtlDUfjltd5BqDJiPRnLg2JI&hl=en&authkey=CP-lzvgH]
* @(#)app1.java
* @author
* @version 1.00 2010/7/22
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class person{
String name;
public person(String fname2){
name=fname2;
class customer extends person{
String emailaddr;
String message;
public customer(String fname3, String emailaddr2, String message2)
super(fname3);
emailaddr=emailaddr2;
message=message2;
public String DisplayCust()
String name=super.name;
int namelength=name.length();
int emailength=emailaddr.length();
int messagelength=message.length();
String printingnamelength;
String printingemaillength;
String printingmessagelength;
if(namelength<10)
printingnamelength="0"+namelength;
else
printingnamelength=Integer.toString(namelength);
if(emailength<10)
printingemaillength="0"+emailength;
else
printingemaillength=Integer.toString(emailength);
if(messagelength<10)
printingmessagelength="0"+messagelength;
else
printingmessagelength=Integer.toString(messagelength);
return printingnamelength+printingemaillength+printingmessagelength+name+emailaddr+message;
//Queue
class Queue
private int maxSize;
private customer[] queArray;
private int front;
private int rear;
private int nItems;
public Queue(int s) // constructor
maxSize = s;
queArray = new customer[maxSize];
front = 0;
rear = -1;
nItems = 0;
public void insert(String fname4, String email4, String message4) // put item at rear of queue
if(rear == maxSize-1) // deal with wraparound
rear = -1;
queArray[++rear] = new customer(fname4,email4,message4); // increment rear and insert
nItems++; // one more item
public String remove() // take item from front of queue
String temp = queArray[front++].DisplayCust(); // get value and incr front
if(front == maxSize) // deal with wraparound
front = 0;
nItems--; // one less item
return temp;
public String peekFront() // peek at front of queue
return queArray[front].DisplayCust();
public boolean isEmpty() // true if queue is empty
return (nItems==0);
public boolean isFull() // true if queue is full
return (nItems==maxSize);
public int size() // number of items in queue
return nItems;
public class app1 implements ActionListener {
//GUI design
public void actionPerformed(ActionEvent ae)
Object obj=ae.getSource();
Queue theQueue = new Queue(5); // queue holds 5 items
if(addmsgbtn==obj)
theQueue.insert(custnametxt.getText(),emailtxt.getText(),messagetxt.getText());
if(retrievebtn==obj)
String output=theQueue.peekFront();
String namelength=(output.substring(0, 2));
String emailength=(output.substring(2, 4));
String messagelength=(output.substring(4, 6));
int namelengthINT=Integer.parseInt(namelength);
int emailengthINT=Integer.parseInt(emailength);
int messagelengthINT=Integer.parseInt(messagelength);
custnametxt.setText(output.substring(6,namelengthINT));
emailtxt.setText(output.substring(namelengthINT,emailengthINT));
messagetxt.setText(output.substring(emailengthINT,messagelengthINT));
if(exitbtn==obj)
System.exit(0);
public static void main(String args[])
new app1();
Similar Messages
-
i am using iphone 5s, glass got broked, where can i get the original panel and what would be price
If you are from India ,here is how you get Out of Warranty service in India
Out-of-Warranty Service
Please contact an iPhone Authorized Service Provider for out-of-warranty service options. -
Went to open the folder 'app store' and got this: "You can't open the application App Store because it may be damaged or incomplete." How do I fix it???
Are you running Snow Leopard or Lion? Download and install the correct combo for your OS.
Mac OS X v10.6.8 Update Combo v1.1
http://support.apple.com/kb/DL1399
Mac OS X Lion 10.7.2 Update Combo
http://support.apple.com/kb/DL1459 -
I have subscribed an "Creative Cloud single-app membership for Photoshop (one-year)" plan, is this plan will be auto renew after expired? I got two macbook, can they share the same plan?
Great thanksYes and yes.
-
Was installing new ios 7 and it asked for acct and password. it did not like and said it would email a new password. no email received. can not figure the Apple support screens to find a phone number to call. help.
No need for alarm. There are several folks a day posting like threads. Most folks know these phishing attempts for what they are and merely delete with prejudice.
To the bottom line... if you wish - and I am sure Apple will take notice - you should FORWARD the email to [email protected] and delete.
CCC -
Warnings in FileReference - can not find the cause
I'm trying to make a loader of a few photos (use FileReference). I get the warnings, but I do not know the reason for their appearance.
warning: unable to bind to property 'fr' on class 'Object' (class is not an IEventDispatcher)
warning: unable to bind to property 'name' on class 'flash.net::FileReference'
warning: unable to bind to property 'data' on class 'flash.net::FileReference'
warning: unable to bind to property 'fr' on class 'Object' (class is not an IEventDispatcher)
warning: unable to bind to property 'name' on class 'flash.net::FileReference'
warning: unable to bind to property 'data' on class 'flash.net::FileReference'
CODE:
import mx.events.CollectionEvent;
import flash.net.FileReferenceList;
import mx.collections.ArrayCollection;
[Bindable]
private var photos:ArrayCollection = new ArrayCollection;
private var frList:FileReferenceList = new FileReferenceList;
private function init():void
photos.addEventListener(CollectionEvent.COLLECTION_CHANGE,function():void
startUploadButton.enabled = (photos.length>0);
clearPhotosButton.enabled = (photos.length>0);
frList.addEventListener(Event.SELECT,addPhotos);
private function selectPhotos():void
var fileFilter:FileFilter = new FileFilter("Images jpeg","*.jpg;*.jpeg");
frList.browse([fileFilter]);
private function addPhotos(e:Event):void
for (var i:uint = 0; i < frList.fileList.length; i++)
var elem:Object = new Object;
elem.fr = FileReference(frList.fileList[i]);
elem.fr.load();
elem.fr.addEventListener(Event.COMPLETE,refreshThumb);
photos.addItem(elem);
private function refreshThumb(e:Event):void
photosList.invalidateList();
public function clearPhoto(data:Object):void
photos.removeItemAt(photos.getItemIndex(data));
photosList.invalidateList();
private function startUpload():void
photosProgressContainer.visible = true;
var request:URLRequest = new URLRequest();
request.url = "http://localhost/tempLoader-debug/upload.php";
var fr:FileReference = photos.getItemAt(0).fr;
fr.cancel();
fr.addEventListener(ProgressEvent.PROGRESS,uploadProgress);
fr.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,uploadComplete);
fr.upload(request);
private function uploadProgress(e:ProgressEvent):void
photosProgress.setProgress(e.bytesLoaded,e.bytesTotal);
private function uploadComplete(e:DataEvent):void
photos.removeItemAt(0);
photosList.invalidateList();
if (photos.length > 0)
startUpload();
else
photosProgressContainer.visible = false;In my opinion this is the line that is causing you the warning:
<mx:Image source="{data.fr.data}" maxWidth="100" maxHeight="75"
horizontalAlign="center" verticalAlign="middle" />
That means that data should be a custom binable object and fr should be another
custom bindable object.
like
public class BindableData
public var fr:BindableData2;
public class BindableData2
public var data:String;
I am not sure though what you are trying to do though, but I assume you try top
load an image from your disk. This link will help you:
view source enabled...
http://www.everythingflex.com/flex3/flexcampItaly/
the blog post ...
http://blog.everythingflex.com/2009/09/08/flexcamp-presentation-filereference-load-part-1- of-3/
C
From: Astraport2012 <[email protected]>
To: Ursica Claudiu <[email protected]>
Sent: Sun, October 3, 2010 3:07:57 PM
Subject: Re: Warnings in FileReference - can not find the cause
I found the solution to the first part of the warning. Only need to modify the
object as ObjectProxy
public var elem:ObjectProxy = new ObjectProxy;
But with the second part is still a problem (warning: unable to bind to property
'name' on class 'flash.net::FileReference'
warning: unable to bind to property 'data' on class 'flash.net::FileReference').
I do not fully describe the problem in the first message. The main application
calls the component and passes it parameters. They cause errors.
It is this component photoThumb.mxml:
<?xml version="1.0" encoding="utf-8"?>
width="120" height="110"
backgroundColor="#FFFFFF" backgroundAlpha="0"
rollOver="{controls.visible=true;}" rollOut="{controls.visible=false;}">
<mx:Image source="@Embed('t1.png')" width="100%" height="100%" alpha="0"
horizontalAlign="center" verticalAlign="middle"/>
<mx:VBox width="100%" height="90" y="5" horizontalAlign="center" >
<mx:Image source="{data.fr.data}" maxWidth="100" maxHeight="75"
horizontalAlign="center" verticalAlign="middle" />
</mx:VBox>
<mx:Label text="{data.fr.name}" width="118" truncateToFit="false" bottom="0"
textAlign="center" />
<mx:VBox id="controls" visible="false" y="65" right="10" horizontalAlign="right"
>
<mx:Button label="X" click="parentDocument.clearPhoto(data)" fontSize="6"
width="30" height="15" />
</mx:VBox>
</mx:Canvas -
I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?
I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?
-
I have moved and changed ISP from Brighthouse to Verizon. I am receiving my icloud emails, but the senders are receiving messages that they are undeliverable. I can't find the cause or solution to the problem. Any thoughts?
PS. I have deleted Roadrunner accounts, and reset new email account.You can't. The only way to get songs in the Music app is to sync from a computer or to download from iTunes.
-
I got a iphone 3 and got it unlocked can i update the the phone
i got a iphone 3 had it unlocked 6 monts a got but now need to update the software as some tine have to turn the phone off and restart it as massage wont go as lose in the network
ONLY the carrier an iPhone is locked to can authorize unlocking it. If you went through the carrier and had it legitimately unlocked, then updating it will not change this. If you used any other method to unlock it, or had it "unlocked" by a local shop, updating will re-lock it to the original carrier. It may not be possible to update it at all and attempting to do so could turn it into a brick.
-
Bugs? can't change the time ... Can't view all mail settings
Am I the only one with this problem? I changed my iPhone with an I phone 3G.
when I go to change the time... it sends me back to the main screen. same with mail settings. I am running on ver 2.1.Go to Settings > General > International > Region Format
I selected United States and then was able to set my Date & Time no problem. What was interesting was that my region format was set to English but there is no option for English only UK or US. That's probably where the bug was.
I found the answer here
http://discussions.apple.com/message.jspa?messageID=8251783#8251783 -
Verify Disk results, confusing.. Can they be the cause of system lock ups?
I have been experiencing strange freezes on my Mac Pro 2008 system.
My boot disk is a 50% full 128GB SSD from Crucial and is running beautifully fast however for the past couple of weeks my system often freezes for anything from 3 seconds to 30 seconds and then the Finder restarts.
After the Finder restarts everything continues running smoothly. As if nothing ever happend, no error reports, no apps crashed, nothing.
I have verified disk permissions and verified the disk itself in Disk Utility but I am not quite sure what these results mean and if they could be the cause of these random lock ups.
here are the results:
Verify permissions for “Boot Disk”
Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired.
Group differs on "private/etc/hostconfig", should be 0, group is 20.
Permissions verification complete
Verifying volume “Boot Disk”
Performing live verification.
Checking Journaled HFS Plus volume.
Checking extents overflow file.
Checking catalog file.
Missing thread record (id = 5888152)
Incorrect number of thread records
Checking multi-linked files.
Checking catalog hierarchy.
Invalid volume directory count
(It should be 184294 instead of 184295)
Checking extended attributes file.
Checking volume bitmap.
Checking volume information.
The volume Boot Disk was found corrupt and needs to be repaired.
Error: This disk needs to be repaired. Start up your computer with another disk (such as your Mac OS X installation disc), and then use Disk Utility to repair this disk.
I would really appreciate it if someone that knows their way around this stuff could help me troubleshoot this.
As for the problem of the system locking up it does not happen in the same application consistently.
Often it happens in Firefox but it could equally often happen when working in Photoshop, browsing files in the Finder or trying to access the Spotlight search via the keyboard shortcut.
When the system locks up I get the spinning beach ball and I can still move the mouse and click and even still access CMD+TAB app switcher, switch spaces and all those things, just applications become non responsive.
If you need any more details please let me know.
Thanks for reading,
JannisThese are innocuous errors that you may safely ignore. However the disk error is a problem. Do the following:
Repairing the Hard Drive
Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors, then quit DU and return to the installer. Now restart normally.
If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X. -
How can I identify the cause of high CPU usage
Just recently, my Mac Book Pro CPU usage has gone through the roof, and the temperature quickly rises to around 80ºC, with the fans are working pretty hard to keep it there.
I've looked in Activity Monitor, but there's nothing unusual as far as I can tell in the list of processes, but it does show that the system is continually using between 30% and 40% of the CPU all the time, even if I have no applications running. From a cold start, it starts using that much CPU as soon as OSX loads.
Here's a screen grab of the activity monitor window
One thing I thought was strange is the amount of Virtual Memory that Growl uses (37gb) but according to the growl website, that's not unusual. I've also tried quitting Growl, but it makes no difference.
I have 30GB of free space left on my HD.
Any ideas? I'm worried my Mac Book might be on it's last legs, so I'm hoping and praying that this is something simple-ish.
thanks
-tYour fellow MacBook Pro users would be found here:
http://discussions.apple.com/category.jspa?categoryID=190
http://www.apple.com/support/macbookpro/
Might also want to check out the Mac OS X Snow Leopard discussions. -
What's wrong? I can't determine the cause of it.
Hi all,
I've gotten myself a macbook online (2 ghz with the stock 512 megs of ram).
I bought myself 2 pieces of patriot 1 gb (it's of correct specifications) and installed them at a computer shop a week ago.
Upon booting up, everything runs perfectly normal. Usually after a certain period of running, the entire system slows down. They widgets and expose features seem to lag whenever they come on. My entire system practically slows down.
I doubt it's a ram issue as many have installed patriot rams onto their macbooks. I've did a memory test, apple hardware test and all yielded the 'ok' sign.
Anyone experiencing the same problems?
Any idea what's the cause of this problem? I'm quite disappointed that this is happening.
Alvin
Macbook Mac OS X (10.4.7)Try reinstalling the original RAM and testing using only one app and Dashboard. With 512MB of RAM having multiple apps could cause the slowness due to paging depending on how you use those apps.
If after a while it still slows down more than it was a few minutes after booting, then you might have ran into an issue one or two others here have seen where after getting to a certain point heat-wise the machine severely slow down.
If it behaves normally with 512MB, then there could be some issue with the RAM. Apple's Hardware Test, while a great resource, will not necessarily detect every single possible problem with RAM. What may be happening is there is a timing defect or corruption that occurs when the RAM reaches a certain temperature and/or a certain memory location on the chips. As such it would take a while for the machine to warm up enough or for it to finally get to a point where it accesses those addresses. -
Sax parse xml bug , I can't figure it out!
(1) orginal xml file as followings:
<row>
<field name="productBundleId">22456</field>
<field name="localPath">/products/01092008/RealArcade/STD_StonesOfKhufu_NOK6030_EN_v1_0_12.jar</field>
<field name="description">/products/01092008/RealArcade/STD_StonesOfKhufu_NOK6030_EN_v1_0_12.jad</field>
</row>
(2) task parsing the above and and retrieve the value and set it to a javabean:
(3) Using the SAX as the xml file is very big , about 1M
* @author mertef
public class XerseHandlerImp extends DefaultHandler implements MF_CONSTANTS
List m_data = new ArrayList();
private CompareSimpleBean m_csb = null;
private String m_tmpVal = "";
private boolean m_id = false;
private boolean m_jar = false;
private boolean m_jad = false;
private String m_whitespace = "";
private boolean m_character = false;
@Override
public void characters(char[] ch, int start, int length) throws SAXException
* // System.out.println(new String(ch,start,length));*
m_tmpVal = new String(ch, start, length);*
if (jad) System.out.println(tmpVal);*
@Override
public void endElement(String uri, String localName, String name) throws SAXException
m_character = false;
if (name.equals(MOVAYA_ROW))
m_data.add(m_csb);
if (name.equals(MOVAYA_FIELD))
if (m_id)
m_csb.setId(m_tmpVal);
m_id = false;
m_jar = false;
m_jad = false;
else if (m_jar)
m_csb.setJarPath(m_tmpVal);
m_id = false;
m_jar = false;
m_jad = false;
else if (m_jad)
m_csb.setJadPath(m_tmpVal);
m_id = false;
m_jar = false;
m_jad = false;
@Override
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
m_whitespace = new String(ch, start, length);
(4) please pay attention to the bold area , the method:
character()
I declare a variable "m_character" to decide if the parser don't read content of
an item in above xml file ,such as
/products/01092008/RealArcade/STD_StonesOfKhufu_NOK6030_EN_v1_0_12.jar
(5)error:
but some time it only reads part of the character contents:
eg:
/products/01092008/RealAr
cade/STD_StonesOfKhufu_UnitedStates_LGCU515_EN_v1_0_12.jad
It means that they parser comes across some character when parsing,
but in fact it doesn't.
You can use println() to monitor the outputs.
So I need to declare some boolean variable to decide whether all the content of one item has read fully.
(6)
May be its a bug, my xml file don't include any special charactor.The problem is that the character data might be delivered in multiple chunks, this means that the characters method might be called more than once for the same element.
One way around this is to create a StringBuilder or something similar in the startElement() method, and fill it with the characters in the characters() method and read it in the endElement() method.
For more information: http://forum.java.sun.com/thread.jspa?threadID=5255925 -
I'm too bad in math! can't figure the correct function to resize images
This is driving me crazy, just becasue I don't have the
logical brains it takes:
I want to dynamically (PHP) resize images, according to a max
width and max height parameters.
What's giving me a problem is that max width and max height
are not equal, AND the images should be
resized only if their original size is too big:
$max_width = 650;
$max_height = 500;
$size = getimagesize($image);
$img_width = $size[0];
$img_height = $size[1];
Now how do I write a function that will resize images of any
possible size, *only if they need to*,
to fit in the maximum size *rectangle*?...
I have tried for hours to get it right, and I am ending up
with a function so full of conditionals
and sub-sub-conditionals that I'm getting completely lost.
I hope you can help, I'm sure it should be very simple...
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing Listhere's the solution. This will correctly and proportionally
reduce image size according to ANY max
width and max height, no matter what the difference between
max width and max height:
if(($width <= $max_width) && ($height <=
$max_height)){
// The image is the right size already
$targetwidth = $width;
$targetheight = $height;
}else{
// if width > height
if($width >= $height){ // if height > width
$targetwidth = $max_width;
$targetheight = $targetwidth * ($height / $width);
// here we must check again if reduced height is not still
greater than max_height
if($targetheight > $max_height){
$targetheight = $max_height;
$targetwidth = $targetheight * ($width / $height);
}elseif($height > $width){ // if height > width
$targetheight = $max_height;
$targetwidth = $targetheight * ($width / $height);
// here we must check again if reduced width is not still
greater than max_width
if($targetwidth > $max_width){
$targetwidth = $max_width;
$targetheight = $targetwidth * ($height / $width);
(_seb_) wrote:
> Actually I did some tests, and it does not work!
>
> Here's the problem:
>
> $maxwidth = 600;
> $maxheight = 400; // max height is smaller than max
width!
>
> Then the method tests whether the image is taller or
wider, and resizes
> it to maxwidth or maxheight accordingly.
> So, if an image is 700px wide and 699px high, it will be
reduced
> according to $max_width, because the image is wider than
tall.
>
> *The resulting resized image will be taller than
$max_height*.
>
> That's the problem I have been running into.
>
> I cannot find a simple mathematic solution, without
getting lost in
> endless conditionals. I have found many examples of
resizing according
> to max width and max height parameters, but not one that
addresses this
> issue.
>
> (_seb_) wrote:
>> thanks Sonjey - that worked
>>
>> Sonjay wrote:
>>> This is the basic code that I've used on several
sites. It checks to
>>> see if
>>> the image needs to be resized, and if so, it
does the math to figure
>>> out the
>>> new proportional dimensions, whether you need to
resize to a
>>> specified width
>>> or to a specified height.
>>> $size = getimagesize($file);
>>> // Specify desired maximum dimensions
>>> $maxwidth = 650;
>>> $maxheight = 500;
>>> if ( ($size[0] <= $maxwidth) &&
($size[1] <= $maxheight) ) {
>>> // The image is the right size already
>>> $targetwidth = $size[0];
>>> $targetheight = $size[1];
>>> } else {
>>> // if width > height
>>> if ( $size[0] >= $size[1] ) { // if height
> width
>>> $targetwidth = $maxwidth;
>>> $targetheight = $targetwidth * ($size[1] /
$size[0]);
>>> } elseif ($size[1] > $size[0]) { // if height
> width
>>> $targetheight = $maxheight;
>>> $targetwidth = $targetheight * ($size[0] /
$size[1]);
>>> }
>>> } // END ELSE
>>>
>>> Now you have your target width and target height
set proportionally,
>>> and you
>>> can proceed with your resizing operation, using
$targetwidth and
>>> $targetheight.
>>>
>>
>>
>
>
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing List
Maybe you are looking for
-
How do u get movies on your ipod?
how do u get movies on your ipod? i hav a 30 gb video ipod, so i can, but i cant figure out how. i've tried looking it up but it says nothing. pls help
-
How can I retrieve the last 10 records in a table
-
Darwin 10.7 kernel panics? can't fix computer
Getting frustrated that I do not know how to fix this. I have 10.6.7 and a MacBook Pro. Mon Apr 18 12:45:17 2011 panic(cpu 0 caller 0x2aab59): Kernel trap at 0x002d96b2, type 14=page fault, registers: CR0: 0x80010033, CR2: 0x00000130, CR3: 0x09fe5000
-
Address Book: Pop-up menus attached to field labels
Some of these are grayed out when it doesn't make sense to me to do so. For example, with the Instant Messaging field label, I find iChat always grayed out, whereas it would appear to represent an opportunity to launch iChat while in Address Book. Di
-
is there any easy way to move a motion's keyframe from one spot in the clip to another? say i have a clip and i add a keyframe at the clip's 'in' point and then another at the clip's 'out' point. the result is say a slight zoom and move across the sc