Dans World

CSS level 3 styles in Internet Explorer 6 onwards | HTML Remix

As web developers, we all hate Internet explorer to an extant. But in my earlier post, I wrote why not to hate Microsoft and IE. It is the people who use out dated software (IE6 is almost ten years old) and try to run our CSS3 level high Ajax’s web 2.0 designs.

border-radius

Last year, I published an htc file, which makes Internet explorer 6 to have rounded corner DIVs. For other modern browsers, we can have border-radius CSS property. For mozilla, you need to prefix -moz- and for webkit based browsers (Safar, Chrome) prefix -webkit- . SO the CSS for a DIV with rounded edges will have following styles.
.curved { -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }

As IE wont support these CSS properties, you will have to add one more line of css and an HTC file. Here is more explanation how to make rounded corner divs in IE.

Good news : Microsoft’s Internet Explorer 9 is expected to support border-radius property.

Early this month, Nick Fetchak of fetchak.com sent me a new htc file with support for IE5 to IE8 which is amazing and working well. You can find the latest version that file here.

box-shadow

Box shadow is another simply amazing CSS3 property, which is unimaginable to work in IE. It works on Safari 3 and Firefox 3.1 onwards and Google Chrome. I am not aware of Opera this time. So what you think about making this work on IE6 ? No kidding..

CSS for box-shadow is:
box-shadow: 10px 10px 5px #888; padding: 5px 5px 5px 15px;

For older version of Firefox, you might have to add -moz- and for Safari and Chrome, try -webkit- as prefix. (My Chrome is already supporting without any prefix).

So, here what you need for IE to make box-shadow.

behavior: url(box-shadow.htc);

Download the htc file here or Demo here. The project is hosted on Google code.

havent had a go of using this yet myself so not sure how well it works, but i've used previous .htc files for other ie6 fixes such as transparent png. a few people have commented on how they have a few issues with this .htc file. i also see that Remiz has a rounded corner div file for IE. not really had much use for this yet, as nothing that i have built so far has really had rounded corners in the layout, but im sure in the near future there will come a time when something like this will need to be looked at.

whats your thoughts on this, are you the kind of developer who doesn't mind not having the css3 style apply to IE and just have it work for newer browsers? I myself believe that this is the better option as long as the IE 6 version of the site look ok and works as intended there is no real need to add all the extra fancy look features and just leave them for the newer browsers as long as this is explained to the client before work begins.

Filed under  //   IE Hacks   css3   web development  

Facebook Secures Patent for News Feed

A new patent awarded to Facebook this week could have some big implications for the entire social media industry. The world’s largest social network now own the patent for the news feed.

Patent #7,669,123, first unearthed by All Facebook, credits Facebook Founder Mark Zuckerberg and seven other current and former Facebookers as inventors and assigns the rights to the patent to Facebook, Inc.

Depending on what this patent actually covers, Facebook could use it to protect its intellectual property and force other companies with news feeds — e.g. MySpace, Google, and Twitter — to change or take down their technologies.

First though, we have to begin to understand what this patent is all about.


Overview: The News Feed Patent



While we’re going to take some time to really dig into this patent, is basics are simple enough. The patent awards Facebook protection for technology “dynamically providing a news feed about a user of a social network.”

While that synopsis is very general and could definitely apply to a lot of well-known social media apps and startups, the patent’s abstract focuses less on status updates and more on the display of stories to the user.

Here is the abstract in its full form:

“A method for displaying a news feed in a social network environment is described. The method includes generating news items regarding activities associated with a user of a social network environment and attaching an informational link associated with at least one of the activities, to at least one of the news items, as well as limiting access to the news items to a predetermined set of viewers and assigning an order to the news items. The method further may further include displaying the news items in the assigned order to at least one viewing user of the predetermined set of viewers and dynamically limiting the number of news items displayed.”

As we see it, this patent is focused on the technology that displays the news feed, rather than the delivery of status updates that often compose them.

