Skip to content

Instantly share code, notes, and snippets.

View danielronnkvist's full-sized avatar

Daniel Rönnkvist danielronnkvist

View GitHub Profile

CV

Try to fit all content on to one page.

Don't really mind about gaps in years between experienxe in your CV. It can easilly be explained in an interview.

Make sure your links are clickabl e.

% Bob lab 1
clear all
%% Load and plot gfun
load('gfun.mat');
plot(gfun)
figure
plot(2.^gfun)
@danielronnkvist
danielronnkvist / makeHDR.m
Last active August 29, 2015 14:10
makeHDR
tic
clear all
load('gfun.mat');
ffun= (2.^gfun);
finalpic(:,:,:) = zeros(683,1024,3);
for i=1:14
value = imread(strcat('Img', int2str(i), '.tiff'));
if value > 127
value = 255-value;
end
@danielronnkvist
danielronnkvist / writing_lab_reports.md
Created November 21, 2014 09:23
From a lecture 2014-11-20

Writing lab reports

Lecture by Shelly Torgnyson, 2014-11-20

Do as much work as possible for the draft session. Have questions ready before the five minute session with Shelly.

Simple report structure

  • Title page
@danielronnkvist
danielronnkvist / part1.m
Created December 6, 2014 09:40
Lab 2 TNM087
%% A
cWhite = imread('CWhite1.jpg');
hWhite = imread('HWhite1.jpg');
N = 512
cWhite512 = imresize(cWhite, [512 512]);
hWhite512 = imresize(hWhite, [512 512]);
[X,Y] = meshgrid((1:N));
[T,R] = cart2pol(X-N/2, Y-N/2);
plot(R(N/2, :));
@danielronnkvist
danielronnkvist / Default.sublime-keymap
Last active August 29, 2015 14:15
Sublime text settings
[
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["ctrl+alt+o"], "command": "prompt_open_folder" },
{ "keys": ["ctrl+'"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+'"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["super+r"], "command": "build", "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.pde" }
<%= link_to image_tag(image.public_thumb_url, alt: t('.view_big')), image.public_url, title: "#{album.title}<small>#{image.user.name}, MTD 2015</small>" %>
@danielronnkvist
danielronnkvist / tjock.js
Created April 9, 2015 20:41
Make it fat
function makeFat(el){
el.style.fontWeight = "bold";
el.style.border = "10px solid";
if(typeof(el.childNodes) === "array"){
el.childNodes.forEach(function(elem){
makeFat(elem);
});
}
}
makeFat(document.body);
@danielronnkvist
danielronnkvist / TND004.md
Last active August 29, 2015 14:21
Sammanfattning för TND004

TND004 sammanfattning

Hashtabell

Hash function

Ett hashtabell har en hash function som mappar ett element till ett index där det bör sparas i tabellen. En bra hash function distibuerar elementen jämnt över tabellen för att inte orsaka kollisioner, den ska även vara enkel att beräkna. Så att medelkostnaden blir O(1).

String

Detta exempel lämpar sig för tabeller som inte är allt för stora.

@danielronnkvist
danielronnkvist / translate.coffee
Last active October 15, 2015 13:51
Puts text from config file into html. Just add an translate attribute followed by the keys separated by dashes,for example: <h1 translate-header-title> will get config['header']['title'].
Translation = (config)->
if typeof config != "object"
throw 'Error, config is not an object'
paths = []
iterate = (obj, parent, paths)->
for property of obj
if obj.hasOwnProperty(property)
if parent != ''
new_parent = parent + '-' + property