Append to table?

Sorry if it has been asked before, but is it possible to append stuff to tables?  It's useful when adding elements into array-like tables. For example:
std::vector<int> someVector = {1, 2, 3, 4};
sol::table someTable = lua.create_table();
for(auto& elem : someVector) {
    someTable.append(elem);
}

That is not something that's possible, unfortunately. I can't think of a good way to implement it either, except by iterating through all of the values already in the table, keeping track of the highest number index in the Lua table, and then "adding" to it with the highest index++; and so on through the loop...
Just talking about it makes me think the actual performance would be kind've dirt.... Also, tables may even have holes in them which is why you'd have to loop over every key to know for sure... and even then it's not clear whether you can achieve the full iteration and get the "True Last Index". It's a really unfortunate situation.

LuaBridge has this functions implemented like this. I'm not sure how it works and it will probably fail for table with holes, but it's still useful to have this function and it looks pretty efficient.
This works:
sol::table arr = lua.create_table();
for (int i = 0; i < 10; ++i) {
    auto L = lua.lua_state();
    sol::stack::push(L, arr);
    sol::stack::push(L, i); // will work as arr[i + 1] = i;
    luaL_ref(L, -2);
    lua_pop(L, 1);
}

This can be optimized by adding function like append(Args&&... args) which will push the table and then continuously append stuff to the table without popping the table itself. Something like this (but with variadic args):
auto L = lua.lua_state();
sol::table arr = lua.create_table();
sol::stack::push(L, arr);
for (int i = 0; i < 10; ++i) {
    sol::stack::push(L, i);
    luaL_ref(L, -2);
}
lua_pop(L, 1);

I checked out what happens if you do it for table with holes: Lua tries to fill all holes in array part. For example if you have arr with arr[3] and arr[5] set, it will insert new stuff into 1, 2, 4, 6, etc. positions.
This is pretty strange. :D

Maybe a more accurate name would be table::fill( T v )? That way, we don't need to have the hard-guarantee of "append", but someone does get to just "stuff a value in this table here".

Yeah, sounds good, but I can see that it may be confusing for users, because "fill" sounds like it may overwrite some previous stuff (especially when inserting lots of values at once) or fill in some range. Something like insert_into_free_index sounds better, but it's too long, so we should look for the name which has the same meaning.
Maybe even table::insert will do if we'll write something like "inserts value into free array index" in docs.
Btw, I'm still not sure that this approach has some drawbacks or fail situations, so I'll take a closer look at it later.

This add/insert thing is really volatile:

It will definitely add the thing, but sure as hell it doesn't behave the same between lua versions and impls apparently. And with purposefully inserted nils, things get even funnier:

But, that behavior is not... too bad, still! Just have to note that holes in the table lead to weird behavior.

Yeah, that's weird... any idea why it works like this? So far I don't have a clue. :D
Btw, you can look at it this way: for table::size to work properly, you have to have continuous sequence. And this requirement is okay, so why not make it same for table::insert/append?

Sure, why not. I'll add it in: can't really hurt.

Awesome, thanks :D

Now part of this release: https://github.com/ThePhD/sol2/releases/tag/v2.8.5

lua["my_arr"] = vec;
Does it for you automatically.

Release has been updated; sorry about that stray #endif.

Wow, that's cool :D
How do I do something like this, though?
sol::table arr = lua.create_table();
arr = vec; // doesn't work!

Huh, that's awesome! Though, it's somewhat not what I'm used to... :D
I think there needs to be some stuff about std::vector/STL stuff possible in docs.
Once I figure out some stuff about sol2, I'm probably going to write some tutorials which are really needed to show users that such stuff is possible. :)

When assign: lua["my_arr"] = vec; table's index start from 1. How to make it start from 0?

@Mark-Joy You don't. ipairs() function iterates from 1, all other manner of Lua functions start from index 1: starting from 0 will break Lua. It's not worth it.

@ThePhD
Thank you.
I tried the below code but got error in lua, how to fix this?
in c++:
vector<double> vec{ 1,3,5,7,9 };
lua["vec"] = vec;

in lua:
for i, value in ipairs(vec) do
...
end

ERROR " bad argument #1 to 'ipairs' (table expected, got userdata)"

You're using Lua 5.1: Lua 5.1 does not support anything other than tables to ipairs or pairs. Either upgrade to Lua 5.2 or 5.3, or force your vector to be degraded down to a table by using as_table:
vector<double> vec{ 1,3,5,7,9 };
lua["vec"] = as_table( vec );

This is mentioned in the container documentation, beneath the complete example: http://sol2.readthedocs.io/en/latest/api/containers.html#a-complete-example
Note that a "manual iteration scheme" mentioned looks like this:
for i=1,#vec do
     print(i, vec[i])
end

Thanks again! I got it working now


Feat: E2e multiple chains support

add: parse and map chains and its config
doc(wip): detailed docs is in progress
e2e test(wip): get chain dynamically

Closing for later review.
We have 3 way communication support now.

Needs discussing and planning, closing for now. Following up on other priorities.


Brian/perf calc audit fixes

Pull Request Test Coverage Report for Build 7765

6 of 6 (100.0%)  changed or added relevant lines in 2 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 100.0%

Totals

Change from base Build 7749:
0.0%

Covered Lines:
1714

Relevant Lines:
1714

💛  - Coveralls


Return target_store to enable testing/logging stages after StoreToZarr

Very much WIP. I am trying to return a singular element containing the store that was just written to. What I am currently trying here is producing multiple outputs (I guess one per fragment written?).
@cisaacstern do you have any clever ideas to do this? I think it would open a host of functionality like testing and logging of successfully written stores.

Hmm this did actually print nothing when running the recipe locally. I added a simple print stage at the end
| beam.Map(print)

which previously (as in my early commits here) did print the target store object (just not one, but many).
Do we need to wrap the target_store in a beam.create() or something else?

Hmm this did actually print nothing when running the recipe locally. I added a simple print stage at the end

Not sure why it's not working for you. It does work for me. In my local clone, I put beam.Map(print) here:
https://github.com/jbusecke/pangeo-forge-recipes/blob/6922b8c4c6a4917b454bded2b0c14a1007780430/tests/test_end_to_end.py#L47-L53
            | StoreToZarr(
                target_root=tmp_target_url,
                store_name="store",
                target_chunks=target_chunks,
                combine_dims=pattern.combine_dim_keys,
            )
+           | beam.Map(print)
        )

Then running, e.g.
pytest -vxs tests/test_end_to_end.py -k "test_xarray_zarr[netcdf_local_file_pattern_sequential-target_chunks0-netcdf_local_paths_sequential_1d]" --disable-pytest-warnings

I get
====================================================== test session starts =======================================================
platform darwin -- Python 3.9.16, pytest-7.4.0, pluggy-1.2.0 -- /Users/charlesstern/miniconda3/envs/pfr-py39/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/charlesstern/Dropbox/pangeo/pangeo-forge-recipes
configfile: setup.cfg
plugins: nbmake-1.4.1, timeout-2.1.0, cov-4.1.0, lazy-fixture-0.6.3, anyio-3.7.0
timeout: 30.0s
timeout method: signal
timeout func_only: False
collected 22 items / 21 deselected / 1 selected

tests/test_end_to_end.py::test_xarray_zarr[netcdf_local_file_pattern_sequential-target_chunks0-netcdf_local_paths_sequential_1d] <zarr.storage.FSStore object at 0x19e014550>

Note the <zarr.storage.FSStore object at 0x19e014550> printed after the test line (scroll right).

Also, can you split this into its own PR against pangeo-forge/pangeo-forge-recipes@main ?
Having it on top of dynamic chunking will make this harder to review, IMO.
As noted in https://github.com/pangeo-forge/pangeo-forge-recipes/issues/559#issuecomment-1671800216, you could merge this with dynamic_chunks_2 into a separate dev branch on your fork, if you want the combined changes available for your development work. But having them layered together makes it harder to evaluate each as a PR to main, if that makes sense.

Hmm this did actually print nothing when running the recipe locally. I added a simple print stage at the end

Not sure why it's not working for you. It does work for me. In my local clone, I put beam.Map(print) here:

I assume then it is a problem with using pgf-runner locally at my end...I tried to adjust the requirements.txt but I am not sure that this even is relevant for a local bakery run?

Indeed this seems to work. I was able to implement a rudimentary test stage like this:
@dataclass
class TestDataset(beam.PTransform):
    """
    Test stage for data written to zarr store
    """
    iid: str

    def _check_and_print_store(self,store: zarr.storage.FSStore) -> zarr.storage.FSStore:
        iid_schema = "mip_era.activity_id.institution_id.source_id.experiment_id.variant_label.table_id.variable_id.grid_label.version"
        import xarray as xr
        import logging
        logger = logging.getLogger()
        ds = xr.open_dataset(store, engine='zarr', chunks={})
        print(ds)
        logger.info(f"Reloaded {ds =}")
        # assert (ds.time.diff('time') > 0).all()

        for facet_value, facet in zip(self.iid.split('.'), iid_schema.split('.')):
            if not 'version' in facet:
                print(f"Checking {facet = } in dataset attributes")
                assert ds.attrs[facet] == facet_value

        return store

    def expand(self, pcoll: beam.PCollection) -> beam.PCollection:
        return (pcoll
            | "Testing Xarray Dataset" >> beam.Map(self._check_and_print_store)
        )

recipes = {}
for iid, urls in url_dict.items():
    pattern = pattern_from_file_sequence(
        urls,
        concat_dim='time'
        )
    recipes[iid] = (
        beam.Create(pattern.items())
        | OpenURLWithFSSpec()
        | OpenWithXarray(xarray_open_kwargs={"use_cftime":True}) # do not specify file type to accomodate both ncdf3 and ncdf4
        | Preprocessor(urls=urls)
        | StoreToZarr(
            store_name=f"{iid}.zarr",
            combine_dims=pattern.combine_dim_keys,
            target_chunks={'time':400},
            # target_chunk_size='150MB',
            # target_chunks_aspect_ratio = target_chunks_aspect_ratio,
            # size_tolerance=0.4
            )
        | TestDataset(iid=iid)
        )

