Name doesn't appear in the alert from hello world exercise

Describe the bug
I'm going through the tutorial and just came to the end of the "hello world" page. At the bottom there is an "exercises" section that asks you to modify the greet function to take a name. When running the code exactly as shown, the browser alert does not include the name passed to the function. It simply displays Hello, !. I made sure that my code is identical to what is shown in the answer section, re-ran wasm-pack build from the root of the project, and even restarted the webpack development server just to be sure. Same result.
To Reproduce
Steps to reproduce the behavior:

Follow the hello world tutorial exactly.

Expected behavior
The alert should say Hello, Your Name!.
Additional context
Software used:
rustc 1.35.0-nightly (3750348da 2019-04-08)
wasm-bindgen 0.2.41
npm 6.9.0
Firefox 66.0.2

Hi Friend,
I ran into the same problem. It looks like there might be an issue with the latest version of wasm-bindgen.
In the meantime I removed the Cargo.lock file, then downgraded and forced the the version in Cargo.toml from wasm-bindgen = "0.2" to wasm-bindgen = "=0.2.40".
Hope this helps!

I wonder if it would make sense to add some regression testing to the book's examples. Having a hello world example at the very beginning of a tutorial fail is not a good first impression for users. I realize this whole thing is super new so we shouldn't expect things to be nice and polished at this point, though. Just thinking out loud.

I suspect that this is https://github.com/rustwasm/wasm-bindgen/issues/1436 if 0.2.40 works and 0.2.41 doesn't. That just means it's basically a 17-hour-old regression (and this issue is 13 hours old!) so we should have this fixed soon :)

Closing now that the fix had landed and I'll publish a new version soon.


Empty cart destroys stored database session?

When I empty the cart after restoring a cart it deletes it from the database... Is this normal?
I need to be able to restore carts after a client has paid. I store them using invoice_id as identifier. But Ideally I want a record of how the cart looked when they paid. Can I restore carts and then empty the cart without destroying the database stored version?

Sorry about that. I didn't realise that the moment you restore the cart it gets destroyed from the database.
I am not sure of the implications, but I have managed to stop it doing it.
I found that if I comment out this line
       $this->getConnection()->table($this->getTableName())
            ->where('identifier', $identifier)->delete();

from vendor\gloudemans\shoppingcart\src\Cart.php
It keeps my stored session which is perfect for my needs right now.
Thanks for this great package!

@warmwhisky Yeah that's not really what the 'store/restore' functionality is written for.
If you want to log/store the state of the cart when an order is made, I would suggest write your own logic for it (combination of Order & OrderLine, models/tables or something)


Land Cover CCI display wrongly positioned

Expected behavior
LC data should be correctly positioned at lat/lon coordinates.
Actual behavior
Display is shifted by some ten degrees and also wrongly scaled:

Specifications
Cate 0.9.0.dev6

Moved to MS IRM7. Code that addresses this issue can be found in https://github.com/CCI-Tools/ncpyramid/blob/master/ncpyramid/pyramid.py


fix(16308): Allows Edge frontend to initiate backend requests when offline

