Expose fewer condition types by leveraging status and reason.

Description of your changes
This slightly more opinionated implementation aims to

Prevent unintuitive statuses, for example a resource being "ready" and "failed" simultaneously.
Provide some guard rails, such as removing IsReady() and friends, which encourage making decisions based on previously recorded rather than currently observed status.
Align the way our conditioned statuses work a little more closely to the patterns used by Kubernetes proper (e.g. on Node).

To recap, today we have the following:
const (
	// Pending means that the resource create request has been received and is waiting
        // to be fulfilled.
	Pending ConditionType = "Pending"

	// Creating means that the resource create request has been accepted and the
        // resource is in the process of being created.
	Creating ConditionType = "Creating"

	// Deleting means that the resource is in the process of being deleted.
	Deleting ConditionType = "Deleting"

	// Failed means that the resource is in a failure state, for example it failed to
        // be created.
	Failed ConditionType = "Failed"

	// Ready means that the resource creation has been successful and the resource
        // is ready to accept requests and perform operations.
	Ready ConditionType = "Ready"
)

// Condition contains details for the current condition of this pod.
type Condition struct {
	Type               ConditionType
	Status             corev1.ConditionStatus
	LastTransitionTime metav1.Time
	Reason             string
	Message            string
}

type ConditionStatus string

// These are valid condition statuses. "ConditionTrue" means a resource is in the condition.
// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes
// can't decide if a resource is in the condition or not. In the future, we could add other
// intermediate conditions, e.g. ConditionDegraded.
const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

Note that each contemporary condition has two states, and some context (i.e. Reason and Message) that largely go unused.
In the approach put forth by this PR there are only two conditions; Ready and Synced. The former represents the lifecycle of the managed resource while the latter represents the status of operations upon the resource. The condition status and reason are used to provide more information as to why the managed resource is or is not synced and ready.
Which issue is resolved by this Pull Request:
Resolves #495
Checklist:

[ ] Documentation has been updated, if necessary.
[ ] Pending release notes updated with breaking and/or notable changes, if necessary.
[ ] Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
[ ] Code generation (make generate) has been run to update object specifications, if necessary.
[ ] CRD manifests generation (make manifests) has been run to update CRD manifests yaml file specifications, if necessary.
[ ] Update dependencies (make vendor) has been run to update Gopkg.lock file, if necessary
[ ] RBAC permissions in clusterrole.yaml have been updated to include new types, if necessary
[ ] All related commits have been squashed to improve readability.
[ ] Comments have been added or updated based on the standards set in CONTRIBUTING.md

I expect this PR to break many test in its current state. I've refactored ConditionedStatus and updated one controller to use the new patterns in order to illustrate my intent. I'd like to get feedback before I undertake the task of refactoring the many places in which we currently use ConditionedStatus.

@ichekrygin @jbw976 @displague Please take another look.
My initial plan with this PR was to refactor the entire codebase in one fell swoop, but I think doing so would have been highly prone to merge conflicts over time, and nigh on impossible to review. Instead I decided to rename ConditionedStatus to DeprecatedConditionedStatus, then introduce the newer implementation of ConditionedStatus in a separate commit. My hope is this will allow us to refactor the codebase over time and avoid one monster PR.


Fix cumxxx with multi-index column.

Codecov Report

Merging #620 into master will decrease coverage by 2.72%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #620      +/-   ##
==========================================
- Coverage   93.31%   90.59%   -2.73%
==========================================
  Files          31       31
  Lines        4878     4878
==========================================
- Hits         4552     4419     -133
- Misses        326      459     +133

Impacted Files
Coverage Δ

databricks/koalas/frame.py
92.78% <100%> (-1.89%)
:arrow_down:

databricks/koalas/usage_logging/__init__.py
23.14% <0%> (-74.08%)
:arrow_down:

databricks/koalas/usage_logging/usage_logger.py
50% <0%> (-50%)
:arrow_down:

databricks/koalas/__init__.py
76.31% <0%> (-7.9%)
:arrow_down:

databricks/conftest.py
90.69% <0%> (-6.98%)
:arrow_down:

databricks/koalas/utils.py
97.43% <0%> (-2.57%)
:arrow_down:

databricks/koalas/namespace.py
87.6% <0%> (-1.61%)
:arrow_down:

databricks/koalas/plot.py
92.51% <0%> (-1.58%)
:arrow_down:

databricks/koalas/testing/utils.py
77.35% <0%> (-0.63%)
:arrow_down:

... and 1 more

Continue to review full report at Codecov.

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


Elyonolaniran/ch364656/simplify osmosis setupstore

Update the setupStore function to return the store ref with the following properties:
Context
Provider
Edit: Updated example project and tests

lets add an explicit check on line 17 above where we loop through and map properties, to prevent the consumer from having a property named Context or Provider that we would overwrite. We should effectively enforce these as protected properties

https://app.clubhouse.io/shipt/story/364659/update-osmosis-example-projects


SIFT CLI - KDE Wallet Service

Hi,
I installed SIFT on the SIFT OVA (sift was missing).  I'm doing a sift upgrade and I'm getting the following pop-up box.

What package is doing this and what option should I pick?
Thanks,
Salty

I found reference to a similar issue and this seemed to resolve pip prompting for the KDE Wallet.
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install setuptools_rust
sudo -H pip3 uninstall keyring
sudo pip3 install --upgrade keyrings.alt
Salty

Hey @salty4n6 -- what SIFT OVA are you using where SIFT is not installed, that doesn't seem correct?
The current community OVA on SANS website does not have the SIFT CLI installed but it is still 100% SIFT.
I've never seen KDE Wallet installed before, to my knowledge both 18.04 and 20.04 SIFT builds are gnome based not KDE, so not sure where KDE stuff is coming from unless you aren't actually using a SIFT OVA and instead using some other flavor of linux?

Regardless, the KDE wallet is nothing being installed directly by SIFT, could be a dependency of something I suppose or installed by default? Could be wrong about KDE vs GNOME too.

Hi, The KDE wallet issue was happening on the latest OVA that doesn't have SIFT installed but I followed the instructions for installing SIFT so I can have an up to date system.  I have also done clean Ubuntu 18.04 and 20.04 installs and installed SIFT and both installs give the same KDE Wallet prompts.  The only packages I've installed before installing SIFT are build-essential, dkms, vim, and the virtualbox guest additions.  I also noticed that there seems to be an issue with the account creation?  I now have a user called {{ user }} on my systems.
I'm going to do another clean install of Ubuntu 18.04, apply all the latest OS updates, and install the couple of packages I listed earlier and will post back.  I'll include the salt log file, too.
Salty

Hi,
I did a clean Ubuntu 18.04.5 install, updated everything, installed a couple of packages (vim, dkms, and build-essential),
and VirtualBox guest additions.  I installed SIFT and the KDE Wallet prompt happened again.
I also have a new home directory called {{ user }}.
The install failed with the following:

Running: /usr/local/etc/foremost.conf
Running: sift-config-tools
Update returned exit code not zero
Error: Update returned exit code not zero
at ChildProcess. (/snapshot/sift-cli/sift-cli.js:542:23)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

----- PLEASE READ ----------------------
A lot of failures are caused by the apt system being locked
or unhealthy.
Before opening an issue in GitHub, please check to see if
your apt system is healthy.
Try running 'apt-get update' then remove any packages that
aren't used by running 'apt-get autoremove'

Thanks,
Salty
saltstack.log

I will take a look, we have primarily started to move on to 20.04, might be worth a try too
Sent from my iPhone

On Apr 17, 2021, at 14:19, salty4n6 @.***> wrote:

Hi,
I did a clean Ubuntu 18.04.5 install, updated everything, installed a couple of packages (vim, dkms, and build-essential),
and VirtualBox guest additions. I installed SIFT and the KDE Wallet prompt happened again.
I also have a new home directory called {{ user }}.
The install failed with the following:
Running: /usr/local/etc/foremost.conf
Running: sift-config-tools
Update returned exit code not zero
Error: Update returned exit code not zero
at ChildProcess. (/snapshot/sift-cli/sift-cli.js:542:23)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
----- PLEASE READ ----------------------
A lot of failures are caused by the apt system being locked
or unhealthy.
Before opening an issue in GitHub, please check to see if
your apt system is healthy.
Try running 'apt-get update' then remove any packages that
aren't used by running 'apt-get autoremove'
Thanks,
Salty
saltstack.log
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

I'll give 20.04 a rip and let you know.

20.04 has the same KDE Wallet pop-up and the {{ user }} issue.  From looking at the salt.log, it looks like the errors are related to the changes to the sansforensics user account.  The KDE prompt is still strange but I'll run the SIFT install again to see if it comes back and if it does then I'll run the other commands I found earlier then run SIFT install again to see if the prompt comes back.
Salty
saltstack.log

Good news is the system knows that SIFT is installed

running sudo sift update now

sudo sift update prompts for the KDE Wallet then I ran
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install setuptools_rust
sudo -H pip3 uninstall keyring
sudo pip3 install --upgrade keyrings.alt
I ran sudo sift update and the KDE Wallet prompts are gone.  Not sure what all is going on.
Salty
I attached the salt log for the last run with the upgrade to keyrings.alt
sift-keyrings-upgrade.log

I haven't seen this happen through normal use, but since you are upgrading pip, perhaps it's related to that. I'll check with a few others as well.

I saw the same popup when I installed on a fresh 18.04 box yesterday. The install error'd out from lack of space, so I had to add more space to root and tried again, and the popup didn't come back but it still gave an error and left a {{user}} folder in /home.  I thought something broke due to the space issue and since there's no way to uninstall sift, I've rebuilt the box with 20.04 and and trying the install again now.
One other thing I noticed is that the verification of the asc file doesn't work using gpg, as the file is created in openpgp instead.

I'll take ac closer look tonight/tomorrow, some recent changes were made with the user, but I think we fixed one bug but might not have pushed the change.
Regard PGP, it shouldn't matter PGP is PGP, but I'll verify and see what's causing a problem.

~/Downloads$ gpg --verify sift-cli-linux.sha256.asc
gpg: verify signatures failed: Unexpected error

~/Downloads$ gpg -v -d sift-cli-linux.sha256.asc
gpg: armor header: Version: OpenPGP.js v4.10.1
gpg: armor header: Comment: https://openpgpjs.org
gpg: public key is A2156B0CEAE26425
gpg: using subkey A2156B0CEAE26425 instead of primary key 15B9AD7122598A94
gpg: encrypted with 4096-bit ELG key, ID A2156B0CEAE26425, created 2013-12-07
      "SANS Investigative Forensic Toolkit<EMAIL_ADDRESS>gpg: decryption failed: No secret key