...and I am getting this in the logal pgf-runner output:
...
Worker: severity: INFO timestamp {   seconds:<PHONE_NUMBER>   nanos: 893973827 } message: "Python sdk harness exiting." log_location: "/srv/conda/envs/cmip6-leap-feedstock/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker_main.py:184" thread: "MainThread"
<xarray.Dataset>
Dimensions:    (lat: 144, bnds: 2, lon: 192, time: 52920)
Coordinates:
  * lat        (lat) float64 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0
    lat_bnds   (lat, bnds) float64 dask.array<chunksize=(144, 2), meta=np.ndarray>
  * lon        (lon) float64 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0
    lon_bnds   (lon, bnds) float64 dask.array<chunksize=(192, 2), meta=np.ndarray>
  * time       (time) object 1850-01-01 00:00:00 ... 1850-01-01 00:00:00
    time_bnds  (time, bnds) object dask.array<chunksize=(400, 2), meta=np.ndarray>
Dimensions without coordinates: bnds
Data variables:
    psl        (time, lat, lon) float32 dask.array<chunksize=(400, 144, 192), meta=np.ndarray>
Attributes: (12/44)
    Conventions:            CF-1.7 CMIP-6.2
    activity_id:            CMIP
    branch_method:          standard
    branch_time_in_child:   0.0
    branch_time_in_parent:  0.0
    cmor_version:           3.4.0
    ...                     ...
    table_id:               day
    table_info:             Creation Date:(13 December 2018) MD5:f0588f7f55b5...
    title:                  UKESM1-0-LL output prepared for CMIP6
    variable_id:            psl
    variable_name:          psl
    variant_label:          r14i1p1f2
Checking facet = 'mip_era' in dataset attributes
Checking facet = 'activity_id' in dataset attributes
Checking facet = 'institution_id' in dataset attributes
Checking facet = 'source_id' in dataset attributes
Checking facet = 'experiment_id' in dataset attributes
Checking facet = 'variant_label' in dataset attributes
Checking facet = 'table_id' in dataset attributes
Checking facet = 'variable_id' in dataset attributes
Checking facet = 'grid_label' in dataset attributes
...

This is super cool!
@cisaacstern do you think we need more tests for this, or could we merge this as is?


Serialization works by type of reference, not the actual referenced type

So, for example, if we serialize:
public class Container
{
    public object Item;
}

We'll get "{"Item":{}}" JSON.


fix: Loosen runtime requirements

@art049 This is ready for another review, at your convenience

Looks good, I also updated slightly the documentation about why we need to install setuptools when running python 3.12+

Thanks a lot @edgarrmondragon !
Sorry for the delay, we had a lot going on ;)


Fix emit for decorator type metadata.

The resolveEntityName function used by both emitExpressionIdentifier and getTypeReferenceSerializationKind always resolves the entity name using itself as the location. As a result, if there is a parameter declaration that has the same name as its type reference, that parameter declaration will be used as the value.
This fix clones the typeName that would be passed to getTypeReferenceSerializationKind and sets the clone's parent to point to the first non-declaration, non-type ancestor node of the type reference. This allows resolution to resolve a value outside of the class declaration, which is the scope in which the decorator metadata would be evaluated.
Fixes issue #3793.

So in your test:
@decorator
class MyComponent {
    constructor(public Service: Service) {
    }
}

what does the synthesized Service type-node get "parented" to?
I'm still hazy on why this is necessary - isn't there a better way of specifying the entity we actually wanted to refer to?

:+1:

@rbuckton what is holding this off?

@mhegazy Nothing now, I'll update it with the latest from master and merge.


Write E2E, integration tests for critical ui components

https://blog.logrocket.com/testing-next-js-apps-jest/

raised issuE: https://github.com/jestjs/jest/issues/14665


cgi can't connect to pigpio

I've tried to run a cgi example from pigpio python CGI abyz.co.uk site and it doesn't work. When i open site http://rpiAdress/pigpio_cgi.py it show error on top of the page:
"Can't connect to pigpio on soft(8889) Did you start the pigpio daemon? E.g. sudo pigpiod Did you specify the correct Pi host/port in the environment variables PIGPIO_ADDR/PIGPIO_PORT? E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888 Did you specify the correct Pi host/port in the pigpio.pi() function? E.g. pigpio.pi('soft', 8888))"
I run sudo pigpiod -p 8889 before.(port 8888 is also not working)
pigpiod is working well becouse I have an application on Windows which can connect and use pigpio over network and is work properly.
Whan I need to do? (also node.js can't connect to pigpio)

I must add that I'm using logmein hamachi on rpi, but I've tried to connect on both IP adresses(local network and virtual network)

When I run the script without starting the daemon I get this message.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Can't connect to pigpio on localhost(8888) Did you start the pigpio daemon? E.g. sudo pigpiod Did you specify the correct Pi host/port in the environment variables PIGPIO_ADDR/PIGPIO_PORT? E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888 Did you specify the correct Pi host/port in the pigpio.pi() function? E.g. pigpio.pi('soft', 8888)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
You must have altered the script (for test purposes?) or added some environment variables for it to be saying "Can't connect to pigpio on soft(8889)" rather than "Can't connect to pigpio on localhost(8888)".
If other systems can access the daemon at port 8888 that is clearly the correct port to be using.
Do you have the loopback interface running, i.e. on the Pi can you ping localhost?  If not make sure /etc/network/interfaces contains the lines
auto lo
iface lo inet loopback

I've tried this:
in script:    pigpio()    in shell:    sudo pigpiod
it doesn't work
in script:    pigpio('soft',8888)      in shell sudo pigpiod
it doesn't work
in script:   pigpio('soft',8889)       in shell   sudo pigpiod -p 8889
it doesn't work
and in script     pigpio('<IP_ADDRESS>',8889[and 8888] )
it doesn't work
In /etc/network/interfaces   I have:
auto wlan0      (when I change it to auto lo    then rpi can't connect to wifi network)
iface lo inet loopback
I'll try install pigpio from github and we'll see.

Does etc/network/interface have the line auto lo? Can you ping localhost?
I said to add the lines if they were not present.
You should not change anything in pigpio_cgi.py, leave that as it is until you get it working with the defaults.  Leave everything at the defaults.

When I add line "auto lo" in /etc/network/interfaces file then ping localhost is working, but there is no automatic(boot-up time) connection to wifi / internet. I must click connect in wpa_gui and then wifi(internet) and cgi script is working :)
What I need to do to get automatic internet connection(boot-up time) ?
My /etc/network/interfaces file:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address <IP_ADDRESS>
netmask <IP_ADDRESS>
network <IP_ADDRESS>
broadcast <IP_ADDRESS>
gateway <IP_ADDRESS>
auto wlan0

I have no idea.  I don't know your system or what you are trying to do.  If you have a general network configuration problem you need to ask on a general software site.

I've add lines:
" sudo ifdown wlan0
sudo ifup wlan0" to “/etc/rc.local”
and edit file /etc/default/ifplugd ,
changed line HOTPLUG_INTERFACES="all"
to HOTPLUG_INTERFACES="eth0 wlan0"
and....    it works!
Thanks for everything:) God bless You:)

I'm going to assume that getting networking working properly also cleared up the pigpio CGI script issue.


fix: update to eye v10.11.1

fix: update to eye v10.11.1

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

npm package (@latest dist-tag)
GitHub release
v16.10.1

Your semantic-release bot :package::rocket:


More specific RTT Connection status

Ok I think it looks good. correct my comments. Make sure RTT works well and all after.


How to build a graph from input file?

Hi,
I would like to do something trivial:
build a graph from an input file (.fastq format).
Yet, I haven't figured out how to do it
nor I have found instructions in the readme.
Note that it should be a trivial thing to do...
I would like to run something like:
./mccortex31 build -k 31 --input in.fastq --output out.ctx

How can one do it?
Thanks,
-Giulio

I figured out myself, by specifying:
-s 1 -1 <input_filename>

Crazy format... :)


No new Simvars

Hi,
I hope I can reach out to you with that. I just found your awesom git repo and the example you provided just works like a charm, but when I try to add more reqested variables (see screenshots), the values are just empty. I tried to query G Force from the Sim, but it keeps being empty...
I also added you on steam, maybe we can discuss about it a bit better over discord or something.
Many thanks in advance!
Greetings,
Tobias

The "G Force" requires most likely the unit "G Force" and not just "G" so your row should look like
{6,"G FORCE,G force"}
Those units are defined for example in the units.cs found in "Samples\SimvarWatcher"
Hopefully that helps you ;)

The "G Force" requires most likely the unit "G Force" and not just "G" so your row should look like
{6,"G FORCE,G force"}
Those units are defined for example in the units.cs found in "Samples\SimvarWatcher"
Hopefully that helps you ;)

That did the trick. Many thanks, and sorry for bothering :)


No WLAN and HTTP support in Arduino library?

Describe the bug
May I know why no WLAN and HTTP support in Arduino library?
To reproduce
no related functions and library in IDE
Expected behavior
Should have HTTP function in IDE
Screenshots
No response
Environment

OS:
IDE &IDE Version:
Repository Version:

Additional context
No response
Issue checklist

[X] I searched for previous reports in the issue tracker
[X] My report contains all necessary details

Do you mean examples similar to this?


How do I deal with controllers updating after the widget is already deleted?

I am using flutter version 1.17.3 and Get 2.12.5.
And I noticed that if I have a controller which is calling a callback when it's widget is already deleted a memory leak will occur. I do get a warning that this is happening. But what is a good way of dealing with this? Should I store the callback and set it to null onClose()?

