Empty trash gets stuck

Ever had the issue that you click empty trash and it just hangs? Found this useful method here

  • Go to Finder and select Finder » Secure Empty Trash.
    • If this operation gets stuck, open the Activity Monitor utility and force quit the Locum process. Enter your admin password when requested.
  • Go back to Finder and select Finder » Empty Trash.

🙂

Advertisements

Configuring SBJSON-framework for XCode 4.2

Procedure to use json-framework in XCode 4.2

1) Open or create your project
2) Open the SBJSON XCode project file “SBJson.xcodeproj

pastedgraphic 1

 

Now drag the SBJson application to you project. There seems to be a bug in the XCode I am using in that it does not display as shown below. Close the project and open it again and it will work.

 

Now strap it in.

Click on your project file
Click the Targets section
Click the Build Phases

Expand target Dependencies
Click the “+” to add a dependency
Choose “sbjson-ios” under the SBJson project

Now expand the “Link Binary with Libraries”, click + and add “libsbjson-ios.a”

That’s it. All done

Transfer database from one server to another

Some times you want to copy a database from one server to another. This is painful and found a easy way to do it from a few other blogs

 

$ mysqldump -u username -p'password' db-name | ssh user@remote.box.com mysql -u username -p'password db-name

 

 

Change MySQL inno dB to file per table

This will create a file per table instead of just one big inno db file

cd /usr/local/mysql/support-files/
sudo cp my-huge.cnf /etc/my.cnf
sudo vi /etc/my.cnf

add this under [mysqld]

innodb_file_per_table

Now create the tables as required after restarting MySQL

Eclipse Java Heap Memory size

Getting the Out of Memory error when running eclipse? Increase heap space using

eclipse -vmargs -Xmx<memory size>

but how do you do this in OSX? Surprisingly difficult to find out how to do this in OSX, but here it is:

If you are using Mac OS X, and launch eclipse using the Finder, the eclipse.ini in eclipse folder doesn’t have any effect. You need to open the Eclipse package (right click, show package content), open the Max OS folder, and edit the eclipse ini located there.

FlexUnit4 Async Testing Events

When doing Unit testing in FlexUnit 4, you can test Async event firing. This is a tricky test if there are multiple events being fired. The reason it gets tricky is because of the single threaded nature of Flex.

When you simply dispatch one event ofter the other, they are added to the display stack and thus handled in REVERSE order when removed from the stack. However, if you are using remote calls, the stack is given a change to execute, while the remote call is sent off and thus Async events happen in NORMAL order. What makes this really tricky is if you have a combination of local events (reverse order) and remote events (normal order)

Here are some high level examples:

Example 1

dispatchEvent(Event1)

dispatchEvent(Event2)

dispatchEvent(Event3)

Correct Async testing is now done in reverse order, since each event is added to the display stack

Async.proceedOnEvent(this, someEventDispatcher, Event3, checkVars3, 500, null, noEventFired);

Async.proceedOnEvent(this, someEventDispatcher, Event2, checkVars2, 500, null, noEventFired);

Async.proceedOnEvent(this, someEventDispatcher, Event1, checkVars1, 500, null, noEventFired);

Notice the order of the Async.proceedOnEvent is reversed

Example 2

remote call(Event1)

dispatchEvent(Event2)

dispatchEvent(Event3)

Async.proceedOnEvent(this, someEventDispatcher, Event1, checkVars1, 500, null, noEventFired);

Async.proceedOnEvent(this, someEventDispatcher, Event3, checkVars3, 500, null, noEventFired);

Async.proceedOnEvent(this, someEventDispatcher, Event2, checkVars2, 500, null, noEventFired);

Notice the remote call clears properly, but the local calls are reverse order.

So the only way to do this is to understand that if a remote call is executed, you check for it and that if there are any local events, they are placed on a stack until no more events or a remote event takes place and then checked in reverse order.

Tricky….

Redirect Tomcat ROOT index.html to your site app

If I have a app at https://abc.com/server/client.html, I want to redirect traffic going to https://abc.com to the same app and not the default Tomcat root page.

Put this in the …/webaps/ROOT/index.html

<html>
<head>
<meta http-equiv=”refresh” content=”0;URL=http[s]://abc.com/server/client.html”>
</head>
<body>
</body>
</html>