: ) wonderful world ( :

the metasyntactic variable

Archive for January 2009

this week’s tobacco

without comments

advanced course

advanced course

Written by grault

January 24, 2009 - 5:11 pm at January 24, 2009 - 5:11 pm

Posted in snus, tobacco

darcs use case; cheat sheet

without comments

Central development simulated with darcs.

cd /path/to/project
cd ..
pushd /path/to/repository
mv /path/to/project .
cd project
darcs init
darcs add -r *
darcs record -am "init"
popd
darcs get /path/to/repository/project
cd project
 [develop]
darcs whatsnew
darcs record -am "log message"
darcs push -a /path/to/repository/project

Written by grault

January 22, 2009 - 8:19 pm at January 22, 2009 - 8:19 pm

Posted in command line, script

do Lisp

without comments

Written by grault

January 14, 2009 - 10:26 pm at January 14, 2009 - 10:26 pm

Posted in links, lisp

openoffice.org Draw; insert text as curve

without comments

Actually I’m up to design a business card for myself (due to hopefully financial reasons). One idea was to create the back page as a collection of words related to my professional experience, typeset in different sizes. For this purpose I wrote a small ooo script which inserts strings as curves into the document making me able to place and rotate them after.

Sub InsertWord (oFSize As Single, oColor As Long, oText As String)
  Dim oDoc As Variant
  oDoc = ThisComponent
  If oDoc.SupportsService("com.sun.star.drawing.DrawingDocument") Then
    Dim oPage As Object
    Dim oPoint As New com.sun.star.awt.Point
    Dim oSize As New com.sun.star.awt.Size
    Dim oTextShape As Object
    oPage = oDoc.drawPages.getByName("back")
    oPoint.x = 0
    oPoint.y = 0
    oSize.Width = 9000
    oSize.Height = 5000

    oTextShape = oDoc.createInstance("com.sun.star.drawing.TextShape")
    oTextShape.Size = oSize
    oTextShape.Position = oPoint

    oPage.add(oTextShape)

    oTextShape.String = oText
    oTextShape.CharWeight = com.sun.star.awt.FontWeight.BOLD
    oTextShape.CharFontName = "Arial"
    oTextShape.CharHeight = oFSize
    oTextShape.CharColor = oColor

    oDocCtrl = oDoc.getCurrentController()
    oDocCtrl.select( oTextShape )
    oDocFrame = oDocCtrl.getFrame()
    oDispatchHelper = createUnoService( "com.sun.star.frame.DispatchHelper" )
    oDispatchHelper.executeDispatch( oDocFrame, ".uno:ChangeBezier", "", 0, Array() )
  End If
End Sub

 

Related (and probably useful) links are:

Written by grault

January 14, 2009 - 10:17 pm at January 14, 2009 - 10:17 pm

Posted in links, script

my ucw posts’ summary (till now)

without comments

Written by grault

January 12, 2009 - 7:31 pm at January 12, 2009 - 7:31 pm

Posted in lisp

moBlog test

without comments

test post with HTC Kaiser

Written by grault

January 8, 2009 - 4:54 pm at January 8, 2009 - 4:54 pm

Posted in notes

pad strings with lisp

without comments

(defun padder-format-string (width &key (character #\Space) (side 'left))
  (format nil
          "~~~D,1,0,'~C<~~A~:[~;~~;~]~~>"
          width character (eq side 'right)))

(defun padder (width &key (character #\Space) (side 'left))
  (let ((format-string (padder-format-string width :character character :side side)))
    (lambda (str)
      (format nil format-string str))))

 

CL-USER> (funcall (padder 10) 12)
"        12"
CL-USER> (funcall (padder 10 :side 'right) 12)
"12        "
CL-USER> (funcall (padder 10 :character #\0) 12)
"0000000012"
CL-USER>

 

For details see pages as follows:

Written by grault

January 3, 2009 - 10:50 pm at January 3, 2009 - 10:50 pm

Posted in lisp