Skip to content

Instantly share code, notes, and snippets.

body {
background: #F0F0F0 !important;
}
#top-panel {
height: 37px !important;
background: #036;
}
#top-panel td #login-field span a {
You have a length of timber that needs to be cut into several pieces. The points where the cuts have to be made are marked on the timber, measured from one end. The only precision cutting company available at short notice charges, for each cut, a rate in dollars equal to the length of the piece in metres before cutting.
![Task 5](https://cgi.cse.unsw.edu.au/~progcomp/2014/open/task5img.png)
The order in which the cuts occur affects the total price. For example, a piece 10m long with cuts needed at 4m, 5m and 7m could be cut first at 5m, costing $10, leaving two 5m sections requiring one cut each, a total of $10 + $5 + $5 = $20.
However if the cuts are made at 4m, 7m and 5m the total cost is $10 + $6 + $3 = $19.
# Your Task
Write a program that determines the optimal cutting cost for a piece of timber with up to 50 cuts, and, for maximum marks, the optimal cutting sequence. The cost is to be expressed to the nearest cent, as cuts need not be integral.
#!/usr/bin/env python
import os, time, subprocess, sys
#import libvirt
BACKUP_DIR = "/mnt/backups/vms/DAILY/"
MO_BACKUP_DIR = "/mnt/backups/vms/MONTHLY/"
TODAY = time.strftime('%Y%m%d')
print('Backup procedure started...')
// http://recordit.co/LKXWw6hvLK
// player *snaps* to top y of bottom right block when jumping on right wall (and same for left wall, snaps to bottom left top y).
// when player hits top or bottom half of block from the side, it snaps to the the top or bottom of the block relatively.
pub fn collides<F: Point>(a: &AABB<F>, b: &AABB<F>) -> bool {
return na::partial_lt(a.mins(), b.maxs()) &&
na::partial_gt(a.maxs(), b.mins());
}
let mut y_diff = player.velocity.y * args.dt;
struct App { }
impl App {
pub fn render(&mut self, args: &RenderArgs, g2d: &mut Glium2d, window: &mut GliumWindow) {
let mut target = window.draw();
target.clear_color(0.53, 0.81, 0.98, 1.0);
target.finish().unwrap();
}
}
// this doesn't work
target.draw(&tile_vertex_buffer, &index_buffer, &program, &uniform! {
tex: glium::uniforms::Sampler::new(texture)
.magnify_filter(glium::uniforms::MagnifySamplerFilter::Nearest)
.minify_filter(glium::uniforms::MinifySamplerFilter::Nearest)
}, &Default::default()).unwrap();
// this works
target.draw(&tile_vertex_buffer, &index_buffer, &program, &uniform! {
tex: texture
fn parse_otp(otp: String) -> ([u8; 6], [u8; 32]) {
let otp_raw = otp.as_bytes();
return (otp_raw[0..5], otp_raw[6..37])
}

Keybase proof

I hereby claim:

  • I am fourbytes on github.
  • I am fourbytes (https://keybase.io/fourbytes) on keybase.
  • I have a public key whose fingerprint is EA9A 432A 304E 92D2 9A62 95F5 BAC0 E050 836D 5895

To claim this, I am signing this object:

May 14 19:32:37 redrock calico-felix[4910]: 2020-05-14 19:32:37.308 [INFO][4910] felix/env_var_loader.go 40: Found felix environment variable: "datastoretype"="kubernetes"
May 14 19:32:37 redrock calico-felix[4910]: 2020-05-14 19:32:37.308 [INFO][4910] felix/env_var_loader.go 40: Found felix environment variable: "logseverityscreen"="debug"
May 14 19:32:37 redrock calico-felix[4910]: 2020-05-14 19:32:37.308 [INFO][4910] felix/daemon.go 188: Loading config file: /etc/calico/felix.cfg
May 14 19:32:37 redrock calico-felix[4910]: 2020-05-14 19:32:37.308 [INFO][4910] felix/file_loader.go 27: Ignoring absent config file: /etc/calico/felix.cfg
May 14 19:32:37 redrock calico-felix[4910]: 2020-05-14 19:32:37.308 [INFO][4910] felix/config_params.go 293: Merging in config from environment variable: map[datastoretype:kubernetes logseverityscreen:debug]
May 14 19:32:37 redrock calico-felix[4910]: 2020-05-14 19:32:37.308 [INFO][4910] felix/config_params.go 374: Parsing value for DatastoreType: kubernetes (from environment
[2020-06-08 05:43:58.680537] I [MSGID: 100030] [glusterfsd.c:2867:main] 0-/usr/sbin/glusterfsd: Started running /usr/sbin/glusterfsd version 7.5 (args: /usr/sbin/glusterfsd -s redrock --volfile-id data0.redrock.bricks-bricksredrock -p /var/run/gluster/vols/data0/redrock-bricks-bricksredrock.pid -S /var/run/gluster/ed66b80c50cd37cd.socket --brick-name /bricks/bricksredrock -l /var/log/glusterfs/bricks/bricks-bricksredrock.log --xlator-option *-posix.glusterd-uuid=5b64dea3-d862-4599-a1ad-e57a3a0d3144 --process-name brick --brick-port 49152 --xlator-option data0-server.listen-port=49152 --xlator-option transport.address-family=inet6)
[2020-06-08 05:43:58.681028] I [glusterfsd.c:2594:daemonize] 0-glusterfs: Pid of current running process is 16008
[2020-06-08 05:43:58.684123] I [socket.c:958:__socket_server_bind] 0-socket.glusterfsd: closing (AF_UNIX) reuse check socket 9
[2020-06-08 05:43:58.689603] I [MSGID: 101190] [event-epoll.c:682:event_dispatch_epoll_worker] 0-epoll: Started thread with index 0
[2020-06-08