Widget deleted, the controller will be deleted.
Before the controller is deleted, onClose is called.
If the default SmartManagement is enabled, onClose will happen before the widget is deleted (as soon as you click on remove or replace a route), and onDelete will happen simultaneously at your disposal.
onClose is async, which ensures that all operations placed on it occur before onDelete. That's all you need to know to handle things on your own.
The onClose method is part of the Controllers life cycle, and you should study it and create the logic of your application just as you would with a StatefulWidget.
I would love to continue answering support questions, but unfortunately this is wasting my time.
Please, if you have support questions, ask at Stackoverflow, which I and other users can answer.
If you have a real bug demonstration, with prints, reproduction code, etc., feel free to open an issue.


Download gene list is not working in transcriptomics heatmap tab

When selecting the gene list from the heapmap view of the Transcriptomics page, Download Genes doesn't work.

fixed and available on beta.

Working now.


Add subdomain summit.dao.brussels and update Google Doc id

Hi @xdamman
I added a (temporary) subdomain so we can start collecting leads via a mailing list: https://summit.dao.brussels
I also noticed that the google doc at https://dao.brussels/daosummit was not pointing to the one in the "website" folder of the google drive, so I fixed it.
Can you publish this please?

This PR is replaced by https://github.com/citizenspring/pages/pull/1


support building preference in code

This PR allows the preference configuration to be set in code, allowing this library to be used when programmatically building a preference screen. For example:
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
	val context = preferenceManager.context
	val screen = preferenceManager.createPreferenceScreen(context)

	val colorPref = ColorPickerPreference(context).apply {
		key = getString(R.string.bgColorKey)
		title = "Background Color"
		defaultColor = R.color.black
		attachAlphaSlideBar = false
		positive = "Confirm"
		negative = "Cancel"
		onInit()
		getColorPickerView().flagView = BubbleFlag(context)
	}
	screen.addPreference(colorPref)

	preferenceScreen = screen
}

Types of changes
What types of changes does your code introduce?

[x] New feature (non-breaking change which adds functionality)

The only changes needed were making a couple fields/methods public.

This fix was included in the new release 2.0.6.
Thank you for your contribution!

 Thank you for this wonderful color picker! I'm using it in my app https://github.com/ethanmdavidson/DeathProgress

Very motivational application. :] Amazing. Your application description and this article are very interesting.
I'm following Year Progress on Twitter for planning and retrospective of my life (this year), this kind of concept would be also helpful. 😃

I hadn't seen that before! I really like the idea of a year one as well, or maybe even letting the user pick which bar they want to display. Thanks for sharing, I've got a ton more ideas now! :grin:


Rewrite content field tests

In regard to https://github.com/ButterCMS/buttercms-csharp/issues/21

@prokopsimek csharp changes have been merged in, can you let us know if these test updates still apply (esp since there is currently a merge conflict)? thanks.

@vlnevyhosteny can you check it please? Thank you!

@prokopsimek csharp changes have been merged in, can you let us know if these test updates still apply (esp since there is currently a merge conflict)? thanks.

The issue is still relevant. But since tests were completely refactor I have created a new PR. I also refactor other classes. https://github.com/ButterCMS/buttercms-csharp/pull/42


How to Create Auto Update

Hi, i want to ask is there any possibility to auto update a table when i clik this circle

i've made this method but i confuse where i should to call this method

thanks

A modified Retrieve handler might do the job. If you want a reusable solution, implement a Behaviour.

@hannesb Thanks for response
so what about get data from the field which we cliked?

If you implement a retrieve behaviour, it will be passed as parameter (i.e. to OnReturn)


feat: update public accessible objects of that module

feat: add --env-file cli flag
feat: update public accessible objects of that module
test: update tests

@CodiumAI-Agent /review

PR Analysis

🎯 Main theme: Enhancements and tests for the image upload CLI
📝 PR summary: This PR introduces several enhancements to the image upload CLI, including the addition of a new --env-file CLI flag, updates to the public accessible objects of the module, and improvements to the error messages. It also includes updates to the tests to cover these new changes.
📌 Type of PR: Enhancement
🧪 Relevant tests added: Yes
⏱ Estimated effort to review [1-5]: 4, because the PR includes changes in multiple files, including the main CLI functionality, error handling, and tests. It also introduces a new feature (--env-file flag), which requires careful review to ensure it's correctly implemented.
🔒 Security concerns: No

PR Feedback
💡 General suggestions: The PR is well-structured and includes meaningful enhancements to the CLI. The addition of the --env-file flag is a good feature that provides flexibility to the users. The changes in the error messages make them more informative, which improves the user experience. The updates to the tests are also appreciated as they ensure the new changes are properly tested.
 🤖 Code feedback:relevant filesrc/images_upload_cli/cli.pysuggestion
Consider handling the case where both env_file and the default config file are not found. Currently, if env_file is not provided and the default config file is not found, load_dotenv will not raise an error, and the program may behave unexpectedly due to missing environment variables. [important]
relevant lineload_dotenv(dotenv_path=env_file or get_config_path())relevant filesrc/images_upload_cli/util.pysuggestion
Consider handling the case where the image mode is not "RGBA" or "RGB". Currently, if the image mode is not "RGBA" or "RGB", the make_thumbnail function will convert it to "RGB", which may result in loss of alpha channel (transparency) information. [medium]
relevant lineif im.mode != "RGB":relevant filesrc/images_upload_cli/upload.pysuggestion
Consider handling the case where the image upload fails. Currently, if the image upload fails, the error message includes the response text, which may contain sensitive information. It would be safer to not include the response text in the error message, or to sanitize it before including it. [important]
relevant linemsg = f"Image link not found in response:\n\n{response.text}"relevant filetests/test_cli.pysuggestion
Consider adding tests for the --env-file flag. Currently, there are no tests that specifically test the new --env-file flag. It would be beneficial to add tests that verify the correct behavior when the --env-file flag is used. [important]
relevant lineargs = ["tests/data/pic.png", "--env-file", "tests/data/.env.sample", "-C", "-h", hosting]

 ✨ Usage guide:
Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:
[pr_reviewer]
some_config1=...
some_config2=...

  Utilizing extra instructions