Tried older release of sift-cli (1.9.2) and it still errors out.
>> Running: /usr/local/etc/foremost.conf
>> Running: sift-config-tools
Update returned exit code not zero
Error: Update returned exit code not zero
    at ChildProcess.<anonymous> (/snapshot/sift-cli/sift-cli.js:547:23)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)

----- PLEASE READ ----------------------

A lot of failures are caused by the apt system being locked
or unhealthy.

Before opening an issue in GitHub, please check to see if
your apt system is healthy.

Try running 'apt-get update' then remove any packages that
aren't used by running 'apt-get autoremove'

**~/Downloads$ ls /home
 sentner  '{{ user }}'**

/var$ tail /var/cache/sift/cli/v2021.4.2/saltstack.log
  user_|-sift-user-sentner_|-sentner_|-present:
    __id__: sift-user-sentner
    __run_num__: 561
    __sls__: sift.config.user.user
    changes: {}
    comment: 'These values could not be changed: {''home'': ''/home/{{ user }}''}'
    duration: 14.622
    name: sentner
    result: false
    start_time: '03:48:14.323389'

I believe this was an accidental bug introduced in 2021.4.2, but not seeing it in 2021.4.3. Please run an upgrade or fresh install and let me know. I'm doing a full run through as we speak.

Hi Erik,
I did a clean install of Ubuntu 20.04 and installed with the latest version 2021.4.3 and I had the same results ( KDE Wallet and {{ user }}). I ran a sift update afterwards and I'm still getting errors.  I'm attaching the log for the update.  I forgot to grab the log for the clean install.
Thanks,
Salty
saltstack.log

Hi Erik,
I did a clean install of Ubuntu 20.04 and installed with the latest version 2021.4.3 and I had the same results ( KDE Wallet and {{ user }}). I ran a sift update afterwards and I'm still getting errors.  I'm attaching the log for the update.  I forgot to grab the log for the clean install.
Thanks,
Salty
saltstack.log

I’m running another build now, so far haven’t reproduced it.
Sent from my iPhone

On Apr 20, 2021, at 19:49, salty4n6 @.***> wrote:

Hi Erik,
I did a clean install of Ubuntu 20.04 and installed with the latest version 2021.4.3 and I had the same results ( KDE Wallet and {{ user }}). I ran a sift update afterwards and I'm still getting errors. I'm attaching the log for the update. I forgot to grab the log for the clean install.
Thanks,
Salty
saltstack.log
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

Ok I duplicated this as well. Looks like they are entirely unrelated.

Good timing.  I was just about to post my update from another machine going from 2021.4.2 to 2021.4.3.
Thank you for looking into these issues.

I have a fix for {{ user }} -- we'll see if they are actually linked together. I spun up an older OVA that doesn't have any of these issues. Looking at the differences.

It's the latest version of pip that is doing the KDE wallet stuff. Pip wants to create a wallet for some reason :/

Apparently this is a known issue that is being worked on in a number of different ways.

Just upgraded via 2021.4.4 - all good with the {{ user }}.  Thanks Erik.


Add Link object

This should fix #114

Fixed the formatting somewhat but the tests have been hit hard with all of the list trailing commas removed by black.


unit-race: find workaround for sqlite data race

Looks like our race unit tests are affected by https://gitlab.com/cznic/sqlite/-/issues/62. We need to find a workaround for that as it doesn't seem like the problem will be fixed any time soon.

Is this still an issue?

I haven't seen this happen anymore. Not sure if we did something wrong or this only happened a single time? Closing for now, can always re-open if it happens again.


Arduino Keyboard library > 1.0.3 include support for multiple layout

Maybe we can just replace Keyboard.begin(); with something like Keyboard.begin(KeyboardLayout_it_IT); without editing files in libraries folder?

Tested Arduino_32u4_Code replacing line 63 with Keyboard.begin(KeyboardLayout_it_IT);
Result:
chars ok: ,.-;:_@#[]
chars empy: {}
< and > was replaced by \ and |
fixed editing file Documents/Arduino/libraries/Keyboard/src/KeyboardLayout_it_IT.cpp
change 0x32 with 0x35 and viceversa

That's what I've done to get the italian Keyboard layout works:

Install Library Keyboard > 1.0.3
Edit the /home/USER/Arduino/libraries/Keyboard/src/keyboard.h and edit the line:
void begin(const uint8_t *layout = KeyboardLayout_en_US);
with
void begin(const uint8_t *layout = KeyboardLayout_it_IT);

As you said the {} characters won't work, but at least you could use "Press" and send the related ALT+Numeric_keypad_1+Numeric_keypad_2+(Numeric_keypad_3 or Numeric_keypad_5).
Not much elegant but worth than nothing.
I was looking at library "keyboard_it_IT.h" and found this:
#define KEY_I_GRAVE       (136+0x2e)
#define KEY_E_GRAVE       (136+0x2f)
#define KEY_O_GRAVE       (136+0x33)
#define KEY_A_GRAVE       (136+0x34)
#define KEY_U_GRAVE       (136+0x31)
Not tested yet if the printed characthers are correct, but maybe it's possible to find a workaround like that for {}.


Another /dev/midi2 problem

After reading thru the issues and solutions the last guy had, I am still having issues. Every time i try to run pilink i get a "no such directory /dev/midi2". I am running on a fresh install of raspbian (which i have rebooted several times with my midi interface installed, still no luck). A little more info; I am attempting to convert TouchOSC to hardware Midi so that I can control my Motu Ultralite interface via the touchOSC template they have created for their hardware.
When I run ls -l /dev/midi* i get no such directory.
dmesg returns:
pi@raspberrypi:~ $ dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.79-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1159 SMP Sun Nov 4 17:50:20 GMT 2018
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 8 MiB at 0x3ac00000
[    0.000000] On node 0 totalpages: 242688
[    0.000000] free_area_init_node: node 0, pgdat 80c85280, node_mem_map ba39f000
[    0.000000]   Normal zone: 2133 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 242688 pages, LIFO batch:31
[    0.000000] percpu: Embedded 17 pages/cpu @ba348000 s38720 r8192 d22720 u69632
[    0.000000] pcpu-alloc: s38720 r8192 d22720 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 240555
[    0.000000] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1280 bcm2708_fb.fbheight=1024 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=f62c4625-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 940232K/970752K available (7168K kernel code, 576K rwdata, 2076K rodata, 1024K init, 698K bss, 22328K reserved, 8192K cma-reserved)
[    0.000000] Virtual kernel memory layout:
vector  : 0xffff0000 - 0xffff1000   (   4 kB)
fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
vmalloc : 0xbb800000 - 0xff800000   (1088 MB)
lowmem  : 0x80000000 - 0xbb400000   ( 948 MB)
modules : 0x7f000000 - 0x80000000   (  16 MB)
.text : 0x80008000 - 0x80800000   (8160 kB)
.init : 0x80b00000 - 0x80c00000   (1024 kB)
.data : 0x80c00000 - 0x80c9017c   ( 577 kB)
.bss : 0x80c97f04 - 0x80d468b0   ( 699 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 25287 entries in 75 pages
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns:<PHONE_NUMBER>67 ns
[    0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every<PHONE_NUMBER>078ns
[    0.000018] Switching to timer-based delay loop, resolution 52ns
[    0.000266] Console: colour dummy device 80x30
[    0.000284] console [tty1] enabled
[    0.000308] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000323] pid_max: default: 32768 minimum: 301
[    0.000643] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000657] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001593] Disabling memory control group subsystem
[    0.001671] CPU: Testing write buffer coherency: ok
[    0.002085] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002487] Setting up static identity map for 0x100000 - 0x10003c
[    0.002609] Hierarchical SRCU implementation.
[    0.003284] smp: Bringing up secondary CPUs ...
[    0.004062] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.004901] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.005721] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.005826] smp: Brought up 1 node, 4 CPUs
[    0.005837] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.005842] CPU: All CPU(s) started in HYP mode.
[    0.005846] CPU: Virtualization extensions available.
[    0.006771] devtmpfs: initialized
[    0.017002] random: get_random_u32 called from bucket_table_alloc+0xfc/0x24c with crng_init=0
[    0.017767] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.017989] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns:<PHONE_NUMBER>2750000 ns
[    0.018007] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.018559] pinctrl core: initialized pinctrl subsystem
[    0.019304] NET: Registered protocol family 16
[    0.022056] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.026933] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.026941] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.027148] Serial: AMBA PL011 UART driver
[    0.028807] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.029268] uart-pl011 3f201000.serial: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[    0.061055] bcm2835-dma 3f007000.dma: DMA legacy API manager at bb813000, dmachans=0x1
[    0.062480] SCSI subsystem initialized
[    0.062698] usbcore: registered new interface driver usbfs
[    0.062750] usbcore: registered new interface driver hub
[    0.062839] usbcore: registered new device driver usb
[    0.070086] raspberrypi-firmware soc:firmware: Attached to firmware from 2018-11-04 16:31
[    0.071506] clocksource: Switched to clocksource arch_sys_counter
[    0.148489] VFS: Disk quotas dquot_6.6.0
[    0.148571] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.148758] FS-Cache: Loaded
[    0.148940] CacheFiles: Loaded
[    0.156880] NET: Registered protocol family 2
[    0.157602] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.157712] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.157897] TCP: Hash tables configured (established 8192 bind 8192)
[    0.158025] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.158070] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.158297] NET: Registered protocol family 1
[    0.158762] RPC: Registered named UNIX socket transport module.
[    0.158768] RPC: Registered udp transport module.
[    0.158774] RPC: Registered tcp transport module.
[    0.158779] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.160425] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.163174] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.171105] FS-Cache: Netfs 'nfs' registered for caching
[    0.171739] NFS: Registering the id_resolver key type
[    0.171769] Key type id_resolver registered
[    0.171774] Key type id_legacy registered
[    0.171789] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.173707] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.173836] io scheduler noop registered
[    0.173842] io scheduler deadline registered (default)
[    0.174009] io scheduler cfq registered
[    0.174016] io scheduler mq-deadline registered
[    0.174022] io scheduler kyber registered
[    0.176730] BCM2708FB: allocated DMA memory fad10000
[    0.176756] BCM2708FB: allocated DMA channel 0 @ bb813000
[    0.213670] Console: switching to colour frame buffer device 160x64
[    0.236425] bcm2835-rng 3f104000.rng: hwrng registered
[    0.236558] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    0.237023] vc-sm: Videocore shared memory driver
[    0.237297] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    0.246844] brd: module loaded
[    0.255654] loop: module loaded
[    0.255668] Loading iSCSI transport class v2.0-870.
[    0.256354] libphy: Fixed MDIO Bus: probed
[    0.256456] usbcore: registered new interface driver lan78xx
[    0.256509] usbcore: registered new interface driver smsc95xx
[    0.256525] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.284419] dwc_otg 3f980000.usb: base=0xf0980000
[    0.484637] Core Release: 2.80a
[    0.484646] Setting default values for core params
[    0.484678] Finished setting default values for core params
[    0.684937] Using Buffer DMA mode
[    0.684944] Periodic Transfer Interrupt Enhancement - disabled
[    0.684949] Multiprocessor Interrupt Enhancement - disabled
[    0.684956] OTG VER PARAM: 0, OTG VER FLAG: 0
[    0.684967] Dedicated Tx FIFOs mode
[    0.685301] WARN::dwc_otg_hcd_init:1046: FIQ DMA bounce buffers: virt = 0xbad04000 dma = 0xfad04000 len=9024
[    0.685327] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[    0.685334] dwc_otg: Microframe scheduler enabled
[    0.685388] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x805ea470
[    0.685399] WARN::hcd_init_fiq:460: FIQ ASM at 0x805ea7d8 length 36
[    0.685412] WARN::hcd_init_fiq:486: MPHI regs_base at 0xf0006000
[    0.685464] dwc_otg 3f980000.usb: DWC OTG Controller
[    0.685498] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    0.685530] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[    0.685579] Init: Port Power? op_state=1
[    0.685584] Init: Power Port (0)
[    0.685781] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.685792] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.685801] usb usb1: Product: DWC OTG Controller
[    0.685809] usb usb1: Manufacturer: Linux 4.14.79-v7+ dwc_otg_hcd
[    0.685817] usb usb1: SerialNumber: 3f980000.usb
[    0.686427] hub 1-0:1.0: USB hub found
[    0.686465] hub 1-0:1.0: 1 port detected
[    0.687001] dwc_otg: FIQ enabled
[    0.687006] dwc_otg: NAK holdoff enabled
[    0.687011] dwc_otg: FIQ split-transaction FSM enabled
[    0.687023] Module dwc_common_port init
[    0.687279] usbcore: registered new interface driver usb-storage
[    0.687455] mousedev: PS/2 mouse device common for all mice
[    0.687527] IR NEC protocol handler initialized
[    0.687533] IR RC5(x/sz) protocol handler initialized
[    0.687537] IR RC6 protocol handler initialized
[    0.687542] IR JVC protocol handler initialized
[    0.687547] IR Sony protocol handler initialized
[    0.687553] IR SANYO protocol handler initialized
[    0.687558] IR Sharp protocol handler initialized
[    0.687563] IR MCE Keyboard/mouse protocol handler initialized
[    0.687568] IR XMP protocol handler initialized
[    0.688244] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    0.688502] bcm2835-cpufreq: min=600000 max=1200000
[    0.688855] sdhci: Secure Digital Host Controller Interface driver
[    0.688860] sdhci: Copyright(c) Pierre Ossman
[    0.689202] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    0.689527] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    0.689620] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.691044] ledtrig-cpu: registered to indicate activity on CPUs
[    0.691232] hidraw: raw HID events driver (C) Jiri Kosina
[    0.691347] usbcore: registered new interface driver usbhid
[    0.691352] usbhid: USB HID core driver
[    0.692141] vchiq: vchiq_init_state: slot_zero = bad80000, is_master = 0
[    0.693626] [vc_sm_connected_init]: start
[    0.702969] [vc_sm_connected_init]: end - returning 0
[    0.703591] Initializing XFRM netlink socket
[    0.703615] NET: Registered protocol family 17
[    0.703713] Key type dns_resolver registered
[    0.704245] Registering SWP/SWPB emulation handler
[    0.704830] registered taskstats version 1
[    0.710613] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    0.710690] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    0.712486] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    0.712496] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    0.772152] sdhost: log_buf @ bad07000 (fad07000)
[    0.807825] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    0.809395] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.810963] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.813751] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    0.851538] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    0.852564] of_cfs_init
[    0.852657] of_cfs_init: OK
[    0.853229] Waiting for root device PARTUUID=f62c4625-02...
[    0.891107] random: fast init done
[    0.901622] Indeed it is in host mode hprt0 = 00021501
[    0.990429] mmc1: new high speed SDIO card at address 0001
[    0.998651] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.001258] mmc0: new high speed SDHC card at address 1388
[    1.001733] mmcblk0: mmc0:1388 USD00 14.7 GiB
[    1.003125]  mmcblk0: p1 p2
[    1.032945] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.032995] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    1.033692] devtmpfs: mounted
[    1.037201] Freeing unused kernel memory: 1024K
[    1.111554] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.111677] Indeed it is in host mode hprt0 = 00001101
[    1.361851] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.361865] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.362559] hub 1-1:1.0: USB hub found
[    1.362637] hub 1-1:1.0: 5 ports detected
[    1.535105] systemd[1]: System time before build time, advancing clock.
[    1.653980] NET: Registered protocol family 10
[    1.655038] Segment Routing with IPv6
[    1.664651] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.681588] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.682167] random: systemd: uninitialized urandom read (16 bytes read)
[    1.687837] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    1.688407] systemd[1]: Detected architecture arm.
[    1.689216] systemd[1]: Set hostname to .
[    1.729619] random: systemd: uninitialized urandom read (16 bytes read)
[    1.749359] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read)
[    1.811935] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.811951] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.814729] smsc95xx v1.0.6
[    1.904996] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:c5:c2:21
[    2.001574] usb 1-1.2: new low-speed USB device number 4 using dwc_otg
[    2.119870] systemd[1]: Listening on udev Kernel Socket.
[    2.120956] systemd[1]: Created slice User and Session Slice.
[    2.121254] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.121476] systemd[1]: Listening on fsck to fsckd communication Socket.
[    2.122379] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    2.143366] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    2.143782] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.154482] usb 1-1.2: New USB device found, idVendor=413c, idProduct=2003
[    2.154499] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.154508] usb 1-1.2: Product: Dell USB Keyboard
[    2.154518] usb 1-1.2: Manufacturer: Dell
[    2.173811] input: Dell Dell USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:413C:2003.0001/input/input0
[    2.210800] i2c /dev entries driver
[    2.242846] hid-generic 0003:413C:2003.0001: input,hidraw0: USB HID v1.10 Keyboard [Dell Dell USB Keyboard] on usb-3f980000.usb-1.2/input0
[    2.541627] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
[    2.676238] usb 1-1.3: New USB device found, idVendor=041e, idProduct=3f0e
[    2.676254] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.676263] usb 1-1.3: Product: E-MU XMidi1X1 Tab
[    2.676271] usb 1-1.3: Manufacturer: E-MU Systems,Inc.
[    2.676281] usb 1-1.3: SerialNumber: E-MU-E6-3F0E-07D90A1E-1014A-TAB
[    2.718784] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    2.776346] usb 1-1.4: new full-speed USB device number 6 using dwc_otg
[    2.819340] systemd-journald[93]: Received request to flush runtime journal from PID 1
[    2.902257] usbcore: registered new interface driver snd-usb-audio
[    2.905477] usb 1-1.4: New USB device found, idVendor=1b1c, idProduct=1b2f
[    2.905496] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.905506] usb 1-1.4: Product: Corsair Gaming SABRE RGB Mouse
[    2.905517] usb 1-1.4: Manufacturer: Corsair
[    2.905526] usb 1-1.4: SerialNumber: 07036031AEB8046955A19679F5001945
[    2.911435] input: Corsair Corsair Gaming SABRE RGB Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:1B1C:1B2F.0002/input/input1
[    2.912023] hid-generic 0003:1B1C:1B2F.0002: input,hidraw1: USB HID v1.11 Mouse [Corsair Corsair Gaming SABRE RGB Mouse] on usb-3f980000.usb-1.4/input0
[    2.918600] input: Corsair Corsair Gaming SABRE RGB Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:1B1C:1B2F.0003/input/input2
[    2.982452] hid-generic 0003:1B1C:1B2F.0003: input,hiddev96,hidraw2: USB HID v1.11 Mouse [Corsair Corsair Gaming SABRE RGB Mouse] on usb-3f980000.usb-1.4/input1
[    2.982851] usbhid 1-1.4:1.2: couldn't find an input interrupt endpoint
[    3.788638] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    3.801170] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[    4.023256] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[    4.030423] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdio.bin for chip 0x00a9a6(43430) rev 0x000001
[    4.030711] usbcore: registered new interface driver brcmfmac
[    4.297372] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2017 03:55:53 version <IP_ADDRESS> (r674442 CY) FWID 01-e58d219f
[    4.298327] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:14
[    5.133214] random: crng init done
[    5.133231] random: 7 urandom warning(s) missed due to ratelimiting
[    5.155443] uart-pl011 3f201000.serial: no DMA platform data
[    5.622576] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    5.622748] brcmfmac: power management disabled
[    6.145177] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[    6.146163] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    6.390742] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[    6.632564] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[    9.625522] Bluetooth: Core ver 2.22
[    9.625726] NET: Registered protocol family 31
[    9.625733] Bluetooth: HCI device and connection manager initialized
[    9.627740] Bluetooth: HCI socket layer initialized
[    9.627771] Bluetooth: L2CAP socket layer initialized
[    9.627830] Bluetooth: SCO socket layer initialized
[    9.652920] Bluetooth: HCI UART driver ver 2.3
[    9.652931] Bluetooth: HCI UART protocol H4 registered
[    9.652935] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    9.653135] Bluetooth: HCI UART protocol Broadcom registered
[    9.995280] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.995287] Bluetooth: BNEP filters: protocol multicast
[    9.995303] Bluetooth: BNEP socket layer initialized
[   10.038825] Bluetooth: RFCOMM TTY layer initialized
[   10.038844] Bluetooth: RFCOMM socket layer initialized
[   10.038868] Bluetooth: RFCOMM ver 1.11
[   11.582196] fuse init (API version 7.26)
[ 1452.435117] usb 1-1.4: USB disconnect, device number 6
pi@raspberrypi:~ $
I can see my midi interface when i run aconnect -l
pi@raspberrypi:~ $ aconnect -l
client 0: 'System' [type=kernel]
0 'Timer           '
1 'Announce        '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 20: 'E-MU XMidi1X1 Tab' [type=kernel,card=1]
0 'E-MU XMidi1X1 Tab MIDI 1'
pi@raspberrypi:~ $
Ideas?

