text:
provide ability to fix chart namespace

Signed-off-by: Avi Deitcher avi@deitcher.net
How to categorize this PR?

/area control-plane
/kind enhancement
What this PR does / why we need it:
When passing charts to genericactuator.NewActuator, it always passes in the kube-system namespace or blank. However, this may not work for many charts. Many expect the user to provide the equivalent of helm install --namespace some-namespace. The charts may not even work in the generic namespace, and must have a provided namespace. A good example is the rook-ceph chart (which is what brought me to this).
This PR provides an ability to create the Chart with a Namespace override. If the c.Namespace is set, then the Apply()/Render()/Delete() will ignore the passed namespace and use the override.
I did look at putting it into the actuator, but there isn't a clean and easy way to get it in there, whereas the pattern of calling genericactuator.NewActuator() and passing it lots of charts in the args is an easy place to do it.
I have't quite figured out how to create that namespace, but this is a step in the right direction.
Special notes for your reviewer:
As an example of how I might use this, look at the aws extension where it creates the controlPlaneShootChart in valuesprovider.go:
		SubCharts: []*chart.Chart{
			{
				Name: "cloud-controller-manager",
				Path: filepath.Join(aws.InternalChartsPath, "cloud-controller-manager"),
				Objects: []*chart.Object{
					{Type: &rbacv1.ClusterRole{}, Name: "system:controller:cloud-node-controller"},
					{Type: &rbacv1.ClusterRoleBinding{}, Name: "system:controller:cloud-node-controller"},
				},
			},

If the CCM were supposed to be in a specific namespace, say aws-ccm, we currently could not support it. With this PR, it remains optional, but we could do:
		SubCharts: []*chart.Chart{
			{
				Name: "cloud-controller-manager",
				Namespace: "aws-ccm",
				Path: filepath.Join(aws.InternalChartsPath, "cloud-controller-manager"),
				Objects: []*chart.Object{
					{Type: &rbacv1.ClusterRole{}, Name: "system:controller:cloud-node-controller"},
					{Type: &rbacv1.ClusterRoleBinding{}, Name: "system:controller:cloud-node-controller"},
				},
			},

This isn't a perfect example, as AWS is likely to put the namespace in the chart itself, obviating the need for it here, but it gets the idea across.
Rook is the primary example right now.
Release note:

Support Chart namespace override

BTW, if there is a better and cleaner way to do this, I am open to it.

/invite @stoyanr

Thanks @rfranzke

One thing I did not cover here was the equivalent of --create-namespace, i.e.
helm install --create-namespace --namespace <namespace>

Does chart.Chart() take care of ensuring the namespace exists when passed to Chart.Apply()? Or is that something I would need to include here?

@deitch I am afraid I don't fully understand the idea of this PR. You write that:

When passing charts to genericactuator.NewActuator, it always passes in the kube-system namespace or blank.

But in fact, this is not the case. The generic controlplane actuator always passes the namespace of the controlplane resource, see e.g. https://github.com/gardener/gardener/blob/b12f41152e867e6c0678311c9a82400ea7f0e5e6/extensions/pkg/controller/controlplane/genericactuator/actuator.go#L301-L303.
The namespace is not specified in the Chart because the implicit idea is that it can't be known in advance, at least not in the use case for which this type was created. Currently the only place I am aware of where this Chart type is used is the generic controlplane actuator you mentioned, and from our perspective everything that is part of a shoot'c control plane must go to the same namespace, the one that contains the shoot's control plane.
You also write that:

This is the equivalent of passing "helm install --namespace" to the Applier.

However, the Apply function already has a namespace parameter that would be from my perspective the equivalent of the  --namespace command line argument. I am not sure why would we need a second way to provide a namespace. Also, overriding a parameter with a field from the type (and not vice versa) is rather strange from my perspective, if this is needed at all I would propose to design it the other way around.
Could you describe the exact problem with rook-ceph that you are trying to solve, perhaps a link to the problematic chart and if possible the code on your side that attempts to use Chart and fails?
At the moment (without knowing more details about your use case) I am inclined to say that any chart that attempts to install something outside of the controlplane namespace should not be installed by the generic controlplane actuator. Could you perhaps solve your problem by installing / removing this chart as part of a different flow than reconciling the Controlplane resource? I am only vaguely familiar with rook-ceph but it seems to me more like something that an Infrastructure reconciliation could take care of?

The namespace is not specified in the Chart because the implicit idea is that it can't be known in advance, at least not in the use case for which this type was created.

Agreed.

Currently the only place I am aware of where this Chart type is used is the generic controlplane actuator you mentioned, and from our perspective everything that is part of a shoot's control plane must go to the same namespace, the one that contains the shoot's control plane.

Does it? What if I am deploying resources to the shoot itself? For example, a CCM or a storage mesh (which is my use case). Granted, CCM almost always lives in kube-system, but it need not.

However, the Apply function already has a namespace parameter that would be from my perspective the equivalent of the --namespace command line argument.

Agreed. My issue is not with can I pass a namespace, but how do I override the default namespace that Gardener passes, i.e. kube-system. There are charts for system components which are expected to be installed not in an application namespace or in kube-system, but in a dedicated one. rook-ceph is our example at hand (which brought this to me), but I can think of others.

I am not sure why would we need a second way to provide a namespace. Also, overriding a parameter with a field from the type (and not vice versa) is rather strange from my perspective, if this is needed at all I would propose to design it the other way around.
Could you describe the exact problem with rook-ceph that you are trying to solve, perhaps a link to the problematic chart and if possible the code on your side that attempts to use Chart and fails?

Certainly. If there is a different way to do this, I am all for it. I just want to make it work.
Here are the install instructions for rook-ceph. Essentially:
helm repo add rook-release https://charts.rook.io/release
helm install --create-namespace --namespace rook-ceph rook-ceph-cluster \
   --set operatorNamespace=rook-ceph rook-release/rook-ceph-cluster -f values-override.yaml

It is fully expected that you:

install it in a specific dedicated namespace
create that namespace
pass it as part of the values

The namespace itself appears nowhere in the chart; it is entirely parametrized via either templates in the chart (--set ...) or the --namespace rook-ceph which sets the default.
It shouldn't go in kube-system or default.
What I have been trying to do via this PR - and led me to this - is put the plain vanilla off-the-shelf rook chart into  charts/internal/shoot-system-components/charts/rook-ceph/, added the storage class into the right place, of course, and then modified valuesprovider.go to include it as part of controlPlaneShootChart that gets passed to AddManager (which calls genericactuator.NewActuator()).
The storage needs to be in place for the shoot to function as anything with storage - e.g. a shooted seed - because storage via CSI is a prerequisite.
Given the above - it needs to be installed (as an option) when deploying a shoot; we want to keep the plain vanilla chart without modifications (upkeep/maintenance costs); we need to deploy it to a specific namespace and create that namespace - is there a better way to go about doing this? I am all for whatever works.

@deitch Thanks, it's much more clearer now.

Does it? What if I am deploying resources to the shoot itself?

You are right, there are charts that go to the shoot, I did not realize rook-ceph may be such a chart. These charts are not applied directly, but rendered and applied later by GRM via a ManagedResource. The namespace Gardener passes is always kube-system. The relevant code is https://github.com/gardener/gardener/blob/b12f41152e867e6c0678311c9a82400ea7f0e5e6/extensions/pkg/controller/controlplane/genericactuator/actuator.go#L317-L319.
Still, rather than modifying the Chart type in the proposed way, I would consider the following approach:

Create the namespace via a separate chart / managed resource. As you mentioned, the namespace should also be created, and there is no other really good way to do it except via the GRM. You would need to add yet another chart to the list of charts passed, e.g. controlPlaneShootNamespaceChart.
If controlPlaneShootNamespaceChart is non-nil, pass the relevant namespace (instead of kube-system) to the call to managedresources.RenderChartAndCreate mentioned above.

This would however not work if, in addition to deploying rook-ceph to its own namespace, you would also like to deploy stuff to kube-system namespace, e.g. CCM RBAC resources, CSI node controller, etc. For this reason, I would also propose that you consider instead of modifying the generic actuator:

Create your own actuator (the generic actuator is there really only for convenience, you can very well replace it with your own)
Embed the generic actuator into your own to avoid duplicating code and delegate to the generic actuator Reconcile and Delete methods.
Extract rook-ceph to its own chart, and also create the namespace chart mentioned above
Apply these charts in your actuator's Reconcile method after calling Reconcile on the generic actuator (via managed resources).
Delete these charts in your actuator's Delete methods before calling Delete on the generic actuator (via managed resources).

As an example how a similar non-generic actuator can be implemented, you could take a look at https://github.com/gardener/gardener-extension-provider-azure/blob/master/pkg/controller/controlplane/actuator.go.
The one thing that I am not entirely sure is that since there is no way to specify that the rook-ceph managed resource depends on the namespace managed resource (and so should be applied after and deleted before the other one), GRM will try to apply / delete them in parallel, which would result in failures. Still I think it should probably work, since GRM would automatically retry after such a failure. No one has tried this however, so I can't be sure. Perhaps you could give it a try and if you encounter issues, we can discuss how to solve them (e.g. via a fix in GRM).

I get what you are saying, that this cannot simply go into the same "space" (for lack of a better term, encompassing chart location and actuator, etc.) with the kube-system namespaced things (CSI, CPEM, etc.). It would be convenient if there were a structure to handle these as well, but there isn't.
So you are proposing that instead of modifying the genericactuator.Actuator, I create my own in pkg/controller/controlplane/ (like the link above), which modifies the behaviour that I want.
I then call that actuator in add.go to pass to controlplane.add() rather than the generic one.
That part I get.
The part I am unsure of is this.

I think you are saying that this would be a completely different argument to my NewActuator(). In addition to passing it the genericactuator with all of its usual arguments, I also pass it a "to apply to shoot when done chart" argument. This is an entirely new var, similar to, say, controlPlaneShootChart or controlPlaneChart that I already am passing to the genericactuator.NewActuator(). Except here it is being passed to my actuator.
The chart itself would live in a new separate path under charts/internal/shoot-components/ or similar

So it would look something sort of like this.
valuesprovider.go:
var shootLateDeployChart = &chart.Chart{
	Name: "shoot-later-components",
	Path: filepath.Join(equinixmetal.InternalChartsPath, "shoot-later-components"),
	SubCharts: []*chart.Chart{
		{
			Name: "rook-ceph",
			Images: []string{
				equinixmetal.RookCephImageName,
			},
		},
	},
}

add.go:
func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error {
	var (
		exposureSecrets           secretutil.Interface
		configChart               chart.Interface
		controlPlaneExposureChart chart.Interface
		configName                string
	)

	return controlplane.Add(mgr, controlplane.AddArgs{
		Actuator: NewActuator(
                        genericactuator.NewActuator(
                              equinixmetal.Name, controlPlaneSecrets, exposureSecrets, configChart,
 			     controlPlaneChart, controlPlaneShootChart, nil, storageClassChart, controlPlaneExposureChart,
			     NewValuesProvider(logger), extensionscontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot),
			     imagevector.ImageVector(), configName, opts.ShootWebhooks, mgr.GetWebhookServer().Port, logger
                        ),
                        shootLateDeployChart),
		ControllerOptions: opts.Controller,
		Predicates:        controlplane.DefaultPredicates(opts.IgnoreOperationAnnotation),
		Type:              equinixmetal.Type,
	})
}

And my Reconcile (and Delete) would look more or less:
actuator.go:
(a *Actuator) Reconcile(ctx context.Context, cal *extensionsv1alpha1.ControlPlane, cl *extensionscontroller.Cluster) (bool, error) {
    // do something in here to apply the given chart to the given cluster
}

First, did I understand you correctly?
Second, is the dedicated path where the charts should live, as I understood them?
Third, I am not sure what goes in the Reconcile and Delete.

First, did I understand you correctly?

Yes, this is more or less what I had in mind.

Second, is the dedicated path where the charts should live, as I understood them?

Yes.

Third, I am not sure what goes in the Reconcile and Delete.

E.g for Reconcile:
func (a *actuator) Delete(
	ctx context.Context,
	cp *extensionsv1alpha1.ControlPlane,
	cluster *extensionscontroller.Cluster,
) (bool, error) {
	// Call Reconcile on the composed Actuator
	return a.Actuator.Reconcile(ctx, cp, cluster)

	// Get shoot later components chart values
	values, err = a.getShootLaterComponentsChartValues(ctx, cp, cluster)
	if err != nil {
		return false, err
	}

	// Render the shoot later components chart and create a managed resource
	if err := managedresources.RenderChartAndCreate(ctx, cp.Namespace, shootLaterComponentsChartResourceName, false, a.client, chartRenderer, a.shootLaterComponentsChart, values, a.imageVector, shootLaterComponentsNamespace, version, true, false); err != nil {
		return false, err
	}

	// Something similar to above for the namespace chart
}

You can take a look at the generic actuator implementation for how to get a.client properly injected, and how to build chartRenderer and version. a.imageVector is probably best passed via the constructor (together with the charts). The rest are constants. The most interesting part is building the values, but you should have already implemented this logic in your current PR as part of your custom ValuesProvider. You would now need to move it to your custom Actuator.
For Delete, you first delete your managed resources and then delegate to a.Actuator.Delete. Again you can take a look at the generic actuator implementation for how to do this properly.

OK, good.
Let's close this PR, but I will come back here when I have further questions, until I get the other PR truly ready.
Thanks @stoyanr

@deitch You are welcome!

@stoyanr still struggling with a few things.
First, creating the namespaces. I looked at creating a "namespaces" chart, and at just putting it in the internal/shoot-later-components/values.yaml as a list and having the actuator just create them. Both had challenges.

For a separate chart, I ran into issues with how to handle ordering. It isn't too bad when creating (doesn't hurt to apply a Namespace yaml twice), but it creates issues when deleting. I could remove it from the list of Chart.Subcharts, but it becomes messy.
For the straight list, I wasn't sure how to get those. I would need to read the actual values.yaml somewhere, either in valuesprovider or actuator.

