Skip to content

Instantly share code, notes, and snippets.

View mjlassila's full-sized avatar

Matti Lassila mjlassila

View GitHub Profile
@mjlassila
mjlassila / gist:4055537
Created November 11, 2012 17:06
ITIA41 - Viikkoharjoitusten palaute 8
# Yleiskommentteja
'''Läpikäynnin tarkoituksena oli ohjata kertaamaan kurssilla aiemmin
käsiteltyjä asioita ja toimia demonstraationa luennon sisällöille.
Tähän asti olimme käyttäneet harjoituksissa ainoastaan Pythonin
perustoiminnallisuuksia sekä NLTK-kirjastoa. Nyt otimme lisäksi
käyttöön Gensim-kirjaston, joka sisältää monia tiedonhaun tutkimuksessa
ja käytännön sovellutuksissa hyödyllisiä toiminnallisuuksia Python-kielellä
toteutettuna.
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(
@mjlassila
mjlassila / howto.md
Created September 11, 2013 17:04 — forked from leomelzer/howto.md
  1. You have Ghostscript installed, right? Otherwise sudo apt-get install ghostscript
  2. This is important and installs the headers (iapi.h etc) which are required but don't come with the default Ghostscript package: sudo apt-get install libgs-dev
  3. I also needed sudo apt-get install gs-esp
  4. For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it: sudo apt-get --purge remove imagemagick
  5. Get the source of ImageMagick, untar it, cd ImageMagick-xx
  6. ./configure --with-gslib=yes [and what else you need]
  7. Confirm in the output near the bottom gslib yes yes and not gslib yes no
  8. make
  9. make install
  10. Run convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
@mjlassila
mjlassila / newbooks-rss.pl
Last active December 26, 2015 10:09
Creates filtered RSS feed of new items added to Jyväskylä University Library catalog.
#!/m1/oracle/app/oracle/product/11.2.0/db_1/perl/bin/perl
# this program processes a flat file created by M. Doran's # newbooks system (newbooks.txt)
# author of this program: # w. grotophorst, (c) 2005, Lost Packet Planet
# Program may be freely copied, modified & improved.
# Support for book covers and feed filtering by mjlassila, 2013.
#########################################
# use strict;
# use warnings;
use open qw/:std :utf8/;
use utf8;
@mjlassila
mjlassila / 0_reuse_code.js
Created January 20, 2014 08:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mjlassila
mjlassila / testaus.xqm
Last active January 3, 2016 20:49
For testing single file revisioning in the server.
module namespace testaus= "http://testausta.coj/";
import module namespace functx = "http://www.functx.com" at "functx-1.0-nodoc-2007-01.xqm";
(: URL routing :)
declare
%restxq:GET
%restxq:path("testaus")
@mjlassila
mjlassila / searchspecs.local.yaml
Last active January 4, 2016 00:09
The current customized relevancy settings for JYU-Finna. Go to lines 341-351 for tweaks.
---
# Listing of search types and their component parts and weights.
#
# Format is:
# searchType:
# # CustomMunge is an optional section to define custom pre-processing of
# # user input. See below for details of munge actions.
# CustomMunge:
# MungeName1:
# - [action1, actionParams]
@mjlassila
mjlassila / account_overview.en.tpl
Last active August 29, 2015 13:55
Finnan ohjetekstit.
<!-- START of: Content/account_overview.en.tpl -->
{assign var="title" value="JYKDOK help – Login and My account"}
{capture append="sections"}
{literal}
<h2 title="login">Login</h2>
<p>Login to JYKDOK if you want to manage your personal account details, loans, payments and reservation transactions, renew your loans, or place reservations. When logged in, you can save your searches and favourites for later use. JU students and staff can also use library e-materials from off campus with their own user accounts.</p>
<p>Click on <strong>Login</strong> to log into JYKDOK using either your library card or user account.</p>
<p><strong>Login with library card</strong></p>
<ul>
@mjlassila
mjlassila / MarcRecordLocal.php
Last active August 29, 2015 13:55
Vufind-Finna MarcRecord.php modifications for sorting holdings etc.
<?php
require_once 'RecordDrivers/MarcRecord.php';
/**
 * Local MarcRecord modifications.
 */
class MarcRecordLocal extends MarcRecord
{
/**
* Assign necessary Smarty variables and return a template name to
* load in order to display holdings extracted from the base record
import module namespace functx="http://www.functx.com";
declare option output:indent "no";
declare option output:item-separator "\n";
declare option output:method "text";
(: Käydään dumppi läpi tietue kerrallaan:)
for $record in /OAI-PMH/ListRecords/record/metadata/record
(: Muuttujaan talteen kaikki tietueen kentän 593 arvot.:)
(: On otettava huomioon, että 593-kenttiä voi olla useampi :)
(: Kentässä kurssikoodeja voi olla useita, pilkulla erotettuna :)
let $raw_course_codes:=$record/datafield[@tag="593"]/subfield[@code='a']