Hi,
Can you send me the output of those commands ?
$ lsmod | grep midi
$ find /dev -name "*midi*"
Thanks.

pi@raspberrypi:~ $ lsmod | grep midi
snd_usbmidi_lib        32768  1 snd_usb_audio
snd_rawmidi            32768  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
snd                    69632  10 snd_hwdep,snd_usb_audio,snd_timer,snd_rawmidi,snd_usbmidi_lib,snd_seq_device,snd_bcm2835,snd_pcm
pi@raspberrypi:~ $ find /dev -name "midi"
/dev/snd/midiC1D0

OSS modules doesn't seems to be loaded for this.
Change this line in config.py  :
mididev = '/dev/snd/midiC1D0'
It's been a while since I have to know the ruling about ALSA naming convention.

That helped. I can run the pilink.sh from terminal without getting that error. Here is the new output, does this seem right?
pi@raspberrypi:~/pilink $ ./pilink.sh
[[[ pilink ]]]
LISTENING UDP PORT 8000
Now when I use the web interface and try to select my midi device nothing is listed. Also I have yet to successfully connect to the PI with TouchOSC.

<IP_ADDRESS> is normal if your browser is running on the Raspberry Pi.
I've commited a fix to find other midi devices within the /dev directory.

So I got pilink working as far as connecting to it via touchosc and I am logging messages from my tablet, but I still cant get it to actually send anything out my midi device. I have /dev/snd/midiC1D0 selected on the web interface. Ideas? Thanks again for all of your help!


Unsupported MIME type: application/octet-stream. Supported types: image/jpeg, image/gif, image/png, image/svg+xml, image/tiff, image/bmp

I think it wont read the file from key properly.
I have the image in its location but every time this happens

Hey @thevisionhouse, appreciate if you can share more details

I mean if the image is in the root of bucket then its working fine. But if the image is in nested folder it can read the image but shows error of mime type.
https:///100x100/auction/15/1644492516305.png
Here the image is there but it shows mime error. But if the same image I am putting in root of the bucket it works.


add stampit.getStampOf method

It might be useful to add a method for getting the stamp of an instance (e.g. stampit.getStampOf)
Consider this use case: I want to add a Cloner mixin, which just adds a clone method to a stamp. I would like to write something like:
var Cloner = stampit().methods({
  clone: function() {
    var stamp = stampit.getStampOf(this)
    return stamp(this)
  }
})

Right now, I have to do a mixin factory:
var ClonerFactory = function(stamp) {
  return stampit().methods({
    clone: function() {
      return stamp(this)
    }
  })
}

But adding it as a mixin to another stamp is not straightforward:
var SomeStamp = stampit()
  .state({ ... })
  .methods({ ... })

SomeStamp = SomeStamp.compose(ClonerFactory(SomeStamp))

instead of:
var SomeStamp = stampit()
  .state({ ... })
  .methods({ ... })
  .compose(Cloner)

First of all, it is always interesting to understand why you need this?
Second, you what something similar to instaceof. Correct?

Well, not really instanceof, more like constructor. I think it's useful to have access to the factory method of an instance, so you can create another similar instance (as in my example). But, if this is not in the spirit of the library, I can understand.

This seems really application specific, to me. The only use-case I can think of is to add a .clone() method to instances -- something you don't need if you have the stamp in-scope.
Your .clone() method is also a bit awkwardly named, because it doesn't create a clone of the current instance -- instead, it creates a fresh instance based on the stamp -- without the current instance's state.
Am I missing something that would make this more generally usable? Maybe specific use-cases? Why is the .clone() method you describe useful? Why not just use the stamp to create new instances, instead?

It is rather cheap to add one more reference per each stamp (aka prototype). I'd add this feature if I was the boss. :)
I believe I will start my own fork of stampit. Not because of this feature, but because we do not iterate fast enough.  But I would like step out as a co-maintainer of this module.

@koresar As a maintainer, you have the power to bring in other contributors to review your commits. You don't need to fork.
Don't wait around for me. Have a buddy review your commits and merge them in.

@ericelliott I was thinking of cases when you don't have the stamp in scope (such as when getting an instance as a parameter in another function, in another module), and you don't want to mutate the received instance, instead you want to return a new instance.
My .clone method works, since it does stamp(this) which copies the state from this instance (and also any overridden methods).
Anyway, maybe I rushed a little, I should use the library more, so I can find a relevant use case. So far I've just played with it, and I really enjoy it.

I, actually, like the idea of having that function. There is little memory penalty, but, as Eric says, "this is not your bottleneck". :)

I think something equivalent to setting a constructor property on a prototype in vanilla js would be very useful. The .clone() described has limited functionality as it doesn't give you direct access to the stamp and it copies overridden methods. Also the name clone is somewhat deceptive as it does not deep copy. I think it would be much more useful to have access to the stamp that created the object instance. Then you could check what stamp created the instance or create another instance using the same stamp.
I propose adding a stamp property with the same purpose as the constructor property commonly used in vanilla js (not sure exactly what the property key would be, maybe something stronger like 'STAMP').

var thing = stampit()
  .state({ ... })
  .methods({ ... })

var myThing = thing();

var myThingsStamp = myThing.stamp;

myThingsStamp === thing; // true

var myOtherThing = myThingsStamp();

// in the case of copying instance properties you could simply do

var myModifiedThing = myThingsStamp(myThing);

We are definitely not adding the 'stamp' property to each created object. That's an unexpected explicit behaviour which might and would lead to hidden bugs.

Are there any alternative ways to figure out the stamp that created an object instance?

Nothing inbuilt, but there are many ways to implement it yourself for any particular stamp.

My $0.02 -- the programmer should have 100% control over what the stamp creates. If we can make it easier to add a .getStamp() method to the object instances, that's cool, but Stampit shouldn't add it to the instances directly.

We are definitely not adding the 'stamp' property to each created object. That's an unexpected explicit behaviour which might and would lead to hidden bugs.

:+1:

I can see the problems it would cause. I would be happy with any solution that lets you easily set a function that gets the stamp from the instance.

Maybe we should add an ES6 Symbol('stamp') to the prototype. Consider the following unit test:
let myStamp = stampit();
let myObject = myStamp({ stamp: "this is a regular property" });

let stampSymbol = Object.getOwnPropertySymbols(myObject.prototype)[0];
assert(myObject[stampSymbol] === myStamp);

After that, we can implement stampit.getStampOf(myObject). Something like this (I hope I got the syntax right).
stampit.getStampOf = (obj) => {
  let symbols = Object.getOwnPropertySymbols(myObject.prototype);
  if (symbols.length === 1 && symbols[0] == "stamp") {
    return myObject[symbols[0]];
  }
};

I'm still getting familiar with ES6. Can you walk me through exactly what's going on in that code? I'm having trouble running it with Traceur: TypeError: Cannot read property 'prototype' of undefined
How would that compile back to ES5?
Of course we can't use features that won't compile back to ES5 for browser compatibility. =|

For this to work, we'd need to polyfill .getOwnPropertySymbols for browsers that don't support symbols, yet.

True. I have just thrown an idea. Other than symbol we could use a "very very hidden property" so to say. :)
let myStamp = stampit();
let myObject = myStamp({ stamp: "this is a regular property" });

let stampSymbol = myObject.prototype.__stamp__;
assert(myObject[stampSymbol] === myStamp);

And then:
stampit.getStampOf = (obj) => {
  let stamp = myObject.prototype.__stamp__;
  if (stampit.isStamp(stamp) {
    return stamp;
  }
};

update: heavily changed the comment above.

This is exactly what I recommended and you said was not a good idea.

var stamp = myObject.prototype.__stamp__;

There is no myObject.prototype property unless you create one. [[Prototype]] is not a property on an instance. It is available on a constructor function, but Stampit doesn't use them.

Authors need full control over the object being created. We should not add properties to the object instances, hidden or otherwise. If the author wants to add a reference to the stamp, they can do so with .enclose().

Let me workaround this. How about new utility method for each stamp?
stamp.hasCreated = function (obj) {
  return obj.__proto__ === this.fixed.methods;
};

This should work as we are using the fixed.methods property as a prototype for objects. Eric?

Maybe we should make stamps "plugin-able". We can allow people to hook into the function factory().
var clonableStamp = stampit("stampit");
clonableStamp.on("ctreated", function (obj, stamp) {
  obj.clone = function () { return stamp(obj); }
});

// and usage
var myShinyStamp = stampit({ whatever: 42 });
var myShinyClonableStamp = myShinyStamp.compose(clonableStamp); // merges 'on()' events
var myShinyObject = myShinyClonableStamp();
var IAmClone = myShinyObject.clone(); // we have clone() method in each object!
assert(IAmClone.whatever === 42);

@zaboco You can workaround current stampit limitations by hacking the stamp.fixed object.
function makeClonable(stamp) {
  stamp.fixed.methods.clone = function () { return stamp(this); };
}

// and usage
var SomeStamp = makeCloneable(stampit({ /*state*/ }, { /*methods*/ }));

Maybe we should make stamps "plugin-able". We can allow people to hook into the function factory().
var clonableStamp = stampit();
clonableStamp.on("ctreated", function (obj, stamp) {
  obj.clone = function () { return stamp(obj); }
});

// and usage
var myShinyStamp = stampit({ whatever: 42 });
var myShinyClonableStamp = myShinyStamp.compose(clonableStamp); // merges 'on()' events
var myShinyObject = myShinyClonableStamp();
var IAmClone = myShinyObject.clone(); // we have clone() method in each object!
assert(IAmClone.whatever === 42);

All the suggestions so far have sounded pretty ugly to me. Lifecycle hooks are much better, but how is this different from .enclose()? You get stamp() passed in?

Yes. We got both stamp and the created object in the same function scope.
The function factory() is closed from an outside intrusion, but it is the only place where we have access to both stamp and object.

I see, and we can't just pass the stamp into .enclose() functions because we pass the args in. We should have just passed an options object in. My bad.
I'm cool with it if you want to add a created lifecycle hook, but I think we should pass a named options hash into it and deprecate .enclose() (the name confuses people anyway).
Basically make it the flexible method that .enclose() should have been. =)
Named options:

