Switch on and off a lamp using relay

Is there an example for switching a simple lamp on and off using a relay?
I'm using a raspbery pi and a 5v relay, i'm able to switch it on and off using python code, but i'm not into python. I would like to use node and js instead.
This is my setup:

PS: the W3Schools example for turning a led on and off worked fine, but when using a relay things get confusing.
Thank you!

There isn't an example in the repo and although it can be a little tricky normally relays should work with onoff.
The important thing about relays is that some models are triggered (turned on) by a high value while other models are triggered by a low value.
I'm guessing here but I think your relay is triggered by a low value. If a relay is triggered by a low value it's important to ensure that the Gpio output object used to control the relay is configured to have a high value when the Gpio object is created. This prevents the relay from turning on automatically when the Gpio object is created. In other words, create the Gpio object for the relay like this:
const relay = new Gpio(21, 'high'); // IMPORTANT: Use 'high' if relay uses low level trigger

rather than like this:
const relay = new Gpio(21, 'out');

Reboot your Raspberry and give the following program a try:
const Gpio = require('onoff').Gpio;
const relay = new Gpio(21, 'high'); // IMPORTANT: Use 'high' if relay uses low level trigger

console.log('Program started. Relay should be off. Relay will turn on in 5 seconds.');

setTimeout(() => {
  relay.writeSync(0);
  console.log('Relay should be on. Relay will turn off in 5 seconds.');

  setTimeout(() => {
    relay.writeSync(1);
    console.log('Relay should be off. ');
  }, 5000);
}, 5000);

If this doesn't resolve the issue please explain what the issue is an post a short program that can be used to reproduce the issue.
See the Gpio constructor documentation for more details.

Only the first 2 lines of code will turn on the relay.  Tried all options (high, low, out),
const Gpio = require('onoff').Gpio;
const relay = new Gpio(21, 'high'); //same thing with 'low' or 'out'

The only option that doesn't start it seems to be 'in'.
const Gpio = require('onoff').Gpio;
const relay = new Gpio(21, 'in');

console.log('Program started. Relay should be off. Relay will turn on in 2 seconds.');

setTimeout(() => {
  relay.writeSync(0);
  console.log('Relay should be on. Relay will turn off in 2 seconds.');

  setTimeout(() => {
    relay.writeSync(1);
    console.log('Relay should be off. ');
  }, 2000);
}, 2000);

process.on('SIGINT', function () {
  relay.unexport();
});

However, using the 'in' option gives me an error:
OUTPUT:
Program started. Relay should be off. Relay will turn on in 2 seconds.
fs.js:786
    return binding.writeBuffer(fd, buffer, offset, length, position);
                   ^

Error: EPERM: operation not permitted, write
    at Error (native)
    at Object.fs.writeSync (fs.js:786:20)
    at Gpio.writeSync (/home/pi/soft/bec/node_modules/onoff/onoff.js:174:8)
    at Timeout.setTimeout (/home/pi/soft/bec/git_example.js:7:9)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)

Only the first 2 lines of code will turn on the relay. Tried all options (high, low, out),

const Gpio = require('onoff').Gpio;
const relay = new Gpio(21, 'high'); //same thing with 'low' or 'out'

What you say here means that everything turns the relay on. Setting the value of GPIO21 to 0 turns the relay on and setting the value of GPIO21 to 1 turns the relay on. If this is really the case the relay does not work.

However, using the 'in' option gives me an error:

This is to be expected as it's not possible to call writeSync for a GPIO input. writeSync can only be called for GPIO outputs.

Please post the Python program that can be successfully used to control the relay
Please post a link to the documentation for the relay
Can you ever hear the relay clicking on and off?
When does the red LED on the relay turn on and off?
When does the green LED on the relay turn on and off?
Are you sure that the lamp is wired correctly to the relay?
What type of lamp is being used?
Please describe how the lamp is connected to the relay (a photo would be good here)

Please post the Python program that can be successfully used to control the relay

import RPi.GPIO as GPIO
import time
channel = 21
# GPIO setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.OUT)
def motor_on(pin):
    GPIO.output(pin, GPIO.HIGH)  # Turn motor on
def motor_off(pin):
    GPIO.output(pin, GPIO.LOW)  # Turn motor off
if __name__ == '__main__':
    try:
        motor_on(channel)
        time.sleep(2)
        motor_off(channel)
        time.sleep(2)
        GPIO.cleanup()
    except KeyboardInterrupt:
        GPIO.cleanup()

Please post a link to the documentation for the relay

https://www.optimusdigital.ro/en/relay-modules/874-relay-module-ordered-with-5v.html
Can you ever hear the relay clicking on and off?

Yes, it's clicking on and off when using the python code and when the light turns on, and also when using the onoff module 2 lines of code. However, when using the onoff code, the light and relay remains on, and i have to run the python code to turn the light and relay off.
When does the red LED on the relay turn on and off?

The red light is always on.
When does the green LED on the relay turn on and off?

The green light turns on when the relay clicks.
Are you sure that the lamp is wired correctly to the relay?

Well you can see the connected wires in the picture and it works with the python code, so yes.
What type of lamp is being used?

It's just a lightbulb plugged into the house power source basically, i have attached 2 more pictures.
Please describe how the lamp is connected to the relay (a photo would be good here)

@muscaiu Thank you for all the information.
I now have a relay connected up to the Raspberry Pi and tested it with the Python code and the following code:
const Gpio = require('onoff').Gpio;
const relay = new Gpio(21, 'out');

function motor_on(gpio) {
  gpio.writeSync(1);
}

function motor_off(gpio) {
  gpio.writeSync(0);
}

motor_on(relay);
setTimeout(function () {
  motor_off(relay);
  setTimeout(function () {
    relay.unexport();
  }, 2000);
}, 2000);

On my Raspberry Pi both the Python code and the JavaScript code turn the relay on for two seconds and then turn it off. Can you give this JavaScript code a try with Node.js pelase?
If this code doesn't work on your Raspberry Pi can you give the following code a try please. Note that it uses GPIO6 which is pin 31 on the GPIO header so you will need to modify your circuit accordingly.
const Gpio = require('onoff').Gpio;
const relay = new Gpio(6, 'out');

function motor_on(gpio) {
  gpio.writeSync(1);
}

function motor_off(gpio) {
  gpio.writeSync(0);
}

motor_on(relay);
setTimeout(function () {
  motor_off(relay);
  setTimeout(function () {
    relay.unexport();
  }, 2000);
}, 2000);

The difference between GPIO6 and GPIO21 is that the internal pullup resistor is activated on GPIO6 by default but on GPIO21 the internal pulldown resistor is activated by default. Perhaps this difference is the source of the issue.

Hurray!!! The hard part is over! After 2 weeks of failed attempts! Thank you so much man!
It works well now on either of the gpios (21 or 6). I switched to 6 now, since mentioned something about being better :-D
The next step is to read the pin status, so i can send it to a webpage that has a ON-OFF switch.
I will try to adapt it to the W3Schools WebSocket tutorial code.
The final step should be just like in the W3Schools WebSocket tutorial, the ability to switch it on and off from phone, witch worked fine with a simple LED.

Hurray!!! The hard part is over! After 2 weeks of failed attempts! Thank you so much man!

Congratulations :tada: and thank you :smile:
Have fun with the rest of the tutorials and onoff...

That is the expected behaviour of the program that you just posted. Calling relay.unexport() will free the resources associated with GPIO21 and reconfigure it as an input GPIO before exiting the program. Reconfiguring GPIO21 as an input results in the relay being turned off.

Please describe exactly what you would like to achieve.

I'm trying to say that gpio.writeSync(1) and gpio.writeSync(0) is doing nothing,
That's why i posted the code without it so you can see that the behavior is the same, yet there is no control over the relay.

Let's take a different approach to see if the underlying sysfs files used by onoff can be used to achieve anything.
First, power down the Pi, pull out the power plug for the Pi and stick the plug back in to restart the Pi. After restarting and logging as user pi don't run any Python or JavaScript programs.
Do everything as user pi. Don't use sudo for anything.
Start a terminal window and execute the following commands one by one. Don't copy and paste all the commands at the same time. Run them one at a time waiting for each command to complete before starting the next command.
cd /sys/class/gpio
ls -l
echo 6 > export
cd gpio6
ls -l
echo out > direction
cat value

Running the command cat value should print 0, does it?
Now run the following command:
echo 1 > value

The state of the relay should have changed, did it?
Now run the following command:
echo 0 > value

The state of the relay should have changed again, did it?
Now run the following command:
echo 1 > value

The state of the relay should have changed again, did it?
There should be no errors while running any of the above commands. If there are errors something is wrong. It should be possible to change the state of the relay by echoing 0/1 to the file called value. If the state of the relay can't be changed there is also something wrong.

I missed the following question.
Please don't edit comments to add important information. Create a new comment.

PS: i'm assuming that relay.unexport() is being used to release the resources and not to control the relay, correct?

Incorrect. Calling unexport reverses the effect exporting. Calling unexport for an output GPIO will reconfigure it as an input. This is also highly likely to change the state of the relay.

I followed you instructions and this is what's happening:

echo out > direction : the relay is being switched on (gren light on)
cat value :  prints 0
echo 1 > value : nothing is hapening
echo 0 > value : nothing is hapening

What is your next suggestion?
Maybe change the wiring?
Try another relay?
I have 2 more relays as seen in this picture (1 ssd and 1 similar to the current except it has 2 chanels).

I'm connecting via ssh from my laptop and using user pi and no sudo like you said.

Pull out the plug on the lamp and retry

If it's still not working disconnect the lamp from the relay and retry.

Disconected the lamp completely from the relay and same thing is happening.
When i run echo out > direction  the relay is being switched on (gren light on)

When i run echo out > direction the relay is being switched on (gren light on)

This is to be expected. Before configuring the GPIO as an output by calling echo out > direction the GPIO is configured as an input. The GPIO is actually configured as an input as soon as the Raspberry Pi is powered on. The relay remains off as long as the GPIO is configured as an input. Configuring the GPIO as an output by calling echo out > direction also sets the value of the GPIO to low (0V). The relay appears to recognize this and turns the relay on. What it doesn't recognize is high (3.3V) levels.
Do you have a multimeter to measure the voltage on the GPIO to see if it's high enough to be recognized as a high level when the value file is set to 1?
As you mention above:
Perhaps the relay is broken... You could try some of your other relays to see if they work.
It doesn't appear to be the wiring but you could change the jumper wires to see if it helps.
At this point we can say that this isn't an onoff issue.

I'm going to go ahead and close this issue as there doesn't appear to be anything that needs to be changed in onoff.

Hi, this kind of relay is triggered on a low level, so without details: just connect the VCC of the relay with only 3.3V supply of raspberry, now when you start your node js code, follow the code as fivdi mentioned above use ('high'), that will write value 1 and the relay will not be triggered, when you want to start your relay to connect use writeSync(0) and when you want to disconnect use writeSync(1)... if you want to understand why then you have to read more about how relays are working, here small article about that I hope it will help. https://electronics.stackexchange.com/questions/202680/relay-what-is-the-difference-between-low-level-trigger-and-high-level-trigger


Add support for React 16

