Tag Archives: software

Reading iCal in R⤴

from

Being organised is an important habit for anyone in these days of scope creep – the tendency for more and more to be done as part of the job. We’re all trying to maximise our capacity, so eliminating duplication of effort is one way to avoid wasting time doing unnecessary admin. Productivity tools like email and calendars have replaced the memo and diary of pre-Internet days, but there are many brands and infrastructures, often competing with each other. The result can be that we end up keeping several email accounts, and several calendars with the inevitable double booking and confusion.

My policy is wherever possible to keep one master data source: documents are configuration managed and stored safely, checked out and checked in when updated and with a visible, reversible change history. Calendars for each project are aggregated in a suitable viewer from master files in iCal format, allowing them to be easily shared and syndicated.

Planning for next academic year, I wanted to display a simple GANTT chart for students of the overall course structure. This, because I had previously been duplicating weekly details from the master calendar. I wanted a way to automatically generate mini-GANTTs for each week in the Virtual Learning Environment (VLE) from the course calendar. Here’s how I did it: the VLE is written and published in Bookdown.

Fortunately, there is already a package for reading and manipulating iCal files. You may need to install this first.

> install.packages("calendar")

So, firstly we want to grab data from the iCal feed. This is the path to an .ics file or the ical data for the calendar: make sure it’s not just a link to a web interface for the calendar.

> mydat <- readLines("https://www.gov.uk/bank-holidays/england-and-wales.ics")

It’s worth checking that this has returned something useful: the head() function returns the first few lines and an iCal file should look something like this:

> head(mydat)
[1] "BEGIN:VCALENDAR"                     
[2] "VERSION:2.0"                         
[3] "METHOD:PUBLISH"                      
[4] "PRODID:-//uk.gov/GOVUK calendars//EN"
[5] "CALSCALE:GREGORIAN"                  
[6] "BEGIN:VEVENT"       
> 

We can use ic_dataframe() to organise this flat file into something more structured, again peeking in at the first few column header names in the data frame:

> mydf <- ic_dataframe(mydat)
> head(names(mydf))
[1] "DTEND;VALUE=DATE"   "DTSTART;VALUE=DATE" "SUMMARY"           
[4] "UID"                "SEQUENCE"           "DTSTAMP"                          
> 

Selecting the information you need from that is a matter of applying filters. A new data frame using the first 3 columns:

> set1 <- data.frame(mydf["DTSTART;VALUE=DATE"],mydf["SUMMARY"])
> head(set1)
  DTSTART.VALUE.DATE                SUMMARY
1         2016-01-01         New Years Day
2         2016-03-25            Good Friday
3         2016-03-28          Easter Monday
4         2016-05-02 Early May bank holiday
5         2016-05-30    Spring bank holiday
6         2016-08-29    Summer bank holiday

Selecting only Jubilee holidays using the logical form of grep:

> set2 <- subset(set1,grepl("Jubilee",set1$SUMMARY))
> head(set2)
   DTSTART.VALUE.DATE                       SUMMARY
54         2022-06-03 Platinum Jubilee bank holiday

Adding new headings using setnames from the data.table library, then removing row numbers and displaying as a table.

library(data.table)
setnames(set1, c("Date","Event name"))
set2 <- subset(set1,grepl("2022",set1$Date))
knitr::kable(set2[order(set2$From),], caption = '2022 Holiday Calendar', row.names = FALSE)

Which will yield a table in your book(down):

Table 1: 2022 Holiday Calendar

Date Holiday
2022-01-03 New Year’s Day
2022-04-15 Good Friday
2022-04-18 Easter Monday
2022-05-02 Early May bank holiday
2022-06-02 Spring bank holiday
2022-06-03 Platinum Jubilee bank holiday
2022-08-29 Summer bank holiday
2022-12-26 Boxing Day
2022-12-27 Christmas Day

Conclusion

I now have a way of automatically updating the calendar in the VLE for my course, my only having to rebuild the site after a change in the master calendar. This is hugely useful within my workflow and reduces the risk of redundancy or error when there is more than one master. Next steps are to make this produce a GANTT chart.

Manjaro Linux on a MacBook Pro⤴

from

This is how I set up Manjaro XFCE Linux, a lightweight but robust and stable version of Arch Linux, on an old (2009) MacBook Pro past its service life. The idea is to try living with it as a device for research, data capture and analysis and writing up of a PhD thesis (with a view to buying a better machine).