However, the patent also specifically covers the auto-generation of a user’s activity and the display of that to friends. That means the news updates you get when your friends upload videos and accept friend requests is covered by Facebook’s new patent.

Facebook pioneered news feed technology when it launched its News Feed feature back in 2006. While there was a lot of controversy about it back then, it is now a standard feature on multiple social networks.


The Potential Impact of the Patent


Facebook and its leadership are now credited as the inventors of the news feed, or more specifically several elements of the news feed. The big question that we have to ask is this: Could Facebook force other social media companies to stop using news feeds?

Here are a few potential scenarios we’ve come up with:

1. Facebook sues companies such as MySpace, Twitter, and Google to take down their news feed features. They succeed, pushing Facebook way ahead in the game.

2. Facebook sues companies in defense of their patent. They win a few and strike out on a few.

3. Facebook sues companies, but the courts don’t side with Facebook because their technologies are significantly different from Facebook’s news feed technology that it doesn’t infringe on the patent.

4. Facebook controls the patent, but doesn’t exercise its right to defend its invention.

Let’s be clear: we don’t know what Facebook wants to do with its patent, and we are not patent lawyers with years of experience in this space. With that said, we do believe this patent could become very significant, very quickly. It covers a lot of technologies that are seemingly in use almost everywhere.

If Facebook can make news feed a Facebook-only feature, then it drains the usefulness of countless social networks while boosting its own. However, the process of exercising that patent would get very ugly, and we’re not sure if Facebook has a lot of incentive to jump into the snake pit and incur that type of PR damage.

We’re going to take some more time to research this patent and consult with experts to see what impact this thing could have. In the meantime, let us know what you think about this new development in the comments.

Update: Facebook sent us the following statement:

“The launch of News Feed in 2006 was a pivotal moment in Facebook’s history and changed the way millions of people consumed and discovered information on the site. We’re humbled by the growth and adoption of News Feed over time and pleased with being awarded the patent.”

well this is interesting, will they wont they? makes you think really, i wouldnt have thought they would even be able to patent such a thing, but i guess you can

Filed under  //   facebook development   patents   web development  

BBC News - PleaseRobMe website reveals dangers of social networks

By Zoe Kleinman
Technology reporter, BBC News

pleaserobme.com, Boy Van Amstel
Boy Van Amstel created pleaserobme.com to make a point.

A website called PleaseRobMe claims to reveal the location of empty homes based on what people post online.

The Dutch developers told BBC News the site was designed to prove a point about the dangers of sharing precise location information on the internet.

The site scrutinises players of online game Foursquare, which is based on a person's location in the real world.

PleaseRobMe extracts information from players who have chosen to post their whereabouts automatically onto Twitter.

"It started with me and a friend looking at our Twitter feeds and seeing more and more Foursquare posts," said Boy Van Amstel, one of PleaseRobMe's developers.

"People were checking in at their house, or their girlfriend's or friend's house, and sharing the address - I don't think they were aware of how much they were sharing."

Mr Van Amstel, Frank Groeneveld and Barry Borsboom realised that not only were people sharing detailed location information about themselves and their friends, they were also by default broadcasting when they were away from their own home.

Simple search

The website took just four hours to create.

"It's basically a Twitter search - nothing new," said Mr Van Amstel. "Anyone who can do HTML and javascript can do this. You could almost laugh at how easy it is."

He said that the site would remain live but stressed it was not created to encourage crime.

"The website is not a tool for burglary," he said. "The point we're getting at is that not long ago it was questionable to share your full name on the internet. We've gone past that point by 1000 miles."

Mr Van Amstel added that in practice it would be "very difficult" to use the information on the website to carry out a burglary.

Charity Crimestoppers advises people to think carefully about the information they choose to share on the internet.

"We urge users of Twitter, Facebook or other social networks to stop and think before posting personal details online that could leave them vulnerable to crimes including burglary and identity theft," said a spokesperson.

