Data observatory frontend integration

In order to revamp the Data Observatory analysis form (design here https://invis.io/5G9YKGISB), the current SQL call is not enough, and we need to use all the helpers already available in the API.
@talos we need some guidance, let me do some questions about the Data Observatory:

Could you point us to the proper documentation? I know we have all signatures listed here https://github.com/CartoDB/dataservices-api/blob/development/client/renderer/interface.yaml but it should be great to know what method to use when.
How do we need to manage the geometry param? I can see some methods accept a bounds param of type geometry, but not sure how to deal with it. Can we pass a country name? Do you have an example of this param using the current bounding box?
Related to above, how do we get the regions available? If you see the design, there is a number next to the region's name, I guess is the number of measurements available in that region. Does the API provide this number?
We can't see the new column name to augment the dataset, how does it work?

A measurement has a structure like this, according to the API response:
{
    numer_id: "xxx",
    numer_name: "...",
    numer_description: null,
    numer_weight: "3",
    numer_license: null,
    numer_source: null,
    numer_type: "Numeric",
    numer_aggregate: "sum",
    numer_extra: null,
    numer_tags: {
         section/tags.ca: "Canada",
         unit/tags.people: "People",
         subsection/tags.language: "Language",
         license/ca.statcan.license.statcan-license: "Statistics Canada Open Licence Agreement",
         source/ca.statcan.license.statcan-census-2011: "Statistics Canada Census of Population 2011"
    },
    valid_denom: false,
    valid_geom: false,
    valid_timespan: false
},

In order to implement the filters, should we use tags?
I see the description is null in almost every result, how we get the description of a measurement? and for filters?
In order to run the analysis, what parameters are mandatory? region and measurement? all but normalize?

@rafatower do you see any troubles in order to get the quota info? Take in mind we can have multiple measurements embedded in the same form.

@nobuti I'll try to answer some questions:

In order to implement the filters, should we use tags?
This was thought and designed far time ago but I can't remember why didn`t we make it. Perhaps @saleiva or @talos can explain you better. But anyway, I update the InVision project and  I added another screen for the flow where it can see when you have for instance 2 filters applied. This mention appears on entry point for filters. You can see the sample:

https://projects.invisionapp.com/d/main#/console/10012782/220110025/preview

I see the description is null in almost every result, how we get the description of a measurement? and for filters?
The description for each measurement and filter is from Table of content where if you select any measurement/description you can find a short description. Here for the measurement:

Here for the filters:

@urbanphes thanks but I meant it from the API point of view, is that available in the response data returned by the API?

@rafatower do you see any troubles in order to get the quota info? Take in mind we can have multiple measurements embedded in the same form.

The only thing that you should take into account is that in order to calculate the quota to be used you have to multiply N rows x M measurements.

Let me take a stab at answering...

Could you point us to the proper documentation? I know we have all signatures listed here https://github.com/CartoDB/dataservices-api/blob/development/client/renderer/interface.yaml but it should be great to know what method to use when.

The best place to look for right now is in the OBS Explorer, which provides a way to navigate metadata visually and is powered by the dimensional metadata functions (OBS_GetAvailableNumerators, OBS_GetAvailableDenominators, OBS_GetAvailableGeometries, and OBS_GetAvailableTimespans).  The relevant code for that is here.
I've also made a ticket that I will take care of today for full documentation for these functions.

How do we need to manage the geometry param? I can see some methods accept a bounds param of type geometry, but not sure how to deal with it. Can we pass a country name? Do you have an example of this param using the current bounding box?

The geometry param has to take a geometry, not a country name.  The example above uses the current user's bounds.  My thought would be we should use the greater of the current map view and the user's own bounds.  Using either an envelope or a geometry is fine; if we use a proper geometry, then measures that might be inside an envelope but not that specific geometry will be excluded.

Related to above, how do we get the regions available? If you see the design, there is a number next to the region's name, I guess is the number of measurements available in that region. Does the API provide this number?

Regions available are provided via tags.  I will provide SQL that will provide this rollup.

We can't see the new column name to augment the dataset, how does it work?

Once a user's selection is made, you should call the OBS_GetMeta function.  This will provide all missing information, including a colname that you can work with.  However, it still would be wise to append some additional metadata to construct your own colname.  I will provide an example of a strategy to do this.

In order to implement the filters, should we use tags?

Yes.  The filters as envisioned in the mockups are the subsection tag type.

I see the description is null in almost every result, how we get the description of a measurement? and for filters?

Some measurements don't require an extended description, and for those we return NULL.  Names should always be human readable, and in such cases where description is NULL the name should be sufficient.
I'm not quite sure what you mean by a description for filters.

In order to run the analysis, what parameters are mandatory? region and measurement? all but normalize?

In order to run the analysis, OBS_GetMeta needs to be run first to "fill out" all metadata fields that the user hasn't yet specified (including some internal ones the user could never specify).  OBS_GetMeta can be operated with a very minimal set of options -- just a numer_id and a geometry is sufficient -- and it will return a rich JSON blob with all the other information filled in, which could be used to prepopulate dropdowns if necessary.

Documentation for OBS_GetMeta can be found here

Thanks @talos, what I meant by description for filters is this. In the second step on the measurements dropdown, the user can access to filters:

@nobuti I've put together an extensive gist that answers all your questions, as well as provides sample API functions for all elements of the interface where they're needed.
Unfortunately, I was not able to populate the responses yet because of the ongoing S3 outage.  Once that's fixed, I can go back and populate the missing example responses.

@nobuti Full docs for those functions are now availablee here and should hopefully be merged in ASAP.

@talos, in this request:
SELECT * FROM OBS_GetAvailableNumerators(
  <View or data boundary>,
  <Postgres Array of tags to filter by, AND'ed>
) numbers

Could you explain an example using view and another using data boundary?

Also, this parameter is coming from the regions field in the UI?

@xavijam I'm not sure I understand -- it works the same way with view or data boundary, you're passing in a Geometry to the API.  I don't know internally how you obtain either from the user.
@nobuti The tags to filter by section should come from the regions field, yes, in particular the region_id returned from the first query in that gist.  It could be NULL if we had the "data extents" option, but if we don't it will always be populated.

What is View? -> could you paste an example of this request?
Data boundary -> bounds of the region using ST_MakeEnvelope?

Example of making this request by view:
SELECT * FROM OBS_GetAvailableNumerators(
  ST_MakeEnvelope(<map left>, <map bottom>, <map right>, <map top>, 4326)
)

By data boundary:
SELECT * FROM OBS_GetAvailableNumerators(
  ST_SetSRID((SELECT ST_Extent(the_geom) FROM <usertable>), 4326)
)

Does that  make sense @xavijam ?  The same semantics would apply for all the other meta functions.

@talos we are a bit concerned about the number of requests needed to run the analysis. I know pretty much nothing, so let me dream here. And forgive me for it.
Ideally, we would need only one request, in a similar manner we have now using obs_legacybuildermetadata, is this possible?
If not possible, at least we should save some requests. For example, I think is possible to avoid the filter's request, a measurement already has a subsection/tag.whatever that is precisely the filter that it "belongs to". It would be nice to have a unique key for all, in order to simplify the filtering in the frontend. In the same manner, we should try to add the timespan, normalize or boundaries information to this.
On the other hand, the measurement API call has the heavier response with a difference. We should try to get rid of every data not needed for the UI. For instance, a measurement has this structure:
{
  numer_description: "",
  numer_id: "ca.statcan.cols_nhs.t013c049_f",
  numer_name: "Income taxes paid as a % of total income (female)",
  numer_weight: "1",
  numer_license: null,
  numer_source: null,
  numer_type: "Numeric",
  numer_aggregate: "quantile",
  numer_extra: null,
  numer_tags: {
    license/ca.statcan.license.statcan-license: "Statistics Canada Open Licence Agreement",
    section/tags.ca: "Canada",
    source/ca.statcan.license.statcan-nhs-2011: "Statistics Canada National Household Survey 2011",
    subsection/tags.income: "Income",
    unit/tags.ratio: "Ratio"
  },
  valid_denom: true,
  valid_geom: false,
  valid_numer: true,
  valid_timespan: false
}

I can see some keys that they don't have a direct translation from the UI point of view, as numer_weight, numer_license (I think the real license is part of numer_tags.license/whatever), numer_source, numer_type, numer_aggregate, numer_extra or unit/tags.ratio, valid_denom, valid_geom... Do we need them to run the analysis?
And finally, I find the API a bit overwhelming from the frontend point of view. Could we have some wrappers to encapsulate all the logic? Below I write down the signature of these wrappers (keep in mind that their name as just suggestions, and maybe even they are wrong or incomplete due to my lack of understanding).
Like I said, in the best case scenario, we would need this request:

obs_builder_metadata()

If not possible, it would be nice to have two requests max, one for regions and one for measurements:

obs_builder_regions()
obs_builder_measurements(dataset, region_id): this will calculate the view's geometry data from the region and the dataset internally.

In the last term, if not of above is possible, we will have other 3 requests to get the rest of the data:

obs_builder_timestamp(dataset, region_id, measurement_id)
obs_builder_normalize(dataset, region_id, measurement_id)
obs_builder_boundaries(dataset, region_id, measurement_id, timespan)

What do you think? Is any of this possible?

Thanks for all the comments!  Very much appreciated.
There are a few columns in OBS_GetAvailableNumerators that you are correct are not especially needed.  Some, like weight and license could simply be eliminated.
While I generally prefer SELECT *, if you wanted to reduce the weight of the response the simplest approach would be to SELECT only the columns you needed -- excluding the license, weight, valid, etc.
@saleiva mentioned the responses are coming in heavier than you'd like.  Do you have an example request so I could think of ways to trim it down?
I'm not sure I see how we could get rid of requests subsequent to the main measurements one (geometry, timespan, normalization).  Geometries, timespans, and normalizations are all shared between measurements, so to include them nested would explode the size of the response.  And each time a different measurement is selected, the exact set that works changes, so I don't see any way to avoid subsequent requests on selection change.
For example, if someone chooses "Total Population" in the USA, then "2011 - 2015" for timespan, they will have county, census tract, zip code, and many other geometry options.
However, if they switch their timespan to "2006 to 2010", they will no longer have zip code as an option, as that's not a geometry that was published by the Census in that release.  I don't see any practical way to capture that information without either very large, complex nested objects (which will excacerbate existing response sizes) or making several requests (which is what we're doing now).
There may be some reasoning behind combining the initial region selector and measurements options into one request.  Indeed, it should be possible to rewrite that SQL into a nested version that could achieve that.  However, it would likely again somewhat bloat response sizes.
That would look something like this:

obs_measurements_by_region
obs_getavailabledenominators
obs_getavailablegeometries
obs_getavailabletimespans

One could argue for having that first one be absorbed into the extension API, but to me it seems very specific to the Builder implementation and thus better left as custom SQL outside the extension.

Perfect @talos, we will do that. I certainly will need your expertise for specifics along the way, so forgive in advance for repeated pings in the future. If you don't mind, let's leave this issue open for these questions.

Sounds good to me! @nobuti would you like me to draft that obs_measurements_by_region function?

@talos what I meant is we are going to use the API without any wrapper or extra function, don't worry. I'm going to need some help to fine tune the queries, though.

@talos I have this call for measurements by region according to the docs:
http://cdb.localhost.lan:8080/api/v2/sql?q=SELECT numer_id, numer_name, numer_description, numer_tags FROM OBS_GetAvailableNumerators(ST_SetSRID((SELECT ST_Extent(the_geom) FROM {dataset}), 4326), '{section/tags.united_states}') numers&api_key={api_key}

This yields to:
{
  rows: [
    {
        numer_id: "us.zillow.AllHomes_Zhvi",
        numer_name: "Zillow Home Value Index for All homes",
        numer_description: null,
        numer_tags: "{"unit/tags.index": "Index", "subsection/tags.housing": "Housing", "section/tags.united_states": "United States", "subsection/us.zillow.indexes": "Zillow Home Value and Rental Indexes", "source/us.zillow.zillow-source": "Zillow Data", "license/us.zillow.zillow-license": "Zillow Terms of Use for \"Aggregate Data\""}"
    },
...
  ]
}

Just to confirm, can we consider subsection/tags% the filter the measurement belongs to?
I found some measurement doesn't have subsection/tags% in my local environment, is this possible? Does this mean this measurement doesn't have a filter to be categorised?

Just to confirm, can we consider subsection/tags% the filter the measurement belongs to?

That is correct

I found some measurements don't have subsection/tags% in my local environment, is this possible? Does this mean this measurement doesn't have a filter to be categorised?

That is also correct.  We have some measurements, for example the quantiles for the USA, that are not currently attached to a subsection.  This means that they don't appear in the Catalog, and it would be best to exclude them for the time being.

@talos one question related to the data boundary. This query to get measurements:
SELECT * FROM OBS_GetAvailableNumerators(
  ST_SetSRID((SELECT ST_Extent(the_geom) FROM <usertable>), 4326)
)

if there is already an analysis applied to that node, should it remain as it is? I mean, in order to get the data boundary, should we use ST_SetSRID((SELECT ST_Extent(the_geom) FROM <usertable>), 4326) no matter custom queries or analysis already applied?

Good question @nobuti .  I defer to @rochoa's knowledge of camshaft internals on that one -- we should be using whatever query would get us the data extents from the last analysis in the pipeline.

@talos, sorry, but how is this related to camshaft?
@nobuti, I guess we can use the same approach we use for determining the geometry type of an analysis. However, this might be a bit more problematic as doing an ST_Extent means we need to full scan the analysis query/table (given no index is created and we cannot use ST_EstimatedExtent for the queries).

@rochoa It may not be, but I thought it may be and that you would know.  It sounds like the answer is "no," then.  I asked because I have not written these UI components before, and am not a good source of truth for how to introspect user data.  I thought that since the question was related to analysis chains, it may involve Camshaft.
It sounds like you answered the question.  I don't have any insight as to how to provide a more performant spatial extent in the absence of indexes.  I suppose we could use the extent from the original table, and see if any funky edge cases crop up.  For the most part the original user data should bear a strong relation to the user data even after several chains of analysis.

@talos Thanks :). I was wondering if we could provide anything from camshaft to facilitate the solution, but as you might have realised, it's not that easy.
About using the original table extent, that could work in some scenarios, but once we apply some filters (via widgets) to source nodes, the extent will not be very representative, I guess.