In both circumstances, do you have any idea how I should indicate "use this namespace for this chart"? I thought about putting it in values.yaml as part of the sub-charts values, but then I need the actuator (or valuesprovider) to extract that value and pass it on. I wasn't sure how to handle that either.

authors: deitch rfranzke stoyanr


text:
automatically generate documentation index

How to categorize this PR?

/area documentation
/kind enhancement
/priority 5
What this PR does / why we need it:
This PR adds a small script which can automatically generate the documentation index (README.md in docs folder).
How to use:
Use make generate-docs to run the script. It is also included in make generate.
How it works:
The script first searches every folder in the docs folder for whether it contains a .docnames file. This is a meta file in JSON format, which contains the name with which this folder should be displayed in the index. Folders which don't have this file will be ignored. For all that have it, it then goes over all *.md files in them and generates links for the index.
The name for the link will be determined as follows:
Usually, the doc files have a fitting name set as header in the first line, which will be used. Alternatively, the name can be set manually by specifying it under overwrites.<filename> in the folder's meta file (see api reference for an example). If the first line of the file is empty and no overwrite is specified, the file will be ignored. To manually ignore a file, define an overwrite pointing to an empty string.
Release note:

The documentation index (README.md in the docs folder) can now be generated automatically by calling `make generate-docs`. It will also be generated on `make generate`.

Would it perhaps make sense, to add the description in this PR how the index creation works to the developers documentation?

Would it perhaps make sense, to add the description in this PR how the index creation works to the developers documentation?

Valid point, will add it.

source: gharchive/pull-request

authors: Diaphteiros achimweigel

repo: gardener/landscaper

license_type: permissive

license_source: github-api


text:
Drop Image Matrix (iaas CLIs x kubectl versions)

What this PR does / why we need it:
This PR reverts https://github.com/gardener/ops-toolbelt/pull/50
Which issue(s) this PR fixes:
Fixes #73
Special notes for your reviewer:
Release note:

With this release of the `ops-toolbelt` only one image is built (`eu.gcr.io/gardener-project/gardener/ops-toolbelt`). The image matrix (iaas CLIs x kubectl versions) will not be built anymore.

@petersutter should we still add "install on demand" commnnds for the iaas clients similar to what we do for tables and wireguard?

@plkokanov I think these images were not used at all and in addition having the cloud provider cli tool installed makes only sense in combination with gardenctl. That's why I would suggest to add it if there is really demand for it. Or do you know of a use case where it still makes sense to have it?

authors: petersutter plkokanov

repo: gardener/ops-toolbelt


text:
CORS error

Hi, I'm using your API for a project and it was working fine until now, I keep getting CORS errors, at first I thought it was my fault but I just checked the commits and in the last commit you changed some CORS variable, so maybe that's why?

Hi, sorry for the bug, and thank you for letting me know!
I think the issue was caused by a combination of

that CORS variable change
a deployment failure on my server due to an incompatible Python version

I spun up a replacement server with a newer version of Python, and I think that will fix the problem when domain name servers point gutendex.com to the new Gutendex server.
Please try again and let me know if you still have issues.

It's working perfectly now, thank you! :smile:

source: gharchive/issue

repo: garethbjohnson/gutendex

license: MIT


text:
[qplex_core.py] Could you please explain more how it works?

Hi, I'm interested in the concept of QPLEX. (Is it from the solver IBM CPLEX right?) I already read 'README.md' but I can't totally figure the 'qplex_core.py' yet.

Could you please explain more about the functions in 'qplex_core.py'.

Could we extend the QPlex to solve as Non-linear Programming (NLP)?

Dear dongsin-kim,
First of all, thanks for your interest. Yep, it's based on IBM CPLEX, but still on an early development.
We tried to make a solver for generic functions receiving a function with different variables and a condition (currently condition is like  ax+by+c*z <= beta). you can check an example at the main.
We encode the number (integer) as binary on severl qbits (as many as precission specified).
And of course you can extend QPlex, it has a MIT license, and if that helps you, we are delighted to know.¨
Regards

Dear gatchan00,
Hello.
Thank you for your reply-! Oh, I see. I am really surprised with your idea.
Maybe, I need more time to look into the code. I hope to keep in touch.
And I hope you have a great day. :-)
Best regards,
Dongsin

You are welcome,
If you need something, just ask for it.
Regards


text:
HTTP: mitigate Java's eternal DNS cache lack of round robin

When using Java's eternal DNS cache, records come always in the same order, so DNS round robin is ignored and all the virtual users hit the same host.
We can have a per virtual user cache that stores a shuffled list.

Will this fix also use additional IPs that are included in DNS records when ELB autoscales?

This will.
But beware of the extra IO on the Gatling hosts :)

Ah. Good point. And is that why we should set nativeTransport to true?

No, completely unrelated. Enabling nativeTransport triggers a Linux epoll based transport instead if Java NIO implementation.

authors: aidylewis slandelle

repo: gatling/gatling


text:
Since upgrading to 3.0.0, incremental builds leave most content 404ing

Hey guys,
Yesterday we upgraded to 3.0.0, but now we're seeing a strange issue where once a WP content change triggers and incremental build, nearly all URLs on our site lead to 404s. Nothing is obviously wrong in the logs, but this seems to happen with any incremental build. A full redeploy fixes the issue though. Has anyone else seen anything similar? Any and all advice is appreciated—we were planning to launch tomorrow 😅
Thank you!

Hi @jdselig sorry about that! Update to gatsby-source-wordpress-experimental@3.0.2 for a fix!

Closing but please feel free to re-open or comment here if it didn't solve your issue.

authors: TylerBarnes jdselig


text:
Crashes on newest version

Steps to Reproduce (as best as you can)
run any command
Expected Behavior
Should not crash
Actual Behavior (What lead to the bot getting permanently stuck)
After a few seconds the game crashes
Crashlogs and Screenshots (if applicable)
(you may drag + dr
latest.log
op text logs and images here, thanks GitHub)
Other mods (if applicable)
Discord username (if you want updates)
TheGamerGerman#9321
Developer Notes (leave this blank)
Difficulty: __
Estimated Time Required: __
Once development starts.

Yea I mucked up the release somehow. I fixed it this morning and will make a new release in a few hours.

Fixed in 0.4.1a which replaced 0.4.1
Should be good to go now.

repo: gaucho-matrero/altoclef


text:
initial commit

This Code includes ;-

Base setup
Routing to different pages
Header section  template code
SignIn and Register pages template
Home section rendering categories(naviagting to product is not included in this yet).
Product page template and nav section for different categories.

repo: gautam-in/shopping-cart-assignment


text:
Add quantity to 'add to cart' mechanism

Basket items usually have a quantity and the total price is derived from quantity * item price

Hi! thanks for the suggestion. This was a one-day task done as a part of a hiring activity. So I don't see a point in working on additional features. However, I'm open to contributions!

authors: TakesTheBiscuit gauthumj

repo: gauthumj/Krypto-Ecommerce-website


text:
Sleep with context

In request.go, when we retry request, we issue delay using time.Sleep.
It means that when we're sleeping, we ignore context.Context, if it's present. If context is cancelled, sleep wont be interrupted immediately, which is not desired.
If r.config.Context is not nil (it comes from Config or WithContext), we instead should listen for context cancellation and interrupt from sleep if needed (and fail retrying).
Note that we should listen on r.config.Context, not local ctx that we create in each retry iteration. The latter is for retry timeout.
Ideally this should be covered by both unit and e2e tests (see e2e_context_test.go).

hi maybe some questions
we have expErrorSuppressor in https://github.com/gavv/httpexpect/blob/master/e2e_context_test.go#L94
and i've read some lines that use reporter in this code base
but I still cant connect the dots, my questions are:

what is a reporter? what does it do? and why httpexpect has several reporter implementations
why the expected error needs to be supressed in e2e_context_test.go?

thank you

Hi,
In short, the generic flow of httpexpect is:

create Expect object using httpexpect.Default or httpexpect.WithConfig (root object)
using Expect object, create Request object (request builder)
use various Request methods to build http request (e.g. WithText, WithHeader)
call Request.Expect(); it will send http request, receive http response, and create Response object based on received response
use Response matcher object to perform assertions on response
create child matcher objects to perform asserions on parts of response; e.g. Response.Headers() will return child matcher object to inspect headers; Response.Body() will return child matcher to inspect body

This is how failure reporting works in matcher objects:

every matcher object (e.g. Response, Value, Array, Object, etc) have chain
when a child matcher is created (e.g. you call Response.Body), the chain is cloned, and the clone is passed to the child object
when matcher performs an assertion (e.g. Object.Equal), and assertion fails, it reports failure to its chain
every chain object has:

fail bit; it is set after first failure; after it's set, all subsequent failures will be ignored in this chain and in future clones of this chain (i.e. in child matchers)
assertion handler; chain uses this handler to report failures

AssertionHandler may be redefined by user. However, in most cases, we use DefaultAssertionHandler, which does the following:

formats failure using Formatter
reports failure using Reporter

Again, Formatter can be redefined by user, but usually we just use DefaultFormatter.

Note: User rarely needs to provide custom AssertionHandler. Providing Reporter is much easier. However in some complex cases, e.g. when user wants to integrate httpexpect with other testing frameworks, it may be helpful.

Note: Defining custom formatter is rather complicated task and also is rarely needed.

