Archive for the ‘Computers’ Category

new best gmail lab feature

Tuesday, February 3rd, 2009

Single send & archive button. Grrrrrrrrreat.

(more…)

self emacs function reminder

Saturday, January 17th, 2009

This is list-matching-lines that I’m always looking after in my feeds

google reader tags.. err… folders?

Monday, November 17th, 2008

So they renamed their tags as folders. But they still act as tags. Don’t people get confused by the “change folders” behavior?

gmail mac notifier wtf?!

Saturday, October 11th, 2008

Downloading gmail mac notifier brings a dmg file (ok) which only contains a shell script (wt?) which opens another URL to download the notifier (W-T-F-F?!). What’s wrong with you, people, seriously?

Dear Google Calendar people

Monday, October 6th, 2008

Please, follow your gmail friends and add lab features. And add the custom colors feature, kthxbye.

how do I include sparkline in a Jasper report using JRuby?

Friday, September 19th, 2008

Assuming that you have some way to get your source data, and that you already have followed instructions to do sparklines with JRuby and JFreeChart, you must first declare an image inside your report:

  <field name="Spark" class="net.sf.jasperreports.engine.JRRenderable"/>
[...]
  <image scaleImage="Clip" hAlign="Center" hyperlinkType="Reference">
    <reportElement x="200" y="0" width="150" height="30"/>
    <graphicElement/>
    <imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[$F{Spark}]]></imageExpression>
  </image>

And then, from JRuby, you must implement the JRDataSource interface (that is, a basic iterator over your data) to provide the corresponding field encapsulated in a JCommonDrawableRenderer:

class MySparkLine
  import "net.sf.jasperreports.engine.JRDataSource"
  include JRDataSource  
  def getFieldValue( field )
    case field.getName()
    when "Spark"
      return JCommonDrawableRenderer.new( chartObject )
    end
  end
end

And that’s as easy as it gets.

precision

Thursday, September 18th, 2008




Maybe I shouldn’t trust Google spreadsheet about any kind of financial number handling.

best gmail lab feature yet

Thursday, September 18th, 2008

“mark as read” button. ‘nuff said.

I love JRuby

Tuesday, September 2nd, 2008

Really, I love JRuby.

report = JasperCompileManager.compileReport( "myreport.jrxml" ) 
ds = RDataProvider.new( "mydata.csv" )
File.open( "myreport.pdf", "w" ) do |f|
  pdf = JasperRunManager.runReportToPdf( report,  nil, ds )
  out_str = String.from_java_bytes( pdf )
  f.write( out_str )
end

And that’s about it. This is almost all that is required to generate a PDF file for a given report from data stored in a CSV file, using the Java libraries from JasperReports and JRuby.

mediawiki importeImages.php

Saturday, August 16th, 2008

The file extension passed as parameter should be lowercase, even if you plan to import files in .JPG or .GIF (more…)

About

My name is Sebastien Tanguy. This is my weblog. I am currently a software developer, but every now and then I also talk about music, books or photography.

 

May 2012
M T W T F S S
« Jan    
 123456
78910111213
14151617181920
21222324252627
28293031  

Archives