There is plenty of information on how to get Manjaro on to a USB stick and then onto your hardware, so I will not go into details of that. I will instead focus on how I got that basic system working with my writing workflow.

Software management

There are tools built in to Manjaro for managing, installing and maintaining a good range of software but not everything I like to use: fortunately, there is a large community of developers and supporters for Arch and Manjaro who work to bring a lot more software to your installation. This can be found at the Arch User Repository (AUR). To use it, the base-develop package is installed, as well as git:

sudo pacman -Sy --needed base-devel git

Whilst it is possible to install software all over your new system, I like to keep the source in one place, where I can find, update and remember it. Installation is simple enough from there, starting with Google Chrome (not Chromium, by the way, because I work across multiple platforms and require the sync of Google bookmarks, for example).

mkdir Software
cd Software/
git clone https://aur.archlinux.org/google-chrome.git
cd google-chrome/
makepkg -sri

The same method can be used to install other useful packages and tools like slack-desktop, rstudio-desktop-bin (be careful to get the right version of RStudio) and mendeleydesktop.

Mendeley

For my library and reference manager Mendeley, I like to use the watched folder feature of the desktop app, although this may not remain as Elsevier develop the Mendeley suite of applications. At the last Mendeley advisor’s meeting (4th May) we were told that there are no immediate plans to withdraw the desktop app, although it will eventually go. Create the folder and locate it in the app:

mkdir ../Desktop/Mendeley\ drop

Dropbox

I use Dropbox to keep copies of literature, bibtex and other cross-platform files. This will not install without setting up the gpg keys thus:

git clone https://aur.archlinux.org/dropbox.git
cd dropbox/
gpg --recv-keys 1C61A2656FB57B7E4DE0F4C1FC918B335044912E
makepkg -sri

Thanks to yan12125 on AUR for that particular tip. It’s worth, when installing from AUR, having a quick read through any comments in the repository to check how problematic, or indeed, well-maintained, it is.

Setting up workflow

Now we have some basic tools, we can pick up development workflow on the new machine. I created a working folder within Documents into which I can clone my repositories.

Jekyll

The first project I did any work on was the one you are reading: my technical blog, which is hosted on github and served by jekyll. That didn’t go too well, and I was temporarily stuck in a login loop, in which my password was accepted by Manjaro but the login prompt was continually re-presented. I found the cause of this to be a problem with bundler-exec. How I got there:

pamac build jekyll
jekyll s -d docs # threw error, unable to find bundler
pamac build bundler-exec
jekyll s -d docs # threw another error, missing gems
bundle update
nano Gemfile	# to add a suitable gem repository source
bundle install # to install missing gems
jekyll s -d docs

Rebooting overnight, I returned to the machine and couldn’t log in using the GUI. Thanks to weixin_39958100, I located the problem in the .xsession-errors log, by logging in to the terminal using ctrl-alt-fn-F2. It was easy then to remove the script throwing the error that was blocking the log in:

cat .xsession-errors
sudo rm /etc/profile.d/bundlerexec.sh 

Microcast 5: Choices⤴

from @ John's World Wide Wall Display

IMG_7438.jpeg

Some thoughts about making choices about the software and systems you use, they may have hidden positives or negatives.

