Dashboard Snowflake Query Costs

Related to #167 , create a dashboard/monitoring (and possibly alerting) for Snowflake costs that focuses on costs of queries. The idea is mainly to (a) catch errant dbt models that might be wicked expensive; (b) help with more granular cost estimates for projects; (c) help determine when it's cost-effective to optimize dbt model performance. Snowflake, thankfully, provides a wealth of information about  query execution history and metering.
An approach to this is described here: https://select.dev/posts/cost-per-query#complete-sql-query
(You can also use their product for this)
Query, copied in case it disappears:
WITH
filtered_queries AS (
    SELECT
        query_id,
        query_text AS original_query_text,

        -- First, we remove comments enclosed by /* <comment text> */
        REGEXP_REPLACE(query_text, '(/\*.*\*/)') AS _cleaned_query_text,
        -- Next, removes single line comments starting with --
        -- and either ending with a new line or end of string
        REGEXP_REPLACE(_cleaned_query_text, '(--.*$)|(--.*\n)') AS cleaned_query_text,
        warehouse_id,
        TIMEADD(
            'millisecond',
            queued_overload_time + compilation_time +
            queued_provisioning_time + queued_repair_time +
            list_external_files_time,
            start_time
        ) AS execution_start_time,
        end_time
    FROM snowflake.account_usage.query_history AS q
    WHERE TRUE
        AND warehouse_size IS NOT NULL
        AND start_time >= DATEADD('day', -30, DATEADD('day', -1, CURRENT_DATE))
),
-- 1 row per hour from 30 days ago until the end of today
hours_list AS (
    SELECT
        DATEADD(
            'hour',
            '-' || row_number() over (order by null),
            DATEADD('day', '+1', CURRENT_DATE)
        ) as hour_start,
        DATEADD('hour', '+1', hour_start) AS hour_end
    FROM TABLE(generator(rowcount => (24*31))) t
),
-- 1 row per hour a query ran
query_hours AS (
    SELECT
        hl.hour_start,
        hl.hour_end,
        queries.*
    FROM hours_list AS hl
    INNER JOIN filtered_queries AS queries
        ON hl.hour_start >= DATE_TRUNC('hour', queries.execution_start_time)
        AND hl.hour_start < queries.end_time
),
query_seconds_per_hour AS (
    SELECT
        *,
        DATEDIFF('millisecond', GREATEST(execution_start_time, hour_start), LEAST(end_time, hour_end)) AS num_milliseconds_query_ran,
        SUM(num_milliseconds_query_ran) OVER (PARTITION BY warehouse_id, hour_start) AS total_query_milliseconds_in_hour,
        num_milliseconds_query_ran/total_query_milliseconds_in_hour AS fraction_of_total_query_time_in_hour,
        hour_start AS hour
    FROM query_hours
),
credits_billed_per_hour AS (
    SELECT
        start_time AS hour,
        warehouse_id,
        credits_used_compute
    FROM snowflake.account_usage.warehouse_metering_history
),
query_cost AS (
    SELECT
        query.*,
        credits.credits_used_compute*2.28 AS actual_warehouse_cost,
        credits.credits_used_compute*fraction_of_total_query_time_in_hour*2.28 AS query_allocated_cost_in_hour
    FROM query_seconds_per_hour AS query
    INNER JOIN credits_billed_per_hour AS credits
        ON query.warehouse_id=credits.warehouse_id
        AND query.hour=credits.hour
),
cost_per_query AS (
    SELECT
        query_id,
        ANY_VALUE(MD5(cleaned_query_text)) AS query_signature,
        SUM(query_allocated_cost_in_hour) AS query_cost,
        ANY_VALUE(original_query_text) AS original_query_text,
        ANY_VALUE(warehouse_id) AS warehouse_id,
        SUM(num_milliseconds_query_ran) / 1000 AS execution_time_s
    FROM query_cost
    GROUP BY 1
)
SELECT
    query_signature,
    COUNT(*) AS num_executions,
    AVG(query_cost) AS avg_cost_per_execution,
    SUM(query_cost) AS total_cost_last_30d,
    ANY_VALUE(original_query_text) AS sample_query_text
FROM cost_per_query
GROUP BY 1

Assigning this to @tnrahim for now as he has some prior experience working with Snowflake cost monitoring and can help move this forward.

Are we having @tnrahim look at this in relation to the Caltrans project only? My understanding was yes. If so I'll update the project. cc: @ian-r-rose @jasonlally

Saving this for possible future platform engineer.


Update ModUtils.InstantiateValidModsForRuleset usage

[ ] Depends on ppy/osu#17286
[ ] Depends on game bump

Closing, misunderstood intentions.


Add auto merge

@conda-forge-admin, please add bot automerge

Hi! This is the friendly automated conda-forge-webservice.
I just wanted to let you know that I added bot automerge in conda-forge/euporie-feedstock#2.


Description is not allowed to be empty

What happened?
https://github.com/upbound/upjet/blob/018e6404baef55366ddd86d8d9cbf04c9bcb2426/pkg/registry/resource.go#L45 states that description can be empty,  however,  it seems to break if the description field is missing in terraform docs
How can we reproduce it?
https://github.com/upbound/upjet-provider-template/issues/32

Hi @Breee,
Thank you for raising this issue. I could not establish a connection between the issue you gave to reproduce and the issue you mentioned here.
If you are having a similar problem, I left a comment, it may solve your problem as well.


When the main files (vslam in RelLoc and vloc in AbsLoc) will be uploaded?

I have found your work to be incredibly insightful and am eager to delve deeper into it.
Could you kindly let me know when the main files (vslam in RelLoc and vloc in AbsLoc) will be uploaded to the repository?
Thank you very much for your time and assistance. I look forward to your response.

Hi, thanks for your interest in our work! The main files have been uploaded. You can refer to the RelLoc/vslam.cc and AbsLoc/estimate.py to check the updates.

Thanks, could you write a more detailed explanation for the environment configuration?
Based on the current instructions, I am not sure how to make the entire system run.

Hi, you can refer to setup.md to compile the project.

Hi, you can refer to setup.md to compile the project.

Thanks! I have successfully compiled and run the system, but it seems that the SLAM interface is not displaying correctly; the keyframes appear abnormally large, and the scale is incorrect. Could you please advise where this setting can be adjusted?


Title: Flappy bird project addition

Is your feature request related to a problem? Please describe.
I believe flappy bird is one of the project done while learning javascript. This one would be a major addition
Describe the solution you'd like.
I have actually built a flappy bird project during my initial days of learning javascript. It would be a major help contributing to this project.
@swapnilsparsh Please assign me this so that I can work on this under GSSOC'24 with appropriate label
Describe alternatives you've considered.
A high score in the flappy bird would be a good feature.
Add any other context or screenshots about the feature request here.
No response

Issue: Flappy Bird project addition
Description:
It is one of the basic projects that a newcomer/beginner works upon to clear their doubts and understand the working of JS easily.
Request:
Kindly assign me this project @swapnilsparsh under GSSOC'24 with an appropriate label as I have worked upon this project and would like to contribute for same.
Enhancements:
To add some powerups that can make the game tricky and fun-playing.
Screenshot about the feature request:

@Ankitapanda25 Thank you for providing your insight but it is not required as of now.


TypeError: Cannot assign to read only property '0' of object '[object Array]'