See https://hivemq.kanbanize.com/ctrl_board/57/cards/16308/details/
This PR fixes the problem of API requests not being fired when their is no connectivity.
The main problem was with the configuration of ReactQuery, see documentation (https://tanstack.com/query/v4/docs/react/guides/network-mode). By default, the Network Mode is set to online, in which Queries and Mutations will not fire unless you have network connection, setting the query into a paused state.
The PR switches the Network Mode to always, in which Queries and Mutations are always sent and ReactQuery basically ignore online/offline status.
The PR also introduces a timeout limit to all Axios requests (by default set to 0, implying a permanent loading).

I think we should expose this configuration somewhere within our own constant file so users don't have to search for it.

Done for the current bug but we will need to design a strategy for the config, to devide

what goes to a central configuration file
where is that configuration done


README.md:127: nothing to be placed here; there is no...

The puzzle 2-dea9fd1f from #2 has to be resolved:
https://github.com/dartoos-dev/eo_color/blob/dee9a9ae3053880dd366a4a699fadb4b5fe012ce/README.md#L127-L127
The puzzle was created by @rafamizes on 13-May-21.
role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

The puzzle 2-dea9fd1f has disappeared from the source code, that's why I closed this issue.


make topnav non user selectable for double clicks on buttons

in reference to #430

@btk Closing this, as it's not really an issue.


v4 plural

fix https://github.com/Azure/autorest.java/issues/607

Currently using jibx-tools. License BSD. It also supports plural -> singular (Fluent likely need this). Downside the lib is large.
evo-inflector. License Apache 2.0. It does not support plural -> singular. For pluralize it has (almost) same effect as here.
@jianghaolu @srnagar Let me know your opinion.


with-dotenv example when changing .env changes doesn't get applied

Example name
with-dotenv
Describe the bug
i have followed this with-dotenv example and it works as expected  fist time then i did a change on the .env file but it seems the first values of .env is still loaded
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:

define some variable inside .env lets say we want to change  REACT_APP_EMAIL =<EMAIL_ADDRESS>to REACT_APP_EMAIL =<EMAIL_ADDRESS>yarn build
i start my application using pm2 start ecosystem.config.js
is still see my old values<EMAIL_ADDRESS>for variables when running the app

Expected behavior
to see the new values of variable which is<EMAIL_ADDRESS>

Try rm -rf node_modules/.cache

is pm2 restarting the process entirely when you make changes to your .env file? dotenv will not overwrite existing values in process.env so it needs a fresh process for you to see your changes

i don't think this is the solution to go but at least it is a work around

That's why I added the labels instead of closing immediately 😄

Related Issue: https://github.com/brysgo/babel-plugin-inline-dotenv/issues/13


T126316008

Description
Describe your changes in detail.
Motivation and Context
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax close #15213 if this solves the issue #15213

[ ] I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes
What types of changes does your code introduce? Remove all that do not apply:

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds core functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Documentation (update in the documentation)
[ ] Example (update in the folder of examples)

Checklist
Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

[ ] I have read the CONTRIBUTION guide (required)
[ ] My change requires a change to the documentation.
[ ] I have updated the tests accordingly (required for a bug fix or a new feature).
[ ] I have updated the documentation accordingly.

Thanks for picking this up @benoitdescamps
I'm looking into the failing test.
There is a bunch of stuff that needs to be fixed for this PR to be mergeable, I'm taking care of it. Bear with me, I'll do a PR on your branch as soon as I'm done with it!

We have device issues in the tests, do you think you can handle it @benoitdescamps ?

We have device issues in the tests, do you think you can handle it @benoitdescamps ?

yes, I will have a go at it


Enable cluster-wide operation

Is your feature request related to a problem? Please describe.
If I have grafana labs deployments in multiple namespaces I also need to deploy the rollout-operator multiple times. This is inefficient and unlike any other k8s operators that are generally employed.
Describe the solution you'd like
Having the rollout operator optionally be capable of working across all namespaces.
Describe alternatives you've considered
Deploying the operator into every namespace, this is inefficient and introduces complexity.

I'm not sure we will ever do this. Binding 1 rollout-operator to 1 namespace was a specific design decision to keep it simpler and isolated from other instances.

This is inefficient

Why do you consider it inefficient? The rollout-operator is very lightweight.


Validate routine type signatures

That is,

Assert all args are annotated exactly once for Pythonic signatures
Assert all args are not annotated and that the annotated arrow type is consistent with the number of args for Haskell-like signatures

In that case, don't worry about Main.hs for now. We'll do another PR where
we just clean up the entire repo and make formatting consistent everywhere.
On Wed, Oct 6, 2021 at 4:50 PM Hans Montero @.***>
wrote:

@.**** commented on this pull request.
In app/Main.hs
https://github.com/ssm-lang/sslang/pull/8#discussion_r723665632:

@@ -103,6 +104,9 @@ main = do
Left s -> do hPutStrLn stderr $ "Error: " ++ s
exitFailure

when (not $ checkRoutineSignatures ast) $ (do hPutStrLn stderr "Error: type signature mismatch"

I just ran Brittany through Main.hs and it made a bunch of changes..
guess a lot of the file wasn't formatted already. Unfortunate that's going
to destroy the blame. Let me know if you think I should drop the
commit/perform the formatting for my code manually.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
https://github.com/ssm-lang/sslang/pull/8#discussion_r723665632, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AC2A5DH4NOHPBTAZYSMSGDTUFSZAPANCNFSM5FNLFQKA
.


HTTP/2 SimplePromiseAggregator tryFailure not consistent with setFailure

Motivation:
The SimplePromiseAggregator.setFailure allows a failure to occur before newPromise is called, but tryFailure doesn't. These methods should be consistent.
Modifications:

tryFailure should use the same logic as setFailure

Result:
Consistent failure routines.

@nmittler - FYI

LGTM

Cherry-picked 4.1 (0736a3b) master (634f63e)


require unique emails for user registration

https://github.com/modilabs/formhub/commit/17f07de21c3930f063010ef7f008af801bff5829


Resources

scmap code  and paper and the related scfind code
SingleR code and paper
CellAtlasSearch paper no code available

Here is a good resource for downloading bulk RNA-Seq data Recount2.

GiniClust2: a cluster-aware, weighted ensemble clustering method for cell-type detection
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-018-1431-3

Identification of cell types from single-cell transcriptomes using a novel clustering method (SNN) https://academic.oup.com/bioinformatics/article/31/12/1974/214505


Add shardSpecOverride to IntegrationSpec

Related ticket: https://issues.redhat.com/browse/APPSRE-6100

@geoberle PTAL


Steam integration module issue

Steam integration doesn't stay connected after GOG Galaxy 2.0 is closed and require steam credentials everytime the client is launched
GOG Galaxy 2.0.13 beta

And even more. I could use sync button to force it to work again. But today it shows Steam as offline. And "try gain" button doesn't work
2.0.14 beta

Hello. We're not responsible for steam plugin. Please report on community github: https://github.com/FriendsOfGalaxy/galaxy-integration-steam


Upload data to Salesforce wave analytics.

Hello, I', trying to find a way to upload data to wave analytics with nodejs.
Right now I have csv files with the information that I need upload, but could not find any way to do it.
Is this library able to upload data to wave analytics? or someone can point me to the right direction.
Thank you.

I also would really appreciate any insight into doing this, thanks!

I find a solution here and I'm implementing it, but the person that posted the example tell you that you have to convert the file into base64 encode format.
I did a test to upload small amount of data, so I do not have to split the file and parse it to base64:
MetadataJson: Buffer.from(JSON.stringify(csv)).toString('base64')
But I'm getting the following error:
 [{"message":"Json Deserialization failed on token 'null' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row","errorCode":"INVALID_FIELD"}]
I found that could be caused by the convertion to base64, so I'm guessing the way I'm doing it is not the correct.
Anyone has some experience uploading data to wave analytics?
And other question, if the file is too big a good practice is split the file in chunks, so how is the best approach to create chunks of 10mb each?


Express mapping in an external JSON to reuse as standard reference

Hi, I am looking for a PHP implementation, so we perhaps use tableshema-py as reference algorithm for tableschema-php issue 35... The core seems the mapping  and  can be expressed as JSON to reuse into other contexts.
        mapping = {
            'any': sa.Text,
            'array': None,
            'boolean': sa.Boolean,
            'date': sa.Date,
            'datetime': sa.DateTime,
            'duration': None,
            'geojson': None,
            'geopoint': None,
            'integer': sa.Integer,
            'number': sa.Float,
            'object': None,
            'string': sa.Text,
            'time': sa.Time,
            'year': sa.Integer,
            'yearmonth': None,
        }

The suggestion: express in a external file, or generate code from a CSV with all datatype map descriptions... As "RosettaStone-tabular-datatypes" ;-)

PS: for more general translation of primitive data types, a  CSV at Data Packaged Core Datasets with all datatypes, perhaps we can reuse from a

Canonic
Description
JSON
SQL-92
Python
Java
...

JSON
UTF8 string
string
text
str
String
...

SQL-92
integer 4 bytes
number
int4
...
....
....

....
....
...
....
....
....
...

@ppKrauss
Thanks for the idea. But this mapping is tightly tied to sqlalchemy Python library. It also use some Postgres special case types later in the code etc. So it's not even a static mapping. I think there are almost no chances to re-use it across different platform. Also it's very small and changing very rarely.
So my recommendation is just to translate it as a starting point to a PHP database library. It will be much more flexible for both sides.


MWPW-131134 - Marquee: media-credit container text disappears if italicized

Allow text formatting of the media credit section

Resolves: MWPW-113134
Test URLs:

Before: https://main--cc--adobecom.hlx.page/drafts/00lightning/bugs/substance-magazine-article-marquee-image-credit-disappears-italics?martech=off
After: https://main--cc--adobecom.hlx.page/drafts/00lightning/bugs/substance-magazine-article-marquee-image-credit-disappears-italics?milolibs=mwpw-113134--milo--wbstry&martech=off

I'm not entirely sure that this the optimal solution, advise is much appreciated, this work around prevents the primary image from being stolen into the media credit container.
From my understanding, the test file doesn't need to be updated, as it still contains the same element no matter the outcome. Please advise me if otherwise!

@williambsm : what's the current status of this PR? Chris requested changes to tests that are currently failing. Also, there are merge conflicts that need to be addressed. Thx

@williambsm How are we looking here? Is this ready to be merged?

@williambsm How are we looking here? Is this ready to be merged?

Yup! All is ready.

This was not ready for merge. Failed check failures, including consistent UT failure: https://github.com/adobecom/milo/pull/843/checks
@williambsm Can we revert this if can't fix within hour?

Mitigated with https://github.com/adobecom/milo/pull/1006


Share product

As a [role]
I need [function]
So that [benefit]
Details and Assumptions

[document what you know]

Acceptance Criteria
Given [some context]
When [action taken]
Then [outcome observed]

Verify if the shared link is the same for customers and engineers


Cannot specify options for pynio engine through backend_kwargs of open_dataset/open_dataarray

Code Sample
frost_run = xr.open_dataarray("nam.grib2", engine="pynio", backend_kwargs={"SingleElementDimensions": "Initial_time"})
# or
import Nio
nio_options = Nio.options()
nio_options.SingleElementDimensions = "Initial_time"
frost_run = xr.open_dataarray("nam.grib2", engine="pynio", backend_kwargs={"options": nio_options})

Problem description
The problem is that there is not a way through xarray to set the PyNio specific options, and I have confirmed by taking a look at the initializer signature of NioDataStore
def __init__(self, filename, mode='r', autoclose=False):

Which does not provide a way to specify that value of the options parameter of the Nio.open_file method it uses
The only workaround is modify the global defaults for Nio prior to opening, i.e.,
import Nio
Nio.option_defaults["SingleElementDimensions"] = "Initial_time"
# open datasets now

Expected Output
Either way from the sample results in TypeError: __init__() got an unexpected keyword argument
Output of xr.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Darwin
OS-release: 17.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
xarray: 0.10.8
pandas: 0.23.4
numpy: 1.15.0
scipy: 1.1.0
netCDF4: 1.4.1
h5netcdf: 0.6.2
h5py: 2.8.0
Nio: 1.5.2
zarr: None
bottleneck: 1.2.1
cyordereddict: None
dask: 0.18.2
distributed: 1.22.1
matplotlib: 2.2.3
cartopy: 0.16.0
seaborn: 0.9.0
setuptools: 40.0.0
pip: 18.0
conda: 4.5.11
pytest: 3.7.2
IPython: 6.5.0
sphinx: 1.7.5

I have the same issue but with the "format" parameter in Nio open_file. I don't know of a workaround for it.

I have found a workaround, I think, in the last item of this issue.
You have to set it before running it in xarray.
https://github.com/NCAR/pynio/issues/19

Thanks for the reply, but unfortunately I don't think the format can be set via options. It is a separate parameter entirely:
def open_file(filename, mode = 'r', options=None, history='', format=''):
...
    file = _nio.open_file(filename,mode,options,history,format)

This would be pretty easy to fix if anyone wants to put together a pull request. I think you could just add **kwargs on this line:
https://github.com/pydata/xarray/blob/master/xarray/backends/pynio_.py#L48


Minor change to EuclideanDistanceSimilarity.java file

This is just a minor change to the file . The end product is same for both the cases.

Is there related project JIRA for this?

This doesn't seem correct, there is a correction that needs to be done in the code comments which is to be addressed by MAHOUT-1602. Will close this PR along with that Jira.


31个样本SV如何合并到一个vcf文件

尊敬的周老师@YaoZhou89
请问在如下步骤中，多个个体以什么方式合并到一个vcf中，多个样本合并还是融合到一个样本？

这里的cleanSV行使了什么功能？
另外，在如下步骤中，如果我的流程中不涉及使用多个SV calling软件，只用了一个软件，我可以不使用这个步骤来对SV去重吗？

敬上
强森

Our SVs are defined as having a length greater than 50. To ensure data quality, we utilize cleanSV to remove any variants with lengths less than 50.
This method relies on identifying duplicated SVs within the dataset. Feel free to give it a try and see if it works for your data.

Thank you so much!
Which process did you do from graph31.vcf.gz* to graph31.vcf.gz, if graph31.vcf.gz* indicates vcf file of 31 samples, graph31.vcf.gz indicates vcf file of merging them.

Thank you so much!
Which process did you do from graph31.vcf.gz* to graph31.vcf.gz, if graph31.vcf.gz* indicates vcf file of 31 samples, graph31.vcf.gz indicates vcf file of merging them.


Copy requests TARGETing the default root ('/') directory fail.  "no such directory"

Situations relying on the stated "default root directory" expectation fail when they should succeed.
For example, the following command should copy the 'hostname' file to the targeted container's root ('/') directory:
dkrcp    /etc/hostname       container_UUID:

However, it fails with the message: "no such directory".
Since dkrcp ultimately relies on docker cp this defect will be addressed once docker cp has resolved Docker issue#20926
Until resolved, specify '/' to circumvent this problem:
dkrcp    /etc/hostname       container_UUID:/

Encoded workaround within dkrcp to address this issue.


Adjust to the new behauvior of the policy-controller

Signed-off-by: hectorj2f<EMAIL_ADDRESS>
Summary

Added minor changes to adapt to the latest changes in the policy-controller.
Release Note

Documentation

cc @vaikas


Getting [dumb-init] /usr/bin/docker-volume-local-persist: No such file or directory

I try running plugins inside container and the container exited immidiately. Docker logs only give this single line of message:
[dumb-init] /usr/bin/docker-volume-local-persist: No such file or directory
$ docker images
REPOSITORY                                   TAG                 IMAGE ID            CREATED             SIZE
cwspear/docker-local-persist-volume-plugin   latest              08d2b4cce1e9        15 hours ago        24.33 MB

$ docker ps -a
CONTAINER ID        IMAGE                                        COMMAND                  CREATED             STATUS                      PORTS               NAMES
07cf4fea5594        cwspear/docker-local-persist-volume-plugin   "dumb-init /usr/bin/d"   5 seconds ago       Exited (2) 5 seconds ago                        kickass_cori

$ docker logs kickass_cori
[dumb-init] /usr/bin/docker-volume-local-persist: No such file or directory

Yep, this is an issue with the base image (Alpine), and there isn't an easy work around. I'm trying to investigate some solutions (see https://github.com/docker/go-plugins-helpers/issues/50). Until then, use v1.1.0. They are functionally the same.

@CWSpear thanks. v1.1.0 working well.

v1.2.0 should work now; I did also do a bump to v1.2.1, even tho none of the source code has changed, just to help those that might be stuck on v1.2.0.


Fix #260 - SimpleType validation converts values

Haven't run all the tests (only util ones) so please, double-check.

Looks like new trafaret has broken API for MongId
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 422, in start
    resp = yield from self._request_handler(request)
  File "/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages/aiohttp/web.py", line 306, in _handle
    resp = yield from handler(request)
  File "/home/travis/build/aio-libs/aiohttp_admin/aiohttp_admin/backends/mongo.py", line 37, in list
    query = create_filter(filters, self._schema)
  File "/home/travis/build/aio-libs/aiohttp_admin/aiohttp_admin/backends/mongo_utils.py", line 105, in create_filter
    value = _check_value(column_traf_map, field_name, value)
  File "/home/travis/build/aio-libs/aiohttp_admin/aiohttp_admin/backends/mongo_utils.py", line 73, in _check_value
    value = apply_trafaret(trafaret, value)
  File "/home/travis/build/aio-libs/aiohttp_admin/aiohttp_admin/backends/mongo_utils.py", line 58, in apply_trafaret
    validate = trafaret.converter
AttributeError: 'MongoId' object has no attribute 'converter'

It is no longer have converter attribute

I've reverted trafaret version back to 0.10.4 and it looks like it has raw types and does not have mongoId issues

BTW, i've just had a look at mongo_utils.py and my gut tells me that smth might be wrong. I'm now sure why it was chosen to assign validate different values but it seems that MongoId had to be converted with trafaret.converter, but in case of [MongoId] trafaret.check_and_return willl be applied to each MongoId
def apply_trafaret(trafaret, value):
    validate = trafaret.check_and_return

    if isinstance(trafaret, MongoId):
        validate = trafaret.converter

    if isinstance(value, list):
        value = [validate(v) for v in value]
    else:
        value = validate(value)
    return value

Anyway, it looks like the lines for MongoId are not necessary anymore (and that will allow to update trafaret to 0.11.3).

Lets remove those lines tests are green.


Added the azure cost billing reports: Budget, Actual, Forecast

Added Azure cost billing reports
Upload the data to the elastic search index
Update the data in the G-Sheet

/LGTM


fixed typo ;)

@kstenschke
Sorry, but I can not found a signed CLA.

@kstenschke
Thanks for reporting!


Maf88/172 add how to contribute file

Fix #172.
Based on spinal cord toolbox file
(https://github.com/neuropoly/spinalcordtoolbox/blob/master/CONTRIBUTING.rst)

I left 2 TODO at line 179 and 323 and explained my concern.

Coverage decreased (-0.04%) to 81.44% when pulling 570ff5d7f2e01eb5c0c9a9667013967db0e20800 on maf88/172-add-how-to-contribute-file into 6ebe87ceba001e7af84aeec033cd2606babeb8fb on master.


Click Event

I want to pass on onClickListener event to parent container.
Just now, when text/table-cell is there, the click event is handled there only, while click on blank area is calling event on parent container.
I do not want selection option in textview.
How to do that?

I guess the simplest option would be to make text selection optional... Either via some setting or by supporting  user-select.

v1.0.4 has Android support for user-select: none


no gnn_train.py in generation folder

Thank you for your interesting work.
For generation task,
In Readme,
mkdir -p ckpt/tmp
python gnn_train.py --train train_processed/ --vocab ../data/polymers/inter_vocab.txt --save_dir ckpt/tmp
but there is no 'gnn_train.py' in generation folder.
Could you check this? thank you in advance!

It should be vae_train.py. That was a typo when the README was edited. It has been corrected now. Thank you!


FIxes #53 fix to render also pure function components

Thanks for the PR, it looks shippable to me. Before I give you merge perms, can you please update the HISTORY.md via this process:
I use https://github.com/defunctzombie/changelog to update it. Just do changelog --increment and add in your changes to it. Do not do changelog --release, just leave the UNREALEASED message for now. Can do changelog --release after merging in.
Also need your npm username

npm name same as github  :)

You're good to merge and publish - update under minor version please

Don't forget to changelog --release <version>, push, and npm publish after

yes, thanks for the reminder


Working with the Workforce 3620

I tested it with the Workforce 3620 the most values are displayed.

Thanks for the good work.

If you want we can also try to fill the missing data points.
For this we would have to check what is different in your http://<Printer-IP>/PRESENTATION/ADVANCED/INFO_PRTINFO/TOP.

I had now some time to test.
Here are the screenshoot of the Firmware

With the Edge Browser i get the following information:
IE_Data.txt
Firmware-Version :**CC23K3 24.08**Stammzertifikat-Version :02.02Seriennummer :SEGY164325Wi-Fi/Netzwerk-MAC-Adresse :AC:18:26::::

Then i would need the output of http://<Printer-IP>/PRESENTATION/ADVANCED/INFO_NWINFO/TOP again for the printer name.

I get this Output for the printername

Druckername :

WF3620

can you install the git version and test it?

The Printername now visible but the Firmware Version still empty.

It is also possible to include the waste Ink status?

I have changed something again in the detection of the firmware, can you still mla test the Git version?
Status of waste ink is not present in the ET series.

Ok now it look's fine for me..

thank your for the improvement...


Found broken /3d-viewport/construction-plane.en link. Please fix!

This appears after searching for "construc".

Fix.


Add Skibidi toilet by iam

Song Name
Skibidi toilet
Artist Name
iam
Source
Youtube
Youtube Link
81LV4embJio
Direct File Link
No response
Song ID
13
Start Offset [ms]
0
Extra
Created from Auto Nong.
Created for level: 9223838

s

reject


Detailed Suspiciousness output

Introduces a new class Suspiciousness which contains all the useful information regarding the suspiciousness of a line of code.
Tests and other classes refactored accordingly.
Closes #54

Hi @andre15silva
It seems perfect for me.
Merged!


ValueError: Unsupported dtype <U1

Description
When i try to create cupy array with randomly chosen strings, i get the following error:
/usr/local/lib/python3.7/dist-packages/cupy/random/_sample.py in choice(a, size, replace, p)
188     """
189     rs = _generator.get_random_state()
--> 190     return rs.choice(a, size, replace, p)
191
192
/usr/local/lib/python3.7/dist-packages/cupy/random/_generator.py in choice(self, a, size, replace, p)
1025                 raise ValueError('a must be greater than or equal to 0')
1026         else:
-> 1027             a = cupy.array(a, copy=False)
1028             if a.ndim != 1:
1029                 raise ValueError('a must be 1-dimensional or an integer')
/usr/local/lib/python3.7/dist-packages/cupy/_creation/from_data.py in array(obj, dtype, copy, order, subok, ndmin)
44
45     """
---> 46     return _core.array(obj, dtype, copy, order, subok, ndmin)
47
48
cupy/_core/core.pyx in cupy._core.core.array()
cupy/_core/core.pyx in cupy._core.core.array()
cupy/_core/core.pyx in cupy._core.core._array_default()
ValueError: Unsupported dtype <U1
To Reproduce
import cupy as cp
cp.random.choice(['1','2'],1)

Installation
No response
Environment
# Paste the output here

Additional Information
I found opened question on StackOverflow with similar issue, but there is no answer yet.
(https://stackoverflow.com/questions/73838033/valueerror-unsupported-dtype-u1-when-change-class-numpy-ndarray-to-class)

We're afraid that CuPy doesn't have a plan to have string ndarrays.

string dtypes are not yet supported and is currently under discussion. #7462


[KAVA] Add missing '/' in staking parameters query

The URL is missing / before 'staking'
 LCD + 'staking/parameters'

Closed with #537


UI should indicate that expense comments are private

Thanks to #3216, expense comments are now private. But the interface does not do a good job of communicating that to the user.
I was about to respond to a comment with some confidential payment info, and then I thought "Oh I better make sure that new private comments feature has been fully released... how can I know if this will be private?" And I realised I could not tell.
I'm not sure the best way to achieve this so I hope @Memo-Es and the designers can help.

Would be great if we could make the message below (displayed when users are not allowed to see the comments) prettier at the same time. Maybe we could have a similar box in two versions:
Authorized
:unlock: These comments are private, only the admins and the expense submitter can see them.
Not authorized
:lock: Comments for this expense are private. You must be signed in as an admin or the expense submitter to view them.

This is the design for the privacy pop ups for expense comments: https://www.figma.com/file/ZQBMWhnGGtRWeIZknFW1eP/OC.com-Production-Ready-✅?node-id=5265%3A0
@Betree


How to install and use

This now comes with the distribution of K on github, so I'm going to close this.


Add support matrix of features supported of Ceph CSI version

Signed-off-by: Poornima G<EMAIL_ADDRESS>

Thanks, @poornimag for the PR.
Fixes #298
@leseb PTAL

@poornimag can you update the table for v0.3.0 driver  also

CI is failng with "./README.md:1: MD033 Inline HTML". I think that's due to the "CSI driverVersion", this is the only way to list two lines in a single cell in markdown table. I can get rid of the  and will have a long column heading. Should i do that? or allow html in readme?

we have 2 options, disable the rule or
use  pure markdown instead  of HTML
@poornimag will this helps https://talk.commonmark.org/t/tables-in-pure-markdown/81/145

@poornimag ideally we should have these columns :
Branch/CSI driver Version, CSI Spec , variants like RBD and CephFS, Kubernetes version

Should wait for https://github.com/ceph/ceph-csi/pull/297

added DNM label to avoid accidental merging

can you send this PR to master branch?  from now onwards we will be using master for csiv1.0 development, Thanks

Also closes #268 right?

Also closes #268 right?

yes

@poornimag Can you please correct the tests?

@humblec  sent another pr..., https://github.com/ceph/ceph-csi/pull/315 for master


Sign error: send back errorType and errorMessage

@vgrichina is there anything blocking this one or do you want me to make any adjustments?


More reliable and faster isPrime()

Ordinary isPrime() has a bug that it can not identify pseudo primes such as  3,825,123,056,546,413,051 = 149491 * 747451 * 34233211.
To make the function more reliable and faster, I use Jim Sinclair' SPRP bases sets. The sets can distinguish at least 2^64 number.
ref. https://miller-rabin.appspot.com/

Coverage increased (+0.0007%) to 99.418% when pulling eea543a464dfeedd40a0aaf4877a0ff0775d8521 on oogFranz:reliable_isPrime into fece6dc8dd28605a3010b81edfaa63dbbedd2097 on peterolson:master.

Coverage increased (+0.0007%) to 99.418% when pulling eea543a464dfeedd40a0aaf4877a0ff0775d8521 on oogFranz:reliable_isPrime into fece6dc8dd28605a3010b81edfaa63dbbedd2097 on peterolson:master.

Looks good to me. Thanks!


Separate out underlying custom canonize primitive

The hmacIdCanonize primitive allows for a labelMap to be passed as an alternative to an hmac -- and it internally uses a custom canonize function. We should expose the custom canonize function and have it take an asynchronous label mapping function.
We could then build a simple helper canonize primitive that just takes a labelMap that is used instead of the hmacIdCanonize one -- and that can be reused with any labelMap.
We should also ensure that the approach passes the normalized dataset (or minimally the canonicalIdMap) to the label mapping function such that a function could be written that considers the total number of blank nodes. Such a function would be useful to SD schemes that want to make HMAC'd bnode labels map to a smaller namespace (rather than using the whole digest). An example would be:
// closure has an HMAC, can be auto-provided by or passed
// to another primitive function that does this common behavior
const hmac = createHmac();
let labelMap;

async function labelMapper({label, canonicalIdMap}) {
  // init labelMap if not initialized yet
  if(!labelMap) {
    // hmac all labels in `canonicalIdMap`
    const hmacs = await Promise.all([
      [...canonicalIdMap.values()].map(
        label => ({label, signature: await hmac.sign(label)}))
    ]);
    // sort based on signature...
    // deal with base64url encoding either before or after
    // sort considering tradeoffs of implementation ease
    // vs. efficiency
    hmacs.sort(comparator);
    // fill `labelMap` in order
    labelMap = new Map();
    hmacs.forEach(({label}, i) => labelMap.set(label, `b${i}`));
  }
  return labelMap.get(label);
}

See #9 for how to better slot the above example in.


feat: initial bookmarks implementation 2

Summary of PR
try to implement bookmarks (again) with new design
Mocks

iOS

 Android

Time spent on PR
2 hours: @AkalUstat
6 hours: @saihaj
Linked issues
Fix #22, fix #124
Reviewers
@Harjot1Singh
Todo

[x] fix TS errors
[x] style component fine tuning will be done later. #129 brings many styles with it so we can do once that is merged.
[x] Write maybe more tests for Bookmarks @Harjot1Singh help needed
~[ ] header~ once #129 is merged we can take pieces from there to help

@Harjot1Singh can you please take a look here. Little confused. Props are kinda passed down but not working as expected.

@Harjot1Singh can you please take a look here. Little confused. Props are kinda passed down but not working as expected.

@bhajneet


Fix undefined as a type

[x] Make sure all of the significant new logic is covered by tests
[x] Rebase your changes on master so that they can be merged easily
[x] Make sure all tests and linter rules pass
[ ] Update CHANGELOG.md with your change
[x] Add your name and email to the AUTHORS file (optional)

Thanks!


Sending execution to demonized flexget fails

Expected behaviour:
Execution to be sent to the demon to execute
Actual behaviour:
There is a FlexGet process already running for this config, sending execution there.
Could not start manager: Int or String expected
Steps to reproduce:

Step 1: flexget start -d
Step 2: flexget execute

Log:
flexget execute --debug
There is a FlexGet process already running for this config, sending execution there.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flexget/__init__.py", line 42, in main
    manager.start()
  File "/usr/local/lib/python2.7/dist-packages/flexget/manager.py", line 290, in start
    client = IPCClient(ipc_info['port'], ipc_info['password'])
  File "/usr/local/lib/python2.7/dist-packages/flexget/ipc.py", line 162, in __init__
    channel = rpyc.Channel(rpyc.SocketStream.connect('<IP_ADDRESS>', port))
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/stream.py", line 132, in connect
    return cls(cls._connect(host, port, **kwargs))
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/stream.py", line 99, in _connect
    socktype, proto)[0]
error: Int or String expected

Additional information:

Flexget Version: 2.3.26
Python Version: 2.7.3
Installation method: pip
OS and version: Ubuntu 12.04

issueing the command flexget demon stop produces the same error
i have to kill the pid to stop it
This was after updating from FlexGet-2.2.9

Awesome quick fix!
Thanks

How did you fix this eventually? I ran into the same problem.

https://github.com/Flexget/Flexget/commit/5ab10ad6ec7a24a97523724fa6ca1dfdbb67f7fe
Please excuse any typos as this was sent on the go.
On 11 Aug 2018, at 16:47, Arthur<EMAIL_ADDRESS>wrote:
How did you fix this eventually? I ran into the same problem.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Flexget/Flexget/issues/1405#issuecomment-412283386,
or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADRXQt8dPXlLEfjPoGSV572KUUzcVZLvks5uPvyRgaJpZM4J8rQ_
.


CLS calculation

Dear Leonardo,
first of all, we want to say “thank you” for your great perfume.js library. We have been using it for a while to read the Google Core Web Vitals in our shop and optimize our performance. Thanks a lot for that!
For a couple of days we compared the CLS values gained from perfume.js with the ones that we saw on the Google Search Console. Despite the fact that the quantity of users / measurements is different -  the results were quite different so we decided to take a look at the calculation of this metric. At https://web.dev/cls/#what-is-cls we’ve learned that the CLS should be the maximum session value of all sessions (in Chrome translated as “cluster”). We took a closer look at the perfume.js implementation and saw that we’re adding the CLS events (see https://github.com/Zizzamia/perfume.js/blob/95ee7744f32f532c2f4f08054ce31fc2bf77108f/src/cumulativeLayoutShift.ts#L12 ) instead of looking for a maximum. The logic at that point seems to differ a bit from the one purposed at https://web.dev/cls/#measure-cls-in-javascript .
We would like to know if you agree with us and plan to correct this in a future version?
Best regards and stay healthy,
Jan & Carlos

Ciao @carloscohen2202, thank you for the ping and sorry for the late reply.
Something I am been thinking for quite a while if it's time to make Perfume.js a superset of the Web Vitals package, by importing the package into Perfume and add some extra functionality on top of it.
This will help stay always align with Google updates, and also keep the extra features that Perfume wants to experiment and offers.
What's your thoughts on this?

Hi @Zizzamia, riding on this thread, I noticed that the clsFinal reported value differs to that of web-vitals's cls. I investigated both libraries and it seems that Perfume captures the later layour-shift event values (presumably because it was initialised later?). Any layout-shift values before that doesn't seem to be captured?
I think making Perfume.js a superset of Web Vitals package is a great idea as this would streamline the data collection mechanism.

Alright, now Perfume.js is a super set of Web Vitals, starting from v8.0.0. Which will help have better parity of data with the official Web Vitals.
Please, if you see anything that is not working let me know and I will take care of it.

Thanks a lot @Zizzamia


Issue with dererministic policies and payloads

I have an issue with Rasa deterministic policies and payloads. I am bulinding a simple (and stupid) deterministic bot that tries to guess your job based on few questions. Questions are answered only by buttons and checkboxes, so there is no natural language processing and I'm using  only the following policies:
policies:
  - name: FormPolicy
  - name: MemoizationPolicy
  - name: MappingPolicy

I have a question with a button, then one with a checkbox, and then one with a button again.
Everything works good until I come to the final button. Then, when it is selected, the conversation just stops, even though I see in the log that the right payload was uttered. I tried moving logic from actions.py to stories and to domain, tried using checkpoints, but nothing made the conversation continue.
One thing that worked was including KerasPolicy in the configuration file. Then, the conversation contiued, but after this, I faced all kinds of other issues. I will skip them for now as I belive fundamentally, there sould not be a need to include KerasPolicy in a deterministic bot and there should be another solution to changing payloads.
I think the problem is with the policies listed above, that's why I'm posting this here.
Can somebody help?
I have the following story:
## dialog beginning
* disclaimer
  - utter_disclaimer
  - utter_question_1
> check_question_1

## Developer
> check_question_1
* button_Java
  -utter_java_dev

## data scientist
> check_question_1
* button_R
  -utter_ds

## checkboxes
> check_question_1
* button_python
  - utter_question_2
  - question_2_form
  - form{"name": "question_2_form"}

 ## happy chatbot path
* button_yes
  - utter_happy_chatbot_dev

## sad chatbot path
* button_no
  - utter_sad_chatbot_dev

There is a FormAction assosiated with question_2_form with the following logic:
        if tracker.get_slot("tensorflow") == 1:
            dispatcher.utter_template("utter_ml_engineer", tracker)
        if tracker.get_slot("git") == 1:
            dispatcher.utter_template("utter_python_dev", tracker)
        if tracker.get_slot("rasa") == 1:
            dispatcher.utter_template(template="utter_question_happy", tracker=tracker)

where utter_question_happy looks like this:
  utter_question_happy:
    - text: >-
        Are you happy?
      buttons:
        - title: 'yes'
          payload: button_yes
        - title: 'no'
          payload: button_no

Hi @melaniab, thanks for your question. It seems like this is more of a question related to your specific example. Please ask this question in our forum.


Access to constructor variables in context of a abstract class

I try to write the following simple code:
abstract class Department {
    constructor() {
        this.printMeeting();
    }
    abstract printMeeting(): void; // is implemented in derived classes
}

class AccountingDepartment extends Department {
    constructor(public name: string) {
        super();
    }
    printMeeting(): void {
        console.log(this.name);
    }
}
var sampleInstance = new AccountingDepartment("Sales Meeting");

As you can see, I tried to access in the methode printMeeting() to the constructor parameter name. If I call the method from the contructor of the base class, the variable name would be undefined.
Is there a way to access to the constructor variables, also when the method would be called from the base class/constructor?
Thanks!

Don't call virtual functions from constructors (in C#, C++, or JS): http://stackoverflow.com/questions/962132/calling-virtual-functions-inside-constructors
See also #13525 and many other initialization order questions linked from there.


Replace assert with exception

Addresses #1386.
Bandit flags assert statements as a security issue. This PR replaces assert statements with exceptions.
Description
Testing:

[ X ] Ran tests and they passed OK

Just to let you we have a ticket to add unit tests for all the functions in this neighbourhood tools file but it has been stuck at the bottom of our to do column for a while. If anyone at BOM is looking for some more practise of writing unit tests for IMPROVER code feel free to put up a PR, but don't worry if not.

Just to let you we have a ticket to add unit tests for all the functions in this neighbourhood tools file but it has been stuck at the bottom of our to do column for a while. If anyone at BOM is looking for some more practise of writing unit tests for IMPROVER code feel free to put up a PR, but don't worry if not.

Just to let you we have a ticket to add unit tests for all the functions in this neighbourhood tools file but it has been stuck at the bottom of our to do column for a while. If anyone at BOM is looking for some more practise of writing unit tests for IMPROVER code feel free to put up a PR, but don't worry if not.

Thanks, I will work on this next!

Just to let you we have a ticket to add unit tests for all the functions in this neighbourhood tools file but it has been stuck at the bottom of our to do column for a while. If anyone at BOM is looking for some more practise of writing unit tests for IMPROVER code feel free to put up a PR, but don't worry if not.

Thanks, I will work on this next!

@btrotta-bom Thanks a lot for the latest changes. These look great.
I've just got a couple of additional points.

Could you update the CONTRIBUTING.md file like you've done in #1413?
As @dmentipl has mentioned in #1413, we're usually writing new unit tests using pytest, although the majority of our tests are still in a unittest-style and we're still adding unit tests in a unittest-style when we're updating or adding to existing unit tests. If you want to, you could consider updating this PR and #1413 to use pytest. What do you and @dmentipl think?

@gavinevans @dmentipl Sounds like pytest is the way to go, since this is a new set of tests. I'll update it today.

@gavinevans I'm inclined to agree that all new tests should be pytest-based.
@btrotta-bom Thanks for agreeing to updating the tests.


feat(hugr-py)!: Reexport commonly used classes from the package root

I had to delay a couple import hugrs to avoid cyclic dependencies.
BREAKING CHANGE: Moved hugr.get_serialization_version to hugr.serialization.serial_hugr.serialization_version

I am very wary - recommended practice now is to import from where things are defined and we risk tying our shoe laces together with circular imports


Changed ownername v2

Hi,
Sorry I had made an error in yesterdays  pull request  #1781 , there I changed my ownername to Barry Dam
But that resulted in a github profile link to someone elses profile
Now Ive changed it to BarryDam.. and I am about to change my VyseExhale profile to BarryDam ..

This pull request will be handled internally with ticket #1780409341 :)

So when is it merged ;)

