Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jmarca's full-sized avatar

James Marca jmarca

View GitHub Profile
@jmarca
jmarca / vrp_tweak.py
Created October 12, 2022 07:43
Bad optimum value with path cheapest arc strategy
#!/usr/bin/env python3
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jmarca
jmarca / README.md
Last active April 5, 2021 06:47
README.md

If you edit the source, and run with data['max_pseudoaxle_load'] = 300, then the fake axle load thing is not binding and the solver will put the loads wherever it wants. For example:

Bin 0 

{'position': 0, 'item': 10, 'weight': 30, 'value': 45, 'length': 2}
{'position': 2, 'item': 12, 'weight': 42, 'value': 20, 'length': 2}
{'position': 4, 'item': 3, 'weight': 36, 'value': 50, 'length': 12}

Sum of item lengths 16
Packed bin weight: 108

Keybase proof

I hereby claim:

  • I am jmarca on github.
  • I am jmarca (https://keybase.io/jmarca) on keybase.
  • I have a public key ASDOZyqQNeeNmM1lUq5km8TtJF03Y9sFVzXCr1HoArct1Ao

To claim this, I am signing this object:

@jmarca
jmarca / .block
Last active April 6, 2017 08:36
Doing the letter fall thing in Elm
license: GPL-3.0
@jmarca
jmarca / index.html
Created August 5, 2016 00:24
testing
<div class="container">
<header class="site-header">
<a href="#0" class="logo">CalVAD Status</a>
<nav class="site-nav">
<ul>
<li><a href="#0">downloads</a></li>
<li class="active"><a href="#0">raw processing</a></li>
<li><a href="#0">imputations</a></li>
<li><a href="#0">grid modeling</a></li>
</ul>
@jmarca
jmarca / agency_redirect.js
Created September 21, 2012 21:38
test for preserving headers on redirect for superagent
var express = require('express')
, app = express()
, secapp = express()
, request = require('../../')
, assert = require('assert')
, should = require('should')
, querystring = require('querystring')
, https = require('https');
app.use(express.cookieParser())
@jmarca
jmarca / makedir.js
Created August 31, 2011 18:05
naive way of recursive directory creation in node.js
/** makedir.js
* How I make directories recursively in node.js
*
* If you pass it a directory that you want to exist, it will traverse
* the directory tree up until it finds a directory that does exist,
* and then it will go back down the directory structure making all
* directories as needed.
*
* For example, if you have /home/james and you want to create
* /home/james/node/repository/makedir,
@jmarca
jmarca / copyorref.js
Created July 12, 2011 19:27
javascript assignment exploration
// assignment as copy or reference?
// run in node.js as node copyorref.js
console.log('assignment by value for simple scalars')
var a = 8;
var b = a;
a++;
console.log('a: '+a + ', b (not changed): '+b);
console.log('\nassignment by reference: aa[4]=45 is also in other vars')