Coding guideline: When to use assert messages

Because this has come up a couple of times in code reviews, I wanted to propose the following guideline on when to include the optional 'message' parameter when using the node "assert" module:
My practice is generally:

Always include a message when a failure indicates an end user error.  (e.g., vetting parameters of a public API)
Always include a message when using "assert" within test code to help diagnose test failures from logs.
Use a comment instead of a message when the assertion indicates a Fluid bug.  (e.g., vetting internal self-consistency)

An example of the last case:
// Vet that the 'cells' array has already been updated to match the matrix's new dimensions.
assert.equal(cells.length, rowCount * colCount);

The motivation for using a comment instead of a message in the last case:

Assertion messages count against our bundle size.
Assertion messages sometimes impact runtime performance.

(In theory, gzip helps and hopefully it's rare that providing a message impacts inlining or register allocation, but my bias is still to prefer comments.)

IMO, if a function has more than one assert, adding a message helps in knowing which one was hit

I've definitely been bit by this.
Furthermore, talking with @anthony-murphy, he pointed out that once the JS is minified, the stacks can get a big mangled relative to the source code, so this is important in any case.
Perhaps we should look into a tagging mechanism like y-arnold used to do in the old Office codebase.

@DLehenbauer, I believe it's time to close this issue. Today, message is required (it's not optional), but related later by tag. I'm not a big fan of it as is (as it's equivalent to forcing me to write a message on every IF statement), but I think this ship has sailed.

Tagged asserts is a reasonable compromise.


runtime/pprof: under-samples work on short-lived threads

What version of Go are you using (go version)?

$ go version
go version go1.15rc1 darwin/amd64

$ uname -a
Linux ip-172-31-18-196.us-west-2.compute.internal 4.14.123-111.109.amzn2.x86_64 #1 SMP Mon Jun 10 19:37:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Does this issue reproduce with the latest release?
Yes this is present in go1.13.14 and go1.14.6, though with slightly different shapes. When I ran with Go 1.13, the profile contained zero samples. When I ran with Go 1.14, the process took about 3 seconds longer to run (7.8s vs 5s) and included 2.2s worth of samples for the function of interest. (Though if this worked as I expect, the profiles would cover the same amount of time as the "time" shell built-in reported.)
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rhys/Library/Caches/go-build"
GOENV="/Users/rhys/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/rhys/go/pkg/mod"
GONOPROXY="*"
GONOSUMDB="*"
GOOS="darwin"
GOPATH="/Users/rhys/go"
GOPRIVATE="*"
GOPROXY="direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/49/zmds5zsn75z1283vtzxyfr5hj7yjq4/T/go-build464588215=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?
On a linux/amd64 machine, I ran a program that does 5ms of work at a time on each of 1000 worker goroutines, and uses runtime.LockOSThread and runtime.Goexit to force each worker goroutine to be on a different OS thread.
package main

import (
	"flag"
	"fmt"
	"log"
	"os"
	"runtime"
	"runtime/pprof"
	"sync"
	"time"
)

func main() {
	profileName := flag.String("profile", "./hops.pb.gz", "File name for CPU profile")
	tickTime := flag.Duration("tick", 5*time.Millisecond, "How much work to run on each thread")
	iterations := flag.Int("iterations", 1000, "Number of threads to use for work")
	flag.Parse()

	pf, err := os.Create(*profileName)
	if err != nil {
		log.Fatalf("Create; err = %v", err)
	}
	defer func() {
		err := pf.Close()
		if err != nil {
			log.Fatalf("Close; err = %v", err)
		}
	}()
	err = pprof.StartCPUProfile(pf)
	if err != nil {
		log.Fatalf("StartCPUProfile; err = %v", err)
	}
	defer pprof.StopCPUProfile()

	tick := time.Tick(*tickTime)

	var p int64 = 1
	var wg sync.WaitGroup
	for i := 0; i < *iterations; i++ {
		wg.Add(1)
		go func() {
			defer wg.Done()

			// Have this code run on its own thread, force the runtime to
			// terminate the thread when this goroutine completes (so the next
			// run will be on a different thread).
			runtime.LockOSThread()
			defer runtime.Goexit()

			for {
				select {
				case <-tick:
					return
				default:
				}

				work(&p)
			}
		}()
		wg.Wait()
	}

	fmt.Printf("%d\n", p)
}

func work(p *int64) {
	for i := 0; i < 1e5; i++ {
		*p *= 3
	}
}

What did you expect to see?
I expected the CPU time reported by the shell's time built-in and the CPU time reported by go tool pprof to roughly match.
What did you see instead?
When doing 5ms of work on each of 1000 unique threads, the shell's time built-in reports 5103ms of user-space CPU time, and go tool pprof reports only 50ms of CPU time.
$ time ./hops.linux_amd64 -profile=./hops.pb.gz -tick=5ms -iterations=1000
-6036671839377369855

real	0m5.105s
user	0m5.103s
sys	0m0.085s

$ go tool pprof -top ./hops.pb.gz
File: hops.linux_amd64
Type: cpu
Time: Jul 27, 2020 at 2:04pm (PDT)
Duration: 5.10s, Total samples = 50ms ( 0.98%)
Showing nodes accounting for 50ms, 100% of 50ms total
      flat  flat%   sum%        cum   cum%
      30ms 60.00% 60.00%       30ms 60.00%  main.work
      10ms 20.00% 80.00%       10ms 20.00%  runtime.(*randomEnum).next (inline)
      10ms 20.00%   100%       10ms 20.00%  runtime.futex
         0     0%   100%       10ms 20.00%  main.main
         0     0%   100%       30ms 60.00%  main.main.func2
         0     0%   100%       10ms 20.00%  runtime.convT64
         0     0%   100%       10ms 20.00%  runtime.findrunnable
         0     0%   100%       10ms 20.00%  runtime.futexsleep
         0     0%   100%       10ms 20.00%  runtime.gcBgMarkStartWorkers
         0     0%   100%       10ms 20.00%  runtime.gcStart
         0     0%   100%       10ms 20.00%  runtime.main
         0     0%   100%       10ms 20.00%  runtime.mallocgc
         0     0%   100%       10ms 20.00%  runtime.mstart
         0     0%   100%       10ms 20.00%  runtime.mstart1
         0     0%   100%       10ms 20.00%  runtime.notetsleep_internal
         0     0%   100%       10ms 20.00%  runtime.notetsleepg
         0     0%   100%       10ms 20.00%  runtime.schedule

/cc @hyangah

I did not add this to the Go1.15 milestone since you've reported that the issue is reproducible in earlier versions of Go. This can change though.

I'm curious if we know why this issue happens? I could see this happening with per-thread CLOCK_THREAD_CPUTIME_ID-style timers (like done here), but Go runtime uses plain good gold setitimer with SIGPROF as far as I know? Does SIGPROF sampling only count in full scheduler ticks and doesn't carry the remainder forward to the next thread scheduled on the same CPU (which would be not entirely correct from the attribution point of view but would be more correct statistically).


Make range selector bigger

@borisyankov let me know the spec ;)
Now I simply make it bigger, do you want to position it lower? As it seems close already

Coverage remained the same at 40.881% when pulling ba91ce28442fbf1a8776acd975fb1c48d53502e8 on qingweibinary:qingwei/style_range_selector into 99698ad13e6e93a593bd4d8e472c2512db2330a6 on binary-com:master.

Closer like this?

Yeah, that looks pretty good ;)


fix(versions): update Activiti/activiti-cloud-full-chart-security versions

UpdateBot pushed helm dependency: activiti-cloud-full-example to: 7.1.130

UpdateBot commands:
updatebot push-version --kind helm activiti-cloud-full-example 7.1.130


Allow custom db configuration from secrets or parameters

This PR introduces changes to LSv2 and Node charts
LSv2
Extended db configuration so to allow any combination of properties or secret injected values.
Some properties are not sensitive, like host in this case, user can specify either the vanilla hostname or the couple secret name + secret key. Plain values, like host in this case, have priority.
This allows LS to work w/

vanilla psql helm chart
aws rds managed services
zalando operator (that creates secrets on our behalf)

Example 1
In this case the POSTGRES_HOST env var can be either a plain text property set as part of the helm chart values via the host property, or kept null and set through the secretName/hostKey.
the SPRING_DATASOURCE_USERNAME is instead considered sensitive and must be set as secretName/userKey.
        - name: POSTGRES_HOST
          {{- if .host }}
          value: {{ .host }}
          {{- else }}
          valueFrom:
            secretKeyRef:
              name: postgres-secrets
              key: POSTGRES_HOST
              name: {{ .secretName }}
              key: {{ .hostKey }}
          {{- end }}
            - name: SPRING_DATASOURCE_USERNAME
              valueFrom:
                secretKeyRef:
                  name: postgres-secrets
                  key: POSTGRES_USER
                  name: {{ .secretName }}
                  key: {{ .userKey }}

Node
Added sleep flag to allow the container to restart with sleep infinity and allow for manual maintenance. This was used to manually fix mithril breaking change.

LGTM when conflicts are resolved and hyphens for aggregation schemas are replaced for underscores :))


quick fix to add post_delete

added the post_delete to the imports.
originally I removed the post_delete from the imports because of a merge conflict.

Quick fix for what and why does this fix it. Please be more detailed in your writeups.
Sent from my iPhone

On Aug 15, 2018, at 9:36 AM, johnsonkuang<EMAIL_ADDRESS>wrote:
added the post_delete to the imports.
originally I removed the post_delete from the imports because of a merge conflict.
You can view, comment on, or merge this pull request online at:
https://github.com/jonfroehlich/makeabilitylabwebsite/pull/563
Commit Summary
quick fix to add post_delete
File Changes
M website/models.py (2)
Patch Links:
https://github.com/jonfroehlich/makeabilitylabwebsite/pull/563.patch
https://github.com/jonfroehlich/makeabilitylabwebsite/pull/563.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Ok this quick fix resolves issue #562, the import was add in PR #560 and removed by PR #559 because of a merge conflict. This fix simply adds it back in.

Thanks. Hopefully this will bring the website back!
Sent from my iPhone

On Aug 15, 2018, at 9:43 AM, johnsonkuang<EMAIL_ADDRESS>wrote:
Ok this quick fix resolves issue #562, the import was add in PR #560 and removed by PR #559 because of a merge conflict. This fix simply adds it back in.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.


Can we have the latest master as a new release?

The latest release (v0.2) seems to be a little outdated, and we would like to have the latest master as v0.3 if possible.

@johnSchnake is this possible?

Yes; sorry for the delay. I will work on getting a release out early this coming week.

So two PRs are outstanding and one of them is a bugfix I'd like to get in before a release is cut. See #94 and #96 .  Will try and wait to see if those can get in without delaying this much further.

@johnSchnake any update on the schedule of the next release?

Released! Sorry it took so long to get that out.


Memory error - Optimization to increase batch size

When training with samples of size 256x256 pixels, a batch size over 32 causes a memory error from cuda. We have to find a way to optimize the process, in order to increase the batch size.
RunTimeError: cuda runtime error (2) : out of memory at /opt/conda/ .../THCStorage.cu:58

