Archive

Tag Archives: working

Recently I have been working a lot on migrating android projects to use gradle building system. Seriously it is much better than the old time. I can easily use libraries on maven repositories and customize my building process. I also no long need to create a desperate project for testing. Awesome!

it’s been a while since the last post. After coming to new york, I have been very busy on my study, personal projects and (of course) playing around. studying in new york university is harsh, but not as hard as i think. I met nice people, hanged out with my beloved new friends. I even found people having great interests in technologies and software development.

I am trying to work on instamusic as long as i have time. I also shared my project of javascript injector with my friend, and hoping to expand service and functions that it can have. I am grateful to see that there are still many people using my applications and sending emails to me. thank you very much and i will try my best to make something new.

with love, a photo in central park is nice.

peace.

DSC053452

shot

What’s happening

One day, when I opened up terminal as usual, it showed [Process completed] and just terminated. I could not type any thing, run any scripts and work on my project. Even worse, this made me unable to install programs into my computer because many installations need to run shell scripts. Okay, I searched over the internet and there was no solution for that. I even peaked many parts in the Mac OSX system to see if there were any mis-configuration, of course nothing helps. After all, I though if there is nothing wrong, it must be  something done with my /bin/bash. And after I upgraded my bash, my lovely terminal came back!

[expand title=”Let’s fix it” tag=”h5″ trigclass=”arrowright”]

Change shell’s default execution

The truth is, when you open terminal, it execute /bin/bash. As it is not working now, we need another environment for us to execute stuff. Open “Terminal->Preference”, and change “Shells open with” manually to “/bin/sh”.

Change What Shell Opens

Update /bin/bash

Now we are going to download the latest version of bash and replace the old one. Open up a new terminal and now you are able to execute commands. Copy and paste the following codes into the terminal, they will automatically handle everything for you.

	curl -LO ftp://ftp.cwru.edu/pub/bash/bash-4.2.tar.gz
	tar zxvf bash-4.2.tar.gz
	cd bash-4.2
	./configure && make && sudo make install
	chsh -s /usr/local/bin/bash {user_name}
	sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells"
	cd /bin
	sudo mv bash bash-old
	sudo ln -s /usr/local/bin/bash bash
	
Once done

Go to “Terminal->Preference” again and change :Shells open with: back to “Default login shell”. Enjoy!

[/expand]

[expand title=”Detailed explanations” tag=”h5″ trigclass=”arrowright”]

What I did?

Okay, I admit that I did something to the system sometimes ago. I was doing some experiments on “sandboxing” and played with “chroot jail” stuff before. That is, I need to create an environment with restricted support to the program I run. So I wrote a sandbox, configured it’s root to a ‘secure’ place (anywhere not the actual root), and copy essential executables to that new root. Well, so far I think I didn’t do anything harm to the system, but I might corrupt the /bin/bash when I copied it to the sandbox root.

Diagnosis

Shell will run the following files before letting user to do anything. Check everyone to see if there are any misconfigurations.

  • ~/.bash_profile (for /bin/bash)
  • ~/.profile (for /bin/sh)
  • /etc/profile (for /bin/sh)
  • /etc/bashrc (for /bin/bash)
  • (google for more)

To play with, add some echoes to see if they works. Btw, I love nano more than vi, so try out “sudo nano /etc/bashrc”.

Playing with Shell
Another thing

The code above updates your bash to version 4.2. To check if there is any new version, go to the ftp.
ftp://ftp.cwru.edu/pub/bash/

Reference

http://techscienceinterest.blogspot.com/2010/05/change-to-new-bash-shell-41-for-mac-os.html


[/expand]

Hi there, its been a long time that InstaMusic haven’t been updated. Sorry for that because I had been so busy in working on a game project in my company. Anyway, I am quitting for the sake of pursuing a master degree. And finally I have time to implement what I thought up and designed!

An new application “InstaMusic Beta Channel” will show up in Android Play Store soon. This application aims to provide a cutting-edge version of InstaMusic. This app could be unstable, lots of force closes, however this helps me kill bugs in the program. For those who only wants a stable music playback, please download the original “InstaMusic”.