When my colleagues get to that ticket, they will check the change and the system will update this thread as well :)

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.1 out of 2 committers have signed the CLA.:white_check_mark: Michadelic:x: BarryDamYou have signed the CLA already but the status is still pending? Let us recheck it.

Thanks Barry for your great contribution and the efforts you spent to implement a custom model.
I just slightly updated the wording of your project description.
I hope thats ok for you, let me know if you have any objections.
Merged!
Michael

Perfect thank you!


GKE Autopilot deprecating insecure kubelet readonly port 10255--and RBAC node/proxy resource not supported

GKE is deprecating the unsecured kubelet read-only port 10255 in its clusters in the near future, we got an email encouraging us to migrate any applications to the https 10250 port instead.
I disabled the insecure port on our autopilot cluster, and set DD_KUBERNETES_HTTPS_KUBELET_PORT=10250 in our helm chart.
After doing this, I'm still getting failures, e.g.:
2024-12-13 00:04:39 UTC | CORE | WARN | (comp/core/workloadmeta/impl/store.go:599 in func1) | error pulling from collector "kube_metadata": couldn't fetch "podlist": unexpected status code 403 on https://<IP_ADDRESS>:10250/pods: Forbidden (user=system:serviceaccount:ddagent:datadog-agent, verb=get, resource=nodes, subresource=proxy)

