Useful Gibberish

Archive for the ‘Tricks and Tips’ Category

Matlab: How to plot boob?

Yes, serious.

Reading emails about professors dying because of  radio-active rays or students suiciding because of stresses makes me want to stop for while and forget what I’m doing.

But I can’t leave my computer, so I have to do something with it.

Google is useful for this purpose, now all I need is a silly question. I use Matlab to plot a lot of my data, but never I’d plotted boob, which is no doubt a lot more attractive than those stress-strain curve of the simulation. Fortunately, there’s a Wolfram’s widget provides the function, so I put it in Matlab and tried, it’s pretty funny.

Here is the code:

figure();
fplot(@(x) -(3*x*log(x)-0.1*exp(-(30*x-12)^6)),[0 1])

Here is the result:

2017-04-07_20-01-46

Revisit Maths after the hiatus

It’s been a long time since I last read any maths related document. Now it’s time to revisit some ‘casse-tête’ theories and algorithms.

Here is what appear in the document I’m studying:

Lagrange multiplier

Taylor series (sometimes I forget, silly me)

Tensor (admittedly, I hate this, but it’s everywhere in my life now)

Those are the basic, now let’s read some journals:

Annals of Mathematics: a super high research level, reading them to know you’re still nothing (The name Princeton reminds you something?).

American Maths Monthly: very interesting maths journal from America.

Epsilon/Pi/Maths and Youth (free/pirated): Vietnamese maths journal. Epsilon is free, and a ‘was’ (the editors stopped and open Pi journal, which is a paid journal, but not too expensive). Maths and Youth is a traditional Vietnamese maths journal, it is a not-so-bad journal (I rate 6/10).

 

Viết blog wordpress với Markdown

Giới thiệu

Một trong những lí do tôi dùng wordpress là vì nó miễn phí nhưng lại hỗ trợ cho người viết những công cụ tốt nhất, tiện nhất có thể. Trước đây là nhúng code và viết công thức toán, gần đây tôi mới biết thêm Markdown.

Markdown là một công cụ giúp viết trên web dễ dàng hơn vì dùng nó thì không cần thiết phải dùng chuột nữa. Với những kí tự cơ bản, những công việc định dạng như tô đậm chữ, in nghiêng chữ, thêm hình ảnh, quote… trở nên đơn giản đến không ngờ, một trong những hiệu qủa tức thì đó là viết được tập trung hơn.

Ví dụ

Để tô đậm chữ, chỉ gần để chữ ở trong ** và **.

Để in nghiêng chữ, để chữ ở trong * và *.

Ngay cả cái trò footnote hay reference cũng hay 1, viết blog mà cứ như là viết báo khoa học vậy.

Kết hợp cả thêm hình ảnh:

Tiêu đề ảnh

hay là block code:

print 'Hello world!'

List cũng dễ không kém:

  • Đây là một cái
  • Đây là cái thứ hai

và cuối cùng là quote:

Đây là quote nhé

Kết luận

Markdown giúp người viết tiết kiệm rất nhiều thời gian khi viết; nó đặc biệt hữu dụng khi kết hợp với các công cụ kiểm tra chính tả, câu cú… Quan trọng nhất vẫn là kỹ năng của người viết, không nên làm dụng quá máy móc, phần mềm. Tuy nhiên, khi làm việc nên tận dụng tối đa các sự trợ giúp có thể. Chúc các bạn viết blog vui và hay!


  1. Footnote là một dạng chú thích thêm ở cuối trang. 

Awesome posts from all over the blogs in this week (week 34/2014)

I started to collect awesome post from other blog to share in my personal blog, they’re about life tips, ideas, design inspirations…

1. Taking note techniques from Japanese people:

http://blog.highfivehq.com/posts/a-little-known-hack-from-japan-to-get-your-notebook-organized

This is one of the coolest technique to take note that I’ve ever read. Hat tip to Japanese people.

2. Finding local peak in a curve with Matlab:

Data post-processing is very important in your research, the original author knew that and shared you this matlab code

http://blogs.mathworks.com/pick/2009/11/13/this-peaks-my-interest/

3. Sharpen your photo using High pass filter in Photoshop:

This is a very simple but powerful technique to sharpen your photos. Work like a charm!

http://news.dphotographer.co.uk/tutorials/creative-use-of-the-high-pass-filter-in-photoshop-to-sharpen-your-images/

Your equipment doesn’t decide your talent

I’m talking mainly about photography and some high-tech stuff like drawing tablet (Wacom), smartphone (SS Note or whatever).

Sometimes I cry inside a little when seeing someone owning a Canon 5D mark II but he has only blurry out focus photos in his collection, and the way he maintains his gears is worse: camera full of dust, the lens are full of finger prints… but he still thinks he’s professional. That’s one story.

Another story is when someone complains about sketching, like “I don’t have a tablet, pity”, “I don’t have good equipment” etc. and refuse to make good artwork, but I’m sorry, making a sketch takes you only a plain white paper and a normal piece of pencil (oh well, an eraser is obvious), and to be honest, drawing on paper gives me better feelings than drawing with digital devices (yes it’s has some cons and sometimes inconvenient for post-processing on computer but anyway). There is tool for you to quickly digitalize your sketch, just scan them and trace line in illustrator, tons of tutorials on the internet can help you, here is one example.

The important point here is the ideas that you have, and the most important thing to maintain in your way of making art (or even you’re doing maths and physics just like me) is to keep your having fun when doing something, practising is the best advice I can give. Yet I’m not professional, but I’m always trying to do my best. The idea is so important that you have to give it food everyday, and when your ideas are good to go, then thinking about buying good devices and softwares.

Write, draw, sketch, colour, think, code, take picture… It’s fun then do it, if it’s not fun, do it till you find some fun in it.

 

Draw particles contact with tikz

I wrote this code long time ago and I want to share it since it’s pretty cool and come in handy a lot of times.


\begin{figure}[H]
\begin{tikzpicture}[scale=0.5]
\draw[step=.5cm,lightgray,very thin] (0.1,0.6) grid (7.8,6.8);
\draw[fill=yellow,fill opacity=0.5] (1,3.5) -- (2,5) -- (4,5.5) -- (6,3.6) -- (4,2) -- (2,2) -- (1,3.5);
\draw[fill=cyan,fill opacity=0.5] (1,3.5) circle (0.78cm);
\draw[fill=cyan,fill opacity=0.5] (2,5) circle (1cm);
\draw[fill=cyan,fill opacity=0.5] (4,5.5) circle (1.05cm);
\draw[fill=cyan,fill opacity=0.5] (6,3.72) circle (1.64cm);
\draw[fill=cyan,fill opacity=0.5] (4,2) circle (1cm);
\draw[fill=cyan,fill opacity=0.5] (2,2) circle (1cm);
\fill[black,font=\footnotesize]
(1,3.5) node [above] {$P_1$}
(2,5) node [above] {$P_2$}
(4,5.5) node [above] {$P_3$}
(6,3.6) node [above] {$P_4$}
(4,2) node [above] {$P_5$}
(2,2) node [above] {$P_6$};
\draw[thick,->] (9,3.5) -- (10,3.5);
% draw 2 particles use for pair of contacts
\draw[fill=cyan,fill opacity=0.5] (13,5.5) circle (1.05cm);
\draw[fill=cyan,fill opacity=0.5] (15,3.72) circle (1.64cm);
\fill[black,font=\small]
(13,5.5) node [above] {$P_3$}
(15,3.72) node [above] {$P_4$};
\draw[blue,->,thick] (13,5.5) -- (15,3.72);
\fill[blue,font=\small]
(14,4.5) node [below] {$\vec{l}_{\,3,4}$};
\draw[red,->,thick] (13.784,4.802) -- (15.784,5);
\fill[red,font=\small]
(15.9,5) node [above] {$\vec{f}_{\,3,4}$};
% equation of the stress tensor
\fill[black,font=\small]
(14,2) node [below] {$\sigma_{ij}=\frac{1}{V}\sum \limits_{c} f_{ij}^c\times l_{ij}^c$};
\end{tikzpicture}
\caption{Calculation of meso-stress in a cycle of grains}
\end{figure}

Use Cisco AnyConnect VPN in Window 8

I had this problem, and I found it on the internet.
In Window 8, when connect to a vpn server, window 8 gives your error, but why? The same configuration with Win 7 works extremely well.

To make Cisco AnyConnect Client work in Win8, you should make a small fix in Window’s registry:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vpnva]

"DisplayName"="Cisco AnyConnect VPN Virtual Miniport Adapter for Windows x64"

Tag Cloud