Wednesday, May 23, 2018

Matlab reshape arrays with internal structures

I have an array like this:

    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}
    {1×2 cell}

But I want to turn it into a 10X2 array.

The way to do it is
[cellfun(@(x) x{1},array,'UniformOutput',false) cellfun(@(x) x{2},array,'UniformOutput',false)];

Matlab Cellfun Arrayfun take multiple inputs

This is done by defining a function

arrayfun(@(z) plus(z, k), x)

Tuesday, May 22, 2018

[solved]Mac Finder gets stuck and can't force quit

I used activity monitor to force quit but it would always restart. The solution is to force quit only once and give it time to recover by itself.

Monday, May 21, 2018

ggplot color names list

Check out this page:

http://sape.inf.usi.ch/quick-reference/ggplot2/colour

Saturday, May 19, 2018

set up automatic modification/update time for your website

If you want to make the "last updated" info on your website automatically generated, you may use these codes:

the script tag should look like <script type="text/javascript">

also it is preferable to use the dom to insert content into the page, not document.write.

in the head:
PHP:
<script type="text/javascript">onload = function(){
    
document.getElementById("lastModified").innerHTML "Page last changed " document.lastModified.split(" ")[0];
}
</script>
later on in the body:

HTML:
<span id="lastModified"></span>
good read: http://www.quirksmode.org/js/lastmod.html
These are copied from here: https://forums.techguy.org/threads/how-can-i-get-an-automatic-last-updated-in-my-web-page.693929/

Sunday, May 13, 2018

activate Chase credit card you received

Visit this page and log in

https://www.chase.com/content/chasecom/en/credit-cards/rtbl/verify-credit-card

Saturday, May 12, 2018

[solved] Word can delete any spaces after a paragraph

This occurred to me:
My Word automatically changes page between some graphs and there would be an empty page sometimes. Even if i tried to delete the empty spaces between paragraphs or in the empty page, it didn't disappear.

Solution:
Presss 'Delete' on the right part of your keyboard to delete the trailing spaces.

Tuesday, May 8, 2018

[solved]How to get Metro Bike Pass for Student, $5 , when you already have an account

Your school or Metro may offer a discount with a promotion code. However, you may not be able to get it since you've already got a monthly pass and are not willing to start a new account.

The solution is: You can call them to update the account type. They may refund you the balance.