My goal for 2012

Give back to the open source world.

Why? I have this sudden feel that I have simply taken too much from all the open source projects and that I have not been able to really contribute to any of them yet. I feel that I have owe too much to all the open source developers (100% of SleepBot is built on open source technology). So my goal for 2012 will be contribute to a few open source projects, or open source some tools and patterns I developed in the past.  :) 

Happy coding. ​

So...this summer.........

After two weeks of averaging 3 hours of sleep, Cooper is finally out of the way. Comparing to last semester, I did about the same--which is bad. It was a mere result of lack of attendance to the easiest classes and doing bad in them because I overestimated myself. Anyways, hopefully I will get around 3.0 (all I need is A in signals processing, eh, doesn't sound so possible).

Other than the grades, the past semester went great. I managed to meet a lot new friends, learn a lot, and at the same time accomplish a lot. There is just one thing, however, I need to point out here before making a plan for this summer, is that I got through my grad level programming class: distributed computing, with 3 other seniors who pushed through like I did. It was the reason that I did bad in many of my other classes, but I did really enjoy learning such software engineering topics. It gets me excited. My final project was on Distributed Similar Image Search, it worked (see the picture at the end). Basically what it does is that it performs a search with the search term the user provided (e.g. square) and get the results from various search engines including Google, Bing, and Flickr, then the user can choose an image (or even provide an image in future releases, if I ever decide to come back to it) to match the image with the rest of the set. The system uses Hadoop Map-Reduce framework to distribute the image matching job and the search engine querying job to different mappers and reducers so that the job is performed quickly and efficiently (for those who don't know, Google also uses a similar Map-Reduce system to allow us to search the entire internet and return the results in less than half of a second). The program framework that I wrote can be easily extended and be made into a real reverse image search engine provided that there exists a good image hashing algorithm and a large image database for me. I spent about three weeks on it, starting from writing a original Java algorithm, playing with search engine APIs, and then learning how to deploy it with Apache Tomcat and Hadoop within/out of an Eclipse environment. I really learned a lot.

Ok, before I talk another few hours about that project, let me go straight into the real topic of this post: my plan for this summer.

It is much simpler than past:  (TWO INTERNSHIPS + START MY OWN BUSINESS + FOR REAL)

1. Internship with Tidal Labs. -I will be working there three days a week this summer. I would say that this is an engineering startup that aims to help the marketing departments of big companies and the marketing firms to data mining people off social network. I choose to work for them because see potential from the growing social marketing companies. It is also php and python based, so I can learn more about those two and at the same time learn about how to handle different situations for a startup company.

2.Internship with Indorse Technology. -I will be working there two days a week this summer.

This is the company of my professor who taught me distributed computing this semester. I'm looking forward to learn a lot more with him on both managing business and coding. We will see how it goes this summer.

3.Start my own thing with friends.

Information about this will be released in a future post while we are still discussing our business plan. It will be a huge thing (<--no jokes please lol).

After all, this summer will be very fruitful for me and should make me stay away from getting use to leisure so I would get killed in Fall.

4. If time allows, I will be able to push Bmark.Me to the next stage.

A distributed get image job result:

A sample run on finding similar image for a square picture

A distributed compare image job with efforts to find the ones that are similar to the first one

Looking for Alpha Testers

Hi friends,

After over one year of development, I'm happy to announce that Bookmark Me! has finally graduated from my home sever and it's ready for testing. Here I am inviting all of you, whoever is looking at this post right now, to become a tester for my project. The site still lack AJAX implementations, it's still 'plain text', so please excuse its appearance for now.

To become a tester, simply let me know by any means (fb comment/email/text), and registration forms will be sent to your Inbox within 24 hours.

My email is :

FAQ

So what is Bmark.Me?

Project "Bookmark Me !" (Http://www.bmark.me) was an idea I formed at my 19th birthday, when I got inspired by few of my friends. It finally reached it's alpha stage and will be used by NYU's Chinese Mei Society as one of its marketing device (http://yuan10.wordpress.com) It is a link sharing site will have the following features as its top 10:

1. Storing a link and retrieve it with with a customized alias. (Done) 2. Sharing the link with facebook, twitter, etc. (In progress) 3. The owner can track the link's hits and referrers. (In progress) 4. For facebook users, the owner can see specifically who visited this link, and the visitors can choose not to reveal their identity as well. (In progress) 5. Links will be both scanned by anti-virus providers and the community. (In progress) 6. User can add tags, descriptions, and photos to associate the link. Using this feature, we can even suggest you links that you will be interested in!! 7. Users can view top linked sites and top tags by popularity. (Done) 8. Photo search on links. Since photos are tagged on links, one should be able to search using a photo and tag terms to identify which links are associated with the link. (Planned) 9. Private links, the owner can hide and/or password protect individual links.(In Progress) 10. A new business model for ad-clicking sites and marketing firms via new technologies. (Planned)

Why am I doing this while all the other sites are doing a great job?

1. I will offer some functionalities that they don't, for example: facebook tracking and photo searching. 2. When I first had this idea, the only popular site back then was TinyUrl, so this site, if implemented back then, would be a huge success. 3. This is part of my PHP Code portfolio for myself in the future. 4. I learned a lot, and will learn much more through the course of development. The goal is to make this site efficient, able to scale up, and extensible.

Why didn't you use HTTP 301 redirect to make it search engine friendly?

It is search engine friendly, in less efficient but more flexible way. The way I did it is that eventually the user can choose which method they want, either by using 301 or javascript redirect. The reason because of the behavior of the link previews from sites like facebook catches the link only catches whats there without letting the re-director modifying it. By using a javascript redirect in the middle of the page, the re-director can manipulate the information that will catch by facebook. For example, when you do a redirect of some blog you wrote with site like bit.ly and share it via facebook and you didn't write a summary for the blog, facebook will not catch what your blog says. However, by using bmark.me you can add pictures for link preview, etc. just to attract viewers. This could potentially evolve into an advertising method for many different purposes.

Why are you taking down the link scanning feature off after a few month?

To be honest, I didn't want to take it off since it is a very unique thing to do. It might be up again.

Right now, I am looking for two people for help,

1. CSS styler and web-page designers. 2. AJAX and Java-script writers.

I will share the honors.

Thanks for reading to the end, Edison

Week 5 and 6.....Midterms finished

Bmark.Me developing will continue after the Physics Exam one..

Because I have already wasted too much time, all the features that I imagined to have are already implemented....

So it is time to me to brainstorm some more innovative (atm) ideas again.

Last time the ideas I had were pretty good, and they are ALL implemented in all the major sites now.

What else can I do for a bookmark site? .....

Combining features of different sites wouldn't work too well, so therefore I need new ideas...

Any suggestions? ....

3/14 of School

Week 3: 1. Work are not getting done. (However, I have just completed 40% of them in the past 3 days...60% left, still a lot) 2. Feelings are getting worse. (Someone simply doesn't care that much) A staying overnight let me see that it won't work and my answer is no to annie's questions... 3. I care even more now... Yea, I do promise that I will be the best one who treat her (not treat her the best? idunno, I'm a good person, I treat everyone well, lolz). I have way too many 'haorenka' for too many people, so I think I should at least getting something back? idunno...at least a little? My relationship life is pathetic. 4. I have decided that I WILL finish bmark.me...and other projects...that needs to be done asap. 5. I will participate(hopefully) in the 2009 ACM contest again!!! ~~  Very excited ~~  Wish I can solve 2+ problems again. Java/C++ this time, I am not sure.....Java handles a lot stuff better due to its newer existence, but C++ is definitely more powerful, faster, and flexible. 6. ZERO for physics Qz.. yea, I did give up that one, I'm sorry, there was no time for it. I will do well afterwards.

Garena Host Drop Method...Investigated..~

Recently I started playing W3C TFT on Garena since my (friend mike's ) CD-key were banned due to excessive 'dual use'. And that Garena actually keeps records of your gaming stauts. Sometimes, however, in Garena the Host can just drop people from the other team when he is lossing.

I thought for a while and tried my guess on how it works.

The way to do it without any tool is fairly simple:

1. While lossing, just tell people that you will remaking. 2. TURN OFF YOUR WIFI/UNPLUG YOUR ETHENET CABLE. 3. Tab back to the game, wait for 30sec-1min. 4.  Keep pushing...the game is urs!

This is cheating.....so yea...same policy as other cheating things I made, They are just for entertaining purposes, I am not taking the responsibility of irresponsibility.

Back to the ideas... So I wonder how do you only kick certain people? Then I realized that Garena just mimicks LAN, so that you can simply Block some users from accessing your computer,...as simple as that ......um~I do believe general firewalls can achieve those in Advanced Settings.

However, if you are a computer noob, there is what i suggest you do: 1. Tell your teammates / friend to stay ~ 2. Then excute the drop method.

anyhoO~~~..just a simple hack for fun~

Sinovision Photograph Contest ....with CURL

Between July 4th to August 4th, the U.S Chinese Community Channel Sinovision is hosting a photograph contest with "Summer" as its theme. My mom entered it. Apparently she has the best picture over there, with a natrual 1000 hits in one day, and was selected as the best picture so far by Sinovision.net. However, she did not receive the highest hits, because the top five are all cheaters.

So......As a son, I stood out...taking one minute to change a CURL refreshing code I wrote before and a few minutes to understand the machanism of the site, I realized how easy it is to "hack" it.

Running 10 CURL scripts from 3 different servers, I had reached my highest speed of 500 hits per minute, and in a fairly fast speed we become #1 within an hour (running time only, because I stopped in the middle a few times).

This morning, I saw that the second place cheater is catching up...... So I let him catch up.....almost hit my number than I started my scripts again(from only 1 server, 5 instances).

Result: Score ratio is 12,000: 3,000 The other guy gave up. The site received too much volume and was down.

Here I apologize to Sinovision.net for what I did.

But the experience is really cool and satisfactory as a programmer and as a son.

Because it is a hacking script, I will not show it here, just google CURL and think about how it works.

P.S.  The PHP. CURL library is one of the most useful and powerful extension(mod) for PHP. It uses a lot server resources but delivers very powerful results with its fairly simple APIs provided. As you can see, CURL is a very good hacking tool (for guessing POST/GET and addresses of sites).

A very simple Music Libery Builder

My friend Ray was uploading some musics of his to his private network so he can listen to them anywhere he wants without sharing them. So I build wrote this simple PHP page for him to let him build a simple music player by just clicking: (Note: XSPF is the standard for MP3 playlists Details at http://www.xspf.org/)
include 'SecurityChecking.php';
$FileList=filesInDir('SOMEDIRECTORY');
$content="\n".
	 "\n".
	 "\n";
foreach($FileList as $file)
	$content.=""SOMEDIRECTORY.$file."\n"; //And other mp3 meta infos.
$content.="\n\n";
$file="default.xspf";
$fh = fopen($file, 'w+') or die("can't open file");
fwrite($fh, $content);
fclose($fh);
echo "Successful! Thanks to Edison.";
function filesInDir($tdir){
	$dirs = scandir($tdir);
        foreach($dirs as $file){
                if (($file == '.')||($file == '..')){}
                elseif (is_dir($tdir.'/'.$file))
                        filesInDir($tdir.'/'.$file);
                else
                        $return[]=$file;
        }
	return $return;
}

Somethings I found interesting for PHP OOP

Having OOPed in PHP5 for a while, I have some things that PHP5 have made more convinient than other OOP supported languages. One is the variable variables feature of PHP to make the setters and getters.

for example, a getter could look like the following:

	public function get($att){
               return $this->{$att};
	}
That is, instead of makings lots of get_att, just make one function to return the fields. By checking specific type, fields can be made private.
	public function get($att){
               if ($att!="password"){
                              return $this->{$att};
               } else {
                 throw new Execption("Restricted Property Cannot Be Returned");
               }
	}
And a client could be called as
try { echo $object->get($att);
} catch .....execption handling..etc.
as proper calls are made, the right field will be printed otherwise exceptions will be caught. Adding more(lots) if statements for different attributes may result the code running at a insignificantly slower speed but it may simply lose the purpose of doing it using variable variables. Similarly, a setter can look like the following:
	public function set($att,$new_value){
		$new_value=$db->escape($new_value);
		$att=$db->escape($new_value);
		$this->db->query("UPDATE `table` SET '$att'='$new_value' WHERE `id`='$id'");
		$this->{$att}=$new_value;
	}
In Java, a map will simply be used. -> well,~it is much less convinent than as in php*.

*Credit to Professor Sable.