Featured image, iPhone screenshot, edited in snapseed

    Modern Technology⤴

    from @ John's World Wide Wall Display

    CharlieChaplinEatingMachine

    Yesterday I tweeted a link to a great post, the transcript of a talk about some social aspects of technology and how allowing technologist to lead our progress might have negative impacts on our privacy and lives, here is a quote.

    Those who benefit from the death of privacy attempt to frame our subjugation in terms of freedom, just like early factory owners talked about the sanctity of contract law. They insisted that a worker should have the right to agree to anything, from sixteen-hour days to unsafe working conditions, as if factory owners and workers were on an equal footing.

    Companies that perform surveillance are attempting the same mental trick. They assert that we freely share our data in return for valuable services. But opting out of surveillance capitalism is like opting out of electricity, or cooked foods—you are free to do it in theory. In practice, it will upend your life.

    Remarks at the SASE Panel On The Moral Economy of Tech

    This spoke very much to some thoughts I’ve been having about our relationship to technology companies. Some of these were sparked  by Dean Groom, Why not to buy Minecraft Education Edition.  Some more idaea were discussed at the Always on (them) event at the University of the West of Scotland and I am in the midst of exploring those in a few microcasts, tagged DigitalUWS & microcast (one down a few more to go).

    I’ve not come to any great conclusions but I do think it is something we should be thinking a lot harder about.

    More grist arrived today from Stephen Downes:

    I can see how the presentation would engage school leaders looking for a way to address current trends in learning, but they need to look beyond the single-vendor approach proposed here, and they should be clear that technology companies are service providers who are held accountable for delivery, not partners taking a hand in pedagogical and educational decisions.

    Looking back to move forward: A process for whole-school transformation ~ Stephen Downes

    I know myself enough to recognise that I am somewhat enthralled by technology and software. I certainly need to think about my relationship, on so many levels, with the technology I use. Should we be addressing this in the classroom with our pupils?

    featured image is probably walking a copyright tightrope, but seems appropriate

    Chalking my First Slate⤴

    from @ John's World Wide Wall Display

    I had a bit of a play with Adobe Slate this morning. It is an iOS app for publishing words and pictures.

    The Devil's Pulpit
    The Devil’s Pulpit

    It is quite a very process which allows you to get good looking results quickly. Macworld points out some limitations that struck me immediately.

    It’s dead-simple, but also quite limited. You can choose from a handful of themes to change the whole look of the story, but can’t adjust individual fonts or formats, or even add a link within a larger block of text. (You can, however, place links as standalone buttons.) You can change image formats so they appear full screen, inline, or as a scrolling “window,” but you can’t add borders or freely move images around. Video isn’t supported at all.

    What we gain

    I guess slate is part of the same move to allowing producers to concentrate on the content while the ‘professionals’ provide the design.
    Like Medium you cannot argue with the results from a clean readable point of view.
    We can publish text and pictures easily on a blog. I am sure we can find a theme or two with typography that is as good, but I suspect it might be hard to find such elegant handling of images.

    What we lose

    I am not a professional writer or photographer, neither am I a designer or coder (obviously;-)).
    I publish ‘stuff’, sometime approaching stories, because it is fun and I want to explore the potential of these activities for learning. I have different degrees of interest in all aspects of the process, I think I can learn from each.
    I’ve been thinking about the tension between ease of use and creativity for a while. For learners we will sometimes want them to concentrate on one particular aspect of the work. I can’t be the only teacher who sometimes asked pupils to leave font and style changes till the story was finished. At other times we will want them to get fully involved in messy learning.
    We also lose some control of the data when we publish to silo sites. I am pretty sure that Medium and Adobe will be around a lot longer than Posterous, but I still like backups.

    Alternatives

    Just as I am writing this I remember an earlier experiment A Walk to Loch Oss using Odyssey.js

    The odyssey.js library is being developed to help journalists, bloggers, and other people on the web publish stories that combine narratives with maps and map interactions. The library is open source and freely available to use in your projects. It is initially being built to work with most modern browsers

    from: odyssey.js README on GitHub. Odyssey.js adds maps to the mix but might be an interesting alternative to Slate that allows you more control and ownership. I am sure there are others out there.

    Unexpected Practices⤴

    from @ John's World Wide Wall Display

    it is seldom about technology designers’ a priori plans for a technology, and more about users’ unexpected practices with it. That, to me, is the most fascinating and useful basis of research inquiry.

    via Brief statement on ‘Digital Wisdom’ | Ibrars space.

    I love ‘unexpected practices’ it is why we need flexible technology in Learning and Teaching.

    My favourite use for word when I was teaching primary 6 was as a poor man’s vector editor, Sandaig Otters » Seeing Stars, and I’ve often been surprised by how pupils and teachers bend unsuitable software to their needs.

    Javascript – Grades to Numbers⤴

    from @ ICT & Education

    A while ago I wrote about how I was able to (finally) get my Adobe Acrobat form to calculate grades. (You can read it here). I’ve finally (with the help of @PenmanRoss) been able to do it the other way around – to type in a grade (e.g., A3) and get the form to calculate the corresponding number.

    Here’s the script

    var og = this.getField("GA").value; 
    
    if( og =="A1") 
    event.value = og = 22; 
    
    else if( og =="A2") 
    event.value = og = 21; 
    else if( og =="A3") 
    event.value = og = 20; 
    else if( og =="A4") 
    event.value = og = 19; 
    else if( og =="A5") 
    event.value = og = 18; 
    else if( og =="B1") 
    event.value = og = 17; 
    else if( og =="B2") 
    event.value = og = 16; 
    else if( og =="B3") 
    event.value = og = 15; 
    else if( og =="C1") 
    event.value = og = 14; 
    else if( og =="C2") 
    event.value = og = 13; 
    else if( og =="C3") 
    event.value = og = 12; 
    else if( og =="D1") 
    event.value = og = 11; 
    else if( og =="D2") 
    event.value = og = 10; 
    else if( og =="D3") 
    event.value = og = 9; 
    else if( og =="E1") 
    event.value = og = 8; 
    else if( og =="E2") 
    event.value = og = 7; 
    else if( og =="E3") 
    event.value = og = 6; 
    else if( og =="F1") 
    event.value = og = 5; 
    else if( og =="F2") 
    event.value = og = 4; 
    else if( og =="F3") 
    event.value = og = 3; 
    else if( og =="G1") 
    event.value = og = 2; 
    else if( og =="G2") 
    event.value = og = 1; 
    else if( og =="H") 
    event.value = og = 0; 
    
    else event.value = "";

    Christmas Cheer⤴

    from @ eCurriculum Blog

    Merry JISCmas

    christmas bauble

    A few websites for some Christmas fun this time:

    Dvolver creates creativity widgets - software that enables people to creatively communicate using internet technologies. www.dvolver.com

    NORAD Santa Tracker - It is very good this year, with educational games for younger students, plus lots of other goodies.On Christmas Eve they team up with Google Earth to track Santa as he speeds around the world delivering his presents. As he reaches places of interest there is information about the towns and Cities. http://www.northpole.com/ 

    Buying a Present - One for the lads - forearmed is forewarned!http://bewareofthedoghouse.com/videoPage.aspx

    Elf Yourself - For those of you who had fun a year or two ago - just to let you know The Elf back again this Christmas: http://elfyourself.jibjab.com/view/KQHtQ4ef9fWLQ9h118fI

    Toondoo“ Create your own comic strips, Publish, Share & Discuss”: a creative site with a community presence, very visual, embed or link to favourites, your own or other peoples. http://www.toondoo.com

    Have a happy Christmas and New Year - I'll be back blogging in 2009 - Joan

    Digital Storytelling – Are they Tall Tales ?⤴

    from @ eCurriculum Blog

    Digital Storytelling describes the practice of combining narrative with digital content. Consider how Broadcasters present history and current affairs now e.g. "The History of Scotland" and "Who Do You Think You Are". Take a look at The BBC project Telling Lives which illustrates the concept of digital storytelling.

    Theoretically it is suggested Digital Story Telling could be applied to any subject area as a legitimate technique that can support learning & teaching. Integrating skills from a range of disciplines is an obvious possibility and provides a natural fit for e-portfolios. In addition Digital Storytelling could provide a means of introducing technology to areas of the curriculum that sometimes have difficulty of seeing how it can be applied in non-technical disciplines.

    Someone with little technical background should be able to create digital stories. Typically, a project starts with a script and then digital artifacts are assembled or created to illustrate the story which is then pieced together to form a short movie.

    It is argued that as well as enhancing the oral tradition of knowledge transfer through storytelling, the process also has an impact on learners by forcing them to think critically about the combination of the elements that construct the story.

    There are many easy to use online tools to support the concept over and above well known applications such as photostory3, Windows moviemaker or iMovie. Timeline tools, genealogy tools and the excellent Museum Box which provides tools for you to build up an argument or description of an event, person or historical period by placing items in a online and virtual box.

    http://www.learningtools.arts.ubc.ca/timeline.htm
    http://www.geni.com/
    http://museumbox.e2bn.org/index.php
    7 things your should know about Digital Storytelling (www.educause.edu/eli )

    USB AccessApps: Free Enabling Technology on a Stick!⤴

    from @ eCurriculum Blog

    access_pendrive This week after our own team meeting, Margaret McKay, our eAdvisor for Accessibility and Inclusion did a session with us to introduce AccessApps. This is an initiative developed by the two JISC Regional Support Centres in Scotland, in conjunction with the JISC TechDis Service. AccessApps provides a range of portable/open source technologies on a pen drive. In fact there are over 50 provided.

    Some of the applications are generic tools, such as the word processing, spreadsheet and presentation alternatives. Others cater for specific needs, such as a need to view larger font sizes or different screen colours, or to control a computer without using a mouse.

    Margaret McKay our eAdvisor:Access and Inclusion is providing the support to roll out the initiative in colleges. Contact us here at the RSC if you'd like to know more.

    RSC - AccessApps