Describe the bug
Please take a quick look on this code, I am struggling with this error, you can see my code for mutations that makes this query to refetch all records. And replace specific record I cant because of an error
queryClient.setQueryData(['boardData', currentBoardId, filterState], old => {
if (!old) return null;
const stateCopy = { ...old };

const foundIndex = stateCopy.records.findIndex(record => record.id === recordId);
const record = { ...stateCopy.records[foundIndex] };
if (foundIndex !== -1) {
	record.lastModified = Date.now();
	record.lastUserModified = data?.id;

	if (isNameEndpoint) {
		record.name = newValue;

		queryClient.setQueryData(['timersList', undefined, undefined], old => {
			let stateCopy = [...(old ?? [])];

			stateCopy = stateCopy.map(timer => {
				if (timer.boardRecordId === recordId) timer.meta.recordName = newValue;
				return timer;
			});
			return stateCopy;
		});
	} else {
		const fieldToUpdate = fieldData.fieldId || fieldData.field;
		record[fieldToUpdate] = {
			value: newValue,
			meta: newMeta || null,
			brfId: fieldData?.id
		};
	}
       // stateCopy.records[foundIndex] = record <<<<--- Error

	const newRecords = [...stateCopy.records];
	newRecords[foundIndex] = record;
	stateCopy.records = newRecords;
}

return stateCopy;

Your minimal, reproducible example
...
Steps to reproduce
check the code snippet
Expected behavior
I thought that I was doing something like Object.freeze on my server side, but it is defiantly react query that freezes this array
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Chrome, React
Tanstack Query adapter
react-query
TanStack Query version
v5
TypeScript version
no
Additional context
No response

you're definitely not making immutable updates as the docs say that we should. you're making shallow copies, but then deeply assign values with code like timer.meta.recordName = newValue
query does not freeze anything. we use structural sharing to keep as many references as possible to avoid unnecessary re-renders and re-computations. If you mutate state directly

@TkDodo hello there, thank you for your answer and for your time, I did as immutable as possible, may I ask you to check if this is the right approach and I got you?
	queryClient.setQueryData(['boardData', currentBoardId, filterState], old => {
		if (!old) return null;
		const stateCopy = { ...old };

		const foundIndex = stateCopy.records.findIndex(record => record.id === recordId);
		let record = { ...stateCopy.records[foundIndex] };
		if (foundIndex !== -1) {
			record = {
				...record,
				lastModified: Date.now(),
				lastUserModified: data?.id
			};

			if (isNameEndpoint) {
				record = {
					...record,
					name: newValue
				};

			} else {
				const fieldToUpdate = fieldData.fieldId || fieldData.field;
				record[fieldToUpdate] = {
					...record[fieldToUpdate],
					value: newValue,
					meta: newMeta || null,
					brfId: fieldData?.id
				};
			}

			const newRecords = [...stateCopy.records];
			newRecords[foundIndex] = record;
			stateCopy.records = newRecords;
		}


Update documentation

What needs to be documented:

Coordinate systems
Transformation algorithms (BQSR, indel realignment, mark dups)
Schemas vs. models
Update getting started docs
Write variant discussion up
Join algorithms - how/what/why?

Closing in favor of #890, #886, #878, #879, #821, #497.


Deep Infra API suppport

Let's support deep infra models, like Phind/Phind-CodeLlama-34B-v2, we can use it via Deep Infra API
We should define another input called deepinfra_token, and if this input is present, ask the Deep Infra chatbot, but if it does not, then we trying with openai_token

since deep infra aggregates different models, we should have deepinfra_endpoint as well. For Phind-CodeLlama-34B-v2 it should be https://api.deepinfra.com/v1/inference/Phind/Phind-CodeLlama-34B-v2, but we can try to use Open AI compatible API, its here, using this endpoint will be the same for all models ChatGPT like: https://api.deepinfra.com/v1/openai/chat/completions

using Open AI endpoint we can pass model as we are doing now for openai_model input, for Phind-CodeLlama-34B-v2 it will be "model": "Phind/Phind-CodeLlama-34B-v2",


Support downgrading realms from /support page

Looks good to me :+1:

Merged, thanks @hackerkid!

One thing I'm curious about -- what sort of logging do we have in place if we want to track down what the history of an organization's billing situation is a year after doing some manual operations here?  I guess maybe the Stripe-side logging has a lot of detail on major changes?

Yes. Stripe has logs on invoices, payment history, payment methods etc.
These are the events related billing we long currently

    SUBSCRIPTION_CREATED = 301
    SUBSCRIPTION_ACTIVATED = 302
    SUBSCRIPTION_DEACTIVATED = 303
    SUBSCRIPTION_PROPERTY_CHANGED = 304

    STRIPE_CUSTOMER_CREATED = 401
    STRIPE_CARD_CHANGED = 402
    STRIPE_PLAN_CHANGED = 403
    STRIPE_PLAN_QUANTITY_RESET = 404

    CUSTOMER_CREATED = 501
    CUSTOMER_PLAN_CREATED = 502
    CUSTOMER_SWITCHED_FROM_MONTHLY_TO_ANNUAL_PLAN = 503

The first 4 are legacy. We should be adding logging to operations in /support as well. For operations like like attach discount, approve sponsorship, downgrade realm etc there is no logging at the moment.

OK.  That's probably logging worth doing at some point if it's easy.


Add support for float8_e4m3fnuz and float8_e5m2fnuz.

Add support for float8_e4m3fnuz and float8_e5m2fnuz.
This includes type promotion for these types.

I've added these types alongside the existing fp8 types, and followed the lead of bfloat16 in places where the fp8 types are not complete (type promotion for example). I'd be keen to get any feedback on that and any additional tests you would like to see.

I've removed all the promotion related changes and reordered added declarations to be in alphabetical order.

Great. Thanks for the review.


Add db replication blog post

Description
Checklist:

[ ] I have reviewed the style guide.
[ ] If blogging, I have reviewed the blogging guide.
[ ] I have manually confirmed that all new links work.
[ ] I added aliases (i.e., redirects) for all filename changes.
[ ] If making css changes, I rebuilt the bundle.

Dropping a note here as a reminder to change the permalink/URL (which involves renaming the directory where the Markdown file is located) to match the change to the blog post title.


Fixed typo in README.md example

I just simply adjust the example in the README.md to a working one.

oops typo xD


GUI option for enable-ghosts-for-t-intersections

Is your feature request related to a problem?
No. It was suggested that we create a GUI option for the enable-ghosts-for-t-intersections. More info can be found in #5074. It's unclear how useful this would be or how often this feature is used in the first place.
Is your feature request specific to a data set?
Yes, AMR.
Describe the solution you'd like.
The suggested solution is to create a GUI flag for enable-ghosts-for-t-intersections.
Describe alternatives you've considered.
We've added a command line flag.
Additional context
When updating the command line flag, I poked around a bit to see how difficult it would be to add this as a GUI option. My first thought was to use the same approach that's used in the Engine for enabling/disabling this feature. Unfortunately, VisIt didn't seem to pass the information through the pipeline when using this approach, and it wasn't immediately clear how to get that to happen. I stopped at that point so that we can figure out whether or not this is worth the effort.

This would probably go with the mesh management options.

This would probably go with the mesh management options.


Provide code in Python

As a data scientist who mainly works and codes in Python, I would love to see the code examples available in Python, too. I will try to provide them by myself, so right now I am adding Jupiter notebooks to the folders which will produce roughly the same analysis an pictures as the R examples. Once I am finished with this, we might have to think about how to structure the code and output because right now the final output is given as html, and I don't want to provide two html files. Maybe we will group the code in sub folders according to the programming language.
The aim will be to roughly reproduce the pictures so the reader has a starting point, but I will not recreate the exact picture because this will be too much the effort. We should follow the Pareto principle here. So for example the first graphic I reproduced with plotly and their margin functionality which creates the histograms but with other bin sizes.
But first I will have to migrate all examples, and I have just started reading so I am looking forward to this!

Just found out about the wonderful plotnine package, that I will use from now on to recreate the plots in Python. With plotnine, the syntax is nearly identical to R, helping readers with the transition between the two languages. I also provide plotly code because I like plotly's interactive capabilities but it is not as powerful as other plotting librariers

Good. Looking forward to seeing it.


Add option to override/disable auto-scaling.

Thanks for this library!
I'm using it in a place where I'm letting the browser scale the <canvas>'s parent, so that the bitmap scales up smoothly to fill the viewport. The built-in auto-scaling was interfering with this, as the canvas's contents would jump between 1x, 2x, 3x scale as the viewport size changes.

Hey thanks @mik3y, this is a great idea. I'm actually okay with removing the stepped scaling altogether so the user has total control.
I just pushed 3.0.0-beta-1 to npm, mind giving it a spin? It should resize smoothly as you change the dimensions of the <canvas> (maintaining aspect ratio). Let me know if that works; thanks again!

v3 is now out of beta; hopefully that approach will do the trick! Thanks again.

Ah, I think it did! Cheers!


Readme is missing a link

Read the documentation goes to a 404

Maybe it should point to https://microsoft.github.io/devicescript/developer/development-gateway?


Content-Length field is zero on HEAD request

Hello, I would like to get the response size without getting the response, but the reqwest::blocking::Response::content_length field is 0 although the raw header has the data. Works perfectly fine with GET requests.
Tested with version = "0.11.11"
Non-Working Sample:
    #[test]
    fn min() {
        let client = reqwest::blocking::Client::new();
        let url = Url::parse("https://ynet-images1.yit.co.il/picserver5/crop_images/2022/09/04/rJIVgLMgo/rJIVgLMgo_0_0_850_479_0_x-large.jpg").unwrap();
        let response = client.head(url.as_str()).send().unwrap();
        let header_length:u64 = response.headers().get("Content-Length").unwrap().to_str().unwrap().parse().unwrap();
        let length = response.content_length().unwrap();
        assert_eq!(length, header_length);
    }

Result:
Left:  0
Right: 821703

Working Sample:
    #[test]
    fn min_work(){
        let client = reqwest::blocking::Client::new();
        let url = Url::parse("https://ynet-images1.yit.co.il/picserver5/crop_images/2022/09/04/rJIVgLMgo/rJIVgLMgo_0_0_850_479_0_x-large.jpg").unwrap();
        let response = client.get(url.as_str()).send().unwrap();
        let header_length:u64 = response.headers().get("Content-Length").unwrap().to_str().unwrap().parse().unwrap();
        let length = response.content_length().unwrap();
        assert_eq!(length, header_length);
    }

Thanks!

but the reqwest::blocking::Response::content_length field is 0 although the raw header has the data.

Hi, this is expected.
Please remember that response.content_length() has a different meaning from the returning Content-Length header.

response.content_length() returns the the content-length of this response, if known.. For head requests, all responses will be 0 because there is no body returned from the server.
the Content-Length header returned by the server indicates the actual content length of this file on the server side.

I see, in such a case that makes sense.
Thanks!


⚠ Bofrost.es has degraded performance

In ca1d807, Bofrost.es (https://www.bofrost.es) experienced degraded performance:

HTTP code: 200
Response time: 1525 ms

Resolved: Bofrost.es performance has improved in 48bb7b8 after 7 minutes.


Whether to remove JsonMixin ?

As flask-restful has a built-in method called marshal, which has the similar function like JsonMixin does.
marshal filters the properties with a specify format, and transform the input data into a OrderedDict.

I think you can use a specify format with dict instead of OrderedDict. and remove JsonMixin

@dongweiming The marshal default behaviour is to turn the data into a OrderedDict, so if needed to turn it into a dict, we have do extra effort. Otherwise i have to override the built-in marshal method.

i just read the source code. i found this:
$python manage.py shell

In [1]: from firefly.models import topic

In [2]: post = topic.Post.objects.all()[0]

In [3]: post
Out[3]: <Post: 美好的测试>

In [4]: import json

In [5]: json.loads(post.to_json())
Out[5]:
{u'_cls': u'Post',
 u'_id': 1,
 u'comments': [1],
 u'content': u"# title\n\u200b\n```python\nprint 'hello'\n```",
 u'created_at': {u'$date':<PHONE_NUMBER>779},
 u'title': u'\u7f8e\u597d\u7684\u6d4b\u8bd5',
 u'views': 37}

In [6]: post.to_mongo().to_dict()
Out[6]:
{'_cls': 'Post',
 '_id': 1,
 'comments': [1],
 'content': u"# title\n\u200b\n```python\nprint 'hello'\n```",
 'created_at': datetime.datetime(2015, 4, 21, 14, 31, 15, 779000),
 'title': u'\u7f8e\u597d\u7684\u6d4b\u8bd5',
 'views': 37}

so . JsonMixin don't need to exist

@dongweiming TIL

or we can use extend a new class with a to_dict method. for  example:

def update_db(db):
    def to_dict(self):
       return self.to_mongo().to_dict()
    setattr(db.Document, 'to_dict', to_dict)
db = MongoEngine(app)
update_db(db)

@dongweiming  Good idea.


KeyError when only one book found

If the search returns only one book, a key error is returned.
>>> ids = lg.search('Mushrooms and Toadstools of Britain and Europe', 'title')
>>> ids
['1819507']
>>> books = lg.lookup(ids)
>>> from pprint import pprint; pprint(books[0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 0
>>>

That's because if only one id is specified, then a Book object will be returned and it won't be contained in a list. I might be separating into lookup and something like batch_lookup to make this more clear, before 2.0.0 is officially released.

In 2.0.0, I ended up changing Library.lookup to yield Book objects instead, to keep the API clean.


How many times do I use ehcache data?

Greetings
I want to know how much ehcache was used during the execution of my program, that is, every time I call session.get and the data comes from ehcache, I want to print it in the log console or something.
I got acquainted with CacheEventListener during my search, but this interface does not notice me when loading and only when push / expire / eviction.

There just isn't enough demand for a get listener to justify the performance overhead of logging on every get. This should however be trivial to implement in a wrapper around the caches.


don't alter in code-block style tags

I've ran in a problem where I have

Parser should not transform the code as the content will also be used to write back. See d2a5b96be5a454a791052815ec5c2369673f1e68
Thanks for the contribution!


Incorrect documentation dynamic build number variables

The documentation in this section is incorrect. When following the example and attempting to run in Azure DevOps, I was presented with the following error:
Unexpected value "why".
I believe the example code should read as follows:
variables:
  - name: why
    ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
      value: pr
    ${{ elseif eq(variables['Build.Reason'], 'Manual' ) }}:
      value: manual
    ${{ elseif eq(variables['Build.Reason'], 'IndividualCI' ) }}:
      value: indivci
    ${{ else }}:
      value: other

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: a57f8545-bb15-3a71-1876-3a9ec1a59b93
Version Independent ID: 28c87c8d-c28d-7493-0c7c-8c38b04fbcd7
Content: Run (build) number - Azure Pipelines
Content Source: docs/pipelines/process/run-number.md
Service: azure-devops-pipelines
Sub-service: azure-devops-pipelines-process
GitHub Login: @juliakm
Microsoft Alias: jukullam

@chcomley -- Chrystal, please review this update in private PR 5983.


Always have (stdin) in source map

I'm using master branch.
Whatever I do I have this kind of source map (here's a minimal example):
{"version":3,"file":"cms.css","sourceRoot":"/","sources":["(stdin)"],"names":[],"mappings":"AAAA"}
Instead of the name of "cms.scss" (in my case) there is "(stdin)"
This is the simple cms.css:
h1 {   color: blue; } /*# sourceMappingURL=cms.css.map */
The compiler works fine even in complex situations with importing Bootstrap framework. The generated css is well.
Having a short look into the code I have seen that the word (stdin) comes from the constructor of the parser class which is called by the compile function.
Don't know what I have to change or if it's a bug.

What source map options are you using?
Reference: https://github.com/leafo/scssphp/wiki/Source-Maps

Hi. I have the same issue with creating source maps. tried the SOURE_MAP_INLINE and the SOURCE_MAP_FILE option.

Same here with options:

sourceMapWriteTo
sourceMapURL
sourceMapBasepath
sourceMapRootpath
sourceRoot

But if I call $preprocessor->compile($scss, '/'); (with the second param), no more error - I just then get two times the base "path" in the sourcemap.map file:
{"version":3,"sourceRoot":"/","sources":["subdir/www/","subdir/www/","subdir/www/assets/themes/MyTheme/scss/foundation/vendor/normalize.scss" ...


⚠ docs imported prior to removal from code.kx.com on 2023.03.01

imported MDs
translated to GFM
fixed inks

code.kx.com/q/interfaces now links to this repo for documentation


Package not valid error

Describe the bug
This package name is not valid, because name can only contain URL-friendly characters.
Not Found - GET http://nginx-redirector.repo-cache.svc.cluster.local/yaml/-/yaml-1.10.2.tgz

To Reproduce
npm install yaml --save

This isn't a bug with yaml, but with your custom registry settings.


add html file

Your pull request needs further work because of the following reason(s):

You have modified BSoD/some.html, You can only modify BSoD/Quyennt17.html

Once you have resolved the issues, comment on this request to be re-judged
This is an automated response, beep boop.
if you think there is a mistake, contact a maintainer

7286acef32a2cdc8d3a0bf4ef55d3675f4df0d7a

This PR has been idle for more than 24 hours, and will now be closed. Feel free to re-open.
This is an automated response, beep boop.
if you think there is a mistake, contact a maintainer

7286acef32a2cdc8d3a0bf4ef55d3675f4df0d7a


Recommend errors.Is instead of == for testing sentinel errors?

The current introduction to Errors in Go recommends using == to test for sentinel errors, but I think that the community recommends using errors.Is instead.
For example, from the docs for errors:

Is unwraps its first argument sequentially looking for an error that matches the second. It reports whether it finds a match. It should be used in preference to simple equality checks:
if errors.Is(err, fs.ErrExist)

is preferable to
if err == fs.ErrExist

because the former will succeed if err wraps fs.ErrExist.

Would you be interested in a pull request that swapped errors.Is for ==? (Or perhaps one that mentions both—since people will see both in code—but recommends errors.Is?)

The difference in meaning is really subtle. We do not really go into error wrapping in the current exercise so I am not convinced we should change it without also introducing the concept of error wrapping. @junedev?

There were some discussions around this an the consens was that it is good to also know how to not unwrap so we are teaching this here. Also people need to learn about == since it is still used in a lot of code bases.
Since also covering error wrapping properly in this exercise would have been too much content, there will be a separate exercise for this, see issue #1997. @telemachus It would be great if you can leave the comment in that issue that we should explain that if there is no specific not to unwrap, errors.Is is preferred. Just to make sure we don't forget about it then.

We do not really go into error wrapping in the current exercise so I am not convinced we should change it without also introducing the concept of error wrapping.

@jmrunkle Maybe I'm confused, but I'm not sure why this is necessary. Even if an error is not wrapped, doesn't errors.Is work? If that's so, can't this exercise recommend using errors.Is without mentioning wrapping?
To respond to @junedev's point ("people need to learn about == since it is still used in a lot of code bases"), I agree that == should be mentioned. How about this as a compromise?

You can compare error variables with the equality operator ==, and you will see this in older Go code. However, Go's documentation recommends using errors.Is for new code. (There could also be a sentence here explaining that errors.Is came into Go relatively recently with 1.13, though I don't think that detail is necessary.)

This lesson doesn't have to say anything about wrapping, and unless I'm confused all the examples should still work. (If not, I'd love to know since that means I'm wrong about errrors.Is.)

@telemachus errors.Is will work for non-wrapped errors like in the exercise but it will always unwrap for wrapped errors. I am not a fan of setting up this exercise in a way that it pretends errors.Is does nothing out of the ordinary because it is not true. I think it makes more sense to properly explain error wrapping first and then introduce errors.Is together with errors.As and explain the relationship of errors.Is and ==.
At work, we have several use cases were we specifically DON'T want to unwrap as it would lead to different behavior. E.g. we have an http error type that, if if would be returned up the chain would lead the server to respond with the enclosed status code. However, in some cases we don't want to forward that code so we wrap the error and then don't unwrap when checking it later, which in our case makes the server return 500 instead of whatever was in the original error. Similar for sentinels, e.g. ErrResourceNotFound in a repository/storage layer. In some context we know this had some other reason (e.g. it appeared in a place were something is really really wrong when the resource was not found at that point) and then we wrap it. In the layers above, we don't unwrap because the storage layer might know better and converted this error for a reason in some of the cases. We still want do be able to access the underlying error, e.g. in observability tools, that's why we don't convert to a string (e.g. use "%v" instead of "%w") but use wrapping.
Long story short, it is important to know and be able to use == which is why we make the student practice it here.
I would be happy to refer to the error wrapping concept right next to explaining == to prime the student that there is more to come but for that we need that other concept first.

I would be happy to refer to the error wrapping concept right next to explaining == to prime the student that there is more to come but for that we need that other concept first.

@junedev Thanks for the detailed explanation. I hadn't thought of cases where people would not want the unwrapping behavior, so that helps. I'll leave a note on #1997 to edit this exercise after that one is written.


Add information on configuring OpenSSL libraries

Documenting this for upcoming configuration changes in vNext.

@MitchellSternke : Thanks for your contribution! The author, @tmullaney, has been notified to review your proposed change.

@meet-bhagdev - Would you review the proposed changes? Thanks

Looks good. #sign-off
@vin-yu as FYI

@meet-bhagdev: I'm sorry - only the author of this article, @tmullaney, can sign off on your changes. But we do have an exception process - if you are on the Microsoft content or product team for this product area, you can ask the PR review team to review and merge it by sending mail to the techdocprs alias.

@meet-bhagdev @vin-yu @MitchellSternke I'll merge this for you. Thanks!


Plugin breaks with IntelliJ build IU-213.5744.223

Plugin error: Plugin 'Ansible Vault Editor' (version '1.15') is not compatible with the current version of the IDE, because it requires build 212.* or older but the current build is IU-213.5744.223

Hello @zcubbs! Thank you for reporting! This already bean fixed, but version will be approved within two days.
You can now manually install it from here: https://plugins.jetbrains.com/plugin/14278-ansible-vault-editor/versions/stable/148166

Thank you


Refactor as per golint warnings.

Added nil test for flatern method.
Fixed few warnings by golint.

Current coverage is 25.50% (diff: 100%)

Merging #263 into master will not change coverage

@@             master       #263   diff @@
==========================================
  Files            33         33
  Lines          1200       1200
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits            306        306
  Misses          839        839
  Partials         55         55

Powered by Codecov. Last update 2721fb6...b011265


Thoughts about Yuncong's Attack

Yuncong's (@yczhangsjtu's) attack may apply whenever the correct sorting of memory tables is not enforced. It reads an inconsistent value from memory even though the memory table's AIR is satisfied and even though the permutation argument checks out. This is possible in general because jumps in memory address or clock cycle are are not verified to be increasing jumps. Specifically, jumps that decrease one of these values are allowed (but shouldn't be), and thus it may be possible to rearrange rows between contiguous regions of the memory table.
Without loss of generality, we use mp to denote the memory address, mv to denote the value, and clk to denote the cycle counter. Bear in mind that the same problem (and solutions) apply to three memory structures in Triton: RAM, OpStack, and JumpStack.
Ferdinand's Intuition

mp partitions the memory table; the induced regions should be contiguous.
clk should increase monotonically within each region.

Intuitively, these rules are necessary and sufficient for integral memory access. However, it's not quite clear how to prove this.
Theorem
What do we even mean by integral memory access? Here is a suggestion:
An execution trace $T$ is has integral memory access iff:

for all $i$ in {0, . . . , height( $T$ )}, if $T$[ $i$ ][ci] = mem_read then there is a $j$ in {0, . . ., $i-1$} for which all of the following hold:

$T$[ $i+1$ ][st0] = $T$[ $j$ ][st0];
$T$[ $j$ ][ci] = mem_write;
for all $k$ in { $j+1$ , . . ., $i - 1$} either $T$[ $k$ ][ci] =/= mem_write or $T$[ $k$ ][st0] =/= $T$[ $j$ ][st0].

Analogous propositions should be considered for OpStack and JumpStack.
Sequential Addressing
For the RAM specifically, the memory pointer can be any field element. As a result, the jumps can be arbitrarily big, and no sorting can be enforced.
A solution is to use a lookup table into a map that sends random memory addresses to sequential memory addresses and back. This memory address bijection (MAB) maps into the range {0, . . . , k} where k+1 is the number of unique memory addresses. The column ramp comes with a counterpart samp (s for sequential). A set equality argument establishes that the pairs (ramp, samp) that appear in the Ram Table constitute the same set as the pairs in the Mab Table. The Ram Table is then sorted by samp and this sorting can be verified because samp can never increase by more than one.
How do we establish that the Mab Table defines a bijection? In particular, it can't include two-to-one relations or one-to-two relations. This is an open question.

[ ] answer

Lazy ramp
In the current architecture, ramp and st1 are the same register. As a result, st1 takes all sorts of values and thus implicitly points to memory cells located there.
It is desirable to split ramp and st1 back into two separate registers. This split does not induce a change in the instruction set architecture: ramp only has to assume the value of st1 when the current instruction is mem_read or mem_write.
Solutions
Whenever there is a jump in clk, the difference between the next and the current values must be small but positive. There are various strategies to prove that this is the case.
Solution 1: U32 Lookups
Since we do not expect the cycle counter to rise above $2^{32}$, we can require that this difference is a u32 integer. A table lookup argument to the U32 Table can establish this fact.
Solution 2: Add Bit Columns
We add k columns whose values are constrained to bits, for some k – say, k = 32. Whenever there is a jump, the jump is exactly equal to the integer represented by the bit columns.
Solution 3: Add Dummy Rows
Add 1 column that indicates whether rows are dummy rows or not. Whenever there is a jump, insert dummy rows that increase clk by one in each row.
Solution 4: Build Difference
This solution can be seen as a hybrid between solutions 2 and 3. Whenever there is a jump, we add logarithmically many dummy rows where we build a difference by adding one or multiplying by two in every row. When the sequence of dummy rows ends, the value at the end is added to clk.

clk should increase contiguously within each region.

I think I mean “monotonically” instead of “contiguously.”

As a reference: the alluded-to attack is described in greater detail in #12.

I believe that a monotonically increasing mp achieves contiguous regions. Thus, any of the solutions {1, 2, 4} should be applicable to ramp in the same way it is proposed to apply to clk. Crucially, this would not require samp or the MAB.

Superseded by #77 and #78.


discovery.docker doesn't work on AWS ECS

What's wrong?
I've applied the configuration from the doc https://grafana.com/docs/agent/latest/flow/reference/components/discovery.docker/
There are no metrics or errors from the agent.
prometheus.exporter.cadvisor works but there are no docker labels with it
Steps to reproduce
`discovery.docker "containers" {
host = "unix:///var/run/docker.sock"
}
prometheus.scrape "demo" {
targets    = discovery.docker.containers.targets
forward_to = [prometheus.remote_write.demo.receiver]
}
prometheus.remote_write "demo" {
endpoint {
url = PROMETHEUS_REMOTE_WRITE_URL
basic_auth {
  username = USERNAME
  password = PASSWORD
}

}
}`
System information
No response
Software version
No response
Configuration
discovery.docker "containers" {
  host = "unix:///var/run/docker.sock"
}

prometheus.scrape "demo" {
  targets    = discovery.docker.containers.targets
  forward_to = [prometheus.remote_write.demo.receiver]
}

prometheus.remote_write "demo" {
  endpoint {
    url = PROMETHEUS_REMOTE_WRITE_URL

    basic_auth {
      username = USERNAME
      password = PASSWORD
    }
  }
}

### Logs

_No response_

I'm seeing this on a DigitalOcean droplet as well

It's due to this https://github.com/grafana/alloy/issues/381


Can number of requests per second be customized?

Can requests be customized to edit RPS and ramp-up time for the benchmarked method?

Bombardier supports rate as a variable. You can use that to use a fixed RPS. It doesn't support variations, but this could be achieved with multiple load jobs (load1, load2, ...) with different rates, and each run would be saved independently. e.g.:
scenarios:
- test
  application:
    job: thebenchmark
  load1:
    job: bombardier
    variables:
      rate: 1000
  load2:
    job: bombardier
    variables:
      rate: 5000
  load3:
    job: bombardier
    variables:
      rate: 10000

Another option is to change one of the clients, for instance the HttpClient one, and improve it to support the ramping up. I think at one point I implemented it, will check if it's still supported (don't remember).
And remember that even if there is a single application job, all the samples are stored if you save the results in a json file (or sql) so you can see the progression of CPU usages or other server stats.

Thanks for that @sebastienros .
I was trying to use variable load as above. In my results.json . I could not see loads-specific results, does it generate one? The file attributes looked similar to the previous ones without using load.


Fix missing tags from tag_by

What does this PR do?
Fix missing tags from tag_by
Used to be passed to self._get_running_wmi_sampler but has changed in
https://github.com/DataDog/integrations-core/pull/6325/files#diff-5616a77c5830301f9247aa423b0158edL59
Motivation
AGENT-5007
Additional Notes

Review checklist (to be filled by reviewers)

[ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
[ ] PR title must be written as a CHANGELOG entry (see why)
[ ] Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
[ ] PR must have changelog/ and integration/ labels attached

Releasing in https://github.com/DataDog/integrations-core/pull/7727


Update default timeline behavior to only show tweets since last cache modified time with optional -f/--full flag

I would prefer it this was an option, not the default. Avoiding to change the current behaviour.

How about a user-configurable  option  to change the default? e.g:
TimelineView: nwest

I guess stat:ing the file is a good enough solution for now, instead of changing the cache file format...

Yes I'm avoding Cache incompatibility here. Stat'ing the file is fine IHMO because most file systems support this. I'm using this  technique elsewhere as well in rss2twtxt

How about a user-configurable option to change the default? e.g:
TimelineView: nwest

Yes, that's good!

@prologic i reworked this a bit. simplified slightly


CLOUD: Three small changes (before Sunday's push possible?)

[ ] Please add a button on eVDC component that says Pricing and links to the pricing component
[x] Move pricing to the bottom and change title to Mainnet Pricing
[x] Please add a color background to the "We are currently in BETA version" component (I'm unsure which color to use, let's try grey and maybe the turquoise from the website and sees what works

@samaradel
please add another (lighter) button to card component and link to bottom Mainnet Pricing block


Expecting ',' delimiter: line 1 column 30 (char 29)

To share the useful information for helping debugging the node:
In the Workflow Test Run view, click "TRACING" tab, click "LLM:Parameter Extractor" and "Action:add_memory" node , share the entire content of "PROCESS DATA" and "OUTPUT" content (copy and paste the content on GitHub with code block marks, not just a screenshot).
for example:

the expected output of LLM:Parameter Extractor node should be like:
{
  "__is_success": 1,
  "__reason": null,
  "action": "add_user_memory",
  "longterm_memory_content": "<memoryspace user_id=\"bdf1fa0e-9b0e-46e6-ac74-a06da80853c6\"><UserInfo><name>Rain</name><age></age><hobbies></hobbies><any_user_info></any_user_info></UserInfo></memoryspace>"
}

PS:  remember to strip the Authorization part before sharing the content
PS: don't expose the API KEY in public.

@HelloXMFJ Can you share more useful information by following the above instruction?

{
"body": "",
"status_code": 0,
"headers": {},
"error_message": "Reached maximum retries (3) for URL ",
"error_type": "HttpRequestNodeError"
}

LLM:Parameter Extractor:{
"__is_success": 0,
"__reason": "Invalid number of parameters",
"action": "",
"longterm_memory_content": ""
}

Action:add_memory:{
"body": "",
"status_code": 0,
"headers": {},
"error_message": "Reached maximum retries (3) for URL ",
"error_type": "HttpRequestNodeError"
}

base_url: http://<IP_ADDRESS>:5001

base_url: http://<IP_ADDRESS>:5001

if you're using Dify Cloud, you should use cloud version API https://api.dify.ai/ as the base_url parameter value.
If you're using "Deploy with Docker Compose" solution, it dependents:

use http://host.docker.internal on MacOS/Linux
use http://docker.for.win.localhost on Windows 10/11

if you changed default nginx port config, append the port you used

@HelloXMFJ which deployment you're using? did you try the above info about the  base_url config?

"Yes, I tried the configurations mentioned above and encountered the same issue. I deployed the system using the source code method, with the database running in Docker. The deployment process is detailed in the following link: https://docs.dify.ai/en/getting-started/install-self-hosted/local-source-code"
Please note that I am specialized in designing logos and this translation assistance is an exception. If you have any logo design needs, feel free to ask!

"I also tried upgrading dify to version 0.13.2, but the issue persists."

Can you share the full input content of "Action:add_memory"?


Export isHandled

This could be useful is some rare cases when implementing your own unhandled rejection tracking.

Coverage remained the same at 100.0% when pulling 49441298a49c6b0ffb67c10e93259b21452e7ca2 on export-is-handled into a9c5aab84dbeb4eb030a0f2b55b88fd2338de9db on master.

Coverage remained the same at 100.0% when pulling 9a2c6c36e549c309e966a57af629210039838312 on export-is-handled into a9c5aab84dbeb4eb030a0f2b55b88fd2338de9db on master.


where are text_ids、text_labels、text_masks of infer() of VLMo class from?

I wanna use VLMo to inference on NLVR task, but I'm confused about these:
text_ids = batch[f"text_ids{do_mlm}"]
text_labels = batch[f"text_labels{do_mlm}"]
text_masks = batch[f"text_masks"]
I read the code carefully, but I have not found where they come from.

In my opinion, datasets are created by the function:
def dataset_cls(self):
    raise NotImplementedError("return tuple of dataset class")

But it have not been implemented yet, so the input dataset is not aligned with the dataset used for the inference.

In my opinion, datasets are created by the function:
def dataset_cls(self):
    raise NotImplementedError("return tuple of dataset class")

But it have not been implemented yet, so the input dataset is not aligned with the dataset used for the inference.

They are generated by function called collate which is located in /vlmo/datasets/BaseDataset.py
The following shows how to find it.
The datamodule of VLMo is defined in /vlmo/datamodules/multitask_datamodule.py, which "concat" a series of "unitask_datamodule" in the self.dms. In your case, the "unitask_datamodule" comes from /vlmo/datamodules/nlvr2_datamodule.py, a child class of BaseDataModule in  /vlmo/datamodules/BaseDataModule.py.
Obviously, the datamodule loads and preprocesses the data from the dataset. In /vlmo/datamodules/BaseDataModule.py, method set_train_dataset set which dataset should be loaded through self.dataset_cls(). Actually it is defined in the child class NLVR2DataModule, called NLVR2Dataset, which is imported from vlmo.datasets. Also you kan get the original data.
     return {
        "image_0": image_tensor_0,
        "image_1": image_tensor_1,
        "text": text,
        "answers": answers,
        "table_name": self.table_names[index],
    }

The ids, labels, masks and other information is created by the param collate_fn in dataloader. Go back into /vlmo/datamodules/BaseDataModule.py, in train_dataloader, you can find such param, which process the data in batch before the dataloader feed them to the model.
The /vlmo/datamodules/BaseDataModule/train_dataloader, the collate_fn is setted as self.train_dataset.collate, and the self.train_dataset is an istance of NLVR2Dataset. And NLVR2Dataset is also the child class of BaseDataset. Don't forget our goal is to find the method "collate", wthichis loacted in the end of BaseDataset in /vlmo/datasets/BaseDataset.py.
Such function read-in bath_size of data, in a list, and do the other things, such as tokenize, wordmasking, and transform each kind of data in list into a large tensor, which will be feed into the model.
def collate(self, batch, mlm_collator):
    batch_size = len(batch)
    keys = set([key for b in batch for key in b.keys()])
    dict_batch = {k: [dic[k] if k in dic else None for dic in batch] for k in keys}
    img_keys = [k for k in list(dict_batch.keys()) if "image" in k]
    for img_key in img_keys:
        new_imgs = [tmp_img[0] for tmp_img in dict_batch[img_key]]
        batch_new_imgs = torch.stack(new_imgs, dim=0)
        dict_batch[img_key] = [batch_new_imgs]

    txt_keys = [k for k in list(dict_batch.keys()) if "text" in k]
    if len(txt_keys) != 0:
        texts = [[d[0] for d in dict_batch[txt_key]] for txt_key in txt_keys]
        encodings = [[d[1] for d in dict_batch[txt_key]] for txt_key in txt_keys]
        draw_text_len = len(encodings)
        flatten_encodings = [e for encoding in encodings for e in encoding]
        flatten_mlms = mlm_collator(flatten_encodings)

        for i, txt_key in enumerate(txt_keys):
            texts, encodings = (
                [d[0] for d in dict_batch[txt_key]],
                [d[1] for d in dict_batch[txt_key]],
            )

            mlm_ids, mlm_labels = (
                flatten_mlms["input_ids"][batch_size * (i) : batch_size * (i + 1)],
                flatten_mlms["labels"][batch_size * (i) : batch_size * (i + 1)],
            )

            input_ids = torch.zeros_like(mlm_ids)
            attention_mask = torch.zeros_like(mlm_ids)
            for _i, encoding in enumerate(encodings):
                _input_ids, _attention_mask = (
                    torch.tensor(encoding["input_ids"]),
                    torch.tensor(encoding["attention_mask"]),
                )
                input_ids[_i, : len(_input_ids)] = _input_ids
                attention_mask[_i, : len(_attention_mask)] = _attention_mask

            dict_batch[txt_key] = texts
            dict_batch[f"{txt_key}_ids"] = input_ids
            dict_batch[f"{txt_key}_labels"] = torch.full_like(input_ids, -100)
            dict_batch[f"{txt_key}_ids_mlm"] = mlm_ids
            dict_batch[f"{txt_key}_labels_mlm"] = mlm_labels
            dict_batch[f"{txt_key}_masks"] = attention_mask

    return dict_batch

In my opinion, datasets are created by the function:
def dataset_cls(self):
    raise NotImplementedError("return tuple of dataset class")

But it have not been implemented yet, so the input dataset is not aligned with the dataset used for the inference.

They are generated by function called collate which is located in /vlmo/datasets/BaseDataset.py
The following shows how to find it.
The datamodule of VLMo is defined in /vlmo/datamodules/multitask_datamodule.py, which "concat" a series of "unitask_datamodule" in the self.dms. In your case, the "unitask_datamodule" comes from /vlmo/datamodules/nlvr2_datamodule.py, a child class of BaseDataModule in /vlmo/datamodules/BaseDataModule.py.
Obviously, the datamodule loads and preprocesses the data from the dataset. In /vlmo/datamodules/BaseDataModule.py, method set_train_dataset set which dataset should be loaded through self.dataset_cls(). Actually it is defined in the child class NLVR2DataModule, called NLVR2Dataset, which is imported from vlmo.datasets. Also you kan get the original data.
     return {
        "image_0": image_tensor_0,
        "image_1": image_tensor_1,
        "text": text,
        "answers": answers,
        "table_name": self.table_names[index],
    }

The ids, labels, masks and other information is created by the param collate_fn in dataloader. Go back into /vlmo/datamodules/BaseDataModule.py, in train_dataloader, you can find such param, which process the data in batch before the dataloader feed them to the model.
The /vlmo/datamodules/BaseDataModule/train_dataloader, the collate_fn is setted as self.train_dataset.collate, and the self.train_dataset is an istance of NLVR2Dataset. And NLVR2Dataset is also the child class of BaseDataset. Don't forget our goal is to find the method "collate", wthichis loacted in the end of BaseDataset in /vlmo/datasets/BaseDataset.py.
Such function read-in bath_size of data, in a list, and do the other things, such as tokenize, wordmasking, and transform each kind of data in list into a large tensor, which will be feed into the model.
def collate(self, batch, mlm_collator):
    batch_size = len(batch)
    keys = set([key for b in batch for key in b.keys()])
    dict_batch = {k: [dic[k] if k in dic else None for dic in batch] for k in keys}
    img_keys = [k for k in list(dict_batch.keys()) if "image" in k]
    for img_key in img_keys:
        new_imgs = [tmp_img[0] for tmp_img in dict_batch[img_key]]
        batch_new_imgs = torch.stack(new_imgs, dim=0)
        dict_batch[img_key] = [batch_new_imgs]

    txt_keys = [k for k in list(dict_batch.keys()) if "text" in k]
    if len(txt_keys) != 0:
        texts = [[d[0] for d in dict_batch[txt_key]] for txt_key in txt_keys]
        encodings = [[d[1] for d in dict_batch[txt_key]] for txt_key in txt_keys]
        draw_text_len = len(encodings)
        flatten_encodings = [e for encoding in encodings for e in encoding]
        flatten_mlms = mlm_collator(flatten_encodings)

        for i, txt_key in enumerate(txt_keys):
            texts, encodings = (
                [d[0] for d in dict_batch[txt_key]],
                [d[1] for d in dict_batch[txt_key]],
            )

            mlm_ids, mlm_labels = (
                flatten_mlms["input_ids"][batch_size * (i) : batch_size * (i + 1)],
                flatten_mlms["labels"][batch_size * (i) : batch_size * (i + 1)],
            )

            input_ids = torch.zeros_like(mlm_ids)
            attention_mask = torch.zeros_like(mlm_ids)
            for _i, encoding in enumerate(encodings):
                _input_ids, _attention_mask = (
                    torch.tensor(encoding["input_ids"]),
                    torch.tensor(encoding["attention_mask"]),
                )
                input_ids[_i, : len(_input_ids)] = _input_ids
                attention_mask[_i, : len(_attention_mask)] = _attention_mask

            dict_batch[txt_key] = texts
            dict_batch[f"{txt_key}_ids"] = input_ids
            dict_batch[f"{txt_key}_labels"] = torch.full_like(input_ids, -100)
            dict_batch[f"{txt_key}_ids_mlm"] = mlm_ids
            dict_batch[f"{txt_key}_labels_mlm"] = mlm_labels
            dict_batch[f"{txt_key}_masks"] = attention_mask

    return dict_batch

I see. Thanks for your detailed response.


getCurrentWebElements(By.cssSelector(...)) and clickOnWebElement(By.cssSelector(...)) fail if targeted web element is off the screen

From<EMAIL_ADDRESS>on September 06, 2013 11:36:03
What steps will reproduce the problem? 1. Display HTML page with content the user would have to scroll down to see
2. Call one of the methods to access an element further down the page What is the expected output? What do you see instead? I would expect getCurrentElements to return a element, but it returns an empty list. I'm not sure if waitFor finds the element or times out either. clickOn... seems to scroll the page, but the element doesn't get clicked. Sometimes it seems to click (0, 0) instead (where there is a clickable element as well in my case). What version of the product are you using? On what operating system? Robotium 4.0, Android 4.1.2, Mac OS X 10.8 Please provide any additional information below. For the particular test we're writing, it can be the case that, with the same selector, it will target an element that is visible on the screen without the need for scrolling. And, in this case, the clickOn succeeds.
Original issue: http://code.google.com/p/robotium/issues/detail?id=514

From<EMAIL_ADDRESS>on September 08, 2013 22:18:55
All the getCurent methods only return elements/views that are visible to the user. This is according to design.
Status: WontFix
Owner<EMAIL_ADDRESS>

From<EMAIL_ADDRESS>on September 09, 2013 14:27:24
The problem is that even after the element is scrolled into view, the click does not succeed.
If it's designed not to succeed, there's no need to attempt to scroll the page to the bottom. Save us some time then.


Create Match service

Resolve #21
Extract match service from bot.
This separation make two services loose coupling.
Match service concentrate on match making.
Discord service concentrate on discord specific logic. (ex: chatbot as UI, channel management, reaction listening)

Isn't it better to put the "service" directory children under the "pkg"?


extension vscode-pdf is not working correctly

extesion vscode-pdf is not working correctly, opend pdf file is not display.
request fails with the following links:
https://mydomain.com/webview/vscode-resource/file///share/CACHEDEV1_DATA/.qpkg/qvscode/data/extensions/tomoki1207.pdf-0.6.0/lib/web/viewer.css
https://mydomain.com/webview/vscode-resource/file///share/CACHEDEV1_DATA/.qpkg/qvscode/data/extensions/tomoki1207.pdf-0.6.0/lib/pdf.css
https://mydomain.com/webview/vscode-resource/file///share/CACHEDEV1_DATA/.qpkg/qvscode/data/extensions/tomoki1207.pdf-0.6.0/lib/build/pdf.js
https://mydomain.com/webview/vscode-resource/file///share/CACHEDEV1_DATA/.qpkg/qvscode/data/extensions/tomoki1207.pdf-0.6.0/lib/build/pdf.worker.js
https://mydomain.com/webview/vscode-resource/file///share/CACHEDEV1_DATA/.qpkg/qvscode/data/extensions/tomoki1207.pdf-0.6.0/lib/web/viewer.js
the correct request link should be like:
https://mydomain.com/vscode-remote-resource?path=/share/CACHEDEV1_DATA/.qpkg/qvscode/data/extensions/tomoki1207.pdf-0.6.0/lib/web/viewer.css
I don't know whether the extension itself or code-server causes the error?

Web Browser: Microsoft Edge 81.0.416.77
Local OS: Windows 10 Pro x64 1909 18363.836
Remote OS: QNAP QTS <IP_ADDRESS>0 ( Linux 4.14.24-qnap x86_64 )
code-server --version: 3.3.1

cc @code-asher

I can confirm the same behavior when using Edge. Chrome and Firefox seem to load the file without a problem.
These /webview requests are a bit weird because they are intercepted by a service worker and then retrieved over the websocket so they don't need to resolve as regular http requests.
On Edge I'm getting 401 unauthorized errors. So maybe this interception mechanism doesn't work on Edge and it's trying to run them as regular HTTP requests?
Something else is broken here though because for me on Chrome and Firefox sometimes the files load and everything works and sometimes they load but give these errors:
TypeError: firstPagePromise is undefined viewer.js:1191:7
TypeError: this.toolbar is null viewer.js:1199:5

Yea sounds like a bug in Edge then.

Similar problem still occurs on iPadOS 14.1 with Chrome 85.0.4183.109


Disable ssr prerender ? Just build spa app ?

Note: The code generator has deoptimised the styling of "E:/preact/hello/build/ssr-build/ssr-bundle.js" as it exceeds the max of "500KB"?
How to disable prerender when build ?

npm run build -- --prerender false should do the work.

For future users arriving here since its number 1 result from google: flag is now --no-prerender


Curious behavior when wrapping Module instantiation in multiple Module.apply invocations

The code below seems like a very reasonable thing to write:
class Minuser extends Module {
  val io = new Bundle {
    val a = UInt(width = 32).flip()
    val b = UInt(width = 32).flip()
    val c = UInt(width = 32)

    c := a -% b
  }
}

object Driver extends App {
  val s = Chisel.Driver.emit(() => Module(new Minuser))
  println(s)
}

but Chisel.Driver.emit calls elaborate which invokes Module.apply, so this is essentially double calling the apply method.
This results in the following, somewhat surprising FIRRTL:
circuit Minuser :
  module Minuser :
    input clk_7 : Clock
    input reset_8 : UInt<1>
    output io_9 : {flip a_3 : UInt<32>, flip b_2 : UInt<32>, c_1 : UInt<32>}

    io_9 is invalid
    io_9 is invalid
    node T_5 = sub(io_9.a_3, io_9.b_2)
    node T_6 = tail(T_5, 1)
    io_9.c_1 <= T_6

Is there any way we can deal with this?

Since code inside of bundles isn't kosher,
I want to double-check that isn't part of the issue.
On Monday, May 16, 2016, Jack Koenig<EMAIL_ADDRESS>wrote:

The code below seems like a very reasonable thing to write:
class Minuser extends Module {
val io = new Bundle {
val a = UInt(width = 32).flip()
val b = UInt(width = 32).flip()
val c = UInt(width = 32)
c := a -% b

}
}
object Driver extends App {
val s = Chisel.Driver.emit(() => Module(new Minuser))
println(s)
}
but Chisel.Driver.emit calls elaborate which invokes Module.apply, so this
is essentially double calling the apply method.
This results in the following, somewhat surprising FIRRTL:
circuit Minuser :
module Minuser :
input clk_7 : Clock
input reset_8 : UInt<1>
output io_9 : {flip a_3 : UInt<32>, flip b_2 : UInt<32>, c_1 : UInt<32>}
io_9 is invalid
io_9 is invalid
node T_5 = sub(io_9.a_3, io_9.b_2)
node T_6 = tail(T_5, 1)
io_9.c_1 <= T_6

Is there any way we can deal with this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/ucb-bar/chisel3/issues/192

The code in the bundle was a typo (would be nice if chisel could flag this somehow).  But by itself, without the extraneous wrapper module, does not cause the problem.

I've run into this issue before too. The unexpected names end up producing some unexpected verilog. This either needs to be supported or caught as an exception because otherwise it is a silent error.


.github: fix "Priorities" heading level

Priorities should have equal weight to the checklists.  It is not a subheading of them.
Description of changes

Things done

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
23.11 Release Notes (or backporting 23.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Priorities
Add a :+1: reaction to pull requests you find important.

Hmm that was intentional, but I didn't consider the nesting, I only thought that h2 was a bit too prominent for this kind of information, so I made all these headers at least h3


spyder has stopped working

<!---   *** BEFORE SUBMITTING: PASTE CLIPBOARD HERE TO COMPLETE YOUR REPORT ***   ---!>

Hi @Smruti06 could you provide us more info regarding your setup (OS, Python version, Spyder version, dependencies, etc)? As well as the way the error triggered for you?
Without more information there is not much we can do sorry :/

Closing due to lack of response


deployment of retina in default namespace

According to the docs ,they have deployed in the kube-system namspace. is it mandatory to deploy it in the kube-system namespace or can i deploy it in any other namespace ?

retina may be installed in any namespace


Documentation for the EditorController

We already started documenting many aspects of the codebase and we are documenting on the go. This ticket can be closed.


Update README with citation information of Gumbel Boxes paper.

@trangtran72 will take care of this issue in my next PR

PR #62


Fixed element usage for #1

I also get this error though still...

yeah, there's a lot of errors still, a lot of context issues it seems regarding usage of this, can you write tests and fix?  I'd love to use this if it worked


how do i make my android app device owner programmatically

how do i make my android app device owner programmatically.

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!


Largest area of rectangle with permutations-done

Added the working code for problem-Largest area of rectangle with permutations

Added pull request in main repo.


Expose Sidecar as a Service

I managed to add a sidecar to UPF. Now, I would like to expose the sidecar as an external service (using LoadBalancer or NodePort). I added the following to 5gSA-values.yaml file, but the service is not created:
upf:
...
containerPorts:
sidecaragent: 8005
services:
sidecaragent:
type: LoadBalancer
ports:
sidecaragent: 8005
nodePorts:
sidecaragent: 30301
What am I missing? Could you please provide details on steps to follow to allow exposing the sidecar as a service?

Hi @WardaChafika
Helm charts do not generate services by them self. You have to create the services (yaml file) you want in the templates folder of each chart you want to modify, and then, you can templating the file to change the config from the values file. I believe you can copy any of the services file created, and modify it for your use case.
BR,
Álvaro


Avoid or warn lock pool resource shortage

Is your feature request related to a problem? Please describe.
When BlockWorkerClientPool is used up (default 1024 threads), applications e.g., writing through Alluxio will stall.
Currently it is hard to tell the resource usage
Describe the solution you'd like
Ideally avoid resource starvation , or at least showing good message to indicate what's wrong
Describe alternatives you've considered
There might be multiple solutions, as proposed by different maintainers:
1 increase this pool size to much larger
2 remove the pool size bound as the purpose is to resuse initialized connection, not for resource binding
3 acquire resource with timeout
Urgency
Relatively high
Additional context

fixed by #14075, so that we introduce a metrics to track the usage of all dynamic resource pool


Create a new hook to enable data decimation

The beforeElementsUpdate hook can be used to decimate data. The chart elements will not be created until after this hook has fired ensuring that if decimation occurs, only the needed elements will be created.
This is a simpler take on #8251 that does not need to reorder any passes. Instead, the decimation plugin uses a heuristic to determine the chart width.
Results
Test 1 (uPlot Benchmark, 100 runs)

Master
PR

Average
53ms
20 ms

Min
37ms
13 ms

Max
175ms
137ms

Variation
138ms
124ms

Heap
36425.8 kB
21191.4 kB

Test 2 (10M data points, since run)

Master
PR

Render Time
2954.39 ms
153.13 ms

Decimation Plugin
{
	id: 'decimate-data',
	beforeElementUpdate: (chart, args) => {
		// Use an approximation since this is before scales are parsed
		const verticalAxisCount = Object.values(chart.scales).reduce((acc, scale) => acc += scale.axis === 'y' ? 1 : 0, 0);

		// assume ~50px for now. If the axis is actually wider then we have more points than needed
		// TODO: Take display settings into account and compute a more accurate guess for each axis
		const availableWidth = chart.width - (verticalAxisCount * 50);

		chart.data.datasets.forEach((dataset, datasetIndex) => {
			let i, point, x, y, prevX, minIndex, maxIndex, minY, maxY;
			const {data} = dataset;
			const meta = chart.getDatasetMeta(datasetIndex);

			if (meta.type !== 'line') {
				// Only line datasets are supported
				return;
			}

			const xAxis = chart.scales[meta.xAxisID];
			if (xAxis.type !== 'linear' && xAxis.type != 'time') {
				// Only linear interpolation is supported
				return;
			}

			if (!!chart.options.parsing) {
				// Plugin only supports data that does not need parsing
				return;
			}

			const decimated = [];

			const xMin = data[0].x;
			const xMax = data[data.length - 1].x;
			const dx = xMax - xMin;

			for (i = 0; i < data.length; ++i) {
				point = data[i]
				x = (point.x - xMin) / dx * availableWidth;
				y = point.y;
				const truncX = x | 0;

				if (truncX === prevX) {
					// Determine `minY` / `maxY` and `avgX` while we stay within same x-position
					if (y < minY) {
						minY = y;
						minIndex = i;
					} else if (y > maxY) {
						maxY = y;
						maxIndex = i;
					}
				} else {
					// Push up to 4 points, 3 for the last interval and the first point for this interval
					if (minIndex && maxIndex) {
						decimated.push(data[minIndex], data[maxIndex]);
					}
					if (i > 0) {
						// Last point in the previous interval
						decimated.push(data[i - 1]);
					}
					decimated.push(point);
					prevX = truncX;
					minY = maxY = y;
					minIndex = maxIndex = i;
				}
			}

			dataset._data = dataset.data;
			dataset.data = decimated;
		});
	}
};

I'm not quite sure how to read the results. Does that mean it went from 2086ms to 1487ms + 153ms or just 153ms? Good improvement either way, but if the latter then wow!!

I've updated that to be clearer. It's two different tests. On the main benchmark it went, on average over 100 runs, from 53ms to 20ms. Rendering 10M points, rendering time dropped from 2954ms to 153ms

I'm assuming if we had this new plugin, then we wouldn't get benefit from the existing line controller decimation anymore? I wonder if we removed the existing line controller decimation and added this general decimation plugin if we'd stay roughly equal in size, but come out ahead on speed and so maybe we should include this plugin in core in that case

@kurkle and I bounced that around too. It might be worth exploring since this also reduces memory overhead. That being said, without the plugin this is quite small.
Size Change: +152 B (0%)
Total Size: 217 kB

Filename
Size
Change

dist/chart.esm.js
63.1 kB
+56 B (0%)

dist/chart.js
79 kB
+59 B (0%)

dist/chart.min.js
57.3 kB
+37 B (0%)

+1 for having this behavior in the core and enabled via an opt.
i'm already not a fan of HighCharts needing the additional "boost" module either. at some point i'm going to add ** callouts for libs that require excessive and precise config to attain the shown bench results.

That's some good feedback @leeoniya. I agree that if we can find a way to make it on by default, it'd be great. In my ideal world, I'd try to make it enabled even when we have to parse and sort the data as it would be a good improvement for everyone. With that said, I did look at flot and they have the hook for decimation before parsing.
Some things I'd want to do on the plugin before we consider shipping it:

[ ] Support more axis types (log, timeseries)
[ ] Bail out early if data.length < 4 * width
[ ] Testing for heuristics and decide if fancier axis measuring is needed
[ ] Disable when the primary axis is y
[ ] Find a way to make this work better with editable data. Right now replaced dataset.data is disruptive

I think these new hook(s) could be valuable even if we do the decimation in core.
If doing in core (+1), it might be good to just have that new hook for controllers too, and implement it in the line controller. Does not make sense to have it in 2 levels, so moving from LineElement to LineController works for me.
Note: After this, the addElements only adds the dataset element, which is not what you'd except from the function name.

Can you expand a bit on what you're thinking for this? Do you mean having a beforeElementUpdate method on the controller that gets called first? Or do you mean a beforeElementUpdate hook that the dataset controller fires?

Can you expand a bit on what you're thinking for this? Do you mean having a beforeElementUpdate method on the controller that gets called first? Or do you mean a beforeElementUpdate hook that the dataset controller fires?

The first one, having a beforeElementsUpdate on the controller. I did not walk the code through, so not sure if that makes sense.

It might be possible to put it there though not sure if the controller should be modifying the data.

I made some progress. I added the plugin into the core (not yet enabled by default). I also added a new feature, dataset.dataKey that allows pointing the data stream away from dataset.data. My thinking is that users don't want their original array modified, so the decimation plugin stores the decimated data as dataset._decimated and then we tell the controller to treat datset._decimated as the array to listen to (for updates, etc). That should resolve a lot of the complexity with updates & user interactions.
Work Still To-Do

[ ] Document decimation plugin options
[ ] Test all controllers with dataKey feature
[ ] Decide on some initial options for decimation. Allow code to support configurable decimation algorithms in the future

dataKey seems a little risky to me because every plugin, etc. would have to understand to get data from dataKey instead of data which would add complication. I'd probably just stick the original data on another field called _originalData and replace data with the decimated data. The original array isn't be modified (just moved), so the user can easily maintain a reference to it outside the chart to maintain access to it without having to know about the _originalData field.

dataKey seems a little risky to me because every plugin, etc. would have to understand to get data from dataKey instead of data which would add complication. I'd probably just stick the original data on another field called _originalData and replace data with the decimated data. The original array isn't be modified (just moved), so the user can easily maintain a reference to it outside the chart to maintain access to it without having to know about the _originalData field.

We could create a getter for the data that uses dataKey. Would need to rename the original data property then to something else and default dataKey to that.

We could create a getter for the data that uses dataKey. Would need to rename the original data property then to something else and default dataKey to that.

I thought about the getter solution too. The reason I didn't implement it was what happens if someone did something like #7340 and passed the data in a class instance

I thought about the getter solution too. The reason I didn't implement it was what happens if someone did something like #7340 and passed the data in a class instance

I'm not sure I understand how the class instance relates to having a getter. They seem orthogonal to me, but I might be missing something

I'm not sure I understand how the class instance relates to having a getter. They seem orthogonal to me, but I might be missing something

I meant if the user passes in a class where data is already a getter, we may not be able to redefine it. This is also likely a problem for frozen data objects (hence why we moved the metas to chart._metasets). Perhaps we can put the data key there, or as you said, just modify the data array and tell the user that that's how the plugin works.
@kurkle @simonbrunel any thoughts?

I meant if the user passes in a class where data is already a getter, we may not be able to redefine it. This is also likely a problem for frozen data objects (hence why we moved the metas to chart._metasets). Perhaps we can put the data key there, or as you said, just modify the data array and tell the user that that's how the plugin works.
@kurkle @simonbrunel any thoughts?

The use passed data object can be stored in the config. we can build the chart.data.datasets[i] and have getter for that objects data property.
so chart.config.data.datasets[0].data would be the original data object. when decimated we lose any additional properties or prototype a data point has. What are we thinking differently?

The use passed data object can be stored in the config. we can build the chart.data.datasets[i] and have getter for that objects data property.
so chart.config.data.datasets[0].data would be the original data object. when decimated we lose any additional properties or prototype a data point has. What are we thinking differently?

Some clarification to what I was suggesting:
currently:
chart {
  get data { return this.config.data; }
  set data(data) { this.config.data = data; }
}

proposal:
chart {
  constructor() {
    this.data = { labels: [], datasets: [] };
  }
  set data(data) {
    this.config.data = data;
    // update('data'), or continue requiring user to call update()
  }
  buildOrUpdateControllers() {
    const datasets = this.data.datasets;
    const configDatasets = me.config.data.datasets;
    for (let i = 0, ilen = configDatasets .length; i < ilen; i++) {
      // simplified, update logic should remain
      datasets[i] = new ControllerClass(me, i, configDatasets[i]);
    }
  }

}

So chart.data.datasets array would contain the controllers, but setting chart.data would equal to setting chart.config.data (for compatibility, not sure if its needed).
Could also combine controller and its meta for reduced complexity and overhead, but I'm not sure if it would be good in all aspects.

Some clarification to what I was suggesting:
currently:
chart {
  get data { return this.config.data; }
  set data(data) { this.config.data = data; }
}

proposal:
chart {
  constructor() {
    this.data = { labels: [], datasets: [] };
  }
  set data(data) {
    this.config.data = data;
    // update('data'), or continue requiring user to call update()
  }
  buildOrUpdateControllers() {
    const datasets = this.data.datasets;
    const configDatasets = me.config.data.datasets;
    for (let i = 0, ilen = configDatasets .length; i < ilen; i++) {
      // simplified, update logic should remain
      datasets[i] = new ControllerClass(me, i, configDatasets[i]);
    }
  }

}

So chart.data.datasets array would contain the controllers, but setting chart.data would equal to setting chart.config.data (for compatibility, not sure if its needed).
Could also combine controller and its meta for reduced complexity and overhead, but I'm not sure if it would be good in all aspects.

@kurkle's idea seems fairly reasonable to me

@kurkle's idea seems fairly reasonable to me

I'm trying to think more about this. It could be very surprising if  chart.data.datasets was the controllers and many people may be using chart.data and assuming it is the data object they passed in. In v3 we did a lot of work to stop modify the data object passed by the user and this feels like a regression backwards.
Maybe I should just update the plugin to modify the dataset and keep the changes minimal force it to be opt-in. Something like this. When decimating in future updates, the plugin would need to look for _data first since that indicates whether or not the dataset has been mutated.

dataset._data = dataset.data;
dataset._decimated = dataset.decimated;

Object.defineProperty(dataset, 'data', {
  configurable: true,
  enumerable: true,
  writable: true,
  get: function() {
    return this._decimated;
  },
  set: function(data) {
    this._data = data;
  }
});

We'd probably want something to clean this up on chart delete and put the object back to what it was.

I'm trying to think more about this. It could be very surprising if  chart.data.datasets was the controllers and many people may be using chart.data and assuming it is the data object they passed in. In v3 we did a lot of work to stop modify the data object passed by the user and this feels like a regression backwards.
Maybe I should just update the plugin to modify the dataset and keep the changes minimal force it to be opt-in. Something like this. When decimating in future updates, the plugin would need to look for _data first since that indicates whether or not the dataset has been mutated.

dataset._data = dataset.data;
dataset._decimated = dataset.decimated;

Object.defineProperty(dataset, 'data', {
  configurable: true,
  enumerable: true,
  writable: true,
  get: function() {
    return this._decimated;
  },
  set: function(data) {
    this._data = data;
  }
});

We'd probably want something to clean this up on chart delete and put the object back to what it was.

I'm trying to think more about this. It could be very surprising if chart.data.datasets was the controllers and many people may be using chart.data and assuming it is the data object they passed in. In v3 we did a lot of work to stop modify the data object passed by the user and this feels like a regression backwards.

I agree with all of this.

Maybe I should just update the plugin to modify the dataset and keep the changes minimal force it to be opt-in.

I still think we might be able to do better than this
Here's another idea - what if we made meta.data hold the decimated data and chart.data.datasets.data could remain the original data? We'd have to be a little careful of which one we're using in the scriptable context and plugins, but hopefully it should mostly be pretty straightforward

I'm trying to think more about this. It could be very surprising if chart.data.datasets was the controllers and many people may be using chart.data and assuming it is the data object they passed in. In v3 we did a lot of work to stop modify the data object passed by the user and this feels like a regression backwards.

I agree with all of this.

Maybe I should just update the plugin to modify the dataset and keep the changes minimal force it to be opt-in.

I still think we might be able to do better than this
Here's another idea - what if we made meta.data hold the decimated data and chart.data.datasets.data could remain the original data? We'd have to be a little careful of which one we're using in the scriptable context and plugins, but hopefully it should mostly be pretty straightforward

I thought about something like that. meta.data is currently the elements, but meta.parsed is the parsed data (that would be decimated). The big downside that I thought of is that most of our examples would break subtly when decimating. We show the callbacks for the tooltips using dataset.data[index] and without decimation the index will match up, but as soon as there is any decimation, the indexes will be off and user tooltips could show the wrong data. I can see this leading to a lot of issues as users migrate over to v3.

I thought about something like that. meta.data is currently the elements, but meta.parsed is the parsed data (that would be decimated). The big downside that I thought of is that most of our examples would break subtly when decimating. We show the callbacks for the tooltips using dataset.data[index] and without decimation the index will match up, but as soon as there is any decimation, the indexes will be off and user tooltips could show the wrong data. I can see this leading to a lot of issues as users migrate over to v3.

Callbacks for tooltips are much simpler if they just use dataPoint or formattedValue (docs). Perhaps we should remove dataset from the context to avoid the possibility of users subtly tripping up as you mentioned and to encourage them to write it in the simpler way. I took a look at this and the one thing we'd need to change is that dataPoint is only the parsed value. We should probably add a rawPoint as well

Callbacks for tooltips are much simpler if they just use dataPoint or formattedValue (docs). Perhaps we should remove dataset from the context to avoid the possibility of users subtly tripping up as you mentioned and to encourage them to write it in the simpler way. I took a look at this and the one thing we'd need to change is that dataPoint is only the parsed value. We should probably add a rawPoint as well

Agreed that callbacks should use dataPoint or formattedValue, but if someone just skims the v3 docs and migrates, it will more or less work in simple cases which is my concern. @kurkle @simonbrunel any thoughts?

Agreed that callbacks should use dataPoint or formattedValue, but if someone just skims the v3 docs and migrates, it will more or less work in simple cases which is my concern. @kurkle @simonbrunel any thoughts?

Not sure what you mean by "more or less" - maybe you just meant "more"? Removing dataset would make it obvious for people, but if we don't want to do that it's rare that a chart has enough data to trigger decimation so maybe not that big a risk to leave it. Or we could also leave it and deprecate it - make it a get method that also prints a warning

Not sure what you mean by "more or less" - maybe you just meant "more"? Removing dataset would make it obvious for people, but if we don't want to do that it's rare that a chart has enough data to trigger decimation so maybe not that big a risk to leave it. Or we could also leave it and deprecate it - make it a get method that also prints a warning

My bad, that was an incomplete sentence. I was, as you said, trying to get across that it mostly works as intended unless decimation happens. I think that might be OK since decimation will be opt-in, but will let everyone else chime in before I implement.

My bad, that was an incomplete sentence. I was, as you said, trying to get across that it mostly works as intended unless decimation happens. I think that might be OK since decimation will be opt-in, but will let everyone else chime in before I implement.

Some changes.

Rebased against the latest from master
Removed the dataKey implementation and replaced using the descriptor idea above (still needs some testing to see how updates behave)

Some changes.

Rebased against the latest from master
Removed the dataKey implementation and replaced using the descriptor idea above (still needs some testing to see how updates behave)

Should we go ahead and remove the existing line decimation or did you prefer to leave that as a follow up for another PR?

Should we go ahead and remove the existing line decimation or did you prefer to leave that as a follow up for another PR?

I think it'd be good to leave that for another PR

I think it'd be good to leave that for another PR

Should we go ahead and remove the existing line decimation or did you prefer to leave that as a follow up for another PR?

I'm not sure we should remove it, because the late decimation works in wider range of cases (no scale type limitation and data can be immutable)

Should we go ahead and remove the existing line decimation or did you prefer to leave that as a follow up for another PR?

I'm not sure we should remove it, because the late decimation works in wider range of cases (no scale type limitation and data can be immutable)

I'm not sure we should remove it, because the late decimation works in wider range of cases (no scale type limitation and data can be immutable)

I can't remember the details of the existing one. Is its algorithm much different? Why would this plugin need a scale type limitation while the existing one doesn't?  I wonder if we should have an option to force the plugin to apply so that someone can use it with a custom scale.
I still think it'd be nice to make this plugin work with immutable data :smile:
In either case leaving the existing one in for this PR makes sense to me

I'm not sure we should remove it, because the late decimation works in wider range of cases (no scale type limitation and data can be immutable)

I can't remember the details of the existing one. Is its algorithm much different? Why would this plugin need a scale type limitation while the existing one doesn't?  I wonder if we should have an option to force the plugin to apply so that someone can use it with a custom scale.
I still think it'd be nice to make this plugin work with immutable data :smile:
In either case leaving the existing one in for this PR makes sense to me

@benmccann the difference between plugin and LineController decimation is, the plugin uses the data values and assumes linear distance between values, while the one in controller uses the actual coordinates from elements. That's why this plugin does not work with timeseries or category, those are not linear.

@benmccann the difference between plugin and LineController decimation is, the plugin uses the data values and assumes linear distance between values, while the one in controller uses the actual coordinates from elements. That's why this plugin does not work with timeseries or category, those are not linear.

@etimberg
https://github.com/leeoniya/uPlot/pull/455#issuecomment-778391754

I think we might need to account for that (0.5, 0.5) translation that is applied


Encode induction in synthesis query to get guarantees over infinite streams

It's unclear whether this is possible, hence the "research" label.
Can we get infinite guarantees from SAT? We can if we somehow figure out how to encode induction.

how to encode induction step?
what’s it mean for pipelining?
let’s take an example design: one stage multiply ab. assume ab is computed and then registered (rather than registering a and b and computing a*b after).
we want a guarantee that says the next output will be correct.
but my intuition isn’t telling me that it looks like normal induction, where you use the correctness of the previous output to prove correctness of the next output. it doesn’t feel like they’re related. so you moreso want a guarantee that, at any time t, all instructions in flight will be correct when they get output
so in the case of the multiplier, at time t, there are two calculations in flight: the calculation returning at this time, time t, and the calculation returning at the next step, time t+1. and then the inductive step between them presumably related to the fact that the calculation returning at t+1 in this step is the calculation returning at t in the next step.
i keep thinking, what does the next stage “want”? i.e. in our case, the calculation returning at t “wants” to be equal to the output, because it is just the identity function, i.e. it’s a register returning its value. the calculation returning at time t+1 “wants” to also be equal to the output a*b. maybe there aren’t two steps in this case, but just one? well, there are two assertions we need to make, but one of them is the one we’re already making: the output assertion. are the assertions on the…input to each register? Where are the assertions? if we have
---[reg]---
^            ^
a             b
Then i suspect we need assertions on either end of the register? but if we have
---[reg]---[reg]---
^         ^^          ^
a          bc          d
we probably don’t need assertions at b and c, even if there’s combinational logic between them. we can probably just take the assertion at c.
a core problem is also that our spec doesn’t tell us what our assertion should be. unlike the output, which we know from the spec, we don’t actually know the intermediate stage values. but we do know what we need the output to be. so can we make “baby step” assertions about each stage? my intuition is telling me there’s something there. it goes back to the idea of “wants” at each stage. can we represent a chain of “wants” as constraints?


Mastodon / activitypub / fediverse DM to nostr

client initiating action
Any nostr app
client receiving or observing action (or lack thereof)
Any mastodon app
timestamp
https://github.com/damus-io/damus/issues/2489 by @sjors
what happens
Damus, and I suspect any Nostr app DMs are incompatible with mastodon DM's. This is not surfaced to the nostr user. There is potential for negative user experience.
question
How might app devs and designers handle this incompatibility?
How might nostr devs handle non-private DMs on mastodon?

How might nostr devs handle non-private DMs on mastodon?

I have a pull request for Mostr that proposes to simply respond with an auto-reply: https://gitlab.com/soapbox-pub/mostr/-/issues/91
That is for DM messages going from Fediverse to Nostr.
This seems like the best solution until Mostr actually implements DM. Sending message from Mastodon to Nostr would be very simple using nip-04. The Mastodon user already has no expectation of encryption, knows the site admins on both sides can read along, and the main Mastodon client clearly warns about that.
But on the nostr receive side it would be obvious for everyone to see who you're receiving DM's from. Unless you do something like gift wraps. There might be a nice solution there.
The other way around is much trickier to deal with for reasons I explain here.
I'm worried much more about the downgraded experience of a Nostr user sending a DM to a Mastodon user (suddenly becomes plain text) then the other way around. But it seems weird to implement DM in only direction. This is why I'm inclined to just disable it altogether, until something like (interoperable) MLS saves the day.

All encrypted messages eventually get converted into plaintext. On Primal for example, the message is decrypted to be displayed on my screen. Therefore, it is always a concern that any Nostr app could then send your decrypted messages somewhere else.
The issue with the bridge is that it's guaranteed that a third-party (mostr) would decrypt the message first, before sending it to ANOTHER third-party (ActivityPub server), until it's eventually received by the recipient. IF we implemented DMs over the bridge.
I get that. It's something people should be aware of.
But I am less bothered by this idea than I was nearly 2 years ago, especially for NIP-04 which people already believe is unsalvageable. There is always a chance the recipient, or some middleman, will leak it. It is the responsibility of the sender to make informed choices about what they share with whom over which channels.
Anyway, I said all of that but I'm still probably not going to implement it. I just said it to argue for no reason. However if someone did implement it, I would not be against it.

To me, nostr is about empowering the end user to make informee choice and making them aware of tradeoffs.
I support the spirit of @alexgleason suggestion of warning nostr users who are considering sending DMs to mastodon

This user is bridged from an external network. Your message may not be seen, and it could be intercepted by third parties.

I suggest the above as a best practice for nostr DM apps who allow their users to interact with mastodon.


Interceptor returns string on error and object on success

Hi All,
On version 0.14.0, am I missing something?
instance.interceptors.response.use(undefined, err => {             console.log(err);         });
Return an object on success: '{data: Object, status: 200, statusText: "OK",...}'
But on a 401 it returns: 'Error: Request failed with status code 401'

Update:
In lib/defaults.js:
validateStatus: function validateStatus(status) {     return status >= 200 && status < 300; }
Fails for greater status codes greater than 300 so a 401 isn't handled. Setting:
validateStatus: function (status) {      return true;  }
in the instance config is a workaround.

With that you've created a bug only, that will send to the first (undefined in your case) callback a valid response even if there is an error (>300) response, do something like this
instance.interceptors.response.use(undefined, err => {
const res= err.response;
console.log(res.status);   //401
})


Modify RepositoryInterface to support Traversable return values

See related discussion from wheniwork/api-data-layer#56.

:+1: excellent! I checked the other repos and none of them say they return an array.


--use-orchestrator param

#365

Codecov Report

Merging #395 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master     #395      +/-   ##
============================================
+ Coverage     79.94%   79.96%   +0.01%
- Complexity      480      481       +1
============================================
  Files            66       66
  Lines          1551     1552       +1
  Branches        234      234
============================================
+ Hits           1240     1241       +1
  Misses          173      173
  Partials        138      138