At first I thought this was an RBAC permissions issue with the agent's service account, but after looking through some docs it seems like the required node/proxy resource permission is disabled in GKE autopilot:

If your workload uses the /pods endpoint on the insecure kubelet read-only port, you need to grant the nodes/proxy RBAC permission to access the endpoint on the secure kubelet port. nodes/proxy is a powerful permission that you can't grant in GKE Autopilot clusters and that you shouldn't grant in GKE Standard clusters. Use the Kubernetes API with a fieldSelector for the node name instead.

(Incidentally, I think this is why the HTTPS port was bypassed for GKE autopilot in the first place in the datadog agent helm chart, a separate issue I posted about here)
Is there any workaround or planned fix for this?

Re-adding my reply from the Helm chart issue: https://github.com/DataDog/helm-charts/issues/1635#issuecomment-2540802564

We are aware of this incoming depreciation and are working with Google and other Datadog engineering teams towards a solution as indeed, nodes/proxy cannot be used preventing our usage of the HTTPS kubelet port. Until such work is completed, to keep full Agent functionality, the insecure port should remain enabled for GKE Autopilot clusters.


JSON decoded error

Hi, I am trying to collect weather data by using OpenWeathermap and use the code that is given on pandas_degreedays 0.0.6, but I get ValueError: No JSON object could be decoded.
The last line of the code error is;
ValueError: All objects passed were None
Any ideas why this is happening?
Thanks