Coverage remained the same at 100.0% when pulling 8ed4b6152bf79f92ee593bfb34e21524f3745ece on smashercosmo:react-16 into 3bb0a84ff4b7e91c1d60095074dca5457ff9b890 on ethanselzer:master.

I merged your PR, thx

Coverage remained the same at 100.0% when pulling 1667db61659620f7a38861b16db312a0cf9c7748 on smashercosmo:react-16 into 3bb0a84ff4b7e91c1d60095074dca5457ff9b890 on ethanselzer:master.

@smashercosmo - Thank you very much. I really appreciate your creating this PR!

@ethanselzer np) thx for the lib)


The router is not installed properly

Version
3.0.0-beta.15
Reproduction link
https://github.com/ondrej-janosik/error-report-vue-cli-3
Steps to reproduce

Create a project with VUE CLI 3 and select router option
npm run serve
Open browser and console - you will se error: Unknown custom element:  - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in
--->  at src\App.vue

What is expected?
The router should be registered properly
What is actually happening?
The router is not working - Unknown custom element:  - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Did you create the project using the UI?

I have same problem with vue-cli 3.0.0-beta.11. It happens because main.js doesn't import router and doesn't include it in new Vue instance (https://github.com/ondrej-janosik/error-report-vue-cli-3/blob/master/src/main.ts#L6). It work properly in vue-cli 3.0.0-beta.16 for me.
@ondrej-janosik  Can you check app creating for vue-cli 3.0.0-beta.16?

@yyx990803
I used "@vue/cli-service": "^3.0.0-beta.16" CI and the mistake persist.
@Smekalin
Main.js is still generated without the router included.
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App)
}).$mount('#app')

@ondrej-janosik please answer the question... did you create the project via the UI, or using the vue create command?

@yyx990803 I get the exact same problem with the vue create command, so I suppose it is worth looking into.
During creation I selected the following:

Manually select features: Babel, Typescript, Router, Vuex, CSS Pre-processors, Linter / Formatter
Use class-style component syntax? Yes
Use Babel alongside TypeScript for auto-detected polyfills? Yes
CSS Pre-processor: SCSS/SASS
Linter / formatter: TSLint
Lint features: Lint on save
Configs: In dedicated config files

@Moland92 can you reproduce this every time, or it appears on and off? I can't reproduce it locally.

@yyx990803 I get the same errors every time.
Currently I am using a Macbook with High Sierra 10.13.4
I have tried using both npmand yarn commands to run the server.

@yyx990803
I tried adding the following to src/main.ts:
import Vue from 'vue';
import App from './App.vue';
import router from './router';  // Added this

new Vue({
    router,  // Added this
    render: (h) => h(App),
}).$mount('#app');

Seems to be working now.

@yyx990803 vue-cli 3.0.0-beta16 working for me, but I have similar behavior if my vue-cli version is 3.0.0-beta11. Can you try it? I did next steps:

npm i -g<EMAIL_ADDRESS>vue --version
$ 3.0.0-beta.11
vue create app11
Enable router (you may disable or enable other points - it isn't important)
Waiting for create
File app11/src/main.js doesn't include router.

It reproduce every time.

@Smekalin if it doesn't happen in the latest version what's the point of looking at an older version?

@yyx990803 you are right 👍   It is more interesting to me.

@yyx990803  I used vue create command. The problem no more occurs in the 3.0.0-beta.16, you can close this issue, thanks :)


do we have an ETA for a stable release?

i used ProcessHacker for years, but it is so hard to deal with the system believing it is malware, so a stable release is something we really want

We originally planned for a stable release in January... There were some issues blocking a stable release:

[x]  Microsoft sent an agreement to sign that was missing 20 pages.
[ ] Blue screen/Bug checks caused by Third parties.
[ ] #1668

There's ongoing discussions with 25 companies causing various issues... The large majority have been resolved and there will be a stable release soon™

Huh, it is a lot of administrative stuff to get it done. I really hope everything goes on track and we see a stable release soon.
I honestly think this is the best app of its kind by far.


Deserialization should be more strict

If you deserialize a struct like this:
use edn_derive::Deserialize;

#[derive(Derive)]
struct A {
    amount: usize,
}

let a: A = edn_rs::from_str("{ :amount -10 }").unwrap(); // A { amount:<PHONE_NUMBER>3709551606 }
let a: A = edn_rs::from_str("{ :amount "123" }").unwrap(); // A { amount: 123 }

The second one is more acceptable, but IMO we should be strict about deserialization conversions.
Maybe we can offer a loose one and a strict one.

We should stop using the to_ conversions like this one on Deserialization:https://github.com/naomijub/edn-rs/blob/1090f2601f3275e3a9a8b7efcdd958a95888af8c/src/edn/mod.rs#L358
They have a different purpose.

https://github.com/naomijub/edn-rs/pull/49

I don't agree that this is a problem let a: A = edn_rs::from_str("{ :amount "123" }").unwrap(); // A { amount: 123 }. How ever, the solution to this is to remove these lines:
https://github.com/naomijub/edn-rs/blob/master/src/edn/mod.rs#L360
https://github.com/naomijub/edn-rs/blob/master/src/edn/mod.rs#L349
https://github.com/naomijub/edn-rs/blob/master/src/edn/mod.rs#L324


About the integration of this tool with ChatGPT from scratch.

If I compile this tool from scratch and run it correctly, does it mean that the relevant API token in ChatGPT does not need to be configured separately?

Yes. The only difference would be the CHATGPT_BASE_URL environment variable you need to set


Get rid of the anonymous auth rule for the OIDC

We don't need it anymore as we publish these to S3. This fixes the
[sig-auth][Feature:OpenShiftAuthorization] The default cluster RBAC policy should have correct RBAC rules
conformance test.
Ref https://issues.redhat.com/browse/HOSTEDCP-257
/cc @csrwng

/retest

@csrwng could you have a look on this one, please?

/lgtm


terminal ansi colors

by default, it seems that spotify_player uses it's own colors. for a CLI/TUI application i don't think this is a very good idea. spotify_player should use the terminal's colors - aka ANSI colors.

By the app's own colors, I'll assume that you're referring to the required colors mentioned in theme's palette documentation.
I believe defining the app's own colors this way allows to define more custom themes. I'm not too sure about the approaches other CLI/TUI applications take. Any resources would be helpful.

thats not exactly what i meant; for example a program can use the current terminals colors, for example heres a simple printf that will use ANSI to ask the terminal to print the text in red, and then reset the colors:
printf '\033[31mi am in red\n\033[0m'

i believe many programs do this; such as spotify-tui.

thats not exactly what i meant; for example a program can use the current terminals colors,

Thanks for the clarification. Does that mean adding a new theme, e.g called "default", that uses the terminal's default colors should work?

i guess?

IMO there shouldnt be themes built in into spotify-player. the default and the only default should be ANSI colors and supports themes via configuration; with templates/themes from the project repo.

I think this feature is a must in terms of theming. I change my terminal theme quite often, it looks like a downsize having to change the spotify-player theme too.

This issue should be resolved by #107.
The default theme change can be considered as a breaking change, so there should a while till it's released with a new major version.
In the meantime, @wael444, @euglevi, can you guys test the latest build of the master branch to see if it works as expected? Note it requires to update the theme's configurations, so please refer to themes documentation for references. Feel free to reopen this issue if encounter any related issues.

Yes. though the color of the green accent is a little too light, should be the default green color 2 instead of 10

Yes. though the color of the green accent is a little too light, should be the default green color 2 instead of 10

Which component are you referring? I think it depends on the terminal's theme. The theme looks fine for mine:

If things don't work, you can always create a new theme based on the "default" theme and update the corresponding component styles.

It seems to me it works well. Thank you! I have tried with a few themes. I will try more in the next days, but I have no reason to think I will experience any issues.


Update C# RPC attributes to share new Any/Auth naming convention

The renaming of the C# RPC attributes seems to have been overlooked in the updates to the RPC naming convention in
#51481.
This intends to bring the relevant C# attributes to consistency.
Not sure what kind of contribution this is supposed to be labeled as so forgive me if I skipped some steps in the process.
I asked around in the discord if anybody had context but it didn't seem like a very high-visibility issue, so I thought to just get it over with.

We reference these attributes from C++ (search for RemoteAttribute and PuppetAttribute) so the name must be updated there as well.

Could you squash the two commits together? See PR workflow.

@akien-mga
I can do it, no problem, but can't GH do that for you?
https://docs.github.com/en/github/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-pull-request-commits
Also before this is ready I have to figure out what's causing this to happen:
λ ..\engine\bin\godot.windows.tools.64.mono.exe --editor
Godot Engine v4.0.dev.mono.custom_build.dc4e6c12d - https://godotengine.org
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        ReadDataFilesInRegistry: Registry lookup failed to get layer manifest files.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle<PHONE_NUMBER>872
     at: VulkanContext::_debug_messenger_callback (drivers\vulkan\vulkan_context.cpp:154)
Vulkan API 1.2.148 - Using Vulkan Device #0: NVIDIA - GeForce GTX 1070

Mono: Log file is: 'C:/Users/Duduwa/AppData/Roaming/Godot/mono/mono_logs/2021-09-27_12.29.45_14204.log'
ERROR: Mono Cache: Member cached_data.class_AnyAttribute is null.
   at: (modules\mono\mono_gd\gd_mono_cache.cpp:268)
...

I can do that no problem, but doesn't GH do that for you?

Yes, but there are various issues that come with using that feature, we prefer PRs to be cleaned up before merging with a merge commit.

Curiously, I ran the project again after annotation a method with [Any] and this caused the cache miss to go away. I suppose this how the mono cache is supposed to function? Regardless, squash commit coming.

Thanks!


Bug: Padding & Margin not used during initialization

Fixed initWithAttributedString:sizedToView:withPadding:andMargin:
bug: Padding & margin were not being applied to the tooltip.

nice.  thanks!

@dtrenz this is live in version 1.2.2


Keyboard shortcut for switching between tabs?

Thanks for this awesome extension.
Are there any keyboard shortcuts for switching between tabs rather than having to use the mouse?
Thanks!

thank you for the suggestion? completely rewritten extension, please wait.

Ctrl-Left, Ctrl-Right for version 5.0.1 :+1:


Object.values() doesn't take into account indexed properties : no inference + type error

✏  EDIT: It seems to be fixable like that
function getValues <Obj:Object>(o: Obj) : Array<$Values<Obj>> {
    return Object.values(o)
}

see this comment: https://github.com/facebook/flow/issues/4771#issuecomment-326571246

https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgCiAHgIYC2OMBAvGAN4DaA1nlgFwB2AruQEZ4ATgF0w7AM4ZBAS04BzAL6pqGMHD4ArMUTKVqYOvSXqNjAIyi6AIjjMwZq8ryqAbqRjjtAQUGDSWAB5JGXkAPgMwAHlNPABjDAA6NxhuPHEAChMASlQgA
/* @flow */

type Example = {[key:number] :string}
let obj : Example = {}
obj[1] = "ok 1"
let vals : Array<string> = Object.values(obj)

🔴  gives
6: let vals : Array<string> = Object.values(obj)
                    ^ string. This type is incompatible with
