Tuesday, October 16, 2012

Print plot in MATLAB in Mac OS X

If you receive an error when using the File-> Print option in Mac OS X in MATLAB.

Problem sending file to output device, system returned error :
lpr: The printer or class was not found.

...

Just follow the steps.

1. In Safari, navigate to http://localhost:631
2. Click on the “Administration” tab, and then “Edit Configuration File”
3. At the top of the editable block of text, add these lines:

Printcap /etc/printcap
PrintcapFormat BSD # For Snow Leopard only


4. Click “Save Changes”. It may take 30 seconds or longer for these changes to go into effect.
5. Restart MATLAB.
Read more ...

Monday, October 8, 2012

Run MATLAB script in terminal

Just type command like following.

matlab -nojvm -nodesktop -r "run <the-script>.m"
matlab -nojvm -nodesktop -r "<the-script>"
matlab -nojvm -nodesktop -r "run <the/path>/<the-script>.m"
Read more ...

MATLAB runtime_error solution

When you running MATLAB, if you encountered an error like this:

terminate called after throwing an instance of 'std::runtime_error'  what():  locale::facet::_S_create_c_locale name not valid

It is easy to solve just by setting environmental variable LC_ALL="en_US.utf8"

bash: export LC_ALL="en_US.utf8"
csh: setenv LC_ALL "en_US.utf8"

It is better to add this to your bash or csh profile.
e.g.
.bshrc
.cshrc
.bash_profile
Read more ...

Thursday, October 4, 2012

如何删除Mac App Store中别人帐号已购应用程序的更新提示

如果安装了别人破解的应用程序,Mac App Store 提示应用程序有更新,会需要输入别人的AppleID信息。如果要清除提示。

1. 在Mac App Store中安装一个免费的App,然后在“应用程序”中找到这个App,右击 –> “显示包内容”–> 进入文件夹“Contents”–> 拷贝“_CodeSignature”,“_MASReceipt”。

2. 在“应用程序”中找到那个破解的App,右击 –> “显示包内容”–> 进入文件夹“Contents”,把刚才拷贝的“_CodeSignature”,“_MASReceipt”粘贴进来覆盖原来的。
Read more ...