I think you should also see URL which is requested.
Try to copy paste this URL to an internet navigator (Firefox, Chrome, Internet Explorer).
I think the problem is on OpenWeatherMap side which don't keep enough history for temperature

Hi,
Below is the error log that I get;
Thanks
---------------------------------------------------------------------------ValueError
Traceback (most recent call
last) in ()----> 1 ts_temp =
TemperatureProvider('OpenWeatherMap',
api_key=api_key).get_from_coordinates(0.34189, 46.5798114, '20150101',
'20150115')
C:\Users\Waseem\Anaconda\lib\site-packages\pandas_degreedays\provider\openweathermap.pyc
in get_from_coordinates(self, lon, lat, start_date, end_date, column)
21         station_id = stations.iloc[0]['station.id']     22 --->
23         data = ow.get_historic_weather(station_id, start_date,
end_date)     24         logging.info("\n%s" % data)     25
C:\Users\Waseem\Anaconda\lib\site-packages\openweathermap_requests_init_.pyc
in get_historic_weather(self, station_id, start_date, end_date,
resolution)    205
logging.error(traceback.format_exc())    206
logging.info("Build concatenated DataFrame")--> 207         df_all =
pd.concat(lst)    208         return(df_all)    209
C:\Users\Waseem\Anaconda\lib\site-packages\pandas\tools\merge.pyc in
concat(objs, axis, join, join_axes, ignore_index, keys, levels, names,
verify_integrity, copy)    752                        keys=keys,
levels=levels, names=names,    753
verify_integrity=verify_integrity,--> 754
copy=copy)    755     return op.get_result()    756
C:\Users\Waseem\Anaconda\lib\site-packages\pandas\tools\merge.pyc in
init(self, objs, axis, join, join_axes, keys, levels, names,
ignore_index, verify_integrity, copy)    797     798         if
len(objs) == 0:--> 799             raise ValueError('All objects
passed were None')    800     801         # consolidate data & figure
out what our result ndim is going to be
ValueError: All objects passed were None
On Mon, Sep 28, 2015 at 4:46 PM, scls19fr<EMAIL_ADDRESS>wrote:

I think you should also see URL which is requested.
Try to copy paste this URL to an internet navigator (Firefox, Chrome,
Internet Explorer).
I think the problem is on OpenWeatherMap side which don't keep enough
history for temperature
—
Reply to this email directly or view it on GitHub
https://github.com/scls19fr/openweathermap_requests/issues/8#issuecomment-143784704
.

--
Dr Muhammad Waseem Ahmad
Research Associate,
BRE Center for Sustainable Construction,
School of Engineering,
Cardiff University,
Cardiff, UK.


The admin should be able to view all notifications.

Bagisto Version: Master
Steps To reproduce--
1. Log in as an admin.
2. Click on the notification icon in the header.
3. Click on view all notifications link
Expected result: All the notifications should be visible in the admin panel.
Actual result: The admin is not able to view all the notifications,Please find the screenshot Here

I have reset my project with the master project again and it is working fine, please find the screenshot here.


Expose ability to refresh access token

I am using omniauth-oauth2 with the Google strategy
My use case is roughly as follows:

I have an initialiser with client id and secret etc, requesting offline access - entirely standard
I store the returned access_token, refresh_token along with the uid etc in a user model
Whenever I request data on behalf of said user, I pull the access_token from the corresponding attribute on the user model
But this access token can (and does) expire. At a later stage (possibly when the user themselves is offline) I need to refresh their access token because it has expired

As far as I can tell, there is no omniauth* provided means of achieving a refresh.
What's the best way of achieving this? Is there something within omniauth that can be exposed to make this easier? Something along the lines of this
At the moment I have a rather unattractive helper method that utilises the same ENV variables to extract the client id, secret etc, takes a user object and performs a refresh using an approach not dissimilar to this
Any thoughts?

while randomly searching how to do setup google calendar connections, i found this code in someone else's repository. there seems to be many ways but this one seemed fairly understandable...
# client being some model i created that stores the info.
  def refresh_current_token(client)
    oauth_client = OAuth2::Client.new(
      Rails.application.secrets.omniauth['google_calendar']['client_id'], Rails.application.secrets.omniauth['google_calendar']['secret'],
      :site => "https://accounts.google.com",
      :token_url => "/o/oauth2/token",
      :authorize_url => "/o/oauth2/auth")
    access_token = OAuth2::AccessToken.from_hash(oauth_client, {:refresh_token => client.refresh_token})
    access_token = access_token.refresh!
    client.access_token = access_token.token
    client.expires_at = Time.now + access_token.expires_in
    client.save
  end

Got this page through search, a bit confused. Link an answer here about the odd oauth2 playground issue for later reference: http://stackoverflow.com/questions/33771197/fail-to-refresh-access-token-in-oauth-2-0-playground

Sharing what I learned, and building up on @deeTEEcee answer (and others): if you have an existing strategy (like Freckle below which I'm building at the moment), you can leverage a bit more the strategy to build the client like this:
    strategy = OmniAuth::Strategies::Freckle.new(nil, key, secret)
    client = strategy.client

    oauth2_token = data_integration.oauth2_token
    oauth2_refresh_token = data_integration.oauth2_refresh_token

    token = OAuth2::AccessToken.new client, oauth2_token, {refresh_token: oauth2_refresh_token}
    new_token = token.refresh!

    data_integration.oauth2_token = new_token.token unless new_token.token.blank?
    data_integration.oauth2_refresh_token = new_token.refresh_token unless new_token.refresh_token.blank?
    data_integration.oauth2_token_expires_at = Time.at(new_token.expires_at) unless new_token.expires_at.blank?
    data_integration.save!

Hope this helps!

Quick example on how to work with dynamic strategies:
provider = :bitbucket
strategy = OmniAuth::Strategies.const_get(provider.to_s.capitalize).new(
      nil,
      Figaro.env.send("#{provider.to_s}_key"),
      Figaro.env.send("#{provider.to_s}_secret")
    )

I found this article helpful for refreshing access tokens from google:
https://stackoverflow.com/questions/12792326/how-do-i-refresh-my-google-oauth2-access-token-using-my-refresh-token#14491560


fix: updated types

TSearchParams

"$~" make only string
"$@" make only string
"$?" make only string

TSearchParamsWithOperator

"$@>" added number
"$<@" added number

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

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


data pre-processing before finetuning, divide by 255?

Hello, I use python 3.6 + tensorflow 1.9.0 to do a classification task by finetuning Alexnet. In kratzert's srouce code, the range of data is [0,255] and the image is substracted
by meanfile[103,116,123].  However, in my case, I perform better accrucy when the input images divide by 255 after substracted mean(distribution is [-0.5,0.5]). If the input images did not divide by 255 (distrubution is [-128, 128]), the results is bad and more easily to suffer Nan problem in summary operation when the learning rate is higher then 0.001.
The question is should I scale the image ?

You probably should, yes. Not sure why I missed to do this here, since I'm doing this usually. But better than dividing by 255 you should divide by the per-channel standard deviation.

Thank u very much!


Toggle fold level numbers for nested folds

Feature description
This plugin is such a good addition to have except I want to be able to hide the fold level numbers, as I see them as unnecessary and often contrary to what a clean code editor UI should look.
I tried to hide them on my own but the problem is I don't have such knowledge and it seems not easy to do.

Describe the solution you'd like
A feature like toggle_fold_level_numbers = true/false could be a great addition.  When you set it to false, the fold level numbers should no longer be there.
Additional context
There were many ways to go around it, but one was hiding the folding ticks >, which is not what I want, one was making the ticks get nested on different columns, which is not pleasant and counter-productive. The last one required to re-build neovim, which I did not know how to do it.

You need to set a custom 'statuscolumn' value. https://github.com/luukvbaal/statuscol.nvim is a great implementation of that, which has a custom function that doesn't show the fold numbers.
Here's my config (using lazy.nvim):
  {
    'luukvbaal/statuscol.nvim',
    opts = function()
      local builtin = require('statuscol.builtin')
      return {
        setopt = true,
        -- override the default list of segments with:
        -- number-less fold indicator, then signs, then line number & separator
        segments = {
          { text = { builtin.foldfunc }, click = 'v:lua.ScFa' },
          { text = { '%s' }, click = 'v:lua.ScSa' },
          {
            text = { builtin.lnumfunc, ' ' },
            condition = { true, builtin.not_empty },
            click = 'v:lua.ScLa',
          },
        },
      }
    end,
  },

Thanks @nogweii this is actually the first solution I see work flawlessly, now my Neovim set up is complete. Thanks again.

Thanks @nogweii this is actually the first solution I see work flawlessly, now my Neovim set up is complete. Thanks again.


Control tolerance for assert_frame_equal

It would be nice to be able to supply atol and/or rtol to pvlib.conftest.assert_frame_equal.
For any pandas > 1.1, current behavior sets either atol, rtol = [1e-3, 1e-3] or atol, rtol = [1e-5, 1e-5]. If atol or rtol are specified they are silently ignored.
Describe the solution you'd like
Pass atol and rtol through to pd.testing.assert_frame_equal
Describe alternatives you've considered
Live with it and compute more accurate test solutions.

NEP-29 says we can increase the minimum pandas to 1.1 and get rid of the test silliness.


fix: Columns not vertically aligned in FluentUI DataGrids

🐛 Bug Report
In the Fluent UI DataGrid i'm trying to allow for the dynamic adding/removing of columns. When doing so, the columns are no longer vertically aligned: individual cells are replaced chaotically. I notice the same behaviour in the FluentUI-blazor.net example, when using MS Edge: https://www.fluentui-blazor.net/DataGrid#typicalusage
(Under Typical Usage -> click on chevron-down in the column header -> hit the refresh button)
💻 Repro or Code Sample
From the link:
https://www.fluentui-blazor.net/DataGrid#typicalusage

Under Typical Usage -> click on chevron-down in the column header -> hit the refresh button
🤔 Expected Behavior
Aligned columns, headers and it's datacells with the same horizon positioning and width
😯 Current Behavior
cells are no longer placed directly beneath it's headers, cells are also not aligned in respect to each other
🔦 Context
I'm building a columnpicker to use in conjunction with the fluent ui datagrid. Adding or removing columns results in the aforementioned bug.
🌍 Your Environment
Windows 11 PRO, Microsoft Edge

OS & Device: [Windows 11] on [PC]
Browser [Microsoft Edge]
.NET and Fluent UI Blazor library Version [8.0.6 and 4.9.1]

+1

There are 2 different things happening here:

The effect you are seeing om the demo site

The effect you are seeing in you own code when adding/removing columns.

Occasionally the initial set GridTemplateColumns value gets mixed up when there are multiple resizable grids on one page. I'll try to make that process more resilient.

This one I can't investigate as there is no reproduction code provided (yet). What I suspect is happening is that you set GridTemplateColumns parameter when the initial grid is created. The grid's JavaScript reads this initial value on initialization and restores it when the reset method is executed. When adding/removing columns, the GridTemplateColumns may or may not be updated but the end result is the initially stored value does not correspond to the current grid setup. If you then reset, the value set will not represent the actual  situation and rendering will go do its own thing.

I'm not really sure how to solve this. Would reset also remove added columns or add removed columns again? If not, what to reset to then?

+1

Guys come on. What are you all '+1'-ing to?
That this happens on the demo site? I already confirmed that in my previous reply.
That this happens in your own code? Then give us reproduction code please (as also requested in my previous reply!) And also answer the questions I asked in my previous reply
The +1 are not really helping at all.

Thanks for your quick reponse. I noticed the reset-button on the demo-site, figured i could use whatever handle it had, to fix my own issues. When that didn't work as expected, i assumed it might be the same underlying issue. Sorry, didn't mean to draw a spotlight on it.
Concerning GridTemplateColumns, I did try using this parameter, to force a column-width based on the amount of columns. Either that or the Width-parameter on the Column. Setting it, or not, did not make a difference regarding the vertical alignment.
What follows is reproduction code, i cleaned it as much as possible.
Grid.razor
@typeparam TGridItem

    <CascadingValue Value="@this" IsFixed="true">
        <CascadingValue Value="@_filterManager" IsFixed="true">
            <CascadingValue Value="@DataManager" IsFixed="true">
                <GridHeaderToolBar Icon="@Icon"
                                   T="TGridItem"
                                   GridTitle="@Title"
                                   Add="_add"
                                   RefreshColumns="RefreshData"
                                   UseColumnPicker="@UseColumnPicker"
                                   EntityGridHeaderManager="@EntityGridHeaderToolBarManager"
                                   HeaderContent="@HeaderContent"
                                   ColumnManager="EntityGridColumnManager" />

                <FluentDataGrid TGridItem="@TGridItem" <EMAIL_ADDRESS>                                virtualize="@Virtualize" Pagination="@PaginationState"
                                NoTabbing="@NoTabbing"
                                ShowHover="@ShowHover"
                                GenerateHeader="@GenerateHeader"
                                OnRowClick="@(row => Click(row.Item))"
                                OnRowDoubleClick="@(row => DoubleClick(row.Item))"
                                @ref="@_gridReference">
                    <ChildContent>
                        @RenderColumns
                    </ChildContent>
                    <EmptyContent>
                        @GetTranslation("No Data Found")
                    </EmptyContent>
                    <LoadingContent>

                            <FluentStack Orientation="Orientation.Vertical"
                                         HorizontalAlignment="HorizontalAlignment.Center">
                                Loading...

                                <FluentProgress Width="240px" />
                            </FluentStack>

                    </LoadingContent>
                </FluentDataGrid>
                @if (PaginationState != null)
                {
                    <Paginator State="@PaginationState" />
                }
            </CascadingValue>
        </CascadingValue>
    </CascadingValue>

@code
{
    private RenderFragment RenderColumns => __builder =>
    {
        if (EntityGridColumnManager == null)
        {
            return;
        }

        @foreach (var column in EntityGridColumnManager.GetColumns())
        {
            <PropertyColumn<EMAIL_ADDRESS><EMAIL_ADDRESS>                            Filtered="@_filterManager.HasBeenFilterdOn(column)"
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>                <ColumnOptions>

                        <CascadingValue Value="@column" IsFixed="true">

                            <DefaultFilter ColumnInfo="@column" />

                        </CascadingValue>

                </ColumnOptions>
            </PropertyColumn>

        }
    };
}

Grid.razor.cs (snippet)
  #region Functions

   public async Task RefreshData()
   {
       await DataManager.RefreshData(default);
       await RefreshGrid();
   }

   public Task RefreshGrid()
       => _gridReference == null ? Task.CompletedTask : _gridReference!.RefreshDataAsync();

   public void SetLoadingState(bool loadingState)
       => _gridReference?.SetLoadingState(loadingState);

   #endregion

   #region Helper

   private string GetTranslation(string translation, bool isMultiple = false)
   {
       return _translate?.GetTranslation(translation, isMultiple) ?? translation;
   }

   #endregion
}

public IEnumerable<EntityGridColumn<TGridItem>> GetColumns(bool getAll = false)
{
    if (!_columns.Any())
        foreach (var column in typeof(TGridItem).GetProperties().Where(x =>
                     x.GetCustomAttributes(typeof(ExcludeFromMappingAttribute), true).Length == 0 &&
                     x.GetCustomAttributes(typeof(NotMappedAttribute), true).Length == 0))
        {
            if (!IsSimpleType(column.PropertyType))
                continue;

            var parameterExpression = Expression.Parameter(typeof(TGridItem));

            var propertyExpression = Expression.Property(parameterExpression, column);

            var convertExpression = Expression.Convert(propertyExpression, typeof(object));

            var lambdaExpression =
                Expression.Lambda<Func<TGridItem, object>>(convertExpression, parameterExpression);

            AddColumn(lambdaExpression, column,
                DefaultValueFormatterHelper.DefaultFormatter(column.PropertyType)
            );
        }

    if (!getAll & _customLayout?.Count > 0)
        return GetSpecificLayout(_customLayout);

    if (!getAll && _defaultLayout?.Count > 0)
        return GetSpecificLayout(_defaultLayout);

    return _columns;
}

public IEnumerable<EntityGridColumn<TGridItem>> GetSpecificLayout(List<string> specificLayout)
{
    List<EntityGridColumn<TGridItem>> specificLayoutColumns = [];

    foreach (var column in specificLayout
                 .Select(specificLayoutColumn => _columns.FirstOrDefault(x => x.PropertyName == specificLayoutColumn))
                 .OfType<EntityGridColumn<TGridItem>>().Where(column => !specificLayoutColumns.Contains(column)))
    {
        specificLayoutColumns.Add(column);
    }

    return specificLayoutColumns;

}

public void UseCustomLayout(List<string> layout)
{
    _customLayout = layout;
}

public void UseDefaultLayout(List<string> layout)
{
    _defaultLayout = layout;
}

#endregion

#region Helper

private static bool IsSimpleType(Type? type)
{
    if (type == null)
        return false;

    var typeInfo = type.GetTypeInfo();
    if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>))
    {
        return IsSimpleType(typeInfo.GetGenericArguments()[0]);
    }

    return type.IsPrimitive || type.IsEnum || type == typeof(string) || type == typeof(decimal) ||
           type == typeof(double) ||
           type == typeof(TimeOnly) ||
           type == typeof(TimeSpan) ||
           type == typeof(DateOnly) ||
           type == typeof(DateTime) ||
           type == typeof(DateTimeOffset) || type == typeof(Guid);
}