"Details posted online are available for the world to see; you wouldn't hang a sign on your door saying you're out, so why would you post it online?"

simple idea, isnt always the same though, and he is proving a point sometimes we do give out to much information to our social networks, i for one know i do sometimes. it does stop and make you think about the things you are posting to the world..

Filed under  //   social networking   web development  

Improve Your jQuery Knowledge with the Source Viewer @sitepoint recommendation

jQuery source viewerjQuery is a great JavaScript framework. However, as with any library, sometimes it’s necessary to get under the hood to discover what’s going on. Perhaps it’s because you’re tracing a bug or are just curious about how jQuery achieves a particular UI effect.

Although jQuery compresses to under 70Kb, the uncompressed file comprises of 6,000 lines of JavaScript code. Your text editor or IDE may offer a function list, but there are dozens of methods to wade through and it’s not always easy to find the code block you need. Fortunately, UK web developer James Padolsey has come up with a neat solution — the jQuery source viewer.

jQuery source viewer

The tool will find the code for any function name you enter (note that names are case-sensitive). By default, it will return version 1.4 code, but versions 1.3.2 and 1.2.6 are also available.

Other jQuery methods are highlighted and click-able so it’s easy to jump to other code blocks. You can also find functions from the URL, e.g.

The tool’s a fantastic idea and will certainly save time when hunting through the jQuery source. Thanks James. My only request: a case-insensitive auto-suggest box would make it absolutely perfect.

great idea, and one that will help out a lot while coding.

Filed under  //   debugging PHP   jquery   web development  

A new Buzz start-up experience based on your feedback

A new Buzz start-up experience based on your feedback

Saturday, February 13, 2010 3:53 PM

We've heard your feedback loud and clear, and since we launched Google Buzz four days ago, we've been working around the clock to address the concerns you've raised. Today, we wanted to let you know about a number of changes we'll be making over the next few days based on all the feedback we've received.

First, auto-following. With Google Buzz, we wanted to make the getting started experience as quick and easy as possible, so that you wouldn't have to manually peck out your social network from scratch. However, many people just wanted to check out Buzz and see if it would be useful to them, and were not happy that they were already set up to follow people. This created a great deal of concern and led people to think that Buzz had automatically displayed the people they were following to the world before they created a profile.

On Thursday, after hearing that people thought the checkbox for choosing not to display this information publicly was too hard to find, we made this option more prominent. But that was clearly not enough. So starting this week, instead of an auto-follow model in which Buzz automatically sets you up to follow the people you email and chat with most, we're moving to an auto-suggest model. You won't be set up to follow anyone until you have reviewed the suggestions and clicked "Follow selected people and start using Buzz."

For the tens of millions of you who have already started using Buzz, over the next couple weeks we'll be showing you a similar version of this new start-up experience to give you a second chance to review and confirm the people you're following. If you want to review this list now, just go to the Buzz tab, click "Following XX people" and unfollow anyone you wish. If you don't want to share the lists of people who are following you and people you are following publicly on your profile, you can opt out at any time from the edit profile page.

Second, Buzz will no longer connect your public Picasa Web Albums and Google Reader shared items automatically. Just to be clear: Buzz only automatically connected content that was already public, so if you had previously shared photos in an "Unlisted" album or set your Google Reader shared items as "Protected," no one except the people you'd explicitly allowed to see your stuff has been able to see it. But due to your feedback Buzz will no longer connect these sites automatically.

Third, we're adding a Buzz tab to Gmail Settings. From there, you'll be able to hide Buzz from Gmail or disable it completely. In addition, there will be a link to these settings from the initial start-up page so you can easily decide from the get go that you don't want to use Buzz at all.

It's been an exciting and challenging week for the Buzz team. We've been getting feedback via the Gmail help forums and emails from friends and family, and we've also been able to do something new: read the buzz about Buzz itself. We quickly realized that we didn't get everything quite right. We're very sorry for the concern we've caused and have been working hard ever since to improve things based on your feedback. We'll continue to do so.

