Thursday, December 30, 2010

Getting apt-get and bzr to work behind a proxy

in /etc/bash.bashrc

append
export HTTP_PROXY=http://username:password@address:port/
          export HTTPS_PROXY=https://username:password@address:port/
export FTP_PROXY=http://username:password@address:port/

save it *(you prolly need superuser privilege(ie., sudo su) to edit bashrc).

and type apt-get update to see if you could retrieve a list of updates.

**** if it doesn't work try rebooting or input the below command ****
and then type the following command
user@prompt>source /etc/bash.bashrc
**** OR if it still doesn't work try rebooting or input the below command ****

sudo gedit /etc/apt/apt.conf
And add Acquire::http::Proxy "http://username:password@proxyhost:port/";

or you can perform the above in ~/.profile

As for pulling from GIT
since most corp(i think) would block GIT port(9418?), its best to relay everything through http port.
Under most circumstance, changing from git: to http: would do the trick.

OR

 export http_proxy=http://myproxy.domain.com:1234
$ git config --global http.proxy $http_proxy
## if you 
if you have $http_proxy set up as mentioned already.

Eclipse, permgen size, configure, outofmemoryerror

java.lang.OutOfMemoryError: PermGen

To alleviate the problem, you could edit the XXMaxPermSize in Eclipse.ini
...
--launcher.XXMaxPermSize
256M
...

to your desired size.

Thursday, December 23, 2010

Running Matlab codes on multicores

Running Matlab codes with multicores has never been this easy!

For your great, great, great work, my sincere thank you to you, Markus Buehren. Thank you.

http://www.mathworks.com/matlabcentral/fileexchange/13775


To run it, it's fairly simple.

Say you are looping a function called DoSomething(x, y, z) 20 times.
In your standard procedures, you would have:
for i =1:20,
%% derivation/computation of x,y,z
DoSomething(x,y,z);
end

Now you will need to rewrite your codes, for example:
paramCell = cell(20,3);
for i = 1:20
paramCell{1, i} = x;%% of course you could merge the 3 args together!!
paramCell{2, i} = y;%%
paramCell{3, i} = z;%%
end

startmulticoremaster(@DoSomething, paramCell, settings); %% for settings just copy settings from the demo!

good, nifty script!!!! Thanks once again!