The more I think about it, the more I think it's OK to use the original table extents.  Widget filters are normally applied after the analysis pipeline is built instead of before, and besides people should be able to pick the correct country if we default to the wrong one.

Hey guys, we have a question about the column that is created for DO analysis. Seems like @talos mentioned that we need to make a request in order to obtain the name of the column. But in the other side, camshaft is waiting for the name of the column https://github.com/CartoDB/camshaft/blob/master/reference/versions/0.47.0/reference.json#L283.
From our point of view, we have to change it in any place. It doesn't make any sense to make a request for later provide it to camshaft. Could we just set the column the user wants like before? Or not provide it and just populate the one that DO provides?

That camshaft node doesn't support multiple column outputs.
@rochoa we'll need a new Camshaft node to handle the new DO interface, no?
I'd be in favor of not letting the user pick, as opposed to forcing the user to pick each time -- remember, we can come up with high-quality names, and they might select a lot of different columns.

@talos, yes, we need a new node:

Can you create that new node in camshaft that handles multiple segments?
Do you think we could do that automating column name generation within that camshaft node?

@rochoa Unless we can make multiple SQL calls in a single node, this will be problematic -- basic issue is that neither pure SQL nor PL/pgSQL can handle returning arbitrary columns.  That's why obs_getdata was implemented to return JSON.
However, if we can make two separate calls, and do the custom query writing in JS, then we're OK.
Happy to hop on a quick call tomorrow to try to figure out an implementation strategy.

@talos, let's talk today. However, Camshaft's current design doesn't allow doing more than one query per node.
cc @jorgesancha

Yes, let's talk today then.
It's worth pointing out that we still did more than one query with the old
design too.  I think we could reuse that model -- make the metadata calls
in the UI, then pass the results of those to the Camshaft node.  Those
metadata UI calls already include column naming information, so we should
be OK.
On Fri, Mar 31, 2017 at 4:17 AM, Raul Ochoa<EMAIL_ADDRESS>wrote:

@talos https://github.com/talos, let's talk today. However, Camshaft's
current design doesn't allow doing more than one query per node.
cc @jorgesancha https://github.com/jorgesancha
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/CartoDB/cartodb/issues/11663#issuecomment-290647910,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAZYV1KiRlmZiJ_vA5iIObvNMs2ECISBks5rrLa0gaJpZM4MOTZT
.

After discussing the problem with @xavijam, @nobuti, and @jorgesancha, and with the already mentioned limitation in Camshaft, the frontend will take care of sending, both, the different measurements and the column names, as proposed in https://gist.github.com/talos/554c7759bafe53faafd23a9711305220#answering-questions-from-issue-11663.
However, the column name generation should happen and be returned from the call to OBS_GetMeta, so instead of delegating the column name composition to the client the API will be responsible for that. @talos, apart from the current fields the response should contain a suggested_column_name, or similar, field. Do I need to create an issue for you to handle that new feature?
On Wednesday, I will work with @nobuti to see if we can improve the situation with the number of requests. Meanwhile, I will create a new Camshaft analysis to be able to use multiple measurements/columns.

Sounds good.  Yes, please make a ticket to add a suggested_column_name
from OBS_GetMeta.
My gentle suggestion for simplest implementation of camshaft node would be
that it takes a JSON argument, meta, which is directly from the
OBS_GetMeta called from the UI.
On Fri, Mar 31, 2017 at 12:06 PM, Raul Ochoa<EMAIL_ADDRESS>wrote:

After discussing the problem with @xavijam https://github.com/xavijam,
@nobuti https://github.com/nobuti, and @jorgesancha
https://github.com/jorgesancha, and with the already mentioned
limitation in Camshaft, the frontend will take care of sending, both, the
different measurements and the column names, as proposed in
https://gist.github.com/talos/554c7759bafe53faafd23a97113052
20#answering-questions-from-issue-11663.
However, the column name generation should happen and be returned from the
call to OBS_GetMeta, so instead of delegating the column name composition
to the client the API will be responsible for that. @talos
https://github.com/talos, apart from the current fields the response
should contain a suggested_column_name, or similar, field. Do I need to
create an issue for you to handle that new feature?
On Wednesday, I will work with @nobuti https://github.com/nobuti to see
if we can improve the situation with the number of requests. Meanwhile, I
will create a new Camshaft analysis to be able to use multiple
measurements/columns.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/CartoDB/cartodb/issues/11663#issuecomment-290755533,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAZYV0HbSz-we5MjwIYUIJU45D9KAMCWks5rrSSTgaJpZM4MOTZT
.

@talos, can you explain a bit more, an example would be awesome, about the meta argument?

@rochoa OK, I think this explains it pretty well:
https://gist.github.com/talos/97a0f1ac1bb101cd4533dd5d892bc4a1
Essentially, when the user presses "apply" in the UI, a call to OBS_GetMeta with all their selected inputs should be run.  The result of that is a JSON array, which can be passed to the camshaft node, which can handle everything else.