#endregion

I'm probably missing stuff you require, if so, please let me know. I'm still rather new at this, trying my hand on some more advanced stuff. Thanks in advance.

Hi @BartvDijk, Bart,
Can you post a zip of a project that I can run locally? Cutting, pasting and then guessing what's missing isn't really efficient

Can't share the project sadly. 'Fixed' the issue by forcing a re-render of the table.


DSRC-62: Document block

Ticket URL: DSRC-62
About these changes
Adds a DocumentBlock to the ArticlePageStreamBlock so that you can add a link to a document with your desired text.
How to check these changes
In the CMS:

In the API:

We will need to see if there is a document serializer, or create one ourselves - but this only needs to bring back a few fields so shouldn't be a big task.
Before assigning to reviewer, please make sure you have

[x] Checked things thoroughly before handing over to reviewer
[x] Checked PR title starts with ticket number as per project conventions to help us keep track of changes
[x] Ensured that PR includes only commits relevant to the ticket
[x] Waited for all CI jobs to pass before requesting a review
[x] Added/updated tests and documentation where relevant

Merging PR guidance
Follow docs\developer-guide\contributing.md
Deployment guidance
Follow docs\infra\environments.md

There is a DocumentSerializer: https://github.com/wagtail/wagtail/blob/5a1ba5abe2511aad29d927cef85e5a73916f2375/wagtail/documents/api/v2/serializers.py
I can't remember where the design is but I think we need the file name, mime type and file size. The model looks like it has a few of these fields ready to go: https://github.com/wagtail/wagtail/blob/5a1ba5abe2511aad29d927cef85e5a73916f2375/wagtail/documents/models.py#L40
I think there was a requirement to allow a list of downloads - was this your understanding as well?

Another thought - are these going into article pages or the yet-to-be-defined "standard page"?

There is a DocumentSerializer: https://github.com/wagtail/wagtail/blob/5a1ba5abe2511aad29d927cef85e5a73916f2375/wagtail/documents/api/v2/serializers.py
I can't remember where the design is but I think we need the file name, mime type and file size. The model looks like it has a few of these fields ready to go: https://github.com/wagtail/wagtail/blob/5a1ba5abe2511aad29d927cef85e5a73916f2375/wagtail/documents/models.py#L40

Perfect 😎

I think there was a requirement to allow a list of downloads - was this your understanding as well?

I haven't seen that anywhere on any of the tickets, just the ability to add one file... Was it in a discussion somewhere?

We have too many tickets per component! 😅
The design one mentions one or more:
https://national-archives.atlassian.net/jira/software/projects/DES/boards/138?selectedIssue=DES-5
There is a design somewhere that shows a list as well but I've only seen it on other's screens.


SPI - question to control a push button with bitmap in SPI

Dear @fivdi
I 'd like to use your library to control this push button from NKK Smartswitch in SPI.
I am not asking to do it but I 'd like just to understand with the information I have found in your sample code to monitor temperature with mcp3008
This is the datasheet

I underlined the most important informat and would be sure I am right and could use your lib with success.
switch : GPIO
SW - Terminal of Switch Normally open
SW  - Terminal of Switch Normally open

=> I should use https://github.com/fivdi/onoff for the button with debounce. Is it right ?
LCD : SPI
SDO  - Data Out Data output line for SPI
SDI - Data In Data input line for SPI
SCK - Serial Clock Clock line for SPI that synchronizes commands and data

SS - Slave Select Chip select for SPI; line is active low

I see the cabling

=> I should use https://github.com/fivdi/mcp-spi-adc for the SPI with CS or https://github.com/fivdi/spi-device . Is it right?
To be sure Ia m understanding : for the pin layout regarding my raspberry PI4 :

