Thursday 11 May 2006
How is an adsense made ? How can I affect their display ?
Par obi, Thursday 11 May 2006 à 00:05 :: TreeGarden
Let's observe the beast. The usefull tools are Firefox; equiped with the webdev toolbar. Adding addsenses in a page is inserting a call to the http://pagead2.googlesyndication.com/pagead/show_ads.js script. This script is obfuscted, so normal humans have difficulites to understand its behaviour. What we can see is the result of this script, executed upon the loading of the page. Select the Adsense without clicking it, right click->view selected source. You should see something like that:
<script type="text/javascript"><!-- google_ad_client = "pub-8315147201128023"; ... google_color_url = "54724A"; google_color_text = "2F2005"; //--></script>
This javascript snipet prepositions variables used by the show_ads.js script
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
This is the call to the script acting onload. You actually pasted these few lines in your HTML code, so it is normal to see those here.
<iframe name="google_ads_frame" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-8315147201128023&dt=1147..." marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="125" scrolling="no" width="125"></iframe>
This iframe was inserted by the javascript and sources a page on the googlesyndication.com server. The long list of parameters are used by the server to display a targeted add.
The content of an iframe does not uses the CSS from the source page. But it isaccessible via the DOM: details are on QuirksMode
The first way we can try to modify the way its displayed is playing with the iframe itself, provided you do not have other iframes on your page; e.g. to have a fixed add in the top right left add the following statements in your CSS file:
iframe { position:fixed; top:0; right:0; }
If you have several adds on the same page, they'll pile up, and that's bad.
I just added adsenses to this blog. Not that I am willing to make money from it, with 6K visits a month, I highly doubt I will hit the 100$ required to receive the first check.
The reason is twofold:
- In my professional life, I am an anouncer, using Adwords to reach visitors searching about DO-178B and IEC 61508 code generators. I just wanted to know how the other side of the system was working. My first impression is:
wow, how easy it is !
- I want ot experiment of what it is possible to do with Adsenses and CSS, and maybe a bit of javascript.
As a user, I am a bit disapointed, having always thought Ads are bad, I find myself clicking on adds, not for earning money (I'm sure google has the means to remove my clicks), but because the adds actually interest me. Their algorythm to find targetted Ads seems pretty good, so lets play a bit and see the results.
NB: should I ever receive a check from google, the first one will be for regne.net which hosts me freely.
Wednesday 25 January 2006
From inkscape to illustrator
Par obi, Wednesday 25 January 2006 à 14:41 :: TreeGarden
What should you avoid in inkscape to have neat illustrator imports of the svg:
- Text using transparency. Use
path->Object To Pathon such text if really needed. - Gradients using transparency. If it is applied ont top of an uniform surface, its easy to flatten, compute the right colors with the pick color tool.
- Images in inkscape are translated in two objects in illustrator: the image itself, which appears scaled down, and an invisble rectangle with the correct size. Resize the image to fit the invisible rectangle.
I am sure i'll find more and will udate this list to track possible solutions ...
Wednesday 16 February 2005
More of building custom GUIs in java with batik
Par obi, Wednesday 16 February 2005 à 22:13 :: TreeGarden
Some developments about the FCU protoype I talked a few monthes ago. This principle is going to be used for a real simulator of an european military transport aircraft. I cannot show anything, but in terms of GUI, it's just a matter of adding (many) buttons.
While making new buttons with different behaviours, we faced a problem: how to get the coords of a mouse event, which cames in terms of pixels, in terms of Canvas units. The solution is simple and allows to go back and forth between screen space and Document space. The JSVGCanvas on which you are drawing provides a getViewBoxTransform() method, which gives the AffineTransform to convert from pixels space to document space. The code is simple and looks like that:
class MyCanvas extends JSVGCanvas {
...
((EventTarget)myElement).addEventListener("mousedown", new EventListener(){
public void handleEvent(org.w3c.dom.events.Event evt) {
AffineTransform userToScreen = getViewBoxTransform();
DOMMouseEvent q = (DOMMouseEvent)evt;
Point2D documentPoint = new Point2D.Double(0.0,0.0);
try
{
userToScreen.inverseTransform(new Point2D.Double(q.getClientX(), q.getClientY()), documentPoint);
}
catch(NoninvertibleTransformException e) {
System.out.println(e);
return;
}
//documentPoint is the coordinates of the event in the Document space. Neat !
...
So, what's the point ? Just that it took us half a day to fin the right way do it, and I want to keep a trace for the next time I'll try to do it.
And if this can help sommeone ...
Tuesday 23 November 2004
Brevets Logiciels ?
Par obi, Tuesday 23 November 2004 à 23:31 :: TreeGarden
Tuesday 9 November 2004
The white stone and the marked day...
Par obi, Tuesday 9 November 2004 à 10:12 :: TreeGarden
As I write this, Firefox 1.0 will be out. Go, get firefox and spread the word !
Monday 8 November 2004
Inkscape's new calligraphy tool
Par obi, Monday 8 November 2004 à 16:11 :: TreeGarden
I already used the inscape calligraphy tool to draw shadows. Now it can be used for its original purpose!

This has been acheived by Bulia, and is very nice. Would be even better without the disgracious spikes.
Thursday 4 November 2004
Preparing the TreeGarden for the next season
Par obi, Thursday 4 November 2004 à 11:44 :: TreeGarden

Update: Left toolbar done. I'm cold just looking at it.