The problem I see with that approach is that it's not clear for the end user what it needs to send, that's, what is the relevant part? Furthermore, Camshaft discourages the usage of complex params because that will expose a complex API to the end-user.
However, I like your idea of having pairs `[['us.census.acs.B01003001', 'colname1'], ['us.census.acs.B01003001', 'colname2']].
I'll CC you in the CR, ok?

OK -- because GetData requires the output of GetMeta to work, and there's no way to dynamically construct a query with the results of GetMeta without making two queries, I see no way to avoid this.  But I'm all ears if you figure something else out.

Hi @talos, I'm working with OBS_GetMeta, and I have a few questions:

Documentation says that normalization param should be one of 'area', 'prenormalized', or 'denominated'. How do we know when to use one or another? I guess denominated is when the user has selected a normalization value, prenormalized by default but area?
I'm getting null as the response if I set the numer_timespan, no matter the rest of params as far I can see. For instance, this request SELECT OBS_GetMeta((SELECT ST_SetSRID(ST_Extent(the_geom), 4326) FROM (SELECT * FROM cdb.walmart_copy) q), '[{"numer_id":"us.census.acs.B03002002","numer_timespan":"us.census.acs.B01003001"}]'). Is that the intended behaviour? Am I missing something?

From the docs:

normalization: The desired normalization. One of ‘area’, ‘prenormalized’, or ‘denominated’. ‘Area’ will normalize the measure per square kilometer, ‘prenormalized’ will return the original value, and ‘denominated’ will normalize by a denominator. Ignored if this metadata object specifies a geometry.

Unfortunately, the docs are currently missing an example of numer_timespan in action with OBS_GetMeta.  Since the purpose of the argument is to specify a timespan, you should pass one in.  From the above, it looks like you passed in another measure ID.  Try this:
SELECT OBS_GetMeta((SELECT ST_SetSRID(ST_Extent(the_geom), 4326) FROM (SELECT * FROM cdb.walmart_copy) q), '[{"numer_id":"us.census.acs.B03002002","numer_timespan":"2011 - 2015"}]')

Let me know how that works, @nobuti .

Also, RE denominated -- if no denom_id is specified, OBS_GetMeta will choose (and return that choice) essentially at random.

Closing because it is already working but we are polishing it 🎉 .


Plugin conflict

Hello,
I'm using your plugin in one of my project, it work well except when I try to use it in correlation with another one: WebGLInput
Since the use of IME cause to loose some feature of Text Mesh Pro like mouse selection. In my project I want to be able to copy/paste without the need of IME (for latin language).
So I use both your plugin and WebGLInput.
I made a simple project based on the source code of the other plugin and I added your plugin.
The problem seems to be caused by WebGLCopyAndPaste.jslib at line 56.
Probably in conflict with the code of other plugin: UnityEngine.WebGLInput.captureAllKeyboardInput = true; in WebGLInput.cs at line 235 and 243
The bug cause two problems:

UnityEngine.WebGLInput.captureAllKeyboardInput = true; seems to cause side effect like described here
To reproduce this in the sample, select the input at top right, deselect it then select it again. Now if you press any key it will be printed twice in the input field. Also each time you unselect and select again the inputfield it will write the key once more when you press it.
It seems that normal character inputs are not catched by the html inputfield but is catched by inputfield in Unity. The IME seems to work properly if not in ASCII mode.

When I comment all the code in WebGLCopyAndPaste.jslib from line 37 to line 60 the problems seems to be solved. Also remplacing only the line 56 from return fn.apply(this, hArgs); to return fn.apply(this, args); solve it too.
Of course I don't understand what this code do exactly so just replacing this line don't seems to be a wise solution!
Do you have an idea on how to fix this properly?

@PlayaPeter Sadly no, If think I chose to disable the use of the other plugin if user don't use IME

Too bad.  Anyhow, thanks for the quick response! Guess I'll just get rid of the HTML overlays then to avoid the problems.


Convert mobile app lynda videos

I have downloaded from mobile app is there any way to convert those videos as my lynda account got expired i can't able to view my offline videos.
Kindly help.

Did you go over the lists of open+closed issues to see if maybe this was already asked (and answered) before?
You have 2 options:

Get a new account.
Figure out if the files you have are either .ldcw or .lynda, and if they are, copy the files to a computer with a windows OS, and run the decryptor according to the instructions on the main page.

If you did both of these things and neither of them worked, tell us what exactly you tried (which error messages you got etc.) and we'll try to help.


[MNT] - Add test for compute_spatial_bin_assignment

This responds to #8

Hey Tom, I just updated this branch so it gets all the updates we made. And I made some modifications based on your suggestions, now it passes all the tests and is ready to be merged!


Possible to set an image instead of text?

I'll consider it. Thanks for your advice

I'll consider it. Thanks for your advice


How do I make sure  the model is good while training

Someone has taught me to look at the plots/align.png whether is a line,  like

Could you anyone tell me how to judge the model now is good,  and  I can stop the training.
thanks.

@alex73 @nsmetanin @r9y9 @neverjoe  thanks very much


little update to PathTree visualisations

This resolves #622 .
A few additions that @sroet found to be useful or being a bug fix.

SampleSet.__contains__ can be tested with replica_ID int, ensemble Ensemble or a sample Sample that is contained.
some code cleanup in visualization.py
Convenience functions to add custom css styles to your PathTree. The tutorial notebook has already been updated (my fault, wrong PR)
Added some more CSS classes to better selected specific elements to be changed
The function that generates the list of samples for ReplicaEvolution now only uses samples that appear in the steps provided. It will not scan longer.
There should also been an update in the previous PR that takes care of the issue of * for steps in other files.

Ready to be reviewed.


Added Net Present Value Calculator

Fixes Issue🛠

Closes #661
Description👨💻
Added a Net Present Value (NPV) calculator is a powerful financial tool designed to help users evaluate the profitability of an investment by calculating the present value of future cash flows.
Type of change📄

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)

Checklist✅

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have added demonstration in the form of GIF/video file
[x] I am an Open Source Contributor

Screenshots/GIF📷

Congrats on getting your PR merged to the repo under GSSOC 2k24 🎉 @Manav173


The vanish addon is loading before my vanish.

[title]

The problem isn't with the vanish plugin or with pl3xmap. The problem is you have another unrelated plugin installed that uses the provides api (like FAWE) in it's plugin.yml file. This feature was implemented incorrectly in Spigot back in March of 2020, and sadly any plugin that uses this feature has a high risk of mangling up the load order for any and all plugins that use softdepend.
No one seems to want to fix this. I blame plugins that use provides knowing it's broken. The plugins that use provides blame spigot. spigot blames plugins like pl3xmap for using softdepend.

no i dont have fawe

I didn't say you did..


Say/think bubbles should work with RTL

Expected Behavior
On command

the text is expected to appear on the stage - with the question mark to the left.
Actual Behavior
The question mark appears on the right:

@chrisgarrity Is this filed somewhere else as well?


Ccross-origin object Erro mailChimp

I'm not able to receive the response of my subscription (mailship form).
Printed Error:
[Show/hide message details.] SecurityError: Permission denied to access property "host" on cross-origin object
I am running my page on Netlify  system, and I have checked that subscription is working, the error seams to be on the callback.
Do you know if I need to do something different?

Can you paste in the URL you put into the _config.yml?

Yep:
mailchimp_action: https://overhackingview.us6.list-manage.com/subscribe/post-json?u=0c80b66360862ed72c16dcb96&id=76324a0c67

Hm that looks right. https://github.com/samesies/barber-jekyll/blob/master/_includes/subscribe-form.html just takes that and adds a callback.
And you have the right mailchimp_input for your form?

For subcription i've just updated the mailchimp parameters:
mailchimp_action: https://overhackingview.us6.list-manage.com/subscribe/post-json?u=0c80b66360862ed72c16dcb96&id=76324a0c67
mailchimp_input: b_0c80b66360862ed72c16dcb96_76324a0c67
Do I need to do something else?

That's all I have. Can you try putting in what comes with the theme and running it? See if you're getting the same error. Because mine is still working.

Ran into the same issue.. Did you ever resolve?  It's something with the callback; the subscription actually goes through.   My band-aid was to modify the error message, but now my users won't know if there is an actual problem upon subscribing .

I have the exact same issue using Mailchimp and Netlify. Like @qwizztest, I get an error message each time:

But the subscription goes through:

Oddly, when I revert to your MailChimp settings, everything works just fine:

Any ideas?

@ucpete The example shows to use post-json, so that's probably why I never got this issue. I will update the README in the next few days. I will also check if replace works in Jekyll.


LD_LIBRARY_PATH on linux

Trying to run the samples, it fails to load the libdawn_native.so. Setting LD_LIBRARY_PATH manually fixes this.
Debugging with LD_DEBUG=libs gives me:
(node:18056) ExperimentalWarning: The ESM module loader is experimental.
     18056:     find library=libdawn_native.so [0]; searching
     18056:      search path=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/haswell/x86_64:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/haswell:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/x86_64:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/haswell/x86_64:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/haswell:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/x86_64:/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release             (RUNPATH from file /home/pelle/test/webgpu/node_modules/webgpu/generated/0.0.1/linux/build/Release/addon-linux.node)
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/haswell/x86_64/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/haswell/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/x86_64/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/tls/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/haswell/x86_64/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/haswell/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/x86_64/libdawn_native.so
     18056:       trying file=/mnt/c/Users/maier/Desktop/LXSS_SHARED/webgpu/generated/0.0.1/linux/build/Release/libdawn_native.so
     18056:      search cache=/etc/ld.so.cache
     18056:      search path=/lib/x86_64-linux-gnu/tls/haswell/x86_64:/lib/x86_64-linux-gnu/tls/haswell:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/haswell/x86_64:/lib/x86_64-linux-gnu/haswell:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64:/usr/lib/x86_64-linux-gnu/tls/haswell:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/haswell/x86_64:/usr/lib/x86_64-linux-gnu/haswell:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/tls/haswell/x86_64:/lib/tls/haswell:/lib/tls/x86_64:/lib/tls:/lib/haswell/x86_64:/lib/haswell:/lib/x86_64:/lib:/usr/lib/tls/haswell/x86_64:/usr/lib/tls/haswell:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/haswell/x86_64:/usr/lib/haswell:/usr/lib/x86_64:/usr/lib          (system search path)
     18056:       trying file=/lib/x86_64-linux-gnu/tls/haswell/x86_64/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/tls/haswell/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/tls/x86_64/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/tls/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/haswell/x86_64/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/haswell/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/x86_64/libdawn_native.so
     18056:       trying file=/lib/x86_64-linux-gnu/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/tls/haswell/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/tls/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/haswell/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/haswell/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64-linux-gnu/libdawn_native.so
     18056:       trying file=/lib/tls/haswell/x86_64/libdawn_native.so
     18056:       trying file=/lib/tls/haswell/libdawn_native.so
     18056:       trying file=/lib/tls/x86_64/libdawn_native.so
     18056:       trying file=/lib/tls/libdawn_native.so
     18056:       trying file=/lib/haswell/x86_64/libdawn_native.so
     18056:       trying file=/lib/haswell/libdawn_native.so
     18056:       trying file=/lib/x86_64/libdawn_native.so
     18056:       trying file=/lib/libdawn_native.so
     18056:       trying file=/usr/lib/tls/haswell/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/tls/haswell/libdawn_native.so
     18056:       trying file=/usr/lib/tls/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/tls/libdawn_native.so
     18056:       trying file=/usr/lib/haswell/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/haswell/libdawn_native.so
     18056:       trying file=/usr/lib/x86_64/libdawn_native.so
     18056:       trying file=/usr/lib/libdawn_native.so
     18056:
internal/modules/cjs/loader.js:1197
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libdawn_native.so: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1197:18)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/pelle/test/webgpu/node_modules/webgpu/index.js:13:18)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)

Unfortunately even with LD_LIBRARY_PATH set manually I get a segfault when tryig the raytracing sample :cry:

Trying hello-triangle.mjs:
$ LD_LIBRARY_PATH=`pwd`/node_modules/webgpu/generated/0.0.1/linux/build/Release node hello-triangle.mjs
(node:18425) ExperimentalWarning: The ESM module loader is experimental.
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  4
  Resource id in failed request:  0x300000d
  Serial number of failed request:  197
  Current serial number in output stream:  203

FYI: on ubuntu 19.10, laptop with RTX-2070

Thanks for reporting, I'll try to resolve this ASAP

The README has directions for setting the LD_LIBRARY_PATH

This is what dpkg tells me:
ii  libvulkan1:amd64 <IP_ADDRESS>-1  amd64        Vulkan loader library

I upgraded to webgpu 0.1.4, but still getting error on hello-triangle, running like this:
$ LD_LIBRARY_PATH=`pwd`/node_modules/webgpu/generated/0.0.1/linux/build/Release node hello-triangle.mjs
(node:6008) ExperimentalWarning: The ESM module loader is experimental.
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  4
  Resource id in failed request:  0x3c0000d
  Serial number of failed request:  197
  Current serial number in output stream:  203

Using node v13.11.0 if that matters.
vulkaninfo seems to return ok info, but vkcube just show a black window (no crash though. I am using an optimus laptop (both nVIDA and Intel GPU) - dunno if that may be related.

Found this related to optimus: https://forums.developer.nvidia.com/t/on-optimus-system-vulkan-tries-to-use-integrated-intel-graphics-and-fails-with-a-blank-black-window/79257.
After disabling the Intel icd, then hello-triangle seems to work, showing a nice red triangle.
Trying to run the ray-tracing sample almost crashed the whole system :S
The ubuntu crash reporter show: node crashed with SIGSEGV in dawn_native::vulkan::Buffer::TransitionUsageNow()

That is a known issue with Dawn.
Disabling integrated GPU is the temporary workaround.

The latest npm package should fix this now.
@pjoe The RT example is broken on linux and I'm currently investigating into this. Can this issue be closed now?

I really don't think it should be necessary to set library party when just consuming the npm module. I've never had to deal with library party before with other npm modules.
Maybe it's a matter of the right rpath, dunno if it helps but found this: https://github.com/nodejs/node-v0.x-archive/issues/25627#issuecomment-172804743

I really don't think it should be necessary to set library path when just consuming the npm module. I've never had to deal with library path before with other npm modules.

You have then not used a package as advanced as this one before.
The library in question is libvulkan1. To avoid the LD_LIRBARY_PATH, just apt install libvulkan1 as root.
It is scheduled to be in the standard distributions of linux in the near future.

@dcerisano I already had libvulkan installed.

Also if you look at the LD_DEBUG output, it is not libvulkan, but libdawn_native it is failing to find. And it is searching for paths that looks local to Felix's machine, which doesn't seem ideal to me :)
What then worked for me was to point LD_LIBRARY_PATH like this:
LD_LIBRARY_PATH=`pwd`/node_modules/webgpu/generated/0.0.1/linux/build/Release

i.e. pointing to a folder inside the installed node module. This I really don't think should be necessary.

I think this can be fixed with the right rpath setting (probably here: https://github.com/maierfelix/webgpu/blob/master/generated/0.0.1/linux/binding.gyp#L102).

I had this issue with past projects too, .gyp files are horrible to work with. I'm not sure what's the best fix for this, but eventually by setting the environment variable manually in the index.js file in this project?
Something like this:
if (!process.env.hasOwnProperty("LD_LIBRARY_PATH ")) {
  process.env.LD_LIBRARY_PATH = require("path").join(__dirname, `${generatedPath}/build/Release/`);
}

Unfortunately I don't think it works to set LD_LIBRARY_PATH like that - at least I was unable to get that working in this case, when I originally tried. Anyway I will try to see if this can't be handled by tweaking rpath. Will do a PR if i get it working, but suggest we keep this issue open for now.

Should be fixed in 0.1.6, can you approve @pjoe ?

Unfortunately still not working with 0.1.7.
Relevant output from LD_DEBUG:
(node:7148) ExperimentalWarning: The ESM module loader is experimental.
      7148:     find library=libdawn_native.so [0]; searching
      7148:      search path=/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build
/Release/tls/haswell/x86_64:/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/
Release/tls/haswell:/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/
tls/x86_64:/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/tls:/home
/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/haswell/x86_64:/home/user
/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/haswell:/home/user/Documents/G
itHub/webgpu/generated/0.0.1/linux/build/Release/x86_64:/home/user/Documents/GitHub/webgpu/
generated/0.0.1/linux/build/Release             (RPATH from file /home/pelle/test/webgpu/no
de_modules/webgpu/generated/0.0.1/linux/build/Release/addon-linux.node)

Please re-open


Error filtering events for calendar xxx: Error: Invalid date passed in to RRule.between

In setting up a fresh install of this plugin that I'm very excited to use, I seem to have hit a roadblock.
I entered my Google secret URL exactly as indicated in the instructions.
But trying the example from README:
var events = await app.plugins.getPlugin('ics').getEvents("{{date:2024-02-02}}");
var mdArray = [];
events.forEach((e) => {
  mdArray.push(`${e.time} ${e.summary} ${e.location}: ${e.description}`.trim())
})
dv.list(dv.array(mdArray))

Renders no output on the page, and the following in console:

I reviewed the setup instructions several times, is it possible I missed something?
Any guidance would be greatly appreciated.

Hi, my apologies, I had a typo in the README. The syntax should just be the date itself.
var events = await app.plugins.getPlugin('ics').getEvents("2024-02-02");

Please test with the command and only after that works then customize with Data view.

Thanks @muness, that did resolve the issue!
However, I think there's still a problem with the README's Dataview example:
```dataviewjs
var events = await app.plugins.getPlugin('ics').getEvents("YYYY-MM-DD");
var mdArray = [];
events.forEach((e) => {
  mdArray.push(`${e.time} ${e.summary} ${e.location}: ${e.description}`.trim())
})
dv.list(dv.array(mdArray))```

The README states "if you use the core Templates plugin you can add [the code above] to add events to your daily note template".
But in this case wouldn't "YYYY-MM-DD" need to be replaced with an actual date?
I know in Templater allows you to resolve the date like this:
moment(tp.file.title,app['internalPlugins']['plugins']['daily-notes']['instance']['options']['format'].split('/').pop()).format("YYYY-MM-DD")

But my use case necessitates Dataview, because it's common for events to get updated throughout the day, so the output must be dynamic.
Can the example in the README be updated to use the date of the daily note in which the Dataview query resides?

However, I think there's still a problem with the README's Dataview example:

Thanks for calling that out, @pm64
71f2dcef3875e255ddfa87edd53478c71a825de4 look ok?

It does, except I just realized the .toFormat("yyyy-MM-dd") bit isn't necessary. So it can be simplified:
var events = await app.plugins.getPlugin('ics').getEvents(dv.current().file.day);

Thanks, updated!


Added new load/save functions.

The new functions allow loading and saving directly from JSON objects.
This allows projects to embed the data in FlowScene within larger JSON
objects, instead of as separate files.

I submitted this PR to a separate fork. Closing this for now but I can reopen if needed.


Height in parent element not followed

I have the following code:
<Box width="100%" height="50vh">
    {validCrop ? <canvas ref={canvasRef} /> :
        <ReactCrop crop={crop} onChange={c => setCrop(c)}>

        </ReactCrop>
    }
</Box>

Width is obeyed, but height is ignored. I expected the behaviour to be either that the image is warped to fit the size or, preferably, the lowest dimension is chosen to keep the aspect ratio of the image.
Am I doing anything wrong? Is this intended behaviour, and if so, is there any way to set the image size based on height?

Are you talking about the canvas or the image?

Sorry, the image along with the ReactCrop. If I apply the size with style to ReactCrop, it works, but the images is just cut off (it isn't scaled to be visible).

Can you post a screenshot? Normally only width is obeyed on an image, it's an age old problem but not quite sure what you're expecting since "warped" and keeping aspect ratio are two different things ;) Maybe object-fit: contain can help

Can you post a screenshot?
Sure 🙂

The code in the original post produces:

Is it normal behaviour for the width=100% to be followed, but not height=50vh? If I change height=1px it doesn't do anything either. The crop is also in the wrong location.
If I change it to something like:
<Box width="100%" height="50vh">
    {validCrop ? <canvas ref={canvasRef} /> :
        <ReactCrop  style={{ maxWidth: "100%", maxHeight: "50vh" }} crop={crop} onChange={c => setCrop(c)}>

        </ReactCrop>
    }
</Box>

Then it looks like:

Where the image has just sort of been cut off, not scaled to the new size.
This is probably normal and expected behaviour, but how would I go about limiting the  and the <ReactCrop> to the given height and width, and have the image scale to that size? I'm not sure if this is just a lack of knowledge from me or something specific to how ReactCrop works.

I see the issue, please upgrade to 10.0.0-beta.5 and try again

That works great, however the crop selection isn't set now. If I'm using pixel coordinates is it set according to new coordinates in the scaled image?

Yep you’ll need to be aware of the size of the image to set an initial crop here’s an example: https://github.com/DominicTobias/react-image-crop#how-can-i-center-the-crop


Document the --ast flag as an option for forge build

As of https://github.com/foundry-rs/foundry/pull/7197, the AST is no longer included in the compiler output unless specified with --ast or --build-info. Currently, the --ast flag is undocumented, and should be added to places where it can be specified as an option. This includes forge build, and might include other commands that run forge build internally like forge test or forge script.

Ticket can be closed, this has been fixed as part of the automated workflow introduced in #1135
https://book.getfoundry.sh/reference/cli/forge/build

Marking as resolved


Clarify data returned weekly by epoch

Clarify across docs (Flux functions and content referencing time returned in weeks) that epoch time starts on a Thursday. We need to point this out when it affects the results of data being returning, for example, when data is truncated by week. Issue reported in Flux repo.
Potentially relevant URLs

https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/date/truncate/

https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/date/week/

https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/query/#epoch

https://docs.influxdata.com/influxdb/v2.0/reference/glossary/#unix-timestamp

Check with Flux team for other potentially affected Flux functions

@sanderson - Any ideas when this DAR is addressed to clarify that epoch time starts on Thursday and the impact is has on aggregateWindow etc.? This should be addressed asap imho.


Update ScriptRuntimeApiImpl.cs

Fixed a minor bug where the {path} was pointing to a native directory path and not the native file path.

Thanks for taking effort to submit a PR. What you describe here i encountered already which made it strange that problem manifested again. Turned out i lost commit c7b56dd yesterday where this issue was fixed. Pushed it now to master.
Couple of notes for future PRs:

This PR does not address the root problem which was fixed in c7b56dd. I understand it may be not obvious, but sometimes it is worthwhile to dig a bit deeper. On the other hand who would think GetAbsolutePath() can be broken, right? ;)
Comments do not align with rest of the lines.
We should only leave commented code if we think it may be useful in the future. Fix like this - we probably dont want old code left over.

A bit of a rough start for you. Sorry about that :) Not many people are testing this code and thus we have plenty of undiscovered problems. It is great to see that people are interested though. With your help we will squash them bugs :)

Hi, Rokas,
Thanks a lot for your response, and that kind of feed back you mention is good to get myself aligned with how you people are working... Just a quick brief about my self, I am construction architect and skilled with C# programming, so i am not programmer by professional.
Thanks again, and sure all bugs will be closed one day as long as we have someone good as you. :)


Fix function call (_setToDefaultImage) and delay rendering until Update.

Added the changes to v4.2.1


test_scene::test_scene_screenshot fails on Windows CI run

test_scene::test_scene_screenshot fails when run on Windows CI. This cannot be reproduced locally, but can be reproduced using a tmate session on the runner.
The code fails on a seg fault, in a call to vtk.WindowToImageFilter().Update(). We used the debugger to make sure all attributes are set correctly/not null before this call. We tried running the tests for the latest development version of vedo on the Windows CI runner and a similar seg faul happens, superficially in plotter:render.show() which migh end up at the same vtk function underneath.
In https://github.com/brainglobe/brainrender/tree/windows-test-scene-screenshot we tried to pass the same env variables to tox as brainrender-napari in case it was a tox configuration issue with no success.
This might be an interaction between vtk and the Windows runner, can look into opening issues on vedo/vtk.

I think this is probably vtk behaving differently on different systems.

Thanks for this clue, @marcomusy - this helped me figure out that we needed to ensure vtk and the headless display work well together, and therefore reminded me of the pyvista GH action that sets up headless displays for the napari CI.


The authorizeResource method does not work with the new abstract base controller class

Laravel Version
11.0.7
PHP Version
8.3.4
Database Driver & Version
No response
Description
When upgrading from 10 > 11 and applying the "AuthorizesRequests" trait as defined in the upgrade guide, I encountered a "Call to undefined method Path\To\MyController::middleware()" exception.
I believe this is simply due to the now empty App\Http\Controllers\Controller class.
The problem can be resolved by changing the "extends" to "\Illuminate\Routing\Controller" but this doesn't seem right.
Is this intended?
Steps To Reproduce
Install a new L11 project
Create a new controller:
php artisan make:controller UserController --resource
Add AuthorizesRequests trait to UserController
Add a route to test

// routes/web.php
Route::get('/', [\App\Http\Controllers\UserController::class, 'index']);

Receive Call to undefined method App\Http\Controllers\UserController::middleware() error
Neither a policy or authenticated user should be required to validate this issue.

When upgrading from 10 > 11 and applying the "AuthorizesRequests" trait as defined in the upgrade guide

We don't say this in the upgrade guide? https://laravel.com/docs/11.x/upgrade

The problem can be resolved by changing the "extends" to "\Illuminate\Routing\Controller" but this doesn't seem right.

This is the correct solution.

When upgrading from 10 > 11 and applying the "AuthorizesRequests" trait as defined in the upgrade guide

We don't say this in the upgrade guide? https://laravel.com/docs/11.x/upgrade

The problem can be resolved by changing the "extends" to "\Illuminate\Routing\Controller" but this doesn't seem right.

This is the correct solution.

Sorry, couldn't find it in the latest doc, probably removed?
Just want to know if it's deprecated and no longer recommend to use AuthorizesRequest in version 11; or the feature will still be maintained and we just need to manually add the correct extends \Illuminate\Routing\Controller, no additional side effects.

You just need to extend the routing controller :thu

@justinmoh my solution (as I need both ValidatesRequests and AuthorizesRequests very frequently) was to create a BaseController that uses both traits and extends Illuminate\Routing\Controller.

As Dries states, the new L11 approach is to extend the slim base controller and add the traits as-and-when required: https://laravel.com/docs/11.x/releases#base-controller-class
I do agree that the docs around this are a bit lacking; understanding of course that 11 is meant to work with 10 without any wholesale changes, but considering the make:controller Artisan command is also slim and there's no mention of the requirement to add these traits anywhere except the release guide, you can see how it's confusing.

We'd very much welcome PR's to make the docs more clear 👍  In general we don't recommend those specific traits any longer because there's other ways to do this like $request->validate() & abort_if() etc. Granted, these work a little bit different.

That's fair enough - I see the logic.
What are the other ways to use authorizeForUser and authorizeResource that come with AuthorizesRequests?
Thanks, NP

@nathanpurcell not unless you reimplement \Illuminate\Routing\Controller::middleware().
But unless i read @driesvints comment above  wrong, this approach is now not recommended.

I think authorizeForUser will still work fine with just AuthorizesRequests but there doesn't seems to be an alternative for authorizeResource at this time. You'll have to use an approach from https://laravel.com/docs/11.x/authorization for this.
Otherwise if you still want to use authorizeResource you can simply extend the base controller which still ships with Laravel.


Analysis server's BazelWorkspace needs to support dart_package directives in BUILD files

The way to opt packages into NNBD in a Bazel workspace will be to include this directive in a BUILD file:
dart_package(
    non_nullable = True,
)

The analysis server needs to recognize this pattern and use it to determine whether a package is opted in to NNBD.
Note that BUILD files are auto-formatted so it's not necessary to parse the whole file to find this directive; a simple regexp should suffice.

See also https://buganizer.corp.google.com/issues/162609651

Thanks! A few notes:
It's true that the file is auto formatted, but some variation is allowed. These are all valid:
dart_package(non_nullable = True)

dart_package(
    non_nullable = True,
)

dart_package(
    # Preceding comment.
    non_nullable = True,  # Trailing comment.
)  # Last comment.

And: it's desirable that the analyzer react to changes to the BUILD file, so that adding non_nullable = True changes the analysis mode for the package as soon as the file is saved.

https://dart-review.googlesource.com/c/sdk/+/157474


Armada-Server still has some problems starting

I found three issues related to Armada Server:

Prometheus needs the Prometheus Operator as we are using those APIs in the operator (https://github.com/armadaproject/armada-operator/issues/89)

Our operator gives these errors:
E0216 14:56:39.372698       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.25.4/tools/cache/reflector.go:169: Failed to watch *v1.PrometheusRule: unknown (get prometheusrules.monitoring.coreos.com)
E0216 14:57:10.238374       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.25.4/tools/cache/reflector.go:169: Failed to watch *v1.PrometheusRule: unknown (get prometheusrules.monitoring.coreos.com)
E0216 14:57:34.091152       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.25.4/tools/cache/reflector.go:169: Failed to watch *v1.ServiceMonitor: unknown (get servicemonitors.monitoring.coreos.com)
E0216 14:57:43.309743       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.25.4/tools/cache/reflector.go:169: Failed to watch *v1.PrometheusRule: unknown (get prometheusrules.monitoring.coreos.com)
E0216 14:58:22.362472       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.25.4/tools/cache/reflector.go:169: Failed to watch *v1.ServiceMonitor: unknown (get servicemonitors.monitoring.coreos.com)
E0216 14:58:37.966185       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.25.4/tools/cache/reflector.go:169: Failed to watch *v1.PrometheusRule: unknown (get prometheusrules.monitoring.coreos.com)

Wait-for-Pulsar job has a syntax error:

[ec2-user@ip-172-31-93-184 armada-operator]$ kubectl logs -n armada wait-for-pulsar-dsf2c
Waiting for Pulsar... (:0)
/bin/sh: syntax error: unexpected ";"

Pulsar-Init has problems finding the pulsar admin application

[ec2-user@ip-172-31-93-184 armada-operator]$ kubectl logs -n armada init-pulsar-l65tk
Initializing pulsar ://:0
/bin/sh: bin/pulsar-admin: not found
/bin/sh: bin/pulsar-admin: not found
/bin/sh: bin/pulsar-admin: not found
/bin/sh: bin/pulsar-admin: not found
/bin/sh: bin/pulsar-admin: not found
/bin/sh: bin/pulsar-admin: not found

I think 2 and 3 still have some problems.  2 is working now but the job is not starting.
Since 2 is blocking we never get to see if 3 works.


Add time to first byte benchmark

In this commit, we add a new type of benchmark to measure the latency aspect of the read operation.
We do this by running fio workloads that send one byte read request with one byte block size against existing files. The time it takes to complete this operation will be measured and recorded as time to first byte read.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

Tested in my fork, you can view the chart here.


Support for ingesting flat json from text files and streams

Is your feature request related to a problem? Please describe.
A very common data format is json, we don't support ingesting arbitrary json from files (only ReatureRow protos encoded as json)
Describe the solution you'd like
I propose we support ingesting flat json from files and streams (kafka + pubsub).
By flat json, I mean eg: {"a":1, "b":2} without any nesting. For convenience, any nested objects or arrays that are declared features will be treated as strings (keeping their json encoding).
I also suggest we remove support for ingesting FeatureRow protos encoded as json in text files. Because it's a quirky format that we only generate for logging and testing stores and we shouldn't impose it on people, we should ingest formats they would typically use themselves.
Describe alternatives you've considered
We could later add support for extracting features from deeply nested json, but I don't think we should do this in the first pass.

Done for pubsub and text files in PR #141
Kafka pending

Thanks @tims. Let's reopen this once the requirement exists.


Roll engine 384a0b8d729c..8d6b74aee6fb (2 commits)

git@github.com:flutter/engine.git/compare/384a0b8d729c...8d6b74aee6fb
git log 384a0b8d729c..8d6b74aee6fb --no-merges --oneline
2019-10-24<EMAIL_ADDRESS>Roll src/third_party/dart 081c01e89a..1bd6e20d76 (6 commits)
2019-10-24<EMAIL_ADDRESS>Roll fuchsia/sdk/core/mac-amd64 from bad9W... to yuA3r... (flutter/engine#13332)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC<EMAIL_ADDRESS>on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

Auto-roller completed checks. About to merge.


Error with job.api.run when using certificates

Issue occurs when trying to use a token that was generated using the certificate and passphrase to run a job using sfcc.instance.import().
The exception is thrown in job.js line 300
write EPROTO 18080:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:c:\ws\deps\openssl\openssl\ssl\record\rec_layer_s3.c:1544:SSL alert number 40

@z1haze Can you please clarify what you mean by

to use a token that was generated using the certificate and passphrase

?
The access token itself is obtained from Commerce Cloud Account Manager and does not need a client certificate and passphrase at all. The client who obtains a token needs a client id and a secret, no client certificate at all.
Also which version of the tool are you using? Looking at master line 300 in job.js (https://github.com/SalesforceCommerceCloud/sfcc-ci/blob/master/lib/job.js#L300) is just a simple type check. Can you please tag the exact piece of code/line in the proper version (I assume a tag) you are using?


Any docs/examples on how to do the audio separation with HP5_only_main_vocal and DeEcho

Is this available in this version of the project yet? if so any examples, trying to migrate from the old repo where it was working.
thanks,

I'll make it!

doing something like this returns me two files that are the same as the input, what am I getting wrong?
from rvc.modules.uvr5.vr import AudioPreprocess

def separate():
    input_path = f"{project_dir}/sandbox/inputs/input.mp3"
    output_path = Path(f"{project_dir}/sandbox/outputs/")

    model_name = "HP5_only_main_vocal.pth"
    model_path = os.path.join(os.getenv("weight_uvr5_root"), model_name)
    agg = 10

    pre_fun = AudioPreprocess(model_path, agg)
    result = pre_fun.process(input_path)

    wav_instrument, wav_vocals, sr, agg = result
    sf.write(f"{output_path}/instrumental.wav", wav_instrument / 32768, sr)
    sf.write(f"{output_path}/vocals.wav", wav_vocals / 32768, sr)

The cli and api endpoint seem to make use of a wrapper:
    uvr_module.uvr_wrapper(
        inputpath, outputpath, model_name=modelname, export_format=format
    )
    ```

    But not sure this actually works, as the wrapper does not accept an output_path, it returns the files.

    Have also tried to use the wrapper directly:

    ```
        uvr = UVR()
    results = uvr.uvr_wrapper(input_path, agg=10, model_name="HP3_all_vocals.pth")

    for i, result in enumerate(results):
        wav_instrument, wav_vocals, sr, agg = result
        sf.write(f"{output_path}/instrument_{i}.wav", wav_instrument / 32768, sr)
        sf.write(f"{output_path}/vocals_{i}.wav", wav_vocals / 32768, sr)

but sadly I still get the same issue of the instrumental and vocals files being the same (original audio). Any help @Tps-F ?

I will check, It could be a bug.


New release?

Hi -- are there any plans to do a new release any time soon? From a quick eyeball it looks like there are a bunch of incompatibilities, so I guess the release will be 0.4.0.

(It would also be helpful if releases to crates.io were tagged and pushed to GH :) )

Hi -- looks like this wasn't published to crates.io. Any chance you could get it up there as well? Thanks!

Oh that's because it needs a bump in lua52-sys.


[WIP][OAP-1583][oap-native-sql] Optimize ColumnarExchange partition id computation

What changes were proposed in this pull request?

SinglePartitioning, RoundRobinPartitioning, HashPartitioning: Move partition id computation from java to native.

RangePartitioning: Fallback to java.

How was this patch tested?
Java/cpp unit tests.

@rongma1997  I verified this patch locally, TPCH tests is correct. I think we could fix the performance in the next patch


Install script

I've tried telegram_backup so many times to backup my chat, but always failed.
This is when sudo python setup.py install for the first time:
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    from pytg import VERSION
  File "/home/iza/github/pytg/pytg/__init__.py", line 9, in <module>
    from luckydonaldUtils.encoding import to_unicode as u
ImportError: No module named luckydonaldUtils.encoding

Then, when sudo pip install luckydonald-utils to install dependencies:
Downloading/unpacking luckydonald-utils
  Downloading luckydonald-utils-0.27.tar.gz
  Running setup.py (path:/tmp/pip-build-9OFyYL/luckydonald-utils/setup.py) egg_info for package luckydonald-utils

Requirement already satisfied (use --upgrade to upgrade): pip in /usr/lib/python2.7/dist-packages (from luckydonald-utils)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from luckydonald-utils)
Installing collected packages: luckydonald-utils
  Running setup.py install for luckydonald-utils
      File "/usr/local/lib/python2.7/dist-packages/luckydonaldUtils/logger/py3.py", line 6
        def success(self, msg, *args, exc_info=False, **kwargs):
                                             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python2.7/dist-packages/luckydonaldUtils/time/py3.py", line 10
        def get_local_time(time:datetime.datetime, time_zone:str=None) -> datetime.datetime:
                               ^
    SyntaxError: invalid syntax

Successfully installed luckydonald-utils
Cleaning up...

When reinstall with sudo python setup.py install:
/usr/lib/python2.7/dist-packages/setuptools/dist.py:294: UserWarning: The version specified ('0.4.1d') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running install
running bdist_egg
running egg_info
creating pytg.egg-info
writing requirements to pytg.egg-info/requires.txt
writing pytg.egg-info/PKG-INFO
writing top-level names to pytg.egg-info/top_level.txt
writing dependency_links to pytg.egg-info/dependency_links.txt
writing manifest file 'pytg.egg-info/SOURCES.txt'
reading manifest file 'pytg.egg-info/SOURCES.txt'
writing manifest file 'pytg.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pytg
copying pytg/__init__.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/argument_types.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/exceptions.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/fix_msg_array.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/fix_plain_output.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/receiver.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/result_parser.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/sender.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/test.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/this_py_version.py -> build/lib.linux-x86_64-2.7/pytg
copying pytg/utils.py -> build/lib.linux-x86_64-2.7/pytg
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/__init__.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/argument_types.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/exceptions.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/fix_msg_array.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/fix_plain_output.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/receiver.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/result_parser.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/sender.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/test.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/this_py_version.py -> build/bdist.linux-x86_64/egg/pytg
copying build/lib.linux-x86_64-2.7/pytg/utils.py -> build/bdist.linux-x86_64/egg/pytg
byte-compiling build/bdist.linux-x86_64/egg/pytg/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/argument_types.py to argument_types.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/exceptions.py to exceptions.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/fix_msg_array.py to fix_msg_array.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/fix_plain_output.py to fix_plain_output.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/receiver.py to receiver.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/result_parser.py to result_parser.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/sender.py to sender.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/test.py to test.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/this_py_version.py to this_py_version.pyc
byte-compiling build/bdist.linux-x86_64/egg/pytg/utils.py to utils.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pytg.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pytg.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pytg.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pytg.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pytg.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pytg-0.4.1d-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pytg-0.4.1d-py2.7.egg
Copying pytg-0.4.1d-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding pytg 0.4.1d to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/pytg-0.4.1d-py2.7.egg
Processing dependencies for pytg===0.4.1d
Searching for DictObject
Reading https://pypi.python.org/simple/DictObject/
Best match: DictObject 0.1.2
Downloading https://pypi.python.org/packages/source/D/DictObject/DictObject-0.1.2.tar.gz#md5=b4f77e9c9ca1089efdeb0dd155860483
Processing DictObject-0.1.2.tar.gz
Writing /tmp/easy_install-epdOiq/DictObject-0.1.2/setup.cfg
Running DictObject-0.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-epdOiq/DictObject-0.1.2/egg-dist-tmp-HeSsmU
zip_safe flag not set; analyzing archive contents...
Moving DictObject-0.1.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding DictObject 0.1.2 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/DictObject-0.1.2-py2.7.egg
Searching for luckydonald-utils==0.27
Best match: luckydonald-utils 0.27
Adding luckydonald-utils 0.27 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for setuptools==18.4
Best match: setuptools 18.4
setuptools 18.4 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin

Using /usr/lib/python2.7/dist-packages
Searching for pip==1.5.6
Best match: pip 1.5.6
pip 1.5.6 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for pytg===0.4.1d

Run telegram-cli as a daemon, then python dump.py:
Traceback (most recent call last):
  File "dump.py", line 164, in <module>
    for d in build_dialogs_list():
  File "dump.py", line 28, in build_dialogs_list
    res = x.dialog_list(100, len(base_list))
  File "build/bdist.linux-x86_64/egg/pytg/sender.py", line 548, in command_alias
  File "build/bdist.linux-x86_64/egg/pytg/sender.py", line 256, in execute_function
  File "/usr/lib/python2.7/inspect.py", line 816, in getargspec
    raise TypeError('{!r} is not a Python function'.format(func))
TypeError: <pytg.result_parser.List object at 0x7f2f4ab766d0> is not a Python function
INFO:pytg.sender:Quit Sending. Not allowing sending anymore.
WARNING:pytg.sender:Terminating currently sending request.
INFO:pytg.sender:Currently not Sending.

Tried with python 3; python3 dump.py
Traceback (most recent call last):
  File "dump.py", line 1, in <module>
    from pytg import sender
ImportError: No module named 'pytg'

I'm not a programmer and this python version things is confusing, would love to get newbie friendly install for this script.

The packages for python2 and python3 aren't the same, so you only installed pytg for python2.
Can you try using a python3 version of pip ? It's can be pip3 on your system.
You will probably run in the same issues with luckydonald-utils, it's an error in pytg, just install it first as you did for python2.

Thank you, it's running now :smile:


Remove Refreshing From AsyncState

This came as a result of looking into https://github.com/rodydavis/signals.dart/issues/351 . The idea of having a "refreshing" state and a "reloading" state does not make a lot of sense for signals. The reasoning in the article I previously referenced states that - one is for when the original condition that led to the data/error is the same and the other is for when the condition changes.
Diving into riverpod's source code. I found this reasoning to be more specific to the riverpod implementation - "refreshing" signifies that the refresh was a manual action caused by ref.refresh()/ref.invalidate() (thus original condition not changed). While "reloading" is from a dependency change resulting in the provider being recomputed. In fact, in riverpod there is no ref.reload(), this is only handled by the framework. As a previous user of riverpod I have yet to ever care about
this distinction between the two states.
In signals, we expose .refresh() and .reload() to the end user. Thus, what is the proper distinction between the two for this library? Since we expose .reload() it would seem the reasoning behind the "reloading" state existing in riverpod,
does not exist here. We could probably just remove .refresh() and ..Refreshing state. And have ..Reloading refer do both an internal refresh (dependencies change) and a manual call to .reload(). I'd argue, this is what users care about anyways. This would streamline the API.

I chose removing ..Refreshing over ..Reloading since "reloading" makes sense for the data and error state, while "refreshing" makes less sense for error state in my opinion. But removing ..Reloading instead is also an option.

Well I think there are 2 reasons we could keep it:

Help with users migrating from Riverpod and the shared abstraction over async state
Control in the UI to refresh data without showing the loading indicator.

For 2 this is common in an infinite list where the initial load you show the indicator but not when new data comes in (firestore or sqlite stream) or when appending to the end of the list.
I think we can simplify this more in a future release (v7?) but v6 can be about ease of migration, documentation, examples and cleaning up as much as possible.

For 2, the AsyncLoading state would handle the initial load and AsyncDataReloading would handle new data being fetched (note AsyncErrorReloading would also still exist). I don't think an addition AsyncDataRefreshing/AsyncErrorRefreshing state is needed.
Having both, with no functional difference, may be confusing. In some places users might call .refresh() and other .reload(). Meaning for most cases users to have to account for both cases, like -
switch(state) {
    AsyncDataReloading(:final data) || AsyncDataRefreshing(:final data) => ...,
    AsyncData(:final data) => ...,
    AsyncError() => ...,
    AsyncLoading() => ...,
}

Rather than just
switch(state) {
    AsyncDataReloading(:final data) => ...,
    AsyncData(:final data) => ...,
    AsyncError() => ...,
    AsyncLoading() => ...,
}

Definitely going to require a v7, as you mentioned, as this is a breaking change. But the sooner the better in my opinion. It might be worth while if this is the accepted, to deprecate .refresh(), .isRefreshing, AsyncDataRefreshing, and AsyncErrorRefreshing now.

Yes I am totally in favor of deprecating to prepare!


Allow object constraints on @:generic to work with abstracts

It would be nice for this to work:
class Test {
    static function main() {
        foo(new Foo('foo'));
    }
    @:generic static function foo<T:{ var length(get, never): Int; }>(v:T) {

    }
}

abstract Foo(String) {
    public var length(get, never):Int;
    inline function get_length() return this.length;
    public function new(s) this = s;
}

Currently it doesn't, because abstracts and objects don't unify. But since the function is generic and T is known at compile time, could we not make an exception?

Wrong repository?

Why am I standing in the bathroom with a frying pan in my hand? :D

Haha, that comment made my morning :-)


Update sdk.md (Typo "Azure Open AI"→"Azure OpenAI")

https://learn.microsoft.com/en-us/azure/ai-services/language-service/question-answering/quickstart/sdk?tabs=macos&pivots=studio
https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/ai-services/language-service/question-answering/quickstart/sdk.md
#PingMSFTDocs

@jboback
Can you review the proposed changes?
Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

#sign-off


Make EXPIRE_WINDOW_MIN configurable

Right now it's set to 30 minutes.

Closing as a duplicate of #14


New feature: Please add unzip to cli container.

Hi team
Please add unzip to cli container. Required by drush make when trying to build Pfizer platform. Without unzip it's impossible to download js libraries to platform.
http://drupal.stackexchange.com/questions/96096/drush-make-command-error-when-unzipping-superfish-module-library
Thank you

Added in 503a416ac565777f7fe39c24f4821103febef19a
Released in v1.0.0


editor.formatOnType breaks indentation

This is for version 0.10.10, when writing JavaScript.
It appears that setting "editor.formatOnType" to true breaks indentation when you add a newline. What I mean by this is that if you are at the end of a line, and hit "enter", the keyboard cursor will briefly appear at the right indentation level on the new line, but snap back to the line start after about 100 milliseconds.
Setting formatOnType to false fixes this behavior; but, of course, VS Code will no longer format on type. Perhaps whatever code formatter is being used is configured to remove all indentation for empty lines.
The only other custom setting that I have is setting "insertSpaces" to false.

I have the same issue

Same issue, really annoying.

@dbaeumer I will take a look to see if I can "tweak" the format edit if it wants to remove whitespace around the cursor

@alexandrudima this is a problem with the tsserver and IMO we should push the TS team to fix this. The corresponding issue in TS land is: https://github.com/Microsoft/TypeScript/issues/6700

Same issue :+1:

@dbaeumer Is this fixed on the TS side on master?
I still get it in some cases such as pressing Enter twice:

@alexandrudima it should be fixed and @jrieken and I tested it (I updated the tsserver to 1.8.9 today). But it looks like not all cases are fixed. I opt for opening a issue against TS.

What's the status regarding that today ?

It's a little big fixed... The true issue is in TypeScript-land and we have refrained from massaging their text edits. @alexandrudima tracks the issue on the TypeScript-side, tho unsure what the status is?

I have to say the formatOnType function is always broken. In most vscode versions , it doesn't work properly.

The fix for Microsoft/TypeScript#6700 is in the nightly TypeScript build.
Until VS code adopts a new version you can use a newer version of TypeScript by:
Install the new typescript version globally:

npm install -g typescript@next
in the user settings define "typescript.tsdk": "path to your folder/node_modules/typescript/lib"

Install the new typescript version locally into your workspace:

npm install -g typescript@next
code will pick it up from there.

The version of the install TypeScript version is shown in the status bar at the right.

I still have the problem that @alexandrudima described. Using Version 1.1.0-insider (1.1.0-insider) and<EMAIL_ADDRESS>

That does look like the problem wasn't fixed yet. Thanks for the repo, I'll keep looking.

Clearing the milestone, since it is an upstream fix that is planned by another team.

@dbaeumer added a workaround for this on our side in PR #6911


Unable to download models on Android

Hi, I built the fastembed crate for Android by building onnxruntime from source and correspondingly setting the environment variable for libonnxruntime.so library, but while running, it is giving following error
hf_hub: Token file not found "token"
ureq:::stream connecting to huggingface.co

This behaviour is not observed in linux, it built fine and is also working

Can you try runing https://github.com/huggingface/hf-hub?tab=readme-ov-file#how-to-use after an Android build?

I tried running it, it didn't work, app is crashing because of the code
use hf_hub::api::sync::Api;

let api = Api::new().unwrap();

let repo = api.model("bert-base-uncased".to_string());
let _filename = repo.get("config.json").unwrap();

// filename  is now the local location within hf cache of the config.json file

So the hf-hub lib that FastEmbed-rs uses in incompatible with your build.

I recommend raising an issue there to see they could help.

Sure, will raise an issue there too, but do you have any idea why its unable to run
It is failing at Api object creation, there they are loading the token from cache, in linux it is able to load, but in Android, it is unable to load from cache

I am not aware of the hf-hub internals.
Maybe hf-hub's cache directory retrieval isn't compatible with Android.

Ok , thanks for the update
Any other crate do you suggest to get vector embeddings for text input which works for Android

I am not aware. I think you should set up an embedding service as an API and use it from your Android application instead.
It would be much better.


Mobile: Selection Support

Recently our mobile support has devolved a bit and items on the map are no longer selectable.

Commited in  764eb3384.
Screenshot of selected road with tons of tagging info:

Closing here as a dup of #749
@Bonkles is working on improving mobile support now!


Add option to keep app open with no tabs

Can this be added via plugin or in the terminal itself?

Released in version 0.55.0.


ViewModel doesn't update when the data context of a #with statement changes

I have these templates:
<template name="main">
	{{#with root}}
		{{> child}}
	{{/with}}
</template>

<template name="child">

{{getText}}

</template>

With this helper:
Template['main'].viewmodel({
	root: function() {
		var itemId = FlowRouter.getParam("_id");
		return  ItemsList.findOne(itemId);
	},
});

If I change the value of the _id of the route the child template doesn't update if I use viewmodel but it does if I use a regular template helper.
// this works
Template['child'].helpers({
	getText: function () {
		return ItemsList.findOne(this._id);
	},
});

// this doesn't
Template['child'].viewmodel(
	function (data) {
		return {
			getText: function () {
				return ItemsList.findOne(data._id);
			}
		};
	},
	['getText']
);

The problem I think is that the viewmodel doesn't get recreated when the data context of the #with statement changes. Is there a way to go around this?
Thanks!

Yeah, don't use with and use FlowRouter.getParam("_id") in getText of your view model.

Shouldn't it work with #with? If the data changes shouldn't a new viewmodel get created?
The problem is that this example is oversimplified, in the real app I need to be able to change routes and re-render the child template with an id from FlowRouter.getParam('_id'); and I even need to be able to access the viewmodel by id (which I put as the viewmodel's unique name). The child template can as well have other child templates inside it so I can't hardcode the id directly from FlowRouter.
What I mean is that I need to be able to change the id to render and the template should change to one that uses that Id to build itself up.

I was able to finally solve the problem using en each statement in the main template instead of with and returning a cursor in the root helper instead of the item itself. Now it updates on route change.
It would be great to know it the with statement problem is a bug of viewmodel to know how to handle it if I ever need it again.
Thanks!

+1 For tracking down this problem. Seems like it should have worked.

The thing is that this isn't really a bug but a difference in how Blaze and ViewModel work. You're basically comparing apples to oranges.
For example, the most normal thing is to put People.find().fetch() inside an autorun and have that function re-run when the cursor changes. Yet the same will not re-run if you put it inside a publication. That's because they operate in different ways.
Back to ViewModel, it works differently than Blaze.
The gist of it is that as far as ViewModel is concerned you're initializing the view model with a static/non-reactive value. Since Blaze doesn't re-render the template when the with data changes, ViewModel keeps the static/non-reactive value. To get the reactivity you need to initialize the view model with a function that uses a reactive value.
I don't know how FlowRouter works, but if FlowRouter.getParam("_id") is reactive then you need to use that inside a function in the view model, not simply pass the (non-reactive) result to it.
Check out these threads:
http://viewmodelboard.meteor.com/comments/GRiBWwaSkTgaR59Td
https://github.com/ManuelDeLeon/viewmodel/issues/46
https://github.com/ManuelDeLeon/viewmodel/issues/74

I understand that the viewmodel starts with a non reactive object but how can I do to have the child viewmodel change when the with changes? I don't see how to make it work. Isn't there a way to make the with reactive as it should? Otherwise is very misleading and problematic I think.
FlowRouter.getParam("_id") is reactive, and I'm using it in the root function but I can't use it in the child viewmodel because I need it to be completely rebuilt on data context change (even the viewmodel name that uses the id).

Let's forget about ViewModel for a second. How would you get such reactivity with good old Blaze?
Given the following:

  {{#with person }}
    {{greeting}}
  {{/with}}

Session.setDefault("person", { name: "Alan" });

Template.body.helpers({
  person: function() {
    return Session.get("person");
  },
  greeting: function () {
    return "Hello " + "Alan";
  }
});

What do you put instead of "Alan" that would make greeting reactive regarding the person used by the with? That is, if I change the person object via Session.set("person", { name: "Bert" }), the greeting function returns "Hello Bert" to the UI.

I'll answer my own question: you use this.name. The thing to notice is that you can't access this from anywhere but a helper method. You can't put an autorun for it on created or rendered. It's a Blaze sleight of hand (so much that the Blaze 2.0 proposal wants to do away with it).
The bottom line is that to obtain reactivity you need to use a reactive source.

Sorry manuel, I still don't undesrtand how to solve it using a with. I understand that ViewModel starts with non reactive data but in my example at the top how would you make it work?
I had to change the with with and each and return a cursor for the root to get the result I want, but that's hacking it, it would be great to know how to do that in a with.
This ticket is closed, I couldn't answer before, but I would really love to undestand this.

Option 1) You drop the #with and put the contents of 'root' in a function
of the child view model.
Option 2) You drop the #with and create a view model for the parent (if you
don't have one already) and from the child you call this.parent().root() to
get the reactive value.
On Aug 19, 2015 6:33 PM, "santiagopuentep"<EMAIL_ADDRESS>wrote:

Sorry manuel, I still don't undesrtand how to solve it using a with. I
understand that ViewModel starts with non reactive data but in my example
at the top how would you make it work?
I had to change the with with and each and return a cursor for the root
to get the result I want, but that's hacking it, it would be great to know
how to do that in a with.
This ticket is closed, I couldn't answer before, but I would really love
to undestand this.
—
Reply to this email directly or view it on GitHub
https://github.com/ManuelDeLeon/viewmodel/issues/89#issuecomment-132836597
.

That wouldn't solve the problem of recreating the viewmodel on root value change, but don't worry, I'm using an each statement and it works fine.
Thanks for the help anyway!

It does work...
<template name="parent">

Parent

  Name: <input data-bind="value: name">
  <button data-bind="click: update">Update</button>
  {{> child }}
</template>

<template name="child">

Child

  Parent Name:
</template>

Here's option 1 (child in control of the reactive value)
Session.setDefault("parent", { name: '' });

Template.parent.viewmodel({
  name: '',
  update: function() {
    Session.set("parent", { name: this.name() });
  }
});

Template.child.viewmodel({
  parentName: function() {
    return Session.get("parent").name;
  }
});

Here's option 2 (parent in control of the reactive value)
Session.setDefault("parent", { name: '' });

Template.parent.viewmodel({
  name: '',
  update: function() {
    Session.set("parent", { name: this.name() });
  },
  data: function(){
    return Session.get("parent")
  }
});

Template.child.viewmodel({
  parentName: function() {
    return this.parent().data().name;
  }
});

In both cases Session.get("parent") is the equivalent of ItemsList.findOne(FlowRouter.getParam("_id")).

I think we are talking about different things. The changes in the reactive value I understand but what I don't is how to have the child template recreated/rerendered when the parent value changes in your example.
If the "parent" value changes I want the child template to be removed and a new one to be created. This is because the child template in my example can't get it's id from outside (like by asking the parent for the id) because of what my project needs. The parent needs to create the child based on the id, and reactively recreate it if the id changes. That's why I was using a with.
In your last example the chlid template always stays the same but changes it's internal values based on a reactive variable.

That's the thing, whatever reactive value triggers the change in the #with can be used to change the properties of the child (reactively, without recreating the template).

Ok, thanks manuel.


merge err: scales and qzeros dimension mismatch

Dear Sir,
Thanks for your sharing of this great work.
I followed the instruction in readme.md that using GPTQ-for-LLaMa
to quantize the llama-2-7b-chat model and applied lora finetuning,  but I got error when using merge.py due to the dimension mismatch of scales and qzeros:

Did I miss something?

@sscheng216 hi， you may check the type of zeros. You need to transfer the zeros from coded format into fp16

@sscheng216 hi， you may check the type of zeros. You need to transfer the zeros from coded format into fp16

Hi, how to transfer the zeros from coded format into fp16

hi, i also want to ask how to transfer the zeros from coded format into fp16

Hi, I also meet this problem? Anyone solved it? Thank you!


Remove warnings from TestJSONEncoder compilation.

Since the introduction of #26357/SR-11160 the TestJSONEncoder seems to
have been emitting the new warnings related to tuples being incorrectly
pattern matched.
The changes remove the incorrect code (removing the parenthesis around
the pattern).
Should not have any other effect (and the effect was not normally
visible if the test was successful, anyway).
/cc @varungandhi-apple

@swift-ci please smoke test


pbjam.star() AttributeError pbjam.IO get_priorpath

I get an error-message for the current version 2.0.1 available from "git clone https://github.com/grd349/PBjam.git" when I run the initialization function:
pbjam.star(ID, freq, psd, {"numax": [somevalue, someerr], "dnu": [somevalue, someerr]})
The error is:
AttributeError: module 'pbjam.IO' has no attribute 'get_priorpath'. Did you mean: 'getPriorPath'?
Local modification of the code to the suggested function "getPriorPath" seems to fix the issue.
All the best,
Jeppe

Hi Jeppe,
The star class isn't currently working on the main branch. I'm in the
process of updating it and the tutorials on the dev branch.
I think it's easiest to just go through the example-modeID notebook in the
main directory, that'll go through the steps that the star class handles.
Otherwise you can checkout the dev branch if you want to use the star
class. Just bear in mind the arguments have changed slightly.
On Tue, Oct 29, 2024 at 10:04 AM Jeppe Sinkbæk Thomsen <
@.***> wrote:

I get an error-message for the current version 2.0.1 available from "git
clone https://github.com/grd349/PBjam.git" when I run the initialization
function:
pbjam.star(ID, freq, psd, {"numax": [somevalue, someerr], "dnu":
[somevalue, someerr]})
The error is:
AttributeError: module 'pbjam.IO' has no attribute 'get_priorpath'. Did
you mean: 'getPriorPath'?
Local modification of the code to the suggested function "getPriorPath"
seems to fix the issue.
All the best,
Jeppe
—
Reply to this email directly, view it on GitHub
https://github.com/grd349/PBjam/issues/279, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEJWO37RKW6QRV7RNRXK3CDZ55MRJAVCNFSM6AAAAABQZOTDKKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZDANZVG44DKMA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Ok thanks for letting me know Martin :)


Is the closed issue counted toward the total number of issues in the repository?

Closed issues are counted toward the total number of issues in the repository.


Refactor and enhanced Enricher 'fmp-service'

port can now take a comma separated list with explicit mappings
multiPort can be switched on to allow multi-port services
Worked on documentation
Got rid of ServiceConfig and ServiceHandler which also decouples the enricher from the XML configuration classes.
Made logic (hopefully) easier to understand

Still todo: Verify and document the way how the enrichment of an existing service works.
Fixes #921

@jstrachan fancy about some review ? If not we, we could merge and see what happens :) (don't expect a tornado, though)

[merge]

[merge]


Automated Package Upgrade

:tada: This PR is included in version 12.0.42 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket: