: ) wonderful world ( :

the metasyntactic variable

Archive for the ‘links’ Category

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

pragmatic linker

without comments

I decided to maintain a page with links good to know about. It’s like a simple html page with entries like

<a href="blah">blah</a>

It’s very annoying to type the whole skeleton every time a new entry comes. Better to store only the data in a file and generate the output page with a script as advised in e.g. The Pragmatic Programmer book. I prepared two solutions like this.

login08% cat links2html.sh
( echo "<html><body>" && \
  cat $1 | \
  sed -e 's/^\(.*\)$/\1 \1/' | \
  sed -e 's/^\([^\ ]*\)/<a href="\1">/' | \
  sed -e 's/$/<\/a><br \/>/' | \
  sed -e 's/>\ />/g' && \
  echo "</body></html>" \
) > $1.html

login08% cat links-to-html.el
(defun links-to-html ()
  (interactive)
  (let ((new (generate-new-buffer "*links-to-html*"))
        (lines (split-string (buffer-string) "[\n\r]+")))
    (with-current-buffer new
      (insert "<html><body>\n")
      (dolist (l lines)
        (insert "<a href=\"" l "\">" l "</a><br />\n"))
      (insert "</html></body>\n"))
    (switch-to-buffer new)))

login08%

Written by grault

December 25, 2007 - 1:51 pm at December 25, 2007 - 1:51 pm

Posted in command line, links, lisp

wallz

with one comment

I’ve never used any wallpaper on my desktop other than defaults. I search for the one and only : ) This is a nice little collection though.

Written by grault

December 22, 2007 - 11:05 pm at December 22, 2007 - 11:05 pm

Posted in links

where’s the source?

without comments

I removed the snippets published here. Instead I made an arch archive http://people.inf.elte.hu/szucssza/archives/kotee@elte.hu--cl. I dunno if it works due to

temp@afroid-laptop:~/tla$ tla register-archive kotee@elte.hu--cl-SOURCE \
http://people.inf.elte.hu/szucssza/archives/kotee@elte.hu--cl
temp@afroid-laptop:~/tla$ tla archives
kotee@elte.hu--cl-SOURCE
    http://people.inf.elte.hu/szucssza/archives/kotee@elte.hu--cl
temp@afroid-laptop:~/tla$ tla make-archive --mirror-from kotee@elte.hu--cl-SOURCE .
/build/buildd/tla-1.3.3/src/tla/libarch/pfs-fs.c:115:botched invariant
    !!uri
PANIC: exiting on botched invariant
temp@afroid-laptop:~/tla$

The files are there though.

szucssza@panda:~/public/public_html/archives$ find
.
./=meta-info
./=meta-info/name
./=meta-info/mirror
./.archive-version
./cl-bf--mainline--0.1
./cl-bf--mainline--0.1/base-0
./cl-bf--mainline--0.1/base-0/log
./cl-bf--mainline--0.1/base-0/cl-bf--mainline--0.1--base-0.src.tar.gz
./cl-bf--mainline--0.1/base-0/checksum
./cl-bf--mainline--0.1/patch-1
./cl-bf--mainline--0.1/patch-1/log
./cl-bf--mainline--0.1/patch-1/cl-bf--mainline--0.1--patch-1.patches.tar.gz
./cl-bf--mainline--0.1/patch-1/checksum
./cl-bf--mainline--0.1/patch-1/++revision-lock
./cl-bf--mainline--0.1/patch-1/++revision-lock/+contents
szucssza@panda:~/public/public_html/archives$

Written by grault

November 11, 2007 - 10:11 pm at November 11, 2007 - 10:11 pm

Posted in arch, links, linux, lisp

old stuff

without comments

You can find it there.

Written by grault

October 22, 2007 - 2:48 pm at October 22, 2007 - 2:48 pm

Posted in links