Reporter is always provided by user. Reporter has very simple interface: it should provide one Errorf() method that will report already formatted message to testing suite.
Standard testing.T struct implements Reporter interface, and the user can just use t as reporter. In addition, we provide two nice Reporter implementations: AssertReporter and RequireReporter. They both use testify package (it's assert and require sub-packages`). When you will use them instead of bare testing.T, testify will add nice backtrace and indentation.

why the expected error needs to be supressed in e2e_context_test.go?

expErrorSuppressor is a mock implementation of AssertionHandler. We use it in a few tests to catch situation when a failure is reported and this failure contains error with specific error message, e.g. "context canceled". It is needed to test that when context deadline expires, a correct failure is reported.
Note: e2e_context_test contains e2e, i.e. end-to-end tests (also called blackbox tests). Those tests intentionally don't know about internals of httpexpect, they use only their public interfaces. In particular, they can't modify or inspect chain. That's why they use a more complicated approach for catching failures with mocking of assertion handler.

thank you for the explanation
that makes a lot of stuff clearer
gonna spent time to do some hands-on first

Merged!

I've added some comments to chain struct: c15c509fb05ef77a0d2aae0defc3e93e879618b0

nice good comments

authors: gavv neverbeenthisweeb

repo: gavv/httpexpect


text:
Please use semver

http://semver.org/
https://dave.cheney.net/2016/06/24/gophers-please-tag-your-releases

Starting from Go 1.9, the standard time package transparently uses monotonic clocks when necessary, so this package is no longer relevant. I'm closing all issues and archiving the repo.

authors: gavv ybbus

repo: gavv/monotime


text:
ign -> gz Migrate Ignition Headers : gz-sensors

See: https://github.com/gazebo-tooling/release-tools/issues/784

@osrf-jenkins run tests

authors: methylDragon nkoenig

repo: gazebosim/gz-sensors


text:
MBC1 & MBC6 titles broken

Titles for MBC1 and MBC6 are broken in the PDF export.

Appears fixed by #292.

authors: ISSOtm basxto

repo: gbdev/pandocs


text:
47 dgauges

in progress - getting dgauges to work #47

@gbochenek ready for review and merge.

repo: gbochenek/esri-wab-build


text:
use haversine formula for great-circle distance

Haversine formula is commonly prefered due to smaller floating point errors.

Coverage increased (+0.3%) to 94.207% when pulling 7dc870df00c8fbb7fd8a73f70b18e24c41664188 on IlyaOrson:patch-2 into 54ee4be1e65c33a41c5751a3ea80a195987a6582 on gboeing:master.

Coverage increased (+0.3%) to 94.207% when pulling 7dc870df00c8fbb7fd8a73f70b18e24c41664188 on IlyaOrson:patch-2 into 54ee4be1e65c33a41c5751a3ea80a195987a6582 on gboeing:master.

Coverage increased (+0.3%) to 94.207% when pulling 7dc870df00c8fbb7fd8a73f70b18e24c41664188 on IlyaOrson:patch-2 into 54ee4be1e65c33a41c5751a3ea80a195987a6582 on gboeing:master.

Thanks @IlyaOrson. What are the trade-offs here? That is, can you quickly validate how much precision/accuracy is gained with the haversine method over the cosines method, and what is the difference in performance time?

authors: IlyaOrson coveralls gboeing

repo: gboeing/osmnx

license: mit

license_source: bigquery


text:
[iOS] App crash after open webview and taking screenshot

Hi @gbumps , I face this error if you have any idea on this ? Thank you
Device: Simulator iPhone 15 pro iOS 17.0.1
react-native-screenguard: 0.3.2
Step to reproduce:

register the ScreenGuardModule.register
open inapp webview
trigger screenshot
The screenshot is replaced by black screenshot
App crash with error

Your app just crashed. See the error below.
NSInternalInconsistencyException: Error when sending event: onSnapper with body: (null). RCTCallableJSModules is not set. This is probably because you've explicitly synthesized the RCTCallableJSModules in ScreenGuard, even though it's inherited from RCTEventEmitter.

I guess that you're using react-native-webview to display an in-app webview. Does it happened on real device ?
It's better to reproduce it with a recording screen instead so I can clearly understand what's happening.

while I'm finding a way to fix, here's the work around for you:  Try to open the in-app Webview inside a Modal.

While I'm finding a way to fix, here's the work around for you: Try to open the in-app Webview inside a Modal.

hello @mthinh, Does this solved your problem yet ? If not, just reopen the issue.
Thanks!

authors: gbumps mthinh

repo: gbumps/react-native-screenguard


text:
Google analytics

This added the Google Analytics code to the head of the site.
Also doesn't show up on the staging Netlify sites.

@fredymoko Do we need to do anything in the GA dashboard to stop the analytics from collecting when we run the site locally / localhost?

I added an if condition to not load the GA script on localhost.


text:
Parse special characters

I have problem parsing this special characters ( <br />). In the xml tags there are also these symbols and html code. Can You help me?

This situation also mentioned in #4.
Inner text of an element must to be XML encoded. For more details you can see this question in stackoverflow and the XML entities in wikipedia.
XMLMapper uses already the public property xmlEncodedString (String+XMLParser.swift) to XML encode the inner text of tags in serialization proccess.
This issue will probably closed as a duplicate of #4

Duplicate of #4

authors: SalvatoreAD gcharita

repo: gcharita/XMLMapper


text:
Do you use the gafferpy python shell?

We now have two gaffer python shells - the older gafferpy and the newer, partly developed, fishbowl dynamic shell.  While one is more established it has some issues and detractors. The newer shell needs work, but possibly has more potential in the long run.
What would your reaction be if our strategy was to develop fishbowl and then retire the older shell?
What things must we add to fishbowl to make it more attractive than gafferpy?

I'm quite a big user of the existing shell.  In principal, I'm quite a fan of the idea of fishbowl.  Would be interesting to think about migration path, and what exactly "retiring" the old shell means, but as the old shell is essentially a wrapper for the REST API, I'm hopeful that this plan wouldn't impose an immediate cost on folks who are using the existing library.
Would be great to hear more, and have a chance to lobby for my pet peeves being addressed in the move :-)

@sw96411 I think a discussion with some key users would be great. It would be useful to hear what design features can be addressed and added while developing fishbowl, as well as adding the missing features.
I also think it is safe to say that when fishbowl becomes feature complete we wouldn't just drop gafferpy immediately but it would not receive new features as quickly for example.

@sw96411 Bring on your pet peeves

