0Posted by Jim Bergman on January 24, 2012 at 10:46 pm
HTML5 / CSS3 development for mobile browsers needs to be aware of the reported screen size to effectively build a mobile site.
However, the screen resolution listed in the device specifications is NOT the same as what is reported by the mobile browser itself. Specifically, what is the window size information available via JavaScript using window.innerWidth and window.innerHeight. It is usually very different than the device’s screen resolution.
The iPhone and iPad are consistent and predictable. All iPhones report a window size of 320 x 460, and all iPads report a window size of 768 x 1004.
The ‘fun’ part is supporting the wide variety of window sizes on Android devices. However, it is exceptionally hard to find data on the window size different devices report via JavaScript.
Using this information, you can more easily develop your CSS media queries, knowing what sizes your app is likely to encounter in the wild.
This will be an ongoing monthly report, and will reflect different reported window sizes when new devices are introduced. By regularly reporting this information, a trend over time can be identified.
What information are you collecting from your apps? Please share your suggestions for additional anonymous information to collect. Information must be available via JavaScript query.
UPDATE FEB 1st: final numbers for January 2012 included
0Posted by Jim Bergman on January 17, 2012 at 12:52 pm
The majority of the internet community is taking a stand against SOPA/PIPA which attempts to fight copyright infringement through Internet censorship, and bypass the due process of law by allowing alleged copyright infringers to be forcibly taken offline without a trial.
Many internet companies have stated their opposition to SOPA/PIPA, such as Google, Reddit, Facebook, Twitter and Wikipedia. An excellent analysis is here on Reddit.
To be clear, this is NOT objecting to copyright law, and NOT in support of copyright infringers.
On January 18th, many websites around the world are blacking out to protest this poorly thought out and technology ignorant legislation, before it is voted on by the US Congress and Senate.
JimBergman.net will take part in the blackout movement from 12am PST to 11pm PST on January 18th.
So, take an hour a week and just blog something. Write about something interesting or humorous or maddening that happened. Write about something you care about. Writing is a like a muscle in that is develops only when used. You’ll write better the more you write. And with over 20 unpublished posts, I’m almost half done for the year (providing there’s something good there).
The Android 2.3 SDK information does not mention a browser upgrade or support for websockets specifically. So there is no official word from Google regarding websockets being included when Android 2.3 is released.
Taking a look at the beta 1 release of the Android 2.3 SDK, the browser in the emulator is the same version as in Android 2.2 FroYo. Here are screencaps from the browser in the Android 2.3 emulator and a screencap from the browser in Android 2.2. Note the browser version is the same in each screencap.
Considering that the browser in Android is based on the same open-source WebKit browser used in the iPhone and iPad, and Apple recently released websocket support in iOS 4.2, it is reasonable to predict that Google will include websocket support in the Android browser very soon, and hopefully in Android 2.3.
2Posted by Jim Bergman on November 26, 2010 at 12:50 am
Apple released iOS 4.2 in November 2010, and part of that release was support for websocket in the web browser.
This was confirmed in a visit to a local Apple store. Here are some screencaps grabbed of the iPhone 4:
iOS 4.2 is also available for the iPad, which is a huge improvement. iOS 4.0 was only for the iPhone, and the iPad was still using iOS 3. Here are the iPad screencaps to confirm websocket support on the iPad:
3Posted by Jim Bergman on September 23, 2010 at 4:23 am
Fing-Fong-Fooey is a game similar to Rock-Paper-Scissors, with the same purpose, to select one person in a group to be ‘it’.
While Rock-Paper-Scissors (also called Ro-Sham-Bo) works with two people at a time, Fing-Fong-Fooey is more easily used with a group of people.
It works like this:
Everyone stands together in a circle, and each person makes a fist.
All together in unison, count to three while saying ‘Fing-Fong-Fooey’, and move your fist up and down with the count.
When Fooey is reached, each person holds out one, two or three fingers.
Add up the total number of fingers shown for all players.
Starting from the person that called for Fing-Fong-Fooey, count counter-clockwise starting with the person to their right.
The last person counted is ‘it’.
Example:
John, Lee and Mary are deciding who will drive everyone to the beach. Mary calls for Fing-Fong-Fooey. John is to Mary’s right and Lee is to her left. Each makes a fist and counts together Fing-Fong-Fooey. On Fooey, John puts out 2 fingers, Lee puts out 3 and Mary puts out 2. The total number of fingers is 7. Mary’s counts to 7 starting to her right. John-Lee-Mary-John-Lee-Mary-John. John was the last person counted and is ‘it’. He is the driver for today’s trip.
A variation that works better for larger groups, is to hold out up to as many fingers as there are people in the group. If there are five people, each person can hold out 1, 2, 3, 4 or 5 fingers. Otherwise there is an advantage to be one of the last counted in the circle.
This game was used in the TV show House M.D. in the first episode of season 7. Dr. Taub calls for Fing-Fong-Fooey with Dr. Chase and Dr. Foreman. Dr. Taub holds out two fingers, Dr. Foreman holds out two fingers, and Dr. Chase holds out one finger. The total number of fingers is five. Starting with Dr. Foreman who is to the right of Dr. Taub, the count goes Foreman-Chase-Taub-Foreman-Chase. Dr. Chase is ‘it’.
The game is alternately called Fing-Fong-Phooey, although the preferred spelling is Fing-Fong-Fooey.
UPDATE July 2010: since the beta 2 release of iOS4, Apple has disabled websockets support. A few readers pointed this out, so I made a trip to an Apple Store it run a few tests.
Confirmed: iOS4 as it is released reports it does NOT have websocket support.
ORIGINAL POST:
Since the Safari web browser on the iPhone is based on WebKit, it makes sense that at some point support for WebSockets would make it to the iPhone.
Safari on iPhone OS 4.0 beta 2 supports WebSocket.
Once OS 4 is available for the iPad, support should be there as well.
36Posted by Jim Bergman on December 9, 2009 at 6:34 pm
Google announced an improved way for a web application to communicate with a server. The new method is called Web Sockets. You can read more info here on Web Sockets.
Here is a quick test to see if your web browser supports Web Sockets. At the time this post was published Google Chrome developer channel release 4.0.249.0 is the only browser to support Web Sockets.
function WebSocketTest()
{
if ("WebSocket" in window)
{
// Google example code
// var ws = new WebSocket("ws://example.com/service");
// ws.onopen = function()
// {
// // Web Socket is connected. You can send data by send() method
// ws.send("message to send"); ....
// };
// ws.onmessage = function (evt) { var received_msg = evt.data; ... };
// ws.onclose = function() { // websocket is closed. };
alert("WebSockets supported here!rnrnBrowser: " + navigator.appName + " " + navigator.appVersion + "rnrntest by jimbergman.net (based on Google sample code)");
}
else
{
// the browser doesn't support WebSockets
alert("WebSockets NOT supported here!rnrnBrowser: " + navigator.appName + " " + navigator.appVersion + "rnrntest by jimbergman.net (based on Google sample code)");
}
}
Sample HTML code (save file as WebSocketTest.html in same folder as .js file above):
3Posted by Jim Bergman on October 15, 2008 at 4:25 pm
Everybody loves a great conversation. It is one of life’s simple pleasures. Sharing ideas and perspectives is a great way feel alive and connected. Looking back at the high points in your life, I hope there are some Intelligent Conversations in there.
So establishing some groundrules for an Intelligent Conversation can help you avoid getting sidetracked and wasting time. A groundrule is an agreement between everyone that is the foundation for what you are about to do. House rules is another common phrase used to describe groundrules.
Especially with all the political and financial news lately, there are many important things that are hard to talk about constructively.
Here is how to prepare for an Intelligent Conversation.
(1) Accept the other person WILL disagree with you.
This stops a lot of people right away. An Intelligent Conversation is not “cram your ideas down the other person’s throat”. The whole point of an Intelligent Conversation is to try and see the other person’s perspective. Just because someone disagrees with you doesn’t automatically make you wrong or stupid. Or them wrong or stupid!
It is best not to care if the other person comes around to your way of thinking or not. Your objective is not to prove the other person wrong, but to LEARN if your perspective is the most correct and useful.
If you want to have a conversation with someone that agrees with you, you can do that by yourself.
(2) No name calling or personal attacks. Ever!
This is an absolute requirement. Rather than saying “You’re a dumbass,” try “I disagree with that view, and here are my reasons why.”
Focus on ideas and concepts, not on the person sharing those ideas and concepts.
Telling someone why you think their idea is incorrect is vastly different than telling someone they’re stupid for thinking that way.
The first way will keep them open to what you’re saying, the second will make them defensive and they will stop listening.
(3) Always be polite.
There are many things included in this groundrule:
Listen first (Don’t interrupt.)
Be respectful and courteous (Don’t be condescending, rude or dismissive.)
Give the other people a chance to be heard (Don’t be a ‘ball hog’ and do all the talking.)
A bad example is the way discussions are held on cable news or talk shows. They are trying to get people to watch and sell advertising much more than they are trying to help you become better informed.
A good example? A well respected journalist is perhaps is the way it supposed to be done. How does Barbara Walter have a conversation vs Howard Stern? (I’m using these as an example of their style, not their substance.)
(4) Try and understand from their point of view.
Try listening to just the words the other person is using. Repeat back to the person what they just said, and see if you got it right before sharing your opinion. Ask them politely to explain to you again if you did not correctly understand what they are communicating.
Where many people get caught up is they hear what they want to hear. They filter what they hear through their own beliefs. Try to put yourself in the other person’s shoes.
For example, I like baseball more than football. Some people think that means I hate football. That’s not what I said — I like football too — but there is an assumption on the meaning.
“You shall listen to all sides and filter them for yourself.” — Walt Whitman
(5) Be willing to check your facts, and admit when you need more information or need to do more research.
“I don’t know” or “I don’t know enough” is not a bad thing.
Nobody knows everything, and there will be times people know things that you don’t. Stubbornly sticking to incorrect facts and information defeats the purpose of having an Intelligent Conversation.
Having an open mind has got to be one of the hardest things to do. But it can be one of the most rewarding.
This is really hard to do with topics like politics and religion. There may even be topics that have to be off limits, and cannot be discussed.
(6) Separate the emotional from the factual.
There are times you’ll feel a certain way about something just because. That’s OK. Everyone has things they believe that are not rooted in any fact.
There are things you associate very powerful positive or negative feelings with that hugely influence how you feel. Even if the facts contradict how you feel.
Accept your feelings, and accept other people’s feelings. This where you have to exercise self control, as feelings are not likely to change.
(7) Be humble in victory and gracious in defeat.
Nobody likes a gloating winner and nobody likes a bitter loser.
If you do persuade others to see things your way, be kind and tread lightly, or you may change their mind back. So no bragging or boasting about how smart you are or how right you are.
If you have changed your mind and now agree with someone else’s point of view, be grateful to have learned something new. It is not a contest to be won or lost.
Thank you for reading my thoughts on having an Intelligent Conversation.
What do you think? Are there any more rules that should be added to this list? Or any removed?
3Posted by Jim Bergman on September 22, 2008 at 2:37 am
How many time have you gone to search for something on the Internet, and it just wasn’t there?
Many times travelling over the last few years, I’ve wanted to know where there was a Costco gas station along my route. Their gas prices are usually the most competitive in a particular area. Finding a location along your route is hard to do when all you have is a list sorted alphabetically by State and City.
I discovered after importing the data, that Google Maps paginates your data set after 200 entries. Since the original data was sorted by State and the City, all the locations are not shown at once. There are 300 Costco Gas Stations in the list.
A more useful arrangement would be to sort the data by ZIP code, and break it into two sets: East and West. I’ll try to find some time for that in the next week.
There were some data validation problems with the original data set also, mainly having to do with non-plain text characters in the data. For example, 1001 Boul. Jean-Baptiste-Rolland, Saint-Jérôme, Quebec J7Y 4Y7 failed validation. The é and ô had to be changed to e and o.
Disclaimer: I was not asked by Costco to do this, and have no ties other than a common membership.
In what way could this map be improved? Leave your suggestions in the comments.