My Archives

mephis stands for mephisto, who cares about memphis

Detecting browsers javascript hacks in a tweet

leave a comment »

Hi folks.

I am recently very fond of the term “code in a tweet” which means that a very useful piece of source code can even fit a Twitter post.  Below here is the shortest javascript that can detect IE browser by Andrea (yeah, IE sucks and we have to detect it to eliminate its problems)


IE='\v'=='v'

Moreover, Gareth Heyes has come up with other browser detections and gather them together


//Firefox detector 2/3 by DoctorDan
FF=/a/[-1]=='a'

//Firefox 3
FF3=(function x(){})[-5]=='x'

//Firefox 2
FF2=(function x(){})[-6]=='x'

//IE detector I posted previously
IE='\v'=='v'

//Safari detector
Saf=/a/.__proto__=='//'

//Chrome
Chr=/source/.test((/a/.toString+''))

//Opera
Op=/^function \(/.test([].sort)

Usage: The variable assignment is the abbreviation of the browser e.g. FF, IE, Op, Saf, Chr which return true or false.

And this is the most interesting part: one-liner to rule them all


B=(function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown'

Usage: B will return a string of the abbreviation of the browser
Tell me what do you think? And if you find any cool stuff like that let me know.

Written by mephis1987

February 15, 2009 at 12:25 am

Posted in Uncategorized

MooTools the Ajax experience

leave a comment »

[Updated] Sorry to be arrogant and simple minded but I always think jQuery rocks and try to inspire as many people as possible to use or move to jQuery because of  one simple reason: the more users and developers use jQuery the better it is and the more plugins will be created.

[Updated] jQuery 1.3 is out and it is super fast ! Read more

I have once used Mootools for one of my projects and it turned out to be running well. The performance was fast and I had no problem implementing its animation effects and plugins. However, I found several complaints about mootools on the Internet that will affect my choice of JS library in the future.

  1. Mootools does not have any well organized or responsive forum.
  2. It does not even have all of the many useful threads that were written for 1.1 available. What it does have – a Google group – is so undermonitered that John Resig’s profile shows up on the home page (now what does that say about JQuery responsiveness)! I have never, never! gotten a response to any of the requests I have made on the Google group page, despite my not being a noob.
  3. No plugins are available unless you already know where to find them, or you write them yourselves. As oppossed to J which makes it easy to get plugins. Yes I know they posted something on the blog.
  4. SVN was dumped for GIT. Maybe not bad from a technical standpoint, but I don’t know how to use GIT, and am not about to start learning.
  5. I rarely see the core developers on IRC, probably because we have different hours. But it is very difficult to get answers there, and thread is downright insulting to noobs – no matter how much he wants to learn. Worse though, the channel is not be stored. All of the questions and answers that are served are only to individuals – they cannot be accessed by someone who is searching for an answer. And lets face it – IRC is not good for most users. Is it so hard to have a chat box on the screen that allows for normal people to communicate, or at least to be able to see the thread?! I know a good framework that can be used to write such a tool!

Written by mephis1987

February 6, 2009 at 6:03 pm

Posted in Uncategorized

If you gonna set up a web startup …

leave a comment »

Wanna be the next Google? Do I hear a “Yes” elsewhere ? I have loads of thoughts on this since I love doing web startup. So let’s do this checklist to realize…

1. Do you know absolutely everything about your business? Do you eat your own dog food? Those “Well, I will use my product later when it is fully developed/established” or “Ehr, I will use my service later, got things to do now…” will definitely fail, more here

2. Are you ambitious/motivated enough? Doing startup is not doing your everday work, if you work only 8 hours a day and spend the rest of the day relaxing then you better quit it. Most IT staff work 8 hours per day under excellent management and what will make your company the next Google since there is no difference between you and other normal IT staff.

3. Do you have a successful team? From Taneli

Startup teams should be about things like attitude, values, goals, objectives, motivation, trust, learning, courage, energy, intensity, competence, superior judgement and good communication (emphasis on feedback).

They should not be about: micro-management, processes, business plans, formal matters, profit and loss statements, reports, politics, non-action, vague visions and missions, long hours and exhausted managers, strict roles and responsibilities.

Success Teams are often full of leaders. There isn’t just one central person responsible of leadership: everybody leads, and they lead to every possible direction: their own teams, colleagues, their bosses, partners etc.

And in the end, let’s discuss a quote from Kristoffer Lawson:

New startups are fantastic because they still think it’s easy so they’ll go for it and only later realise the deep hole they got themselves into :-)

Now you decide: do you give up or go forwards with the lessons learnt. If you decide to continue, chances are you’ll have now learnt stuff the hard way and will be much better tomorrow. You need to be hammered to eventually become world-beaters!

Written by mephis1987

November 2, 2008 at 10:30 pm

Posted in update

Tagged with ,

We solved the problems with Flash 10

leave a comment »

As you may know Flash 10 came out a week ago and due to its change in security policy we had to change the uploader as well as fix our flash player. It was fun doing pair programming with Kelvin. I myself was coding a brand new navigation, a forum and its feed. Thanks to MVC architecture, those things only cost me a week and it was a piece of cake. Meanwhile, Kelvin has completed tailoring the feed system and the flash player. Nice, MahShelf is running with its full speed.

Written by mephis1987

October 24, 2008 at 5:17 pm

Posted in development

Tagged with ,

Summer holidays, a month off means more tasks for me

leave a comment »

Hi, long time to see in this blog. And that was because I have been in my summer holidays in Espoo, Finland. It is such a nice city though there was not many interesting activities there. For me, hanging out with friends is enough fun.

Here is the list of things happened while I am away:

  • Tasks, tasks, more tasks are coming and I have no choice but to finish it in order to keep up with the schedule.
  • A brand new forum for Vietnamese students in Finland. It was created with the passion to replace the old one which is not quite well-organized and supported. Take a look and enjoy yourself there. :D

Updated: Looks like the old admin board did not accept to migrate to the new one. I agree that the old one has been the playground for the early students for a while and it has a great impact on them. But why did not they realize that the old fun time just passed away, the playground is rotten because of the way they administrated it: full of irrelevant posts in some important forums, no connection with other Vietnamese students in other cities and absolutely no help to the newcomers.

I heard that the only (functional) admin shares no access to the control panel to the other admin. Therefore he is the one who responsible to upgrade, react on emergency and have total control on the backend. If that was true then I do not have anything to say more, a communist forum, ehr ?

Hmm, feel free to post comments here :)