:-)  Just a few things really.
Firstly, an observation on fishbowl that you are probably going to change anyway - at the moment IIRC it just dumps an API binding to the folder 'generated' under whatever the current working directory of the python shell is.  This is a risky move for a couple of reasons (I might not have write access to that directory, I might be trying to bind to two different Gaffer instances, I might be sharing a python installation with different users, I might already have a folder called "generated" at that place in my filesystem...).
I'd suggest at least allowing the destination to be specified and defaulting to a tempfile.  You may also be able to use importlib tricks and filelike objects to automatically import the relevant libraries, and maybe even do so without needing to write a file to the actual filesystem.
Re:  GafferPy itself, most of the usability issues I see not related to the actual API itself (which GafferPy can't help, of course!) are about handling results.  Navigating results in GafferPy involves dealing with a mix of objects, nested dictionaries (often of size one and keyed by Java FQDNs) and switch statements to deal with directed edges.  If you're quite familiar with how Gaffer works, it all makes sense, but it's hard for new users, particularly non-programmers working in Jupyter, to get their heads around.
I'd suggest what's needed is both access to a raw view of the results JSON (as a JSON object, nested-dicts etc) and the ability to tell the API which parts of the results I'm interested in, and then have it create the objects I need as a generator.  So I could do something not entirely unlike:
results = gc.execute(my_operation_chain)
for result in results.generate(['source.type AS type', 'source.value AS VALUE', 'my_special_property', ('my_other_property', str.upper)]):
print(result.type, result.value, my_special_property, my_other_property)
The idea behind the tuple on my_other_property is I'm telling the API to apply the function str.upper to the property.  You could use this to decode a HLLP, list of timestamps etc.
There's different ways to skin this particular cat though, and I can see from fishbowl you've already had some exciting thoughts on that topic!

@sw96411 I think these are both good ideas.
Being able to load the library straight in from memory, and optionally save it to disk, seems a lot cleaner.
Also I like your idea for making the outputs easier to handle and reason with. I think a raw json response should be still available but some form of response which is easier to query and process would make the API a lot easier and nicer to use.

The decision has been made that gafferpy will be deprecated in the last few Gaffer 1 releases. With Gaffer 2 it will be removed and replaced by a more functional fishbowl. The deprecation will act as a way to show users that gafferpy is for Gaffer 1 graphs, fishbowl is for Gaffer 2 graphs.
@sw96411 how does this sound to you?

See https://github.com/gchq/gaffer-tools/issues/951

repo: gchq/gaffer-tools


text:
Gh 845 is operation supported null input

Covers issue #845
Updated is_operation_supported url generation to handle operation=None.
Added doc strings for the execute_get and is_operation_supported methods with expected inputs and examples.
Commit  5f5bb4b - Changed the outputs of the two methods from strings to json.loads() of those strings - happy to revert this if it is breaking something elsewhere I couldn't see. All usage of these methods (*_it tests) uses an immediate json.loads so it seemed logical to handle that within the method.

Reverted some of the commits to avoid breaking changes. Operation parameter for is_operation_supported method has been made mandatory.


text:
allow format-date() to suppress warnings

I have a few translations that try a few different date-format strings to try to get an output, however these generate warnings despite the translation being coded to deal and expect the failure.
Can i have a parameter to suppress the warnings please

currently I'm doing something along the lines of this and getting an warning for the first format-date() call
<xsl:variable name="attempt1" select="stroom:format-date($date,'DD-MM-YYYY')"/>
 <xsl:choose>
   <xsl:when test="string-length($attempt1) gt 0">
      <xsl:value-of select="$attempt1"/>
    </xsl:when>
   <xsl:otherwise>
      <xsl:value-of select="stroom:format-date($date,'YYYY-MM-DD')/>
  </xsl:otherwise>
<xsl:choose>

repo: gchq/stroom


text:
ValueError: No edges and no nodes

Hi @jsilter,
while running inference.py for pdbbind dataset on 363 complexes mentioned in testset_csv.csv sometimes throwing the below error
48it [49:44, 25.37s/it]--- Logging error ---
Traceback (most recent call last):
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/inference.py", line 261, in main
data_list, confidence = sampling(data_list=data_list, model=model,
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/utils/sampling.py", line 115, in sampling
tr_score, rot_score, tor_score = model(mod_complex_graph_batch)[:3]
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in call_impl
return forward_call(*args, **kwargs)
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/models/cg_model.py", line 318, in forward
rec_edge_index, rec_edge_attr, rec_edge_sh, rec_edge_weight = self.embedding(data)
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/models/cg_model.py", line 290, in embedding
rec_node_attr = self.rec_emb_layers[l](rec_node_attr, data['receptor', 'receptor'].edge_index, edge_attr, rec_edge_sh, edge_weight=rec_edge_weight)
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/models/tensor_layers.py", line 311, in forward
raise ValueError("No edges and no nodes")
ValueError: No edges and no nodes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 1083, in emit
msg = self.format(record)
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 927, in format
return fmt.format(record)
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 663, in format
record.message = record.getMessage()
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/logging/init.py", line 367, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/data/sudarsh2/miniconda3/envs/diff_L_new_rec/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/inference.py", line 319, in
main(_args)
File "/home/hgx/omics/srilekhx/DiffDock-1.1.2/inference.py", line 303, in main
logger.warning("Failed on", orig_complex_graph["name"], e)
Message: 'Failed on'
Arguments: (['6ott'], ValueError('No edges and no nodes'))
Please let me know what might be the issue for getting that error on inference.py on pdbbind dataset

I am getting the same error...any suggestions?

I think it comes from errors a cropping function
https://github.com/gcorso/DiffDock/blob/6d065cd78c11a610a0f3eba30f836a7e3a04358f/utils/sampling.py#L108

Got the same error on the HF space (https://huggingface.co/spaces/reginabarzilaygroup/DiffDock-Web)

ValueError: No edges and no nodes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 1083, in emit
    msg = self.format(record)
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 927, in format
    return fmt.format(record)
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 663, in format
    record.message = record.getMessage()
  File "/home/appuser/micromamba/envs/diffdock/lib/python3.9/logging/__init__.py", line 367, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/home/appuser/DiffDock/inference.py", line 318, in <module>
    main(_args)
  File "/home/appuser/DiffDock/inference.py", line 302, in main
    logger.warning("Failed on", orig_complex_graph["name"], e)
Message: 'Failed on'
Arguments: (['complex_0'], ValueError('No edges and no nodes'))

repo: gcorso/DiffDock


text:
Train/Val/Test split

Is there any standard for the train/val/test split for abstract summarization?

Hi, not as far as I know, but the website hosting the original raw data would have more detailed information regarding that.

this link may help you: http://groups.inf.ed.ac.uk/ami/corpus/datasets.shtml

this link may help you: http://groups.inf.ed.ac.uk/ami/corpus/datasets.shtml

authors: Dod-o gcunhase swethmandava

repo: gcunhase/AMICorpusXML


text:
Notification Server URL Help

Hello, first of all thanks for you hard work. I use Octopod in my iPhone to check the printer while I’m not home. Today I updated your app and installed the plugin in octoprint that is running in my RaspberryPI connected to my printer. I tried the Send test notification but still have in the Notification Server URL: http://octopodprint.com/ what I assume that is wrong and it didn’t work although it says sent successful. My question is what should go in there? http://localhost ?
Thanks again.

I also have the same problem.
Installed the plugin and after I connected to my OctoPi via app I could send a notification, but I didn't get one.
Put in http://localhost and this crashed my OctoPrint-Instance when I tried to send the test notification.

Same issue ....

I just tested it again and once it worked.
I now have enabled debug logging and get this in the octoprint.log:

2019-05-28 19:44:09,970 - octoprint.plugins.octopod - DEBUG - Snapshot URL: http://localhost:8080/?action=snapshot
2019-05-28 19:44:11,673 - octoprint.plugins.octopod - DEBUG - Print Job Notification Response code: 204
2019-05-28 19:44:13,126 - octoprint.plugins.octopod - DEBUG - CheckTemps(): {'chamber': {'actual': None, 'target': None, 'offset': 0}, 'bed': {'actual': None, 'target': None, 'offset': 0}, 'tool0': {'actual': 0.0, 'target': None, 'offset': 0}}

working now with default values. I'm going to assume it was a server issue that's been resolved

Not working on my end here.
At least not, when I have the app closed completely (not in task list of iOS visible).
If I close the app down (what I do most of the time) I get no notification at all (tried it with the bed heating notification).
When I have the app open, but in the background (in task list of iOS visible) I get the notification

Same here, octopod must be running in background to have notifications, not working when it's closed.

Hey guys,
Thanks for using the brand new plugin and providing this useful feedback. Until I get to the bottom of this, make sure to leave the app running in the background. It seems like silent notifications (which is what we use) are treated differently by the iOS when the app is not running. I tested many things but not having the app closed. :(
Until this gets resolved, please let me know how it goes by leaving the app in the background.
Leave the server url as "http://octopodprint.com/". That is the correct address. What you might want to change is the URL to the camera snapshot. The default should work with OctoPi out of the box.

Looking at APNS Silent Push Notifications documentation we can see that if the user forced-quit (i.e. killed) the app then silent notifications are not sent since the app is not running. This is how Apple let users control unwanted notifications by letting them kill the app.
IOW, not much we can do unless we do not use silent notifications which is a bigger change since translations will need to be stored in the plugin and not in the iOS app. Same for printer name that user gave in the iOS app.
TLDR; :(

My vote is for 'regular' notifications as well, as it would have interesting side effects.
https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html shows a way to localize notification payloads by keeping the translations in the app bundle and storing the language with the server, so that the notification payload contains the language to use as a lookup key.
However, in my humble opinion it may actually make sense to keep everything on the server (by "server" I mean "the server that currently handle notifications for users").
Look at it this way: when it comes to notifications, the master is really the OctoPrint plugin; OctoPod on iOS is really just a receiver. Indeed, when a notification is sent from the server, OctoPod just displays it and doesn't really do anything else.
Right now if you were to add more notification hooks to the plugin ("notify the user when the printer reaches a certain percentage" or "notify the user every X hours" or anything else), you would have to also modify OctoPod and rebuild it just so it can handle the new message; end users would have to wait until a new release is approved by Apple.
By decoupling the server from the iOS app, so that OctoPod can just show whatever the server sends, would allow new notification hooks to be added asynchronously. All it has to do is really just show the notification, and the language issue can be handled by simply saving the language itself together with the token (maybe on each app load in case the user changes it); then the server can locally look up the appropriate language for the string being requested by OctoPrint for that specific event, and put it right into the APNS envelope from the get-go.
Bonus side effects: works with the app closed (iOS may kill it, etc.) and doesn't require any work at all on iOS when it comes (except generating an alert to show it in case it comes when the app is open).
Just my two cents, and of course I may be missing something huge here as I haven't written code for iOS since iOS 4. :)

Major work is almost done! I will soon release new beta version of OctoPod that will require the new version of this plugin. You will get visual alerts even if you killed the app. On top of that, I added new alerts for any firmware error (e.g. probing failed, runout temp error, min temp error, max temp error, etc).

Sweet! Thanks Gaston! :)

New version is now out and includes a fix for what was raised in this ticket. Thanks for bringing this up.
Closing ticket now.

authors: Guilouz Morcegolas gdombiak jollino pjratl taker218

repo: gdombiak/OctoPrint-OctoPod


text:
QuicksortAlgo.cpp

Related Issue
I have made PR on Quick sort Algorithm
Closes: #[issue number that will be closed through this PR]
Give a clear description what modifications you have made
Type of change
What sort of change have you made:

[ ] Bug fix (non-breaking change which fixes an issue)
[x ] New feature (non-breaking change which adds functionality)
[ ] Code style update (formatting, local variables)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Checklist:

[ ] My code follows the guidelines of this project.
[ ] I have performed a self-review of my own code.
[ ] I have commented my code, particularly whereever it was hard to understand.
[ ] I have made corresponding changes to the documentation.
[ ] My changes generate no new warnings.

Screenshots(optional)

Original
Updated

original screenshot
updated screenshot

@Dinesh0602 Hey can you please first create an issue and then create pr
You need to add file in such way that

sorting folder

Quicksort folder(create it)

I'm just closing this Pr now you can create new pr with required changes

Sir please remove  those labels. Due to those labels   I am not able to get a Hacktoberfest T-shirt

repo: gdsc-gvp/DSA


text:
Add routes to gdsfactory klayout macro

We can now use gdsfactory's routing functions in KLayout. We can define routes as PCell parameters, and specify the routing function. The routing is done instantaneously.
Some things to fix:

There has to be a way of updating both the component's routing information (the 'routes' pcell parameter) when a route is specified in one of the components. Specifying the route as port1->component_2@port2 suffices to make the routing, but it does not update the opposite port2->component1@port1 in component2.
We need a nicer way of keeping track of all the routes and instances in the layout. A possible way is to write the placements, instances, and routes to a .pic.yml file somehwere and read off that.

I am marking this PR as draft until I find a solution for these. I am open to any suggestions @joamatab

Hi Skandan,
Troy is working on a schematic driven layout, which makes sense for a GUI-like flow that you are describing
For keeping track of the routes we could use a pic.yml as you suggest that could be kept in sync with the layout or we can add the routes info in the GDS metadata
this looks really cool, at the moment we always go from code to layout, which is my preferred way of working, what you are trying to do is go the other way around, which may not scale well for big complex layouts
https://user-images.githubusercontent.com/4514346/204411009-cb97e020-3640-4ecc-bb68-71c6d6d5c231.mp4
@tvt173
@thomasdorch
@flaport

Hello @joamatab,
Thanks for attaching the demo, when I tried to attach it, it just said the file size is too big.
I agree we canadd it to the gds metadata, I will look into how I can do that. Currently, we need to keep track of where the instances and routes are, so that we can pull the ports info. But I think another way to do it would be to have an option where the user can click and drag between two ports and then hit a button on the toolbar/keyboard shortcut to let gdsfactory route it. We can also make the routes as pcells with the route_function and cross section as parameters
I agree, this might not scale well for large layouts where many routes need to be made, but as it stands now, there is no way to connect any of the components together in the PCell library - we can import them and then have to manually add the straight and bend components and make sure they are connected properly one by one. This will be more tedious than typing in the routes.

@sebastian-goeldi
how do we add info into the GDS metadata?
i think in gdstk you can use Cell.set_property which in gdsfactory would be Component._cell.set_property
https://heitzmann.github.io/gdstk/library/gdstk.Cell.html#gdstk.Cell.set_property

@joamatab correct. Be careful, gdsii only supports integers as keys, oasis supports strings, too. So, what I did is write it as key/value pair into the value. Not ideal but possible. Also, keep in mind, there is a limit ln the keys and values (2 bytes for the keys, 126 characters for value)

authors: SkandanC joamatab sebastian-goeldi

repo: gdsfactory/gdsfactory


text:
error: adb not found

Hi,
I tried to run audiosource with ./audiosource run after activating dev options and debugging on my Android phone and installing the app. However I receive the following error error: adb not found. However, my device can be found in Android Studio when using PTP. What can I do to get it running?
Thanks for this app!

Hi!
You need to have adb in your $PATH (and also pactl with comes with pulseaudio or pipewire-pulse and python). You can either install the platform tools with your package manager, or add Android/sdk/platform-tools to your $PATH like so: export PATH="$PATH:/home/user/Android/sdk/platform-tools" (you may need to adjust the location of the SDK).
Best regards,

Thank you. That helped. Now I get another error which is unrelated to the previous one:
[+] Loading PulseAudio module
27
[+] Waiting for device
* daemon not running; starting now at tcp:5037
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 16574
--- adb starting (pid 16574) ---
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Android Debug Bridge version 1.0.41
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Version 35.0.1-11580240
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Installed as /home/{REDACTED_USER_NAME}/Android/Sdk/platform-tools/adb
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Running on Linux 6.8.0-40-generic (x86_64)
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63
09-07 23:12:07.575 16574 16574 I adb     : auth.cpp:416 adb_auth_init...
09-07 23:12:07.575 16574 16574 I adb     : auth.cpp:152 loaded new key from '/home/{REDACTED_USER_NAME}/.android/adbkey' with fingerprint {REDACTED_FINGERPRINT}
09-07 23:12:07.575 16574 16574 I adb     : auth.cpp:391 adb_auth_inotify_init...
09-07 23:12:08.575 16574 16574 E adb     : usb_libusb.cpp:571 failed to open device: Access denied (insufficient permissions)
09-07 23:12:08.575 16574 16574 I adb     : transport.cpp:1150 1C171FDF600FCW: connection terminated: failed to open device: Access denied (insufficient permissions)

It complains about insufficient permissions although I granted microphone and sensors permission to the app. Could this be a GrapheneOS specific issue? Thanks.

I figured out that I need to set the USB connection to PTP. Afterwards it was working fine. So as a follow-up question: it's apparently not possible to use the phone as webcam (via USB connection Webcam) and microphone at the same time, correct? When I had my phone via USB connection Webcam I got this output.
[+] Loading PulseAudio module
27
[+] Waiting for device
error: protocol fault (couldn't read status): Success

Would there be any way to make this work? Thanks.

It's apparently not possible to use the phone as webcam (via USB connection Webcam) and microphone at the same time, correct?

Yes, the device really appears as a regular USB webcam, so ADB (on which Audio Source relies) is not accessible.

Would there be any way to make this work?

You can try scrcpy. It seems it can forward the camera feed into a v4l2loopback device, which will appear as a regular webcam.

authors: CodeShakingSheep gdzx

repo: gdzx/audiosource


text:
To Bootstrap, or not Bootstrap?

In issue #2, you @masbicudo proposed a project structure that contemplates both Bootstrap and not Bootstrap components. I totally agree, given that we have the exact same components with the exact same API for both
The problem right now is that we don't have enough time. I'd rather have a rich set of components for Bootstrap  (or not) then supporting both and have them half-baked.
Then I propose start off having Bootstrap only components. Here's why:
Bootstrap con:
Bootstrap isn't that flexible. However, from my personal experience, I had a bad experience with bootstrap when I wanted to create websites with a visual identity. If I was to create a Facebook like website, I wouldn't go with bootstrap, because it would require a ridiculous ammount of CSS overrides to make it unique. But Bootstrap is very suitable for line-of-business apps because they don't need to be that unique and it offers good support for forms.
Bootstrap pro:
If we didn't go with Bootstrap, we'd have to implement our own presentation framework. I mean, we'd have to implement common CSS to make sure all the components share a concise look and feel. It's not just about styling each component. I's also about making sure they look consistent. And with Bootstrap we'd have that for free.
So, what do you think about going with Bootstrap for now and then trying to make BS independent component, if we feel the need?

One other HUGE advantage of bootstrap: it already has got tons of themes.

Right.. Then we agree to start on Bootstrap and then do whatever feels right.

We can start with bootstrap, but that means only using their CSS, not the JS part.
All components must be reactjs, using our gearz guidelines for components development.

I'm good with using only CSS..

authors: andrerpena masbicudo

repo: gearz-lab/react-components


text:
Fix/793

Added URLs and brief descriptions for khmer-relevant documentation in doc/introduction.txt, pointing to http://khmer-protocols.readthedocs.org and khmer-recipes.readthedocs.org, with brief descriptions of their content; hopefully, fixes issue #793.

Can one of the admins verify this patch?

Can one of the admins verify this patch?

[X] Is it mergeable?
[ ] Did it pass the tests?
[ ] If it introduces new functionality in scripts/ is it tested?
Check for code coverage with make clean diff-cover
[ ] Is it well formatted? Look at make pep8, make diff_pylint_report,
make cppcheck, and make doc output. Use make format and manual
fixing as needed.
[ ] Did it change the command-line interface? Only additions are allowed
without a major version increment. Changing file formats also requires a
major version number increment.
[X] Is it documented in the ChangeLog?
http://en.wikipedia.org/wiki/Changelog#Format
[ ] Was a spellchecker run on the source code and documentation after
changes were made?

(I only added the ChangeLog entry after the initial push, since I was following documentation rather naively; in the future I should know better!)

Thanks, looks good. One thing to avoid in the future is reformatting lines unnecessarily - most of your
changes were to spacing/end of line in otherwise untouched text, which present as differences on github. I'm going to run the tests pro-forma but since you didn't touch any code I expect them to pass :)

ok to test

(I also ran a spellchecker. All looks good.)

On Mar 14, 2015, at 8:50 AM, C. Titus Brown notifications@github.com wrote:

Thanks, looks good. One thing to avoid in the future is reformatting lines unnecessarily - most of your
changes were to spacing/end of line in otherwise untouched text, which present as differences on github.

Aha.  OK, from now on I'll watch for that...

git is clearly going to take me more time to work with before it becomes second nature, but at least now I've gotten a *taste* of the Brown lab github workflow.  ;)

--Erich

authors: SchwarzEM ctb ged-jenkins

repo: ged-lab/khmer


text:
Map object is not displaying

An ipyleaflet issue (https://github.com/jupyter-widgets/ipyleaflet/issues/1192) is preventing the geemap map interface from being displayed.
Until the ipyleaflet issue is resolved, a workaround is to downgrade ipyleaflet to version 0.18.2.
Run the following command in your Colab notebooks:
!pip install ipyleaflet==0.18.2
…or use your preferred package management tool to update affected Python environments.
Also, a version of geemap that pins a working version of ipyleaflet will be released shortly and then available in Colab a couple days later.

Colab now has ipyleaflet v0.18.2. We can close this issue now. Will revisit this when ipyleaflet fixes the issue.

authors: giswqs jdbcode

repo: gee-community/geemap


text:
config.txt different directory on distro

Hello
I am using this image Debian 10 raspberry
# uname -a
Linux rpi4-20210210 5.10.0-0.bpo.5-arm64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) aarch64 GNU/Linux

# sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

I am getting this directory  /boot/firmware/config.txt instead the default /boot/config.txt
The file contains:
# Switch the CPU from ARMv7 into ARMv8 (aarch64) mode
arm_64bit=1

enable_uart=1
upstream_kernel=1

### UPSPro Config Added manually ###
dtoverlay=i2c-rtc,ds1307
dtparam=i2c_arm=on
##################

kernel=vmlinuz-5.10.0-0.bpo.5-arm64
# For details on the initramfs directive, see
# https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=10532
initramfs initrd.img-5.10.0-0.bpo.5-arm64

I cannot getting info from UPS  .
Executing the script, getting  this :|
$ sudo python3 bin/upsPlus_iot.py
[sudo] password for ha:
Traceback (most recent call last):
  File "bin/upsPlus_iot.py", line 16, in <module>
    ina = INA219(0.00725,address=0x40)
  File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 116, in __init__
    self._i2c = I2C.get_i2c_device(address=address, busnum=busnum)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.

have tried create a link with ln -s /boot/firmware/config.txt /boot/config.txt , but not work.
Maybe a ARM64 imcompatibility ?
PS: The RPI leds are off (both green/red)

yes, you are using 64bit OS, it is a bit different from 32bit OS, and if you can enable I2C on this OS ? because the daughter board is communicate with raspberry pi via I2C protocol via USB-C port , you need to enbale dwc2 function so that it can communicate with each other, and for 32bit, just adding dtoverlay=dwc2,dr_mode=host to /boot/config.txt file and reboot raspberry pi is ok. I am not sure about if 64bit OS also support that dtb file as well.

I am getting this output
teste@rpi4-20210718:~$ python3 bin/upsPlus_iot.py
Traceback (most recent call last):
  File "bin/upsPlus_iot.py", line 18, in <module>
    ina_supply = INA219(0.00725,address=0x40)
  File "/home/teste/.local/lib/python3.7/site-packages/ina219.py", line 116, in __init__
    self._i2c = I2C.get_i2c_device(address=address, busnum=busnum)
  File "/home/teste/.local/lib/python3.7/site-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
  File "/home/teste/.local/lib/python3.7/site-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.
teste@rpi4-20210718:~$ i2cdetect -y 1
-bash: i2cdetect: command not found
teste@rpi4-20210718:~$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77

Well a little search and find this !!
teste@rpi4-20210718:~$ sudo i2cdetect -y 0
[sudo] password for teste:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
teste@rpi4-20210718:~$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
teste@rpi4-20210718:~$ sudo i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
teste@rpi4-20210718:~$ sudo i2cdetect -y 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

seems the ic2-3 and not 1

I can get information using @frtz13 script (setProtectionVoltage.py) Will get info and set with success.
/UPSPlus_mqtt# python3 setProtectionVoltage.py 3000
------------------------------------------------------------
Modify battery protection voltage in UPS Plus
------------------------------------------------------------
Current value:  3600 mV
Successfully set the protection voltage to: 3000 mV

Using your scripts... no .. :|  getting this errors
# python3 Full-featured-demo-code.py
Traceback (most recent call last):
  File "Full-featured-demo-code.py", line 20, in <module>
    ina_supply = INA219(0.00725, address=0x40)
  File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 116, in __init__
    self._i2c = I2C.get_i2c_device(address=address, busnum=busnum)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.

Solution: https://github.com/frtz13/UPSPlus_mqtt/issues/14#issuecomment-888541414
Maybe need do update on your code ?!

authors: hellresistor yoyojacky

repo: geeekpi/upsplus


text:
humaneval

请问可以提供测试humaneval的相关方法吗，现在想要进行测试但是完全不知道该如何下手，generate_repo返回的是一个Projectrepo类型不能被转换成jsonl，希望作者能加上去，谢谢。

ProjectRepo对应的是一个文件夹路径。如果要转JSON，本质上是将一个文件夹转JSON。
你希望转成什么样的JSON？

我希望转成一个可以让humaneval评估的jsonl文件，目前我是自己写python脚本把文件夹里面的代码写入jsonl，但可能是由于我的代码问题这样得到的jsonl获得的准确率只有0.27。

由于版本迭代新增功能且迭代较快，engineer 中增加了不少 repo 级别的处理和设计。针对 HumanEval，我建议你先熟悉并使用 v0.4-release 或者之前的版本。在这个版本中，你可以获取 engineer 的执行结果（msg = Message(content=code, role=self.profile, cause_by=WriteCode)）。你可以选择在 msg 生成之前直接将code保存到JSONL文件，或者在 engineer 执行结束后，通过 memory 的 get_by_actions 函数来获取代码，再将其写入 JSONL 文件。:)

There will be some scripts related to humaneval in version 1.0

请问现在有可以测试humaneval的script了吗？

authors: codeAlwaysPass geekan iorisa stellaHSR wkwk-ai

repo: geekan/MetaGPT


text:
update method of terminate

Features
update method of terminate

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.63%. Comparing base (4ef53a2) to head (60fd49e).
Report is 7 commits behind head on code_interpreter.

:exclamation: Current head 60fd49e differs from pull request most recent head 88cea94. Consider uploading reports for the commit 88cea94 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@                 Coverage Diff                  @@
##           code_interpreter    #1002      +/-   ##
====================================================
+ Coverage             81.61%   81.63%   +0.01%
====================================================
  Files                   223      223
  Lines                 13127    13136       +9
====================================================
+ Hits                  10714    10723       +9
  Misses                 2413     2413

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

authors: codecov-commenter mannaandpoem


text:
add SequentialSearch

Implementation Sequential Search Algorithm using Python Language

Hey @onowdev, Sequential search is the same as Linear Search. It has already been implemented but we have many more issues. Please refer to the  issues  section and find something you can contribute to. Thankyou :)

Hello @geekquad  ,Thank you for the correction and I will correct my contribution, sorry for my ignorance

authors: geekquad onowdev

repo: geekquad/AlgoBook


text:
🛑 blist is down

In e9e9cb2, blist (https://Blistingsnip.geeks121.repl.co) was down:

HTTP code: 0
Response time: 0 ms

Resolved: blist is back up in 03d7d33.


text:
动手写分布式缓存 - GeeCache第五天 分布式节点 | 极客兔兔

https://geektutu.com/post/geecache-day5.html
7天用 Go语言/golang 从零实现分布式缓存 GeeCache 教程(7 days implement golang distributed cache from scratch tutorial)，动手写分布式缓存，参照 groupcache 的实现。本文介绍了为 GeeCache 添加了注册节点与选择节点的功能，并实现了 HTTP 客户端，与远程节点的服务端通信。

感谢博主，一系列的博文看完后，感觉自己的知识架构更加清楚了。
想请教一下博主，resp是否需要先判空后再defer resp.Body.Close()?如果不判空的话，会留下隐患

main.go 58 行。addrs := make([]string, 3) 应该是 addrs := make([]string, 0) 吧，如果一开始长度是 3 ，后边再 append 会得到前边是三个空字符串的切片。

@ylwang1122 如果 err != nil，前面已经返回了，不会到 defer 语句，我看了下 http.Get 的实现，如果 err == nil，resp 是不会为空的。

@PegasusWang，感谢纠错，已经更正。因为后面用了 append，而不是按索引赋值，所以可以不用初始化，改成了：
var addrs []string

感谢博主的文章，是不是还没有实现节点异常的处理。

@Kingpie 仿照的 groupcache 的实现，假定节点是可用的，不包含异常的处理。
geecache 对一致性没有要求，所以也没有必要。需要异常处理的一般是实现 CAP 理论中的 CP，比如分布式数据库，消息系统等。有节点宕机时，需要重新选举 master 以保证一致性。后续会考虑此类系统的实现。

首先感谢博主的文章
这里有个小小的问题想问一下博主,如果需要部署分布式节点,即创造分布式节点的客户端,这其中的流程大概是怎么样的呀

感谢博主的文章,
这里有一个疑惑想问一下博主,如果要将GeeCache进行横向扩展的话,应该如何部署,可不可以将peer部署到其他机器上

@catwithtudou 把 IP 和端口换成部署机器的 IP 和端口就可以了。只是测试用例中，在本机启动了三个实例，基于网络通信，部署在哪里都可以。

是不是漏掉了从远程节点拿到缓存后更新本地缓存这一步？

是不是漏掉了从远程节点拿到缓存后更新本地缓存这一步？

groupcache 中缓存值只淘汰不更新，也没有超时淘汰机制，这样取舍简化了设计。

@geektutu

是不是漏掉了从远程节点拿到缓存后更新本地缓存这一步？

groupcache 中缓存值只淘汰不更新，也没有超时淘汰机制，这样取舍简化了设计。

我的意思是当请求当前缓存服务器时 此服务器本地没有缓存 接着由当前服务器去请求其他节点服务器 当拿回来缓存值后 不应该更新此服务器的本地缓存吗 ？

@walkmiao 分布式缓存的目的是不同key缓存在不同的节点上，增加总的吞吐量。如果大家转发请求后，都再备份一次，每台机器上都缓存了相同的数据，就失去意义了。每个节点缓存1G数据，理论上10个节点总共可以缓存10G不同的数据。
当然对于热点数据，每个节点拿到值后，本机备份一次是有价值的，增加热点数据的吞吐量。groupcache 的原生实现中，有1/10的概率会在本机存一次。这样10个节点，理论上可以缓存9G不同的数据，算是一种取舍。

@geektutu
@walkmiao 分布式缓存的目的是不同key缓存在不同的节点上，增加总的吞吐量。如果大家转发请求后，都再备份一次，每台机器上都缓存了相同的数据，就失去意义了。每个节点缓存1G数据，理论上10个节点总共可以缓存10G不同的数据。
当然对于热点数据，每个节点拿到值后，本机备份一次是有价值的，增加热点数据的吞吐量。groupcache 的原生实现中，有1/10的概率会在本机存一次。这样10个节点，理论上可以缓存9G不同的数据，算是一种取舍。

学到很多 谢谢

var _ PeerPicker = (*HTTPPool)(nil)
var _ PeerGetter = (*httpGetter)(nil)
请问这两个操作有什么意义呢, 不是很明白

@mjyuser
var _ PeerPicker = (*HTTPPool)(nil)
var _ PeerGetter = (*httpGetter)(nil)
请问这两个操作有什么意义呢, 不是很明白

确保这个类型实现了这个接口 如果没有实现会报错的

请教博主：
如何才能缓存多个group？
是通过go 开辟新goroutine吗？或者是给多个group注册相同的peers?

如何才能缓存多个group？

都可以，group 和 HTTPPool 是解耦的，可以复用，也可以各自搭配各自的。

有个疑问，如果用了consistent hashing，这样所有的request都会去有指定key的机器上。为什么还需要forward request到其他机器上去呢？

博主你好，请问回调函数中获取数据的数据源，是不是可以不一定来自节点本地数据库。

请教一下：
之前在RegisterPeers中如果已经有注册的peers，则不能注册，在main函数中，如果设置了三个端口号那不是在同一个group上注册了三个不同端口的HTTPPool吗？这里是怎么实现的呀？

请教一下, 整片文章看了一遍之后, 我还是有点不明白. 用户只知晓API:9999.那么API与分布式缓存是一个1对3的关系.  那么当用户查询的时候,首先查询的get是三个缓存中的哪一个呢? 还是说API本身是一个group 本地有, 没有再去三个缓存中找呢? 这个模型实在是没搞清晰 希望指点

请教一下, 整片文章看了一遍之后, 我还是有点不明白. 用户只知晓API:9999.那么API与分布式缓存是一个1对3的关系. 那么当用户查询的时候,首先查询的get是三个缓存中的哪一个呢? 还是说API本身是一个group 本地有, 没有再去三个缓存中找呢? 这个模型实在是没搞清晰 希望指点

API用consistent hasher 去算出应该去哪个port，每个port都被放到了hash环上。

第一步就抽象出接口，感觉不是很好理解。根据这篇文章https://blog.chewxy.com/2018/03/18/golang-interfaces/，是否可以考虑延迟定义接口。即首先定义类型/struct，在会使用到接口的时候再定义接口。

成功被大佬精湛的技术绕晕了

@Willendless  一般抽象出接口是为了扩展性，很多场景下需要优先抽象接口。比如 RPC 通信需要支持不同的编解码方式，那首先想到的是一个支持编解码的结构体需要支持哪些方法，即接口。GeeRPC第一天 服务端与消息编码 在这篇文章中体现了这种思考方式。
我觉得你说的也是有道理的，如果是比较确定的业务，优先 struct，需要扩展时再抽象接口更符合直觉一些。不过对于实现框架的童鞋来说，可扩展性是第一位的，所以一般都会优先设计接口。比如 go-micro 这个微服务框架，所有的参数都是接口类型的，这个框架是完全可插拔的，允许用户替换任意的类，只要 struct 实现了接口类型就行。

@wilgx0
成功被大佬精湛的技术绕晕了

group代表一类资源,一个group结构体代表的是一个节点,存储了一部分缓存数据,具体一个值是到哪个具体节点读取则是由算法决定的（这里是一致性哈希算法，一致性哈希算法可以理解为把地址空间化成一个圈，键值的Key先遇到谁就是谁，具体的看代码实现）。group中注册了一个peers数组，相当于是其他节点的电话簿，是用作在缓存miss的时候向其他节点请求数据用。而这个peer其实就是先前定义的httppool,定义了节点所在的Ip、端口。
以上个人理解，有错误请帮忙指出。

我觉得难理解的地方是从 getFromPeer开始获取bytes，
过程中调用的(h *httpGetter) Get(group string, key string) ([]byte, error)方法
其中res, err := http.Get(u) 是直接到了ServeHTTP。
这个流程中又走了一遍 (g *Group) load(key string) (value ByteView, err error)
这里有点绕。我是加了好多好多trace才看明白的。
感觉作者有必要整体梳理一下流程

@limaoxiaoer 感谢你的建议，这部分相比 groupcache 的原生实现还是简化了很多了。确实是需要一定的基础，不然看上去会比较费力。比如 http.Get(u) 直接到了 ServeHTTP，这一块如果没有用 Go 实现过网站，就挺不好理解的。ServeHTTP 是 net/http 的接口，实现了这个接口，请求就会被路由到实现函数来。
另外，geecache 既作为存储的实例，提供 http 接口，又可以作为 API 层，供应用程序直接调用，这两个功能的切换也可能会比较绕。
这个系列最大程度还原 groupcache 的实现，而且做了大量的简化，不过博客的解释可能确实不够清晰，见谅。

有个疑问，一致性哈希这章里使用
idx := sort.Search(len(m.keys), func(i int) bool {
return m.keys[i] >= hash
})
这样的寻找方式，不会导致任何查询（不管是不是同一个key）永远都停在8001这第一台主机吗

我怎么感觉这个代码有点问题，因为节点之间可能会循环请求对方的缓存

@wanboyan
我怎么感觉这个代码有点问题，因为节点之间可能会循环请求对方的缓存

每个节点的hash算法都是一致的，对于一个key，所有节点算出来的远程节点都是同一个。所以应该不存在循环请求的问题

说一个我遇到的坑😭😭，在访问localhost:8001这个url的时候，我本地一直会报 curl: (52) Empty reply from server。改成127.0.0.1:8001就没问题或者干脆别用这个端口就没有这个问题。有碰到这个问题的同学可以试下

说一个我遇到的坑😭😭，在访问localhost:8001这个url的时候，我本地一直会报 curl: (52) Empty reply from server。改成127.0.0.1:8001就没问题或者干脆别用这个端口就没有这个问题。有碰到这个问题的同学可以试下

@jeffmingup 感谢反馈，可能和 hosts 的设置有关系。

@jeffmingup 感谢反馈，可能和 hosts 的设置有关系。

@geektutu
@Kingpie 仿照的 groupcache 的实现，假定节点是可用的，不包含异常的处理。
geecache 对一致性没有要求，所以也没有必要。需要异常处理的一般是实现 CAP 理论中的 CP，比如分布式数据库，消息系统等。有节点宕机时，需要重新选举 master 以保证一致性。后续会考虑此类系统的实现。

应该是不支持动态的横向扩展，现在需要把一致性hash中的物理节点提前写在配置中，或者map中

@geektutu
@Kingpie 仿照的 groupcache 的实现，假定节点是可用的，不包含异常的处理。
geecache 对一致性没有要求，所以也没有必要。需要异常处理的一般是实现 CAP 理论中的 CP，比如分布式数据库，消息系统等。有节点宕机时，需要重新选举 master 以保证一致性。后续会考虑此类系统的实现。

应该是不支持动态的横向扩展，现在需要把一致性hash中的物理节点提前写在配置中，或者map中

我觉得TUTU，你这个main.go文件写的过于复杂了，不便于理解基础业务逻辑，

// Overall flow char										     requsets					        local
// gee := createGroup() --------> /api Service : 9999 ------------------------------> gee.Get(key) ------> g.mainCache.Get(key)
// 						|											^					|
// 						|											|					|remote
// 						v											|					v
// 				cache Service : 800x								|			g.peers.PickPeer(key)
// 						|create hash ring & init peerGetter			|					|
// 						|registry peers write in g.peer				|					|p.httpGetters[p.hashRing(key)]
// 						v											|					|
//			httpPool.Set(otherAddrs...)								|					v
// 		g.peers = gee.RegisterPeers(httpPool)						|			g.getFromPeer(peerGetter, key)
// 						|											|					|
// 						|											|					|
// 						v											|					v
// 		http.ListenAndServe("localhost:800x", httpPool)<------------+--------------peerGetter.Get(key)
// 						|											|
// 						|requsets									|
// 						v											|
// 					p.ServeHttp(w, r)								|
// 						|											|
// 						|url.parse()								|
// 						|--------------------------------------------

// Overall flow char										     requsets					        local
// gee := createGroup() --------> /api Service : 9999 ------------------------------> gee.Get(key) ------> g.mainCache.Get(key)
// 						|											^					|
// 						|											|					|remote
// 						v											|					v
// 				cache Service : 800x								|			g.peers.PickPeer(key)
// 						|create hash ring & init peerGetter			|					|
// 						|registry peers write in g.peer				|					|p.httpGetters[p.hashRing(key)]
// 						v											|					|
//			httpPool.Set(otherAddrs...)								|					v
// 		g.peers = gee.RegisterPeers(httpPool)						|			g.getFromPeer(peerGetter, key)
// 						|											|					|
// 						|											|					|
// 						v											|					v
// 		http.ListenAndServe("localhost:800x", httpPool)<------------+--------------peerGetter.Get(key)
// 						|											|
// 						|requsets									|
// 						v											|
// 					p.ServeHttp(w, r)								|
// 						|											|
// 						|url.parse()								|
// 						|--------------------------------------------

有一个问题不懂，感觉apiServer提供的服务更像是负载均衡，为什么要先检查是否被缓存？先找到key对应的节点，再从那个节点从找到需要的值可以吗？

那个load就太大了
Thanks,
Cong Wang
On Apr 6, 2021, 06:14 -0700, zyy @.***>, wrote:

有一个问题不懂，感觉apiServer提供的服务更像是负载均衡，为什么要先检查是否被缓存？先找到key对应的节点，再从那个节点从找到需要的值可以吗？
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

func (p *HTTPPool) PickPeer(key string) (PeerGetter, bool) {
p.mu.Lock()
defer p.mu.Unlock()
if peer := p.peers.Get(key); peer != "" && peer != p.self {
p.Log("Pick peer %s", peer)
return p.httpGetters[peer], true
}
return nil, false
}
为什么根据查询key 获取节点要加锁呢,那这样的话是不是无法并发查询了

@fy403
// Overall flow char										     requsets					        local
// gee := createGroup() --------> /api Service : 9999 ------------------------------> gee.Get(key) ------> g.mainCache.Get(key)
// 						|											^					|
// 						|											|					|remote
// 						v											|					v
// 				cache Service : 800x								|			g.peers.PickPeer(key)
// 						|create hash ring & init peerGetter			|					|
// 						|registry peers write in g.peer				|					|p.httpGetters[p.hashRing(key)]
// 						v											|					|
//			httpPool.Set(otherAddrs...)								|					v
// 		g.peers = gee.RegisterPeers(httpPool)						|			g.getFromPeer(peerGetter, key)
// 						|											|					|
// 						|											|					|
// 						v											|					v
// 		http.ListenAndServe("localhost:800x", httpPool)<------------+--------------peerGetter.Get(key)
// 						|											|
// 						|requsets									|
// 						v											|
// 					p.ServeHttp(w, r)								|
// 						|											|
// 						|url.parse()								|
// 						|--------------------------------------------

请问这个是用啥工具画的呀

@zach030
对于一个HTTPPool的peers里加入它本身，会不会PickPeer时选择到自身，导致进入死循环，我在测试的时候一直在死循环，想请教一下

并不会，因为PickPeer方法里面有peer != p.self的判断

@njcongtou

请教一下, 整片文章看了一遍之后, 我还是有点不明白. 用户只知晓API:9999.那么API与分布式缓存是一个1对3的关系. 那么当用户查询的时候,首先查询的get是三个缓存中的哪一个呢? 还是说API本身是一个group 本地有, 没有再去三个缓存中找呢? 这个模型实在是没搞清晰 希望指点

API用consistent hasher 去算出应该去哪个port，每个port都被放到了hash环上。

并不是api用一致性hash算，而是api服务绑定了一个本地的geecache服务，这个服务miss的时候，才会去寻找其他结点

@dayou5168
我觉得TUTU，你这个main.go文件写的过于复杂了，不便于理解基础业务逻辑，这启动三个CacheServer这里，就需要三次启动才比较好理解，主要把注册peer表现完整就好多了。

是的。本来逻辑通了。 到main.go 开始又混乱了

小白请教一下，在调试的时候，我用协程分别起了三次startCacheServer,然而在debug的时候，发现无法debug HTTPPool.ServeHTTP（）函数。我加了log发现这个函数一直在开启新的协程而不返回。请教下为啥不能用协程的方式启动三个startCacheServer呢？代码如下：
for k,_:=range addrMap{
register:=k==8003
go startCacheServer(addrMap[k],addrs,gee,register)
}
startAPIServer(apiAddr,gee)

获取缓存数据的流程是：从本地缓存查找->从远程节点查找->回调函数，写到本地。如果是这样的话，远程节点是不是就一直没有缓存到数据。数据要么是本地缓存直接得到，要么是本地和远程都找不到，然后回调，写到本地缓存。不知道我理解的正确吗？

@chens72
获取缓存数据的流程是：从本地缓存查找->从远程节点查找->回调函数，写到本地。如果是这样的话，远程节点是不是就一直没有缓存到数据。数据要么是本地缓存直接得到，要么是本地和远程都找不到，然后回调，写到本地缓存。不知道我理解的正确吗？

不对。
远程节点查找的时候，如果在远程节点的缓存中找不到，是调用远程节点的回调函数，存储到远程节点

@puck1006

@chens72
获取缓存数据的流程是：从本地缓存查找->从远程节点查找->回调函数，写到本地。如果是这样的话，远程节点是不是就一直没有缓存到数据。数据要么是本地缓存直接得到，要么是本地和远程都找不到，然后回调，写到本地缓存。不知道我理解的正确吗？

不对。
远程节点查找的时候，如果在远程节点的缓存中找不到，是调用远程节点的回调函数，存储到远程节点

好的，明白了。但是在测试的时候，发现一直不能访问远程节点，报错连接被拒绝。于是我尝试启动远程节点监听以后，报错http: Accept error: accept tcp [::]:9000: accept4: too many open files; retrying in 15ms。
请问这是什么原因呢？

@cuglaiyp

@fy403
// Overall flow char										     requsets					        local
// gee := createGroup() --------> /api Service : 9999 ------------------------------> gee.Get(key) ------> g.mainCache.Get(key)
// 						|											^					|
// 						|											|					|remote
// 						v											|					v
// 				cache Service : 800x								|			g.peers.PickPeer(key)
// 						|create hash ring & init peerGetter			|					|
// 						|registry peers write in g.peer				|					|p.httpGetters[p.hashRing(key)]
// 						v											|					|
//			httpPool.Set(otherAddrs...)								|					v
// 		g.peers = gee.RegisterPeers(httpPool)						|			g.getFromPeer(peerGetter, key)
// 						|											|					|
// 						|											|					|
// 						v											|					v
// 		http.ListenAndServe("localhost:800x", httpPool)<------------+--------------peerGetter.Get(key)
// 						|											|
// 						|requsets									|
// 						v											|
// 					p.ServeHttp(w, r)								|
// 						|											|
// 						|url.parse()								|
// 						|--------------------------------------------

请问这个是用啥工具画的呀

同问呀，有知道的小伙伴么？

想知道现实场景下，每个节点的IP需要手动配置吗？还是说有别的办法

兔兔，我有个问题，就是如果我想要新增一个节点怎么办呢，需要重新启动，然后利用peers.Set(addrs...)把新增后的所有节点加进来吗

兔兔，我有个问题，就是如果我想要新增一个节点怎么办呢，需要重新启动，然后利用peers.Set(addrs...)把新增后的所有节点加进来吗

对，作者他这个版本只能这样。后续可以将缓存服务注册到注册中心，通过服务发现获取所有节点IP。

@peanutzhen

兔兔，我有个问题，就是如果我想要新增一个节点怎么办呢，需要重新启动，然后利用peers.Set(addrs...)把新增后的所有节点加进来吗

对，作者他这个版本只能这样。后续可以将缓存服务注册到注册中心，通过服务发现获取所有节点IP。可以参看我实现的版本：https://github.com/peanutzhen/peanutcache

已star哈哈

@zyyingbb
有一个问题不懂，感觉apiServer提供的服务更像是负载均衡，为什么要先检查是否被缓存？先找到key对应的节点，再从那个节点从找到需要的值可以吗？

这里的apiServer和一个缓存服务绑定在一起了，所以先检查这个绑定的缓存服务器，如果key不是属于这个缓存服务器再从其他peer获取，因为这里只是向外暴露了一个api,所以兔老大实现的版本无法先找到key再直接从那个节点找需要的值

萌新想请教一下，如果8002端口给group命名为class，其他两个端口命名为scores，我如果在8003端口请求8002端口的数据，在getFromPeer方法中的peer.Get(g.name, key)将传入的group名就是scores，但是应该传入的group名应该是class吧？本来应该请求的url是/class/key，现在变成了/scores/key，是不是有点问题呢还是我的理解有点错误。。

day5-multi-nodes/geecache/geecache.go - github
if value, err = g.getFromPeer(peer, key); err == nil {
				return value, nil
			}

是否是
value, err := g.getFromPeer(peer, key); err == nil

@walkmiao

@geektutu

是不是漏掉了从远程节点拿到缓存后更新本地缓存这一步？

groupcache 中缓存值只淘汰不更新，也没有超时淘汰机制，这样取舍简化了设计。

我的意思是当请求当前缓存服务器时 此服务器本地没有缓存 接着由当前服务器去请求其他节点服务器 当拿回来缓存值后 不应该更新此服务器的本地缓存吗 ？

应该是将数据缓存到g.mainCache.add(key, value)，lru缓存就相当于查询排行榜，这样经常被查询的数据就不用去节点取了

@walkmiao

@geektutu

是不是漏掉了从远程节点拿到缓存后更新本地缓存这一步？

groupcache 中缓存值只淘汰不更新，也没有超时淘汰机制，这样取舍简化了设计。

我的意思是当请求当前缓存服务器时 此服务器本地没有缓存 接着由当前服务器去请求其他节点服务器 当拿回来缓存值后 不应该更新此服务器的本地缓存吗 ？

意思是请求分布式节点后得到的数据后放到Group下的maincache中？

萌新想请教一下，如果8002端口给group命名为class，其他两个端口命名为scores，我如果在8003端口请求8002端口的数据，在getFromPeer方法中的peer.Get(g.name, key)将传入的group名就是scores，但是应该传入的group名应该是class吧？本来应该请求的url是/class/key，现在变成了/scores/key，是不是有点问题呢还是我的理解有点错误。。

感觉是有问题，startAPIServer的gee.Get(key)中group就已经确定了，一路下来getFromPeer中peer.Get(g.name, key)，g.name没有改变过，只有改变group才会改变。和PickPeer方法中获取节点没有关系。是不是设计的时候就只能在在一个缓存命名空间，否则就要中途通过GetGroup换Goup,但分布式节点和group是什么关系呢，这里应该是group包含分布式节点。不知道理解的对不对?

peersUrl != p.self为什么不可以是自己

@liujing-siyang
peersUrl != p.self为什么不可以是自己

说了是找另一个服务器，如果是自己的话就是GetLocally()

cache/http.go:127:5: cannot use (*HTTPPool)(nil) (type *HTTPPool) as type PeerPicker in assignment:
*HTTPPool does not implement PeerPicker (missing PeerPicker method)
抄的代码，不能实现PeerPicker接口，没想懂

怎么感觉到这里，代码逻辑比较乱呢

博主，Group的getFromPeer方法返回的ByteView必须是指针，好像写错了
func (g *Group) getFromPeer(peer PeerGetter, key string) (*ByteView, error) {
	bytes, err := peer.Get(g.name, key)
	if err != nil {
		return &ByteView{}, err
	}
	return &ByteView{b: bytes}, nil
}

博主您好，我看完整个项目后在这里有一点疑问，望解答，谢谢。
在实际的分布式部署中，每个节点部署一个分布式缓存，存在节点上下线和缓存内容替换的问题，
（1）那么节点之间是不是要同步它们之间所有的key和相互知道其它所有的节点呢？我想的是如果它们不同步这两个信息，那么在不同的分布式节点上它们的一致性哈希内容不同，就不知道去哪个节点找key。（2）如果上述同步成立，在实际中它们是采用什么同步策略或工具呢？望指点，谢谢。

博主您好，我看完整个项目后在这里有一点疑问，望解答，谢谢。 在实际的分布式部署中，每个节点部署一个分布式缓存，存在节点上下线和缓存内容替换的问题， （1）那么节点之间是不是要同步它们之间所有的key和相互知道其它所有的节点呢？我想的是如果它们不同步这两个信息，那么在不同的分布式节点上它们的一致性哈希内容不同，就不知道去哪个节点找key。（2）如果上述同步成立，在实际中它们是采用什么同步策略或工具呢？望指点，谢谢。

1、只淘汰，不更新缓存值
2、https://segmentfault.com/a/1190000021199728看下图解的一致性hash做了什么

这是一封自动回复邮件。已经收到您的来信。

@iLiuqi
个人觉得，测试多节点缓存逻辑效果时，main 中 fronted api server 和 cache server 的启动应该独立分开，原用例中，启动的第三个服务用2个端口既承担了 api 又 承担了 cache，容易混乱，分开的话更便于理解。

同意。。。

是不是初始化的时候只有maincache中有数据，分布式节点上并没有？

@BetterZhuang
是不是初始化的时候只有maincache中有数据，分布式节点上并没有？

maincache中也没有吧。测试用例里面启动了三个分布式节点服务，其中一个既作为API又作为分布式节点（这个太晕了，看了好几遍）。每个节点都对应一个Group，一个Group又包含一个本地缓存maincache。初始所有节点的本地缓存maincache里面是没有数据的，每次从远程节点得到key后（可以是数据库或者其他数据源，作者是用本地map模拟的数据源），得到的key会被缓存在对应远程节点的maincache里面，下次有相同的请求key就可以直接获取。重点是搞清楚每次启动一个节点，就会新建一个对应的group，里面包含一系列东西，包括节点的本地缓存。理解有误不对欢迎指出。

@mindingyao

@BetterZhuang
是不是初始化的时候只有maincache中有数据，分布式节点上并没有？

maincache中也没有吧。测试用例里面启动了三个分布式节点服务，其中一个既作为API又作为分布式节点（这个太晕了，看了好几遍）。每个节点都对应一个Group，一个Group又包含一个本地缓存maincache。初始所有节点的本地缓存maincache里面是没有数据的，每次从远程节点得到key后（可以是数据库或者其他数据源，作者是用本地map模拟的数据源），得到的key会被缓存在对应远程节点的maincache里面，下次有相同的请求key就可以直接获取。重点是搞清楚每次启动一个节点，就会新建一个对应的group，里面包含一系列东西，包括节点的本地缓存。理解有误不对欢迎指出。

我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源。从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group），但是我认为很奇怪的是，如果group与http解耦合了的话，意味着每一类资源最终还是仅有一个group，不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件。
我认为你说的“重点是搞清楚每次启动一个节点，就会新建一个对应的group”似乎不太对啊。每次启动的节点仅仅会启动一个新的http服务。您看看我说的是否有问题？

@zhucebuliaole

@mindingyao

@BetterZhuang
是不是初始化的时候只有maincache中有数据，分布式节点上并没有？

maincache中也没有吧。测试用例里面启动了三个分布式节点服务，其中一个既作为API又作为分布式节点（这个太晕了，看了好几遍）。每个节点都对应一个Group，一个Group又包含一个本地缓存maincache。初始所有节点的本地缓存maincache里面是没有数据的，每次从远程节点得到key后（可以是数据库或者其他数据源，作者是用本地map模拟的数据源），得到的key会被缓存在对应远程节点的maincache里面，下次有相同的请求key就可以直接获取。重点是搞清楚每次启动一个节点，就会新建一个对应的group，里面包含一系列东西，包括节点的本地缓存。理解有误不对欢迎指出。

我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源。从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group），但是我认为很奇怪的是，如果group与http解耦合了的话，意味着每一类资源最终还是仅有一个group，不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件。
我认为你说的“重点是搞清楚每次启动一个节点，就会新建一个对应的group”似乎不太对啊。每次启动的节点仅仅会启动一个新的http服务。您看看我说的是否有问题？

“我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源”
你这个说法准确一点，我只是简单陈述一下我理解的重点，即启动一个节点创建一个Group。
“从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group）”
day5测试用例里面不是执行了三次共启动了三个节点吗？每次都会调用createGroup函数新建一类Group资源，里面包含一个本地缓存cache。
“不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件”
你觉得奇怪的地方确实是不合理的，共享一类资源没有意义是吧。分布式缓存的设计初衷就是根据不同key将请求分散到不同节点处理。
“每次启动的节点仅仅会启动一个新的http服务”
你再看仔细看一下启动的shell脚本呢？

@mindingyao

@zhucebuliaole

@mindingyao

@BetterZhuang
是不是初始化的时候只有maincache中有数据，分布式节点上并没有？

maincache中也没有吧。测试用例里面启动了三个分布式节点服务，其中一个既作为API又作为分布式节点（这个太晕了，看了好几遍）。每个节点都对应一个Group，一个Group又包含一个本地缓存maincache。初始所有节点的本地缓存maincache里面是没有数据的，每次从远程节点得到key后（可以是数据库或者其他数据源，作者是用本地map模拟的数据源），得到的key会被缓存在对应远程节点的maincache里面，下次有相同的请求key就可以直接获取。重点是搞清楚每次启动一个节点，就会新建一个对应的group，里面包含一系列东西，包括节点的本地缓存。理解有误不对欢迎指出。

我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源。从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group），但是我认为很奇怪的是，如果group与http解耦合了的话，意味着每一类资源最终还是仅有一个group，不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件。
我认为你说的“重点是搞清楚每次启动一个节点，就会新建一个对应的group”似乎不太对啊。每次启动的节点仅仅会启动一个新的http服务。您看看我说的是否有问题？

“我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源”
你这个说法准确一点，我只是简单陈述一下我理解的重点，即启动一个节点创建一个Group。
“从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group）”
day5测试用例里面不是执行了三次共启动了三个节点吗？每次都会调用createGroup函数新建一类Group资源，里面包含一个本地缓存cache。
“不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件”
你觉得奇怪的地方确实是不合理的，共享一类资源没有意义是吧。分布式缓存的设计初衷就是根据不同key将请求分散到不同节点处理。
“每次启动的节点仅仅会启动一个新的http服务”
你再看仔细看一下启动的shell脚本呢？

是的，我重新看了一下脚本，我之前理解的不太对，应该就是每个分布式节点都建立了同名的group然后在本地建了一个LRU缓存。我能想到的解释大概是group可以解决不同类型资源里key有冲突的情况。
BTW，新年快乐:)

var _ PeerPicker = (*HTTPPool)(nil)
var _ PeerGetter = (*httpGetter)(nil) 我想问下这两句的作用是什么？

@zhucebuliaole

@mindingyao

@zhucebuliaole

@mindingyao

@BetterZhuang
是不是初始化的时候只有maincache中有数据，分布式节点上并没有？

maincache中也没有吧。测试用例里面启动了三个分布式节点服务，其中一个既作为API又作为分布式节点（这个太晕了，看了好几遍）。每个节点都对应一个Group，一个Group又包含一个本地缓存maincache。初始所有节点的本地缓存maincache里面是没有数据的，每次从远程节点得到key后（可以是数据库或者其他数据源，作者是用本地map模拟的数据源），得到的key会被缓存在对应远程节点的maincache里面，下次有相同的请求key就可以直接获取。重点是搞清楚每次启动一个节点，就会新建一个对应的group，里面包含一系列东西，包括节点的本地缓存。理解有误不对欢迎指出。

我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源。从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group），但是我认为很奇怪的是，如果group与http解耦合了的话，意味着每一类资源最终还是仅有一个group，不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件。
我认为你说的“重点是搞清楚每次启动一个节点，就会新建一个对应的group”似乎不太对啊。每次启动的节点仅仅会启动一个新的http服务。您看看我说的是否有问题？

“我认为从day2的解释来看，并不是一个group对应一个节点，而是一个Group对应一类资源”
你这个说法准确一点，我只是简单陈述一下我理解的重点，即启动一个节点创建一个Group。
“从day5的测试用例中也可以看到，所有的节点共享了一个gee（也就是group）”
day5测试用例里面不是执行了三次共启动了三个节点吗？每次都会调用createGroup函数新建一类Group资源，里面包含一个本地缓存cache。
“不同的节点仅仅是用于负载均衡，也就是不同的key通过不同的节点访问同一个group文件”
你觉得奇怪的地方确实是不合理的，共享一类资源没有意义是吧。分布式缓存的设计初衷就是根据不同key将请求分散到不同节点处理。
“每次启动的节点仅仅会启动一个新的http服务”
你再看仔细看一下启动的shell脚本呢？

是的，我重新看了一下脚本，我之前理解的不太对，应该就是每个分布式节点都建立了同名的group然后在本地建了一个LRU缓存。我能想到的解释大概是group可以解决不同类型资源里key有冲突的情况。
BTW，新年快乐:)

这里Group应该是一个namespace的概念，类似于某类缓存的资源或数据，我感觉group可以去对标分片的概念，而这里起了若干个cacheserver的分布式节点对应的应该是复制节点的概念。至于最外层的9999应该是充当client的角色

return p.httpGetters[peer], true
这行代码报错,cannot use p.httpGetters[peer] (map index expression of type *HTTPGetter) as PeerPicker value in return statement: *HTTPGetter does not implement PeerPicker (missing method PickPeer)

这是一封自动回复邮件。已经收到您的来信。

想请问下，如果要进行多个group的数据交互的话，该如何进行？必须要手动请求/_geecache/group/key吗？

还有一个问题不太明白，为什么8001,8002,8003的group的name都是同一个值，是一个name可以对应于多个maincache吗？那这样的话一个group又具体指什么？

@zhangxc0921
还有一个问题不太明白，为什么8001,8002,8003的group的name都是同一个值，是一个name可以对应于多个maincache吗？那这样的话一个group又具体指什么？

先解释为什么group的name一样，这里可以再仔细读一下main.go中的代码，调用createGroup()时创建了一个group，并且之后在调用startCacheServer()时，将该group入参，8001,8002,8003所对应的节点都注册在该group.peers中，自然所对应的name都一样。
作者在Day2中的原句：

Group 是 GeeCache 最核心的数据结构，负责与用户的交互，并且控制缓存值存储和获取的流程。

说一下个人的理解，你可以把group看成一个控制中心，getter是用户访问缓存的入口，提供了访问函数，peers的实际类型为HTTPPool（可以看成是一个缓存节点池，管理着真正的缓存节点），包装了一致性哈希算法，所有的8001,8002,8003对应的远程节点都在其中。

@iLiuqi
个人觉得，测试多节点缓存逻辑效果时，main 中 fronted api server 和 cache server 的启动应该独立分开，原用例中，启动的第三个服务用2个端口既承担了 api 又 承担了 cache，容易混乱，分开的话更便于理解。

太对了哥，真的该这样，要不然真有点混乱

这是一封自动回复邮件。已经收到您的来信。

我觉得这篇文章读者很绕，还有一部分原因是命名不太规范。比如peers，一会儿指代host、一会儿指代PeerPicker、一会儿指代consistentHash。从名称上没有做出区分，绕来绕去的

这是一封自动回复邮件。已经收到您的来信。

画了一个关于Day5测试用例的执行流程以及各个服务端和客户端的情况，如有错误之处多多包涵，希望能帮助各位理解

github上也刚传了目前Day1-Day5的学习笔记及相关代码讲解，后续会继续更完：
https://github.com/Mickalls/GeeCache

补充一下，Client1会在本地缓存回写查询到的结果

这命名真是根坨屎一样

感觉这一块儿逻辑有点混乱啊

这是一封自动回复邮件。已经收到您的来信。

authors: 018429 201732110125 Assiduous-donkey BetterZhuang DamonGG DurantVivado FinaLone GuYith KKKZOZ Kaimar666 Kingpie LLoyou00 Leoooo-tqp Mickalls Mr-Xiao2021 NDzuki PegasusWang Pissssofshit Super-DoXCDH UnbearableFate Willendless ZMbiubiubiu alvinssb banzhihang berlinsaint catwithtudou chens72 cuglaiyp dayou5168 geektutu goder-tao hhgg220 hxw19991118 jeffmingup lemon5227 limaoxiaoer liujing-siyang mindingyao mjyuser monkeyskings njcongtou peanutzhen puck1006 sgq123 spade69 walkmiao wanboyan wangy2333 wanhhe wilgx0 yinhuanyi ylwang1122 zhangxc0921 zhucebuliaole zyyingbb

repo: geektutu/blog


text:
Ansible failed to complete successfully. reopening #1065

Issue Type

Bug Report / Support Request

Your Environment
Vagrant 1.9.1
VirtualBox 5.1.10r112026
ansible 2.2.0.0
  config file =
  configured module search path = Default w/o overrides

Your OS

macOS (10.10.5)

Full console output
https://gist.github.com/gettysburger/5293989dab70be8548db4365bf5386bc
Summary
In issue #1065 I tried to spin up a fresh instance and got an Ansible error. You recommended that I upgrade Ansible and that worked for that instance. Today I tried to spin up another fresh instance and got the same error, even though I have the latest Ansible.
Thanks,
Stephen

I think I may have figured it out. I forgot to set "build_composer_project: false"

Yes, that was it. I'm a dope. Sorry to waste your time. Great software Thanks!

Ha, no problem!

authors: geerlingguy gettysburger

repo: geerlingguy/drupal-vm


text:
test Raspian 64 bit architecture

Raspberry Pi have just released the 64-bit architecture for Raspian OS. Importantly it means the entire 8GB of memory can be allocated to a single process too "But some use cases will benefit from being able to allocate the entire memory of an 8GB Raspberry Pi 4 from a single process."

@williamtsalter tested this and found issues with libcamera support for managing camera parameters and also issues with picamera and various submodules supported in the 64-bit version. Based on discussions with William it sounds like with time this will become the future of OWL but for the moment, it needs further development of 64-bit modules and libcamera functionality.
We'll keep looking into using/converting to libcamera as that library advances.

repo: geezacoleman/OpenWeedLocator


text:
WIP - outer joins

A few trivial changes to start out:

Removed extra spaces from generated SQL.
Picked a better example for the recursive query (1) test to show that it works with countries that have more than one city.
Fixed handling of empty resultsets so we get "No match" rather than "Not a table" when no rows were returned.

Slightly less trivial:

Got nullable fields working.
Got failed joins working.

The recursive queries can be implemented as joins rather than multiple fetches so but we need to implement table aliasing before we can do that. One thing at a time ;-)

