Where to put attribution?

I'm working on my own library and I would love to have a good and user friendly docs like ReactJS has.
As I understand I can just use some parts of this repo under CC BY 4.0 license. I'm not sure how I should mention that my documentation is based on Reacts one. Any advices are welcome. I just want to do it in a fair way. Do I have to put my documentation into separate repository than my project is located? My library is under MIT license. I'm also not sure what to do with the file headers like:
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the CC-BY-4.0 license found
 * in the LICENSE file in the root directory of this source tree.
 *
 * @emails react-core
 */

Should I leave them as they are, remove or change to my Organization?

Yes, I have the same question, I like the initial setup on gatsby which has been made, I wanna put my own content, own images, but wanna uses high part of src folder. So not sure where and what should be kept. If src folder would be under MIT, then everything would be clear.

Maybe @bvaughn, you could help us to answer our question, If I can borrow a little of your time.  I've noticed that you have renamed license file. Many thanks.

You might want to check out the Docusaurus project: https://github.com/facebook/docusaurus. It's not Gatsby but it generates static sites with a similar look and functionality to this site.
As far as the Gatsby source goes, you can probably include the original copyright notice in the license file for your derived works.
https://softwareengineering.stackexchange.com/questions/195076/mit-licence-copyright-notice-for-derived-works

(IANAL) I think the source code for this site is MIT and the content is CC-by-4.

@bvaughn Thanks, (IANAL) Actually this can be tricky, because if its content is CC-by-4, and the rest doesn't contain specific  license declaration, then by default it's i don't know, unlicensed?. So that's my concern. I don't want to violate any license rights.

Same question. I'm not interested in re-using any of the content, just the code for the gatsby app. @krzysztofpniak @rostislav-simonik did you resolve this? What approach did you take?
As @krzysztofpniak mentioned, I see one file with the header:
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the CC-BY-4.0 license found
 * in the LICENSE file in the root directory of this source tree.
 *
 * @emails react-core
 */

And another file with the header:
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @emails react-core
 */

But the majority now just say:
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * @emails react-core
 */

Thanks in advance!

@samajammin we haven't used that code.

@gaearon - sorry to bug you but perhaps you know the answer to this? Can you confirm bvaughn's comment that the source code for this site is MIT and the content is CC-by-4?


Don't add legacy setup.py in sdist

Codecov Report

Merging #115 (4563f3b) into master (3ba0caa) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #115   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            3         3
  Lines          494       494
  Branches        93        93
=========================================
  Hits           494       494

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ba0caa...4563f3b. Read the comment docs.


Add proposal for store instance high availability

The format of this proposal mirrors an existing draft proposal:
https://github.com/improbable-eng/thanos/pull/387
We should to arrive at consensus on the open issues described in the proposal (under the 'Open issues' section) before merging.
/cc @xjewer @fabxc @Bplotka

Updated based on feedback, comments welcome.

@mattbostock I don't why we did not ask about this, but....
For HA, is that not enough to just put multiple replicas of store gateways behind some loadbalancer (for example 2 replica statefulset behind k8s service)? (:
This will not work for gossip (as in gossip pods talks to pods), but wil work for static --store flag just fine

Thanks for your work here, but I think we need to merge it as rejected ):  We want gossip to be removed soon and this gives clear, easy win to achieve HA for store gateways -> just by using K8s service or any other simple RR balancer.
However this proposal might be a good base for other features in soon future:

exposing some store gateway external labels (configured statically)
having single store gateway supporting multiple buckets

Merged, just to move it to rejected and have it for future reference.


Databases

[ ] New Jersey's avg Daylight HRs
[ ] Vendors (New Jersey website Amory found)
[ ] Avg cost of installation (Related to vendors)
[ ] External News Articles
[ ] Incentives/Saving (New Jersey website Amory found)

vendors columns:

name
street
zipcode
(latitude, longitude) of zip code (because distance from vendors = distance between zip codes)

articles columns:

name
source
category
date added
url


OverflowError: in method 'RoutingIndexManager_IndexToNode', argument 2 of type 'int64'

So, I have been trying to use Flask in python to send distance matrix from a user form to the vrp program. However, I am facing the same error every time.
The error is -
OverflowError: in method 'RoutingIndexManager_IndexToNode', argument 2 of type 'int64'
The above exception was the direct cause of the following exception:
SystemError: < built-in function RoutingModel_SolveWithParameters > returned a result with an error set
My Code is as follows -
"""Vehicles Routing Problem (VRP)."""

