This script automatically:

  1. Clicks the “Positive” radio button.
  2. Fills out the feedback comments.
  3. Rates everything with five stars.

You can use this bookmark whenever you are on a feedback page on eBay.
To use it, first drag the following link to your bookmarks bar or add it to your favorites:

eBay Feedback

And then click it when browsing eBay’s feedback page.
It is most useful if you have lots of eBay transactions to rate at once. Then you can go here:
http://feedback.ebay.com/ws/eBayISAPI.dll?LeaveFeedback2

And use the script to fill all your feedback pending transactions at once.

Here’s the bookmark’s code for the developers among us:

var feedback = prompt( 'Please enter your feedback message', 'Thanks, great seller. I got the item quickly.' );
 
var el = document.querySelectorAll( '.radiorow input[value="positive"]' );
 
for (var i = 0; i < el.length; i++) {
	el[ i ].click();
}
 
var el = document.querySelectorAll( 'input[type="text"]' );
 
for (var i = 0; i < el.length; i++) {
	if ( el[ i ].name.substr( 0, 7 ) == 'comment' ) {
		el[ i ].value = feedback;
	}
}

I developed it for my personal use, but decided to share it here in case anyone else was interested in such a script.

Search terms:

You can extract and view any Google Chrome extension’s full source code following the following easy steps.

Every Google Chrome extension is basically a CRX file. When you click the “Install” button on the Google Chrome extension gallery you are basically clicking a link of the extension’s CRX file.

The first step is downloading the extension’s CRX file. Instead of clicking it’s link, which will lead to that extension being installed on your browser, right-click the link and choose “Save link as…”.

Now that you have the CRX file on your computer, rename it’s extension from CRX to ZIP. Turns out that every CRX file is a renamed ZIP archive of the extension.

All there is left to do is extract the ZIP archive to the desired destination. The full code of the Chrome extension is there.

Have fun exploring other peoples code!

Search terms:
10.05.2010

If the question intrigues you, this video of me lecturing about it will probably answer it for you. This video was shot last month in a user-generated content meeting organized by StartupSeeds.

The lecture is in Hebrew but there are English subtitles available.

box2d warningsWhen I started developing in flash using the Box2d physics engine, I had this problem which held me back for a couple of hair pulling hours. So I thought, why not spare other people from this misery?

The Problem’s Symptoms

If you encountered any of these error messages when compiling a Box2d flash project:
b2World.as, Line 871 - 1046: Type was not found or was not a compile-time constant: Vector. - public function RayCastAll(point1:b2Vec2, point2:b2Vec2):Vector.
b2World.as, Line 917 - Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean. - return (m_flags & e_locked) > 0;
Input.as, Line 155 - Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean. - mouseReleased = !e.buttonDown;
Input.as, Line 189 - Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean. - return (keyState[k] > 0);
Input.as, Line 199 - Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean. - return (keyState[k] == 1);
Input.as, Line 208 - Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean. - return (keyState[k] == -1);
Input.as, Line 217 - Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean. - return (keyBuffer[i][0] == k && keyBuffer[i][1] <= t);
1046: Type was not found or was not a compile-time constant: b2PolygonDef. - var the_box:b2PolygonDef;
1067: Implicit coercion of a value of type Box2D.Collision:b2AABB to an unrelated type Box2D.Common.Math:b2Vec2. - the_world=new b2World(environment,gravity,true);
1137: Incorrect number of arguments. Expected no more than 2. - the_world=new b2World(environment,gravity,true);
1178: Attempted access of inaccessible property m_sprite through a reference with static type Box2D.Dynamics:b2DebugDraw. - debug_draw.m_sprite=debug_sprite;
1178: Attempted access of inaccessible property m_drawScale through a reference with static type Box2D.Dynamics:b2DebugDraw. - debug_draw.m_drawScale=30;
1178: Attempted access of inaccessible property m_fillAlpha through a reference with static type Box2D.Dynamics:b2DebugDraw. - debug_draw.m_fillAlpha=0.5;
1178: Attempted access of inaccessible property m_lineThickness through a reference with static type Box2D.Dynamics:b2DebugDraw. - debug_draw.m_lineThickness=1;
1178: Attempted access of inaccessible property m_drawFlags through a reference with static type Box2D.Dynamics:b2DebugDraw. - debug_draw.m_drawFlags=b2DebugDraw.e_shapeBit;
1180: Call to a possibly undefined method b2PolygonDef. - the_box = new b2PolygonDef();
1061: Call to a possibly undefined method CreateShape through a reference with static type Box2D.Dynamics:b2Body. - final_body.CreateShape(the_box);
1061: Call to a possibly undefined method SetMassFromShapes through a reference with static type Box2D.Dynamics:b2Body. - final_body.SetMassFromShapes();
1046: Type was not found or was not a compile-time constant: b2PolygonDef. - var the_box:b2PolygonDef;
1180: Call to a possibly undefined method b2PolygonDef. - final_body.CreateShape(the_box);
1061: Call to a possibly undefined method SetMassFromShapes through a reference with static type Box2D.Dynamics:b2Body. - final_body.SetMassFromShapes();
1136: Incorrect number of arguments. Expected 3. - the_world.Step(1/30, 10);
Warning: 3590: Box2D.Common.Math:b2Vec2 used where a Boolean value was expected. The expression will be type coerced to Boolean. - the_world=new b2World(environment,gravity,true);
1046: Type was not found or was not a compile-time constant: b2World. - public var the_world:b2World;
1046: Type was not found or was not a compile-time constant: b2AABB. - var environment:b2AABB = new b2AABB();
1046: Type was not found or was not a compile-time constant: b2Vec2. - var gravity:b2Vec2=new b2Vec2(0.0,10.0);
1046: Type was not found or was not a compile-time constant: b2DebugDraw. - var debug_draw:b2DebugDraw = new b2DebugDraw();
1046: Type was not found or was not a compile-time constant: b2Body. - var final_body:b2Body;
1046: Type was not found or was not a compile-time constant: b2BodyDef. - var the_body:b2BodyDef;
1046: Type was not found or was not a compile-time constant: b2PolygonDef. - var the_box:b2PolygonDef;
1180: Call to a possibly undefined method b2AABB. - var environment:b2AABB = new b2AABB();
1180: Call to a possibly undefined method b2Vec2. - var gravity:b2Vec2=new b2Vec2(0.0,10.0);
1180: Call to a possibly undefined method b2World. - the_world=new b2World(environment,gravity,true);
1180: Call to a possibly undefined method b2DebugDraw. - var debug_draw:b2DebugDraw = new b2DebugDraw();
1120: Access of undefined property b2DebugDraw. - debug_draw.m_drawFlags=b2DebugDraw.e_shapeBit;
1180: Call to a possibly undefined method b2BodyDef. - the_body = new b2BodyDef();
1180: Call to a possibly undefined method b2PolygonDef. - the_box = new b2PolygonDef();
1046: Type was not found or was not a compile-time constant: b2Body. - var final_body:b2Body;
1046: Type was not found or was not a compile-time constant: b2BodyDef. - var the_body:b2BodyDef;
1046: Type was not found or was not a compile-time constant: b2PolygonDef. - var the_box:b2PolygonDef;
1180: Call to a possibly undefined method b2BodyDef. - the_body = new b2BodyDef();
1180: Call to a possibly undefined method b2PolygonDef. - the_box = new b2PolygonDef();
1172: Definition Box2D.Dynamics could not be found. - import Box2D.Dynamics.*;
1172: Definition Box2D.Collision could not be found. - import Box2D.Collision.*;
1172: Definition Box2D.Collision.Shapes could not be found. - import Box2D.Collision.Shapes.*;
1172: Definition Box2D.Common.Math could not be found. - import Box2D.Common.Math.*;

I have the solution.

Possible Causes

There are two main causes for these type of errors:

  1. The Box2d code you are compiling doesn't match the Box2d source files' version.
  2. Flash can not locate the Box2d engine source files.

Version Difference

Personally, I first encountered the first cause. As it seems, when the Box2d guys updated their SVN and downloads for the latest version (for the time writing this post: 2.1 alpha aka 2.1a), they forgot to also update their code samples. So if one downloads the latest version and tries to compile the example projects, it simply won't work. Instead, flash will throw some of the errors listed above.

In addition, all of the online resources and tutorials regarding Box2D don't work with the latest Box2D version. I have yet to find an article or a code sample that works flawlessly with the latest version. They really rewrote major parts of the engine thus making lots of code (if not all) incompatible.

Missing Box2D files

The second cause is also very common. When compiling any project which uses the Box2d physics engine, Abobe must be able to find the needed Box2d source files. Adobe Flash looks for the files in the projects directory (is our case, for a Box2D subdirectory), and at the locations which one can specify in the preferences menu.

The Solutions

These solutions have solved my problems. If these won't help you, or if you have a better solution that you'd like to suggest - comment below.

Version Difference

As I've mentioned before, the examples in the latest Box2D download don't match the correct version and almost any code sample you will find online won't work with the latest version of Box2D.

Visit their full download page which contains all previous versions and download version 2.0.2. All the examples work great in this package. And any other code should also work using this version.

Missing Box2D files

Many times, Adobe Flash (also Flash Develop and any other Flash IDE) won't find the correct Box2D directory to use. As a result it will throw those errors.

To fix this, you have two options:

  1. You can simply copy the correct Box2D source folder (a folder named Box2D) to the directory of your project. For instance, if your project lies under C:\projects\box2d-demo\demo.fla, you will need to copy the Box2D folder there. In the end the Box2D folder should lie at C:\projects\box2d-demo\Box2D.
  2. The second option is to inform your IDE about the location of your Box2D folder. I use this option and I store my Box2D directory at C:\Documents and Settings\Oren Yomtov\My Documents\FlashUtilities\Box2D.

    To inform your IDE, follow the following steps:

    In Adobe Flash:

    1. Open your project in Adobe Flash.
    2. Navigate to "Edit->Preferences...".
    3. Click the "ActionScript" tab/category.
    4. Click the "ActionScript 3.0 Settings..." button.
    5. Click the "Browser To Path" (folder/cross icon) button under "Source path:".
    6. Browse to the folder which contains the Box2D folder and click "OK".
    7. Click "OK" twice to save the changes.

    In Flash Develop (If you use it):

    1. Open Flash Develop
    2. Navigate to "Project->Settings..."
    3. Click the "Classpaths" tab.
    4. Click the "Add Classpath..." button.
    5. Browse to the folder which contains the Box2D folder and click "OK".
    6. Click "OK" to save the changes.

    NOTE: If you use both, you will need to configure both.
    Do not browse directly to the Box2D folder. Instead, browse to it's parent folder.

Now recompile your code and it should all work.

By the way, if you are looking for video tutorials on the Box2D engine - check out Todd's great videos. They are very detailed and fun. Good luck.

Search terms:

Google ReaderSurfing the web, you find many interesting websites or blogs which you want to subscribe to. But the never-ending search for the RSS link is a burden we all share. If you are using Google Reader, I may have the perfect solution for you.

Bookmark or favorite the following URL:javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{location='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href)}Using Google Chrome or Firefox, you can drag this link to your bookmarks bar – Subscribe.

Now, you may skip the RSS link seeking and simply click the link you have just bookmarked.

In my browser, Google Chrome, it looks like this:
Subscribe Bookmark

If you want to check it out, feel free to give it a shot and subscribe to my blog.

Search terms: