Square array
I need to create a square array of integers with a specified size.
Then I need to create a new square which should be read from a file.
If I could figure out how to declare them'd probably be right with the
rest but I don't know where to start. Any help would be appreciated.
Thanks
int[][] arr = new int[5][5];
Similar Messages
-
I am writting a method that should create an array of 10 integers, where each element holds the square of its index number (thus, for example, myArray[3] should hold the value 9). Here is my code that does not work properly.
public int[] makeIndexSqArray(){
int[] myArray = new int[10];
for (int i = 0; i < myArray.length; i++)
myArray[i] = myArray[i] * myArray;
return myArray;
Any suggestions?
Thank you ,
PeterBefore this line:
myArray[i] = myArray[i] * myArray;
include this
myArray[i] = i; -
How to extract data on the diagonal of a square matrix
Hi, I am quite new to this. I have Labview 7.1. I am having a bit of trouble with the following:
I have a square array and would like to extract the data ocurring on the diagonal of this array into a 1d array. Can anyone help me with this? Kind regards.
RAnother solution, with a much smaller diagram :
Use a FOR loop, WITH autoindexing, then use "index array" wired to the loop counter to extract the diagonal elements.
See the attached exemple.
Chilly Charly (aka CC)
E-List Master - Kudos glutton - Press the yellow button on the left...
Attachments:
Extract_Diagonal.vi 18 KB -
Does anyone us square register as a POS and interface it to Quickbooks Pro? If so, what's the process?
Ok, my english isn't the best, but I'll try to explain the best I can:
the problem isn't your cherOrigin() method, it is the structure of your actionPerformed() method.
When an ActionEvent is thrown and you enter the for-loop at the beginnig of the actionPerformed() method, your app will start processing for the first element in your squares array. If you clicked the button once, it will set your originGood variable to false and then jump into the while-loop (because originGood is false). Then it will perform the checkOrigin() method for the first element. So if checkOrigin() returns a value other than -1, it will set originGood to true and quit the while loop and then go on the same way with all the other elements in your squares array. So if checkOrigin() returns -1 for any of your elements in the squares array, originGood will never be set to true and the while(!originGood) loop will never come to an end. I think that's why your program 'freezes', because it's stuck in the actionPerformed() method.
I hope you understand what I mean ;) -
Help programming Pythagoras tree
Hello,
I want to write a program that draws a
Pythagoras
tree. The only programming language I know is C but I tried it
in that language and it was horrible. Someone recommended Flash
(AS3) to me so I am trying it in that now, but I only started
learning it yesterday.
Anyway, I got to the point where I can draw the leftturning
branch of the Pythagoras tree, but I don't know how to draw the
other branches. The number of "houseshapes" a square with a
rectangular triangle on top increases with every step according to
the formula 1 x 2^(n-1) (First step is n=1). I created a function
that draw this houseshape, called drawHouse() and it takes as its
arguments the co-ordinate of the lower left corner of the square
part of the house, the length of the side of the square part of the
house and the current rotation angle. Rotation angles are always
multiples of 45 for now, but I might try to expand it to other
values later, but for now I hardcoded a lot of stuff that assumes
the 'roof' of the house is a rectangular triangle.
What I am asking is: how do I store the 2 new x and y
co-ordinates that I can calculate after drawing the houseshape, for
drawing the next houseshape, and how do I store the angles? Do I
need 3 separate arrays for x, y and angle? And how do I then call
the houseshape function for every x and y co-ordinate and angle in
these arrays? Code below.
I would greatly appreciate any help.
Thanks in advance,
Maxcreate an array consisting of all newly added squares. you
need only include the [x,y,rotation,side length] of the newly added
squares where x,y are the coordinates of one corner of the square.
for each square in this array you'll create two new squares
(using the parents x,y,rotation,side length) and add those new
squares (x,y,rotation,side length) to the next generation of newly
added squares array (not the previous generations array).
ie, you'll create a new array containing 2**(n-1) array
elements with each order n. when you've completed looping through
the previous generation's array, you'll have completed creating the
next generation's squares and your next generation array will be
complete and be ready to be used to create the new order n+1
squares. -
Some strange problem with Flash/As3
Hi,
I am having some strange problem with my flash cs3.
Whatever script I write in as3 doesn't work, even a stop() function doesn't work . But when I change my publish setting to as2 it works fine.
Not sure about the root cause, may be some setting or preference or my cs3 is corrupted.
Can anybody please advise.
Thanks,
Kishortry this
create a new fla as3,
select frame 1
open the actions panel
paste in the following code
var squares:Array = new Array;
setup();
function setup():void {
for (var i = 0; i < 25; i++) {
var square:Sprite = new Sprite();
//square.name = "square" + i;
square.graphics.beginFill(Math.random() * 0xffffff);
squares.push(square);
squares[i].graphics.drawRect(0, 0, 100, 100);
squares[i].x = i*3;
squares[i].y = i*3;
squares[i].filters = [];
square.graphics.endFill();
stage.addChild(squares[i]);
for (var j = 0; j < squares.length; j++) {
squares[j].addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
squares[j].addEventListener(MouseEvent.MOUSE_UP, dropMovie);
squares[j].buttonMode = true;
function dragMovie(event:MouseEvent):void {
event.target.startDrag();
function dropMovie(event:MouseEvent):void {
event.target.stopDrag(); -
G4 titania PB hooking up to a digital projector
FIrst time to post,,,
I am supposed to give a slide show, so i thought Iphoto would be good as it is fairly simple,,, i took my PB to the bank that is allowing me use of there project,, i thnk a in focus l3 540? anyway, just testing it to see how the photos would look before hand,.
I connected the cord to the little monitor adapter that comes with the computer,(,the one that plugs into the right side with the fairly long rectangle interface with the 25 little pin holes in the nice array with 4 in a square array next to it) i am sure yall know which one, i just dont know the name.,
anyway, we plugged it in and the projector screen kept running through a dialog, searching for device, ( similar language) but in any case, it was looking for a signal, presumably my computer,,
Could someone please give me the proper procedure for using this projector and hookup with this laptop, do i need to turn off the computer first before hooking up or i have seen closing the lid, ,, anyway,, what is the proper procedure for hooking up to a digital projector,,,,
oh, and one more question,, if the projector is a 1024x768, would my jpeg setting of 1000 on the horiz and 750 on the vert with a 96 dpi be a good setting to get good projection detail as it shows on the laptop screen,,
its a basic wildlife slide show,, like the old days,
thankin all in advance for any thoughts,,,
Kim KaiserHi Kim and welcome!
You have a G4 powerbook, but I'm not sure what model it is.
It sounds a bit newer than my G4 titanium 15"
Maybe it is more like the one at this link?
http://manuals.info.apple.com/en/PowerBookG4_15inch1.67-1.5GHzUserGuide.pdf
Sounds like you are referring to the DVI port on the right side. You also plugged in the adapter that lets a regular monitor(in this case the projector) use that port.
Sounds right so far.
I have Tiger on my computer so my info could be off a bit--take it as it's given: with reservation.
I use the s-video port( the little camera with the "out" written on it) next to that DVI port on your laptop . I bought a long S-viedo cable at radio shack so I could be a bit further from the projector.
When the cables are all hooked up and after I start up the projector, I start up the laptop, open the "system preferences" in the apple menu and open up "monitors". It has a "detect displays" button and I press it.
There is also a little button (maybe only in tiger) that says "show displays in menu bar" I check this button too because it puts a menu at the top of the screen that lets me control the monitors.
If the display shows up on your computer, you also need to turn video mirroring on.This makes whatever you see on your laptop is showing on your TV. There is a check-bow for this OR it is in your menubar now.
The only goofiness that I ran into was that sometimes you have to select the source that the projector is accessing. This is done at the projector end and often with the input button on the remote. If you are using the DVI port with the adapter, then the VGA input needs to be selected on the projector. If you are using the S-video cable(like I do) then you need to select S-video on the projector.
I hope this helps a little bit until somebody else comes along.
rf -
Accessing value in document class
hello i am trying to acces a value in the document class. but i can't get it to work.
what i have is:
can someone tell me how i should access the myArray value?
bomberman.as:
package {
import flash.display.MovieClip;
public class bomberman extends MovieClip {
public var myArray:Array=[]; //trying to access this value
public function bomberman() {
init();
//trace(document.docClass);
private function init() {
var square:Array=[];
for (var i:Number=0;i<11;i++) {
for (var j:Number=0;j<11;j++) {
var temp:grassSquare;
if (i==0||i==10) {
temp=new grassSquare(i*50,j*40);
addChild(temp);
square.push(temp);
} else if (i%2!=0) {
if (j==0||j==10) {
temp=new grassSquare(i*50,j*40);
addChild(temp);
square.push(temp);
myArray.push(false);
} else {
myArray.push(true);
} else {
if (j%2==0) {
temp=new grassSquare(i*50,j*40);
addChild(temp);
square.push(temp);
myArray.push(false);
} else {
myArray.push(true);
bomberman.fla:
import flash.events.KeyboardEvent
var User1:Player1=new Player1;
stage.addEventListener(KeyboardEvent.KEY_DOWN, User1.fl_SetKeyPressed);
User1.x=75;
User1.y=60;
addChild(User1);
Player1.as:
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.KeyboardEvent
import flash.ui.Keyboard
public class Player1 extends MovieClip {
private var upPressed:Boolean = false;
private var downPressed:Boolean = false;
private var leftPressed:Boolean = false;
private var rightPressed:Boolean = false;
private var currentSquare:uint=12;
public function Player1() {
this.addEventListener(Event.ENTER_FRAME, fl_MoveInDirectionOfKey);
//stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_SetKeyPressed);
public function fl_MoveInDirectionOfKey(event:Event)
if (upPressed && this.y>=100 /*&&document.myArray[currentSquare-1]*/)
this.y -= 40;
upPressed = false;
currentSquare-=1;
if (downPressed && this.y<=340 /*&& this.myArray[currentSquare+1]*/)
this.y += 40;
downPressed = false;
currentSquare+=1;
if (leftPressed && this.x>=125 /*&& /*this.myArray[currentSquare-11]*/)
this.x -= 50;
leftPressed = false;
currentSquare-=11;
if (rightPressed && this.x<=425 /* && /*this.myArray[currentSquare+11]*/)
this.x += 50;
rightPressed = false;
currentSquare+=11;
trace(currentSquare);
public function fl_SetKeyPressed(event:KeyboardEvent):void
switch (event.keyCode)
case Keyboard.UP:
upPressed = true;
break;
case Keyboard.DOWN:
downPressed = true;
break;
case Keyboard.LEFT:
leftPressed = true;
break;
case Keyboard.RIGHT:
rightPressed = true;
break;i have this code now and it gives me a bunch of errors. could someone tell me what's going wrong ?
errors are in the red code.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 25
1093: Syntax error.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 27
1084: Syntax error: expecting identifier before this.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 27
1084: Syntax error: expecting colon before minusassign.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 28
1084: Syntax error: expecting rightbrace before semicolon.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 31
1084: Syntax error: expecting rightparen before if.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 31
1084: Syntax error: expecting identifier before dot.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 31
1093: Syntax error.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 33
1084: Syntax error: expecting identifier before this.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 33
1084: Syntax error: expecting colon before plusassign.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 34
1084: Syntax error: expecting rightbrace before semicolon.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 37
1093: Syntax error.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 39
1084: Syntax error: expecting identifier before this.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 39
1084: Syntax error: expecting colon before minusassign.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 40
1084: Syntax error: expecting rightbrace before semicolon.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 43
1084: Syntax error: expecting rightparen before if.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 43
1084: Syntax error: expecting identifier before dot.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 43
1093: Syntax error.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 45
1084: Syntax error: expecting identifier before this.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 45
1084: Syntax error: expecting colon before plusassign.
C:\Users\Jannes\Desktop\dev\Player1.as, Line 46
1084: Syntax error: expecting rightbrace before semicolon.
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.KeyboardEvent
import flash.ui.Keyboard
public class Player1 extends MovieClip {
private var upPressed:Boolean = false;
private var downPressed:Boolean = false;
private var leftPressed:Boolean = false;
private var rightPressed:Boolean = false;
private var currentSquare:uint=12;
public function Player1() {
this.addEventListener(Event.ENTER_FRAME, fl_MoveInDirectionOfKey);
//stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_SetKeyPressed);
public function fl_MoveInDirectionOfKey(event:Event)
if (upPressed && this.y>=100 && MovieClip(root).myArray[currentSquare-1]*/)
this.y -= 40;
upPressed = false;
currentSquare-=1;
if (downPressed && this.y<=340 && MovieClip(root).myArray[currentSquare+1]*/)
this.y += 40;
downPressed = false;
currentSquare+=1;
if (leftPressed && this.x>=125 && MovieClip(root).myArray[currentSquare-11]*/)
this.x -= 50;
leftPressed = false;
currentSquare-=11;
if (rightPressed && this.x<=425 && MovieClip(root).myArray[currentSquare+11]*/)
this.x += 50;
rightPressed = false;
currentSquare+=11;
trace(currentSquare);
public function fl_SetKeyPressed(event:KeyboardEvent):void
switch (event.keyCode)
case Keyboard.UP:
upPressed = true;
break;
case Keyboard.DOWN:
downPressed = true;
break;
case Keyboard.LEFT:
leftPressed = true;
break;
case Keyboard.RIGHT:
rightPressed = true;
break; -
FaceTime will not launch in Yosemite; "Application Not Responding"
I'm using a late 2012 iMac. Following advice I saw in another, similar thread, I deleted all FaceTime items in Keychain Access (including certificates), as well as all of the following from my User/Library/Preferences folder:
com.apple.facetime.bag.plist
com.apple.FaceTime.plist
com.apple.ids.service.com.apple.ess.plist
com.apple.ids.service.com.apple.madrid.plist
com.apple.ids.service.com.apple.private.ac.plist
com.apple.ids.service.com.apple.private.alloy.callhistorysync.plist
com.apple.ids.service.com.apple.private.alloy.continuity.activity.plist
com.apple.ids.service.com.apple.private.alloy.continuity.activity.public.plist
com.apple.ids.service.com.apple.private.alloy.continuity.auth.plist
com.apple.ids.service.com.apple.private.alloy.continuity.encryption.plist
com.apple.ids.service.com.apple.private.alloy.continuity.tethering.plist
com.apple.ids.service.com.apple.private.alloy.icloudpairing.plist
com.apple.ids.service.com.apple.private.alloy.idsremoteurlconnection.plist
com.apple.ids.service.com.apple.private.alloy.maps.plist
com.apple.ids.service.com.apple.private.alloy.multiplex1.plist
com.apple.ids.service.com.apple.private.alloy.phonecontinuity.plist
com.apple.ids.service.com.apple.private.alloy.screensharing.plist
com.apple.ids.service.com.apple.private.alloy.sms.plist
com.apple.imagent.plist
com.apple.imservice.FaceTime.0016cb8bcac8.plist
com.apple.imservice.FaceTime.A709F320-4249-5DEC-B9D9-7E6A3D5722CA.plist
com.apple.imservice.FaceTime.plist
com.apple.imservice.ids.FaceTime.A709F320-4249-5DEC-B9D9-7E6A3D5722CA.plist
com.apple.imservice.ids.FaceTime.plist
There were no equivalent files in User/Library/Preferences/ByHost. I logged out and back in, then tried launching FaceTime, to no avail.
I have not yet emptied the Trash.
FaceTime is working fine on my iPad 3. I received a call on it yesterday.
I am stumped. Help, please?Thank you for offering assistance, Mr. Davis. Here's the log entry:
11/16/14 6:04:07.573 PM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
11/16/14 6:04:14.662 PM osascript[6316]: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
11/16/14 6:04:14.663 PM osascript[6316]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
11/16/14 6:04:47.614 PM sharingd[4032]: 18:04:47.614 : Stopping Handoff advertising
11/16/14 6:04:53.189 PM com.apple.WebKit.WebContent[6253]: Warning: accessing obsolete X509Anchors.
11/16/14 6:04:54.304 PM com.apple.WebKit.WebContent[6253]: Warning: accessing obsolete X509Anchors.
11/16/14 6:04:56.512 PM sharingd[4032]: 18:04:56.511 : Stopping Handoff advertising
11/16/14 6:05:05.381 PM sharingd[4032]: 18:05:05.380 : Stopping Handoff advertising
11/16/14 6:05:07.925 PM SIMBL Agent[4072]: warning: failed to get scripting definition from /Applications/FaceTime.app; it may not be scriptable.
11/16/14 6:05:07.925 PM SIMBL Agent[4072]: AppleEvents: Send port for process has no send right, port=( port:29023/0x715f rcv:1,send:0,d:0 limit:5) (findOrCreate()/AEMachUtils.cp #526) com.apple.main-thread
11/16/14 6:05:08.475 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.487 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.498 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.510 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.687 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.698 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.709 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:08.720 PM com.apple.Safari.SearchHelper[4279]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:09.215 PM FaceTime[6314]: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
11/16/14 6:05:09.216 PM FaceTime[6314]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
11/16/14 6:05:09.217 PM SIMBL Agent[4072]: AppleEvents: Send port for process has no send right, port=( port:29023/0x715f rcv:1,send:0,d:0 limit:5) (findOrCreate()/AEMachUtils.cp #526) com.apple.main-thread
11/16/14 6:05:13.388 PM sharingd[4032]: 18:05:13.387 : Stopping Handoff advertising
11/16/14 6:05:13.870 PM iGlasses[5891]: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
11/16/14 6:05:13.871 PM iGlasses[5891]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
11/16/14 6:05:13.876 PM iGlasses[5891]: Bartender: Loaded BartenderHelperSeventyFour
11/16/14 6:05:14.730 PM osascript[6323]: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
11/16/14 6:05:14.731 PM osascript[6323]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
11/16/14 6:05:17.025 PM iGlasses[5891]: *** WARNING: CFMachPortSetInvalidationCallBack() called on a CFMachPort with a Mach port (0x1362b) which does not have any send rights. This is not going to work. Callback function: 0x7fff8e7e4e70
11/16/14 6:05:19.565 PM iGlasses[5891]: *** WARNING: CFMachPortSetInvalidationCallBack() called on a CFMachPort with a Mach port (0x147bb) which does not have any send rights. This is not going to work. Callback function: 0x7fff8e7e4e70
11/16/14 6:05:22.180 PM sharingd[4032]: 18:05:22.180 : Stopping Handoff advertising
11/16/14 6:05:22.428 PM iGlasses[5891]: assertion failed: 14A389: libxpc.dylib + 76986 [9437C02E-A07B-38C8-91CB-299FAA63083D]: 0x11
11/16/14 6:05:23.865 PM mdworker[6327]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:23.897 PM mdworker[6327]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:23.999 PM mdworker[6327]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:24.023 PM mdworker[6327]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:24.049 PM mdworker[6327]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:24.099 PM mdworker[6327]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:24.117 PM mdworker[6328]: code validation failed in the process of getting signing information: Error Domain=NSOSStatusErrorDomain Code=-67062 "The operation couldn’t be completed. (OSStatus error -67062.)"
11/16/14 6:05:24.419 PM mdworker[6328]: code validation failed in the process of getting signing information: Error Domain=NSOSStatusErrorDomain Code=-67030 "The operation couldn’t be completed. (OSStatus error -67030.)" UserInfo=0x7fabf36a4310 {SecCSArchitecture=i386}
11/16/14 6:05:24.420 PM mdworker[6327]: code validation failed in the process of getting signing information: Error Domain=NSOSStatusErrorDomain Code=-67030 "The operation couldn’t be completed. (OSStatus error -67030.)" UserInfo=0x7fe1455224f0 {SecCSArchitecture=i386}
11/16/14 6:05:24.424 PM mdworker[6327]: code validation failed in the process of getting signing information: Error Domain=NSOSStatusErrorDomain Code=-67062 "The operation couldn’t be completed. (OSStatus error -67062.)"
11/16/14 6:05:28.724 PM iGlasses[5891]: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
11/16/14 6:05:28.725 PM iGlasses[5891]: (
0 CoreFoundation 0x00007fff8e82964c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8e1506de objc_exception_throw + 43
2 CoreFoundation 0x00007fff8e6cd068 -[__NSPlaceholderArray initWithObjects:count:] + 360
3 CoreFoundation 0x00007fff8e7336b4 +[NSArray arrayWithObjects:count:] + 52
4 CoreFoundation 0x00007fff8e75b0fa -[NSDictionary allKeys] + 202
5 iGlasses 0x0000000100011544 -[iGlassesFrameSender aHostAppIsPlugin] + 38
6 iGlasses 0x0000000100011377 -[iGlassesFrameSender aHostAppIsPluginForApp:] + 29
7 iGlasses 0x0000000100004390 -[AppController checkActiveApp:] + 611
8 Foundation 0x00007fff8c2b2f4c __NSThreadPerformPerform + 293
9 CoreFoundation 0x00007fff8e747661 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10 CoreFoundation 0x00007fff8e7397ed __CFRunLoopDoSources0 + 269
11 CoreFoundation 0x00007fff8e738e1f __CFRunLoopRun + 927
12 CoreFoundation 0x00007fff8e738838 CFRunLoopRunSpecific + 296
13 HIToolbox 0x00007fff8405f43f RunCurrentEventLoopInMode + 235
14 HIToolbox 0x00007fff8405f1ba ReceiveNextEventCommon + 431
15 HIToolbox 0x00007fff8405effb _BlockUntilNextEventMatchingListInModeWithFilter + 71
16 AppKit 0x00007fff848de821 _DPSNextEvent + 964
17 AppKit 0x00007fff848ddfd0 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
18 AppKit 0x00007fff848d1f73 -[NSApplication run] + 594
19 AppKit 0x00007fff848bd424 NSApplicationMain + 1832
20 iGlasses 0x0000000100001b14 start + 52
11/16/14 6:05:28.747 PM sharingd[4032]: 18:05:28.747 : Stopping Handoff advertising
11/16/14 6:05:30.752 PM sharingd[4032]: 18:05:30.752 : Stopping Handoff advertising
11/16/14 6:05:33.603 PM SystemUIServer[4026]: Attempt to use XPC with a MachService that has HideUntilCheckIn set. This will result in unpredictable behavior: com.apple.backupd.status.xpc
11/16/14 6:05:50.398 PM BusyCal[5024]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:50.409 PM BusyCal[5024]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:50.418 PM BusyCal[5024]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:50.427 PM BusyCal[5024]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:50.436 PM BusyCal[5024]: Warning: accessing obsolete X509Anchors.
11/16/14 6:05:50.533 PM BusyCal[5024]: Warning: accessing obsolete X509Anchors.
11/16/14 6:06:14.792 PM osascript[6332]: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
11/16/14 6:06:14.794 PM osascript[6332]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
11/16/14 6:06:44.483 PM sharingd[4032]: 18:06:44.483 : Stopping Handoff advertising
11/16/14 6:06:52.944 PM sharingd[4032]: 18:06:52.944 : Stopping Handoff advertising
11/16/14 6:06:54.948 PM sharingd[4032]: 18:06:54.947 : Stopping Handoff advertising
Is iGlasses causing the problem?
EDIT: Wait— FaceTime launched after a several minutes (I hadn't force quit it), but the iSight camera light did not come on, and the FaceTime window shows something I've never seen before— a large image of a camera lens with a series of small spectrum-colored squares arrayed along its top edge. Moreover, the iGlasses mini-window that appears beside it lacks images, showing just small reproductions of that same image of a camera lens.
NEW EDIT: I tried using FaceTime. I called a friend, and the audio worked and I could see him, but all he could see was that same camera lens image. -
Help needed on correction applied to the rotatonY angle when using perspectiveProjection
Hello, can someone help me out please?
I have a stage with and height of : 600x400
On this stage i have 3 squares that have a centerpoint in the middle. The square are 90 (width) and 80 (height)
The first square is aligned to the left site and the second one in the middle and the third one on the right
The perspectiveProjection is setup using the middle of the stage as it projectionCenter.
When i rotate all squares to 90 degrees (rotationY) than only the middle one is now not visible anymore, at that point i want to
switch the image inside the square. But at 90 degrees the left and right squares are not invisible.. For the left square that point would
be at 90 - 22, and the right one 90 + 22. Is there a way to calculate the correction value (22) in this example?
What i don't want is to give every square it's own perspectiveProjecten , then it would work but you have a completely different
3D rotation.
The only thing that goes wrong in my example is that the image from the left and right square are not changed at the right time, because
90 degrees on the left square does not mean it it not visible at that point.
And here is the code:
import flash.display.MovieClip;
import flash.geom.Point;
import flash.geom.PerspectiveProjection;
import fl.transitions.*;
import fl.transitions.easing.*
var squares:Array = [c1, c2, c3];
this.transform.perspectiveProjection.projectionCenter = new Point(300, 200);
this.transform.perspectiveProjection.fieldOfView = 50;
for(var i:int = 0; i< squares.length; i++) {
var square:MovieClip = squares[i] as MovieClip;
var tween:Tween = new Tween(square, "rotationY", Strong.easeOut, 0, 180,8, true);
tween.addEventListener(TweenEvent.MOTION_CHANGE, onTweenUpdate);
function onTweenUpdate(e:TweenEvent):void {
if(e.currentTarget.obj.rotationY >=90) {
e.currentTarget.obj.img2.visible = true;
e.currentTarget.obj.img1.visible = false;
} else {
e.currentTarget.obj.img2.visible = false;
e.currentTarget.obj.img1.visible = true;
//trace("targ", e.target.obj.rotationY);try:
import flash.display.MovieClip;
import flash.geom.Point;
import flash.geom.PerspectiveProjection;
import fl.transitions.*;
import fl.transitions.easing.*
var squares:Array = [c1, c2, c3];
this.transform.perspectiveProjection.projectionCenter = new Point(300, 200);
this.transform.perspectiveProjection.fieldOfView = 50;
for(var i:int = 0; i< squares.length; i++) {
var square:MovieClip = squares[i] as MovieClip;
var tween:Tween = new Tween(square, "rotationY", Strong.easeOut, 0, 180,8, true);
tween.addEventListener(TweenEvent.MOTION_CHANGE, onTweenUpdate);
function onTweenUpdate(e:TweenEvent):void {
var theX:Number=e.currentTarget.obj.x;
var difX:Number=theX-this.transform.perspectiveProjection.projectionCenter.x;
var tempDegree:Number=e.currentTarget.obj.rotationY-(difX/10); // <---anyone know the right formula?
if(tempDegree>=90) {
e.currentTarget.obj.img2.visible = true;
e.currentTarget.obj.img1.visible = false;
} else {
e.currentTarget.obj.img2.visible = false;
e.currentTarget.obj.img1.visible = true;
//trace("targ", e.target.obj.rotationY); -
Info needed from Epochmaker please
Hello there,
I came across your post with the hairdryer trick for the G5 logic board. I'm currently experiencing the 3 flashes random boot problem on a G5 Dual 2.0 ghz June 2004 model and have followed all the other alternatives. I was wondering if you could post an image of the location of the memory controller chip you refer to as I can't find anything obvious on my board that is ' above and to the right of the lower RAM bank,'.
Any help would be greatly appreciated. I'm going to be away for a couple of days but I will make my email visible in my profile if that helps. it would be great to keep this one out of the landfill.
Cheers, L2K8Ok, final update.
warmed up the area suggested by Japamac ( square array of solder between banks on the right ) and had success in booting and running system off external firewire drive. Unfortunately only the first set of Ram was recognised ( inner slots ) but the next set was not. In moving the second set the original problem immediately returned.
Had another crack at heating the area between the banks and couldn't get the machine to boot. In fact, now the boot chime had stopped ( fans still whooshed up initially as normal ), no flashing LEDs and the fans then went full blast after a minute or so.
The most likely scenario is that I overdid the second 'reflow' and fried something else in the process. However, it did re-establish that it works if only in a limited way, and is useful to retrieve any data in the short term.
Someone with more skill or patience may well be able to achieve a more permanent fix. This machine is now destined to be broken for parts sadly. Many thanks again for the usual excellent support.
Cheers, L2K8 -
On this test site http://www.cybermountainwebservices.com/client0/dragdrop/
I create 25 randomly colored sprites that can be dragged and dropped, increases and decreased in size and have the alpha changed. There's an issue with the alpha that I think will go away when I move it to a slider. The thing that's bugging me is the way the sprites bove accross the screen when scaled they're supposed to stay put and scale wher they are. If I do a trace on the x and y of the sprite output says it's not moving yet I can clearly see it move.
Here's the code the revelent parts are in bold:
import flash.display.Sprite;
import flash.events.MouseEvent;
var squares:Array = new Array;
for(var i = 0; i < 25; i++){
var square:Sprite = new Sprite();
//square.name = "square" + i;
var c:ColorTransform = new ColorTransform();
c.color = (Math.random() * 0xFFFFFF);
square.transform.colorTransform = c;
square.graphics.beginFill(0x000000);
squares.push(square);
squares[i].graphics.drawRect(i*3, i*3, 100, 100);
this.stage.addChild(squares[i]);
upArrow.addEventListener(MouseEvent.MOUSE_DOWN, scaleUp);
upArrow.addEventListener(MouseEvent.MOUSE_UP, stopScale);
downArrow.addEventListener(MouseEvent.MOUSE_DOWN, scaleDown);
downArrow.addEventListener(MouseEvent.MOUSE_UP, stopScale);
alphaUp.addEventListener(MouseEvent.MOUSE_DOWN, increaseAlpha);
alphaUp.addEventListener(MouseEvent.MOUSE_UP, stopAlpha);
alphaDown.addEventListener(MouseEvent.MOUSE_DOWN, decreaseAlpha);
alphaDown.addEventListener(MouseEvent.MOUSE_UP, stopAlpha);
stage.frameRate=1000;
var timer:Timer=new Timer(5,0);
// ***************************Alpha *********************
function increaseAlpha(event:MouseEvent):void {
timer.addEventListener(TimerEvent.TIMER, alphaUpListener);
timer.start();
function alphaUpListener(e:TimerEvent):void {
trace("alphaUP " + lastTarget.alpha);
if(lastTarget.alpha < 1.00){
lastTarget.alpha*=1.01;
e.updateAfterEvent();
if (lastTarget.alpha == 1.00) {
alphaOff();
function decreaseAlpha(event:MouseEvent):void {
timer.addEventListener(TimerEvent.TIMER, alphaDownListener);
timer.start();
function alphaDownListener(e:TimerEvent):void {
trace("alphaDown" + lastTarget.alpha);
if(lastTarget.alpha > 0){
lastTarget.alpha*=.99;
e.updateAfterEvent();
if (lastTarget.alpha>.99) {
alphaOff();
function stopAlpha(event:MouseEvent):void {
alphaOff();
function alphaOff() {
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, alphaUpListener);
timer.removeEventListener(TimerEvent.TIMER, alphaDownListener);
// *************************** end Alpha *********************
// *************************** scaling **********************
function scaleUp(event:MouseEvent):void {
timer.addEventListener(TimerEvent.TIMER, timerListener);
timer.start();
function timerListener(e:TimerEvent):void {
if(lastTarget){
trace(lastTarget.x);
trace(lastTarget.y);
lastTarget.width*=1.01;
lastTarget.height*=1.01;
e.updateAfterEvent();
if (lastTarget.width>250) {
scaleOff();
function stopScale(event:MouseEvent):void {
scaleOff();
function scaleOff() {
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, timerListener);
timer.removeEventListener(TimerEvent.TIMER, timerListenerDown);
function scaleDown(event:MouseEvent):void {
timer.addEventListener(TimerEvent.TIMER, timerListenerDown);
timer.start();
function timerListenerDown(e:TimerEvent):void {
if(lastTarget){
lastTarget.scaleX*=.99;
lastTarget.scaleY*=.99;
e.updateAfterEvent();
if (lastTarget.width<2) {
scaleOff();
// ********** Drag Drop ***********
//var _targetPiece:*;
var lastTarget:*;
for(var j = 0; j < squares.length; j++){
squares[j].addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
squares[j].addEventListener(MouseEvent.MOUSE_UP, dropMovie);
squares[j].buttonMode = true;
function dragMovie(event:MouseEvent):void {
event.target.startDrag();
//this.filters = [new DropShadowFilter()];
//this.parent.addChild(this);
function dropMovie(event:MouseEvent):void {
event.target.stopDrag();
lastTarget = event.currentTarget;
// this.width = stage.stageWidth / 2;
// this.height = stage.stageHeight / 2;
//this.filters = [];
function disable():void {
this.buttonMode = false;
this.removeEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
this.removeEventListener(MouseEvent.MOUSE_UP, dropMovie);I see at least partially what you're saying if I go to the bottom of the pile that one doesn't have the problem. When I place the sprites on the stage at i*3, i*3 it seems there should be some way to be sure the registration point is there too. I need to sleep on this my brain works much better in the mornings. Doesn't the Strite have a local registration point? I'll get back to you in the morning.
-
I hope I can phrase this question right. I'm not sure what kind of terminology to use but I'll give it a shot.
How do I get the "Start Panel" and the "Application Tray" to both be on the same panel. I've tried placing them right next to each other but when the Application Try grows when new windows are opened, it expands over the Start Panel. I know it's possible to do because I've seen screenshots like this one:
http://upload.wikimedia.org/wikipedia/c … ce-4.4.png
but I'm not sure how to get it that way. I've tried using Panel Manager but I don't know how to add the Application Tray. Also, does anyone know which icon set that is? I'd actually like my desktop to look almost exactly like that.A thought: is your panel set to be "full width", in the centre? A "normal width" panel in the bottom left, with the Task List's "Minimum Width" parameter set just nicely to hit the right edge of the screen when empty would behave exactly as you describe.
Panel Manager: Fixed Position, centre (ie, one of the middle buttons in the square array of 12 placement buttons), Normal Width.
Task List: Set the Minimum Width to 100. No, really. In a "normal width" panel, it'll always expand to fit the space available, and if you set this value to the lowest possible, you won't run into any more problems if you add more stuff to the panel, or your System Tray fills up with icons: the List will just contract to give them space. Obviously, if it gets too small, you might want to change it to something larger, but for the moment, it should work fine like that. -
Java Double calculations produce greater error than C++?
I wrote PLU (A=PLU) decomposition program in Java to solve Ax=B. A, P,L and U are square arrays. x and B are vectors. The error was great for large matrices.My instructor suggested me to use C++. So, I wrote the same thing in C++. The error is much less now. The code is almost identical. I thought that both languages use the same IEEE standard.
Is it possible that java handles double calculations worse than C++ does?tmirzoev wrote:
matrix A and B are known. So, after my program computes x, I do Ax-B. Ideally, Ax-B=0. But that never happens because of the errors in floating point calculations. The problem that in Java that error Ax-b is much greater than in C++.Okay, but how do you know that Ax-b is greater in Java? Show your Java code and your C++ code. -
Hi, I am new to Java and I am currently trying to learn how to do multiple row searching in 2D array..
I have an input of character array that starts like this.
private static final char[][] bigSquare = {
{ 'F', 'G', '3', '4'},
{ 'F', 'G', 'C', 'D'},
{ 'E', 'F', 'G', 'H'},
{ 'E', 'F', 'G', 'H'}};
private static final char[][] smallSquare ={
{ 'F', 'G'},
{ 'F', 'G'}};I am suppose to find the number of occurence of the small squares in the bigSquare in this 2D character array.. but I have no idea how to start,
I currently have this code
//b is the big square, r is the small square, bSize is the width of the big square, rSize is the width of the small square
public static int checkOccurence(char[][] b, char[][] r, int bSize, int rSize) {
int n = 0; //to return
// TODO Search for square occurrences..
for (int i = 0; i < b[0].length; i++) {
for (int j = 0; j < b.length; j++) {
System.out.println();
return n;
}The above example should return 2
Can someone point me in the right direction? :(
Edited by: 873045 on Jul 17, 2011 2:01 PMmGx-Alander wrote:
Thanks Winston and Ram
I got it :DWell done. And isn't it much more satisfying when you get there by yourself?
Now to the critique - and don't worry, these are all things that you'll learn as you go on.
First: I don't like those 'bS' and 'rS' names (what is rS?). The 'bigSquare' and 'smallSquare' that you had originally were much better, and there's nothing to stop you using them in your checkOccurrence() method too. Just rename the parameters.
Second, your code assumes that your matrices are squares. In this case, you'll get the right answer (if the code is right; and at first glance it appears to be), but it makes the solution "brittle". What if the next assignment is to find a small rectangle inside a big one? Wouldn't it be nice to reuse the same code?
Third: I rather like your idea of banging the entire bigSquare into a 'line' of Locations - quite clever - but I suspect you can go even further. Have a think about it.
Fourth: You've got quite a lot of 'loops inside loops', which usually means that you haven't broken the problem down enough, and makes the code quite hard to read.
Now that you've got some working code, I'll give you my "pseudo description" of the solution:set 'numberFound' to 0.
for each cell in 'bigSquare', starting from the top-left:
if its value matches the top-left corner of 'smallSquare'
compare the 'internal square' starting here with the contents of 'smallSquare'.
if the contents match
add 1 to 'numberFound'.
end-for-each.Obviously, it's not detailed enough - the "compare the 'internal square'" line needs some fleshing out - but basically it describes the major steps.
So what about "compare the internal square"?
Get another piece of paper and describe how that works (which is basically all the inner stuff starting from "for (int r = 0; r < rS.length; r++) {...").
Now, most importantly, when you do your translation into Java, make all your pieces of paper separate methods. It's not a hard and fast rule; but it's not a bad one to start out with.
I think I might define the method something like:public static boolean completeMatch(char[][] bigSquare,
int atRow, int atColumn, char[][] smallSquare) {...and then your outer loop might look something like:for (int i = 0; i < loc.length; i++) {
int r = loc.getRow();
int c = loc[i].getCol();
boolean found = false;
if (bS[r][c] == rS[0][0])
found = completeMatch(bS, r, c, rS);
if (found)
++n;
}a bit neater, don't you think?
There are many other ways to do it (for example, you could make the 'top left corner' check the first thing in your 'completeMatch()' method; I probably would), but the main idea is: break things down.
If you find yourself writing reams of code in the same method (my usual rule of thumb is about a screenfull): Stop; and think about how you could break it up.
HIH
Winston
Maybe you are looking for
-
NetStream.Play.Stop : Problem:
Hi, I have develop video streaming application with Flash Media server 3.5 + and Use Dynamic stream feature , this player work correct in all way but issue with NetStream.Play.Stop() command set while playing video without EOF i.e video file .f4v fo
-
Caller Display Charge from Jan 2014
With regard to the soon to be chargeable options 1571 and Caller Display I am confused as to whether I would be charged or not. For 1571 I cancelled this a few years ago as it interferred with my Answerphone, so hopefully there will be no automatic '
-
What is the function to change paragraph styles?
I'm trying to make a simple script that changes a raw data file that has preset Paragraph style already in the exported data from a HTML calender, and once its copied over into Indesign it changes the already existing paragraph style into a diffrent
-
How to lock a pane within front panel
Hello, i am trying to lock a single specific pane of my front panel while handling an event. or the inverse in the event structure, one can lock the front panel while performing the event. i would like this to happen, in order to avoid queuing other
-
JDeveloper 10.1.3. - Web application run problem
I have created new Application workspace and new application with only one empty JSF page. JDeveloper created all related configuration files, but when I start the application, I get this error: [Starting OC4J using the following ports: HTTP=8988, RM