well once again and this time really quickly the guys at Google have listened and have made the changes requested to buzz, i really like the speed and the way that they have made the changes, simple and now really easy for people to opt out of following people on their lists as well as not showing their following lists to the public.

Once again youve done a good job guys at Google, lets hope this will stop the people complaining and start using the service like it should be used, I for one will still be using it as ive really enjoyed the experience so far, and using buzz on the mobile through Google Maps is superb, being able to see people buzzing in your local area allowing you to communicate with people around you really makes this a useful tool.

Filed under  //   Google Buzz   social networking   web development  

Google Chrome for Mac finally getting extensions

As thousands of Mac fans and developers gather in San Francisco for this week's Macworld conference, we're particularly delighted to announce a new beta release of Chrome for Mac. Today's release includes some of our most requested features from the Mac community, including extensions and bookmark sync.

You can read more about these features on the Google Chrome blog, or you can try it out directly by downloading the Google Chrome Beta for Mac. If you're already using Chrome, you should be automatically updated to the new beta within the next day.

Downloading Google Chrome will give your mouse pointer a new reason to get excited:

Really excited about this one, i use chrome on both my Mac and the PC in work, and i have installed a few google chrome extensions and really pleased with them, so now i can finally install some on my mac.

I love using Chrome as an everyday browser but for developing i still think it looses out to firefox, if someone would make the firebug extension for chrome then ill probably never have to open up firefox again apart from doing cross browser testing.

Chrome just seems faster, more responsive and a much simpler interface to use.

plus i enjoyed the video.

Filed under  //   browsers   web development  

Facebook Developers | HipHop for PHP: Move Fast

One of the key values at Facebook is to move fast. For the past six years, we have been able to accomplish a lot thanks to rapid pace of development that PHP offers. As a programming language, PHP is simple. Simple to learn, simple to write, simple to read, and simple to debug. We are able to get new engineers ramped up at Facebook a lot faster with PHP than with other languages, which allows us to innovate faster.

Today I'm excited to share the project a small team of amazing people and I have been working on for the past two years; HipHop for PHP. With HipHop we've reduced the CPU usage on our Web servers on average by about fifty percent, depending on the page. Less CPU means fewer servers, which means less overhead. This project has had a tremendous impact on Facebook. We feel the Web at large can benefit from HipHop, so we are releasing it as open source this evening in hope that it brings a new focus toward scaling large complex websites with PHP. While HipHop has shown us incredible results, it's certainly not complete and you should be comfortable with beta software before trying it out.

HipHop for PHP isn't technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP's runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.

Scaling PHP as a Scripting Language

PHP's roots are those of a scripting language, like Perl, Python, and Ruby, all of which have major benefits in terms of programmer productivity and the ability to iterate quickly on products. This is compared to more traditional compiled languages like C++ and interpreted languages like Java. On the other hand, scripting languages are known to generally be less efficient when it comes to CPU and memory usage. Because of this, it's been challenging to scale Facebook to over 400 billion PHP-based page views every month.

One common way to address these inefficiencies is to rewrite the more complex parts of your PHP application directly in C++ as PHP Extensions. This largely transforms PHP into a glue language between your front end HTML and application logic in C++. From a technical perspective this works well, but drastically reduces the number of engineers who are able to work on your entire application. Learning C++ is only the first step to writing PHP Extensions, the second is understanding the Zend APIs. Given that our engineering team is relatively small — there are over one million users to every engineer — we can't afford to make parts of our codebase less accessible than others.

