Browsed by
Author: Ola Løvholm

Work programmatically with Google Spreadsheets Part 2

Work programmatically with Google Spreadsheets Part 2

A while back I wrote a short post on how you can write and read to Google Spreadsheets programmatically using Python and the package ‘gspread’. Last time the reading was done by first creating arrays with the addresses to where the values could be found in the spreadsheet, and then run through all the values and replace the addresses with the values. It worked fine, but it’s not best practice or very efficient as it makes many single requests on…

Read More Read More

API-scrape images from Instagram

API-scrape images from Instagram

An image can say more than a thousand words, especially when you add a retro-filter and a score of hashtags to go with it. That is a basic explanation to the functionality of Instagram; the power app which revolutionised peoples creativity when it came to documenting dietary habits… and popularised images in social media. Instagram brought social into photography in a way other more desktop-oriented photo sharing applications like Picasa and Flick never managed. It is social and users can…

Read More Read More

Prepare Your Data For Analysis: Load Data With Spoon

Prepare Your Data For Analysis: Load Data With Spoon

Note: The instructions described here is learnt and utilized while working on the Clouds & Concerts project at University of Oslo in close collaboration with Xin Jian, Johannes Bjelland og Pål Roe Sundsøy under supervision by Arnt Maasø. The credit for methodology and SQL ninja tricks is therefore to be attributed to all members of the fantastic stream team. Inconveniences or mistakes are solely my own. Technical set up We chose to use Amazon as a solution for doing our…

Read More Read More

Useful Terminal Commands for work with data

Useful Terminal Commands for work with data

Please, see my terminal-tools tag for more articles on nifty terminal tools. Enclose values in quotes, and add comma Say you work with a large datafile where you get all values printed on consecutive lines, and you want to copy these lines into an array, list or other data structure where strings need to be quoted, and values needs to be separated by commas. Here is a sed script that may help you with that task. sed ‘s/\(.*\)/”\1″,/g’ all_uuid.csv >…

Read More Read More

Safe functions for casting numbers and timestamp in Oracle SQL

Safe functions for casting numbers and timestamp in Oracle SQL

In the process of importing data which can be irregular from a flat file it is convenient to import all values as character strings, in this case Oracle’s varchar2, and then cast them into the proper format using the built-in datatype converters as e.g. to_number. The problem occurs when some value which is not convertible is stored in the column. This could be either because table column-overflow in the import process or because the value is optional and may be…

Read More Read More

Sanntid hjemme: Følg Ruter hjemmefra med Arduino og Python

Sanntid hjemme: Følg Ruter hjemmefra med Arduino og Python

Sanntidsskjermene som Ruter har satt opp ved flere t-bane, trikk og bussholdeplasser har blitt et kjærkomment bidrag til informasjonen du som reisende får om avganger. Ikke bare kan du ha stålkontroll over hvilke avganger som går, og i hvilken rekkefølge, du blir også oppdatert om estimert ankomsttid slik at du vet at du mista bussen du løp for å rekke eller om bussen har blitt forsinka i rush-trafikken. I tillegg til skjermene på holdeplassene som opplyser om sanntid, kan du få…

Read More Read More

Create an online webservice fast with Sinatra and Heroku

Create an online webservice fast with Sinatra and Heroku

So you want to explore the posibitilies of the web, and you want to look the static HTML files served from a web server. Here is a short introduction to how you get a dynamic webserver up and running as fast as it gets utilising the Sinatra web-framework and the hosting provider Heroku. Heroku has already have gained cred in the developer society, and Facebook is now recommending Heroku as PaaS (Platform as a Service) when you create services. It is…

Read More Read More

Screenscrape av Øya-programmet

Screenscrape av Øya-programmet

Forskningsprosjektet Sky & Scene, hvor jeg jobber, ser blant mye annet nærmere på strømmetallene fra WiMP før, under og etter Øya-festivalen. For å gjøre dette trenger vi en liste over hvilke artister som spiller, hvilken dag de spiller og når på dagen de spiller. Før dataene kan analyseres må disse dataene være tilgjengelige i Excel-ark og i CSV-format og i databasen hvor strømmetallene finnes. Dataene må hentes og struktureres i et bestemt format. Et godt utgangspunkt er å samle dataene…

Read More Read More

Bilder fra Øya-festivalen

Bilder fra Øya-festivalen

Jeg var så heldig at jeg fikk vært på Øyafestivalen 2013 for Sky & Scene, forskningsprosjektet jeg arbeider for. Her er et utvalg av bildene jeg tok av band og publikum. [AFG_gallery id=’1′]