NOTE : May be specific to our (GC HPC) computing environment

Can some kind of co-routines/generators approach be useful here ?  Are there unnecessary copies of data structures in memory ?

See https://github.com/pytorch/pytorch/issues/5210

Tests were performed using the unet network rather than unetsmall in order to force a memory error. The error occurred on line 102 of unet_pytorch.py under these conditions. Here is a summary of the observations thus far:

Deleting variables as they were no longer needed had no impact on memory usage (ex. del maxpool1 after line 91 in unet_pytorch.py)
Adding torch.cuda.empty_cache() to the code gives back approximately 10 MB of GPU memory, which is too little to be an applicable solution
Convolution operations, which are quite heavy operations, are performed using CuDNN by Nvidia (closed source) which is optimized for performance on Nvidia GPUs. It is unlikely that we will be able to reduce memory use without building new modules. There seems to be a way to set a memory limit for the convolution in the Caffe C++ source code used by Pytorch, but further investigation is needed to see how to use this in Pytorch.
Alternative: we could trade memory for computation and execution speed as described here using gradient checkpointing to limit the size of the stored backpropagation graph. This isn't a good option since we want to keep training time as low as we can.

@epeterson12 - interesting concept that we might want to look at : tensor comprehensions
Also, this ticket might not be all that important after all.  PyTorch 1.0 will have a compiler to make it faster, which probably also means better on memory.

@epeterson12 : the figures for checkpointing don't seem to be that bad.  In fact for one of the models checkpointing actually decreases gpu time.  I suggest we create some benchmarks to test.  import torch.utils.checkpoint works just fine in our environment so we could try the following:

confirm that a batch size > 32 with 256 X 256 samples does indeed trigger the error
try with checkpoint to see if the batch size goes through; increase batch size until memory crashes again

Memory consumption and processing times could be monitored for all tests.  What do you think ?

@ymoisan I think that it would be a good idea to test our net using checkpointing. I will confirm that a batch size > 32 with 256 X 256 samples causes the error. I have started modifying our code in order to test checkpointing using this methodology I mentioned in my previous comment.

It turns out that the maximum batch size that we can currently handle with a sample size of 256x256 is 33 when using the unetsmall net and 15 when using the unet net with our current hardware and version of the code. Beyond these quantities, we get the out of memory error.

Using checkpointing in the unetsmall net increases the speed of training. Tests were performed using the following parameters:

# Training Samples
# Validation Samples
Sample Size
# Classes
# Epochs

781
495
256
11
200

Learning Rate
Weight Decay
Step Size
Gamma
Class Weights
Dropout

0.0001
0
4
0.9
False
False

Best results

.
Original
Checkpointed

Max batch size
32
50

Time to complete training over 200 epochs
350 min
316 min

Using checkpoints in the net design does seem to affect the results of the training. Tests were done on the original and on the checkpointed nets while setting the random seed to 7 and the models outputted gave similar but slightly different results. In the first test, the original algorithm gave results closer to the ground truth. In the second tests, the checkpointed version of the net yielded better results.

Validation of Checkpointed results
Results when using checkpointing are slightly different from those of the original unetsmall model because CudNN has non-deterministic kernels. I ran tests using suggestions from pytorch discussions https://discuss.pytorch.org/t/non-reproducible-result-with-gpu/1831 and https://discuss.pytorch.org/t/deterministic-non-deterministic-results-with-pytorch/9087.
Using the same sample files, I ran train_model.py twice using the unetsmall model (batch_size = 32) and I ran it once using the checkpointed_unet model (batch_size = 50). Then, I classified some images with the resulting models.
The settings to try to get reproducible results were set as follows at the beginning of the code:
torch.backends.cudnn.deterministic = True
torch.manual_seed(999)
torch.cuda.manual_seed(999)
torch.cuda.manual_seed_all(999)
random.seed(0)

Also, in the DataLoaders, the parameters used for the instantiation had num_workers = 0 and shuffle = False
Running the original unetsmall configuration without checkpoints 2 times yielded two slightly different results. Here are some examples of the results obtained when running image_classification.py on one of the training images with each trained model. Sections if the images that weren’t classified were left white.

Ground Truth
Current Code
Current Code 2
Checkpointed

Please note that the configurations and the number of samples weren't set to yield optimal results. Verifying reproducibility was the goal of these tests. The number of training samples was set to the number of samples produced during the samples creation.
global:
  samples_size: 256
  num_classes: 5
  data_path: /my/data/path
  number_of_bands: 3
  model_name: unetsmall     # One of unet, unetsmall, checkpointed_unet or ternausnet

sample:
  prep_csv_file: /my/prep/csv/file
  samples_dist: 200
  remove_background: True
  mask_input_image: False

training:
  output_path: /my/output/path
  num_trn_samples: 3356
  num_val_samples: 1370
  batch_size: 32
  num_epochs: 100
  learning_rate: 0.0001
  weight_decay: 0
  step_size: 4
  gamma: 0.9
  class_weights: False

models:
  unet:   &unet001
    dropout: False
    probability: 0.2    # Set with dropout
    pretrained: False   # optional
  unetsmall:
    <<: *unet001
  ternausnet:
    pretrained: ./models/TernausNet.pt    # Mandatory
  checkpointed_unet:
    <<: *unet001

I think that the results of the checkpointed_unet are similar enough to the unetsmall’s results for us to consider that it is a good memory and time optimised version of our unetsmall net architecture. I have added it as a model choice for our program.
Throughout my tests, I observed that the models produced by training are more accurate when the randoms aren’t seeded. The checkpointed_unet, observationally,  seems to be more affected by this then the unetsmall.


Added Speech Synthesis

The following pull request consists a section for speech synthesis using tensorflow.

Thank you for the PR. There are a few changes to be made, before, merging the PR.

Will be adding the comments/reviews in the code section


Not a true typescript express starter project

The code for app.js and server.ts should have been wrapped under classes.
See here -> https://www.typescriptlang.org/docs/handbook/classes.html
The first example shows how a server should be initiated.
class Server {
...
...
execute = async () => {
....
}
}
const server = new Server();
server.execute(); // Thats it
Everything apart should come under classes.

The  beauty of Open Source... you can always create a PR and submit it when you think the code is wrong

I am on it. will do. :)

Create PR - https://github.com/Microsoft/TypeScript-Node-Starter/pull/136

Changes done from my side and have submitted PR as referenced above.

No response yet?

@bowdenk7 @DanielRosenwasser ^^

Official opinion is to support both functional and pop style. Where is the opinion coming from that TypeScript should be done object oriented? In terms of consistency: The application isn't using classes anywhere else.

Hi @andys8, what you said totally makes sense.
The reasons that makes me think not to merge the OOP style is that the original repo is

It is now being used by so many developers and so many forks are already there.
The choice to make it OOP or functional style depends on the developers forking/cloning this project which makes it available to everyone.
The purpose of TS is to make bigger and complicated JS projects more maintainable which at-least I see is tough in the absence of object orientation.
Having said all this, what I too think is not to merge. I will keep my fork as separate under my Repo only and rename it "Typescript-Express-Starter-OOP" or something like that.

@satya-jugran Great to hear that. I think a OOP fork would make a nice side project and be very interesting to compare.

@satya-jugran
Many people like Express because it's super simple. Currently, you added tons of abstraction that has no value — multiple classes which only wrap functions.
I recommend reading Typescript Goals https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

Non-goals
Exactly mimic the design of existing languages. Instead, use the behavior of JavaScript and the intentions of program authors as a guide for what makes the most sense in the language.

Some developers try to code in the same way as C#, which is a wrong understanding.

Current design makes it available to everyone (both OOP and functional style programmers), so no design changes make more sense. Closing this issue.


Error parsing response

Hi all, I'm trying to use Hyperclient to consume the API of a server that it's build with perl+Catalyst and exposes outside as JSON+HAL, but I'm stuck with a parsing error that Hyperclient throw me and I'm unnable to figure what's happen.
This is the full response when I query the resource 'subscribers':
{
   "_embedded" : {
      "ngcp:subscribers" : [
         {
            "_links" : {
               "collection" : {
                  "href" : "/api/subscribers/"
               },
               "curies" : {
                  "href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
                  "name" : "ngcp",
                  "templated" : true
               },
               "ngcp:callforwards" : {
                  "href" : "/api/callforwards/52"
               },
               "ngcp:calls" : {
                  "href" : "/api/calls/?subscriber_id=52"
               },
               "ngcp:customers" : {
                  "href" : "/api/customers/3"
               },
               "ngcp:domains" : {
                  "href" : "/api/domains/3"
               },
               "ngcp:journal" : {
                  "href" : "/api/subscribers/52/journal/"
               },
               "ngcp:reminders" : {
                  "href" : "/api/reminders/?subscriber_id=52"
               },
               "ngcp:subscriberpreferences" : {
                  "href" : "/api/subscriberpreferences/52"
               },
               "ngcp:subscriberregistrations" : {
                  "href" : "/api/subscriberregistrations/?subscriber_id=52"
               },
               "ngcp:voicemailsettings" : {
                  "href" : "/api/voicemailsettings/52"
               },
               "profile" : {
                  "href" : "http://purl.org/sipwise/ngcp-api/"
               },
               "self" : {
                  "href" : "/api/subscribers/52"
               }
            },
            "administrative" : false,
            "alias_numbers" : [],
            "customer_id" : 3,
            "domain" : "proxy.testserver.org",
            "domain_id" : 3,
            "email" : null,
            "external_id" : null,
            "id" : 52,
            "password" : "testtest",
            "primary_number" : {
               "ac" : "949",
               "cc" : "1",
               "sn" : "3465301"
            },
            "profile_id" : null,
            "profile_set_id" : null,
            "status" : "active",
            "username" : "test.fax",
            "uuid" : "45cdcf6f-3f39-4245-bccb-3db775622701",
            "webpassword" : null,
            "webusername" : "test.fax"
         },
         {
            "_links" : {
               "collection" : {
                  "href" : "/api/subscribers/"
               },
               "curies" : {
                  "href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
                  "name" : "ngcp",
                  "templated" : true
               },
               "ngcp:callforwards" : {
                  "href" : "/api/callforwards/55"
               },
"ngcp:calls" : {
                  "href" : "/api/calls/?subscriber_id=55"
               },
               "ngcp:customers" : {
                  "href" : "/api/customers/3"
               },
               "ngcp:domains" : {
                  "href" : "/api/domains/3"
               },
               "ngcp:journal" : {
                  "href" : "/api/subscribers/55/journal/"
               },
               "ngcp:reminders" : {
                  "href" : "/api/reminders/?subscriber_id=55"
               },
               "ngcp:subscriberpreferences" : {
                  "href" : "/api/subscriberpreferences/55"
               },
               "ngcp:subscriberregistrations" : {
                  "href" : "/api/subscriberregistrations/?subscriber_id=55"
               },
               "ngcp:voicemailsettings" : {
                  "href" : "/api/voicemailsettings/55"
               },
               "profile" : {
                  "href" : "http://purl.org/sipwise/ngcp-api/"
               },
               "self" : {
                  "href" : "/api/subscribers/55"
               }
            },
            "administrative" : false,
            "alias_numbers" : [],
            "customer_id" : 3,
            "domain" : "proxy.testserver.org",
            "domain_id" : 3,
            "email" : null,
            "external_id" : null,
            "id" : 55,
            "password" : "tfp6LzOxTFa2OWHF",
            "primary_number" : {
               "ac" : "919",
               "cc" : "1",
               "sn" : "8675959"
            },
            "profile_id" : null,
            "profile_set_id" : null,
            "status" : "active",
            "username" : "7WOkIWgU",
            "uuid" : "df0ed22e-d0db-406b-b1cf-0f068f5778d4",
            "webpassword" : null,
            "webusername" : "7WOkIWgU"
         }
      ]
   },
   "_links" : {
      "curies" : {
         "href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
         "name" : "ngcp",
         "templated" : true
      },
      "ngcp:subscribers" : [
         {
            "href" : "/api/subscribers/52"
         },
         {
            "href" : "/api/subscribers/55"
         }
      ],
      "profile" : {
         "href" : "http://purl.org/sipwise/ngcp-api/"
      },
      "self" : {
         "href" : "/api/subscribers/?page=1&rows=10"
      }
   },
   "total_count" : 2
}