Scaling Facebook is particularly challenging because almost every page view is a logged-in user with a customized experience. When you view your home page we need to look up all of your friends, query their most relevant updates (from a custom service we've built called Multifeed), filter the results based on your privacy settings, then fill out the stories with comments, photos, likes, and all the rich data that people love about Facebook. All of this in just under a second. HipHop allows us to write the logic that does the final page assembly in PHP and iterate it quickly while relying on custom back-end services in C++, Erlang, Java, or Python to service the News Feed, search, Chat, and other core parts of the site.

Since 2007 we've thought about a few different ways to solve these problems and have even tried implementing a few of them. The common suggestion is to just rewrite Facebook in another language, but given the complexity and speed of development of the site this would take some time to accomplish. We've rewritten aspects of the Zend Engine — PHP's internals — and contributed those patches back into the PHP project, but ultimately haven't seen the sort of performance increases that are needed. HipHop's benefits are nearly transparent to our development speed.

Hacking Up HipHop

One night at a Hackathon a few years ago (see Prime Time Hack), I started my first piece of code transforming PHP into C++. The languages are fairly similar syntactically and C++ drastically outperforms PHP when it comes to both CPU and memory usage. Even PHP itself is written in C. We knew that it was impossible to successfully rewrite an entire codebase of this size by hand, but wondered what would happen if we built a system to do it programmatically.

Finding new ways to improve PHP performance isn't a new concept. At run time the Zend Engine turns your PHP source into opcodes which are then run through the Zend Virtual Machine. Open source projects such as APC and eAccelerator cache this output and are used by the majority of PHP powered websites. There's also Zend Server, a commercial product which makes PHP faster via opcode optimization and caching. Instead, we were thinking about transforming PHP source directly into C++ which can then be turned into native machine code. Even compiling PHP isn't a new idea, open source projects like Roadsend and phc compile PHP to C, Quercus compiles PHP to Java, and Phalanger compiles PHP to .Net.

Needless to say, it took longer than that single Hackathon. Eight months later, I had enough code to demonstrate it is indeed possible to run faster with compiled code. We quickly added Iain Proctor and Minghui Yang to the team to speed up the pace of the project. We spent the next ten months finishing up all the coding and the following six months testing on production servers. We are proud to say that at this point, we are serving over 90% of our Web traffic using HipHop, all only six months after deployment.

How HipHop Works

The main challenge of the project was bridging the gap between PHP and C++. PHP is a scripting language with dynamic, weak typing. C++ is a compiled language with static typing. While PHP allows you to write magical dynamic features, most PHP is relatively straightforward. It's more likely that you see if (...) {...} else {..} than it is to see function foo($x) { include $x; }. This is where we gain in performance. Whenever possible our generated code uses static binding for functions and variables. We also use type inference to pick the most specific type possible for our variables and thus save memory.

The transformation process includes three main steps:

  1. Static analysis where we collect information on who declares what and dependencies,
  2. Type inference where we choose the most specific type between C++ scalars, String, Array, classes, Object, and Variant, and
  3. Code generation which for the most part is a direct correspondence from PHP statements and expressions to C++ statements and expressions.

We have also developed HPHPi, which is an experimental interpreter designed for development. When using HPHPi you don't need to compile your PHP source code before running it. It's helped us catch bugs in HipHop itself and provides engineers a way to use HipHop without changing how they write PHP.

Overall HipHop allows us to keep the best aspects of PHP while taking advantage of the performance benefits of C++. In total, we have written over 300,000 lines of code and more than 5,000 unit tests. All of this will be released this evening on GitHub under the open source PHP license.

Learn More this Evening

This evening we're hosting a small group of developers to dive deeper into HipHop for PHP and will be streaming this tech talk live. Check back here around 7:30pm Pacific time if you'd like to watch.

As I'm sure there will be plenty of questions, starting this evening take a look at the HipHop wiki or join the HipHop developer mailing list. You'll also find us at FOSDEM, SCALE, PHP UK, ConFoo, TEK X, and OSCON over the next few months talking about HipHop for PHP. We're very excited to evolve HipHop into a thriving open source project along with all of you.

Haiping Zhao, a senior engineer, has found Facebook to be a programmer's paradise.

Sounds good to me, but would this only really be effective on a website of this kind of scale, would it be as time efficent to use this on a smaller scaled website?

Filed under  //   PHP development   facebook development   web development