As a new version is coming out, I have created a feature list presenting the main improvements done or working on.

  1. Stability
    InstaMusic has been unstable for a long time. Music stops suddenly without telling. After a deep diagnosis, the core reason leading this bug is found, and a fix is patched! Music never stops now!
  2. Loading Speed
    Media loading speed has been a big concern for me while generating the music list. Long loading time affects user experience and might hinder other operations. Anyway, I have designed a new architecture specially for the list generation. This assured an optimised, low memory usage, synchronised and dynamic list generation.
  3. Jelly Bean Support (Working in Progress) 
    There are lots of new features and supports from platforms beginning from Android 4.0 such as notification controls and new theme styles. I am working on making use of those new features and to create a whole new user experience for users!
  4. Editable Playlists integrating with Favourite List (Working in Progress)
    In the next version of InstaMusic, Favorite List will be integrated into Playlist. The reason is… actually there is no reason to separate them lol.

Thank you for your supporting so far. Please comment below and tell me what you think on InstaMusic!

I have been working with Cocos2D for a while and I am still a newbie. The way to deal with animations in Cocos2D 1.0.0 – the stable version currently – is different from the way before using CCSpriteSheet. Now Cocos2D adapts animations as cache shared in the project using CCSpriteFrameCache. It also requires a plist file as well as a texture file.

First, put the following assets into the project “Resources” folder to let the program use.

  • grossini.plist – The file contain the animation information such as frame details.
  • grossini.pvr.gz – The texture file in pvr format which allow better performance in Cocos2D.

Second, add the following codes into the function init. Take a look at the comments for program explanation. =]

// Capture the window size
CGSize size = [[CCDirector sharedDirector] winSize];

// Load the plist into the cache
CCSpriteFrameCache *cache = [CCSpriteFrameCache sharedSpriteFrameCache];
[cache addSpriteFramesWithFile:@"grossini.plist"];

// Create sprite with the first frame
CCSprite *sprite = [CCSprite spriteWithSpriteFrameName:@"grossini_dance_01.png"];
sprite.position = ccp( size.width/2, size.height/2);
sprite.anchorPoint = ccp(0.5f, 0.5f);

// Create array for the animation frames
NSMutableArray *animFrames = [NSMutableArray array];
for(int i = 0; i < 14; i++) {
    CCSpriteFrame *frame = [cache spriteFrameByName:[NSString stringWithFormat:@"grossini_dance_%02d.png",(i+1)]];
    [animFrames addObject:frame];
}

// Convert the array into animation
CCAnimation *animation = [CCAnimation animationWithFrames:animFrames];

// Run the sprite with the created animation and display it by adding it to the scene
[sprite runAction:[CCRepeatForever actionWithAction: [CCAnimate actionWithDuration:2.8f animation:animation restoreOriginalFrame:NO] ]];
[self addChild:sprite z:0];

After all, don’t forget to deallocate the resources loaded in cache in function dealloc.

// Deallocate the resource in cache
CCSpriteFrameCache *cache = [CCSpriteFrameCache sharedSpriteFrameCache];
[cache removeSpriteFramesFromFile:@"animations/grossini.plist"];

Finally, this is a screenshot. Enjoy. XD

It is very disappointing that the League of Legends for Mac is closed after 6 Sep. It is really sad to see the compulsory close button after opening the LoL as shown in the below screenshot.

Luckily, there is a way to make the game working again temporary. Technically, as the game is a transplant from Windows with the emulator tool Wine, the whole thing is just running a Windows program in Mac environment. Therefore it is possible to put the files of LoL in Windows back to Mac to trick the server that I am using Windows. Of course, please take your own risk to do the following steps. =]

Step 1: Download the Windows version of LoLLauncher.exe here.

Step 2: Replace the LoLLauncher.exe with the downloaded one under
/Applications/League of Legends.app/
Contents/Resources/transgaming/c_drive/rads/projects/lol_launcher/releases/0.0.0.33/deploy/

Step 3: Relaunch the LoL and now you are able to update your game! Hope this fix would last longer! =]

After days struggling with the new Mail 5, there has been a breakthrough. I finally fix the problem and Apple Mail 5 is now working with the Mbox Mail for Mac. As there is still some more work to do to pack the programs, as a support i hope somebody could make me some donation. As a preview, a screenshot is shown below. I will release my work as soon as I finish and the donation reach US$100, please comment and notify me after donation. Thanks a lot! =]

Okay, I give up. Go here:
Fix Mbox Mail for Mac on Lion, works Apple Mail 5

%d bloggers like this: