Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Thursday, July 31, 2008

Fractions in HTML

So I finally found a way to put (mathematical) fractions inline in HTML. It's quite straightforward using the inline-block display style. It works in all major browsers, except for Firefox earlier than version 3. Here's the code
<style>
.fraction {
  display: inline-block; vertical-align: middle;
  font-size: 50%; text-align: center;
}
.fraction span { display: block; }
.fracdenom { padding-top: .05em; border-top: .125em white solid; }
</style>

<p>Compute 
3 <span class="fraction"> 
<span>1</span> 
  <span class="fracdenom">400</span> 
  </span>+ 
<span class="fraction">
  <span>399</span>
  <span class="fracdenom">400</span>
</span> without your pocket calculator!
</p>

And this is what it looks like:

Compute 3 1 400 + 399 400 without your pocket calculator!

Unfortunately, you have to tweak it for ever page to make it look good; and it displays differently on each and every browser (for one thing: Firefox handles the "inline-block" setting correctly only since version 3).

Sunday, November 20, 2005

The EZ-Diffusion Model

We—that is, Eric-Jan Wagenmakers, Han van der Maas and me—have recently submited a paper which introduces the "EZ diffusion model" for two-choice reaction times, based on the diffusion model by Ratcliff (1978). To make application of the model easier we made a simple JavaScript program. Here's a batch-processing version. You only have to paste a table with the means, variances and proportions correct, and click a button to compute the EZ-diffusion parameters. The values are nicely formatted in a table so that you can copy easily copy and paste them back into your data analysis program. The original program can be found on E-J's site.

Update: An updated version of the EZ diffusion model, EZ2, is now available which also estimates the starting point/bias parameter. See EZ2