Oops, it has been a long time since my last blog post. Many things happened and I will try my best to update each major incident. Stay tuned!
How in AI?
2018年10月21日 星期日
2016年10月10日 星期一
Introducing ... React Polygon
Due to the need of my recent work, I have published a new library called "react-polygon" on here. It is my first react library and it did help me in many ways.
Here I wanna talk about something about this project:
Q1. Why Reactjs?
A1. Mmm.. There is no specific for it. The main reason is that the project inspired me is built in Reactjs I do want to take the advantage of it and build the helper for me. After it, I make it into a library which can help more people.
Q2. Why specified for Polygons? Isn't there is a D3.js already?
A2. I would say the D3 binding for Reactjs is not well supported yet which I cannot build my own polygon with enough customizations. Therefore I have to write my own polygon generator in Reactjs. Of course, if you are doing something with native Javascript support, you probably need the D3.js instead.
Q3. How good is your own developed "Polygons generator"?
A3. Not the best. But I do think it is good enough for general purpose. You can have a look at the demo here.
Q4. Any other business?
A4. Not a big deal right now as it is built into a stable version and I did publish it to npm now. You can check it here.
You know, this is my first public library ever and I dun really know what I am doing. In order to make this happen, I have to thank the boss of my previous project which inspired me for the idea of this library.
P.s. the library now gets 2 stars from other people. This is a great push for me to go forward.
Here I wanna talk about something about this project:
Q1. Why Reactjs?
A1. Mmm.. There is no specific for it. The main reason is that the project inspired me is built in Reactjs I do want to take the advantage of it and build the helper for me. After it, I make it into a library which can help more people.
Q2. Why specified for Polygons? Isn't there is a D3.js already?
A2. I would say the D3 binding for Reactjs is not well supported yet which I cannot build my own polygon with enough customizations. Therefore I have to write my own polygon generator in Reactjs. Of course, if you are doing something with native Javascript support, you probably need the D3.js instead.
Q3. How good is your own developed "Polygons generator"?
A3. Not the best. But I do think it is good enough for general purpose. You can have a look at the demo here.
Q4. Any other business?
A4. Not a big deal right now as it is built into a stable version and I did publish it to npm now. You can check it here.
You know, this is my first public library ever and I dun really know what I am doing. In order to make this happen, I have to thank the boss of my previous project which inspired me for the idea of this library.
P.s. the library now gets 2 stars from other people. This is a great push for me to go forward.
標籤:
Reactjs,
Web Development
2016年7月30日 星期六
Take a peep on Genetic Algorithm (a.k.a mimicking naïve evolution)
Pre
Since stuff didn't go that busy on these days, finally got a chance to take a quick look on the Genetic Algorithm (GA) and understand the basics of it. Before this, I was overwhelmed by the side projects as well as the internship. The side projects are mainly about the node app and stuff about html, javascript and css. More specifically, one is React app and another one is Angular app. Doing these two projects simultaneously seems over-killing. Anyway, this is the whole point of life, right?
You know, a peep doesn't give you the whole picture. I just watched two great videos which explain the algorithm quite well.
- A open lecture from MIT: https://www.youtube.com/watch?v=kHyNqSnzP8Y
- A kinda book sharing of the Nature of Code (good book though): https://www.youtube.com/watch?v=6l6b78Y4V7Y
After these two videos, I got the full picture about the GA. However, it is becomes more and more complicated when the problem size and all the controls you could make to improve the accuracy as well as diversity.
There are a few terms which would be stuck in your head if you are going to look around the GA.
Fitness
A mathematical function (or map function) to evaluate how well the current population is.
Genotype and Phenotype
Genotype is the data structure (or say the binary) of your population, just like the chromosome (or say DNA) in our body which determined the phenotype.
Phenotype is the physical representation of your genotype. You can imagine it as the iris, hair color, and height of humans.
Evolution
The whole point of GA is to mimic the evolution again in your problem space. There are some basic steps:
- Initialize the state or random generate some "creatures"
- Evaluate them by the fitness function
- Select some amount of population to survive according to some functions (can imagine as a simple probability that higher fitness would be more likely to be selected) [Natural Selection]
- Reproduce and Crossover the genotypes
- Mutate the genotypes according to a small probability
- With this new set of population, go back to step #2 and loop until the appropriate solution is found
Actually, GA is nothing like super fancy. But it sounds quite fancy and professional by itself. I will try to do a simple demo in the following weeks and try to dig more into it and see if I can find out anything special.
Post
After reading through these materials, I just felt like computer scientists are quite keen on mimicking the whole world (maybe be should say God?). Look at what we have today, the neural network, which is going to be competitive to human brains in the following years. So...should there any stance between this kind of mimicking and the nature? In the video, there is one interesting question asked if we put the same algorithm back to real life. Would that be possible? Of yes, that's why we can survive till nowadays. Stop until it grows? We may say "Stop before it starts".
標籤:
AI,
Algorithm,
Genetic Algorithm
2016年7月20日 星期三
De-the-bug, oh yeah!
Let the bug crawls!
"A bug is never just a mistake. It represents something bigger. An error of thinking. That makes you who you are." - Eliot @ Mr. RobotToday, we just spent a half day to de-a-bug. This is a tough, really really tough bug. Let me tell you a story of this:
TL;DR
1. Last week, I found that the performance of one of the Power8 clusters for running the Spark is abnormal. Also, it is even slower than another Intel Xeon machine which has "worse" specs than this one.2. As the power8 machine has more cores and more memory, even the clock speed is faster than the Xeon machine, we totally have no idea on this issue.
3. First, we tested with a simple Spark application but no luck. We tried to dig into each stage step by step to see the duration, write time and serialization delay sort of things.
4. After that, we put the focus on the JVM. We suspected that JVM would cause a performance difference as IBM Java and Oracle Java are used on Power8 and Xeon respectively. However, the performance still differed after installing OpenJDK on both machines for a simple Java sorting program.
5. As we did't have any idea on Java, we targeted on something more fundamental --- C.
6. Guess what? After dealing with the optimization flags and all sorts of CPU benchmarking, we concluded that even the Power8 has "higher" specs than Xeon, Xeon stills outweigh it because of an all-rounded functionality and optimized instructions set.
2016年7月16日 星期六
A new journey in Levyx, Inc and More
Turn a new page
After spamming all the companies and startups nearby, I finally got a position in Levyx, Inc. This is a great to place to work, hmm... not exactly only but learn much as well. Great place, nice people, awesome food and free environment make me enjoying here so much!
Diving into Big Data
One of the important goals for me to choose working here is that I can take this awesome opportunity to learn the things that I couldn't learn by myself in terms of resources, environment, and timing.
Before the work, I was told to get familiar with Scala which is a functional programming running on JVM. The reason is that the framework we are using now, the Spark is based on Scala (actually, it does support Python and R natively).
Spark is a framework which emphasizes on the parallel processing of the data. When you start dealing with Spark, you will get overwhelmed with the term, "RDD" which is "Resilient Distributed Datasets". Because of the power of RDD, Spark could result in high performance in data processing as well as other application like Machine Learning and MapReduce.
Once more thing, I got the access to some "powerful" machines as well for the profiling. The "powerful" I talked here is about 60+ cores and 200GB+ memory with 3TB+ SSD. I will find a better way to utilize (or torture) these machines. 😎
Oh, by the way...
I am still in California for this internship. Yes, I will go back in September. See you guys there~~~
2016年6月9日 星期四
Build your own Speedometer!
**Disclaimer**
This is not a legit tutorial, but just a preview.
Recept of Speedometer
Introduction:
In my class of Embedded System, I decided to build a wireless speedometer for my bike since I didn't buy it for my bike.Ingredient:
Atmel Atmega32 * 140 DIP socket * 1
8Mhz Crystal * 1
HC05 Bluetooth module * 1
Reed Switch * 1
Magnet * 1
9V Battery * 1
LM7805 * 1 (equivalent 5v regulator)
Perfboard * 1
Pin sockets * 1 bunch
Solder wires * 1 bunch
Single-core wires * 1 bunch
Instruction:
1. Plan out your circuit diagram!!! Make sure you get the right side of the chip and other components (because I made a stupid mistake which made me re-solder everything).2. Check you circuit diagram again and again. This can save your components second or third lives.
3. Put your components on the perfboard, but not solder yet. You may use some solder wire to hold the temporary position.
4. Hold your breath and solder them!
5. After soldering, check if the circuits are matched with your diagram.
6. Put the components on and ...... boom!
Result:
Besides the hardware, I have also built an Android app for the user interface:
For more information or code, you may have a look of there: https://github.com/peteroid/avr-study-projects (in the folder of bike-speedometer)
Stay tuned for the next awesome project!
2016年5月26日 星期四
Presentation for UCI HKN
Open Source Project
A blog plugin based on React JS.Your Motivation
Take the chance to learn React JS and make myself the blog plugin.Steps You Took
- learn React JS (obviously)
- setup npm: dependencies
- setup Webpack: ReactJS, BabelJS, webpack-dev-server
- setup Grunt: sass (css preprocessor), uglify (javascript minifior)
Challenges and Obstacles
New syntax for ReactJS (more than JS, more than HTML)
Vulnerable for Cross-site Scripting
Now using: https://facebook.github.io/react/tips/dangerously-set-inner-html.htmlBecause the output of the contents of a post from Blogger API is purely html......
Results
![]() |
| Main page of the blog |
![]() |
| Content page of a post |
Future Possibilities
- Integrate with different blog provider: Tumblr, Facebook blog
- Make it more modular
訂閱:
意見 (Atom)