from __future__ import print_function
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
from flask import jsonify, Flask, make_response,request, render_template
from flask_restful import Resource, Api
from flask_cors import CORS
import json
app = Flask(__name__)
CORS(app)
api = Api(app)
get_vehicle= 0
data = {}
def create_data_model():
    """Stores the data for the problem."""
    global data
    data['num_vehicles'] = 4
    data['depot'] = 0
    return data

def print_solution(data, manager, routing, solution):
    """Prints solution on console."""
    max_route_distance = 0
    total_distance = 0
    for vehicle_id in range(data['num_vehicles']):
        index = routing.Start(vehicle_id)
        plan_output = 'Route for vehicle {}:\n'.format(vehicle_id)
        route_distance = 0
        while not routing.IsEnd(index):
            plan_output += ' {} -> '.format(manager.IndexToNode(index))
            previous_index = index
            index = solution.Value(routing.NextVar(index))
            route_distance += routing.GetArcCostForVehicle(
                previous_index, index, vehicle_id)
        total_distance += route_distance
        plan_output += '{}\n'.format(manager.IndexToNode(index))
        plan_output += 'Distance of the route: {}m\n'.format(route_distance)
        print(plan_output)
        max_route_distance = max(route_distance, max_route_distance)
    print('Total distance of all routes: {}m'.format(total_distance))
    print('Maximum of the route distances: {}m'.format(max_route_distance))

@app.route("/", methods=['POST', 'GET'])
def get():
        global data
        # main()
        # ar = jsonify(global_sol)
        # return (ar)
        text_input = request.form["vehicleNo"]
        with open('data.txt', 'w') as data_file:
                data_file.write(text_input)
        # return jsonify({'message': 'Data saved sucessfully!'}), 200
        text_input = None
        with open('data.txt', 'r') as data_file:
                text_input = data_file.read()
        print("data from post")
        print(text_input)
        data = create_data_model()
        data['distance_matrix'] = text_input
        print("distance matrix")
        print(data['distance_matrix'])
        # Create the routing index manager.
        manager = pywrapcp.RoutingIndexManager(len(data['distance_matrix']),
                                            data['num_vehicles'], data['depot'])

        # Create Routing Model.
        routing = pywrapcp.RoutingModel(manager)

        # Create and register a transit callback.
        def distance_callback(from_index, to_index):
            """Returns the distance between the two nodes."""
            # Convert from routing variable Index to distance matrix NodeIndex.
            from_node = manager.IndexToNode(from_index)
            to_node = manager.IndexToNode(to_index)
            return data['distance_matrix'][from_node][to_node]

        transit_callback_index = routing.RegisterTransitCallback(distance_callback)

        # Define cost of each arc.
        routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index)

        # Add Distance constraint.
        dimension_name = 'Distance'
        routing.AddDimension(
            transit_callback_index,
            0,  # no slack
            100000,  # vehicle maximum travel distance
            True,  # start cumul to zero
            dimension_name)
        distance_dimension = routing.GetDimensionOrDie(dimension_name)
        distance_dimension.SetGlobalSpanCostCoefficient(100)

        # Setting first solution heuristic.
        search_parameters = pywrapcp.DefaultRoutingSearchParameters()
        search_parameters.first_solution_strategy = (
            routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)

        # Solve the problem.
        solution = routing.SolveWithParameters(search_parameters)

        # Print solution on console.
        if solution:
            print_solution(data, manager, routing, solution)
            return ("solution")
        else:
            return("no solution")

if __name__ == '__main__':
    app.run(debug= True)

What version of OR-tools and what language are you using?
Language: Python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Routing Solver (VRP)
What operating system (Linux, Windows, ...) and version?

Actually, see https://github.com/google/or-tools/issues/1890
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
Le jeu. 2 avr. 2020 à 16:44, Karthik Menon<EMAIL_ADDRESS>a
écrit :

@lperron https://github.com/lperron Could you elaborate a little more ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1945#issuecomment-607889820,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3MIHJRIMVNTWKXT4TTRKSQGBANCNFSM4L2P23NA
.

@lperron  I tried all threads in #1890 . However, I am still receiving the same error

try adding a try catch around your callback code
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
Le jeu. 2 avr. 2020 à 17:49, Karthik Menon<EMAIL_ADDRESS>a
écrit :

@lperron https://github.com/lperron I tried all threads in #1890
https://github.com/google/or-tools/issues/1890 . However, I am still
receiving the same error
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1945#issuecomment-607928339,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3PIYDZ7R3TGMR6SN23RKSXWZANCNFSM4L2P23NA
.

