2009-10-14
If you have to merge PDF files, you need no other than Ghostscript (which is installed by default with many Linux distributions).
Here's the command line:
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=firstANDsecond.pdf -dBATCH first.pdf second.pdf
2009-10-08
PySWIP is a Python module which enables accessing SWI-Prolog's foreign language interface using our beloved computer language.
Here's a small tutorial on adding facts and rules to prolog knowledgebase.
First, adding facts and rules, based on examples in a Prolog tutorial.
from pyswip import Prolog
p = Prolog()
# something ...
2009-08-13
Here's a sample application for using DCOP with Python.
Needed to install python-dcop on Debian.
It works on KDE 3.5 with Amarok 1.4 (won't work on KDE 4)
import pydcop
playerService = pydcop.DCOPObject('amarok', 'player')
d = dict(
title=playerService.title(),
artist=playerService.artist(),
album=playerService.album ...
2007-05-28
I've written bulk of PySWIP last summer, it is based on Nathan Denny's proolog.py
.
This is the first project that I used ctypes, a fantastic package which allows calling C functions from dynamic libraries that I use to link libpl.so
(Linux) or libpl.dll
(Windows) of ...
python
ctypes
prolog
pyswip
2007-05-27
Finding valid and distinct integers for digits S, E, N, D, M, O, R and Y in the equation SEND + MORE = MONEY is a classical constraint programming problem.
Here's the slightly modified version of the sample program at Wikipedia constraint programming entry for SWI-Prolog using clp library:
:- use_module(library ...
send more money
sendmory
constraint programming
prolog
2005-10-24
A few hours ago, when I was dealing with my thesis, I've come up with a Python function that constructs a tour for a given TSP instance using the nearest neighbor heuristic:
def nearestneighbor(size, dists):
tour = [0]*size
candy = [True]*size
candy[0] = False
for i in range ...
2005-10-17
Today, I added a keyword called freeze to Marvin3.
Basically, when called inside a routine, it pops the top element from the stack and replaces routine's code with a word that pushes that value onto the stack.
This way we can create a write-once routine, which is similar to ...
2005-09-29
How to write 99 bottles of beer in Marvin3?
:bottles dup dup 1 > [" bottles"] [" bottle"] ifte cat ;
:sing
bottles dup " of beer on the wall," cat println
" of beer. " cat println
"Take one down, pass it around." println ;
:theend "No more beer left." println ;
:beers [dup 0 >] [sing decr] while ...
marvin3
marvin
99 bottles
2005-09-27
Marvin3 is a new cross-platform stack-based language developed in Python.
Marvin3 features object-oriented-programming, anonymous routines, eager lists, variables, lexical scope, combinators and support for modules.
This is from my Marvin3 project home.
Marvin has evolved into Marvin3 and is becoming ready to be tried by the audience.
In order to ...
2005-09-14
Last week, I received 20 (1 install + 1 live) Ubuntu Linux 5.04 (Hoary Hedgehog) CDs FOR FREE (details will follow).
Of course in no time I installed it. I have to say that Hoary rocks!
I was using Warthy before, and this new release fixes the few problems Warthy ...
ubuntu
hoary hedgehog
linux
FOSS