SPI0 MISO <=> SDO from my button
SPI0 MOSI <=>SDI from my button
SPI SCLK <-> SCK
SPI CE0 <-> SS but each time I need to send a message I need to force "false" till the message is sent then when terminate I need to force a true the SS. I don't know if SPI CE0 is enabled when false or true?
Thanks for your remarks.
Best Regards,
Youssef

I'm not familiar with the NKK Smartswitch so the information provided in the answer here isn't coming from an NKK Smartswitch expert.
It looks like this is a 5V device but the Raspberry Pi is a 3.3V device. This means the appropriate logic level converters would be needed. Alternatively, perhaps there are 3.3V NKK Smartswitchs available.
An SPI clock frequency of 8MHz should not be a problem for the Raspberry Pi or the spi-device Node.js module.

switch : GPIO
SW - Terminal of Switch Normally open
SW  - Terminal of Switch Normally open
=> I should use https://github.com/fivdi/onoff for the button with debounce. Is it right ?

Yes, this should work.

LCD : SPI
...
=> I should use https://github.com/fivdi/mcp-spi-adc for the SPI with CS or https://github.com/fivdi/spi-device . Is it right?

https://github.com/fivdi/spi-device can be used. https://github.com/fivdi/mcp-spi-adc can't be used as it's only for MCP3xxx analog to digital converters.

SPI0 MISO <=> SDO from my button
SPI0 MOSI <=>SDI from my button
SPI SCLK <-> SCK

Yes, this is correct.

SPI CE0 <-> SS but each time I need to send a message I need to force "false" till the message is sent then when terminate I need to force a true the SS. I don't know if SPI CE0 is enabled when false or true?

SPI CE0 should be connected to SS, however, you will not need to control the SS line yourself, this will be handled by spi-device automatically.

Dear @fivdi
Thanks a lot for your confirmation 🥇
The Raspberry PI4 has 3.3V and 5V distributed but could use external power because my second oled button needs 16v for the backlight 65k color display.
SpiOptions -  lsbFirst
I have seen in the https://github.com/fivdi/spi-device/blob/master/spi-device.d.ts there is a properties to :
export type SpiOptions = {
    mode?: SpiMode, // 2-bit, MODE0, MODE1, MODE2, or MODE3, default MODE0
    chipSelectHigh?: boolean, // true for active high chip select, default false
    lsbFirst?: boolean, // true for least significant bit first transfer, default false
    threeWire?: boolean, // true for shared MISO/MOSI signals, default false
    loopback?: boolean, // true for loopback mode, default false
    noChipSelect?: boolean, // true for 1 device per bus, no chip select, default false
    ready?: boolean, // true if device pulls low to pause, default false
    bitsPerWord?: number, // 8-bit, device word size, default 8
    maxSpeedHz?: number // 32-bit, device clock frequency in Hertz, default system specific
}

 lsbFirst?: boolean, // true for least significant bit first transfer, default false

When generating a bitmap, I need to send data with LSB first but not for the command.

That means each byte I need use >>8 to get msb -> LSB.
Like this :
( D0 D1 D2 D3 D4 D5 D6 D7 >> 8 ) result (D7 D6 D5 D4 D3 D2 D1 D0)

Is it right ?
Best Regards
Youssef

The Raspberry PI4 has 3.3V and 5V distributed but could use external power because my second oled button needs 16v for the backlight 65k color display.

Yes, the Raspberry Pi supplies 3.3V and 5V on the GPIO header. However, all GPIO pins including the SPI pins are not 5V tolerant, they are 3.3V tolerant.

That means each byte I need use >>8 to get msb -> LSB.

Yes, it looks like you will need to reverse the bits in each byte of the bitmap. Note that in JavaScript >> is the right-shift operator, not a reverse bits operator.

On seconds thoughts, looking at the bottom half of the image in this post where is says "Transferring Display Data/Displaying LCD Command and Data Sequence" it looks like it isn't actually necessary to reverse the bits in each byte of the bitmap,

Dear @fivdi
Regarding your comment
Yes, it looks like you will need to reverse the bits in each byte of the bitmap. Note that in JavaScript >> is the right-shift operator, not a reverse bits operator.
Not understood in JavaScript >> is the right-shift operator, not a reverse bits operator.
Best Regards
Youssef

Not understood in JavaScript >> is the right-shift operator, not a reverse bits operator.

For a description of the right-shift operator see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Right_shift
What's needed is a revers bits in byte, not a shift bits right. See https://stackoverflow.com/questions/2602823/in-c-c-whats-the-simplest-way-to-reverse-the-order-of-bits-in-a-byte/2603254

Dear @fivdi
It was my first exercice in ASM. My teacher when he designed his board he reverted all the 8 bits but to control his eprom.
Then My first option was to make a Look up table but he said I don't enough memeory.
I need to find few line of ASM code to invert the value and I did it but 25 years ago.
Now with new language, the way to write a code are too different and in asm I was able to control the timing of my software, function, .... here I don't know.
I will try your link and let you know the end.
But sure today I will control the button.
Just missing an extra library able to me to draw line, rectangle, square, text, ... because here in the command, there is only bitmap :-(
Again thanks for your time.
If you are living in Belgium, with plaisure to share a beer and chocolate with you.
Best Regards
Youssef

If you are living in Belgium, with plaisure to share a beer and chocolate with you.

I'll be sure to let you know if I'm in Belgium :smiley:
Good luck with the smartswitch.

Are you working in the broadcast industry ?
BR

No, the electronics industry.

Dear @fivdi
I hope you are well.
I tried the GPIO library and with the button it works. just need to adapt the bounce.
I enable the SPI through raspi-config
regarding SPI, I tried but don't know if I could have a monitoring of what i am sending or to scan SPI port and see if any device is connected like i2cDetect.
I tried this sample code but nothing happen.
I don't know if this is the option are wrong following the datasheet.
CEO needs to be at false when sendind data and back the true at the end.
Otherwise, when opening the SPI, open(busNumber, deviceNumber[, options], cb)
But i don't have the device number and nothing in the datasheet.
I let to "0";
If you have any idea if my settings are correct or wrong. It will be great.

'use strict';

const spi = require('bindings')('spi');

// Determine the temperature using a TMP36 analog temperature sensor wired to
// channel 5 on an MCP3008 SPI A/D converter

const options = {
  mode: spi.MODE0,
  chipSelectHigh: false,
  lsbFirst: false, // pi only supports msb first
  threeWire: false,
  loopback: false, // pi doesn't support loopback
  noChipSelect: true,
  ready: false, // pi doesn't support ready
  bitsPerWord: 8, // pi only supports 8 bit words
  maxSpeedHz: 8000000 //Hz
};
const nkk_switch = spi.open(0, 0, options, err => {
  // An SPI message is an array of one or more read+write transfers

  const message = [{
    sendBuffer: Buffer.from([ 0x40, 0x03, 0x41, 0x1F]), // Sent to rinitialize
    //receiveBuffer: Buffer.alloc(3),              // Raw data rno answer
    byteLength: 4,
    chipSelectChange : false,
    speedHz: 8000000 // Use a low bus speed to get a good reading from the TMP36
  }];

  if (err) {
    throw err;
  }

  nkk_switch.transfer(message, (err, message) => {
    if (err) {
      throw err;
    }

    console.log('sent initialize');

  });

  const message1 = [{
    sendBuffer: Buffer.from([0x40, 0x33, 0x41, 0xBF]), // Sent backlight RED FULL
    //receiveBuffer: Buffer.alloc(3),              // Raw data read
    byteLength: 4,
    chipSelectChange : false,
    speedHz: 8000000
  }];
  nkk_switch.transfer(message1, (err, message) => {
    if (err) {
      throw err;
    }
    console.log('sent message1');
  });
});

I have no error but not feedback or nothing on the button :-(
Best Regards,
Youssef

I tried the GPIO library and with the button it works. just need to adapt the bounce.

That's good news.

regarding SPI, I tried but don't know if I could have a monitoring of what i am sending or to scan SPI port and see if any device is connected like i2cDetect.

I'm not aware of a scanner for SPI similar to i2cdetect for I2C.

CEO needs to be at false when sendind data and back the true at the end.

In this case, CE0 on the Raspberry Pi should be connected to SS on the SmartSwitch and the option noChipSelect should either be set to false or omitted. In the code above, noChipSelect is set to true
  noChipSelect: true,

it should be
  noChipSelect: false,

Otherwise, when opening the SPI, open(busNumber, deviceNumber[, options], cb)
But i don't have the device number and nothing in the datasheet.
I let to "0";

If the SmartSwitch is connected to the Pi as shown in the images from the first post above then the busNumber is 0 and the deviceNumber is 0. The busNumber is 0 because the pins for SPI0 are being used. The deviceNumber is 0 because pin SPI CE0 is used to select the device.

chipSelectChange : false,

The default value for chipSelectChange is false so setting it it false will have no effect, This can be omitted. Also, the messages being sent only contains one transfer so this option will have no effect.

mode: spi.MODE0,

Have you checked the datasheet to ensure that MODE0 is the correct mode for the device?

Dear @fivdi
Again thanks.
I will do it.
Regarding the SPI MODE 0. Nothing in the pdf file but I have seen SPI Timing chart (/SS Using)

The pdf in case I forgot to share you the good information.
smart_switch_lcd6432_IS.pdf
Best Regards
Youssef

Dear @fivdi
It's works
I checked the SPI Timing chart and discovered it is MODE2.
Here I have just sent the procedure to initialyze and the send backlight to GREEN.
'use strict';
const spi = require('bindings')('spi');
// Determine the temperature using a TMP36 analog temperature sensor wired to
// channel 5 on an MCP3008 SPI A/D converter
const options = {
mode: spi.MODE2,
chipSelectHigh: false,
lsbFirst: false, // pi only supports msb first
threeWire: false,
loopback: false, // pi doesn't support loopback
noChipSelect: false,
ready: false, // pi doesn't support ready
bitsPerWord: 8, // pi only supports 8 bit words
maxSpeedHz: 8000000 //Hz
};
const nkk_switch = spi.open(0, 0, options, err => {
// An SPI message is an array of one or more read+write transfers
const message = [{
sendBuffer: Buffer.from([ 0x40, 0x03, 0x41, 0x1F]), // Sent to initialize
//receiveBuffer: Buffer.alloc(3),              // Raw data rno answer
byteLength: 4,
speedHz: 8000000 // Use a low bus speed to get a good reading from the TMP36
}];
if (err) {
throw err;
}
nkk_switch.transfer(message, (err, message) => {
if (err) {
throw err;
}
console.log('sent initialize');

});
const message1 = [{
sendBuffer: Buffer.from([0x40, 0x33, 0x41, 0xBF]), // Sent backlight RED FULL
//receiveBuffer: Buffer.alloc(3),              // Raw data read
byteLength: 4,
speedHz: 8000000
}];
nkk_switch.transfer(message1, (err, message) => {
if (err) {
throw err;
}
console.log('sent message1');
});
});
Now the goal is to use the two library GPIO and SPI to manage the button.
GPIO to detect Raising & falling edge, how long it was pressed and next but hope to close today is to generate bitmap array and send lsb first ;-)
Best Regards,
Youssef

This
const spi = require('spi-device');

is better than this:
const spi = require('bindings')('spi');

Also, I'd highly recommend sending the second message in the completion callback of first message.

Dear @fivdi
Yes I was to say you if I clone the repository, I have an issue with this line
const spi = require('bindings')('spi');

doesn't work.
Usually I am not working with npm install the package to be sure I have all the repository with uglify, ....
Also, I'd highly recommend sending the second message in the completion callback of first message.

IF you could give me an example I am not expert ;-)
Best Regards,
Youssef