instance
stamp
args

Thanks to ES6 destructuring, using them is almost as convenient as using formal params:
function foo ({ param1, param2, param3}) {
  console.log(param1, param2, param3);
}

foo({param1: 'foo', param2: 'bar', param3: 'baz'}); // logs foo bar baz

This way we leave the created hook open for extension like .enclose() should have been. ;)
Thoughts?

I suppose we could also still make instance available as this.

I think init or initialize would be a good names. Technically the refs and props are for initializing as well but this is where initialization code would go right?

Eric, I was thinking of this solution but was afraid to break backwards compatibility. Although, the enclose() arguments is a rather new feature. There should be few people using it.
init() would be the good name for the new alias.
this and instance should be both available IMO.

I am not sure if a full event system is necessary. What cases other than created are there?
A very simple solution would be:
// .init() aka .enclose()
var stamp = stampit().init(function(settings, stamp){ });

This would break backward compatibility though. I don't remember if it was decided to make the factory args a settings hash or not.

Ok, let's implement the Eric design in v2_0.

My logic for avoiding .init() in the first place was that users might think that's the way to define initialization logic, and I was hoping we could train users to separate instantiation from initialization more. For example, my favorite way to initialize private vars is this:
var f = stampit().enclose(function() {
  var name;

  return stampit.mixIn(this, {
    // Getter and setter for name:
    name: function (value) {
      if (value) {
        name = value;
        return this;
      }
      return name;
    }
  });
});

// f() instantiates and returns the instance.
// .name('foo') initializes the private variable.
var thing = f().name('foo');
thing.name(); // 'foo'

Note that the initialization doesn't actually happen until you call the instance's .name() method.
Maybe I was wrong, though, because .enclose() does seem to confuse users a lot more than I anticipated. );

So we don't have to deprecate yet another method, I'm going to insist that we pass an options hash instead of a list of formal params:
NOT THIS
var stamp = stampit().init(function(settings, stamp){ });

Ah, this is better...
var stamp = stampit().init(function({instance, stamp, args}){ });

In ES5...
var stamp = stampit().init(function(options){ /* instance, stamp, and args are available on options obj */});

I've created #62 to address this. Eric, feel free to edit #62. Whatever name the enclose-init would have I agree to any one.
IMO, init is a good name because this is actually what it's for - initialization of an instance. But, again. I'm happy with any name.

@zaboco I will close this issue as we are going to implement #62. Please, feel free to open a new one if necessary.

@koresar ok, #62 sounds nice


Expanded sync statistics

Description
Expands sync statistics for the Aion Kernel to produce a more comprehensive set that helps users and developers better monitor the Kernel. This PR covers feature requirements defined on issue #661:

The percentage of requests made to each peer with respect to the total number of requests made.
A list of peers ordered by the total number of blocks received from each peer.
A list of peers ordered by the total number of blocks requested by each peer.
Average response time between sending requests out and that peer responding shown for each peer and averaged for all peers.
Methods have to be implemented in SyncStats.java, while information should be printed in TaskShowStatus.java under debug logging.

Type of change
Insert x into the following checkboxes to confirm (eg. [x]):

[ ] Bug fix.
[X] New feature.
[ ] Enhancement.
[X] Unit test.
[ ] Breaking change (a fix or feature that causes existing functionality to not work as expected).
[ ] Requires documentation update.

Testing
Unit tests for each method implemented in SyncStats.java that return stats summaries were implemented in class org.aion.zero.impl.sync.SyncStatsTest.java. They can be run locally using the following commands:
$ cd modAionImpl/
$ ../gradlew test --tests org.aion.zero.impl.sync.SyncStatsTest --info

Verification
Insert x into the following checkboxes to confirm (eg. [x]):

[X] I have self-reviewed my own code and conformed to the style guidelines of this project.
[X] New and existing tests pass locally with my changes.
[X] I have added tests for my fix or feature.
[ ] I have made appropriate changes to the corresponding documentation.
[X] My code generates no new warnings.
[X] Any dependent changes have been made.

The fix solved the exception issue. I did notice however one more issue, the code is actually listing the seeds twice, instead of the leeches. The statistics for leeches should be gathered from ReqBlocksBodiesHandler instead of ResBlocksBodiesHandler. The first class handles block requests received from the network and creates replies to those requests (i.e. leeches). The second handles the responses made to the requests sent out by the node (i.e. seeds). For a node starting to sync from an empty database, I would expect to see almost no data for the leeches.

I've updated the leechers block requests stats as required.

since it wasn't part of the bounty, we will determine internally where this information should be logged or if we add a new configuration option for displaying the stats


Check for isFinishedLaunching when initializing an Application from NSRunningApplication

In my app I'm listening to didActivateApplicationNotification notifications and then add AXObserver to the app that was activated.
I've noticed that in some scenarios I got UnknownUIElement errors when I was trying to add an observable right after launching Chrome.
I think this is due to the fact that chrome has isFinishedLaunching = false when activated.
The solution for me is to listen for another additional event (didLaunchApplicationNotification), but you may want to consider adding a check for isFinishedLaunching in Application initializers.

Thanks, I'll consider it. I don't know if that behavior is documented anywhere so I can verify I'm doing the right thing, but that's true for a lot of aspects of these APIs.
If initialized with only a process ID, we should document that we don't check this, either.


send_multicast causes 404 response

Describe the bug
404 Response when using send_multicast using the newest version. It works fine on 3.3.0.
To Reproduce
Use send_multicast method.
Additional context
Logs:
[INFO] HTTP Request: POST https://oauth2.googleapis.com/token "HTTP/1.1 200 OK"
[INFO] HTTP Request: POST https://fcm.googleapis.com/v1/projects/xxxxxxxxx/messages%3Asend/batch "HTTP/1.1 404 Not Found"
[WARNING] Unexpected HTTP response with status: 404; body: b''

Thanks!

Hello @Narquadah,
I will take a look at it.


Fix(useVirtual): do not trigger onScroll and loadMore by internally scroll-to method

Fix(useVirtual): do not trigger onScroll and loadMore by internally scroll-to method

Pull Request Test Coverage Report for Build 951974512

7 of 13 (53.85%)  changed or added relevant lines in 1 file are covered.
3 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-2.6%) to 51.54%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/useVirtual.ts
7
13
53.85%

Files with Coverage Reduction
New Missed Lines
%

src/useVirtual.ts
3
41.73%

Totals

Change from base Build 951815200:
-2.6%

Covered Lines:
182

Relevant Lines:
284

💛  - Coveralls


Add option to run under specific UID/GID

Is this possible right now? Can't find. I'm not all too comfortable running it as root. That would be a great addition!

I think that this might relate to issues, where plugin dependencies cannot get installed. Since the scripts only get called on container start, I don't see much potential for container takeovers. Do you have any special concerns or see potential attacks?

My concerns are not specifically to homebridge per se, but it was proven before that it's possible to get out of the container, so I got used to not run anything that is not needed as root inside Docker.
If you take a look at linuxserver.io containers, you can pass environment variables (UID/GID) to the container and it will do all necessary things as root (like installing scripts) but whenever run the actual program (homebridge in this case), they switch the id/gid to whatever you specified on the variables. This seems like a sensible approach that might be applicable to this case, I guess.

I can understand you concerns, but won't be able to add such feature via env variable any time soon. Feel free to add a PR!


[firebase_messaging] data message arrives on the native side, but is not delivered to the Dart side

Using firebase_messaging: ^5.1.6 plugin in my application, I noticed that when the app is in the background, sometimes the messages do not reach "the destination", so i decided to do some "tracking".
In the file FlutterFirebaseMessagingService.java, at the method executeDartCallbackInBackgroundIsolate i added
"Log.i(TAG, "before handleBackgroundMessage")":
    ...
    Log.i(TAG, "before handleBackgroundMessage");
    args.put("message", messageData);
    backgroundChannel.invokeMethod("handleBackgroundMessage", args, result);
    ...