Written by mephis1987

July 10, 2008 at 2:25 pm

An draft entry for MahShelf.com

leave a comment »

Dear users, enjoy the weekend with out new flash reader. Hopefully it will bring the easiness of reading and page navigating.

Beyond the basic features, there are some new features that worths mentioning:

Auto-hide menubar: not satisfy with the reading area why dont you increase it by hiding the menu bar?

In fullscreen mode, you can use mouse scroll to navigate to either the next page or previous page. It rocks!

A new brand new look and feel of the reader, no more I have to look at the old ugly reader.

There are much more hidden features in the flash reader and I let you figure out yourself.

Posting comments is more interesting with emoticons. Here is a list of all available emoticons (including hidden ones)

‘:)’=>’happy.png’,
‘:-)’=>’happy.png’,
‘:))’=>’smile.png’,
‘:-))’=>’smile.png’,
‘:D’=>’biggrin.png’,
‘:-D’=>’biggrin.png’,
‘:-O’=>’suprised.png’,
‘:O’=>’suprised.png’,
‘:S’=>’confused.png’,
‘:-S’=>’confused.png’,
‘:s’=>’confused.png’,
‘:-s’=>’confused.png’,
“;(”=>’cry.png’,
‘;-(’=>’cry.png’,
‘:(’=>’sad.png’,
‘:-(’=>’sad.png’,
‘:p’=>’tongue.png’,
‘:-p’=>’tongue.png’,
‘:P’=>’tongue.png’,
‘:-P’=>’tongue.png’,
‘;)’=>’wink.png’,
‘;-)’=>’wink.png’,
‘X(’=>’angry.png’,
‘X-(’=>’angry.png’,
‘8-)’=>’cool.png’,
‘8)’=>’cool.png’,
‘:idea:’=>’idea.png’,
‘:fav:’=>’favorite.png’,

Written by mephis1987

May 18, 2008 at 4:40 am

Posted in Uncategorized

The 5 Stages of a Consumer Web Startup

leave a comment »

This is a collected article from GigaOM,  so please remember the copyright belongs to them:

In my years covering technology, I’ve gotten more than my fair share of pitches related to the latest consumer Internet startup. Thanks to this I’ve been able to witness what amounts to be a near-familiar life cycle for these companies. Not every company hits every step, but most of these will be familiar to those of you in the Silicon Valley Social Media/Web 2.0-Something trenches.

 

IN THE BEGINNING 

One day an entrepreneur is chatting with his friends, gets an idea, writes about the idea on his or her blog, and then starts coding. A few weeks or possibly days, a beta — increasingly a euphemism for a not-fully-thought-out-product — emerges.

 

THE LAUNCH 

Then the buzz builds and the company opens up the beta far and wide. Maybe TechCrunch, ReadWriteWeb, WebWorkerDaily or WebWare write about the product. Either way, this is the first traffic spike and the entrepreneur rejoices. The VCs come calling. If they don’t, the angels will certainly do a fly-by.

But eight weeks later reality sets in. The traffic stops growing or — worse yet– dives. The VCs stop calling and blogs start posting Alexa charts that look like ski slopes or tabletops. But as an ever-optimistic entrepreneur it’s time to regroup, gather your programmers, toss back some Red Bull and…

 

LAUNCH A SOCIAL NETWORK WIDGET 

If the user adoption press releases, the widget and subsequent coverage can’t get your site growing again, it’s time for the big guns...the open API. Now you’re a platform! The startup gets a fresh round of publicity, maybe more exposure to new users, and the founder rejoices again. This time the money men get serious because you have shown them you can survive the Silicon Valley jungle and you have a Facebook strategy.

 

12 MONTHS LATER 

Maybe the media is getting too insistent with their questions about how this service is supposed to make money. Maybe the bills from Amazon Web Services are getting too high, or the VCs are getting impatient. The blogs are back to posting unflattering Alexa numbers. Compete data backs those charts up! So it’s time for advertising.

If the startup is well-funded or has a famous founder, the ad unit might be something novel like awidgetpre-roll voice ads on a mobile phone, or Beacon. Otherwise it’s generally based on banners and Google AdWords with promises of more to come.

 

THE END IS NEAR 

But selling online advertising is hard. If Google, Yahoo, AOL or Microsoft haven’t stopped by with a buyout, it’s time to consider reality. You could always try your hand as an ad network or merge with a competitor, but more than likely it’s time to sell that domain name and user base on eBay or quietly shut your doors. Better luck next time.

Written by mephis1987

May 9, 2008 at 11:54 pm

Posted in Uncategorized

Tagged with , , ,

A week of Memphis #2 (28 April 2008 -> 4 May 2008)

leave a comment »

Done:

  • Refactor the code and delete image preview feature
  • Study for exams
  • Synchronize my calendar and todo list between google calendar and Rainlendar
  • Make some hotfixes in the server
  • Start reading the book: The Art of Agile Development

Written by mephis1987

May 9, 2008 at 4:13 am

Posted in development, update

Tagged with , , ,

Am I not skillful enough?

with 2 comments

This is a post expressing my thought and criticism on myself.

After attending the arctic startup event in Helsinki, I have seen lots of cool company and noticed what is their development stage, what is the development method and how talented they are … I also realized that our team is at the very beginning stage and indeed we are not cool. And if we can not survive or evolve, we are doomed.

A serious start-up company will not take normal people, in fact the company decreases the failure risk percentage by hiring (extremely) talented people. However, I am more or less a normal person, I did go to school every day, did play games every week, and programmed as a hobby… Sometimes, I ask myself how serious I am in this project, and what is the situation I am facing now if I continue living like I did before. Will I fail ?

I am facing a chance, yes it is a chance to completely change my life. Never before have I realized that I almost catch up with the web 2.0 trends, and if I do not do anything, I am losing it. Never before have I realized that this is the only chance to be popular and rich and to let my beloved mom know that she can be proud of her son. Yes, by the time I left that bar, I realized it well and suddenly I knew that my team was far behind race, we are somehow losing the battle because of the development process is too slow.

A friend made a joke that he definitely will not work for a start-up company like us because of the risk. However, I did take it seriously, I know that we are bearing the risk but in order to minimize it, we should change the way we work. In my point of view, if we do not change then we will certainly fail. Don’t be too optimistic.

I spent so much time on trivial thing, I should stop surfing non-sense or unrelated websites. I should focus on coding and do not afraid of refactoring or modifying to improve code quality, do not afraid of applying new features.

I should narrow down what I should learn, and hire other persons to handle with their profession instead of trying to do it myself. I admit that I can not handle a real production server and my knowledge on Linux is limited . I admit that I am not a web designer. In the future I only want to be a pure web developer. And that will be my only focus.

PS: Like scred team, I will try to work 12 hours a day.

Written by mephis1987

May 9, 2008 at 4:05 am

Posted in development

Tagged with , ,

Almost every application is now available on the web, how about mobile phone?

leave a comment »

I write this post with a Nokia 9300i and its default browser. Basically I just fired up the browser with the link m.wordpress.com but I was disappointed because of the limitation given by wordpress. All I got is a text input and text area for the post’s subject and content, i cant even write an url or insert my images. Then I googled for a blogging client and found a tool from telewaving but it s not available for my phone. Hope someone will write a similar tool in Java.

Written by mephis1987

May 5, 2008 at 2:42 am