[LIB] static/v0.54.0/flowlib/core.js:52:     static values(object: any): Array<mixed>;
                                                                               ^ mixed

does anyone know a workaround ?
Maps are unfortunately not an option for me.

You can do this:
let vals : Array<string> = (Object.values(obj): any)

Objects can't have numbers as keys. If you try to set a numeric key on an object it will automatically be cast to a string:
let obj = {}
obj[1] = "ok 1"
JSON.stringify(obj)
// {"1":"ok 1"}

@jcready thanks
related:

~https://github.com/facebook/flow/issues/2133 (closed)~
https://github.com/facebook/flow/issues/2174

Unfortunately it would be unsound to define Object.values/entries/keys any other way. I previously made a PR to do what you want, but I had to close it after it was pointed out how unsound the changes were:
function test(val: { foo: string }) {
  Object.values(val).forEach(v => {
    v.toLowerCase();
  });
}

test({ foo: 'x', bar: 123 });

@jcready actually, thanks to $Value, it is possible:
function getValues <Obj:Object>(o: Obj) : Array<$Values<Obj>> {
    return Object.values(o)
}

type M1 = {[a:number]: string}
type M2 = {[a:number]: number}

let v1ok : Array<$Values<M1>> = ["33","44","55"]
let v2ok : Array<$Values<M2>> = [12,22]

let v1 : Array<$Values<M1>> = ["33",22]
//                                  ~~ error
let v2 : Array<$Values<M2>> = ["33",22]
//                             ~~~~ error

this works fine for me
I learnt about $Values 5 minutes ago reading this comment: https://github.com/facebook/flow/issues/2174#issuecomment-316739515
sadly, it is not documented here: https://flow.org/en/docs/types/utilities/

full example:
function getValues <Obj:Object>(o: Obj) : Array<$Values<Obj>> {
    return Object.values(o)
}

type M1 = {[a:number]: string}
type M2 = {[a:number]: number}

let v1ok : Array<$Values<M1>> = ["33","44","55"]
let v2ok : Array<$Values<M2>> = [12,22]

let v1 : Array<$Values<M1>> = ["33",22]
//                                  ~~ error
let v2 : Array<$Values<M2>> = ["33",22]
//                             ~~~~ error

let t1 : Array<string> = getValues({a: 'ok', b:'stuff'})

let t2 : Array<string> = getValues({a: 'ok', b:44})
//                                             ~~ error

It's still unsound to define Object.values using $Values. This still passes type checking, but will throw a runtime error:
declare class Obj {
  static values <T: Object> (obj: T) : Array<$Values<T>>;
}

function test(val: { foo: string }) {
  Obj.values(val).forEach(v => {
    v.toLowerCase();
  });
}

test({ foo: 'x', bar: 123 });

The only way it would be safe to define Object.values using $Values is if flow provided some way to only let $Exact objects flow in. Something like this hypothetical syntax:
declare class Object {
  static values <T: $ExactObject> (obj: T) : Array<$Values<T>>;
  static values (obj: any) : Array<mixed>;

  static keys <T: $ExactObject> (obj: T) : Array<$Keys<T>>;
  static keys (obj: any) : Array<string>;

  static entries <T: $ExactObject> (obj: T) : Array<[$Keys<T>, $Values<T>]>;
  static entries (obj: any) : Array<[string, mixed]>;
}

Then my test function would fail type checking because I've annotated my input parameter val as an inexact object type, so flow would use my secondary Object.values definition which returns Array<mixed>. And if I redefined my test function to use an exact object type for its input parameter val (e.g. {| foo: string |}) then my invocation of test({ foo: 'x', bar: 123 }) would fail type checking because the object I passed it doesn't match the exact object type.

@jcready thanks for your example

It's still unsound to define Object.values using $Values.

It depends. it is "sound" in my codebase, because  I have other ways to check and maintain my invariants. In any way, it seems to me that it is the best possible way so far to do what I want.
Other solutions like this is much less safe :

let vals : Array<string> = (Object.values(obj): any)

This being said, I agree that changing the core Object.values type definition is probably not a good idea. On the other side, defining a getValues function as shown above may bring more type safety in many cases.
📝  Also, most people who try to do that probably know that there is some invariant in their codebase that should allow them to do that.

At least it sounds with maps:
export const values: <T>({+[string]: T}) => T[] = (Object.values: $FlowIssue);
export const entries: <T>({+[string]: T}) => [string, T][] = (Object.entries: $FlowIssue);

I had luck with implementing the $ObjMap<T, F>


MF-571 - Connection module UX

What does this do?
Adds things and channels checkbox lists to Connection module.
Have you included tests for your changes?
No
Did you document any new/modified functionality?
No

Codecov Report

Merging #576 into master will decrease coverage by 0.24%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #576      +/-   ##
==========================================
- Coverage   87.11%   86.86%   -0.25%
==========================================
  Files          62       62
  Lines        3391     3381      -10
==========================================
- Hits         2954     2937      -17
- Misses        298      305       +7
  Partials      139      139

Impacted Files
Coverage Δ

bootstrap/postgres/configs.go
69.17% <0%> (-6.6%)
:arrow_down:

bootstrap/api/transport.go
97.1% <0%> (-0.64%)
:arrow_down:

bootstrap/postgres/init.go
89.47% <0%> (-0.27%)
:arrow_down:

sdk/go/sdk.go
96.15% <0%> (ø)
:arrow_up:

bootstrap/reader.go
0% <0%> (ø)
:arrow_up:

readers/api/responses.go
100% <0%> (ø)
:arrow_up:

bootstrap/api/endpoint.go
100% <0%> (ø)
:arrow_up:

readers/api/endpoint.go
100% <0%> (ø)
:arrow_up:

bootstrap/api/responses.go
100% <0%> (ø)
:arrow_up:

bootstrap/api/requests.go
93.75% <0%> (ø)
:arrow_up:

... and 2 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 3f3b42b...93f9989. Read the comment docs.

This one should not be sent to master, but to ui branch.


Mesh/Model default ctors

The default constructors for mesh and model are only relevant for Prefabs in the sample project. As there is no reasonable default state for either, they should probably be removed and Prefabs changed somehow (pointers maybe).

Closing as this is no longer relevant with Vulkan.


InternVL2/2.5 is supported in  PaddleMIX by Paddle Team.

