Text Size
Wednesday, May 22, 2013

IOS and LAMP Web Developer Blog by Mike Zriel

Photography

Photography

You can't open the application adobe photoshop cs6 because it may be damaged or incomplete

BY: Mike Zriel

You can't open the application adobe photoshop cs6 because it may be damaged or incomplete on a Mac

To fix this problem on a Mac you need to uninstall and re-install Photoshop cs6, this is how you do it:

In your Application folders ( SHIFT - CMD - A ) open the Utilities folder, look for Adobe Installers and click on Uninstall Adobe Photoshop CS6

Now when you restart "Adobe Application Manager" it will re-download Photoshop CS6 for Mac.

 
IOS Xcode

IOS Xcode

Last Updated on Tuesday, 30 April 2013 08:32

cocos2d create animations from sprite sheet loaded by plist

BY: Mike Zriel

xCode Cocos2s Animation

Here is how to load animations from Sprite sheet and use a second plist for subset of animation you want:


[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"zriel-sprite-sheet.plist"]; // Sprite Sheet files name ( png and plist )

CCSprite *player1 = [CCSprite  spriteWithSpriteFrameName: @"zriel-animation1-first-frame.png"]; // Add Character with first frame
        
player1.position = ccp(screenSize.width / 2,screenSize.height /2); // put in centre of screen
// player1.rotation = 180;
// player1.scale = 2;
// player1.opacity = .25;
// player1.visible = NO;
player1.tag=1; // Assign a number so you can reference during runtime
[self addChild:player1]; // Add player1 to Sceene


NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"zriel-animation1" ofType:@"plist"]]; // NSDictionary subset of entire sprite sheet 
NSMutableArray *frames = [[NSMutableArray alloc] init];  // create array to hold frames
for(int i=1; i<10;i++) { 
   NSLog(@"key=%d value=%@", i, [dict objectForKey:[NSString stringWithFormat:@"%d",i]]); // Log Results
  [frames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[dict objectForKey:[NSString stringWithFormat:@"%d",i]]]]; // Add frames from plist to frames array
}
CCAnimation *animation1 = [CCAnimation animationWithSpriteFrames:frames delay:1.0f/9.0f]; // create animation with speed of 1/9 of a second

 [player1 runAction:[CCSequence actions:
         [CCAnimate actionWithAnimation: animation1],
         [CCAnimate actionWithAnimation: animation1],
         [CCAnimate actionWithAnimation: animation1],
                                         nil]]; // Run animation1, 3 times

Plist would contain a key of 1 and value of "zriel-animation1-first-frame.png" and key of 2 and value of "zriel-animation1-second-frame.png" for example

 
IOS Xcode

IOS Xcode

Last Updated on Wednesday, 17 April 2013 09:22

Show Hide hidden files on mac for example .DS_Store

BY: Mike Zriel

How to show hidden folders using finder on a mac do this:

defaults write com.apple.finder AppleShowAllFiles -bool true
osascript -e 'quit app "Finder"'

How to hide hidden folders using finder on a mac do this:

defaults write com.apple.finder AppleShowAllFiles -bool false
osascript -e 'quit app "Finder"'

The -bool flag makes it work, I have tried NO, YES , True, False and it did not work.

killall Finder did not work for me either but osascript -e 'quit app "Finder"' does work.

Mac version 10.8.3

 
Joomla

Joomla

Joomla get db database name in your own component

BY: Mike Zriel

How to get database name from within your code in Joomla 3.0 do the following:

// Get Database Name

$config = JFactory::getConfig();

$databaseName=$config->get('db');

You can get any parameter you need from the configuration.php this way.

 

Latest comments

  • fafasdff
  • I am a microsoft system engineer and I'm not famil...
  • It really help me fixing errors in joomla mobile d...
  • Thanks a ton !
  • fh
Copyright © 2013 by Mike Zriel - Zriel.com