@lperron I tried adding a try-catch. However, it hits no error every time
try:
            # Create and register a transit callback.
            def distance_callback(from_index, to_index):
                """Returns the distance between the two nodes."""
                # Convert from routing variable Index to distance matrix NodeIndex.
                from_node = self.manager.IndexToNode(from_index)
                to_node = self.manager.IndexToNode(to_index)
                return self.data['distance_matrix'][from_node][to_node]
except:
            print("error in callback")
else:
            print("no error")

with open('data.txt', 'r') as data_file:
    text_input = data_file.read()
print("data from post")
print(text_input)
data = create_data_model()
data['distance_matrix'] = text_input

This makes no sense to me, you are using a string as a distance matrix?
Can you print(type(data['distance_matrix'])) to make sure?

@stradivari96 Thanks for the help. On doing the same. I realized that my list was getting converted to type str.
I converted it back to list and it works now

I ran into the same error. My error popped up due to not putting a demand of 0 at the initial node. (i.e. my len(data['demands']) was less than the number of columns in my distance matrix)

I ran into the same error. My error popped up due to not putting a demand of 0 at the initial node. (i.e. my len(data['demands']) was less than the number of columns in my distance matrix)

Wanted to chime in here for anyone running or-tools library from inside of a job queue like https://github.com/rq/rq.
I was receiving the same error from my model:
OverflowError: in method 'RoutingIndexManager_IndexToNode', argument 2 of type 'int64_t'
Traceback (most recent call last):
  File "./optimizer/test.py", line 379, in travel_time_callback_user
    from_node = manager.IndexToNode(from_index)
  File "/usr/local/lib/python3.7/site-packages/ortools/constraint_solver/pywrapcp.py", line 4670, in IndexToNode
    return _pywrapcp.RoutingIndexManager_IndexToNode(self, index)

However, I noticed I was not receiving the error when running the code directly, only when calling from a worker on our job queue (https://github.com/rq/rq).
Then, I noticed another innocuous log, buried in all the clutter: Task exceeded maximum timeout value (180 seconds).  When I increase the job_timeout for the queued job, these errors went away.  Turns out, there was no issue with my model or the data. Just the queue library was interrupting the process upstream, causing these cryptic errors to appear.


Return an object from EVM execution instead of unwieldy tuples

EVM execution currently returns unwieldy 5-6 element tuples in interpreter.py. These tuples should be turned into dataclasss or NamedTuples to make code more readable.
Personally I would prefer dataclasss because we already use those in the spec.

@SamWilsn Is there anything pending on this issue? I believe we have implemented all the points.

I think we're good! I just forget to close the issues :sweat_smile:
If you add (closes #...) to your commit messages, it'll auto-close the issue when I merge.


Work of cache algorithm

Hello. What advantage of cache in django-select2 ?
I think current cache algorithm is wrong or at least not working as expecting.
For example:
Client opens web page with django-select2 control. HeavyWidgets algorithm cached itself, everytime when it renders on page. Widget cached with object id key (unique key). Here we have several problems:

if page loaded 1000 times it create 1000 instances of cached objects. Cache stores an objects that probably may not used and it wasted use ram memory. But you can config timeout of cache so, that cached objects will be in expired state, but here  exist second problem

For example, you have cache timeout = 300 sec(it's default value in Django cache ).  If user loads page and page remaining open more then 5 minutes, cache of widget will expire. Then user try enter values in select2 controls, he get 404 error. We can set Timeout = 1 year , but then we have problem number 1

Correct me if i'm wrong.

About the topic a hand:
Yes memory could pile up, but only if you have millions of simultaneously visitors. If so, I must kindly ask you to you're put  a fraction billions in ad revenue towards improving this repository.
Yes, the default timeout might not be enough, that's why this issue is well documented and you are advised to configure a separate cache backend.
A side note: both issues where addressed, assessed and documented during the development. Unless you have a better solution I don't see your point of bringing this up again.

So you're saying I shouldn't dedicated my pressures free time to open source because I suck at it?

@codingjoe, no, just a question for clear vision.
For my project solution as pointed in documentation separate cache, set None timeout, and make static cache key for widget.
Thanks for answer.

None is not needed, the session timeout time should be enough. But only if you can't control the size of you cache db. Should work both pretty well.

 Just asked and wanted hear your opinion. Sorry, if so.

None is not needed, the session timeout time should be enough. But only if you can't control the size of you cache db. Should work both pretty well.

Thanks for advise.