I just launched Tweet My Cam, a simple web service to post pictures from your webcam to Twitter.
Check it out: tweetmycam.com
I just launched Tweet My Cam, a simple web service to post pictures from your webcam to Twitter.
Check it out: tweetmycam.com
So – you read about Bing on Mashable and want to try out the cool new features. But what happens when you go to Bing? You see nothing! That’s because some of the really cool features are only available from within the U.S.
What I do is that I use a U.S. proxy service so that the IP that Bing sees is in reality the IP of the proxy service – as if I was browsing the site from somewhere in the U.S.
One great proxy service is HideMyAss.com which works really well. It has a lot of popup windows but if you can live with that, it really works great.
So: Go to HideMyAss.com and type in www.bing.com – it works!
The source code my previous post about a clipboard image applet is now available here: PasteImageApplet.zip
The code lets you post images from your clipboard directly to the webserver to avoid the need to go through Photoshop or another image application.
When you compile your own applet using javac, you’ll need to sign it in order to be able to get access to the clipboard. (I have signed the applet contained in the zip and the certificate expires 6 months from July 19th, 2009, around January 19th, 2010).
If you find it useful or somebody else has already done this (and somebody surely has, but I didn’t have any luck finding it on Google), please write me in the comments.
Thanks.
- Lasse
Update: The source code for this demo is now available here: Clipboard java applet
I just did a small test to see if it was possible to post images from the clipboard to a webapp.. and it is, using a signed applet.
The concept is to grab the image, post it to a php-script and then return the URL of the new image. Check it out here. (The applet code is rewritten from here).
Or if you don’t like trusting me to run my home made signed applet, just view this video: ;-)
Thought I’d share this because I had a lot of trouble figuring out how and where to run the “rake gems:install” when deploying with Capistrano. I wanted it to automatically deploy the gems when I call “cap deploy:migrations” – this is done by installing the gems right after update_code, like this:
# config/deploy.rb
after "deploy:update_code", "gems:install"
namespace :gems do
desc "Install gems"
task :install, :roles => :app do
run "cd #{current_release} && #{sudo} rake gems:install"
end
end
Some of the examples I’ve seen use “cd #{current_path}” but I don’t think this would work as the “current” symlink hasn’t been updated at the time the “update_code” task is run. That’s why I use “current_release”.
Also others use “rake RAILS_ENV=production gems:install” but I can’t see why you should have to use RAILS_ENV here. If I’m wrong, please correct me.
Some of the links I found when trying to get this to work:
Update 17th July 2009: Some of the code I wrote in this video is now live at my Notes application.
So.. How fast can you implement OpenID using Ruby on Rails without having tried it before?
This is to document how fast it is to implement new things using Rails, even if you haven’t tried it before. I had never tried the Rails OpenID plugin before so this is a documentation of my first shot — I did it in less than an hour :-)
Check it out – and please bare with me as I do a lot of thinking where the screen just stands still.. and I have a couple of breaks during this hour.
Please note: In the video I set “attr_accessible … :identity_url” to be able to create a user using User.create(:identity_url => identity_url). This of cause is a potential security issue where a malicious user could set the identity URL manually. Please remember to remove :identity_url from attr_accessible if you use this in real life. Thanks.
So, maybe you’ve seen this one too many times:
<input type="text" id="username" name="username" value="Enter username"
onfocus="if (this.value == 'Enter username') this.value = '';"
onblur="if (this.value == '') this.value = 'Enter username';" />
A lot of code duplication there.
What if you could do it with labels and without writing a single line of Javascript? Like this:
<label for="username" class="default-value">Enter username</label> <input type="text" id="username" name="username">
I wanted to do a default value replacement that was easy and intuitive to use and at the same time being semantically correct. As an example, a non-semantic way could be to add a “default-value” attribute to the input.
I would also like it to show the default values as labels if the browser has either CSS or Javascript disabled.
As shown above, we can do this by adding a label for each input, giving the labels a class called “default-value”. The concept is then to use Prototype to iterate through the labels and use their values as default for the associated inputs.
When the input is in “default mode” it should have a class called “default” so we can use this to gray out the text like this:
.default {
color: #999;
}
We go through each label like this:
$$("label.default-value").each(function(label) {
// code goes here
});
For each label we set up some variables:
/* Change this to your default class name */ var defaultClass = "default"; /* Get the default value */ var defaultValue = label.innerHTML; /* Get the associated input */ var input = $(label.htmlFor); /* Get the form */ var form = input.form; /* Store information about the input being a password so we can use this later */ var isPassword = (input.type && input.type == "password");
Then add a focus observer:
/* When input gets focus, set value to "" if value is default value */
input.observe("focus", function(event) {
if (input.value == defaultValue) {
input.value = "";
input.removeClassName(defaultClass);
if (isPassword) input.type = "password";
}
});
A blur observer:
/* When input loses focus, set value to default value if value = "" */
input.observe("blur", function(event) {
if (input.value == "") {
input.value = defaultValue;
input.addClassName(defaultClass);
if (isPassword) input.type = "text";
}
});
Observe when the form is submitted:
/* Set default values to "" when form is submitted */
if (form) {
form.observe("submit", function(event) {
if (input.value == defaultValue) {
input.value = "";
}
});
}
Set the default values:
/* Set default value when page loads */
if (input.value == "" || input.value == defaultValue) {
input.value = defaultValue;
input.addClassName(defaultClass);
if (isPassword) input.type = "text";
}
And finally hide the label:
/* Hide the label using javascript so css-but-no-javascript browsers will see the label */ label.hide();
That’s it.
Now you can set up your form like this:
<script src="prototype.js" type="text/javascript"></script>
<script src="default-values.js" type="text/javascript"></script>
...
<style type="text/css">
.default {
color: #999;
}
</style>
...
<form>
<label for="username" class="default-value">Enter username</label>
<input type="text" id="username" name="username">
</form>
… and have your values replaced automatigally :-)
Demo: See a demo
Download: default-values.js, prototype.js
So… I wanted to take a look at the new book Free by bestselling author Chris Anderson who also coined and wrote The Long Tail.
But dammit! He’s doing the same thing as all the others, putting restrictions everywhere. You can’t download the book, you can only get it as MP3 or read it at Scribd… Can’t even get a PDF.
But even if you choose Scribd you can’t read it outside the US. It’s like if Chris Anderson was working in the music industry – in 1998… or well, 2009.
But here’s how you can read it on Scribd:
1. Go to the book on Scribd (opens in a new window)
2. Right when it displays the front page of the book, you keep holding down the Escape-key a couple of seconds, like 5 seconds or so
3. Now you should be able to read the book
Luckily they didn’t put the location checker on the serverside. But Scribd still sucks compared to reading it elsewhere.
Follow me on Twitter – @lassebunk
Update: Google This: 5 Reasons to Switch to Bing
Microsoft recently launched their new search service Bing as a replacement for Live.com — and ultimately Google, I’m sure they hoped for.
I watched this demo video and I must say I’m not impressed. The video is just a bunch of blah trying to sell the product and the product itself is just a replicate of Google — and it’s not even better.
I have watched the video for features and the majority is precisely what Google has done for ages. Check it out:
Bing is called a decision engine — that’s just another word for “organized results”. Google already has this but they don’t name it because it’s a seamless part of their results.
Suggestions — as the speaker types in “home depot”, Bing automatically suggests other searches containing this phrase. Google already does this.
Best match on top — Google already does this but they don’t name it; Bing, I’m sure we all know that the first result is also the best match… duh.
Deep links — Google already does this, finding the most relevant links inside a website and displaying them directly in the search result.
Local listings — Google already does this; I can type “movies new york” and it automatically finds movies running in new york. Or, I can set up my home town and just type “theaters”.
Related searches — Google already does this.
Quick view is a kind of extended summary that displays the contents of the website — Google doesn’t do this, probably because their summaries are good enough without it.
Video previews — good idea, Google should do this.
Simple answers is just another way of saying that you can type in what you are looking for and Bing finds it. Google already does this — let’s have a few examples:
Flights — type in your flight number and Bing finds it. Google already does this.
Traffic — Google has this on Google Maps, could be implemented on Google.com.
Weather — Google has this.
Movie times — Google has this.
Time — Bing doesn’t respond to searches like “new york time”. Google does this.
Currencies — e.g. “100 EUR to USD”. Google already has this.
Categorized results is Bing’s way of guessing what the user is looking for:
A search for “new york” gives you links to travel, maps, weather.
A search for “ford focus” gives you links to reviews, recalls, repair, images.
Google uses related searches to do this, working great in that is uses actual user data to predict the searches. I don’t know how Bing does this but it’s got to be more static than using related searches.
Shopping
The speaker then does a search for “digital cameras” which returns a result with price comparison, reviews etc.
Narrowing down by various features — Google has this.
Item reviews — of course Google has this.
Cashback — just another Microsoft way of locking both the customers and suppliers in to Bing. I’m imagining Microsoft made this to make customers come back to Bing because of the discounts. I think it’s bad business because customers then have to go back to Bing to search for the company instead of just going straight to their website.
Local
Search for “french restaurants new york” — Google has this.
Ratings — Google has this.
Health
Search for “diabetes” show trustworthy sources — good idea, Google should do this, coupled with Google Health.
Travel
Search for flight tickets — Google doesn’t do this (yet).
So… Microsoft has done a wanna-be-but-never-will-be Google in their own skin, but not even that — the colors and layout are not even their own. Too bad, I think — why not focus more on the things you do best; servers, operating systems, computer software? Why do you want world domination? Why can’t you make up something of your own?
After having been on Twitter for a while now I’m starting to see a pattern in who I want to follow and whom I don’t.
I want to follow you if:
- You post updates that are relevant to me — something I can use
- You post on a regular basis — so I know you’re serious about this
I don’t want to follow you if:
- You post too much every day because then my Twitter start page only has your messages in it
- You use Twitter for advertising only, i.e. sends me all sorts of irrelevant stuff — just because you can
- Your communication is one way and you don’t respond to my @ replies
So right now I don’t follow a lot of companies because most of them use Twitter as just another advertising channel. If I want advertising I can go to… well.. I don’t. But I do want you to communicate with me, so if you have something you genuinely believe I would be interested in, then please do post it.
I’m hoping that companies in the future will use this medium as a space for communicating with the customers and not just to them. Gotta learn this myself too… It’s about the recipient, not me… It’s about the recipient, not me… It’s about the recipient, not me… It’s about the recipient, not me… It’s about the recipient, not me… Okay, gotta go :-) (and my Twitter profile is @lassebunk)