The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.
Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.
Examples for extra instructions:
[pr_reviewer] # /review #
extra_instructions="""
In the 'general suggestions' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

  How to enable\disable automation

When you first install PR-Agent app, the default mode for the review tool is:

pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

  Auto-labels
The review tool can auto-generate two specific types of labels for a PR:

a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)

  Extra sub-tools
The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_ticket, and more.

  Auto-approve PRs
By invoking:
/review auto_approve

The tool will automatically approve the PR, and add a comment with the approval.
To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:
[pr_reviewer]
enable_auto_approval = true

(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)
You can also enable auto-approval only if the PR meets certain requirements, such as that the estimated_review_effort is equal or below a certain threshold, by adjusting the flag:
[pr_reviewer]
maximal_review_effort = 5

  More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs 💎: Generate docstring for new components introduced in the PR.
/generate_labels 💎: Generate labels for the PR based on the PR's contents.
/analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

Persistent review updated to latest commit https://github.com/DeadNews/images-upload-cli/commit/51c3d0ec7f17895450ce4c4bb2fc3236f62f7603


Add scrolling to getting started page

Currently using just native scroll, ideally would use DomScrollableElement, cc @alexdima for help working with that.


Investigate using TestContainers to replace embedded-eureka

The documentation lives here: https://www.testcontainers.org/quickstart/junit_5_quickstart/
This would potentially allow us to move to Java 17+

@chrisrohr Should this issue cause the minor version to bump? i.e. to 1.2.0?


S-meter values too high in AM

only smeter to much open in AM (agc?), then would be perfect!
is the best firmware until right now!👍

I m very surprised that FW is improving day by day، with limited memory its a big acheavment to add awsome funtions

I m very surprised that FW is improving day by day، with limited memory its a big acheavment to add awsome funtions

absolutely!!👍

Thank you.
This is basically a duplicate of #53. Please go there, you will find a firmware there that displays raw RSSI value. If you have any way of telling what is the correlation between RSSI and correct value of dBm across spectrum (ideally 3 points per band) I could try to calibrate it. I'm not a ham operator and my knowledge is limited in this regard, also I don't know what kind of accuracy is satisfactory.
The dBm currently is calculated as (rssi / 2) - 160 which comes from RF IC reference manual, but it looks like to me that it is shifted, and shows to high values.

Thank you. This is basically a duplicate of #53. Please go there, you will find a firmware there that displays raw RSSI value. If you have any way of telling what is the correlation between RSSI and correct value of dBm across spectrum (ideally 3 points per band) I could try to calibrate it. I'm not a ham operator and my knowledge is limited in this regard, also I don't know what kind of accuracy is satisfactory. The dBm currently is calculated as (rssi / 2) - 160 which comes from RF IC reference manual, but it looks like to me that it is shifted, and shows to high value

is enough to reduce a bit, not important be very precis.... try and we check...😉

Reduction in dBm
-30, // band 1
-36, // band 2
-54, // band 3
-48, // band 4
-48, // band 5
-48, // band 6
-12  // band 7
reduced_rssi.packed.bin.zip

Reduction in dBm -30, // band 1 -36, // band 2 -54, // band 3 -48, // band 4 -48, // band 5 -48, // band 6 -12 // band 7
[reduced_rssi.packed.bin.zip]

so is too much, the pic show the difference,  in the middle of the last 2 release would be good👍
https://drive.google.com/file/d/1GmxOpAJev4ZpZjo76cbZLNbAKTJ6UXRL/view?usp=drivesdk
TNX MATE !

Egzumer, the first reduce release is much hard, try this when you have a bit of time please🙏:
b1: -15
b2: -15
b3: -25
b4: -20
b5: -20
b6: -20
b7: -7

.. that's the right value! much more real, good job! 👍🙏

...also the AM audio quality seem more clear, less noise 👌

...also the AM audio quality seem more clear, less noise 👌

Placebo effect, there is no change regarding that. Also the s-meter values are as you suggested, so good job for both of us.
Feedback from other users is also welcome.

i said "SEEM" but only few minuts of testing, maybe placebo.... or maybe propagation🤷, anyway  the signal strength now is ok 👏👏


bytes, strings: Compare tests do not modify input alignments

I can't see any tests varying the alignment of Compare arguments. Since Compare is written in assembly on most platforms (in internal/bytealg) we should probably be checking that it works even if the inputs are unaligned.

@LotusFenn Yes, bytes/compare_test.go and strings/compare_test.go. An additional short test in each that just varies the input alignment from, say, 0 to 16 (inclusive) would be great. Thanks!

@mundaym - The Compare function in strings does not use assembly and has a simple implementation.
	if a == b {
		return 0
	}
	if a < b {
		return -1
	}
	return +1

It even has a note from @rsc saying -
	// NOTE(rsc): This function does NOT call the runtime cmpstring function,
	// because we do not want to provide any performance justification for
	// using strings.Compare. Basically no one should use strings.Compare.

Would you still want to test unaligned input for strings/compare_test.go ?

@agnivade Good point. I still think it would be worthwhile though. The compiler could do the substitution with runtime.cmpstring or other alignment-sensitive vector code under the hood (as rsc alluded to in that comment).


Case split ignores variables when hole has too few spaces

When the spaces in a hole are removed before doing an interactive case split, it seems like any variables to split on are ignored.
To reproduce:

create and load the following file:

data Bool : Set where
  true : Bool
  false : Bool

not : Bool → Bool
not b = ?

delete the spaces inside the hole, so it looks like {!0!} (the bug also happens with a single space left, but not if there's at least two).
do C-c C-c, enter b as the variable to split on.
This results in an error:

Cannot split into projections because the target type Bool is not a
record type
when checking that the expression ? has type Bool

This is using version 0.2.7 of the extension and Agda <IP_ADDRESS> on Linux Mint.

Issue reproduced!


Questions about the tensorflow version

Tensorflow is required to be 1.13, but your CUDN version does not support TensorFlow 1.13, in addition to reducing the CUDN version, is there a solution?

just add .compat.v1 like I did

Can you run the program when you use “.compat.v1”? I also saw this solution when I first ran the program, but after experimenting with this solution, other problems arose.


[Windows] feature-wish: use command line options

hi!
i use toggl on a regular basis and was wondering if it is possible to include the following feature in the windows desktop version:

start tracking a certain project from command line.

example:
TogglDesktop.exe -project "Projectname"
which starts toggl and immediatley tracks a new entry for the project "Projectname".
This would be very useful to make it possible to start tracking a user session as soon as windows is started up - or to make desktop-shortcuts to start tracking certain projects.

We have decided not to implement this feature into Toggl Desktop. Thank you for your feedback.

Is there any kind of API for the running Toggl Desktop app?
Consider this situation: I am away from the internet, and I want to start tracking new task for some project. I can do that with Desktop app. But I would like to do that from command line (because command line is my main workspace).
I saw toggl-cli project but it didn't work on my machine. And I would like Toggl Desktop to cache my data.

@MarSoft There is no command line api for Toggl Desktop app. We do not have plans to add this functionality. There are some community created CLI-s in the toggl api docs  repo, but I don't think that they support offline mode.

Maybe some other API, like DBus or whatever? I see it should be possible to programmatically stop tracking current task by sending Ctrl+S to the running TogglDesktop's window, and it should be possible to restart (continue) last task by sending Ctrl+O. But no way to start new task with certain task name, project and other attributes, right?..
My usecase is that I am using tiling WM, and use dmenu to start new task. For it to work properly I need first to obtain list of "suggestions" (i.e. latest used task names with their projects), and then to programmatically start new task with given name&project.


Issue Title: "Add Chatbot Feature"

@jinx-vi-0
Issue Description: I would like to add a chatbot feature to the website to enhance user support and engagement. The chatbot will provide instant assistance to users by answering common queries, offering guidance, and directing them to relevant sections of the site.
Please assign this issue to me under the labels: level3, gssoc-ext, and hacktoberfest-accepted.

Can you please help me understand why a password management website needs a chatbot?

@jinx-vi-0 actually i thought the same,


360° view

Could you provide any code to get a 360° view of the model like you demoed in your video at https://youtu.be/cYHQKtBLI3Q?t=21

Hi,
Note that in the renderer it has the option to take in view-angles https://github.com/akanazawa/cmr/blob/5d97c4e744bcdd6c3bc20866305ec382fce7fcc5/demo.py#L62
to make that kind of video, you simply render the model in every 5 or 15 angle increments and ffmpeg the resulting images together.
Best,
Angjoo

Thank you, Angjoo. What I'm actually trying to do is to get the numpy array of the preprocessed image and visualize it via ipyvolume so that you can twist and turn it. Have a look if you're interested. It's quite amazing https://ipyvolume.readthedocs.io/en/latest/index.html#volume

Super neat!! Thanks for sharing.


[SPARK-35613][CORE][SQL] Cache commonly occurring strings in SQLMetrics, JSONProtocol and AccumulatorV2 classes

What changes were proposed in this pull request?
Cache commonly occurring duplicate Some objects in SQLMetrics by using a Guava cache and reusing the existing Guava String Interner to avoid duplicate strings in JSONProtocol. Also with AccumulatorV2 we have seen lot of Some(-1L) and Some(0L) occurrences in a heap dump that is naively interned by having reusing a already constructed Some(-1L) and Some(0L)
To give some context on the impact and the garbage got accumulated, below are the details of the complex spark job which we troubleshooted and figured out the bottlenecks. tl;dr - In short, major issues were the accumulation of duplicate objects mainly from SQLMetrics.
Greater than 25% of the 40G driver heap filled with (a very large number of) duplicate, immutable objects.

Very large number of duplicate immutable objects.

Type of metric is represented by 'scala.Some("sql")' - which is created for each metric.
Fixing this reduced memory usage from 4GB to a few bytes.

scala.Some(0) and scala.Some(-1) are very common metric values (typically to indicate absence of metric)

Individually the values are all immutable, but spark sql was creating a new instance each time.
Intern'ing these resulted in saving ~4.5GB for a 40G heap.

Using string interpolation for metric names.

Interpolation results in creation of a new string object.
We end up with a very large number of metric names - though the number of unique strings is miniscule.
~7.5 GB in the 40 GB heap : which went down to a few KB's when fixed.

Why are the changes needed?
To reduce overall driver memory footprint which eventually reduces the Full GC pauses.

Does this PR introduce any user-facing change?
No

How was this patch tested?
Since these are memory related optimizations, unit tests are not added. These changes are added in our internal platform which made it possible for one of the complex spark job continuously failing to succeed along with other set of optimizations.

Tagging @mridulm here to take a look as we worked together on these changes.

Can one of the admins verify this patch?

Can you please include the impact of these changes ?
For the cases we observed, what was the impact of individual changes ?
This will help quantify the amount of garbage saved for nontrivial spark applications.

+CC @cloud-fan

ok to test

Yeah, agree with @mridulm's point. The changes look making sense.

The change makes sense, but it's also better to know the impact.

Test build #139262 has started for PR 32754 at commit 2cb9f8a.

Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43786/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43786/

Test build #139262 has finished for PR 32754 at commit 2cb9f8a.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139262/

Can one of the admins verify this patch?

Can you please include the impact of these changes ?
For the cases we observed, what was the 'savings' for the individual changes ?
This will help quantify the amount of garbage saved for nontrivial spark applications.

Added more details on the garbage accumulated and the impact after fixing them.
Earlier the job used to be configured with driver memory of 40+gb and still run into heavy GC but after these fixes the driver memory is brought down to 25gb and no long Full GC pauses. Now the Full GC pauses are much more streamlined.

Gentle reminder @HyukjinKwon @cloud-fan @mridulm

Thanks for the details @venkata91.
Looks good to me, will leave it open for a couple of days for review by others as well.

Sounds good. Thanks.

Merging to master


Made example titles more consistent

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

@Manish-Giri I hardly call this fair... I was changing the labels for consistency and clarity


Can't delete existing job

Hi, I've just encountered this error: we have been running one scheduled job for some time (each minute for a week)
and now i wanted to delete the job, however calling DELETE resulted in
curl -v -XDELETE https://metronome.internal/v1/jobs/example-api.production.cron
*   Trying <IP_ADDRESS>...
* Connected to metronome.internal (x.x.x.x) port 443 (#0)
* TLS 1.2 connection using TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: metronome.internal
* Server certificate: xxx
* Server certificate: xxx
> DELETE /v1/jobs/example-api.production.cron HTTP/1.1
> Host: metronome.internal
> User-Agent: curl/7.49.1
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Length: 59
< Content-Type: application/json
< Date: Tue, 06 Dec 2016 13:47:24 GMT
<
* Connection #0 to host metronome.internal left intact
{"requestPath":"/v1/jobs/example-api.production.cron"}

and in the metronome log i found
mesosphere.marathon.StoreCommandFailedException: Can not delete entity job-runs/example-api.production.cron
	at mesosphere.util.state.zk.ZKStore$$anonfun$exceptionTransform$1.applyOrElse(ZKStore.scala:94)
	at mesosphere.util.state.zk.ZKStore$$anonfun$exceptionTransform$1.applyOrElse(ZKStore.scala:93)
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
	at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:216)
	at scala.util.Try$.apply(Try.scala:192)
	at scala.util.Failure.recover(Try.scala:216)
	at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:326)
	at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:326)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
Caused by: org.apache.zookeeper.KeeperException$NotEmptyException: KeeperErrorCode = Directory not empty for /metronome/state/job-runs/example-api.production.cron
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:125)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at com.twitter.zk.AsyncCallbackPromise$class.process(AsyncCallbackPromise.scala:18)
	at com.twitter.zk.UnitCallbackPromise.process(AsyncCallbackPromise.scala:29)
	at com.twitter.zk.UnitCallbackPromise.processResult(AsyncCallbackPromise.scala:31)
	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:609)
	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498)
[error] d.m.j.i.JobSpecPersistenceActor - Repository change failed
mesosphere.marathon.StoreCommandFailedException: Can not delete entity job-runs/example-api.production.cron
	at mesosphere.util.state.zk.ZKStore$$anonfun$exceptionTransform$1.applyOrElse(ZKStore.scala:94)
	at mesosphere.util.state.zk.ZKStore$$anonfun$exceptionTransform$1.applyOrElse(ZKStore.scala:93)
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
	at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:216)
	at scala.util.Try$.apply(Try.scala:192)
	at scala.util.Failure.recover(Try.scala:216)
	at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:326)
	at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:326)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
Caused by: org.apache.zookeeper.KeeperException$NotEmptyException: KeeperErrorCode = Directory not empty for /metronome/state/job-runs/example-api.production.cron
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:125)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at com.twitter.zk.AsyncCallbackPromise$class.process(AsyncCallbackPromise.scala:18)
	at com.twitter.zk.UnitCallbackPromise.process(AsyncCallbackPromise.scala:29)
	at com.twitter.zk.UnitCallbackPromise.processResult(AsyncCallbackPromise.scala:31)
	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:609)
	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498)

restarting metronome itself (i run it as a marathon application) helped and i could curl -XDELETE the job afterwards. I guess there must have happened some de-sync between the zookeeper and the in-memory data in metronome..? Or maybe desync against the mesos.. This job has always run only on a schedule, never as a standalone run (via the POST /run).

anyone interested, maybe @aquamatthias?

Note: This issue has been migrated to https://jira.mesosphere.com/browse/MARATHON-1653. For more information see https://groups.google.com/forum/#!topic/marathon-framework/khtvf-ifnp8.


Proposed backward-compatible syntax for owning and output references

Since move is already a keyword, I propose the following:
&move T indicates a move reference to T. A move reference implicitly moves out of whatever it borrows, and dereferencing it consumes the reference, yielding a value of type T, but it may also be borrowed as &T and &mut T. &move T is NOT copy, and does not allow reborrowing like &mut T does. The borrowed variable is considered dropped at the end of the lifetime of the &move T by borrowck. Drop::drop() will be implicitly called.
&move mut T indicases an output reference to T. An output reference is considered an uninitialized variable by the borrowchecker. Only an uninitialized variable can be borrowed as &move mut, and it is considered initialized by borrowck after the end of the lifetime of the &move mut. Once initialized, it is considered identical to &mut T.
&move T is the owning reference that a lot of people have been wanting for a while, and &move mut T is my idea for a generalized placement new syntax, which might be necessary when/if we support unmovable types. An alternative to &move mut T would be a combination of placement syntax and guaranteed return-value optimization for functions returning unmovable types; I suppose the latter would be necessary anyway for them to work at all.
Thoughts? Reasons why this wouldn't actually parse? Alternative syntax?

&move has been discussed fairly extensively: see #998 and #1646


TC synthesis fails with unknown metavariable

I'm getting an error unknown metavariable '?_uniq.6088' during type class synthesis. From my limited understanding this is almost always a bug. Unfortunately, I was unable to create self contained mwe, and the only way I can reproduce it is by cloning my repository.
git clone --branch tc_problem https://github.com/lecopivo/SciLean.git
cd SciLean
lake build

The error should be:
./SciLean/Data/Table.lean:124:2: error: unknown metavariable '?_uniq.6088'

It is likely the type class instances are incorrectly set up and TC gets into an infinite loop, but still the error message  unknown metavariable '?_uniq.6088' is highly suspicious.
Please do not bother trying to figure out the tangle of typeclasses. I have two classes in which I did not find outParam sufficient to achieve what I need do, so I devised a Trait class trick. This error is a result of some non-trivial interaction of Trait classes for SemiInner and Table.

Yes, unknown metavariable is usually due to a bug in Lean or a user metaprogram.
We currently do not have cycles to investigate issues that are reported without a self-contained mwe. We would be very grateful if you create one. The standard recipe is to keep incrementally removing dependencies.

Understandable, will keep poking at it and hopefully reduce it to something smaller.

I have managed to produce mwe:
class Vec (X : Type u)

class IsLin {X Y} [Vec X] [Vec Y] (f : X → Y)

def ℝ := Float

instance : Vec ℝ := sorry
instance {α : Type u} {X : Type v} [Vec X] : Vec (α → X) := sorry
instance {X : Type u} {Y : Type v} [Vec X] [Vec Y] : Vec (X × Y) := sorry

--------------

instance swap_is_lin {α : Type} {Y Z : Type} [Vec Y] [Vec Z]
  (f : α → Y → Z) [∀ a, IsLin (f a)]
  : IsLin (λ y a => f a y) := sorry
instance comp_is_lin {X Y Z : Type} [Vec X] [Vec Y] [Vec Z]
  (f : Y → Z) (g : X → Y) [IsLin f] [IsLin g]
  : IsLin (λ x => f (g x)) := sorry

----------------

class Trait (X : Type u) where
  R : Type v
  D : Type w
  eval : R → D → ℝ

attribute [reducible] Trait.R Trait.D Trait.eval

class SemiInner (X : Type u) (R : Type v) (D : Type w) (eval : R → D → ℝ) where
  semiInner : X → X → R
  testFunction : D → X → Prop

@[reducible] instance (X) (R : Type u) (D : Type v) (e : R → D → ℝ) [SemiInner X R D e] : Trait X := ⟨R, D, e⟩

class SemiHilbert (X) (R : Type u) (D : Type v) (e : R → D → ℝ) [outParam $ Vec R] extends Vec X, SemiInner X R D e

instance (X R D e) [Trait X] [Vec R] [SemiHilbert X R D e] (ι : Type v) : SemiHilbert (ι → X) R D e := sorry

instance : SemiInner ℝ ℝ Unit (λ r _ => r) := sorry

--------------

constant foo {X Y} : (X → Y) → (X → Y) := id
theorem  foo_apply {X Y} [Vec X] [Vec Y] (f : X → Y) [IsLin f] (x dx : X)
        : foo f x = f x := sorry

def norm {X} [Trait X] [inst : SemiInner X (Trait.R X) (Trait.D X) Trait.eval] (x : X) : Trait.R X := sorry

def sum {n} {α : Type} (f : Fin n → α) : α := sorry

set_option trace.Meta.synthInstance true in
example (x) : (foo λ (x : Fin n → ℝ) (j : Fin n) => sum λ i => norm (x i)) x = x :=
by
  rw [foo_apply]
  admit

@lecopivo Thanks for posting the mwe. Not sure it is related to your original issue. The "unknown metavariable" error in the mwe is due to an invalid trace message. I pushed a fix issue for this issue, but not sure whether it also fixes the original issue.  Could you please try?

Yes the error message is correct now, both in mwe an in the original problem.
Unfortunately, the TC still gets into an infinite loop but that is a different issue, mine not Lean's. The structure of typeclasses is inherently flawed. The problematic instance is:
instance (X R) [Vec R] [SemiHilbert X R] (ι : Type v) : SemiHilbert (ι → X) R := sorry

Ideally I would reverse the order of [Vec R] and [SemiHilbert X R], but that is not possible as the definition of SemiHilbert requires Vec R. I would like to somehow express, do not bother synthesizing Vec R if there is no hope in synthesizing SemiHilbert X R.


Feature: Add ability to stop/interupt stream

This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

I would like to have a button that will stop/interrupt the stream being rendered (ChatGPT has this). So if the response is going downhill, the user would be able to stop it before it goes any further. I've tried implementing something myself, but it doesn't quite work with the ASyncGenerator.

Interesting. I wonder if you could try ReadableStream.cancel() method, as ReadableStream() is what we use in the frontend:
https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel
The spec says that sending a cancel event should attempt to cancel the underlying mechanism, so I think it would close the TCP connection? I'm not sure if you'd still pay for the full tokens of the call though. That's worth experimenting with, if you haven't yet.
Otherwise I fear you'd need to move to something with better bidirectional support like web sockets.

Thanks for the prompt response! I was trying to cancel the asyncio thread in Quart, but cancelling the stream make much more sense :)
I've been able to implement this just now, and it seems to work quite well. As far as I can tell, it also stops the response coming back from the model, but I am not sure if there's a way I can check if I was still billed for the full token count, but it doesn't bother me that much, the user experience is more important :)
const [responseStream, setResponseStream] = useState<ReadableStream|null>(null);
const handleAsyncRequest = async (question: string, answers: [string, ChatAppResponse][], setAnswers: Function, responseBody: ReadableStream<any>) => {
        setResponseStream(responseBody);
// ... other code ... //

Then I've just added a button that calls onStopClick()
const onStopClick = async () => {
    try {
        if (responseStream) {
            responseStream.cancel("User cancelled the stream");
        }
    } catch (e) {
        console.log(e);
    }
};

Very cool! You might be able to monitor token usage in your Azure OpenAI metrics dashboard.

Looks nice, very cool indeed. We will try it on our end and give you feedback!

Hi all,
@TaylorN15 don't you face an error such as :
ReadableStream.cancel: Cannot cancel a stream locked by a reader  ?
I could not interrupt my chat the way you shared, but I just found a workaround like this :
export class ClassForReadNDJSONStream {
    reader: ReadableStreamDefaultReader;
    responseBody: ReadableStream<any>;

    constructor(responseBody: ReadableStream<any>) {
        this.responseBody = responseBody;
        this.reader = responseBody.getReader();
    }
    async *readStream() {
        let runningText = "";
        let decoder = new TextDecoder("utf-8");
        while (true) {
            const { done, value } = await this.reader.read();
            if (done) break;
            var text = decoder.decode(value, { stream: true });
            const objects = text.split("\n");
            for (const obj of objects) {
                try {
                    runningText += obj;
                    let result = JSON.parse(runningText);
                    yield result;
                    runningText = "";
                } catch (e) {
                    // Not a valid JSON object
                }
            }
        }
    }
}

const c4readNDSJonstream = new ClassForReadNDJSONStream(responseBody);
setResponseStream(c4readNDSJonstream); // Using your method with ClassForReadNDJSONStream signature

for await (const event of c4readNDSJonstream.readStream()) {
// other code ...

Based on @pamelafox readNDJSONStream lib but expose reader to allow reader.releaseLock() (and then responseBody.cancel()) in onStopClick() to interrupt chat answer.
What do you think about it ?

Yes, actually, I did get that error :)
I ended up implementing an abort controller instead.

you might sharing the code ? @TaylorN15

Add the AbortController
const [abortController, setAbortController] = useState<AbortController | null>(null);
Add the below into makeApiRequest
const makeApiRequest = async (question: string) => {
	const controller = new AbortController();
	setAbortController(controller);

Add the AbortSignal to the props of handleAsyncRequest
const handleAsyncRequest = async (
	question: string,
	answers: [string, ChatAppResponse][],
	responseBody: ReadableStream<any>,
	signal: AbortSignal
) => {

And the logic for handling the abort, also in handleAsyncRequest
setIsStreaming(true);
for await (const event of readNDJSONStream(responseBody)) {
	if (signal.aborted) {
		// Abort the stream if requested
		break;
	}

Create a function for when the button is clicked, and call from where you want, I have mine in the question container, so that the stop button appears instead of the send button, if the answer is streaming
const onStopClick = async () => {
	try {
		if (abortController) {
			abortController.abort();
		}
	} catch (e) {
		console.log("An error occurred trying to stop the stream: ", error);
	}
};

Nice, does yours actually stop the stream on the backend? It seems that most of the time, mine doesn’t. It doesn’t bother me much, but it would be nice to reduce the token usage :)

Hello, sorry for the delay.
Yes, it stops the stream on the backend. Depending on when the chat is stopped, I may save a few tokens.

Did you add any code to the backend to handle the abort?

No, I didn't add anything to the backend, as fetch api natively handles AbortController signals.

@TrentinMarc I am curious about how you implemented this. I tried following the code layed out here, but when I cancel the stream in the chat I get the following error message on the screen:
AbortError: BodyStreamBuffer was aborted
I was wondering if there is a more graceful approach to handling this that you may be aware of.

@ssjdan27 I did not check the recent updates on this project as I stopped working with, but when we were working on it, the simpliest way was to add the signal parameter to the fecth() function performed by chapApi().
Perhaps the asynchronus process has been edited in the meantime ?
If you run out of solution, let's share more informations about your problem :)

Please create an Pull Request

@cforce I will work on it! I will do my best to get that open within the next few days.

@cforce I just opened a PR here. Feel free to check it out!


Add support for client certificates

It would be great if you could give the HTTPS request a client certificate.
Certificate format like:
-----BEGIN CERTIFICATE ----- ASDASDASDASDASDASDASD ASDASDASDASDASD .... -----END CERTIFICATE -----

Could you take a look at #28 ?


Update rust-toolchain

Can Dependabot update the rust-toolchain file, if it exists?
It should at least update stable to latest stable, and ideally update nightly to latest nightly and beta to latest beta. Updating nightly to stable (eg an unstable feature got stabilised) should probably be a manual change.

rustup now supports rust-toolchain files that look like
[toolchain]
channel = "nightly-2020-11-25"
components = [ "rustfmt", "rust-src", "llvm-tools-preview"]
targets = [ "x86_64-unknown-hermit" ]

take from https://github.com/hermitcore/rusty-hermit/blob/master/rust-toolchain
The project uses features only available in the nightly version of the rust compiler, but if we set the channel directly to 'nightly' the CI will download the latest version, which means it uses a different compiler/format checker/... every day. Just a few days ago there was a change in rustfmt, which resulted in every pull request to fail as the latest version of rustfmt wanted to format parts of the code differently.
If we could use dependabot to update the rust-toolchain file once a week that would be great :smile:
// CC @stlankes

Yes, the usage of dependabot will be great. Can you that?

I think technically it'll be possible, but it will require adding support at all levels of dependabot. I don't think we'll be able to prioritize it in the near future unfortunately.
Having said that, what would be some good resources to read up on rust-toolchain, what it does and how we could check for new versions etc?

rust-toolchain is used by rustup. See [0] if you are looking for information on what rustup does. [1] is the link directly to the rust-toolchain file section. I am not aware of any exact specification on the file, but I think @ebroto added support for the TOML syntax to rustup, maybe he can provide some further details.
[0] https://rust-lang.github.io/rustup/index.html
[1] https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file

This would be very useful!

I also think this would be very interesting. Right now we use the lastest stable toolchain, which causes us every once in a while fixing new clippy warnings when they are added.... It would be nice to have a fixed version configured, and dependabot letting us know if a new version can be updated without any issues or not.

I'm going to share some of the research I was able to find on datasources for updating rust-toolchain.toml:
Dependabot would need to update the channel property in rust-toolchain.toml. channel is formatted as^1:
<channel>[-<date>][-<host>]

<channel>       = stable|beta|nightly|<major.minor>|<major.minor.patch>
<date>          = YYYY-MM-DD
<host>          = <target-triple>

Semver versions can be found from the git tags in https://github.com/rust-lang/rust ^2. Full information on dated channels can be found at the following URLs:

https://static.rust-lang.org/dist/channel-rust-stable.toml
https://static.rust-lang.org/dist/channel-rust-beta.toml
https://static.rust-lang.org/dist/channel-rust-nightly.toml

However, we only likely need the date itself, which can be found at:

https://static.rust-lang.org/dist/channel-rust-stable-date.txt
https://static.rust-lang.org/dist/channel-rust-beta-date.txt
https://static.rust-lang.org/dist/channel-rust-nightly-date.txt

Another potential avenue for both semver and channel version data is the Rust manifest list^3. It's a single source for all of this information.

Note that for internal consumption in Azure DevOps, we will need to be able to configure Dependabot to be able to use our internal msrustup toolchain installer (which supports Azure authentication), and to install the internal Microsoft toolchain which we require for production Rust binaries.
So Dependabot will need some configuration mechanism to allow the information sources you mention to be configured appropriately, such that public Dependabot would use the public rust-lang channels as you suggest, whereas Azure DevOps Dependabot would be configured to use internal channels to get the same information.
In general, "support configuration for using internal Microsoft Rust toolchain and toolchain installer" is its own feature, which overlaps with the general feature for installing toolchains dynamically within Dependabot. @abdulapopoola is going to connect me with that ongoing work.

Tagging @jakecoffman and @jurre , I suspect this will need proxy changes?


Show exceptions in a separate section of the CLI output

Resolves #203

Codecov Report

Merging #208 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   99.88%   99.89%   +<.01%
==========================================
  Files          18       18
  Lines         900      924      +24
  Branches      134      139       +5
==========================================
+ Hits          899      923      +24
  Partials        1        1

Flag
Coverage Δ

#unittests
99.89% <100%> (ø)
:arrow_up:

Impacted Files
Coverage Δ

src/schemathesis/models.py
100% <100%> (ø)
:arrow_up:

src/schemathesis/runner/__init__.py
100% <100%> (ø)
:arrow_up:

src/schemathesis/utils.py
100% <100%> (ø)
:arrow_up:

src/schemathesis/cli/output.py
99.23% <100%> (+0.11%)
:arrow_up:

Continue to review full report at Codecov.

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


Get the buttons and labels in the showcase

This is on hold due to the redesign

I don't think this is relevant now.


Changes in test and Dockerfile

Changes in the Dockerfile use "latest" version instead of having to change the last version manually from time to time. Since documentation says by default it builds the latest version, it iw consistent with it.
Minor changes in documentation.
The Travis file builds, starts and then checks it's running. Maybe it would be better to have a test suite and actually run it, but this is second best.

Hi @JJ, thanks for the contribution! Quick question: wouldn't having ARG rakudo_version=latest cause docker to cache the resulting image, so you would need to invalidate the cache every time you want to build an image for a new rakudo star version?

@hoelzro correct -- for the official images builds, this will need to stay pinned to a specific version, but perhaps some documentation could be added to this repo about using latest via --build-arg?  (or a quick link for how to look up what the latest release version is, and then how to specify it?)

2017-12-08 21:30 GMT+01:00 Tianon Gravi<EMAIL_ADDRESS>
@hoelzro https://github.com/hoelzro correct -- for the official images
builds, this will need to stay pinned to a specific version, but perhaps
some documentation could be added to this repo about using latest via
--build-arg? (or a quick link for how to look up what the latest release
version is, and then how to specify it?)

They are now on a pretty tight schedule: every 1st, 4th, 7th and 10th,
released on the next month. A script, anyway, might solve it straight away.

Indeed, for most of the images maintained under https://github.com/docker-library, we write an update.sh script which simply bumps the version numbers, then we have a Jenkins instance which is responsible for running that periodically, build-testing the result, then pushing an update commit directly to the relevant repository.
When we notice such commits (which I get directly to my inbox via GitHub's atom feed from our @docker-library-bot's activity feed), we then make the appropriate PR to https://github.com/docker-library/official-images.  We even have a maintainer or two who automate that final PR. :+1:


Update key-vault-manage-with-cli.md

fixing command line option

Hi @adamglick, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

It looks like you're working at Microsoft (aglick). If you're full-time, we DON'T require a contribution license agreement.

If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@adamglick : Thanks for your contribution to the Azure documentation! The author, @BrucePerlerMS, has been notified to review your proposed change.

Nice catch. Thanks for submitting the fix. I'm signed off.

#signoff


Merge updates to live branch

Docs Build status updates of commit 2ccb03e:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

TerminalDocs/customize-settings/actions.md
:bulb:Suggestion
View
Details

TerminalDocs/customize-settings/appearance.md
:white_check_mark:Succeeded
View

TerminalDocs/customize-settings/interaction.md
:white_check_mark:Succeeded
View

TerminalDocs/customize-settings/profile-appearance.md
:white_check_mark:Succeeded
View

TerminalDocs/dynamic-profiles.md
:white_check_mark:Succeeded
View

TerminalDocs/get-started.md
:white_check_mark:Succeeded
View

TerminalDocs/index.md
:white_check_mark:Succeeded
View

TerminalDocs/troubleshooting.md
:white_check_mark:Succeeded
View

TerminalDocs/customize-settings/actions.md

Line 1107, Column 2: [Suggestion-column-header-missing] Column headers are required for tables. Add appropriate header text, or remove any extra table cells that cause an extra column.

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel

Docs Build status updates of commit fab316c:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

TerminalDocs/customize-settings/actions.md
:bulb:Suggestion
View
Details

TerminalDocs/customize-settings/profile-general.md
:bulb:Suggestion
View
Details

TerminalDocs/customize-settings/appearance.md
:white_check_mark:Succeeded
View

TerminalDocs/customize-settings/interaction.md
:white_check_mark:Succeeded
View

TerminalDocs/customize-settings/profile-appearance.md
:white_check_mark:Succeeded
View

TerminalDocs/dynamic-profiles.md
:white_check_mark:Succeeded
View

TerminalDocs/get-started.md
:white_check_mark:Succeeded
View

TerminalDocs/index.md
:white_check_mark:Succeeded
View

TerminalDocs/troubleshooting.md
:white_check_mark:Succeeded
View

TerminalDocs/customize-settings/actions.md

Line 1107, Column 2: [Suggestion-column-header-missing] Column headers are required for tables. Add appropriate header text, or remove any extra table cells that cause an extra column.

TerminalDocs/customize-settings/profile-general.md

Line 70, Column 65: [Suggestion-docs-link-absolute] Absolute link 'https://docs.microsoft.com/windows/wsl/install-win10' will be broken in isolated environments. Replace with a relative link.

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel

This actually breaks the tutorial interestingly enough.
microsoft/terminal#9237 (comment)
Not specifying the version number fixed it for me.
Using the given version, it gives ModuleNotFound errors for Set-PoshTheme

Yes - we're working on are-write of this article as so much has changed since the original. Hoping to have it completed soon, but want to make sure it's correct, in the meantime, Kayla goes over how to set things up in this episode of the HelloWorld show: https://channel9.msdn.com/Shows/Hello-World/Hello-World-April-7-2021


Rework the landing page

The current landing page works pretty well, but it is not very clean. I'm no web designer but I would really like a landing page that uses an animated 3D model of a paperplane in the background.
The demo part should be kept, maybe done in a different way, I can help with that. The contributor list should also be kept, overall the only thing that should be changed is the design and layout.
Please don't submit random templates from the internet, also please no bootstrap / material design try to avoid css frameworks if you can.
You can see the current landing page at https://survol.me

I can do this if you want to assign me.

Good luck :+1:

Also if you could add a little testimonial / review section so we can add quotes from people / articles if the extension ever gets some. For example we could add this one from Ryan Hoover, Founder of ProductHunt

Is it ok to leverage to Bulma CSS framework you were already using in here or is the intent to remove that?

bulma is fine

hi, can i work on this, although i'll use bootstrap but i'll make it better.

I'm still working on this. Should have something pushed out this evening or tomorrow

@mdolr Alright I have a PR up finally. It's not all that novel, but it does make it a bit nicer https://github.com/mdolr/survol/pull/147
I didn't get to the testimonials, but there is a spot for them under the download buttons.

Here are some screenshots


cannot convert 'SPIClass' to 'SPI_TypeDef*' for argument '1' to 'FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef*, uint16_t)'

Veryfing code using this library in Particle Build fails with this error:
tlc_driver/tlc_driver.cpp:67:53: error: cannot convert 'SPIClass' to 'SPI_TypeDef*' for argument '1' to 'FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef*, uint16_t)'
  while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET)

I got this error trying to use the library with the Particle Photon

I got same error with Photon.

This error is happening because the library was written for spark core. Their microprocessors are different and the base firmware is different too, therefore is not possible to simply use the library. It has to be adapted.
This guy started doing some work but his library is still not quite working. https://community.particle.io/t/tlc5940-on-the-photon/21108

The problem is that Wiring defines SPI1 as an interface to the SPI peripheral (it controls SPI3 on the Photon). This clobbers the STM32 definition of SPI1 here.
What you should be able to do is simply copy that definition into your code like:
#define SP1_STM32 ((SPI_TypeDef *) SPI1_BASE)

So your all your calls get turned into (you need to find/replace SPI1 as appropriate):
while (SPI_I2S_GetFlagStatus(SP1_STM32, SPI_I2S_FLAG_TXE) == RESET)

I would submit a PR for this, but I don't have any chips to test. :)


fix: Solo12::is_ready() returned inverted value

Description
Solo12::is_ready() should return true if state == ready, not the other way round :)
How I Tested
Cannot really test right now, as the code where I'm using it currently still has other problems.
I fulfilled the following requirements

[x] All new code is formatted according to our style guide (for C++ run clang-format, for Python, run flake8 and fix all warnings).
[x] All new functions/classes are documented and existing documentation is updated according to changes.
[x] No commented code from testing/debugging is kept (unless there is a good reason to keep it).

@jviereck @MaximilienNaveau I'm not sure how much you two are still involved in this project.  Please let me know if there is someone else who's better suited for reviewing PRs here.


Issue 430

Addresses https://github.com/raphlinus/pulldown-cmark/issues/430.

I'm noticing that this had being around since February. Does it needs more work before it can be merged it ?

I think it's ready to go, just needs a review.
@raphlinus, do you have time for this?

I was about to try to hack around this downstream ... it would be really nice to see this merged.

I've compiled this PR and checked it against what I expected the ranges to be and it is now returning end bytes for Reference links similar to the way Inline links currently work. I can't speak for every possible scenario but at least that bit seems right here.

Cool, thanks for doing a testrun @alerque! Let us know if you find any other issues :-)


Issue #740 Prevent duplicate service configuration in builder

When creating the cache configuration, most service configuration are
expected to exist as a single instance. The builder now takes care of
achieving this. At the same time, service consuming these configuration
now properly check that no duplicates are found when this is not valid.
This pull requests takes care of the CacheConfigurationBuilder level, CacheManagerBuilder level to come later.

Added the CacheManagerBuilder handling of duplicate ServiceCreationConfiguration

test this please

test this please


branch-2.0 Fix potential bug when cancel query

Proposed changes
Issue Number: close #xxx

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall


Add libncurses-dev to slim buildDeps so that the curses module works

Fixes #51

OMG and since @yosifkit merged https://github.com/docker-library/official-images/pull/794 first, this PR is actually going to run that test via Travis :heart_eyes:

:green_apple:

LGTM


Azcore rename and move contextdata

Fixes #3609
Renames ContextData to Context, moves it from com.azure.core.http to com.azure.core

Can one of the admins verify this patch?


Is this project still active?

Just wondering because this seems like a great plugin.

I don't think it is active anymore :(

Apologies for the late response. The plugin is not active anymore, but if you want to have voice calls within Mattermost, I'd suggest to take a look at the Calls plugin: https://github.com/mattermost/mattermost-plugin-calls

Oh, ok dont worry! Thank you for the info!


Universal Editor: decorate block method doesn't call after block content update

Context:
In the Universal Editor, we have a block where we rewrite the markup using JavaScript/Lit-html.
Issue:
When we update the content using the Universal Editor, the block markup is updated alongside the content. However, the loadBlock method in editor-support.ts does not function as expected. This issue occurs because the loadBlock method was modified to receive a section as a parameter instead of the block itself.
Possible optimizations/questions:

Adaptation of loadBlock: Should we modify the loadBlock method in editor-support.js to properly receive the section as a parameter, instead of the block?
why do we rewrote loadBlock to receive a section as parameter and not a block? in the doc based adobe boilerplate they also go with section as parameter but not in the xwalk boilerplate.

update after alignment with @ifahrentholz and @samuelecalamita :

aem.js should be handled as a 3rd party dependency. We can hook in or extend but we should not overwrite it.
This means we can split it in single task files but the functions must not be copied. Instead we would import the functions from the original aem.js of Adobe (mind there are two, one for doc-based and one for x-walk projects - see this dicord discussion)


Content seucrity policy (CSP) implemntation in the boilerplate

[x ] Feature (https://github.com/react-boilerplate/react-boilerplate/blob/master/.github/CONTRIBUTING.md#feature-requests)

Description
I am trying to implement a CSP security in the boilerplate after testing my boilerplate with https://observatory.mozilla.org/analyze.html
It appear the CSP is missing and I did try to add the following meta
<meta http-equiv="Content-Security-Policy" content="default-src https:">

It returns header with or without https :
main.js:1944 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src http:".

    at Object.23 (main.js:1944)
    at __webpack_require__ (main.js:687)
    at fn (main.js:110)
    at Object.58 (main.js:2210)
    at __webpack_require__ (main.js:687)
    at main.js:787
    at main.js:790

Did anyone succeeded implementing a csp security on the boilerplate ?
It is becoming a new standard of best security practice, could it be implemented by default in the boilerplate ?
Thanks again for the amazing job and selecting the best of the ecosystems for us!
Versions

React-Boilerplate (see package.json): 3.4
Node/NPM: 7.10
Browser: chrome

Try using this.
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self'; script-src 'self'; style-src 'unsafe-inline'">

I load style sheet inline (<style> tag) using style-loader and css-loader hence I used 'unsafe-inline' for the style-src. If you want to restrict your web app in using one, you have to load it with the usual <link href stylesheet> tag.
You have to understand how CSP works in order for it to work in your use case. The docs is a good place for this default-src style-src.

You have to use the script-src 'self' of the CSP tag only in production because react-boilerplate's hot module replacement uses eval function (you may also just need to use 'unsafe-eval')

If you don't really care and you just want things to work out. Use this
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' 'unsafe-eval' 'self'; font-src https://* " />

You have to understand how CSP works in order for it to work in your use case.

Thanks for your answer, to be honest, I am just starting to get interested in CSP. My app is used in dev under http and we deploy it under https.
Is there a way to differenciate the CSP depending of the environment ?
Also I have tried theses meta headers:
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' 'unsafe-eval' 'self'; font-src https://* " />

<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' 'unsafe-eval' 'self'; style-src 'unsafe-inline'" />

The style-src seems to be ignored for both
   Refused to load the stylesheet 'https://fonts.googleapis.com/css?family=Open+Sans:400,700' because it violates the following Content Security Policy directive: "style-src 'unsafe-inline'".

   bootstrap-styled.js:5498 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

I am reading deeper on CSP but working implementation and example from existing source are welcomed.
More generally, what is the reactboilerplate community opinion regarding CSP?

In your App container you can use react-helmet and the process.env.NODE_ENV global variable. Try this code
console.log(process.env.NODE_ENV)

It should output 'development' or 'production' depending on your environment.
This is made possible by line 78 - 82 of /internals/webpack/webpack.base.babel.js which uses DefinePlugin.

Closing due to inactivity


Js/backports

This is a backport of https://github.com/microsoft/AdaptiveCards/pull/4693 into release/20.08
Related Issue

Fixes https://github.com/microsoft/AdaptiveCards/issues/4620
Fixes https://github.com/microsoft/AdaptiveCards/issues/4595
Fixes https://github.com/microsoft/AdaptiveCards/issues/4692
Fixes https://github.com/microsoft/AdaptiveCards/issues/4694

Description

toJSON now serializes to the version specified at the card level unless an explicit SerializationContext is specified
The $when property isn't emitted anymore in an expanded template
The selectAction property is now tied to schema version  1.1 and later (instead of 1.0)
selectAction.title is now used as a tooltip

How Verified
Verified manually in adaptivecards-designer-app
Microsoft Reviewers: Open in CodeFlow

@dclaux is the last (tooltip feature) issue #4694 supposed to be backported to 20.08? I see it noted as being in the 20.09 milestone?

@shalinijoshi19 given there are no schema changes - it's just a behavioral update - as discussed last week we're including the change in JS immediately.

I see thanks -- sorry still catching up from last week's going's on. Do we need to update any corresponding docs here at all? Eg RendererStatus ?


pythonPackages.dpath: init at 1.4.2

Motivation for this change
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[x] Fits CONTRIBUTING.md.

@GrahamcOfBorg build python2Packages.dpath python3Packages.dpath

Success on aarch64-linux (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)
reading manifest file 'dpath.egg-info/SOURCES.txt'
writing manifest file 'dpath.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/wzs0n6k7r0v8qwjrz431wkmx2sp2h4h0-python2.7-dpath-1.4.2
/nix/store/fsc5hdfcinp2q43syqz598g9jzkm3mw9-python3.6-dpath-1.4.2

Success on x86_64-linux (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)
reading manifest file 'dpath.egg-info/SOURCES.txt'
writing manifest file 'dpath.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/18s44ffama1v5qdxawnfvp7g2h0gfd31-python2.7-dpath-1.4.2
/nix/store/3h97v71p7ig38jfdwyabkn80kadmgxnd-python3.6-dpath-1.4.2

It looks like upstream also has some tests, which you can run with nosetests.

@bhipple fixed up, ptal.

@GrahamcOfBorg build python2Packages.dpath python3Packages.dpath

Success on aarch64-linux (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)

OK
running install tests
.................................................
----------------------------------------------------------------------
Ran 49 tests in 0.078s

OK
/nix/store/0sbvvfq5mf217y7m4qmgxjmypq5cc4p9-python2.7-dpath-1.4.2
/nix/store/n374mzc6vcn50r9dfvrrpw4nqx50qlvk-python3.6-dpath-1.4.2

Success on x86_64-linux (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)
patching script interpreter paths in /nix/store/5glxv269v9klqs44ncs80vr5wdgjp649-python3.6-dpath-1.4.2
checking for references to /build in /nix/store/5glxv269v9klqs44ncs80vr5wdgjp649-python3.6-dpath-1.4.2...
running install tests
.................................................
----------------------------------------------------------------------
Ran 49 tests in 0.148s

OK
/nix/store/iqkjix2psipqyk451f9bczgs5lx3cby8-python2.7-dpath-1.4.2
/nix/store/5glxv269v9klqs44ncs80vr5wdgjp649-python3.6-dpath-1.4.2

ping @bhipple

and @FRidh

Let's have a last ofborg build, since there was a push since the last builds, as a formality. From here, everything looks good IMHO.
@GrahamcOfBorg build python2Packages.dpath python3Packages.dpath

Success on x86_64-darwin (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)
Ran 49 tests in 0.051s

OK
.................................................
----------------------------------------------------------------------
Ran 49 tests in 0.048s

OK
/nix/store/7byzrz8wvb4mxq9av1xmzvh3hr9jv4n2-python2.7-dpath-1.4.2
/nix/store/k0znjw27b01jf94n34jdd5zmr9pb8ri4-python3.6-dpath-1.4.2

Success on x86_64-linux (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)
patching script interpreter paths in /nix/store/943y73p1yx3q0h5y6gcd6hax1n3y1xc3-python3.6-dpath-1.4.2
checking for references to /build in /nix/store/943y73p1yx3q0h5y6gcd6hax1n3y1xc3-python3.6-dpath-1.4.2...
running install tests
.................................................
----------------------------------------------------------------------
Ran 49 tests in 0.113s

OK
/nix/store/vinaxmlq3zz6qzp4l67filx31ikmnd38-python2.7-dpath-1.4.2
/nix/store/943y73p1yx3q0h5y6gcd6hax1n3y1xc3-python3.6-dpath-1.4.2

Success on aarch64-linux (full log)
Attempted: python2Packages.dpath, python3Packages.dpath
Partial log (click to expand)
patching script interpreter paths in /nix/store/9xc5i5jkrj1cx0bd84n9272l3il6p03k-python2.7-dpath-1.4.2
checking for references to /build in /nix/store/9xc5i5jkrj1cx0bd84n9272l3il6p03k-python2.7-dpath-1.4.2...
running install tests
.................................................
----------------------------------------------------------------------
Ran 49 tests in 0.068s

OK
/nix/store/9xc5i5jkrj1cx0bd84n9272l3il6p03k-python2.7-dpath-1.4.2
/nix/store/ycai7ijijaksj1pyc5952y88sqcpjcik-python3.6-dpath-1.4.2

:+1:


Modify CC3100 Driver to not require busy loop to be in python

At the moment when you connect to an access point you have to code a busy loop as below:
while (not nic.is_connected()):
    nic.update()
    pyb.delay(100)

This is not idea for the developer, and has no timeout in this form.
Restructure the connect() method to include the loop, and to take a timeout value.

Done.


more typing in linearizer uoping utils

there was a bug in render_block because of accs not being typed.
This diff also showed a lot of places in the code where idx are wrongly/incompletely typed. These should all be just a List[UOp]

merging pre multireduce


Memory leak in Python numpy returns

Calling a C++ function that returns a Numpy array:

get_jitter_images
get_face_chips
get_face_chip
repeatedly, causes memory leak

Expected Behavior
Calling these function in a for loop should free memory and not cause more and more memory to be used. I tested only get_face_chip, but I think the problem will exist with other methods as well.
Current Behavior
System memory is constantly reduced as more and more files are processed with get_face_chip
Steps to Reproduce
import time

import cv2
import dlib

__DETECTOR = dlib.get_frontal_face_detector()
__PREDICTOR =  dlib.shape_predictor("ktrain/image/shape_predictor_5_face_landmarks.dat")

def load_hundred():
    images = []
    for _ in range(100):
        img = cv2.imread("face2.jpg")
        rgb_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
        dets = __DETECTOR(rgb_img)
        shape = __PREDICTOR(rgb_img, dets[0])
        face_chip = dlib.get_face_chip(rgb_img, shape)
        images.append(face_chip)
    return images

def main():
    while True:
        images = load_hundred()
        time.sleep(0.25)

if __name__ == "__main__":
    main()

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          32065        1994       14741         112       15328       28438
Swap:         32667           0       32667
$ free -m
              total        used        free      shared  buff/cache   available
Mem:          32065        1995       14740         112       15328       28437
Swap:         32667           0       32667
$ free -m
              total        used        free      shared  buff/cache   available
Mem:          32065        1998       14738         112       15328       28435
Swap:         32667           0       32667
$ free -m
              total        used        free      shared  buff/cache   available
Mem:          32065        2070       14688          88       15305       28385
Swap:         32667           0       32667
$ free -m
              total        used        free      shared  buff/cache   available
Mem:          32065        2109       14649          88       15305       28347
Swap:         32667           0       32667
$ free -m
              total        used        free      shared  buff/cache   available
Mem:          32065        2138       14615          93       15311       28312
Swap:         32667           0       32667

Please also see:
https://github.com/pybind/pybind11/issues/27

Version: 19.10
Where did you get dlib: Github
Platform: Ubuntu
Compiler: gcc

Thanks for reporting the bug.  Can you submit a PR that fixes it?

I think we can move away from Numpy headers altogether with pybind11. I am not that familiar with pybind, however, I found this post on Stack Overflow:
https://stackoverflow.com/questions/44659924/returning-numpy-arrays-via-pybind11
Perhpas @supervacuus can help?

I will have a look into this... thanks for the work you already put into this.