And this is the error Hyperclient throw me when I try to do a simple iteration over api.subscribers.each to just puts the subscriber.id:
RuntimeError: Invalid response for LinkCollection. The response was: "_links"
from /usr/local/rvm/gems/ruby-2.3.3/gems/hyperclient-0.8.5/lib/hyperclient/link_collection.rb:18:in `initialize'

Why it's unable the full parse the response and let my iterate over the subscribers collection ? ... I've checked that the response is ok.

Is it ok to have a _links under _embedded?
You should build a spec for this and lets figure out if it's legit per JSON+HAL spec?

Maybe the issue is with the missing Content-Type: application/hal+json header? I can reproduce this exact same error message by having a server return a hal response but not include any Content-Type (and just this week a colleague was bit by this exact issue).
@dblock would you think it's useful to improve the error in these cases? I can try to whip up a PR to improve error handling when we don't get what we expect from faraday after a request.

The isssue is with the API server not returning the root doc, instead it returns a html page with the manual of the API.
The reply I posted was from asking to one of the resources URL.
I'm beeing in contact with Oriol about this.
Either way, improving the error reporting on this cases, for example trowing a exception about not valid Content-Type will help a lot.
On a side note, is there any way to use the gem pointing directly to the resources URL ?, I'm trying to build the root doc myself and then changes on nginx so it returns the root doc instead of the html one to json+hal query over the same root URL, but in the mean time I whant to test how the gem works with the API

@dblock As far as I know, it's a valid json+hal reply, because the _links section is outside _embedded one, then inside the _embedded you have another_links section, that point to the collection

Okay, so back to the original issue it sounds like what's described in this bug is not the case, ie. that's not the data being returned (different content-type, an HTML page), right @rbetancor? In that case this should be closed?
Improving the error message would be great, if @ivoanjo wants to take it, go for it!

@dblock Yes, you are wrigth ... the response I pasted, is the one you receive whenever you query directely the resource, the root API URL returns an html doc, no a json+hal root one, either way ... is there any way of passing to the client instance a root_doc build by myself?

Hyperclient.new(url) is what you want, but you just need to pass the right URL in there. Or am I missing something?
I'll close this, but feel free to ask more questions!

@dblock  no ... Hyperclient.new(url) is not valid for this ... because this wrongly developed api does not return a valid ROOT document, never ever ... so I whant to 'inyect' my own root_document to the Hyperclient instance and from there it follow the _links to the resources.

Oh, the API should be fixed :)
That said, I looked at how you would "load" a document instead of requesting and parsing it, but there's a bunch of stuff going on there - all requests are made with Faraday.
A clean implementation is to write a middleware for Faraday that "fixes" this content. There's a bunch of examples of middleware in https://github.com/lostisland/faraday_middleware to look at.
Otherwise a hack ... Hyperclient.new, is actually Hyperclient::Entrypoint#new, which then makes HTTP requests, ultimately calling Hyperclient::Link#get, so I think you could declare Hyperclient::Entrypoint#get and return an instance of Resource, so  Resource.new(<the new body>, @entry_point, response).
Finally, you could add a Hyperclient#load method that takes a body. I am not 100% convinced we want this in the library, but I would consider a pull request.

@dblock finaly I found how to tweak nginx setup so for queries against the root URL /api/ ... to return a static json file I build, instead of the html help docs of the api.
But now stuck on who to query resrouces that are named in an 'prefixed' way ... I mean .. how to query for api.subscribers.each ... when on the api the href for subscribers really said ngcp:subscribers  ... ? Any clue?

@dblock wear ...
This is the index.json file I'm returing for a query over the root of the api:
{
        "_links": {
                "self": {
                        "href": "/api"
                },
                "curies": [
                        {
                                "name": "ngcp",
                                "href": "https://proxy.testserver.tld:1443/rels/{rel}",
                                "templated": true
                        }
                ],
                "subscribers": {
                        "href": "/api/subscribers/"
                },
                "subscriber": {
                        "href": "/api/subscribers/{id}",
                        "templated": true
                }
        }
}

Now from rails I do:
@create_connection.subscribers.each { |sub| puts sub.id.to_s }
And get this:
TypeError: no implicit conversion of String into Integer
from /usr/local/rvm/gems/ruby-2.4.0/bundler/gems/hyperclient-9d8bd0451390/lib/hyperclient/curie.rb:25:in `[]'

Either if I ask for specific resource:
@create_connection.subscriber(id: 52).id
I get the same error, the json reply for the first query (iterate over the whole list of resources), is the one I published ad the begining of this issue ... the reply to the individual query to resource id:52 is:
{
   "_links" : {
      "collection" : {
         "href" : "/api/subscribers/"
      },
      "curies" : {
         "href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
         "name" : "ngcp",
         "templated" : true
      },
      "ngcp:callforwards" : {
         "href" : "/api/callforwards/52"
      },
      "ngcp:calls" : {
         "href" : "/api/calls/?subscriber_id=52"
      },
      "ngcp:customers" : {
         "href" : "/api/customers/3"
      },
      "ngcp:domains" : {
         "href" : "/api/domains/3"
      },
      "ngcp:journal" : {
         "href" : "/api/subscribers/52/journal/"
      },
      "ngcp:reminders" : {
         "href" : "/api/reminders/?subscriber_id=52"
      },
      "ngcp:subscriberpreferences" : {
         "href" : "/api/subscriberpreferences/52"
      },
      "ngcp:subscriberregistrations" : {
         "href" : "/api/subscriberregistrations/?subscriber_id=52"
      },
      "ngcp:voicemailsettings" : {
         "href" : "/api/voicemailsettings/52"
      },
      "profile" : {
         "href" : "http://purl.org/sipwise/ngcp-api/"
      },
      "self" : {
         "href" : "/api/subscribers/52"
      }
   },
   "administrative" : false,
   "alias_numbers" : [],
   "customer_id" : 3,
   "domain" : "proxy.testserver.tld",
   "domain_id" : 3,
   "email" : null,
   "external_id" : null,
   "id" : 52,
   "password" : "testtest",
   "primary_number" : {
      "ac" : "949",
      "cc" : "1",
      "sn" : "3465301"
   },
   "profile_id" : null,
   "profile_set_id" : null,
   "status" : "active",
   "username" : "test.fax",
   "uuid" : "45cdcf6f-3f39-4245-bccb-3db775622701",
   "webpassword" : null,
   "webusername" : "test.fax"
}

And I checked on the nginx server logs, the Hyperclient is asking for the right URL on both cases and get back the json reply.

Try to understand what's going on by looking at the entire stack of that exception, https://github.com/codegram/hyperclient/blob/master/lib/hyperclient/curie.rb#L25 is just accessing a hash and something there is a string where it expects an integer? With a repro you should be able to see what is what and what it's expecting and how it gets there.


minor type fix

Fixes #
Minor issue: echos "ADDGroupID" instead of "AADGroupID"
Proposed Changes

Super simple string change

Testing

Closing since these samples are no longer in the Experimental directory, but are in the BotBuilder-dotnet and BotBuilder-js projects.
I've duplicated this patch here: https://github.com/microsoft/botbuilder-dotnet/pull/2896


BUG - Plugin cannot be started after upgrade to 3.1

** After upgrading to 3.1 the plugin cannot be started **
Expected behavior
Plugin gets started
Observed Behavior
Error message is shown in Mattermost GI system console
Environment

Mattermost version: 5.26.0
OS: Linux Debian
Platform:  Windows Desktop App 4.5.3
Previous plugin: 3.0.2 (Runs after downgrade from 3.1)

@jprusch yeah, my bad, Will be releasing a new build in an hour.

@jprusch This is resolved in v3.1.1.


Extension state forgotten

Extension state is forgotten if another extension "takes over". So when the other extension is finished showing it does not go back to the one activated before and instead goes back to default

I will wait a little with this until I have time. Also I want this to be solved first: https://github.com/MLFlexer/smart_workspace_switcher.wezterm/issues/36
because it is not it will be stuck in the wrong state when using the switcher if it is not "forgotten". This is mostly a note for myself

I will wait a little with this until I have time. Also I want this to be solved first: MLFlexer/smart_workspace_switcher.wezterm#36

Fixed here https://github.com/michaelbrusegard/tabline.wez/pull/26


🐞 [BUG] - Gssoc'23 still being used in Issue Template and advanced-labeler.

Description
We need to update the year in necessary places..like all the issue templates..advanced-labeler-yml
Current behaviour
Gssoc'23 being displayed inspite of the year being 2024
Expected behaviour
Gssoc'24 inplace of Gssoc'23
Reproduction steps
1. Go to 'create a new Issue'
3. Scroll down to bottom ..It asks ae you contributing to the Gssoc'23
4. See error

Screenshots

Logs
No response
Browsers
Chrome
OS
No response
Are you contributing for a program ?
GSSoC2023
Code of Conduct

[X] I have read and agree to the Contributing Guidelines of this project.

Please assign me this

Assigned @irfan-iiitr


Some classes of tailwind CSS not working when we import flowbite.css(Flowbite Blocks)  in Next js

We did the flowbite integration according to the documentation for react Next JS, and flowbite React components are working fine but when i tried to use Flowbite Blocks components like Hero, Marketing, Testimonials, by adding Flowbite.css.
With flowbite css, Flowbite blocks components are working  fine but some of the Tailwind Css classes(break points like md: sm:) are not working.
Steps to reproduce:

Create fresh project with create next app with tailwind integrated.
Integrate Flowbite as recommended in documentation https://flowbite.com/docs/getting-started/next-js
Use Testimonial with carousel code snippet from (https://flowbite.com/blocks/marketing/testimonial/#carousel-slider)

You can observe testimonial carousel UI broken
as a work around steps:

try to import tailwind.min.css from node_modules/flowbite/dist/
Testimonial carousels UI will work seamlessly, but tailwind css "w-14 md:w-20" will break

Hey @pradeep538,
Thanks for supporting our work!
I think that you shouldn't import the CSS file from node_modules - instead you should set up Tailwind CSS with Next.js and the configuration file paths so that you will build the CSS on demand instead of having everything at once.
This will also massively increase performance.
You can check this official guide too for the Next.js & Tailwind CSS integration: https://tailwindcss.com/docs/guides/nextjs

Thanks for the reply @zoltanszogyenyi ,
Apologise, i have written wrongly tailwind.min.css, that is actually flowbite.min.css


Quantization

Hi,
Have you tried quantizing Mamba? Do you plan on releasing quantized versions?
Can you share your thoughts on quantizing Mamba, given the sensitivity of the model's recurrent dynamics?
Thanks

We have not tried quantization, it's an open question.
Would be very interesting to understand how sensitive the model is to the SSM params. E.g. I could imagine quantizing the nn.Linear weights but keep the SSM params and states in high precision.

I would love an update on this

Hello, we have some initial results to share, but it is still under reviewing. Please see our pre-viewed version at https://hychiang.info/projects/quamba/

Here's a paper being presented at the Next-Generation Sequence Modeling Workshop at ICML next week: https://arxiv.org/abs/2406.09477
The takeaway is that for quantization aware training and inference on LRA, most parameters can be quantized to below uint8, but the the recurrent matrix A/lambda is the most sensitive and performance dramatically changes under 8 bits.

Here's a paper being presented at the Next-Generation Sequence Modeling Workshop at ICML next week: https://arxiv.org/abs/2406.09477
The takeaway is that for quantization aware training and inference on LRA, most parameters can be quantized to below uint8, but the the recurrent matrix A/lambda is the most sensitive and performance dramatically changes under 8 bits.
This recent preprint might also be of interest: https://arxiv.org/abs/2407.12397

So basically mixed precision of int4 for most of the weights, then int8 for matrix A/lambda, is reasonable?

Yup, this is similar to the more recent ExpertsInt8 from Jamba1.5 where the MLPs in the MOEs are quantized: https://www.ai21.com/blog/announcing-jamba-model-family
But yeah, generally the order of sensitivity is MLPs < non-recurrent parameters inside SSM block < A/Lambda/recurrent matrix in SSM block. Not sure about the impact to the other mechanisms in Mamba but it's a start.


Make log level configurable in values file

Problem: Log level is currently hardcoded to 'debug' and is not configurable.

log can now be configured in latest chart


No output folder in gdrive

i'm using latest colab https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb and there is no output folder.

same here

https://github.com/TheLastBen/fast-stable-diffusion/commit/d39a5ab9d69727247a121b7c5a845c14adfdb6a0

@TheLastBen thanks!


Remove unnecessary auth reconcile command from README

We no longer need the RBAC template in 3.9. The template was removed in https://github.com/openshift/origin/pull/18580
/assign @jwforres

/lgtm


Use v1 of numeral

Numeral just update to v2 introducing breaking changes. This change pins it to version 1.

Erm, shouldn't this be numeral that you've pinned to ~1 rather than handlebars?
Also, I note that I completely forgot to add lodash and must have had it installed globally back in the day when I wrote the tests. (If you fancy adding that dependency as well as fixing the numeral version fix ;)

Doh! Clumsy! I'll update! I'll also add lodash.

Fixed and added lodash. The GH diff makes it look like I've changed the whole file. https://github.com/solidgoldpig/handlebars.numeral/pull/1/files?w=1 Makes things much clearer.


String clickedValue = (index < 9) ? (index + 1).toString(): (index == 9)  ? '0' : (index == 10)? '.' : String.fromCharCode(0xe0c5);

This code is not working for showing backspace
String clickedValue = (index < 9) ? (index + 1).toString(): (index == 9) ? '0' : (index == 10)? '.' : String.fromCharCode(0xe0c5);

Hi @neha-ann! Could you explain what you are trying to do? It's not clear from your code snippet what's not working or what you mean by "showing backspace". Thanks!

There's nothing wrong in this code and it works.

I'm going to close this as the code posted works like it should.
The question is what you were trying to do with the code. Please feel free to respond with more information and we might be able to help. Thank you!


Website 404 page not working on netlify hosting!

Version
System:
  OS: Windows 10 10.0.19045
  CPU: (4) ia32 AMD Ryzen 3 2200U with Radeon Vega Mobile Gfx
  Memory: 649.02 MB / 3.40 GB
Browsers:
  Edge: Chromium (121.0.2277.106)
  Internet Explorer: 11.0.19041.3636

Details

Reproduce link
https://rspress.dev/404
Reproduce Steps
any non existent page

I think the solution includes two point:

generate 404.html in ssg phase https://github.com/web-infra-dev/rspress/blob/main/packages/core/src/node/build.ts#L134
add redirect rule for the unmatched route in netfily config file https://answers.netlify.com/t/new-feature-browse-files-in-your-deploy-with-the-deploy-file-browser/105196

Do you have any idea?

I think the solution includes two point:

generate 404.html in ssg phase https://github.com/web-infra-dev/rspress/blob/main/packages/core/src/node/build.ts#L134
add redirect rule for the unmatched route in netfily config file https://answers.netlify.com/t/new-feature-browse-files-in-your-deploy-with-the-deploy-file-browser/105196

Do you have any idea?

something similar to astro adapters? for rspress for different hosts
https://github.com/withastro/adapters/blob/main/packages/netlify/src/index.ts#L88
https://docs.astro.build/en/guides/integrations-guide/netlify/

i guess _redirects r netlify config is missing in build

https://docs.netlify.com/routing/redirects/redirect-options/#custom-404-page-handling

@sanyuan0704
can you tell me where 404.html is located??? so that i can fix err for netlify

#623


Displaying same text twice in libraries

Actual behavior
"Created by" is used twice in many of the library description.
Screenshots of the issue

Would you like to work on the issue?
Yes, please assign me to this.

I couldn't find it any other description except for p5.bots

@Rahulm2310 Yeah, actually it is duplicated in many of the Hindi translation libraries.

It is only duplicated for p5.bots. You can go ahead and fix it.


OrientationMarkersTool & ScaleOverlayTool Could you update to the current version

Can you update the description for the isse?

你能更新一下这个问题的描述吗？

I hope has OrientationMarkersTool and ScaleOverlayTool in cornerstoneTools of cornerstone3D,I want to use it in volume viewport

I want to have a scale on the volume viewport, the old version was implemented by ScaleOverlayTool, but I didn't find this tool in the 3D version

I tried to move the old version of the code to the new version, but I was unsuccessful，I hope you can help me realize the function of this scale line

Can you create a draft PR to our Cornerstone3D repo, I can investigate and help you to implement this feature

Can you create a draft PR to our Cornerstone3D repo, I can investigate and help you to implement this feature
#298
I have created a draft  PR ，I just created the file. Please help me complete this function, thanks


fix: Solved the problem of garbled request headers

If Form-data is used to pass Chinese strings, garbled characters exist

@q1979635364 This does not look right. MIME fields can have ASCII characters only. If one needs to put values with non-ASCII characters in MIME fields one must encode (BASE64 or quote-printable) one must encode those values.


Example/modification of Account._unclaimed_register()

Summary

Created an example for using account_unclaimed_register() and have modified the required functions
for it to work properly. Maybe you can successfully fix, that the created account gets locked and disabled, see
comments inside the example.
Changed the Base-API-Url to v9 from v7
Changed the aiohttp requirement to aiohttp[speedups] so it installts brotli compression (which is enabled by default for users) and enabled br correspondingly in all required locations
Added a captcha solver utility function inside the example which is based on the 2captcha-python lib

General Info

[x] If code changes were made then they have been tested.
[x] This PR adds something new (e.g. new method or parameters).

Hey, thank you for reviewing this, glad you are actively working on it, keep it up. x) - Ill wait for you to push a couple more updates and then open another PR


Text nodes should retain whitespace

Amazing and helpful tool!
I ran into a small issue when copying HTML from TailwindUI into elm-to-html.com
The issue is that text nodes are run through String.trim. This makes for cleaner strings, but whitespace has semantic meaning in text nodes, which is lost.
(I could see 'fixing' this possibly generating very long trailing spaces and new lines, so maybe any whitespace could be collapsed into a single space? Not sure if that's actually tenable.)
Here is the original/expected HTML, followed by the HTML generated by Elm, after having been passed through elm-to-html.com
-
Faucibus commodo massa rhoncus, volutpat. Dignissim sed eget risus enim.

+
Faucibus commodo massa rhoncus, volutpat.Dignissimsedeget risus enim

Expected:

Actual:

Hey! Thank you for reporting the issue and finding the relevant code.
                trimmed : String
                trimmed =
                    String.trim textBody
                        |> Regex.replace
                            (Regex.fromString "\\s+"
                                |> Maybe.withDefault Regex.never
                            )
                            (\_ -> " ")

This is the current implementation (as you linked to). I wonder if the regex replace is sufficient and maybe just removing the String.trim would handle it correctly?

Okay, I think this might address the issues. Here's a preview of the deployed site that you can play around with, any thoughts?
https://deploy-preview-20--html-to-elm-tailwind.netlify.app/
The one case that comes to mind that I'm not sure about is if whitespace needs to be preserved within nodes that have nothing but whitespace or if it is safe to remove all whitespace within whitespace-only nodes. Otherwise it's seeming pretty good.

Thanks @dillonkearns. Sorry I didn't look at it in a timely manner but the preview link looks great

No problem, thanks for taking a look! It's live now on the site and new package release. Thanks again for reporting the issue! 🙏


md-select will trigger set method on computed element during initilization

Please check this simple code example, where set method of a v-model bounded on md-select is triggered during page initialization, however with standard select and option tag this won't happen.
http://codepen.io/anon/pen/yMaXeP?editors=1011

Steps to reproduce
Goto this then see the console output, set of userBirthdayMonth is triggered when page initializing
http://codepen.io/anon/pen/yMaXeP?editors=1011
Which browser?

Tried on chrome and firefox, both have this issue
Vue Material 0.71
Vue 2.1.10
What is expected?
set should not trigger during initialization.
(One can try to change the md-select and md-option tp select and option this the set method won't trigger during initialization)
What is actually happening?

Reproduction Link
http://codepen.io/anon/pen/yMaXeP?editors=1011

  <md-layout md-flex-xsmall="100" md-flex-small="33" md-flex-medium="20" md-flex="10" md-flex-offset="1">
      <md-input-container>
        Month
        <md-select name="month" id="month" v-model="userBirthdayMonth" >
          <md-option v-for="month in month_opt" v-bind:value="month">
            {{month}}
          </md-option>
        </md-select>
      </md-input-container>
  </md-layout>

Vue.use(VueMaterial)

Vue.material.registerTheme({
  default: {
    primary: {
      color: 'light-green',
      hue: 700
    },
    accent: 'red'
  },
  teal: {
    primary: 'blue',
    accent: 'pink'
  },
  purple: {
    primary: 'purple',
    accent: 'orange'
  }
})

var App = new Vue({
  el: '#app',
  data () {
    return {
      month: 1,
      month_opt: [1, 2, 3, 4]
    }
  },
  computed: {
    userBirthdayMonth: {
      get () {
        console.log('get method run')
        return this.month
      },
      set (month) {
        // when first loading the page, this method should not run
        // if we replace md-select, md-option to selec and option, then
        // this set method won't trigger during page init
        console.log('set method run - should not run when page load ...')
        this.month = month
      }
    }
  }
})

@change.native?

@3luyka what do you mean? I don't have change called in js code.

Indeed, I've found this issue as well.
I have a form with some md-selects, md-inputs, md-checkboxes. They are all using v-model on their computed props, with getters and setters. On page init or component init, the change event is triggered on all md-selects while it is not triggered on any of the other input components. All the input components are wrapped in the md-input-container element as well.
I am not manually catching the events so I don't have @change to change to @change.native, it seems that on page/component init, the md-select inputs are triggering their change event and setting the current value of the v-model data prop which I think is unexpected behavior compared to the other input elements.

Closing this issue as our focus is on the new 1.0.0 version.


UI: Setting page tweak for read-only option

For read-only option, don't show the Required or * in the UI since it's impossible to change anyway.
Also, make the mask color a bit lighter or the text darker, so people can see it easier.

Required is still shown in the description.
Also, for the read-only fields in the other pages, e.g. node page disk storage, make the text darker as well.

Fixed.


Fix for multiple android surfaces workaround

Commit 4ad06dc added a way to workaround the lack of support for
multiple Android surfaces, by giving the ability to choose which one to
create and render on, when a trace creates multiple surfaces/swapchains.
This commit adds a couple of checks for VK_NULL_HANDLE passed around as
surface handles that were missing causing assertion failures.

CI gfxreconstruct build # 1660 passed.

CI gfxreconstruct build queued with queue ID 22858.

CI gfxreconstruct build # 1666 running.

CI gfxreconstruct build # 1666 passed.

I am just realizing that in some cases surface can be VK_NULL_HANDLE
These cases are:

vkGetPhysicalDeviceSurfaceFormats(2)KHR and vkGetPhysicalDeviceSurfacePresentModes(2)KHR because of the VK_GOOGLE_surfaceless_query
vkDestroySurfaceKHR

I guess I'll need to add a check if the extension is active

CI gfxreconstruct build # 1669 running.

CI gfxreconstruct build # 1669 passed.

Decided to take a different approach. I gathered that it would be impossible to determine if we need to skip a function call because a surface is null because we skipped its creation or whether the application passed it when that google extension is active.
Please let me know if the change is too disruptive

CI gfxreconstruct build # 1684 passed.

CI gfxreconstruct build queued with queue ID 25198.

CI gfxreconstruct build # 1691 running.

CI gfxreconstruct build queued with queue ID 25212.

CI gfxreconstruct build # 1692 running.

CI gfxreconstruct build # 1692 passed.


Create Table of Contents

Create tale of contents to link to different sections of the Readme.

Do you need a table of contents for the README?


As non standard ports are difficult with the CPH University suggest to use a new cname admin.col.plus and setup apache to redirect to the right local ports as api.col.plus also uses port 80 on the same machine

[] setup admin.col.plus
[] setup apache
[] configure ws and cli DW for different ports

@MattBlissett could you direct admin.col.plus to the colapps machine please? collapse

Done.

great thanks!


Suggestion: Support Cell AccessoryView

When swipe the cell, the cell accessoryview position is fixed at the right end of cell.
So, in the updateCellState function of SWTableViewCell.m
The following logic could be added:
if(self.accessoryType == UITableViewCellAccessoryNone&&self.accessoryView)
....

ya figured out the same fix as the OP. Would be nice to fix it in repo...
line 619: if ((self.accessoryType != UITableViewCellAccessoryNone || self.accessoryView != nil) && !self.editing)

+1
Does anyone has a solution for that?

+1

PR here: https://github.com/CEWendel/SWTableViewCell/pull/352


[BUG] Fatal error: Unexpectedly found nil while unwrapping an Optional value in getSortedLocalizations() (iOS 17)

New issue checklist

[X] I have reviewed the README and documentation
[X] I have searched existing issues and this is not a duplicate
[ ] I have attempted to reproduce the issue and include an example project.

General information

Superwall version: 3.0.1
iOS version(s): 17.0 beta 1
CocoaPods/Carthage version (if applicable):
Xcode version: 15.0 beta 1
Devices/Simulators affected: iOS 17 simulator
Reproducible in the demo project? (Yes/No):
Related issues:

Describe the bug
I have built and ran an app with Superwallkit 3.0.1 in Xcode 15 for iOS 17 simulator. The app crashed with Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value on LocalizationLogic.swift:22 while unpacking the currentLocale.localizedString(forLanguageCode: localeId) when localeId = bgc.
It seems to be that either there should not be a need for Superwall to enumerate hundreds of locales, or that the enumeration should be coded defensively, with an if let instead of force unwrap.
Other Information

Scheme settings:

A repro code. When Locale.autoupdatingCurrent is cs_001, the currentLocale.localizedString(forLanguageCode: localeId) returns nil for bgc localeId.
When I do the same with localeCs = NSLocale(localeIdentifier: "cs_001"), it works.
So, Superwall enumeration now crashes the whole app on devices with Czech locale on iOS 17. I reported this to Apple, but this needs to be changed into a defensive code.
	func printLocales() {
		let localeIds = Locale.availableIdentifiers

		let currentLocale = Locale.autoupdatingCurrent
		let localeUs = NSLocale(localeIdentifier: "en_US")
		let localeCs = NSLocale(localeIdentifier: "cs_001")

		print("localeIdentifier, Current (\(currentLocale.identifier)), US, CS")
		localeIds.forEach { localeId in
			/// Get language
			let localizedLanguageCurrentLocale = currentLocale.localizedString(
				forLanguageCode: localeId
			)
			let localizedLanguageUs = localeUs.localizedString(
				forLanguageCode: localeId
			)
			let localizedLanguageCs = localeCs.localizedString(
				forLanguageCode: localeId
			)

			print("\(localeId),\"\(localizedLanguageCurrentLocale ?? "NO LOCALIZED STRING IN CURRENT LOCALE (\(currentLocale.identifier))")\",\"\(localizedLanguageUs ?? "NO US LOCALIZED STRING")\",\"\(localizedLanguageCs ?? "NO CS LOCALIZED STRING")\"")
		}
	}

Guys, I looked at how much swiftlint:disable:next force_unwrapping is used in Superwallkit.
! definitely feels like a code smell to me - each place is a potential crash site for the app.

Thanks for this report, I've fixed this on the develop branch now. I've also moved the localization manager to be lazily loaded only when debugging paywalls, which means that we now won't loop through the localizations every time the app is launched from a cold start. Good point about the disabling of force_unwrapping, I've reduced these instances as well as force_cast.

Thanks, this definitely happens for multiple languages, as I had crash reports from multiple people around the world. Will be happy to move back to official SDK once this is merged into some release.

Thanks, we've had some reports from others too since. Again keeping this open for visibility until it's merged into the next release.

Released in 3.0.2!


Docs: Fix broken links in package files

Fix broken links in package files.

Contains extraneous files, re-doing


[💡FEATURE REQUEST]: Add OpenTelemetry API support

Plugin
Server
I have an idea!
Please add OpenTelemetry support. With OpenTelemetry https://opentelemetry.io/, you don't have to add the support for each vendor. aka: NewRelic, Datadog, AppInsight, etc.

Hey @litan1106. Yeah, we have plans about adding a unified standard for the traces and metrics information. But, still, vendor-specific drivers have better support for its API. I'll put that ticket for the ~v2.10.0 RR version initially. Thanks for the proposal 👍🏻

repo for the middleware: https://github.com/roadrunner-server/otel

Hello, I'm a maintainer of opentelemetry-php. I love the idea of having otel support in roadrunner.
I'd be happy to help/test/collaborate to try to ensure that code instrumented with the php library plays nicely with RR's implementation. Also as an FYI, there is a PSR proposal being worked on for tracing

Hey @brettmc, nice to meet you 👋🏻 . That's great, thank you very much 👍🏻 I plan to start working on that plugin somewhere at the end of April (Go part). That would be nice if you could review the otel PHP part or test the beta version of the RR; when it is ready ⚡

Updates: In the initial implementation, RR via otel HTTP middleware will support the following exporters:

All who support the OTLP protocol (datadog, new_relic, etc).
stdout exporter.
Zipkin

I have plans to add support for the OTLP protocol also to the gRPC and jobs plugins (likely in the v2.11)

If I were to instrument PHP code using opentelemetry-php, how would I get access to the parent trace id (probably the http span in the image above) from RR? I think that's critical to enable the distributed trace part of the otel spec.
Also, either RR or opentelemetry-php (or userland code which is sending outgoing http requests) would need to be responsible for injecting HTTP trace headers, distributed tracing of services further down the line.

In the next alpha/beta release you'll be able to get the spans from the OTLP http request field. At the moment, it exists only on the RR side, but the idea is to use opentelemetry-php to extend these spans inside the PHP code.
OTLP structure field looks like this: {"TraceID":"5d7d1faf902d6e0fa50e98e0b0a83454","SpanID":"30f396620dab37d0","TraceFlags":"01","TraceState":"","Remote":false}

That sounds like what otel calls "trace context propagation" - the data an otel trace implementation passes along that is understood by all other implementations. e.g PHP's implementation of the feature is https://github.com/open-telemetry/opentelemetry-php/blob/main/src/API/Trace/Propagation/TraceContextPropagator.php - note that it's agnostic as to where the info comes from, provided the keys match.
I think that if the OTLP fields above were injected into the http request via https://github.com/open-telemetry/opentelemetry-go/blob/main/propagation/trace_context.go#L47 using w3c tracecontext headers, then PHP code doesn't need to be aware of whether it's a RR request or not. Conceptually RR is a separate service in a distributed system, which I think fits in with this design as RR is exporting its own traces.
IMO this is more closely aligned to spec (although you're not obligated to follow the spec).

That sounds like what otel calls "trace context propagation"

This is a little bit different. I meat OTEL structure field, from the Go's POV this is SpanContext in the docs. They are similar from the information POV, but has a different structure.

I think that if the OTLP fields above were injected into the http request via https://github.com/open-telemetry/opentelemetry-go/blob/main/propagation/trace_context.go#L47 using w3c tracecontext headers, then PHP code doesn't need to be aware of whether it's a RR request or not. Conceptually RR is a separate service in a distributed system, which I think fits in with this design as RR is exporting its own traces.

Yeah, you're right. We use propagators as well: https://github.com/roadrunner-server/otel/blob/master/plugin.go#L102. My bad, I forgot to mention that. That's information duplication (I mean OTEL structure field and w3c headers), but this is an early draft. I wanted to try different ways to deliver the information to the PHP workers. Thanks for noting that 👍🏻
We may agree on using only w3c propagators, so the PHP worker requires no modifications from the PHP worker side. Only get the needed headers, process and return them in the response.

Ok, guys, this is the almost final configuration version:
http:
  address: <IP_ADDRESS>:15389
  middleware: [gzip, otel] # otel middleware should be applied first in the line (from right to left). Middleware order is: `request` --> `otel` -> `gzip` -> `http-plugin` -> `PHP worker`.
  pool:
    num_workers: 10

otel:
  insecure: false # HTTP OR HTTPS
  compress: true # use gzip compression
  client: http # http client (connect via http) or grpc
  custom_url: "" # applied only to the http client, if you use a non standard endpoint to receive traces
  exporter: otlp # otlp (datadog, new_relic (who support the OTLP protocol)), zipkin or stdout
  service_name: rr_test # your app name
  service_version: 1.0.0 # your app version
  endpoint: otlp.eu01.nr-data.net:4318 (new_relic) # zipkin - http://localhost:9411/api/v2/spans
  headers:
    - api-key: xxx (used for the new_relic)

The v2.10.0-beta.1 will be available early next week.
All the tracing data as we agreed (w3c) will be in the request headers and can be accessed w/o any modifications on the PHP worker's side.
I'll also provide a docker-compose.yaml with preconfigured zipkin endpoint. So, to test, you'll need to exec docker compose up and start rr via ./rr server -c .rr.yaml (as usual).
CC: @brettmc

@brettmc Here you are: https://github.com/roadrunner-server/roadrunner/releases/tag/v2.10.0-rc.2
With pre-release notes: https://github.com/roadrunner-server/roadrunner/releases/tag/v2.10.0-rc.1

Hi @rustatian - it integrates well with opentelemetry-php!

My only observation is that the incoming trace parent is the "gzip" span, but I would have thought the "http" one would make more sense (ie, in the above screenshot, both "rr/http" and "php/root" have "rr/gzip" as a parent span).
My example is available in github if you wanted something you can run quickly: https://github.com/brettmc/rr-otel-demo

Hey @brettmc 👋🏻. Thank you very much for your help. I'll investigate the issue with the wrong parent span.

@brettmc Found the issue, fixed:

Now everything looks pretty 😄

One note on how-to-use env variables:
Option1:
server:
  command: "php ../rr-e2e-tests/php_test_files/otel_worker.php"
  env:
    - OTEL_SERVICE_NAME: php
    - OTEL_TRACES_EXPORTER: otlp
    - OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
    - OTEL_EXPORTER_OTLP_ENDPOINT: http://<IP_ADDRESS>:4318
    - OTEL_PHP_TRACES_PROCESSOR: simple
  relay: pipes

Option2: (via docker-compose):
    environment:
      OTEL_SERVICE_NAME: php
      OTEL_TRACES_EXPORTER: otlp
      OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
      OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4318
      OTEL_PHP_TRACES_PROCESSOR: simple

Both are valid.

@brettmc You can try v2.10.0-rc.3: https://github.com/roadrunner-server/roadrunner/releases/tag/v2.10.0-rc.3

@rustatian - rc3 works perfectly in my testing. Thankyou so much!

Thank you, @brettmc; I really appreciate everything you've done 🤝

@rustatian - I think I have found one more issue. The RR otel plugin seems to disregard an incoming traceparent header and always generates a new trace, with no parent. In order for traces in a distributed system to be correctly related, the trace id and parent id should be extracted from the traceparent header, if available (and valid). See https://www.w3.org/TR/trace-context/#trace-id

@brettmc hmm.. yeah, good catch. I guess this is my issue: https://github.com/roadrunner-server/otel/blob/master/middleware.go#L28

@brettmc Could you please try: https://github.com/roadrunner-server/roadrunner/releases/tag/v2.10.0-rc.6

@rustatian Fantastic, rc6 works as expected for distributed traces!

@rustatian Fantastic, rc6 works as expected for distributed traces!

Great, thank you ⚡

Ok, the last step is finished; all middleware now supports otel headers and propagators.


proofs: multiproof verification

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

#156  👈
#155
master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @gabriele-0201 and the rest of your teammates on  Graphite


Why does the compilation freeze after importing go-sqlite3

I used gin

@mattn

Is it actually frozen, or just slow? It can take a while for your computer to build this library due to the C code.
Also, in the future, please do not share code as an image. Use a code block like so:
```go
package main

...
```

It is frozen

Is it actually frozen, or just slow? It can take a while for your computer to build this library due to the C code.
Also, in the future, please do not share code as an image. Use a code block like so:
```go
package main

...

When I remove go-sqlite3, the project is programmed fine

I think I know what the problem is, thanks


Where to download train.csv

Hi,
Thank you for creating the benchmark dataset.
I found the link (https://www.kaggle.com/datasets/tianqingfang/ckbp-emnlp2021) doesn't work anymore. Where can we download train.csv now?
Thanks for your help!

Could you try this link again? Should be working now.

Work very well. Thank you for your quick reply!


how to develop ios app to split the images into two (left and right) for vr

hi im completely new to ios.how to develop an ios app that chooses the image from gallery and take picture from camera and then convert it into (two splits i.e left and right) for vr view.
im doing a project so please do comment here the links.i searched in net. it is not correct. so please do reply

Sorry haven't seen anything like this


clean content

after unpack ,should we clean content  to save disk space ?

Can you please give an example and explain which content needs to be cleaned?

For CRI you can use the discard_unpacked_layers option to remove content after it has been unpacked. We don't have this feature in ctr, however any other client can do this by stripping the reference labels on manifests to layers.

tks, @dmcgowan ,
btw, after discard_unpacked_layers  , if download image again, containerd will download content again or use upacked snapshot directly ?

@timchenxiaoyu it will use the unpacked snapshot

@dmcgowan ，as you said containerd will use  unpacked snapshot, why not set discard_unpacked_layers to true ? switch true can save disk space.

We recommend setting it to true for most CRI use cases. The cases where you don't want to set it is when you are using the content after pull, such as for late unpacking, building, or redistributing.

@dmcgowan  thank you very much。 btw， what is  redistributing  ？


Can't insert a new entry in my database

Hello,
I have a problem when I want to do an "INSERT INTO" query to my SQL server it does nothing. I've tested with 1.11.2 - 1.12.1 - 1.12.2 Minecraft's version but it does not work :/ I can do a "SELECT" query it works but not an insert ... In the past it worked perfectly (in another server).
No errors in the console. I tested my server's mysql user and root user.
Informations:
Skript dev35b (tested with dev34)
Skript code :
execute "INSERT INTO `players` (`name`, `uuid`, `rank`, `works`, `friend_invitation`, `register_date`, `last_seen`, `last_ip`) VALUES (%name of player%, %UUID of player%, 'Joueur', '', 'allow', %now%, %now%, %ip of player%)" in {sql}
Plugins: Skript, skript-db, skript-mirror
Thanks for your help :)

Does the last database error contain anything after executing that statement?

Hello, do you have anything new about the problem ?

Skript's date class cannot be stored directly in a database. I'll add a way to convert Skript dates into SQL dates.

Yeah, it works perfectly when I convert date to text :)

any updates?


How to run julius with only text as output?

Hello. Is there a way to run julius with an option, which actually would make it print just best sentence as an output? I run julius with that command: "julius -C julius.jconf -dnnconf dnn.jconf -input mic" and what I get is

Recognition: 2nd pass (RL heuristic best-first)
STAT: 00 _default: 14715 generated, 4565 pushed, 339 nodes popped in 175
ALIGN: === word alignment begin ===
sentence1:  PTAK
wseq1:  PTAK
phseq1: sil | p t a k | sil
cmscore1: 0.683 0.072 1.000
score1: 65.000496
=== begin forced alignment ===
-- word alignment --
id: from      to     confidence        unit
[   24676    24676]  0.682506  	[]
[   24677    24765]  0.072064  PTAK	[PTAK]
[   24766    24847]  1.000000  	[]
current base = 24676re-computed AM score: 142.784332
=== end forced alignment ===

In this example, I wish to get just "PTAK". I need that, because I want to send sentence to other program, which is supposed to print me what I got. I don't know much about speech recognition and I am not really pro at programming stuff.
Second question is: is there a possibility to turn off Julius automatically after it sends me first sentence? I read a lot about it last days, since I couldn't find anything for polish converting speech to text on linux offline. I would really appreciate answer, which would solve my problems.
Third question: are there some options, which would convert single word without context better?

First question: option -quiet turns off almost all output and just outputs the result.  See Options document for details.
Second question: Using adintool audio front end and use -autopause option for the adintool will do the job:
Term 1:
% adintool -in mic -out adinnet -autopause
Term 2:
% julius -C ... -input adinnet

The adintool will stop just after sending the first input to Julius.  Note that the paused adintool should be resumed from Julius via socket contol.  Test the resume using module mode like this:
Term 1:
% adintool -in mic -out adinnet -autopause
Term 2:
% julius -C ... -input adinnet -module
Term 3:
% jclient.py
(after pause, type below and hit enter to resume audio input)
RESUME

hello,
I tried running julius with -quiet as  /home/zeus/gitRepoClones/julius/julius/julius -C julius.jconf -dnnconf dnn.jconf -quiet but it still prints everything.
Any solutions to this

Did you investigate whether the position of the -quiet in the command is important? Normally one would expect to see global options immediately after the call to julius, that is before the -C and -dnnconf pairs?

I tried it but no improvements

Well, after playing around with it for a while, it seems to me that this tool is completely useless for any particular application except for academic and research purposes.
You could at least output recognized words in an XML or JSON format for developers to be able to use it.

I think this is quite offensive to the effort of the creator - Mr Lee. In my opinion this is the best decoder available out there. It has been used extensively in commercial environments. Just because you do not make the effort of spending time with it does not make it useless.

@LivingScripts A little contribution of mine. After having redirected the output to a text file, say "speech.txt", you can use the attached script I have written in python language to filter most of the verbose text and generate a new file, for example "extract.txt", containing only the words of your interest. Obviously, you must have python installed, then you have to copy the script to the same directory where "speech.txt" (or whatever name you have chosen), change the script extension from .txt to .py, inside the script modify the input and output file names at your own discretion, launch it with command python extract_words.py. It's very fast.
extract_words.txt

I've switched to vosk.  It works much better.  https://github.com/MikeyBeez/Juliet


[feature/#271] Create UiState for BookmarkFilters to Encapsulate Business Logic

Issue

close #271

Overview (Required)

The image is this 👀
https://github.com/DroidKaigi/conference-app-2023/blob/companion_feature/%23271/screenshot-diff/app-android/build/outputs/roborazzi/io.github.droidkaigi.confsched2023.sessions.component_null_DefaultGroup_BookmarkFiltersPreview_0_null_compare.png


Added extra blocking for h, w, c and k for conv_bwd (similarly to conv_fwd)

Summary:
Adding blocking for h, w, c and k to conv_bwd, in the same way it works for conv_fwd (but switching C and K)

@egeor please have a look and comment (I think I have an issue visible with w_block != 1 with this code ported to PT extensions so not sure if I missed something here or in my PT extension code).


Standalone mostly reincarnated.

Support out of source standalone build:

  mkdir mkf-build/; cd mkf-build
  ..../MkFitCore/standalone/configure <path-to-directory-containing-RecoTracker>
  make -j 666

JSON generation works.
Matriplex autogen commands are not yet run.
Move commented out code from MkBuilder to MkFitCMS/standalone/StdStandaloneSeqs.

Does the make produce standalone code that can run our old benchmarks or is this still a work in progress?

No, just mimi. The prepare seed and event/mkbuilder based functions used in besthit/standard/ce buildtests need to be reviews / fixed / moved somewhere. The new StdStandaloneSeqs is probably a good place.


Centering windows doesn't take scale_factor_override into account

          This doesn't take into account `scale_factor_override` (maybe it shouldn't? I'm trying to write the documentation for `WindowResolution` in https://github.com/bevyengine/bevy/pull/8858 and I have a hard time understanding how it works, or what is a bug and what is intended behavior)

For example this doesn't spawn at the center of the screen (when default scale_factor is 1., before and after this PR so not a regression at least):
Window {
    position: WindowPosition::Centered(MonitorSelection::Primary),
    resolution: WindowResolution::new(500., 300.).with_scale_factor_override(2.0),
    ..default()
}

Originally posted by @Selene-Amanita in https://github.com/bevyengine/bevy/issues/8903#issuecomment-1599006929

As discussed in that thread, it's unclear what the intended behavior should be, and if this is even a bug. Splitting it out here to track though.


[Feature]: Increase GitHub Action Timeout

Please check the following

[x] Do the tests still pass? (see Run the Tests)
[x] Is the code formatted properly? (see Linting (Formatting))
For New Features:

[x] Have tests been added to cover any new features or fixes?
[x] Has the documentation been updated accordingly?

Please describe additional details for testing this change

@itsalaidbacklife despite the failure it’s just a timeout increase, would you merge it anyway?


[material-ui][Modal] Enhanced Modals Manager with Multi-step Modal Support and Confirm Modal Component

Summary
Introduce a feature to enhance the issue formatting for the modals manager. This feature aims to create a centralized modals manager with the ability to handle the state of multi-step modals efficiently.
Examples
Refer to the Material Design specification or other implementations for inspiration on the expected behavior. Screenshots of the proposed implementation or links to similar implementations can also be provided for clarity.
Example Implementation: Mantine Modals Manager
Motivation
The objective of this feature is to streamline the management of modals within the application. By centralizing the modals manager, developers can efficiently handle the state of multi-step modals, enhancing the user experience and facilitating smoother interactions. Additionally, introducing a confirm modal component with built-in confirm and cancel buttons will improve the user flow for actions requiring confirmation. Furthermore, by clarifying that dynamic content is not supported when using the modals manager, users can make informed decisions about their implementation strategy, ensuring a seamless integration with the existing codebase.
Search keywords: modal
Search keywords:

Could this be scheduled for the v7 release?


introducing struct ble_gatt_cpfd containing a member named 'namespace' causes issue when compiled using C++ compiler

In C++, namespace is a reserved keyword, and cannot be used to name variables.
In code introduced in commit 0273e0e83, a struct is introduces which has a member called namespace.
I noticed the problem when trying to compile the esp-matter light example. This uses the esp-idf repo, which recently updated the nimble submodule to include the commit 0273e0e83, resulting in the example no longer building.

struct was added to nimble/host/include/host/ble_gatt.h

Hi @MarleenDev  , thanks for pointing this. Please try attached patch which should fix the issue.
0001-update-variable-name-to-avoid-using-keyword.txt

Changes merged, closing


Updating device failed

I was using usbipd to redirect the USB device from Windows into the WSL2 environment in order to run factory_reset.sh. I recognized that this might have some risks beyond doing it natively in Windows, but setting up the environment needed on Windows was something I wanted to avoid if possible. I used a very high quality USB-C cable that I typically use for high speed data transfers from my Sony camera.
An interesting consequence of usbipd is that you have to reattach the USB device to WSL2 every time it disconnects. The script would get through one phase, then fail because the device was gone. So, for the sake of simplicity, I wrote a three line BAT script to infinitely keep reattaching the device to WSL2, which resolved this issue.
For reasons I haven't figured out, it was able to flash the loader, and xous.img, but it timed out while writing soc_csr.bin. It erased it successfully, but then only wrote 35% before erroring out.
Unfortunately, this has left the device in a state where factory_reset.sh -s complains that... Could not find a valid csr.csv descriptor on the device, aborting!.
I see in the Wiki that I could go through the full Failsafe update, but that legitimately looks like a lot of hassle. I'm sure I'll get around to it eventually if needed, but...
My actual question: I am curious whether the device is in a state that actually requires a Failsafe update, or whether the factory_reset.sh script simply doesn't handle this case yet? The device actually boots up into the new firmware (it has the updated GUI that wasn't present in the factory build), and I can issue commands on the device... nothing seems soft-bricked. It feels like the factory_reset.sh script just needs to barge on and ignore the lack of a csr.csv descriptor in a case like this, but I've been using the device for a total of like 30 minutes, so I'm definitely speaking from a place of ignorance.
Full output of the time that it failed:
$ sudo ./factory_reset.sh -s
Updating to latest stabilized release
--2022-03-18 17:28:01--  https://ci.betrusted.io/releases/latest/loader.bin
Resolving ci.betrusted.io (ci.betrusted.io)... <IP_ADDRESS>
Connecting to ci.betrusted.io (ci.betrusted.io)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1282120 (1.2M) [application/octet-stream]
Saving to: ‘/tmp/loader.bin’

/tmp/loader.bin               100%[=================================================>]   1.22M   575KB/s    in 2.2s

2022-03-18 17:28:05 (575 KB/s) - ‘/tmp/loader.bin’ saved [1282120/1282120]

Using SoC v0.9.7-0-ga5d09b9 registers
Halting CPU.
Programming loader image /tmp/loader.bin
ID code bytes 1-2: 0x8080c2c2
ID code bytes 2-3: 0x3b3b8080
Erasing 100% (1282120 of 1282120) |##############################################| Elapsed Time: 0:00:04 Time:  0:00:04
Erase finished
Writing 100% (1282120 of 1282120) |##############################################| Elapsed Time: 0:00:26 Time:  0:00:26
Write finished
Skipped verification at user request
Resuming CPU.
Resetting SOC...
waiting for device to reboot
--2022-03-18 17:28:42--  https://ci.betrusted.io/releases/latest/xous.img
Resolving ci.betrusted.io (ci.betrusted.io)... <IP_ADDRESS>
Connecting to ci.betrusted.io (ci.betrusted.io)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6159800 (5.9M) [application/octet-stream]
Saving to: ‘/tmp/xous.img’

/tmp/xous.img                 100%[=================================================>]   5.87M   979KB/s    in 6.1s

2022-03-18 17:28:50 (979 KB/s) - ‘/tmp/xous.img’ saved [6159800/6159800]

Using SoC v0.9.7-0-ga5d09b9 registers
Halting CPU.
Programming kernel image /tmp/xous.img
ID code bytes 1-2: 0x8080c2c2
ID code bytes 2-3: 0x3b3b8080
Erasing 100% (6159800 of 6159800) |##############################################| Elapsed Time: 0:00:23 Time:  0:00:23
Erase finished
Writing 100% (6159800 of 6159800) |##############################################| Elapsed Time: 0:02:04 Time:  0:02:04
Write finished
Skipped verification at user request
Resuming CPU.
Resetting SOC...
waiting for device to reboot
--2022-03-18 17:31:22--  https://ci.betrusted.io/releases/latest/soc_csr.bin
Resolving ci.betrusted.io (ci.betrusted.io)... <IP_ADDRESS>
Connecting to ci.betrusted.io (ci.betrusted.io)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2621440 (2.5M) [application/octet-stream]
Saving to: ‘/tmp/soc_csr.bin’

/tmp/soc_csr.bin              100%[=================================================>]   2.50M   870KB/s    in 2.9s

2022-03-18 17:31:27 (870 KB/s) - ‘/tmp/soc_csr.bin’ saved [2621440/2621440]

Using SoC v0.9.7-0-ga5d09b9 registers
Halting CPU.
Programming SoC gateware /tmp/soc_csr.bin
ID code bytes 1-2: 0x8080c2c2
ID code bytes 2-3: 0x3b3b8080
Erasing 100% (2621440 of 2621440) |##############################################| Elapsed Time: 0:00:09 Time:  0:00:09
Erase finished
Writing  35% (936704 of 2621440) |################                               | Elapsed Time: 0:00:19 ETA:   0:00:34Traceback (most recent call last):
  File "./usb_update.py", line 635, in <module>
    main()
  File "./usb_update.py", line 585, in main
    pc_usb.flash_program(locs['LOC_SOC'][0], image, verify=verify)
  File "./usb_update.py", line 356, in flash_program
    status = self.flash_rdsr(1)
  File "./usb_update.py", line 154, in flash_rdsr
    return self.peek(self.register('spinor_cmd_rbk_data'), display=False)
  File "./usb_update.py", line 37, in peek
    numread = self.dev.ctrl_transfer(bmRequestType=(0x80 | 0x43), bRequest=0,
  File "/usr/local/lib/python3.8/dist-packages/usb/core.py", line 1082, in ctrl_transfer
    ret = self._ctx.backend.ctrl_transfer(
  File "/usr/local/lib/python3.8/dist-packages/usb/backend/libusb1.py", line 893, in ctrl_transfer
    ret = _check(self.lib.libusb_control_transfer(
  File "/usr/local/lib/python3.8/dist-packages/usb/backend/libusb1.py", line 602, in _check
    raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out
Writing 100% (2621440 of 2621440) |##############################################| Elapsed Time: 0:00:22 Time:  0:00:22

Attempting to run the command again:
$ sudo ./factory_reset.sh -s
Updating to latest stabilized release
--2022-03-18 17:55:23--  https://ci.betrusted.io/releases/latest/loader.bin
Resolving ci.betrusted.io (ci.betrusted.io)... <IP_ADDRESS>
Connecting to ci.betrusted.io (ci.betrusted.io)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1282120 (1.2M) [application/octet-stream]
Saving to: ‘/tmp/loader.bin’

/tmp/loader.bin               100%[=================================================>]   1.22M   583KB/s    in 2.1s

2022-03-18 17:55:27 (583 KB/s) - ‘/tmp/loader.bin’ saved [1282120/1282120]

Could not find a valid csr.csv descriptor on the device, aborting!

If you haven't cut power, try running this sequence of commands:
wget https://ci.betrusted.io/$REVISION/soc_csr.bin -O /tmp/soc_csr.bin
./usb_update.py --soc /tmp/soc_csr.bin --force
rm /tmp/soc_csr.bin

This should get your soc_csr.bin into a good state by forcing the write.  Sorry for the hassle...I'll be able to respond more later today, on the road at the moment.

I haven't cut power, so I'm happy to try that out. Unfortunately, the result seems the same.
After wget-ing the file successfully:
$ sudo ./usb_update.py --soc /tmp/soc_csr.bin --force
Could not find a valid csr.csv descriptor on the device, aborting!

I could certainly comment out the digest check that is causing the script to fail, if you think that's a good idea, but I don't want to mess things up by being overly eager if there's a chance of avoiding the failsafe method.

Humm... I'm on mobile right now. it would not hurt your device to leave it plugged into USB, the charger is autonomous from the soc core. I can respond properly in about 4 hours.
can you try putting the '--force' argument first in the argument list? it should not be position sensitive but it's also weird its getting stuck there. if you look inside the python script it should be using a backup set of register locations embedded in the script instead of looking for the csv file embedded in the device when the force argument is specified...
thanks,
-b.
On March 19, 2022 8:42:31 AM GMT+08:00, Josh Leverette @.***> wrote:

I could certainly comment out the digest check that is causing the script to fail, if you think that's a good idea, but I don't want to mess things up by being overly eager if there's a chance of avoiding the failsafe method.
--
Reply to this email directly or view it on GitHub:
https://github.com/betrusted-io/betrusted-wiki/issues/20#issuecomment-1072905451
You are receiving this because you commented.
Message ID: @.***>

The control flow path is something like this:
def main():
    parser = argparse.ArgumentParser(description="Update/upload to a Precursor device running Xous 0.8/0.9")
    parser.add_argument(
        "--soc", required=False, help="'Factory Reset' the SoC gateware. Note: this will overwrite any secret keys stored in your device!", type=str, nargs='?', metavar=('SoC gateware file'), const='../precursors/soc_csr.bin'
    )
    # [...]

    # !!! this is where things go wrong, it calls `load_csrs()` before checking the `force` argument
    pc_usb.load_csrs() # prime the CSR values
    if "v0.8" in pc_usb.gitrev:
        # [...]
    elif "v0.9" in pc_usb.gitrev:
        # [...]
    elif args.force == True:
        # try the v0.9 offsets
        locs = {
           "LOC_SOC"    : [0x00000000, "soc_csr.bin"],
           "LOC_STAGING": [0x00280000, "pass"],
           "LOC_LOADER" : [0x00500000, "loader.bin"],
           "LOC_KERNEL" : [0x00980000, "xous.img"],
           "LOC_WF200"  : [0x07F80000, "pass"],
           "LOC_EC"     : [0x07FCE000, "pass"],
           "LOC_AUDIO"  : [0x06340000, "short_8khz.wav"],
           "LEN_AUDIO"  : [0x01C40000, "pass"],
           "LOC_PDDB"   : [0x01D80000, "pass"],
        }
    else:
        print("SoC is from an unknow rev '{}', use --force to continue anyways with v0.9 firmware offsets".format(pc_usb.load_csrs()))
        exit(1)

```python
    def load_csrs(self):
        LOC_CSRCSV = 0x20277000 # this address shouldn't change because it's how we figure out our version number

        csr_data = self.burst_read(LOC_CSRCSV, 0x8000)
        hasher = hashlib.sha512()
        hasher.update(csr_data[:0x7FC0])
        digest = hasher.digest()
        if digest != csr_data[0x7fc0:]:
            print("Could not find a valid csr.csv descriptor on the device, aborting!")
            exit(1)
            # !!! then, we exit the program here because the csr.csv descriptor is invalid
        # [...]

I'll definitely leave the Precursor plugged in. It's already 8pm here, so I might be asleep before you're properly online, but we'll see. I definitely appreciate you getting back to my question as quickly as you have.

I just realized that your problem is not that the programming script can't find the csr area, it's that they don't exist because they got erased. I will need some time to replicate your problem and test a patch. if you can keep in plugged in overnight I will do my best to get you a tested hot fix for this by the time you wake up.
basically I will bundle a full copy of the intended csr/csv set and some sanity checks as the work around to your problem.

Ok, I hopefully have a fix for you.
Please pull the latest main and run the following commands:
wget https://ci.betrusted.io/releases/latest/soc_csr.bin
python .\usb_update.py --soc soc_csr.bin --force --override-csr .\csr_data_0.9.7.bin

If this is successful, clean up the soc_csr.bin file with rm soc_csr.bin.
What this should do is tell the updating script to ignore whatever is inside the FLASH, and use this pre-specified copied of the CSRs. Based on the logs it looks like you previously had 0.9.7 in there, so this should match what you're running on in the CPU. If you get some weird error, maybe try 0.9.5...because that's what the device shipped with. But I tested this just now on a device where I aborted the burn after an erase, and was able to replicate your error and also fix the error.
I've also redone the factory update script so that the device boot is atomic with the update by partially erasing the loader, leaving the device in a "bad signature" state which holds the CPU in a loop so it doesn't do naughty things like try to watchdog reset itself because the FPGA is inconsistent with the OS, and only after all the artifacts are burned does it simultaneously burn the FPGA and a good loader copy in the same invocation of the script.
Anyways -- I hope this gets you out of your pickle. Sorry for the troubles.

Ok, that worked great, as far as I can tell!
After that, I performed the factory_reset.sh -s again, which succeeded. Then I used a paperclip as instructed, then applied power to boot it up again. After that, I ran ecup auto on device, which seemed to start applying the staged updates. I looked away for a minute and looked back to see it had a blank screen and was unresponsive, which was mildly confusing, but if I've learned anything about this device... connecting it to power is usually the next step, so I did that and it started up. Since I was unsure if it actually applied successfully, I ran ecup auto again expecting it to instantly say there was no new update to apply, but it went through the process again, so I watched more closely and saw it say at the end that it was shutting down. During the ecup auto, it printed out that I should run ecup reset, so after booting up again, I ran that. Then I used the paperclip again for good measure and applied power again.
Everything seems fine, so I believe it all worked. (As you may notice that I used the paperclip twice, I thought the instructions there were a little confusing as to when you're supposed to use it. After running ecup auto, I believe the correct time to use it is after ecup auto and ecup reset, but I'm not sure if ecup reset is even needed.)
On an unrelated note, just a quick question: one thing I find confusing is that there's only a sleep mode, no menu item to shut down completely. Since this is a development kit, there's a good chance that I will not be using it continuously forever, which leaves the option of letting it just run out of battery in a drawer when I'm not actively using it, or opening it up and physically disconnecting the battery, or... maybe the paperclip turns the device off completely?

I actually test under WSL2 and ubuntu, so, probably more likely this is indicative of a shortcoming of my test environment than anything else. Thanks for confirming it worked for you. i'm going to close this for now, if you have a new issue, please feel free to open a new issue!


Deprecated module github.com/golang/protobuf being used

What version of protobuf and what language are you using?
Version: v1.31.0
Lang: Go
What did you do?
Deprecated module github.com/golang/protobuf.
Deprecation notice: Use the "google.golang.org/protobuf" module instead.
What did you expect to see?
No deprecated module used
What did you see instead?
Deprecated module used
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
"C:\Program Files\Go\bin\go.exe" mod why -m github.com/golang/protobuf #gosetup
# github.com/golang/protobuf
google.golang.org/grpc/credentials
github.com/golang/protobuf/proto

Anything else we should know about your project / environment?
No

Looking up where the dependency occurs demonstrates that this is a known and expected condition:
import (
	// Ensure that any program using "github.com/golang/protobuf"
	// uses a version that wraps this module so that there is a
	// unified view on what protobuf types are globally registered.
	_ "github.com/golang/protobuf/proto"
)

I’m going to go ahead and just directly close this issue since this is known and expected, and there is no actionable response. We will not be removing the dependency.


Cannot read property 'length' of undefined

This issue occurred when trying to remove an element that was dynamically added. This plunkr demonstrates the issue. For demonstration sake (as seen in #48), the off-click expression on the <p> element has been emptied.
Flow:
Click the 'Add Menu button'
Click the button to 'Toggle menu visible'
Click the 'Remove' button in the menu.
Error shows up as 'TypeError: Cannot read property 'length' of undefined' on line 132:
if (OffClickFilterCache[filter].length > 1) {

hey @TheSharpieOne I'm also encountering this issue and I think it's because you need to push the latest changes through to bower (sorry I'm not sure what the correct terminology is there.) From the home page of this repo I can see that you updated the /src files 7 days ago, but the /dist files haven't been updated in several weeks. Thanks!

@TheSharpieOne @Ricardo-Marques Could a new release be pushed out, please?

Released v1.0.8


BUG: Fix PySide6 compatibility

So this is a problem:
$ python -c "from IPython.external.qt_for_kernel import QtGui; print(QtGui)"
<module 'PySide6.QtPrintSupport' from '/home/larsoner/python/virtualenvs/base/lib/python3.12/site-packages/PySide6/QtPrintSupport.abi3.so'>

The source file for qt_for_external says that it's kept for backward compat, so perhaps no surprise it doesn't work. I don't see any reason we need to triage based on being in ipython or not, though, given everything else comes from qtpy earlier anyway.
@tkoyama010 you added this in https://github.com/pyvista/pyvistaqt/pull/40/files#diff-bcab1285ff8ba2b1a25b18d87cd02a09eca4194b83196ba0c2b7939c76393d01R65, any recollection why it was necessary?

... I suggest we merge this and cut a bugfix 0.11.1 for this. I added a release.yml to remove all the dependabot PRs from the autogenerated release notes because they're unhelpful.

I also opened https://github.com/ipython/ipython/issues/14463 but I don't think we should need IPython for this in any case

@tkoyama010 you added this in https://github.com/pyvista/pyvistaqt/pull/40/files#diff-bcab1285ff8ba2b1a25b18d87cd02a09eca4194b83196ba0c2b7939c76393d01R65, any recollection why it was necessary?

It is not particularly impressive and can be removed. I apologize for not leaving a clear comment.


[AQT] Failed to move compiled module with AQT to a different device

To reproduce
from torchao import quantize_
from torchao.quantization import int8_weight_only
from torch import nn
import torch

linear = nn.Linear(1024, 1024)
quantize_(linear, int8_weight_only())
linear.cuda()
linear.compile()
linear(torch.randn(1, 1024, device="cuda"))
linear.cpu()  # this will error
linear.cuda()  # this will also error

Error
Traceback (most recent call last):
  File "/home/xxx/python3.10/site-packages/torch/nn/modules/module.py", line 945, in _apply
    torch.utils.swap_tensors(param, param_applied)
  File "/home/xxx/python3.10/site-packages/torch/utils/__init__.py", line 51, in swap_tensors
    raise RuntimeError("Cannot swap t1 because it has weakref associated with it")
RuntimeError: Cannot swap t1 because it has weakref associated with it

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/xxx/debug.py", line 11, in <module>
    linear.cpu()
  File "/home/xxx/python3.10/site-packages/torch/nn/modules/module.py", line 1118, in cpu
    return self._apply(lambda t: t.cpu())
  File "/home/xxx/python3.10/site-packages/torch/nn/modules/module.py", line 949, in _apply
    raise RuntimeError(
RuntimeError: _apply(): Couldn't swap Linear.weight

This seems like a problem for tensor subclass + compile in general, not limited to AQT. Even doing compile(disable=False) still has this error.
cc: @jerryzh168
torchao: 0.7.0+git26648c2c (install from source)
pytorch: tested with 2.5.0 and 2.6.0.dev20241102+cu124

@jerryzh168 May I know if anyone is looking at this issue? It seems to affect tensor subclass + compile in general, so maybe I can open an issue in core instead?

@gau-nernst not right now I think, yeah I feel it makes sense to open in core.
I did remember swap_tensor can't work for a normal tensor and a tensor subclass tensor, but not sure if both are tensor subclass tensor