In the file firebase_messaging.dart , at the method setMethodCallHandler i added
"print('Received in Dart!');":
  backgroundChannel.setMethodCallHandler((MethodCall call) async {
    print('Received in Dart!');
    if (call.method == 'handleBackgroundMessage') {
    ...

To do some testing,  i send 4 data messages, while the app was in background.  2 of them arrived successfully in the app, but the last 2 didn't, even they arrived to the java side:

If i "bring" the app in the foreground and send to it others data messages, the arrive successfully.
What could be the problem? Why the messages are not delivered always to the Dart side, when the app is in the background?

Hi @sd-timaru
Could you please provide your flutter doctor -v
and your your flutter run --verbose?
Thank you

Yes, but i just updated the flutter and dart plugin....
doc.txt
output.txt

Thank you @sd-timaru

I also experience this on my app.
A simple flutter logs on the connected device would show the creation of an observatory listener when a data message is received
I/flutter (24260): Observatory listening on http://<IP_ADDRESS>:46040/aO_xk0_pDeQ=/
But then the Dart background Message handler does not always execute

Hey all 👋
As part of our roadmap (#2582) we've just shipped a complete rework of the firebase_messaging plugin that aims to solve this and many other issues.
If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here.
Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin.
Thanks everyone.


added support for maximum expiration of a JWT token

Summary
Support for limiting the expiration period on JWT tokens.
In the JWT plugin you can set  the property 'maximum_expiration'  to a positive integer, indicating the maximum number of seconds between the 'nbf' and 'exp' claims in the token.
The purpose of this feature is to prevent the use of tokens with extreme long lifetimes.
Full changelog

Added the 'maximum_expiration' to the jwt plugin schema
Added a check in the handler
Added unit tests for handler and schema.

I like the idea here, but not all JWT's will include the exp and nbf, why not also make an if validating on if exp >= nginx.time + conf.valid_time or w/e you have if you want to keep token expiry an hour or less? It's something we implemented too to prevent clients from being irresponsible with their tokens.

I thought it would be cheaper to do the (exp -nbf) calculation. In addition, with (exp-nbf) I did not have to deal with clock skew.
I will change it, to use exp only. leaving the configuration of maximum_expiration to deal with possible clock skew..
Cheers,
Mark

@jeremyjpj0916 can you please review my pull request? Once it is integrated, I can stop merging the changes from master into this one 😃

@mvanholsteijn I don't have write access, I chimed in only because I was implementing a similar change personally and thought to bring up the scenario where just exp is exposed and to compare against ngx.time() , which is looks like you added that so overall I think this is a nice feature! Hopefully kong team agrees and will consider implementing it as it makes sense from a security perspective.

@jeremyjpj0916 I did not know you did not have write access :-)
We implemented this feature after an external security audit was performed on our API. They recommended to limit the lifetime of the jwt token.

@thibaultcha  Do you have any idea on when this PR might be reviewed?

@thibaultcha I processed all (but 1) remarks.

Merged with some modifications (testing, formatting, errors), thanks again for your contribution

@thibaultcha thank you for your support!


docs: fix @unocss/astro install command

@Nomango
https://github.com/unocss/unocss/blob/main/examples/astro/astro.config.ts using unocss/astro import path so install unocss looks good for me, any reason to change that to @unocss/astro?

Sorry for submitting this sloppy PR.
Yesterday, after installing unocss, I also installed astrojs/react, astrojs/vercel, and others. When I started it, I encountered an error saying Failed to load url unocss/astro, specifically in the import statement import UnoCSS from "unocss/astro". I resolved it by manually installing @unocss/astro.
However, today I couldn't reproduce this issue in the sandbox. It's more likely that I made a mistake with my own actions, so I'll close this PR for now.

@Nomango You can see more explanation in #2478.


Uncaught Error: Cannot call function 'getPosition' on missing remote object 96Error: Cannot call...

[Enter steps to reproduce:]

Install atom-ide-ui and ide-csharp packages
Restart Atom
Open a .cs file

Atom: 1.40.0 x64
Electron: 3.1.10
OS: Ubuntu 19.04
Thrown From: Atom Core
Stack Trace
Uncaught Error: Cannot call function 'getPosition' on missing remote object 96
Error: Cannot call function 'getPosition' on missing remote object 96
at throwRPCError (/usr/share/atom/resources/electron.asar/browser/rpc-server.js:145:17)
at EventEmitter. (/usr/share/atom/resources/electron.asar/browser/rpc-server.js:367:7)
at EventEmitter.emit (events.js:182:13)
at WebContents. (/usr/share/atom/resources/electron.asar/browser/api/web-contents.js:294:13)
at WebContents.emit (events.js:182:13)
At /usr/share/atom/resources/electron.asar/renderer/api/remote.js:219

Error: Cannot call function 'getPosition' on missing remote object 96
Error: Cannot call function 'getPosition' on missing remote object 96
    at throwRPCError (/usr/share/atom/resources/electron.asar/browser/rpc-server.js:145:17)
    at EventEmitter.<anonymous> (/usr/share/atom/resources/electron.asar/browser/rpc-server.js:367:7)
    at EventEmitter.emit (events.js:182:13)
    at WebContents.<anonymous> (/usr/share/atom/resources/electron.asar/browser/api/web-contents.js:294:13)
    at WebContents.emit (events.js:182:13)

    at metaToException (/usr/share/atom/resources/electron.asar/renderer/api/remote.js:271:17)
    at Object.exception (/usr/share/atom/resources/electron.asar/renderer/api/remote.js:219:30)
    at metaToValue (/usr/share/atom/resources/electron.asar/renderer/api/remote.js:223:28)
    at Object.remoteMemberFunction (/usr/share/atom/resources/electron.asar/renderer/api/remote.js:123:16)
    at AtomEnvironment.getWindowDimensions (/usr/share/atom/resources/app/static/<embedded>:1:705395)
    at AtomEnvironment.storeWindowDimensions (/usr/share/atom/resources/app/static/<embedded>:1:705810)
    at WindowEventHandler.handleWindowResize (/usr/share/atom/resources/app/static/<embedded>:11:285420)
    at l (/usr/share/atom/resources/app/static/<embedded>:11:1197399)

Commands

Non-Core Packages
atom-ide-ui 0.13.0
atom-material-syntax 1.0.8
atom-material-syntax-dark 1.0.0
atom-material-ui 2.1.3
autocomplete-unity 0.1.3
ide-csharp 0.6.2
seti-syntax 1.2.0
seti-ui 1.11.0

Thanks for contributing!
We noticed that this looks like a duplicate of https://github.com/atom/atom/issues/16630 so you can subscribe there for updates if you'd like (we believe that this will be fixed in a future Electron upgrade).
About your steps to reproduce, can you reproduce consistently with those steps?

Because we treat our issues list as the Atom team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.
For information on how to use GitHub's search feature to find out if something is a duplicate before filing, see the How Can I Contribute? section of the Atom CONTRIBUTING guide.


add_novel_topic_data_to_topic_entity_tag

Looks good! Thanks @ianlongden
A minor question: do we need to set unique=False in toptic_entity_tag_model.py?

Technically no, unique = false is the default, but by stating it it, it is just more obvious.

OK I see. Thanks @ianlongden


package testmethods clash with Platform Encryption limitations

Summary
We have enabled Platform Encryption on Account.Name; unfortunately, the apex test methods use SOQL that violates Platform Encryption rules:

LIKE operators

SELECT id FROM Account WHERE name LIKE :nameFilter
                              ^
ERROR at Row:1:Column:31
The operator like is not supported on an encrypted field
MA_ReportServiceTest:
 SELECT id FROM Account WHERE name LIKE :nameFilter
                              ^
ERROR at Row:1:Column:31
The operator like is not supported on an encrypted field

2.

  I suspect your test report will need new filters as you can't do Starts WIth operator on an encrypted field (only equality/inequality)
static void setup() {

        // get rid of any data that might be in our test report's filters
        String nameFilter = ACCOUNT_NAME_PREFIX + '%';
        delete [ SELECT id FROM Account WHERE name LIKE :nameFilter ];  // no-no w/ platform encryption

    }

Version of Mass Action Scheduler
2.3
Steps To Reproduce

Platform Encrypt (Deterministic - case insensitive) Account.Name
Install package (though in your case, step 1 will fail during configuration)

Expected Behavior

Package should install and not violate any Platform Encryption restrictions on SOQL in testmethods

Actual Result
see above text of error
Source Type

[ ] Reports
[ ] List Views
[X] SOQL Queries

Action Type

[ ] Process Builder & Flows
[ ] Workflow Rules
[ ] Email Alerts
[ ] Quick Actions
[X] Apex (testmethods)

Does your configuration use Named Credentials?
YES but n/a here

Hi @cropredyHelix,
Thanks for your interest in Mass Action Scheduler and for this report.
To confirm, you are blocked from installing the managed package because the org has Platform Encryption enabled on Account.Name field? I didn't realize the Apex tests would run on install, only at the time I create the package version.
Could you please share with me the exact steps you're using to install the package?
Thanks

To confirm, you are blocked from installing the managed package because the org has Platform Encryption enabled on Account.Name field? I didn't realize the Apex tests would run on install, only at the time I create the package version.

Me: YES  When you encrypt an OOTB field, SFDC scans the apex code looking for violations of encryption limitations/rules. It does not run the tests so only static SOQL is considered. Dynamic SOQL issues wouldn't be detected until code execution.  I ran into the exact same issue with Apttus Contract Management and had to wait for the vendor to update their package before we could go ahead and encrypt the OOTB field Account.Name
Me: Steps to reproduce
Precondition: Field Account.Name is encrypted (deterministic - case insensitive)

Go to GitHub, install Mass Action Scheduler

RESULT: Fails to install
In your case, as package developer, I'm 100% confident that if you attempt to encrypt Account.Name you will get the same errors as I outlined in the initial Issue description. You may get additional issues when your tests are run.
I think best practice  for the ISV/Open source package is to encrypt EVERY OOTB field, verify no configuration compliance issues, and then run tests to verify no runtime compliance issues.
Were SFDC to just encrypt at the SAN layer, these problems would go away but that is not a reality as of Winter 20.

@douglascayers - Known Issue fixed in Winter 21!

@douglascayers - Known Issue fixed in Winter 21!


Add array support using definitions in the _meta field.

Still needs a few more tests and discussion.
Fixes: #2441

BTW, we should add some docs describing what needs to be added to the mapping to declare an array field. Ideally, we could include some examples of calling ES APIs using curl.

I just pushed those changes. I'll start working on the docs.


Fixed issue with AC3.DD2.0 not working in audio tag

Fixed issue with audio tag not working with AC3.DD2.0


e2e,migration: Quarantine flaky compute-migration test

What this PR does
This flaky test has caused over 10% impact to the compute-migrations lane over the past 14 days and qualifies for quarantining[1]
Quarantine to give time for investigation.
https://github.com/kubevirt/kubevirt/issues/13143
[1] https://search.ci.kubevirt.io/?search=test_id%3A6980&maxAge=336h&context=1&type=bug%2Bissue%2Bjunit&name=&excludeName=&maxMatches=5&maxBytes=20971520&groupBy=job

Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Special notes for your reviewer
/cc @dhiller @fossedihelm @xpivarc

Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

[ ] Design: A design document was considered and is present (link) or not required
[ ] PR: The PR description is expressive enough and will help future contributors
[ ] Code: Write code that humans can understand and Keep it simple
[ ] Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
[ ] Upgrade: Impact of this change on upgrade flows was considered and addressed if required
[ ] Testing: New code requires new unit tests. New features and bug fixes require at least on e2e test
[ ] Documentation: A user-guide update was considered and is present (link) or not required. You want a user-guide update if it's a user facing feature / API change.
[ ] Community: Announcement to kubevirt-dev was considered

Release note

NONE

/override pull-kubevirt-unit-test-s390x
Not relevant to the PR and looks like the s390x cluster is not reachable.


Background observer is not working

I'm trying to implement background observers but it's not working.Followed updated documents for Background observers but still same issue.
Expected behavior
Should trigger the events for background observers.
Screenshots
This is my App.js file

Device:  iPhone 14 pro
OS: 16.4.1
Version : RN 0.67.3 and react-native-health - 1.14.0

I have same issue!

Did ya'll figure out this issue?

Is there any update?  same for  me.

@dipayanpalit15 @bewallyt @GGGava Is background observer working for  anyone?

Hey, I'll take a look on this tomorrow. But let me ask: Is the background capability on? Does the observer work when the app is on foreground? Thanks

@GGGava Background capability is on. Observers does not work even when app is on foreground.
@bewallyt observers didn't work even when phone was connected to macbook and it was charging. Added data to HK manually but that didn't work. observers didn't trigger in both simulator, real device. Also check in both dev and production build but not triggered.

Hey @dipayanpalit15  tested it locally and it seems the issue is with the Cycling observer. Not sure what is going on, I'll take a look later, but you can just use the Workout event: 'healthKit:Workout:new'. Cycling is a Workout, so works the same.
Let me know if the issue persists.
@Krupal5691 is your issue similar? What observer are you trying to use?

@Krupal5691 run the dev build thru xcode and add health data (e.g., create a workout event) in the apple health app. you should at the very least see the logs being sent thru xcode
like this
Sending `healthKit:MindfulSession:new` with no listeners registered.
[HealthKit] New sample from Apple HealthKit processed - MindfulSession healthKit:MindfulSession:new
[HealthKit] New sample received from Apple HealthKit - SleepAnalysis

make sure you're registering all events like this:
      [`healthKit:${observerType}:new`]: async () => {
        console.log(`${observerType}: in newSampleObserver - received a new sample`);
      },
      [`healthKit:${observerType}:failure`]: () => {
        console.log(`${observerType}: in newSampleObserver - new event failure`);
      },
      [`healthKit:${observerType}:setup:success`]: () => {
        console.log(`${observerType}: in newSampleObserver - setup success`);
      },
      [`healthKit:${observerType}:setup:failure`]: () => {
        console.log(`${observerType}: in newSampleObserver - setup failure`);
      },
      ```
      where observerType is `Workout`

@GGGava @bewallyt Observers are triggering while app is in foreground, I am getting log in console. But when I try it when app is in background, there is  no log for observer, instead all that logs are  coming when I  open the app from background.

@GGGava @bewallyt I am trying for below obsevers
StepCount
Cycling
HeartRate

Hi, I have a similar issue and have narrowed it down to the following
When setting AppleHealthKit.initHealthKit, it works - I will be able to get data - any data which I have got permissions allowed for.
If I set background observers, following new NativeEventEmitter(NativeModules.AppleHealthKit).addListener in scenarios
before, under (in delegate) or after permission asked - the observers will not fire.
HOWEVER, if I terminate the app and then reset/re-init the observers, now the notifications will fire in all cases.
That is not optimal ofcourse.

@mfagerdal I noticed the same behaviour just like the way you explained it.
In addition to that I archived a build from the same code and uploaded it to TestFlight and its observers are not working at all. Not even after terminating the app and then reset/re-init the observers.

@mfagerdal I noticed the same behaviour just like the way you explained it.
In addition to that I archived a build from the same code and uploaded it to TestFlight and its observers are not working at all. Not even after terminating the app and then reset/re-init the observers.

I'm experiencing the same behavior and haven't been able to get any type of listener to trigger while the app is in background. Has anyone had any success with this?

@swellander @KevinDeShawn Now I am able to trigger the observers in background mode even if app is killed by user.

Did y'all figure out this issue?

This is happening for me too. @Krupal5691's solution didn't work either. Observers only start working after allowing permissions and relaunching the app.

Facing the same issue... I'm surprised that such a crucial feature doesn't seem to work for the average person trying it. Is this a bug or is there a specific method for using the background observer that isn't well documented?

I am also facing the same issue, tried healthKit:StepCount:new, healthKit:StepCount:new but no success. Then I tried healthKit:Workout:new and then app triggers when we add workout session in health app manually. What I faced is when I manually adding steps/cycling/running/walking but app does not triggers in background or in killed state. Then I tried to add cycling/running/walking from workout session then it triggers.

new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
'healthKit:StepCount:new',
async () => {
try {
await trackerService.retrieveAndSendAllHealthDataFrom(0)
} catch (e){
}
},
);
new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
'healthKit:Cycling:new',
async () => {
try {
await trackerService.retrieveAndSendAllHealthDataFrom(0)
} catch (e){
}
},
);
new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
'healthKit:HeartRate:new',
async () => {
try {
await trackerService.retrieveAndSendAllHealthDataFrom(0)
} catch (e){
}
},
);
new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
'healthKit:Workout:new',
async () => {
try {
await trackerService.retrieveAndSendAllHealthDataFrom(0)
} catch (e){
}
},
);
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:StepCount:setup:success',
            async () => {
                // console.log('--> StepCount observer NativeEventEmitter setup success');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:Cycling:setup:success',
            async () => {
                // console.log('--> Cycling observer NativeEventEmitter setup success');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:HeartRate:setup:success',
            async () => {
                // console.log('--> HeartRate observer NativeEventEmitter setup success');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:Workout:setup:success',
            async () => {
                // console.log('--> Workout observer NativeEventEmitter setup success');
            },
        );

        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:StepCount:setup:failure',
            async () => {
                // console.log('--> StepCount observer NativeEventEmitter setup failure');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:Cycling:setup:failure',
            async () => {
                // console.log('--> Cycling observer NativeEventEmitter setup failure');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:HeartRate:setup:failure',
            async () => {
                // console.log('--> HeartRate observer NativeEventEmitter setup failure');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:Workout:setup:failure',
            async () => {
                // console.log('--> Workout observer NativeEventEmitter setup failure');
            },
        );

        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:StepCount:failure',
            async () => {
                // console.log('--> StepCount observer NativeEventEmitter failure');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:Cycling:failure',
            async () => {
                // console.log('--> Cycling observer NativeEventEmitter failure');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:HeartRate:failure',
            async () => {
                // console.log('--> HeartRate observer NativeEventEmitter failure');
            },
        );
        new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
            'healthKit:Workout:failure',
            async () => {
                // console.log('--> Workout observer NativeEventEmitter failure');
            },
        );

Hello, Is this still working for you? And please can I see your implementation for await trackerService.retrieveAndSendAllHealthDataFrom(0)

What worked for me was to add background modes capability => background processing in addition to the health kit's background capability, as shown in the screenshot.


Add error for no trailing slash

This pull request provides logic to return an error if there is no slash at the end of BaseURL or UploadURL.
Related comment:
https://github.com/google/go-github/pull/690#issuecomment-321879628

It looks like we made need to revert this change based on the comment in #690.
Thoughts, @shurcooL?

@gmlewis See my reply at https://github.com/google/go-github/pull/690#issuecomment-323884954. I don't think we need to revert it yet, because this change is no-op for correct programs. If could cause other problems if the trailing slash is not included, so reporting an error is helpful to catch those kinds of issues.
If we have a few other reports of this causing issues, we can reconsider or look for a better way to handle the situation. I think we should wait and not act based one report, since there's not enough information to make a good decision. I've asked for more info there so we can see what caused it.


Usage with HTTP Loader?

Given this request to store a shortened url:
curl -X "POST" "http://localhost:8888/shortener/http://localhost:8888/unsafe/300x200/http://1.bp.blogspot.com/-Xo5YM9JZD7A/UsDOLW8UrNI/AAAAAAACxts/RRvxCZ57WuY/s1600/9593308189_7bc9c93e05_b.jpg"

I get a 400 error. When adding some logging for the post handling, I see that the url gets its http:/ stripped off in the call to path_to_parameters
2016-05-11 18:09:50 thumbor:WARNING RequestParser#path_to_parameters path: http://localhost:8888/unsafe/300x200/http://1.bp.blogspot.com/-Xo5YM9JZD7A/UsDOLW8UrNI/AAAAAAACxts/RRvxCZ57WuY/s1600/9593308189_7bc9c93e05_b.jpg
2016-05-11 18:09:50 thumbor:WARNING {'trim': None, 'full': None, 'hash': 'http:', 'crop_top': None, 'crop_left': None, 'vertical_flip': None, 'image': '/localhost:8888/unsafe/300x200/http://1.bp.blogspot.com/-Xo5YM9JZD7A/UsDOLW8UrNI/AAAAAAACxts/RRvxCZ57WuY/s1600/9593308189_7bc9c93e05_b.jpg', 'crop_right': None, 'unsafe': None, 'crop_bottom': None, 'width': None, 'fit_in': None, 'meta': None, 'horizontal_flip': None, 'filters': None, 'valign': None, 'debug': None, 'adaptive': None, 'height': None, 'smart': None, 'halign': None}
2016-05-11 18:09:50 thumbor:WARNING Request denied because the specified path "/localhost%3A8888/unsafe/300x200/http%3A//1.bp.blogspot.com/-Xo5YM9JZD7A/UsDOLW8UrNI/AAAAAAACxts/RRvxCZ57WuY/s1600/9593308189_7bc9c93e05_b.jpg" was not identified by the loader as a valid path
2016-05-11 18:09:50 thumbor:WARNING No original image was specified in the given URL
2016-05-11 18:09:50 tornado.access:WARNING 400 POST /shortener/http://localhost:8888/unsafe/300x200/http://1.bp.blogspot.com/-Xo5YM9JZD7A/UsDOLW8UrNI/AAAAAAACxts/RRvxCZ57WuY/s1600/9593308189_7bc9c93e05_b.jpg (<IP_ADDRESS>) 4.77ms

Any hints on how to call the API?

Figured out how to call the api to generate a short url is with this call
curl -X "POST" "http://localhost:8888/shortener/unsafe/300x200/http://1.bp.blogspot.com/-Xo5YM9JZD7A/UsDOLW8UrNI/AAAAAAACxts/RRvxCZ57WuY/s1600/9593308189_7bc9c93e05_b.jpg"

Just as with the standard thumbor url, you start after shortener with the unsafe or signature, not with the full thumbor url.
However, by default, these urls are not any shorter, since it's using the original image-uri as part of the key.  If your goal is to shorten the full url, including thumbor params and image-uri, there is another config value SHORTENER_GENERATOR_PRESERVE_NAME = False to have the key be just the generated one, without the original image-uri.

@ryanwi it seems you answered your question, I'm closing this issue, feel free to re-open it if need be :)

yes, thank you @Bladrak. I've submitted a couple PRs that would have helped me with initial use.


createBitmapMask() is inconsistent when used on Shapes

Version

Phaser Version: 3.55.2

Description
When called on a Shape game object, createBitmapMask(shape) makes a working mask but createBitmapMask() doesn't.
Example Test Code
Given a Shape:
const rect = this.add.rectangle(0, 0, 200, 150, 0xffff00);

This makes a working mask:
const mask = rect.createBitmapMask(rect);

This doesn't:
const mask = rect.createBitmapMask();

Both calls succeed, but only the first mask has a visual effect.

#5918


3D Tiles - Support replace and mix color blend modes

For #3241
Per-feature colors now support 3 different blend modes with the source colors: highlight, replace, and mix. Highlight is the existing approach where the source color is multiplied by the feature's color. Replace takes the original color and replaces it with the feature color. Mix blends the original color and the feature color.
In order to correctly do replace and mix embedded glTFs must have a _3DTILESDIFFUSE semantic set on their diffuse parameter, otherwise it is very difficult to identify the diffuse color prior to lighting and any other operations in the shader. I added the semantic to some of our sample tilesets but still need to convert them all (including any other repos like https://github.com/AnalyticalGraphicsInc/3d-tiles-samples and https://github.com/AnalyticalGraphicsInc/3d-tiles-tools).
To test it out I added a multi-color tileset to the 3D Tiles demo. There is also a menu for selecting the color blend mode.
The code is still not complete. I need to finish up the tests and resolve some TODOs. The approach so far is when the tileset's colorBlendMode changes all the tiles are restyled. Cesium3DTileBatchTable stores the colorBlendMode for each tile so it's easy to recognize if the tile's shader needs to be recompiled. One of the biggest issues is we didn't have any code in place to recompile b3dm or i3dm shaders on the fly, which changing the colorBlendMode requires.
Right now pnts always use highlighting when they are batched, it's possible to support replace and mix but requires a different code path than the b3dm and i3dm because there is no concept of a diffuse uniform. I left this out until we feel the need to support it. Shader styling with per-point metadata is completely fine though and just ignores the colorBlendMode because the styling language allows you to access point colors directly with ${COLOR}.
Here's an example of a shader after the transformations in Cesium3DTileBatchTable. When the colorBlendMode is changed on the fly, the shader is just edited so tile_highlightDiffuse(tile_featureColor);  becomes tile_replaceDiffuse(tile_featureColor);
precision highp float;
varying vec3 v_normal;
uniform vec4 u_ambient;
uniform vec4 u_emission;
uniform vec4 u_specular;
uniform float u_shininess;
varying vec3 v_positionEC;
void tile_main(vec4 tile_diffuse) {
    vec3 normal = normalize(v_normal);
    vec4 color = vec4(0., 0., 0., 0.);
    float diffuseIntensity = 0.0;
    float specularIntensity = 0.0;
    vec4 diffuse = vec4(0., 0., 0., 1.);
    vec4 emission;
    vec4 ambient;
    vec4 specular;
    diffuse = tile_diffuse;
    ambient = diffuse * 0.5;
    emission = u_emission;
    specular = u_specular;
    vec3 normalizedpositionToEyeEC = normalize(-v_positionEC);
    diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normal);
    specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normal, u_shininess) +
           0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normal, u_shininess);
    color.xyz += ambient.xyz;
    color.xyz += diffuse.xyz * diffuseIntensity;
    color.xyz += specular.xyz * specularIntensity;
    color.xyz += emission.xyz;
    color = vec4(color.rgb * diffuse.a, diffuse.a);
    gl_FragColor = color;
}

uniform vec4 u_diffuse;
void tile_highlightDiffuse(vec4 tile_featureColor)
{
    vec4 diffuse = u_diffuse;
    tile_main(diffuse);
    gl_FragColor *= tile_featureColor;
}

void tile_replaceDiffuse(vec4 tile_featureColor)
{
    vec4 diffuse = (tile_featureColor.rgb == vec3(1.0)) ? u_diffuse : tile_featureColor;
    tile_main(diffuse);
    gl_FragColor.a *= tile_featureColor.a;
}

void tile_mixDiffuse(vec4 tile_featureColor)
{
    vec4 diffuse = u_diffuse;
    vec4 mixed = mix(diffuse, tile_featureColor, 0.5);
    diffuse = (tile_featureColor.rgb == vec3(1.0)) ? diffuse : mixed;
    tile_main(diffuse);
    gl_FragColor.a *= tile_featureColor.a;
}
varying vec4 tile_featureColor;
void main()
{
    tile_highlightDiffuse(tile_featureColor);
}

Here are some screenshots in action. This in the 3D Tiles demo so the style being applied is the height color ramp. When replacement is used you can see the style directly.
No style

Highlight

Replace

Mix

In order to correctly do replace and mix embedded glTFs must have a _3DTILESDIFFUSE semantic set on their diffuse parameter...

Please open a PR for the spec.

but still need to convert them all (including any other repos like https://github.com/AnalyticalGraphicsInc/3d-tiles-samples and https://github.com/AnalyticalGraphicsInc/3d-tiles-tools).

Perhaps add a tasklist to this PR.

Right now pnts always use highlighting when they are batched...I left this out until we feel the need to support it

This is all good because this is just the Cesium API.  It has nothing to do with fully implementing the 3D Tiles spec.

What is the use case for mix?  Are we sure it is useful given that 0.5 is hardcoded?

Can we disable the dropdown in Sandcastle when appropriate?

CC @pmconne

Updated - I am much happier with the new approach. I still need to address the relevant TODOs.

Big +1 on the new approach.  Let me know when this is ready for the next review.

Almost ready to go. The textured test is in but I need to add the _3DTILESDIFFUSE semantic to an instanced tileset.

Ok @pjcozzi this is ready now.

Most of our tilesets still don't have the _3DTILESDIFFUSE flag set, but I'm going to wait until the 3d-tiles-tools generator is done so I can update everything at once.

@lilleyse please make the minor doc updates in the 3d-tiles branch.

@lilleyse also please open a PR in the 3d-tiles spec repo for _3DTILESDIFFUSE.

@lilleyse please make the minor doc updates in the 3d-tiles branch.

Updated here: https://github.com/AnalyticalGraphicsInc/cesium/commit/5bd69da337e69ca2f6cc30b787ca62697de3055e

also please open a PR in the 3d-tiles spec repo for _3DTILESDIFFUSE.

Since colorBlendMode is not part of the spec, this wouldn't need to be mentioned there. Unless we decide it's important as an example case.

also please open a PR in the 3d-tiles spec repo for _3DTILESDIFFUSE.

Since colorBlendMode is not part of the spec, this wouldn't need to be mentioned there. Unless we decide it's important as an example case.

Ah, yes, of course.


Consolidate top level directory

With more benchmark scripts getting added the top level directory is getting cluttered, suggest creating a benchmark_wrapper directory and moving all wrapper directories into it.

Agreed this is ok, no change


Error

UnboundLocalError: cannot access local variable 'results' where it is not associated with a value

Sure, feel free to associate it
On Thu, 6 Jun 2024 at 00:59, nothing @.***> wrote:

UnboundLocalError: cannot access local variable 'results' where it is not
associated with a value
—
Reply to this email directly, view it on GitHub
https://github.com/vysecurity/DomLink/issues/36, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA3N7URIUSRQBEC3CZ6KU63ZF47V3AVCNFSM6AAAAABI3DXD2WVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZTMNBQGE4DQMY
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>


[RFC] Deprecate weights_save_path from the Trainer constructor

Proposed refactor
Deprecate weights_save_path from the Trainer constructor:
https://github.com/PyTorchLightning/pytorch-lightning/blob/9d8faecdb2b873b52b95f2772f4bf48068a0af9a/pytorch_lightning/trainer/trainer.py#L175
Motivation
We currently have multiple ways to set the checkpoint save path in Lightning:

theweights_save_path Trainer argument
the dirpath argument and instance variable of ModelCheckpoint
the generic default_root_dir Trainer argument

We have all this complicated logic here to determine how to set the checkpoint save path based on the above variables:
https://github.com/PyTorchLightning/pytorch-lightning/blob/9d8faecdb2b873b52b95f2772f4bf48068a0af9a/pytorch_lightning/callbacks/model_checkpoint.py#L567-L601
Having multiple ways of doing the same thing can create confusion and overly complex code. Also, we don't have any save_path for the profiler in the Trainer constructor, so why should we for checkpointing?
Additional context
Discussed in https://github.com/PyTorchLightning/pytorch-lightning/discussions/10547
cc @awaelchli @ananthsub @ninginthecloud @rohitgr7 @tchaton @akihironitta @justusschock @kaushikb11 @borda

This argument is used for automatic fault-tolerance here: https://github.com/PyTorchLightning/pytorch-lightning/blob/0cb64fb8baf954db2de234a69b483209fb19de9a/pytorch_lightning/trainer/connectors/checkpoint_connector.py#L55-L68
What would be used instead?
What happens if multiple model checkpoints are configured? It doesn't make sense to save multiple checkpoints used for resuming?

I see. Can we use default_root_dir here?

I like deprecating weights_save_path usage in ModelCheckpoint - don't see a reason for it when ModelCheckpoint has dirpath. Some things we lose by deprecating weights_save_path Trainer arg:

the ability for fault tolerance to specify a path different from default_root_dir. potential solutions:

trying to check ModelCheckpoint dirpaths to use. This is messy/won't work well though as mentioned above, e.g. multiple ModelCheckpoint(dirpath) callbacks, or no ModelCheckpoint callbacks at all.

keep weights_save_path arg, just repurpose and rename it as e.g. fault_tolerance_path (remove functionality for weights_save_path being used in ModelCheckpoint)

(sharing weights_save_path across multiple ModelCheckpoint callbacks. Nbd, I think explicitly giving dirpath to each ModelCheckpoint is much better)

Interesting, yeah it seems like the only viable option is repurposing it as fault_tolerance_path

any thoughts @tchaton @awaelchli?

I think that fault-tolerance using weights_save_path is a bug considering the fault-tolerance is set to save in default_root_dir. (the same argument can be done the other way around).
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/trainer/trainer.py#L1761
I would not introduce a Trainer argument for the ft path as it's still experimental and supposed to be invisible to the users.
This logic will get cleaned up with #11862. The callback added can be extended in the future.

Makes sense, thanks. So after https://github.com/PyTorchLightning/pytorch-lightning/pull/11862 lands, do you think we can make the changes initially proposed in this issue?

That's fine, we can introduce an environment variable for the path for the special fault-tolerance checkpoints and default to the root dir.

do you think we can make the changes initially proposed in this issue?

I believe so, looking at the PR that introduced this variable: https://github.com/PyTorchLightning/pytorch-lightning/pull/211
The argument was allowing saving customization without ModelCheckpoint, however, we are moving away from cluster-specific saving logic.