Thanks to all the authors for their great work!
InternVL2/2.5(https://github.com/PaddlePaddle/PaddleMIX/tree/develop/paddlemix/examples/internvl2)  is supported in  PaddleMIX by Paddle Team.

Thanks to Paddle Team for the support of our models!


ddim_sampling_eta: What is it for?

Hi, what's ddim_sampling_eta used for?

this is a parameter, you can see it in the DDIM paper(Denoising Diffusion Implicit Models). In a word, it is used to determine the amount of randomness. eta=0 means it is a deterministic process, random noise is of no use. eta = 1 means the original ddpm process.

Thank you - this helped!


Problems bridging messages to RabbitMQ

Hi!
My company has been trying to benchmark a few MQTT brokers and we decided to give VerneMQ a try. I have been compiling VerneMQ from the source on a Mac OS. I can get it running and, by using mosquitto_(pub/sub), I'm able to publish messages and get them when subscribed.
As part of our current use case, we would need to route all received messages to a same RabbitMQ queue. Therefore, I was trying to set up the bridge functionality to interact with Rabbit.
I have my RabbitMQ MQTT Broker running on port 1889 and, based on the documentation available here, was trying the following configuration for Verne:
bridge.tcp.br0 = <IP_ADDRESS>:1889
bridge.tcp.br0.cleansession = on
bridge.tcp.br0.client_id = auto
bridge.tcp.br0.keepalive_interval = 10
bridge.tcp.br0.username = guest
bridge.tcp.br0.password = guest
bridge.tcp.br0.restart_timeout = 3
bridge.tcp.br0.try_private = off

bridge.tcp.br0.topic.1 = * out

Unfortunately, this setup is not working as I would expect. I can see that the connection between the systems is stablished, but messages published to Verne are not pushed to Rabbit.
I've tried a few different settings for bridge.tcp.br0.topic.1, and learned the following:

in rules work correctly. When I set one up, and publish something to RabbitMQ MQTT, I get that back on VerneMQ;
$SYS/* out remote, the example provided on the documentation, works.

I've seen a few related issues, but from one of them I'm unsure if a related bug exists. Most probably, though, I am doing something wrong with my configuration.
Any ideas what could be the problem here?
Thanks

Hi @lucastorri
great you're checking out VerneMQ & thanks for your report :)
It seems regardless whether you configure
bridge.tcp.br0.topic.1 = * outor bridge.tcp.br0.topic.1 = /* out, you'll only get the topics after the first level /.
In fact, in mosquitto_sub, you can only subscribe like that:
mosquitto_sub -h <IP_ADDRESS> -p 1889 -t /# (subscriber to RabbitMQ)
This way, things works for me. Kinda inconsistent. Normally one would only export a sub tree of the whole topic tree, or work with aliases.

Hi @lucastorri,
Thanks for the report and great you're giving VerneMQ a spin.
It's interesting that you see the $SYS/# messages arriving in Rabbit and none of the others. Are your messages routed and not rejected by an auth plugin?

Hey @ioolkos and @dergraf,
thank you for your help.
I have a small nodejs application running locally for authentication, and I've registered a few webhooks to interact with it:
var http = require('http');

const PORT = 8080;

function handler(request, response) {
  let content = {};

  switch (request.url) {
    case '/on-register':
      content = {
        "result": "ok",
        "modifiers": {
          "mountpoint": "newmountpoint",
          "subscriber_id": "subscriber_id",
          "reg_view": "reg_view",
          "clean_session": false,
          "max_message_size": 65535,
          "max_message_rate": 10000,
          "max_inflight_messages": 100,
          "retry_interval": 100,
          "upgrade_qos": false,
          "trade_consistency": false
        }
      }
      break;
      case '/on-subscribe':
        content = {
          "result": "ok",
          "topics": [{"topic": "rewritten/topic", "qos": 0}]
        }
        break;
      case '/on-publish':
        content = {
          "result": "ok",
          "modifiers": {
            "topic": "rewritten/topic",
            "qos": 2,
            "payload": "rewritten payload",
            "retain": true,
            "reg_view": "reg_view",
            "mountpoint": "newmountpoint"
          }
        }
        break;
  }

  withData(request, (data) => {
    console.log(`${request.url}:${response.statusCode} => ${data}`);
    console.log(`res: ${JSON.stringify(content)}`)
    response.end(JSON.stringify(content));
  });
}

function withData(request, cb) {
  let body = [];
  request.on('data', function(chunk) {
    body.push(chunk);
  }).on('end', function() {
    body = Buffer.concat(body).toString();
    cb(body);
  });
}

var server = http.createServer(handler);

server.listen(PORT, function() {
  console.log(`Listening on: http://localhost:${PORT}`);
});

vmq-admin webhooks register hook=auth_on_register endpoint="http://localhost:8080/on-register"
vmq-admin webhooks register hook=auth_on_publish endpoint="http://localhost:8080/on-publish"
vmq-admin webhooks register hook=auth_on_subscribe endpoint="http://localhost:8080/on-subscribe"

I can see that the endpoints are being used through the logs, i.e. I would see something similar to the following whenever I subscribe/publish to VerneMQ:
/on-register:200 => {"peer_addr":"<IP_ADDRESS>","peer_port":50503,"mountpoint":"","subscriber_id":"mosqsub/26465-lucass-mb","username":"undefined","password":"undefined","clean_session":true}
res: {"result":"ok","modifiers":{"mountpoint":"newmountpoint","subscriber_id":"subscriber_id","reg_view":"reg_view","clean_session":false,"max_message_size":65535,"max_message_rate":10000,"max_inflight_messages":100,"retry_interval":100,"upgrade_qos":false,"trade_consistency":false}}

Then I have a couple of shell sessions, and when I publish something, I get the following on the connected subscriber:
# shell #1
mosquitto_pub -q 0 -m "Hello, MQTT" -t /data

# shell #2
mosquitto_sub -t '#'
Hello, MQTT

So, as far I can tell, authentication seems to be fine. BTW, I can also check that RabbitMQ MQTT is also working by publishing the following and see the message on the queue I bound to the MQTT related exchange:
# shell #1
mosquitto_pub -q 0 -m "Hello, MQTT" -t /data -u guest -P guest -p 1889

# shell #2
mosquitto_sub -t '/#' -u guest -P guest -p 1889
Hello, MQTT

VerneMQ authentication with RabbitMQ also looks fine, since, like I said before, I can see the connection stablished through the RabbitMQ web UI.
I've tried to set bridge.tcp.br0.topic.1 to a few different options:

* out
/* out
/+ out
+ out

... and to publish it with different topics:
mosquitto_pub -q 0 -m "Hello, MQTT" -t /
mosquitto_pub -q 0 -m "Hello, MQTT" -t /data
mosquitto_pub -q 0 -m "Hello, MQTT" -t /data/1
mosquitto_pub -q 0 -m "Hello, MQTT" -t /data/1/2

..., but none of the combinations worked.
Once again, thank you for your support.

The reg_view modifier in your on_register handler looks suspicious. Can you remove this modifier and test again. Also is the VerneMQ error.log showing any errors?

@dergraf I've removed the reg_view and there are no errors that I can see (files or console). For reference, here are the log entries I get when running vernemq console: https://gist.github.com/lucastorri/9200f3143e4cac10c3e183f70108f88d
By the end you can see that I add the webhooks and also send a single message with mosquito_pub, where the clients connects and disconnects in the sequence.

Ah I missed something. The modifier mountpoint is telling the router to use a different routing tree (similar to the vhosts in Rabbit). So you could change the vhost of a simgle publish msg (no shoveling around anymore ;)). However, our bridge plugin currently only supports the default mountpoint ""so the messages are never picked up by the bridge. Please remove the mountpoint modifier and retest. Thanks.

And for the notice the modifier subscriber_id in auth_on_register doesn't exist. If your intention is to rewrite the client_id use the client_id modifier. Please note that modifying the client_id to the same value for every connection (as you would do in your webhook) is only useful if you're dealing with one single client. Otherwise every connect would kick out any other established client.

Hey @dergraf, removing mountpoint did the trick 😃
I was using the templates available here for the auth response. To be honest, I have very little idea of what most of those fields do.
Anyway, I'm glad to see it working. Thanks a lot for your help!


Added readme file for ad-click module.

Task/Issue URL:
Description
Steps to test this PR
Feature 1

[ ]
[ ]

UI changes

Before
After

!(Upload before screenshot)
(Upload after screenshot)

Current dependencies on/for this PR:

develop

PR #3831   👈

This stack of pull requests is managed by Graphite.


The GRU/LSTM function bugs when using TF2.7

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Windows 10
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
TensorFlow installed from (source or binary):binary
TensorFlow version (use command below):2.7
Python version:3.8
Bazel version (if compiling from source):
GCC/Compiler version (if compiling from source):
CUDA/cuDNN version:11.5
GPU model and memory:NVIDIA Geforce 1070, 8GB

Describe the current behavior
Hello，I offered the issue seveal days ago in Tensorflow area and the developer suggested me that it should be offered there ,so I post there,the original link is:https://github.com/tensorflow/tensorflow/issues/53701
When I used the keras GRU/LSTM model to accomplish the text classification with IMDB dataset，there were some problems  in model  fitting process.This is the dataset shape information.

When I set the GRU layer with  return_sequences=True:

Then I removed the return_sequences=False,the code was seemed to be normal,but the gradient was't decreased:

The LSTM performance was also similar with the GRU. If I used the two layers GRU with the last GRU's return_sequences=False，the performance of model was same as the single GRU/LSTM layer.

Describe the expected behavior
I asked my teammates who used tf2.6.2,they said all the problem I mentioned above didn't occur when they ran these codes. But some people who used  tf2.7 found the same problem. I also checked the different systems like linux in colab or docker,it seems that the bugs could happen when using tf2.7.I has updated my code with zip attachment,
Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.
The Code is here:
imdb.zip

@hayatejp ,
Please take a look at this SO link and issue with the similar error.It helps.Thanks!


Markdown export (Pod V2) does not add .md suffix to file names in links

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

[ ] Workspace.  VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
[ ] Lookup.  Dendron's Lookup Command
[ ] Views.  Dendron Preview, Tree View, Side Panels in the UI
[ ] Schema.  Dendron Schemas
[x] Pod.  Data import from / export to Dendron
[ ] Publish.  External Site Publish
[ ] Markdown.  Markdown features, such as syntax support and features

Describe the bug
When wikilinks are converted into markdown links, the filename extension .md is omitted.
To Reproduce
Steps to reproduce the behavior:

Export a note containing a wikilink using Dendron: Export V2

Here is my config for reference:
podId: export-vault
podType: MarkdownExportV2
wikiLinkToURL: false
destination: /path/to/my/export/folder
convertTagNotesToLinks: false
convertUserNotesToLinks: false
addFrontmatterTitle: false

Expected behavior
[[note1]] --> ![note1 title](/note1.md) what I get is [[note1]] --> ![note1 title](/note1)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information)

OS: macOS 12.3
Browser (if with published websites; include version): [e.g. chrome, safari]
Versions (all that apply to bug):

Dendron Extension: 0.87
VS Code version: 1.65.2
Dendron CLI:

Additional context
N/A
Dendron Log file
N/A

Looking at the code, this seems to be the intended behavior for the markdown export pod.
@Harshita-mindfire Do you know why the markdown export pod omits the .md portions from the links?

This will be fixed when https://github.com/dendronhq/dendron/pull/2771 releases next week!

This should be fixed with Dendron v0.92. Feel free to comment here if that's not the case.


solidity chainID and inline assembly code not working on Hyperledger Besu smart contracts

When I'm deploying smart contract for Uniswap clone, it is working on every other network except Hyperledger Besu run Blockchain.
Inline assembly code is not working on Hyperledger Besu.
@shemnon @macfarla @ajsutton @MadelineMurray Please look into it.

Without details on the contract and your Besu setup, I would guess that you don't have all the milestones necessary in your genesis file? https://besu.hyperledger.org/en/stable/Reference/Config-Items/?h=milestone#milestone-blocks

Closing this one - assuming you have the same issue as this https://github.com/hyperledger/besu/issues/4247


$prop pass into variable why sometimes has colon in front, sometimes has no colon

Hi @xinjie-zhang
When the colon should be used, I am puzzled, would you please instruct me a bit more?
Thanks
Eric Xin

It is shorthand syntax of alphin.js x-bind directive, please refer to https://alpinejs.dev/directives/bind

Thanks for your help, I read again, and I thought I understood already.


Animations and animation state graphs do not load properly with templates

After loading a template at run-time into the scene, animated objects in the template do not play.
The issue seems to be that the animation state graph and animation assets that are linked to the objects in the template are not loaded together with the template or no loaded in the right order. Pre-loading these solves the problem, but is not ideal in terms of optimization and can be messy to keep track of.

Do you have a repro project we can take a look at please?
Generally, the template is a separate asset to the assets that are referenced so when the template is instantiated, the components should attempt to lazy load the assets used in each component.
It sounds like this may not be happening correctly with the anim component 🤔

Yeah, that's my impression. I'll try to reproduce it in a fresh project now.

Hey, managed to reproduce it now in this project: https://playcanvas.com/editor/scene/1552117

Hey, any progress on this issue?

@ellthompson I've had another look at this and it looks like the anim assets are being loaded when the template is instanced into the scene but the anim system is not started/animating when it is done.
Would the recent PR you've done for empty states also fix this as a side effect?

hmm.. interesting. Actually it looks like calling anim.rebind() some time after  load makes the animations play! (but doing it when the assets load is marked "ready" seems to be too early)

ok, my bad. That "hack" did not work. And this is still very much an issue. To get animations to play they have to be pre-loaded or manually loaded before a template using them are loaded. Otherwise they simply won't play

@ellthompson I've had another look at this and it looks like the anim assets are being loaded when the template is instanced into the scene but the anim system is not started/animating when it is done.
Would the recent PR you've done for empty states also fix this as a side effect? https://github.com/playcanvas/engine/pull/5112

I've just tried this with engine latest and it doesn't solve this particular issue.
@ellthompson Any ideas of workarounds in the short term?

ok, I found a temporary hack that worked:
When loading a template that has animations attached to it, wait a bit, then re-load and instantiate the whole thing again.

Hey, I noticed it looks like this issue has been fixed!
.. eexcept some issue with shape keys.
If you immediately trigger an animation after the entity is instantiated it plays correctly, except for the shape keys. Briefly playing another animation later on or using the anim.rebind() function on a timeout fixes the problem, making the shape keys effect visible.


Purify not pruning the css file

index.html

Foo

    Bar
    Baz

style.css
body {
    background-color: #000;
    color: #fff;
}

span#foo { font-weight: bold; }
span#bar {  color: blue; }
p {  color: red; }

In this case, it will prune p, but it will not prune span#bar, even though nothing in the html matches that selector

You mean span#foo should be deleted, right?

Yeah

I have something similar
index.html:
<!DOCTYPE html>

	<title></title>
	<link rel="stylesheet" type="text/css" href="style.css">

Purify

style.css:
body{
	margin:0 25em;
	background: #ccc;
	color:#020202;
	font-family: 'Segoe UI','Arial';
}

h1{
	color:#F2F2F2;
}

h2{
	color:red;
}

Expected outcome is that the h2 is gone.
But nothing was removed.
package.json:
{
  "name": "purifycss-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "purify":"purifycss style.css './index.html' --info --out style-pure.css"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "purifycss": "^1.1.9"
  }
}

https://github.com/purifycss/purifycss/pull/130 should fix this once it gets merged in

Note that I am seeing in #184 spurious retentions from matches to random text including in comments.


CQL-to-ELM Translator - Internal translator error

When the argument for the collapse operator is null, the CQL Translator is throwing an error.
CQL:
define CollapseIsNull: collapse null
Error:
Translation failed due to errors:
Error:[1:24, 1:36] Internal translator error.
CQL Spec: https://cql.hl7.org/09-b-cqlreference.html#collapse

Thank you for the report @sanumula

Addressed in 1.4.9 release


updated the contents to Docker EE for AWS and removed Quickstart link

/cc @joaofnfernandes

@uday-shetty the change should go live any minute now. Hopefully this is keep people from pinging you 😁

great!


[Detect From Image], [Add Background Image] functionality not working properly in Firefox

Describe the bug
In Firefox, when using "Detect from Image", the detection result cannot be output normally for the first time (the height of the feedback area becomes zero), and the pose detection result can be output for the second time, but the node connection (or display) is wrong.
"Add Background Image" behaves the same as “Detect from Image".
To Reproduce
Steps to reproduce the behavior:

Open SD WebUI with Firefox
Go to 'OpenPose Editor'
Click on 'Detect From Image' and 'Choose one picture'
See error

Expected behavior
After the first detection is completed, the detection result can be output correctly.
Screenshots
Initial UI (everything is normal):

First try (feedback area disappears):

Network debug info on first try (nothing wrong with backend data transfer):

Second time (feedback area restored, weird detection result output):

Network debug info on second time (backend data transfer goes normal):

Environment

OS: Fedora 28 x86_64
Browser: Firefox 105.0

Additional context
In Chrome 104.0.5112.101, it works as expected.

After a few attempts, I found a simple workaround (without upgrading Firefox), DO IT AGAIN.


Allow function calls on user-provided functions

It would be kinda verbose, but pretty useful potentially.

Supported since v2.


make clarifications and fix typos

Thanks so much for taking the time to go through this short guide AND to make improvements!


[NEW ALGORITHM] : Prime Number in C

Issue will be closed if:

You mention more than one algorithm. You can create a separate issue for each algorithm once the current one is completed.
You propose an algorithm that is already present or has been mentioned in a previous issue.
You create a new issue without completing your previous issue.

Note: These actions will be taken seriously. Failure to follow the guidelines may result in the immediate closure of your issue.

Name:
Finding the Prime numbers from 1 to N.
About:
The Prime Numbers are essential for many problems and is one of the common and famous problems. Finding the Prime numbers from 1 to N can be used in various aspect.

Labels:
new algorithm, gssoc-ext, hacktoberfest, level1

Assignees:

[x] Contributor in GSSoC-ext
[x] Want to work on it

@pankaj-bind Please assign this issue to me as soon as possible so that i can open new issue for other algorithm as i have an idea.


Dev 22 - Added storybooks to the project

Please make sure these boxes are checked before submitting your PR, thank you!

[x] Make sure all the tests are still passing.
[x] Make sure the test coverage is still 100%.
[x] Make sure your source branch is correct.
[x] Make sure your destination branch is devel.
[x] Make sure the name of the PR has a correct DEV-# identification prefix.
[ ] Make sure you reviewed all your changes and they look correct.
[x] Make sure all the commits have a correct format.
[x] Make sure you refer related issues for you PR.
[x] Make sure you add KovDimaY as a reviewer and assignee of your PR.

Take a look at the Issue #32

Coverage remained the same at 100.0% when pulling e2572137c0f4689e30caff2479343c96b1dc7b32 on DEV-22 into c80bd7854bdbe173cb85f7714bc6ec4553ec5347 on devel.


Licensing for commercial use - how to contact you?

💡 Your Question
Hello,
There are multiple LICENSE files in your repository and it is unclear to me which license applies. Two files state that if we want to use your code commercially we should contact you. However, your web page does not exist anymore and we cannot find any way how to contact you. Could you please advise us?
Thank you,
Petr
Versions
No response

i may be in stand by cuz NVIDIA bought Deci-AI

That's definitely the reason. I hope that Nvidia fully open sources this project, but not sure, so good to leave this question up in case anyone ever comes back to answer it.


GraphQL: Add support for keys to Maps

This adds a keys argument to Map types. This allows you to get
multiple entries in one line:
{
  root {
    elements(keys: ["a", "c"]) {
      key
      value
    }
  }
}

Outputs:
{
  "data": {
    "root": {
      "elements": [
        {"key": "a", "value": 1},
        {"key": "c", "value": 3}
      ]
    }
  }
}

If keys is present all other args are ignored.
Issue #3227

@aboodman PTAL at the changes to MapIterator
@rafael-atticlabs PTAL at the GraphQL specifics

@kalman Since @rafael-atticlabs needs some rest...

Codecov Report

Merging #3237 into master will decrease coverage by -0.01%.
The diff coverage is 89.18%.

Impacted Files
Coverage Δ

go/ngql/query.go
100% <ø> (ø)
:white_check_mark:

go/types/map_iterator.go
100% <100%> (ø)
:white_check_mark:

go/types/map.go
93.71% <100%> (ø)
:white_check_mark:

go/ngql/types.go
92.77% <87.09%> (-0.52%)
:x:

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 9d3a972...205ae6b. Read the comment docs.


PDFThumbnailProvider crashing

Microsoft PowerToys version
0.67.0
Installation method
PowerToys auto-update
Running as admin
Yes
Area(s) with issue?
File Explorer: Thumbnail preview
Steps to reproduce
PowerToysReport_2023-02-03-14-23-41.zip

As soon as I open my file explorer, this error pops up.
✔ Expected Behavior
No response
❌ Actual Behavior
No response
Other Software
Quick Look for preview of PDF files

Hi, is there something specific with the file pdf file Explorer is trying to generate thumbnail for? Does this happen whenever you try to open Explorer or with some specific directory?
/needinfo

Hello,
There is no specific file here. As soon as I open my file explorer, and move to a folder where there are PDF's, this error pops up. It also pops up when I scroll up and down within the folder. I've also seen that this error pops up when I generated a PDF file. So it basically seems like whenever I move to a folder with PDF, this error pops up.

This issue has been fixed in the 0.67.1 release. Please update PowerToys to get it. Thank you!


hal_silabs: hci_uart sample no longer builds

Describe the bug
As reported here:

hci_uart sample no longer builds for me on efr32bg22_brd4184a/efr32bg22_brd4184b boards and ends with error
modules/hal/silabs/zephyr/include/sl_bt_ll_zephyr.h:11:10: fatal error: sl_hci_common_transport.h: No such file or directory

This is because https://github.com/zephyrproject-rtos/hal_silabs/pull/42 has been merged but https://github.com/zephyrproject-rtos/zephyr/pull/62832 has not.
To Reproduce
west build -b efr32bg22_brd4184a samples/bluetooth/hci_uart

Expected behavior
Build successfully
Impact
Apps for the Silabs Gecko using radio cannot be built.

cc @fkokosinski @pepe2k


Diverse UI-Anpassungen

Feature description

Problem and motivation

Is this something you're interested in working on

GEschlossen, Duplikat zu https://github.com/corona-warn-app/cwa-quick-test-frontend/issues/162


#46: Create sidebar menu and display icon for evergreen

Shouldnt be merged until we are ready to add functionality for the sidebar as well

Hold until #9 is merged

@alexhoffman617 can you resolve the merge conflict?

@alexhoffman617 can you resolve the merge conflict?

@duluca fixed merged conflicts for my branches


Certain topics not publishing data

Hi all,
I have checked driver in ROS Indigo repositories (sudo apt-get install ros-indigo-astra-launch) and also compiling from source.
The driver works, but there are topics that appear doing "rostopic list" that do not publish any data. In my case, these are:
/camera/depth_registered/points
/camera/depth_registered/sw_registered/*
/camera/rgb/*
This means there is not color images, neither RGB-D pointclouds.
Best,
Alberto

hi
there are main two type products, astra adn astra pro. i don't know which type you have.
1,astra  using rgb by openni . you can get rgb and points from drivers.
2,astra pro.  with a separate uvc camera, you must get rgb data by your self, such as luvcview.

刘华
座机：0755-86329228
<EMAIL_ADDRESS>手机：13603061506
深圳奥比中光科技有限公司 www.orbbec.com.cn
地址：深圳市南山区粤兴三道8号中国地质大学产学研基地中地大楼A808
From: alberto-tellaeche
Date: 2016-11-03 20:00
To: orbbec/ros_astra_camera
Subject: [orbbec/ros_astra_camera] Certain topics not publishing data (#10)
Hi all,
I have checked driver in ROS Indigo repositories (sudo apt-get install ros-indigo-astra-launch) and also compiling from source.
The driver works, but there are topics that appear doing "rostopic list" that do not publish any data. In my case, these are:
/camera/depth_registered/points
/camera/depth_registered/sw_registered/*
/camera/rgb/*
This means there is not color images, neither RGB-D pointclouds.
Best,
Alberto
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Hi, thanks for the fast response !
In my case I have an Astra Pro.
I understand your answer, this means ROS driver is not supporting RGB data from the sensors. However, I think it could be extremely helpful to have this colour information from the ROS driver somehow encapsulated, I mean, launch the driver and have all the sensor capabilities in topics, colour included (for example for RGB-D colour and pointcloud registration). Is this planned on the driver development?
If this is not planned, it could be a good idea to remove the topics that are not being used from the list of publishers, just to avoid misunderstandings..
Cheers,
Alberto

you can visit http://wiki.ros.org/uvc_camera,  use this module publish rgb data.
it's goo idea to disable the rgb topic for astra pro.  we will update it next version. thanks!

刘华
座机：0755-86329228
<EMAIL_ADDRESS>手机：13603061506
深圳奥比中光科技有限公司 www.orbbec.com.cn
地址：深圳市南山区粤兴三道8号中国地质大学产学研基地中地大楼A808
From: alberto-tellaeche
Date: 2016-11-04 16:35
To: orbbec/ros_astra_camera
CC: ob-tim-liu; Comment
Subject: Re: [orbbec/ros_astra_camera] Certain topics not publishing data (#10)
Hi, thanks for the fast response !
In my case I have an Astra Pro.
I understand your answer, this means ROS driver is not supporting RGB data from the sensors. However, I think it could be extremely helpful to have this colour information from the ROS driver somehow encapsulated, I mean, launch the driver and have all the sensor capabilities in topics, colour included (for example for RGB-D colour and pointcloud registration). Is this planned on the driver development?
If this is not planned, it could be a good idea to remove the topics that are not being used from the list of publishers, just to avoid misunderstandings..
Cheers,
Alberto
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.


Add user friendly description to internal delta queries

to make Spark UI easier to follow
Delta operation generates multiple queries to manage the transaction log.
For example
val data = spark.range(0, 15)
data.write.format("delta").save("/tmp/delta-table")
val df = spark.read.format("delta").load("/tmp/delta-table")

import io.delta.tables._
import org.apache.spark.sql.functions._
val deltaTable = DeltaTable.forPath("/tmp/delta-table")
deltaTable.delete(condition = expr("id == 0"))

executes several "housekeeping" queries.  This enhancement makes it easier to figure out which is which.
"Default Names" and "Enhanced Names" screen shots show the before and after UI.  (Stack traces shown in the UI are not useful here)
"Default Names"

"Enhanced Names"

Closes https://github.com/delta-io/delta/issues/528

Hi,
@tdas @brkyvz any chance you can look at this?

Thanks @ekoifman I plan to take a look by tomorrow the latest. Sorry for the delay


Add connected SWA node to local project tree

This touches some of the same code as https://github.com/microsoft/vscode-azurestaticwebapps/pull/304 but I wanted to get some early feedback on this.

I opted to add a link to the SWA tree item (not the SWA tree item itself) because I could see problems keeping duplicate tree items in sync.
findStaticWebAppTreeItem uses WebSiteManagementClient to find the static site and then uses that to create the StaticWebAppTreeItem we're looking for. This should be faster than finding the tree item directly (by using SubscriptionTreeItem.loadAllChildren) because we're just making API calls instead of creating all the tree items.

I like this idea. It makes sense to not have a duplicate tree item when the original tree item accessible in the same window.

Closing due to local project pivot


[GraphQL] getOAMComponents queryType

Signed-off-by: Piyush Singariya<EMAIL_ADDRESS>Description
This PR implements a part of #5167
Notes for Reviewers
Signed commits

[ ] Yes, I signed my commits.

Those pesky lint failures...

Codecov Report

Merging #5267 (817f489) into master (e4f0ff2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5267   +/-   ##
=======================================
  Coverage   17.39%   17.39%
=======================================
  Files         107      107
  Lines        9824     9824
=======================================
  Hits         1709     1709
  Misses       7694     7694
  Partials      421      421

Flag
Coverage Δ

e2etests
?

gointegrationtests
6.00% <ø> (ø)

unittests
13.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out 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 dc87302...817f489. Read the comment docs.

@piyushsingariya a couple of examples put into docs.meshery.io in the api guide will go a long way.


Pods allocation on a WorkerNode reservation

Description
What problem are you trying to solve?
Will be nice to have a way to reserve some Pods allocation on the WorkerNodes: currently, having consolidationPolicy: WhenUnderutilized makes Karpenter to pur Pods on Nodes around 100% of a Node Pods Allocation capacity.
Then, when a new Pod(s) are created, they have to wait while Kaprnter will spin up a new Nodes.
How important is this feature to you?
It's close to a critical feature, as affects the overall cluster's stability.

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment

Closing as duplicate of https://github.com/kubernetes-sigs/karpenter/issues/749


Release with Xcode 9.1

As Xcode 9.1 ships with Swift 4.0.2 which is not ABI compatible with Swift 4 we need to make a release built with it so that swift templates continue to work. I guess few next releases should contain both binaries, built with Swift 4 and Swift 4.02 to support those who updated and not at the same time.

+1

+1

+1

Have some issues running rake task for new release. Will investigate them later or perform steps manually.

+1

The last release was by using Xcode 9.2.


Add reference of Subscription to ChannelSubscriberSpec

Expected Behavior
When adding a ChannelSubscriberSpec it's not possible to currently have duplicate subscriptions and it is probably better to include either an ObjectRef or something like that as part of the entry being added to the list so that Subscription Controller can keep track of Subscription -> Entry in the list of subscribers.
// ChannelSubscriberSpec defines a single subscriber to a Channel.
// CallableDomain is the endpoint for the call
// SinkableDomain is the endpoint for the result
// One of them must be present
type ChannelSubscriberSpec struct {
// +optional
CallableDomain string json:"callableDomain,omitempty"
// +optional
SinkableDomain string json:"sinkableDomain,omitempty"
}
Right now for example it's not possible to have duplicate Subscriptions because of this. Well, at least not correctly without complicating things (like refcounting).
@grantr @n3wscott
Actual Behavior
Steps to Reproduce the Problem

Additional Info

@evankanderson

Ah -- you're saying that it's impossible to set up two subscriptions from A calling C if you want to call C twice for some reason. (I'm not sure why you would do this, but it seems like two subscriptions should cause two messages to be delivered.)
Adding the subscription name (either as ObjectReference or namespace+name string(s)) to the ChannelSubscriberSpec would seem to fix this, and would make it somewhat easier to handle individual deltas. I think there may still be a tricky question on how to remove stale channels if we miss a Subscription delete edge.

I'm going to play with this tomorrow. I think we wouldn't necessarily remove a subscription unless we remove channels (via finalizers?)
I think it might be better to use ObjectReference instead of namespace/name (which was actually my first thought) in case there's other objects later on that can create subscriptions. Thoughts?


Missing Switches

There are a lot of missing switches here.
Instead of listing the missing items, I'm going to just post to the full set. /Transport is what I am referencing specifically. If you compare you can see the missing items.
[/Transport]
Configures settings used by transport server (when you install
only the Transport Server role service).
[/ObtainIpv4From:{Dhcp | Range}]
Specifies the source of IPv4 addresses.
[/Start:<Start IPv4 Address>]
    Specifies the start of the IP address range. This is required
    if /ObtainIpv4 is set to Range.

[/End:<End IPv4 Address>]
    Specifies the end of the IP address range. This is required if
    /ObtainIpv4From is set to Range.

[/ObtainIpv6From:Range]
Specifies the source of IPv6 addresses. The only supported
value is Range.
[/Start:<Start IPv6 Address>]
    Specifies the start of the IP address range. This is required
    when /ObtainIpv6From is set to Range.

[/End:<End IPv6 Address>]
    Specifies the end of the IP address range. This is required
    when /ObtainIpv6From is set to Range.

[/PortPolicy:{Dynamic | Fixed}]
Specifies the UDP port policy to use.  Set this to Dynamic for
obtaining ports dynamically from Winsock.  Set this to Fixed
for using ports from a fixed range.
[/StartPort:<Start Port>]
Specifies the start of the port range.
[/EndPort:<End Port>]
    Specifies the end of the port range.  This is required when
    /PortPolicy is set to Fixed.

[/Profile:{10Mbps | 100Mbps | 1Gbps | Custom}]
Specifies the network profile to use.  Note: This option is
only available for servers running Windows Server 2008 or
Windows Server 2003.
[/MulticastSessionPolicy]
Configures transfer settings for multicast transmissions.
[/Policy:{None | AutoDisconnect | Multistream}]
    Determines how to handle slow clients.  None means to keep all
    clients in one session at the same speed.  AutoDisconnect
    means that any clients that drop below the specified
    /Threshold will be disconnected.  Multistream means clients
    will be separated into multiple sessions as specified by
    /StreamCount.

[/Threshold:<Threshold in KBps>]
    For /Policy:AutoDisconnect, this option sets the minimum
    transfer rate in KBps.Clients that drop below this rate will
    be disconnected from multicast transmissions.

[/StreamCount:{2 | 3}]
    For /Policy:Multistream, this option determines the number of
    sessions.  2 means two sessions (fast and slow) 3 means three
    sessions (slow, medium, fast).

[/Fallback:{Yes | No}]
    Determines whether clients that are disconnected will continue
    the transfer using another method (if supported by the
    client). If you are using the WDS client, the computer will
    fallback to unicasting.  Wdsmcast.exe does not support a
    fallback mechanism. This option also applies to clients that
    do not support Multistream. In that case, the computer will
    fall back to another method instead of moving to a slower
    transfer session.

[/TftpMaximumBlockSize:<Block size>]
Specifies the maximum block size that the TFTP server can use.
[/EnableTftpVariableWindowExtension:{Yes | No}]
Specifies if the TFTP variable window extension is enabled.

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

ID: 03b393e6-b22c-d6ed-eda8-d2dc50e62680
Version Independent ID: 77e487c6-711c-f1eb-7560-6e7b9f26c677
Content: Subcommand set-Server
Content Source: WindowsServerDocs/administration/windows-commands/subcommand-set-server.md
Product: windows-server-threshold
Technology: manage-windows-commands
GitHub Login: @coreyp-at-msft
Microsoft Alias: coreyp

Thanks for your dedication to our documentation. If we have been unable to review your issue in a timely manner, we sincerely apologize for the delayed response. We have captured the informtion you have provided for review. We are closing this issue for now, but if you feel that it's still a concern, please respond and let us know. If you determine another possible update to our documentation, please don't hesitate to reach out again. #please-close


Some question about zf2

Hello
we have project by zf2 ( https://github.com/pi-engine/pi ) but we can not update project to zf3 before next summer .
I have some questions :
1- what is last version of zf2 ? 2.4.10 or 2.5.1 or ... ?
2- will we have any new version of zf2?
3- zf2 have full support of php7? or not and if not do you make any version for full support php7?
thanks

1- what is last version of zf2 ? 2.4.10 or 2.5.1 or ... ?

2.5.3 is the latest 2.x version

2- will we have any new version of zf2?

You can only expect bugfix releases for critical or security bugs.

3- zf2 have full support of php7? or not and if not do you make any version for full support php7?

Yes, it supports PHP 7.

thank you very much how I can get zend 2.5.3 ? by composer create-project -sdev --repository-url="https://packages.zendframework.com" zendframework/skeleton-application ./ 2.5 I get 2.5.1

You can only expect bugfix releases for critical or security bugs.

How I can get news about it?
thanks for replay

Don't use --repository-url="https://packages.zendframework.com"
Try composer create-project zendframework/skeleton-application:^2.5


Adsk Contrib - Create optimized processor

Add a function to create an optimized version of a Processor.
This can be used for debug purposes to inspect how a Processor is optimized (for CPU or GPU). Processor could be optimized and written (or converted to transform).
Signed-off-by: Bernard Lefebvre<EMAIL_ADDRESS>

Following the two-weeks rule, here is a friendly reminder that the branch can be merged this week unless there are some objections.


trailingSemicolon linter breaks for @media queries with vars inside

Basic media query code as the one below errors with the message "All property declarations should end with a semicolon" on the second to last semicolon.
@media screen and ( max-width: 768px ){
    @color: red;

    .div {
        color: @color;
    }
}

Hmm, interesting. It seems to be confused by the variable declaration. Just setting red as a value works as expected, i.e.
@media screen and ( max-width: 768px ){
    .div {
        color: red;
    }
}

works.
I'll take a look!


Guidelines for Shared module

From andrew.hankinson on September 08, 2011 10:45:10
Filing a reminder issue for guidelines for the shared module
Original issue: http://code.google.com/p/music-encoding/issues/detail?id=8

From andrew.hankinson on May 11, 2012 10:39:53
Status: Started

From andrew.hankinson on September 08, 2011 07:46:20
Labels: -Priority-Medium Priority-High Milestone-ReleaseNext

From<EMAIL_ADDRESS>on May 24, 2012 07:30:05
Status: Needs-Review

From andrew.hankinson on September 10, 2012 11:30:44
Fixed in MEI 2012 2.0.0. Closing.
Status: Fixed


ReferenceError: Worker is not defined

Hi, I have recently tried to use this package in react 18, but I got an error called "Worker is not defined".
Here is the package.json:
[...]   "dependencies": {     "next": "12.2.3",     "react": "18.2.0",     "react-dom": "18.2.0",     "react-icons": "^4.4.0",     "react-media-recorder": "^1.6.6"   },   "devDependencies": {     "@types/node": "18.6.3",     "@types/react": "18.0.15",     "@types/react-dom": "18.0.6",     "eslint": "8.21.0",     "eslint-config-next": "12.2.3",     "typescript": "4.7.4"   } }
And the element I put the record in is:

    <p>{status}</p>

    <button onClick={startRecording}>Start Recording</button>

    <button onClick={stopRecording}>Stop Recording</button>

    <video src={mediaBlobUrl} controls autoPlay loop />

Any solution ?

Error also exists on my end. Here's package.json dependencies
{
    "@emotion/react": "^11.10.6",
    "@emotion/styled": "^11.10.6",
    "@mui/icons-material": "^5.11.11",
    "@mui/lab": "^5.0.0-alpha.124",
    "@mui/material": "^5.11.15",
    "axios": "^1.3.4",
    "eslint": "8.37.0",
    "eslint-config-next": "13.2.4",
    "next": "13.2.4",
    "prop-types": "^15.8.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-media-recorder": "^1.6.6",
    "styled-components": "^5.3.9",
    "uuid": "^9.0.0",
    "zustand": "^4.3.7"
  }

try this in nextjs:
const ReactMediaRecorder = dynamic(() => import('react-media-recorder').then((mod) => mod.ReactMediaRecorder), {
  ssr: false,
});

Did you use within a class component?  Could you possibly share your component code setup?  Thanks!
Tried the useReactMediaRecorder with hooks and this is not working..
const useReactMediaRecorder = dynamic(
() => import("react-media-recorder").then((mod) => mod.useReactMediaRecorder),
{
ssr: false,
}
);

ReferenceError: dynamic is not defined
getting this error in next js.
Any help on this?

ReferenceError: dynamic is not defined getting this error in next js. Any help on this?

need to import dynamic from "next/dynamic".
import dynamic from "next/dynamic";

try this in nextjs:
const ReactMediaRecorder = dynamic(() => import('react-media-recorder').then((mod) => mod.ReactMediaRecorder), {
  ssr: false,
});

then how we can import this useReactMediaRecorder hook if we get the same error

Here is my solution for hooks related to useReactMediaRecorder or class-base too:
Assume we have a custom component called CustomMediaRecorder that uses useReactMediaRecorder. We want to use this component in the current component.
 const CustomMediaRecorder = dynamic(
  () => import('..../CustomMediaRecorder'),
  {
    ssr: false,
  }
);

NB. CustomMediaRecorder can be a class-based or functional component. Import it into your current component like the code snippet above shows.

what is the solution for Remix based projects?

@rorlich since the workaround seems to exclude the part from rendering on server side, you can use the client side rendering of Remix. See here https://remix.run/resources/remix-utils#clientonly

How do we get the hook? useMediaRecorder? I am trying to do it with below code to set the state. But it never works. Any suggestions?
  useEffect(() => {     import("..").then((module) => {       const { useReactMediaRecorder } = module;       setUseMediaRecorder(useReactMediaRecorder);     });   }, []);

I solve this problem by dynamic import them component A containing useMediaRecorder
const componentA = dynamic(() => import('@/components/a').then((mod) => mod.default), {     ssr: false,   });

add
'use client'
top of the component.
Is it solve?

add 'use client'
top of the component. Is it solve?

That did the trick for me...😃

How do we get the hook? useMediaRecorder? I am trying to do it with below code to set the state. But it never works. Any suggestions?
useEffect(() => { import("..").then((module) => { const { useReactMediaRecorder } = module; setUseMediaRecorder(useReactMediaRecorder); }); }, []);

Does anyone has this working in NextJS and has an example of it? I'm getting an Unhandled Runtime Error. 🙁 I can get the react-media-recorder working in my local environment, but every time I'm deploying to Vercel it fails.

same error with nextjs
workder is not defined error on build

I am using NextJS 14.1.1.
What I did was created a separate component for AudioRecording named AudioRecording.tsx having 'use client' on the top.
Imported this component dynamically

import dynamic from "next/dynamic";

const AudioRecorder = dynamic(() => import("./AudioRecorder"), { ssr: false });

And used it like
<AudioRecorder
  onRecordingComplete={(file) =>
    // my state update
  }
  isRecording={false}
/>

and I got it to work without giving build time errors


[Scenarios - FlightItinerary.Json] - Voice Over is not conveying the complete name for the days under 2 Stops and Non- stop.

Target Platforms
iOS
SDK Version
Version 1.0(2.4.0-beta.<IP_ADDRESS>)
Application Name
Adaptive Cards
Problem Description
Test Environment:
Device: iPhone 11
iOS: 15.6.1
Application: Adaptive Cards
App Version: Version 1.0(2.4.0-beta.<IP_ADDRESS>)
Screen Reader: Voice Over
Repro Steps:

Launch Adaptive Cards iOS application.
Home screen will appear.
Activate voice over
Navigate to "V1.0" control and select it.
Navigate to 'Scenarios' control and activate it.
Navigate to 'FlightItinerary.json' under 'Elements' list item and activate it.
Navigate to Date and Time details under 2 stops and observe the issue.

Actual Result:
Voice over is conveying incomplete information about the days while navigating to the date and time details under 2 stops and Non stops, Voice over is announcing as 'Tue comma May 30 comma 2017 12 colon 25 PM'.
Expected Result:
Voice over should convey the complete day name information to the user and it should announce as 'Tuesday comma May 30 comma 2017 12 colon 25 PM'
Notes:
Issue is repro throughout application.
User Experience:
It will impact the screen reader user as they will not get to know about the day and get confused about the date information.
MAS Reference:
https://liquid.microsoft.com/Web/Object/Read/MS.Accessibility/Requirements/01.03.01
"Have feedback to share on Bugs ? Please help fill Trusted Tester Bug Feedback (office.com) “
Screenshots
https://user-images.githubusercontent.com/95913748/190315630-81dce0d9-85f7-406f-a889-1c46a78f13a8.MP4
Card JSON
NA

Sample Code Language
No response
Sample Code
No response

Now, this issue is tracked using below URL, hence closing this issue.
https://github.com/microsoft/AdaptiveCards-Mobile/issues/41


Filtering places by distance from user

As an unregistered user I want to filter places in the sidebar list by distance form me so that I can narrow down my search.
Acceptance criteria:

WHEN an unregistered user access an application popup with access or block location.

If Unregistered user allows access to his location for an application, THEN system defines location of user automatically and display marker of user location on the map.

Unregistered user can put location marker on the map.

If unregistered user does not put marker on the map, system shall calculate distances to places from default marker.

Marker of location shall be different than marker of place. (For example blue colored).

"Filter by" button in available above the sidebar list with places for Unregistered user.

WHEN an unregistered user clicks "Filter by" button, THEN panel with filtering options is opened.

Panel with filtering contains third option "In radius from you" that have input field (number type) with placeholder "km" and next regex:
a. Value shall be positive;
b. Max value shall be 500 km

"Apply" and "Cancel" button shall be displayed on the bottom of filtering panel.

WHEN an unregistered user set highest value of distance AND click "Apply" button, THEN system shall:
a. display places in the sidebar list and on the map, which are in defined radius from current user location/ putted marker by user/ default marker location.
(For example, when an unregistered user fill in a value  as 5 km, then system shall display places in the sidebar list, which are in radius 5 km)
b. display circle as filtered radius from marker of user location/default location;
c. filtered places shall be visible inside of circle

An unregistered user can click "Cancel" button on the filtering panel.

WHEN an unregistered user fills in highest value and clicks "Cancel" button, THEN filter shall not be applied.

WHEN an unregistered user applied filter by distance and clicks "Cancel" button, THEN system shall display all available places on the map.

WHEN unregistered user applied filter by distance and then zoom in/out the map, system shall hold filtered result AND shows nothing else.

This user story relates to #147

Not relevant.


Use Staticcheck instead of golint

NOTE: Golint is deprecated and frozen. There's no drop-in replacement for it, but tools such as Staticcheck and go vet should be used instead. from https://github.com/golang/lint/blob/master/README.md

@t25kim This is a very good idea. I have already started using Staticcheck for analysis. There are many comments from the Staticcheck and I will try to fix the part in the near future and turn on the Staticcheck for automatic analysis.
Thank you for advised it!
On the other hand, I propose a lint to not be excluded as it is also useful and used in the Go report system and we have the lowest indicators on it. golint->76% (https://goreportcard.com/report/github.com/lf-edge/edge-home-orchestration-go).


Handling of all active listeners

It's sometimes hard to keep an overview of all started listeners and it gets more difficult with the new wildcard *.
Would it be possible to get something like /live/get/allactivelisteners and /live/stop/allactivelisteners ?
Probably this is only for development purposes and may be too much work to implement as listeners "belong" to different .py files, right?

Yeah, I think this would be a fairly heavy lift and only possible with a fair bit of added code to track listener creation/destruction on the AbletonOSC side (as the Ableton API itself has no way to query this). Closing unless a very strong reason arises to do this.


Enforce Data Frame Schema

Enforce DataFrame Schema
Scope

Add function enforce_dtypes() that returns a DataFrame with a guaranteed set of columns with known type.
Modifies list_files() and list_categories() to return a type consistent DataFrame.

Background
Converting the results of a GET request from '../list.json' to pd.DataFrame returns a reliable DataFrame only when the list is non-empty. If the list is empty, it results in a DataFrame with no columns, which can cause downstream errors.
cc_client = CashCtrlClient()
df = pd.DataFrame(cc_client.get('journal/list.json')['data'])

Refer to the Type Consistency section in the CONTRIBUTING.md for more details.

Here's a review by ChatGPT:
  Click for instructions given to ChatGPT
> Review this Python unit and the corresponding unit test.
[Uploaded enforce_dtypes.py and test_enforce_dtypes.py]

> Provide as downloadable markdown file

enforce_dtypes.py Review
Functionality

Inputs:

data: a pandas DataFrame or None
required: dictionary mapping column names to their required data types
optional: dictionary mapping column names to optional data types
keep_extra_columns: boolean to keep or drop extra columns

Outputs:

Returns a DataFrame with enforced data types for specified columns and handles the presence of required columns.

Error Handling

Throws ValueError if required columns are missing.
Throws TypeError if data type conversion fails.

Type Conversion Specifics

Manages timezone conversions for datetime types.
Uses pandas' astype() for other data types.

Code Structure

Well-structured with clear separation of functionality.

Documentation and Examples

Includes comprehensive docstrings with detailed descriptions and examples.

test_enforce_dtypes.py Review
Test Cases

General Functionality: Tests for empty input, required and optional columns addition, and behavior of keep_extra_columns flag.
Error Handling: Verifies the handling of missing required columns and invalid data type conversions.
Datetime Handling: Tests adding datetime columns with and without timezone information, and handling of invalid datetime formats.

Coverage and Robustness

Comprehensive coverage of scenarios including null inputs, data type enforcement, error handling, and datetime conversions.

Improvement Suggestions

Additional Edge Cases: Test for mixed data types within columns.
Performance Testing: Consider testing with large data sets.
Documentation: Enhance readability with inline comments or descriptive test function names.

Implements first step in macxred/cashctrl_ledger#2.


Add Edit/Delete buttons to Note Detail UI view

Environment

Nautobot version:
nautobot-circuit-maintenance version: 0.4.3

Proposed Functionality
Add Edit and Delete buttons in the Note Detail view
Use Case
Easier access to these actions

won't do because notes will be deprecated to use Nautobot default ones


Added a "Better Scroll-to-top button" with fixed position

Hey @subhadipbhowmik
I have added the scroll to top button and changed the position
Closes #223
Result:

The button only appear after the user has scrolled down a certain distance from the top of the page
Designed as a small, round button with an arrow icon pointing upwards.
Styling that matches the website’s overall design, with appropriate hover effects.
When clicked, the button will smoothly scroll the user back to the top of the page.

https://github.com/subhadipbhowmik/30-Days-Of-CPP/assets/101971980/e45bafc2-f036-40d1-b7e9-a15137ec1ded
Please take a look and review it, Thank You!!

please merge the PR @subhadipbhowmik


Compilation of 0.3.0 seems to be broken on macOS

It seems that version 0.3.0, currently released on crates.io, is broken:
   Compiling mmap-rs v0.3.0
error[E0599]: no associated item named `MAP_JIT` found for struct `UnsafeMmapFlags` in the current scope
   --> /Users/antek/.cargo/registry/src/github.com-1ecc6299db9ec823/mmap-rs-0.3.0/src/os_impl/unix.rs:293:56
    |
293 |           if self.unsafe_flags.contains(UnsafeMmapFlags::MAP_JIT) {
    |                                                          ^^^^^^^ associated item not found in `UnsafeMmapFlags`
    |
   ::: /Users/antek/.cargo/registry/src/github.com-1ecc6299db9ec823/mmap-rs-0.3.0/src/lib.rs:18:1
    |
18  | / bitflags! {
19  | |     /// The available flags to configure the allocated mapping.
20  | |     pub struct MmapFlags: u32 {
21  | |         /// May initially map the pages as shared between multiple mappings, but creates a private
...   |
76  | |     }
77  | | }
    | |_- associated item `MAP_JIT` not found for this

I can see that this issue has been already resolved (i.e. I'm able to compile the git version on macOS without problems), but do you have any plans of releasing the fixed version to crates.io?

Thanks for the reminder! 0.4.0 is now available on crates.io.


Update contributing [skip ci]

Current coverage is 96.77% (diff: 100%)

Merging #108 into master will not change coverage

@@             master       #108   diff @@
==========================================
  Files            19         19
  Lines          3130       3130
  Methods         320        320
  Messages          0          0
  Branches        800        800
==========================================
  Hits           3029       3029
  Misses          101        101
  Partials          0          0

Powered by Codecov. Last update dc56c0b...25dbfd7


add support for more than one driver at a time

should already work... just test coverage needed...


Setting only one of BGFX_CONFIG_RENDERER_* flags to 0, disables the others as well

When trying to strip one or more renderers from BGFX by setting the specific BGFX_CONFIG_RENDERER_*-flag to 0, all the others will be set to 0 as well, if you didn't explicitly set them to 1 before.
Is this the wanted behavior? I just wanted to exclude D3D12-support, because I'm missing the header at the moment, and thought the others would still be seen as valid, as they all are default to a compile-time check, rather than off.

Yes this is intentional. You define what you want, not inverse.
Just define all renderers you want:
BGFX_CONFIG_RENDERER_OPENGL=1
BGFX_CONFIG_RENDERER_DIRECT3D9=1
...

Allright, the default setting of "use whatever seems possible" just confused me then. Keep up the good work!


bugfix: fix shenyu-admin-dist start.sh and shenyu-bootstrap-dist star…

fix shenyu-admin-dist start.sh and shenyu-bootstrap-dist star.sh

Make sure that:

[ ] You have read the contribution guidelines.
[ ] You submit test cases (unit or integration tests) that back your changes.
[ ] Your local test passed mvn clean install -Dmaven.javadoc.skip=true.

Codecov Report

Merging #1468 (039a041) into master (c777e5b) will decrease coverage by 0.52%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1468      +/-   ##
============================================
- Coverage     63.93%   63.40%   -0.53%
+ Complexity     2043     2037       -6
============================================
  Files           407      407
  Lines          8797     8797
  Branches        880      880
============================================
- Hits           5624     5578      -46
- Misses         2755     2801      +46
  Partials        418      418

Impacted Files
Coverage Δ
Complexity Δ

...enyu/client/tars/TarsServiceBeanPostProcessor.java
31.70% <0.00%> (-51.22%)
8.00% <0.00%> (-6.00%)

...henyu/plugin/httpclient/NettyHttpClientPlugin.java
57.14% <0.00%> (-2.05%)
10.00% <0.00%> (ø%)

...che/shenyu/sync/data/http/HttpSyncDataService.java
63.72% <0.00%> (-1.97%)
12.00% <0.00%> (ø%)

...elimiter/handler/RateLimiterPluginDataHandler.java
69.23% <0.00%> (-1.54%)
14.00% <0.00%> (ø%)

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 c777e5b...039a041. Read the comment docs.


Price Model for service with simple functions

Hi guys,
Summary
I would like to know if it is possible to define the price of a service based on simple functions; for example, if I have an integer among the parameters, I would like to calculate the price based on the units (Eg PARAM = 100, Price = 100 * UNIT_VALUE)
If it is already possible how can it be configured?
Details
in the XML file of the Technical Service I have to enter variable values (e.g. number of VMs, size of storage, etc.), the price varies based on these values, so I would like to define the value per unit (e.g. cost of a single VM, cost of 1Gb) and then calculate the price.
Acceptance criteria
Precise and detailed conditions under which a feature request is considered to be completed.
Additional context
EXAMPLE of XML:
<ParameterDefinition configurable="true" id="DATA_DISK_SIZE" mandatory="false" maxValue="500" minValue="20" valueType="INTEGER">
    <LocalizedDescription locale="en">Data disk size in Gigabyte</LocalizedDescription>
    <LocalizedDescription locale="de"/>
    <LocalizedDescription locale="ja"/>
  </ParameterDefinition>
<ParameterDefinition configurable="true" default="DEV" id="TYPE_OF_STORAGE" mandatory="false" valueType="ENUMERATION">
    <Options>
      <Option id="DEV">
        <LocalizedOption locale="en">Development</LocalizedOption>
      </Option>
      <Option id="PROD">
        <LocalizedOption locale="en">Production</LocalizedOption>
      </Option>
    </Options>
    <LocalizedDescription locale="en">Type of Storage</LocalizedDescription>
    <LocalizedDescription locale="de"/>
    <LocalizedDescription locale="ja"/>
</ParameterDefinition>

So during subscription i have to choose dimension of storage and type of storage, if type is Development 1GB cost 0.45 if is production cost is 0.75, then i've to choose the storage dimension and the cost is 0.45*DIMENSION or 0.75*DIMENSION.
Thank you.

Hi @Crys-K
You can define such price models in OSCM as you described.
One important thing to clarify is, how you want the customer to be charged back:
a) Based on subscription parameters, e.g. amount of storage booked with subscription?
b) Or dynamically based on the end consumption metrics?
In case of a) your technical service could offer a DIMENSION parameter, for instance like DATA_DISK_SIZE in your example,  to select the storage size. On base of your technical service, you could simply create two (or any number) of marketable service offers with different price models. F.e. two marketable services, both have the parameter TYPE_OF_STORAGE with the checkbox "User Option" deselected (set by the supplier). One marketable service, where the parameter is set to "Development", and one where it's set to "Production". Then you can define respective storage prices separately, for the price model "Development" and for the price model "Production".
In case of b) you'll need to build  the integration based on priced events. What is the base of your service? The support of event based consumption metering and charging is integrated for VMware, OpenStack and for the Shell integration. The latter one is the most flexible one.
For example, you can use the Shell Integration API to integrate any kind of service with Unix shell or with PowerShell scripts. The charged amount depends on the event prices defined in the price model and number of event occurrences.
For Shell Integration API, you could stay with a single marketable service, and cover the requested cost factor by setting the multiplier parameter in your Usage Data script. For instance, for your case, you could read the TYPE_OF_STORAGE parameter and set multiplier to 75 in case 'Production' and 45 for 'Development'. See page 9 in ShellIntegration.pdf. A technical service example with definition of usage events can be found here.

Hi!
Thank you for the answer,
but is there a way to see a quote with the final price that you would pay once the various parameters have been set?


⚠ Bofrost.at has degraded performance

In ef4f35b, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 3361 ms

Resolved: Bofrost.at performance has improved in d13b5ff after 13 minutes.


Translucent ActionBar

Found this and thought it would be nice to add to this module:
http://cyrilmottier.com/2013/05/24/pushing-the-actionbar-to-the-next-level/
@manumaticx, do you see any serious technical challenges with this?

@ricardoalcocer I had a look again and you'll be happy to hear that you can already to this in Titanium.
To get this working you need to set the Actionbar into overlay mode by theme:
      <item name="android:windowActionBarOverlay">true</item>
      <item name="windowActionBarOverlay">true</item>

The rest simply changing the actionbar background color while scrolling. I'll provide an example soon.

Allright, here is my example gist: https://gist.github.com/manumaticx/c173974097c36d08eedc
It looks like this:

Oh man, I'm gonna blow up twitter with this!!
:)
R
On Wed, Jun 24, 2015 at 9:04 AM, Manuel Lehner<EMAIL_ADDRESS>wrote:

Allright, here is my example gist:
https://gist.github.com/manumaticx/c173974097c36d08eedc
It looks like this:
[image: fadingactionbar]
https://cloud.githubusercontent.com/assets/2563642/8335031/612c4996-1a9b-11e5-855d-fddb0dee7b42.gif
—
Reply to this email directly or view it on GitHub
https://github.com/ricardoalcocer/actionbarextras/issues/16#issuecomment-114926054
.

--
Check out my mobile app development book at http://buildmobileapps.io

Ha! Just tweeted it :P
I am actually surprised how simple this was. Hacked together in 20 minutes. It uses just abx.backgroundColor, its not a new feature.

Just shared it internally as well.
Speaking of Android, I'm writing something about using the Material Theme.
Would love to hear your comments and/or corrections  if any:
https://gist.github.com/ricardoalcocer/790ffb935c298391d189
R
On Wed, Jun 24, 2015 at 9:17 AM, Manuel Lehner<EMAIL_ADDRESS>wrote:

Ha! Just tweeted it :P
I am actually surprised how simple this was. Hacked together in 20
minutes. It uses just abx.backgroundColor, its not a new feature.
—
Reply to this email directly or view it on GitHub
https://github.com/ricardoalcocer/actionbarextras/issues/16#issuecomment-114929859
.

--
Check out my mobile app development book at http://buildmobileapps.io

@manumaticx this is awesome, thank you! do you know if this would work with
@android:style/Theme.Material

That example appears to be using the Material Theme (compiled with Ti 4.0), though Appcelerator doesn't inherits from Theme.Material, but rather from AppCompat.

@ardiwine Yes, as @ricardoalcocer said, I use 4.0 and this is already Material with AppCompat theme. The theme is included in the gist. I've not yet tested on other Android versions but this should also work on Android 2.x

@manumaticx I have try your module update about this material theme on Android using ScrollView and it work perfectly. Could this be implemented in ListView or TableView, because I've tried using ListView with event 'swipe' it doesn't worked.

@danang-altastratus Not sure how this could work with ListView but you can use this however you want. I just came up with an example of how this basically works - feel free to modify and improve it.