Ok nullable fields work now.

Bit off more than I had intended but it seems to work.

Is this ready for review/merge or should I leave it until you get back?

I've reworked this in https://github.com/gemini-hlsw/gsp-graphql/pull/4/commits/35da44d9e64f6829bd9ed45477f095fdd1e2caf7 as part of #4.

authors: milessabin tpolecat

repo: gemini-hlsw/gsp-graphql


text:
Controls enable\disable fix

Fixed retry button disabled when accepting reference when tests end. Fixed retry button disabled if retried single suite.

/cc @sipayRT

:ok:

authors: SevInf SwinX

repo: gemini-testing/gemini-gui


text:
NTR: regulation of transcription involved in carbohydrate catabolism

Hello,
I'd like a term to describe the regulation of transcription of sets of genes involved in carbohydrate catabolism - gylcolysis, in particular.
Reference: PMID: 19995986
This new term would replace IMP annotations made to several different phenotypes to protein Q9NP71.
Thanks,
Pascale
Reported by: pgaudet
Original Ticket: geneontology/ontology-requests/11035

We already had:
rdfs:label "regulation of carbohydrate metabolic process by regulation of transcription from RNA polymerase II promoter"^^xsd:string
id "GO:1900402"^^xsd:string
has_obo_namespace "biological_process"^^xsd:string
definition "A regulation of transcription from RNA polymerase II promoter that results in regulation of carbohydrate metabolic process."^^xsd:string
has_exact_synonym "regulation of carbohydrate metabolism by regulation of transcription from RNA polymerase II promoter"^^xsd:string
created_by "mah"^^xsd:string
creation_date "2012-04-20T02:45:27Z"^^xsd:string
I fixed its logical def ->
'regulation of transcription from RNA polymerase II promoter'
and (regulates some 'carbohydrate metabolic process')
And added
rdfs:label "regulation of carbohydrate catabolic process by regulation of transcription from RNA polymerase II promoter"
has_obo_namespace "biological_process"^^xsd:string
definition "A regulation of transcription from RNA polymerase II promoter that results in regulation of carbohydrate catabloism."^^xsd:string
has_exact_synonym "regulation of carbohydrate catabolism by regulation of transcription from RNA polymerase II promoter"^^xsd:string
created_by "dos"^^xsd:string
creation_date "2017-01-31T14:46:21Z"^^xsd:dateTime
EquivalentTo: 'regulation of transcription from RNA polymerase II promoter'
and (regulates some 'carbohydrate catabolic process')
=> automated classification under:
'regulation of carbohydrate catabolic process'
'regulation of carbohydrate metabolic process by regulation of transcription from RNA polymerase II promoter'
@pgaudet  - discovered this ticket - lost during transition from SourceForge.  Hope above fix is good (TG template has issues).

Looks like it addresses it !
Thanks, Pascale

authors: dosumis gocentral pgaudet

repo: geneontology/go-ontology


text:
Definition revision GO:0043328 protein transport to vacuole involved in ubiquitin-dependent protein catabolic process via the multivesicular body sorting pathway

The def of GO:0043328 is incorrect
The process of directing proteins towards the vacuole using signals contained within the protein, occurring that contributes to protein catabolism via the multivesicular body (MVB) pathway.
PMID:11511343
because it doesn't depend on signals within the protein.....

Hi Val,
Updated the definition:
OLD def: "The process of directing proteins towards the vacuole using signals contained within the protein, occurring that contributes to protein catabolism via the multivesicular body (MVB) pathway." [GOC:jl, PMID:11511343]
NEW def: "The process of directing proteins towards the vacuole that contributes to protein catabolism via the multivesicular body (MVB) pathway." [GOC:jl, PMID:11511343]

authors: ValWood pgaudet