Dear @fivdi
Back again,
I am trying to generate a bitmap just by forcing a value just to be sure I could see anything.
My question,
I am creating the message :
  let bitmapbuffer = new ArrayBuffer(257); // create a buffer of length 16
  bitmapbuffer[0] = 0x55;
  var i = 1;
  for (i = 1; i < 257; i++) {
    bitmapbuffer[i] = 0x03;
  }
  console.log(`nbr bytes ${bitmapbuffer.byteLength} ...`)
  console.log(bitmapbuffer)

  const messageBitmap = [{
    sendBuffer: Buffer.from(bitmapbuffer), // Sent backlight GREEN FULL
    byteLength: 257,
    speedHz: 8000000
  }];

I can check log that the bytearray is correctly created but no way to see if it sent or if :+1:
sendBuffer: Buffer.from(bitmapbuffer), // Sent backlight GREEN FULL

From the button, no feedback. If the bytearray is malformed or missing anything automatically the button reject the new command.
Thanks if you could confirm the way I am creating the 257 bytes are correctly implemented in the sendbuffer.
Best regards
Youssef

Also, I'd highly recommend sending the second message in the completion callback of first message.

IF you could give me an example I am not expert ;-)

Something like this:
'use strict';

const spi = require('bindings')('spi');

// Determine the temperature using a TMP36 analog temperature sensor wired to
// channel 5 on an MCP3008 SPI A/D converter

const options = {
  mode: spi.MODE2,
  chipSelectHigh: false,
  lsbFirst: false, // pi only supports msb first
  threeWire: false,
  loopback: false, // pi doesn't support loopback
  noChipSelect: false,
  ready: false, // pi doesn't support ready
  bitsPerWord: 8, // pi only supports 8 bit words
  maxSpeedHz: 8000000 //Hz
};
const nkk_switch = spi.open(0, 0, options, err => {
  // An SPI message is an array of one or more read+write transfers

  const message = [{
    sendBuffer: Buffer.from([ 0x40, 0x03, 0x41, 0x1F]), // Sent to initialize
    //receiveBuffer: Buffer.alloc(3),              // Raw data rno answer
    byteLength: 4,
    speedHz: 8000000 // Use a low bus speed to get a good reading from the TMP36
  }];

  if (err) {
    throw err;
  }

  nkk_switch.transfer(message, (err, message) => {
    if (err) {
      throw err;
    }

    console.log('sent initialize');

    const message1 = [{
      sendBuffer: Buffer.from([0x40, 0x33, 0x41, 0xBF]), // Sent backlight RED FULL
      //receiveBuffer: Buffer.alloc(3),              // Raw data read
      byteLength: 4,
      speedHz: 8000000
    }];

    nkk_switch.transfer(message1, (err, message) => {
      if (err) {
        throw err;
      }

      console.log('sent message1');
    });
  });
});

The following code doesn't do what you think it does.
  let bitmapbuffer = new ArrayBuffer(257); // create a buffer of length 16
  bitmapbuffer[0] = 0x55;
  var i = 1;
  for (i = 1; i < 257; i++) {
    bitmapbuffer[i] = 0x03;
  }
  console.log(`nbr bytes ${bitmapbuffer.byteLength} ...`)
  console.log(bitmapbuffer)

  const messageBitmap = [{
    sendBuffer: Buffer.from(bitmapbuffer), // Sent backlight GREEN FULL
    byteLength: 257,
    speedHz: 8000000
  }];

Try this instead:
  let bitmapbuffer = Buffer.alloc(257);
  bitmapbuffer[0] = 0x55;
  var i = 1;
  for (i = 1; i < 257; i++) {
    bitmapbuffer[i] = 0x03;
  }
  console.log(`nbr bytes ${bitmapbuffer.length} ...`)
  console.log(bitmapbuffer)

  const messageBitmap = [{
    sendBuffer: bitmapbuffer, // Sent backlight GREEN FULL
    byteLength: 257,
    speedHz: 8000000
  }];

Dear @fivdi
Thanks for your reply.
Finally, i did it.

How to close or disconnect SPI ?
Just to be sure, when the message are sent at the end you close the SPI connection or there is a disconnect or close command to sent?
And there is a way to wake up the SPI if any message is coming to the raspberry ?
For the next

Now I need to clean the code and generate enum for command, color set, background set, managing bitmap array.

Missing a bitmap array to generate text in 1 till ' lines with autosize or wrapping, .... and for eacfh line to be able to invert the background color ;

Long mission.
Otherwise, the source code is C as far as I know, but did you have any time got memory leaks or updated with the latest commit from the original source ?
Otherwise if you have other protocol like modbus, it will be nice to have as controller or device ;-)
Finally is to create a board to support 16/33/50 bitmap push button with one rotary button magnetic in spi too or I2C and I think I need to replace the CE0 by usingthe  MCP23017 https://www.microchip.com/wwwproducts/en/MCP23017
too much protocol in use and I need another mcp2317 for the push button too.
How do you think boss ;-)
I am sure you have better idea .
Best Regards
Youssef

Finally, i did it.

Congratulations :smile:

How to close or disconnect SPI ?
Just to be sure, when the message are sent at the end you close the SPI connection or there is a disconnect or close command to sent?

It's not really necessary to invoke close on SpiDevice objects in most scenarios. An SpiDevice object can be opened (created) for each SPI device when the program starts and left open for the lifetime of the program. Under the covers, invoking open opens a file for communication with the device. Invoking close will close that file and free the corresponding resources.
If a program continuously created many SpiDevice objects for whatever reason, it would need to invoke close at some point as each process can only have a limited number of open files.

And there is a way to wake up the SPI if any message is coming to the raspberry ?

Something like this shouldn't be needed. Just open the required SpiDevice objects and leave them open. Then they can be used whenever needed.

Otherwise, the source code is C as far as I know, but did you have any time got memory leaks or updated with the latest commit from the original source ?

I'm not sure which source code you are referring to here. Do you mean the source code from this repository? If so, it's implemented in C++ and I'm not aware of any memory leaks. I don't know which original source you are referring to.

Finally is to create a board to support 16/33/50 bitmap push button with one rotary button magnetic in spi too or I2C and I think I need to replace the CE0 by usingthe MCP23017

50 bitmap buttons means 50 chip select output lines and 50 button input lines which is 100 lines and additional lines will be needed for MISO/MOSI/SCLK (SPI) and SDA/SCL (I2C). That's more that a Raspberry Pi has and means it can only work with I/O expanders.
4 I/O expanders will be needed for the 50 buttons and each I/O expander will have 2 interrupt outputs which means 8 interrupt inputs for the Raspberry Pi.
A Raspberry Pi 4 has up to 5 SPI ports and up to 6 I2C ports (see here). Perhaps it would make sense to use multiple SPI and I2C ports at the same time.
It will be interesting to see how the project goes particularly from a performance perspective.

Dear @fivdi
Regarding C library ; https://github.com/fivdi/spi-device/tree/master/src
In the src folder I can find all the code in C.
Did you made a wrapper to JS ?
I am interrested because the manufacturer of the button sent me yesterday the c library in for raspberry and would make a js wrapper on it otherwise I will rewrite the code.
Best Regards
BEst Wishes for 2020 cheers
Youssef

Regarding C library ; https://github.com/fivdi/spi-device/tree/master/src
In the src folder I can find all the code in C.

As mentioned above, the code in https://github.com/fivdi/spi-device/tree/master/src is C++ code.

Did you made a wrapper to JS ?

spi-device was implemented in a way that makes it directly callable from JavaScript without the need for a wrapper.
i2c-bus was implemented in a way that requires a wrapper.

Dear @fivdi
Sorry to ask too much question, I am beginner with javascript.
Do you have a tuto how to make the wrapper from C to javascript or typescript ?
I have a lot of library in C or C++ but my team doesn't want to use C or c++ only typescript  in first and javascript in second ;-)
The manufacturer sent me the library in C for raspberry PI3
NKK Raspberry Pi Source Code.zip
And now need to convert it in typescript or java.
Apology but I respect you and never in github I have seen somebody like you sharing with happiness your knowledge.
Again many thanks.
Youssef

Do you have a tuto how to make the wrapper from C to javascript or typescript ?

I'm afraid I don't.
A lot of the knowledge that I have is from the nan examples and nan tests.
Note that using nan for Node.js addons is an old technique. A more modern approach would be to use  N-API. See here and here.

Dear @fivdi
Thanks, I got it but I will spend 10 years to wrap my code ;-)
Best Regards
Cheers
Youssef


Option to just insert Wikipedia link

My personal style is that instead of inserting blocks of text from Wikipedia, I like to just insert the link to the Wikipedia page. It would be lovely if this could be an option in your wonderful plugin.

This is possible with the current version. In the plugin's settings, just update the Wikipedia Extract Template value to be something like:
{{searchTerm}}]({{url}}

I usually set it like this:
> wikipedia:: [{{searchTerm}}]({{url}})
{{text}}

which does include the text. But if you do the top option it just won't insert the paragraph text.


Image upload enhancements

Posting this to get feedback/suggestions etc.
We are looking to improve the process of uploading images for various posts, specifically:

Have a default s3 prefix per post type, so that each post type has its respective images in its own subfolder
We use another level of subfolders below post type to group images pertaining to a single post; as such we want the system to remember the last folder the user was in, per post type, so that multiple images can be uploaded to the final subfolder without having to navigate there every image. This cache should expire after some time, I'm thinking 6 hours.

yes, this will be helpful.. recently Owen implemented subdomains having specific folders for each site, so this would be nice addition to that.

@mazharoddin thanks, can you point me toward that code? I looked through first few pages of commits here and did not see anything appropriate.

@p-decoraid , here is the code snippet which @owen2345 modified to add support folder per subdomain.
https://github.com/owen2345/camaleon-cms/blob/master/app/uploaders/camaleon_cms_aws_uploader.rb#L23

Thanks @mazharoddin !

I would like this to be an optional feature. The reason is that I have an image compressor hooked up to my S3 bucket that places all optimized images in the same directory. If the function draws files from various subfolders but places them all in one place, then my file management has actually gotten worse.
Another upload feature that would solve this problem would be to add a hook for custom upload processing - image optimization, antivirus, etc. With this in place I could optimize my images before they reach the subfolders, removing the conflict.

@briank-musichouse
there is a hook for uploader called "before_upload" where you can do it.
Regards,

Sorry, I must have overlooked that. Thanks!