Notes

A place to record somethings related to programming.


  • 首頁

  • 歸檔

  • 標籤

  • 檢索

Sublime Text Notes

發表於 2014-11-05 |

Guide:
http://zh.lucida.me/blog/sublime-text-complete-guide/
http://code.kpman.cc/2014/10/14/sublime-text-3-mac-指南/

Add to mac terminal

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl

Install Package Controller
https://sublime.wbond.net/installation

Math symbol

發表於 2014-11-01 |

Norm

( |x| = \sqrt{x_1^2+…+x_n^2} ) in n-dimensional Euclidean space
( |x|1 = \sum\limits{i=1}^n |x_i| )
( |x|p = (\sum\limits{i=1}^n |x_i|^p)^{1/p} )

Vector dot product

( \vec{a} \cdot \vec{b} = \sum\limits_{i=1}^n a_i b_i = |\vec{a}| |\vec{b}| cos(\theta) )
( cos(\theta) = \frac{\vec{a} \cdot \vec{b}} {|\vec{a}| |\vec{b}|} )
And dot product also means projection =>
( |\vec{a}| cos(\theta) ) is the component of vector a in direction b. (project a to b)
( |\vec{b}| ) is the length of vector b. However, if b is normal vector, then ( |\vec{b}| ) is one.

Using MathJax in Blogger

發表於 2014-10-25 |

It’s really easy. Just add the following code above <head> in blogger’s template:

<script type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
And you can test it now! \( J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\bigl({\frac{x}{2}}\bigr)}^{2 m + \alpha} \)
\(
         J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\bigl({\frac{x}{2}}\bigr)}^{2 m + \alpha}

\)

Using SyntaxHighlighter in Blogger

發表於 2014-10-25 |

I use the Google Code Prettify Now.
https://amobiz.github.io/2013/05/28/blogger-google-code-prettify-github-gist/
https://github.com/google/code-prettify/
Use method:
<pre class=”prettyprint”></pre>

Add the following code above the <head> in your blogger’s template:

<link href=”http://alexgorbatchev.com/pub/sh/current/styles/shCore.css“ rel=”stylesheet” type=”text/css”></link>
<!– the theme can change –>
<link href=”http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css“ rel=”stylesheet” type=”text/css”></link>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js“ type=”text/javascript”></script>
<script src=”http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js“ type=”text/javascript”></script>
<script language=”javascript”>
SyntaxHighlighter.config.bloggerMode = true; //need to add this if we use blogger
SyntaxHighlighter.all();
</script>
And one thing need to note is that if you want to add some code with < or >, you need to encode the code first. For example, you can use: http://www.opinionatedgeek.com/dotnet/tools/htmlencode/encode.aspx

Reference:
http://alexgorbatchev.com/SyntaxHighlighter/
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html

1…56
Jack Pan

Jack Pan

54 文章
24 標籤
© 2017 Jack Pan
由 Hexo 強力驅動
主題 - NexT.Mist