When using ::Logger::Formatter, config.log_tags are not prepended

When you use the formatter: ::Logger::Formatter the output does not prepend the config.log_tags.
What's interesting is the LogStashLogger::Formatter::* all include "tags":["<IP_ADDRESS>"] in the output.

I figured out why this is the case.
When logger is of type LogStashLogger::Formatter it doesn't need to print the log_tags because it is already included in the event hash.
So the current self.build_default_logger(opts) function will create a logger_class with ::Logger so the config.log_tags will not be prepended to every message. But if you think about it, that's the wrong behavior for when setting the format to Logger::Formatter or Logger::SimpleFormatter, because you expect that the tags should show here.
  def self.build_default_logger(opts)
    device = Device.new(opts)
    ::Logger.new(device).tap do |logger|
      logger.instance_variable_set(:@device, device)
      extend_logger(logger)
    end
  end

So the solution could be, to check if the formatter's ancestors include LogStashLogger::Formatter::Base, and if it doesn't we can pass the logger into ActiveSupport::TaggedLogging.new(logger). Like so:
logger = ActiveSupport::TaggedLogging.new(logger) if logger.formatter.class.ancestors.exclude?(LogStashLogger::Formatter::Base)

finally this is what the self.build_logger(opts) method could look like:
def self.build_logger(opts)
  formatter = Formatter.new(opts.delete(:formatter), customize_event: opts.delete(:customize_event))
  logger = case opts[:type]
  when :multi_logger
    build_multi_logger(opts)
  when :syslog
    build_syslog_logger(opts)
  else
    build_default_logger(opts)
  end
  logger.formatter = formatter if formatter

  logger = ActiveSupport::TaggedLogging.new(logger) if logger.formatter.class.ancestors.exclude?(LogStashLogger::Formatter::Base)

  logger
end

Hi,
Tagged logging isn't something that exists in Ruby's standard library. It's available in ActiveSupport, and LogStashLogger has a compatible implementation. So naturally Logger::Formatter, which is in the Ruby standard library, doesn't include log tags in the output.
If you are using ActiveSupport, you can try the following:
logger.formatter.extend ActiveSupport::TaggedLogging::Formatter


Make Subtitles Optional

Currently title page and footer look weird when no subtitle is defined.

Subtitles are now optional.


"fork() function is unimplemented on this machine"

Hi there,
I am trying to use Rspec to test a model function that executes search.
The function works properly when being tested using ui. But as soon as I try to switch the :solr => true,
it throws error with "fork() function is unimplemented on this machine"
  it "searches", :solr => true do
    # if I search for 'help'
    result = Model.search ({:q => ["help"]})
    # "we are expecting 10 instances"
    result.count.should == 10
  end

Environment details:
win 64bit
Ruby 1.9.3
Rails 3.2.13

Stacktrace:
Failure/Error: Unable to find matching line from backtrace
    NotImplementedError:
    fork() function is unimplemented on this machine
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sunspot-rails-tester-1.0.0/lib/sunspot/rails/tester.rb:18:in `fork'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sunspot-rails-tester-1.0.0/lib/sunspot/rails/tester.rb:18:in `start_original_sunspot_session'
C:/APP_DIR/spec/spec_helper.rb:47:in `block (2 levels) in <top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example.rb:237:in `instance_eval'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example.rb:237:in `instance_eval'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/hooks.rb:21:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/hooks.rb:66:in `block in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/hooks.rb:66:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/hooks.rb:66:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/hooks.rb:418:in `run_hook'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:334:in `run_before_each_hooks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example.rb:300:in `run_before_each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example.rb:113:in `block in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example.rb:254:in `with_around_each_hooks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example.rb:111:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:390:in `block in run_examples'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:386:in `map'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:386:in `run_examples'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:371:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:28:in `map'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:28:in `block in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/reporter.rb:34:in `report'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:25:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'

Is there something I'm missing, or is it not supported for windows?
Any help would be much appreciated!
Cheers!

See the Rails test guides, section 3.2 to change workers -- which use the said fork(method) to paralleled processes -- to threads. This last one use another method to parallel processes. Also take a look on the beginning of the section 3, which describes how the tests are made.
I have used a WSL2 to run Rails. However the local test needs the jruby to be executed in somewhat.


Enabling batch 2 of CloudStack E2E tests

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

/approve


VariableDeclarator + ArrowFunctionExpression with named parameter throw 'Unexpected token =>'

From  @termi in https://code.google.com/p/esprima/issues/detail?id=483

What steps will reproduce the problem?
Parse 'let test1 = ({a}) => ([a])' using esprima#harmony
What is the expected output?
AST
What do you see instead?
Error: Line 1: Unexpected token =>

Suggested Fix:
https://github.com/termi/es6-transpiler/blob/e99435f45aad8cac89c04208d1c33b4a7a57422f/lib/esprima_harmony.js#L3130#L3131

A fix for that is already in the harmony branch: 0e4014d2e0d4c024c3481acdad7e7a813195527b

Thanks @fkling!

I recently found out that all the cases can be handled together directly in parseGroupExpression. We will have a much elegant way of dealing with ArrowFunctionExpressions soon.


Add NODEOS_URL and KEOSD_URL environment variables to cleos

This prevents a lot of repeated typing when using cleos with a host other than localhost

The proper solution to this is to have keosd and nodeosd read a config file from a default location which should contain these options.


license?

This looks like a nice class.  Does this have a license?

Added GPLv3. Hope that's ok, let me know if not.

Since you asked... I would need something like a BSD, MIT, or Apache style license to use it.  Of course I understand if you don't desire to support those.  Thanks.

No problem, done.


Add Apache 2.0 license

There's currently no license. I propose applying the Apache 2.0 license.

@kdykeman Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@kdykeman Thank you for signing the Contributor License Agreement!

thanks!


Added a script to validate custom constitution

A standalone script to validate operator actions on a CCF network. The script will run a few tests to validate if an operator member (a member with the member data attribute 'is_operator' set to true) could perform certain governance actions.

The script would be duplicated with the one we already have here: https://github.com/microsoft/mccf-vscode-extension/blob/main/src/scripts/test_operator_actions.sh.
I think we need to find a common place to keep it, without duplicating.


HTML Plenary document "Foreword" should be called "Summary" and should not be preceded by empty spaces

For Plenary documents, it is "Summary". For a Recommendation, it is "Foreword".
Right now for plenary documents, in Doc it is "Summary".

But in HTML, it is "Foreword", and is also preceded by empty spaces (  Foreword).

Depends on https://github.com/riboseinc/metanorma-unece/issues/7


Enable-Management trusted hosts

Add parameters for Enable-Management that allows specifying trusted hosts. Will require multiple parameter sets with each added trusted host entry being a member of each consecutive trusted host parameter set.

Added parameter sets up to 6 trusted host subnets. Also added parameters to specify the admin username and a parameter to specify the allowed access options.


Blazor WASM State Management topic

Are there plans with the 3.2 release to add examples / best practices for proper state management in Blazor Web Assembly?
I know this is all Blazor Server, but given that Blazor WebAssembly is a common pattern too, I figure this is a fair question :)

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

ID: ae14b3e3-3271-b919-9e0a-6f317a6b2d2d
Version Independent ID: e5e1273b-195e-5da1-b4aa-66bbcff1425b
Content: ASP.NET Core Blazor state management
Content Source: aspnetcore/blazor/state-management.md
Product: aspnet-core
Technology: aspnetcore-blazor
GitHub Login: @guardrex
Microsoft Alias: riande

@guardrex, ProtectedBrowserStorage support is now in (https://github.com/dotnet/aspnetcore/pull/23553). @MackinnonBuck can you share a small sample showing how to use the new ProtectedBrowserStorage?

Also, I do like the idea of having a separate node for Blazor WebAssembly state management: Create a new doc for state management in WASM, as you referred to it.

As for the categories (your last question), maybe we should hold on for now. Let's roll the simple state management doc and then see how community will react and tell us what more they will need.

Blazor server feature and does not work in WebAssembly

Then, the options are down to ...

Convert the doc to cover both WASM and Server given the overlap in approaches in the Where to persist state section and with possible 3rd party libs. Sections that would pertain to one or the other clearly marked within the topic.
New doc for WASM (and a node to hold both topics), and it will have similar coverage to what's in the Where to persist state section, possibly made generic and put into an INCLUDES file so that both topics could use that content. Same for the 3rd party package remarks.
Don't address WASM at this time and only use this issue to fix up the current coverage for Blazor Server.

@mkArtakMSFT I'm working on this issue now. I think we should try a single pivot topic for this at first. I can use INCLUDES for common content. Let's give it a shot. I think it would reduce our burden for:

A new node and Overview.
More complicated content split between/among topics.
More messing about with the ToC.
Another redirection file entry.

If it doesn't work out on review, I can set up a new PR with the node-topic approach.
As a reminder on pivots, see the Tooling doc, which performs pivots on OS. For this work, we'd pivot our State management topic on Blazor WebAssembly and Blazor Server ...
https://docs.microsoft.com/aspnet/core/blazor/tooling

@MackinnonBuck ... You mentioned (and showed) a change for local storage GetAsync. Is the current coverage on session storage still accurate? ...

To recover the currentCount data if the user returns to the Counter component later, including if the user is on an entirely new circuit, use ProtectedSessionStore.GetAsync:

protected override async Task OnInitializedAsync()
{
    currentCount = await ProtectedSessionStore.GetAsync<int>("count");
}

@guardrex The new changes apply for both local storage and session storage.

Ok ... I'll likely need to make one more commit then. Stand-by before you review.

lol ... I forgot ...... tomorrow. I need to sleep on it one more night. I'll make the changes, and they'll be on the PR in the morning.

@scottaddie ❓ ... For the new pivot group blazor-hosting-models, I'll go with ...
- id: blazor-hosting-models
  title: Blazor Hosting Model
  prompt: Choose a Blazor hosting model
  pivots:
    - id: webassembly
      title: Blazor WebAssembly
    - id: server
      title: Blazor Server

... but I noticed while adding the new group that prefixing the OSes in the operating-systems group with os- is overkill. It's a common and meaningless prefix for a whole topic that uses pivot groups on OS. It seems to make more sense to drop the os-. After all, I don't plan on using hosting-model-webassembly and hosting-model-server for the blazor-hosting-models pivots. The only reason those os- prefixes are there is because the file that I stole from the other repo had it. I propose that we do this for that group ...
- id: windows
  title: Windows
- id: linux
  title: Linux
- id: macos
  title: macOS

Now is the time ⏰ to make this change, while there's only one doc on the repo that uses pivot groups.

@guardrex Your zone pivots proposal sounds good to me.


[Quest/eCBIS] - Searching and unsuccessful pairing devices during p2p sync

Describe the bug
Pairing of devices not successful even after nearby detection
Steps to reproduce the behavior:

Launch app
Go to P2P menu
Launch P2P Sync menu
Initiate a pairing session
See bug

Expected behavior
The initial sync should be fast and take only a few minutes/seconds depending on the amount of data on the server.
The subsequent sync takes a few seconds.
Smartphone (please complete the following information):

Device: Oppo F9 and Samsung Galaxy A2.
Android: 10
Build number: eCBIS v.0.0.5

Video
https://user-images.githubusercontent.com/85434942/176634598-2730219f-aa6a-47da-b5e4-34dc9a7c63f4.mp4

Related ticket - #1249

@AnnieMungai
APK : https://github.com/opensrp/fhircore/releases/tag/v0.1.9-ecbis-rc5A
Devices: Android 11 4GB RAM -- CHA
Android 9 2GB RAM -- CHSS
Observation:
search and Pairing is successful for P2P sync


Audio streaming in screensharing (on linux)

Describe the solution you'd like
I found this project, think you should try doing something like this
https://github.com/maltejur/discord-screenaudio
Additional context
I'm using Fedora, so I will say, that I would need this feature to support Wayland

Duplicate of #153.


added option to disable websocket emiting

Added option to disable usage websocket and user-count websocket
This feature includes adding those to the config in order that the UI will not emit on every event to the backend
#7633

Closing due to unwanted changes, and conflicts. You might want to check if the changed code will work without an issue with the latest dev.


[issue-262]-Delete version takes long and some times thrown an exception

Resolves: https://github.com/project-openubl/searchpe/issues/262

Closing as it was resolved by https://github.com/project-openubl/searchpe/pull/287


Support for lm_eval 0.4.0

I hope gpt-neox to support lm-eval==0.4.0. The current gpt-neox evaluate the models on benchmarks with lm-eval==0.3.0, which does not support many important datasets, for example, mmlu.

@haileyschoelkopf i thought you had fixed this?

I thought so too. Though I’ll make a PR to bump the dependency now that we put 0.4.0 on pypi

Perhaps it's because I'm still using the old version of gpt-noex. I'll check the differences with the latest version. Thanks for your help! By the way, could you tell me the commit ID where this issue was fixed?

@ZhiYuanZeng It's here


Build errors (duplicate symbol) on iOS (xCode 13.2.1)

Your Environment
Fattmerchant SDK version: 1.4.5
Xcode version:  13.2.1
Platform: iOS
OS version: 11.6 and newer
React Native version: 0.63.2
Pod:
  - boost-for-react-native (1.63.0)
  - CocoaAsyncSocket (7.6.5)
  - CocoaLumberjack (3.7.2):
    - CocoaLumberjack/Core (= 3.7.2)
  - CocoaLumberjack/Core (3.7.2)
  - DoubleConversion (1.1.6)
  - Fattmerchant (1.4.5)

Expected Behavior
Success build
Actual Behavior

Steps to Reproduce

add react-native-background-geolocation to package.json
add Fattmerchant SDK to pod
build app

Context
I get a duplicate symbol issue when i introduce Fattmerchant SDK to my project. The libLumberjack.a file of Fattmerchant SDK is conflict with my existed dependency CocoaLumberjack for react-native-background-geolocation module.
I think this issue is caused byFattmerchant SDK linked with CocoaLumberjack without adding a dependency, could you help to deal with this?

This has been fixed in the 2.2.1 release today

The latest version of the SDK works well. Thanks very much.


[Documentation website] Rename tabs on documentation detail pages

We’ve noticed that it can be challenging for developers to find technical information on our component detail pages. To make this easier, we’re proposing a reorganization of these pages.
Proposed Solutions:
Solution 1

Usage Tab: This tab will stay the same, detailing when to use the component, when to avoid it, its anatomy, and behavior. We’ll remove all Figma-related info to keep it focused.
Design Tab: This new tab will be dedicated to Figma properties and design-specific details.
Development Tab: We’ll rename the current "Code" tab to “Development” and consolidate all relevant content here.
Accessibility Tab: This tab will remain as is, ensuring we keep our accessibility standards front and center.

Solution 2
Let’s display the example at the top of the tabs while keeping the tabs themselves below the example for easy navigation.
Solution 3
We’re open to other solutions, so let’s discuss any additional ideas during our refinement session.
### Tasks
- [ ] make a proposal for different solutions in figma
- [ ] ideas: change tab names, show example on top of the tabs, full width divider of tabs, put all information above the tabs in the blue hero
- [ ] development
- [ ] refactor all component detail pages

Diana's mockup made with the inspect tool :)


Want to add DSA And Algo cheat sheet

I can add dsa and  algo cheat sheet .. assign this issue to me .!
is .png fine or should it be .txt files

I think .txt files are fine. But maybe it is better to have .md files. Markdown files are quite easy to document and represent.

I think .txt files are fine. But maybe it is better to have .md files. Markdown files are quite easy to document and represent.

can i upload then ??

how is markdown file created ??

You can perhaps use Stackedit as an editor to write your markdown file.
And for markdown resources, you can follow: JOHN GRUBER documentation

thanks !

Please assign this to me

@codurr1 You can submit a PR. No need to assign.

Just added a PR please review

we now have 4 DSA cheatsheets


L515 Hardware Synchronization Clarifications

Required Info

Camera Model
L515

Firmware Version
<IP_ADDRESS>

Operating System & Version
Win10 : 19041.630

Kernel Version (Linux Only)
N/A

Platform
PC/Raspberry Pi

SDK Version
<IP_ADDRESS> }

Language
C#/Python

Issue Description
We've been trying to replicate the results from the whitepaper Multi-Camera configurations with the Intel® RealSense™ LiDAR Camera L515 using a C# to drive 8 L515s from a PC and Python on a Raspberry Pi to drive the Hardware Sync signals, but haven't gotten the results we expect, and would like some further clarification regarding how it works.

We recognized that the example Python code is run only once, so we wrapped setting GPIO output signals in a loop and had the script run as a service continually as long as the Raspberry Pi is running. I'm assuming those behind the whitepaper did similarly?  If not, how did they have the Raspberry Pi signal output at an appropriate time?
We also opened all 8 of the L515's depth streams in the RealSense viewer with Intercam Sync Mode and found that our L515's were streaming when the sync signal was LOW not when the sync signal was HIGH, so we switched the two in our code.  Is this the intended sync signal on the L515's, where LOW is enabling streaming?  If so, it contradicts the image and associated explanation given in the whitepaper in section 2-E:  And if not, then I must have misunderstood the wiring given in section 1.  Which pin (top, middle or bottom) in the following image corresponds to the sync signal input, and which to the grounding cable?  (We interpreted the middle as the sync cable and the bottom as the ground cable.)
Once we were able to see Hardware Syncing in the RealSense Viewer we attempted to utilize HW syncing programmatically in C#.  I notice that in the whitepaper (section 3-A), they set inter cam hardware sync on the first camera (through using front()).  Is this the recommended way to set this?  Or should we be searching for the depth camera specifically with something like this:

var m_pipe = new Pipeline(ctx);
var cfg = new Config();
cfg.EnableDevice(m_serialNumber);
cfg.EnableStream(Stream.Depth, 640, 480);
cfg.EnableStream(Stream.Color, 1280, 720, Format.Bgr8, 6);

var pipelineProfile = cfg.Resolve(m_pipe);
var sensors = pipelineProfile.Device.QuerySensors();
foreach (var sensor in sensors)
{
    if (sensor.Is(Extension.DepthSensor) || sensor.Is(Extension.L500DepthSensor))
    {
        sensor.Options[Option.InterCamSyncMode].Value = 1.0f;
        break;
    }
}

Further, is this the appropriate method of setting the HW Sync from C#, or is there another preferred method? This hardware sync is important for our product, and would really appreciate any guidance/clarifications about this process.
(On another note, is there a good example in ensuring we get color images that match the depth images?  We really only want a single still frame from all 8 cameras, without interference.  How does the Hardware Sync alter the synchronization between color images and depth images?)

We have not been successful in activating Hardware sync programatically.  Any help would be appreciated.

Hi @kkh3049
Let me see if I can help you in your questions above:

Initial question regarding Python, yes our initial proof of concept in the whitepaper was only centered around Python and used in the same manner you describe.  We haven't ported or used any other language or wrapper.
Regarding the signals, I think you do have the wires mixed up.  The behavior is as we describe in the whitepaper.  We also made a couple of edits to the whitepaper to hopefully clarify which pins on the connector are pin 1, 2, 3 and which one is the sync signal and which one is ground (https://dev.intelrealsense.com/docs/lidar-camera-l515-multi-camera-setup).  Have a look there but the clarify here

The left most pin is pin 1 for sync signal (or another way to look at it, exactly in the image above, the bottom pin is pin 1 for sync signal).  Pin 2 is the middle and that is ground.  The right most pin is pin 3 (or another way to look at it, exactly in the image above, the top pin is ping 3).  Hopefully this helps.

You can also look at it from the perspective of the L515 camera itself.  With the L515 as in the image above being pointing up on a table top, the left most pin is pin 1, pin 2 is middle and the right most pin is pin 3.
Regarding matching color images with depth, the color images and stream isn't affected by the sync signal.  The color will come normally to the host system.  So you'd have to use something like timestamps or any other metadata to help determine best way of syncing the color images to the depth images you get from each camera at the given timing interval of depth frames in the 8 camera sync setup.

I am having the identical issue as the creator of this thread. My wires are configured correctly, verified through multimeter probing.
I have tried various solutions. Switching my signal generator from a Pi to and Arduino, changing from RPI.GPIO to pigpio, changing from RealSense viewer to software, none worked.
"We also opened all 8 of the L515's depth streams in the RealSense viewer with Intercam Sync Mode and found that our L515's were streaming when the sync signal was LOW not when the sync signal was HIGH, so we switched the two in our code. Is this the intended sync signal on the L515's, where LOW is enabling streaming? If so, it contradicts the image and associated explanation given in the whitepaper in section 2-E:"
Is pretty much exactly what I am experiencing. Firmware is the latest.

I am having the identical issue as the creator of this thread. My wires are configured correctly, verified through multimeter probing.
I have tried various solutions. Switching my signal generator from a Pi to and Arduino, changing from RPI.GPIO to pigpio, changing from RealSense viewer to software, none worked.
"We also opened all 8 of the L515's depth streams in the RealSense viewer with Intercam Sync Mode and found that our L515's were streaming when the sync signal was LOW not when the sync signal was HIGH, so we switched the two in our code. Is this the intended sync signal on the L515's, where LOW is enabling streaming? If so, it contradicts the image and associated explanation given in the whitepaper in section 2-E:"
Is pretty much exactly what I am experiencing. Firmware is the latest.

As OP posted, I tried reversing my signals and that also fixed my problem. Thanks OP, but the documentation appears to be wrong.

As OP posted, I tried reversing my signals and that also fixed my problem. Thanks OP, but the documentation appears to be wrong.

Thank you for the feedback and we will continue to look over our documentation to improve the information.

Thank you for the feedback and we will continue to look over our documentation to improve the information.

For what it's worth, I recently checked my wiring and confirmed it to be according to the updated documentation.  Sending a LOW (ground) voltage as my sync signal works while sending a HIGH (3.3V) voltage stops the cameras from collecting depth sensors.

For what it's worth, I recently checked my wiring and confirmed it to be according to the updated documentation.  Sending a LOW (ground) voltage as my sync signal works while sending a HIGH (3.3V) voltage stops the cameras from collecting depth sensors.


Geofencing Sample deprecated. Please update with the best solution

Geofencing Sample doenst seems to be working with Android Oreo devices as per the background execution limits . My GeofenceIntentService gets killed at a later time unknowingly and i get a log as GeofenceHelper : removeGeofences - which i havent done explicitly in my app . I want my fences live forever in the app until the user uninstalls my app.
For now am using JobScheduler API to schedule it every 5 secs to get the transition triggers. Can anyone at Google Please assist me with this.
Thanks in advance.

+1

+1

Any updates on this one?

@janbrodhaecker  Hey You could probably use the solution which am using for now. It worked for me like a charm.

@pramodit Thanks a lot for your feedback.
Could you be so kind and provide some snippets? I read a lot about this issue and I also tried to schedule a Job - but I am not quite sure what to do when the Job is executed? Just request another location update? Is there any chance to trigger the API, so that the Geofences are evaluated again?
Thanks in advance!

Sure @janbrodhaecker  This is how i am doing it . I use this JobService and reschedule it every 1 secs in Android O to make sure the OS dont kill my service.
/**
JobService for Geofences above Android Oreo
@author Pramod
@SInCE 16-Sept-2018.
*/
@TargetApi(21)
public class OreoJobService extends JobService {
private JobParameters mParams;
//Assuming it takes maximum 5 seconds for
private String TAG = "OreoJobService";
public boolean onStartJob(JobParameters params) {
this.mParams = params;

String command = params.getExtras().getString("command");

if (command != null && command.equals("stop")) {

    this.endJob();
    return false;
} else {

    if (MyApplication.getInstance().geoFencePendingIntent == null) {

        if (params.getExtras().containsKey("fromJobScheduler")) {

            String geoFences = MyApplication.getInstance().fetchGeoFences();

            if (geoFences != null) {

                List<Fence> fencesList = new Gson().fromJson(geoFences, new TypeToken<List<Fence>>() {
                }.getType());
                MyApplication.getInstance().createGeoFences(fencesList);

            }

        }
    } else {

        Log.e(TAG, "onStartJob: scheduling job ");
        this.scheduleJob(10000);
    }

    return true;
}

}
void endJob() {
this.jobFinished(this.mParams, false);
}
void scheduleJob(long interval) {
ComponentName serviceName = new ComponentName(this.getPackageName(), OreoJobService.class.getName());

PersistableBundle extras = new PersistableBundle();
extras.putString("command", "start");
extras.putInt("fromJobScheduler", 1);
JobInfo jobInfo = (new JobInfo.Builder(VariableConstants_Fortees.GEOFENCE_JOB_ID, serviceName))
        .setExtras(extras).setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
        .setMinimumLatency(interval)
        .setOverrideDeadline(interval)
        .build();

JobScheduler jobScheduler = (JobScheduler) this.getSystemService(Context.JOB_SCHEDULER_SERVICE);
assert jobScheduler != null;
jobScheduler.schedule(jobInfo);
this.endJob();

}
public boolean onStopJob(JobParameters params) {
return false;

}
}
###################### And here's my logic for scheduling ##########################
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    ComponentName serviceName = new ComponentName(this, OreoJobService.class.getName());
    PersistableBundle extras = new PersistableBundle();
    extras.putString("command", "start");

    JobInfo jobInfo = (new JobInfo.Builder(VariableConstants_Fortees.GEOFENCE_JOB_ID, serviceName))
            .setExtras(extras).setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
            .setMinimumLatency(1L)
            .setOverrideDeadline(1L)
            .build();

    JobScheduler jobScheduler = (JobScheduler) this.getSystemService(Context.JOB_SCHEDULER_SERVICE);

    try {
        jobScheduler.schedule(jobInfo);
    } catch (IllegalArgumentException errorMessage) {
        errorMessage.printStackTrace();
    }

}

@pramodit - thanks a lot for your answer. Could you just explain what you are doing, when the job is executed? Maybe you give me some more hints for these lines:
if (MyApplication.getInstance().geoFencePendingIntent == null) {
 if (params.getExtras().containsKey("fromJobScheduler")) {
  String geoFences = MyApplication.getInstance().fetchGeoFences();
   if (geoFences != null) {
    List<Fence> fencesList = new Gson().fromJson(geoFences, new TypeToken<List<Fence>>() {}.getType());
    MyApplication.getInstance().createGeoFences(fencesList);
   }
 }

Best regards,
Jan.

Hey @janbrodhaecker , I am just creating the Geofences and adding to the GeofencingPendingIntent to trigger those transition events .
Here is the snippet for my createGeofences method -
public void createGeoFences(List fencesList){
    for (int i = 0; i < fencesList.size(); i++) {

        String type = fencesList.get(i).getType();
        if (type != null && !"".equals(type)) {

            if ("circle".equals(type)) {

                Shape shape = fencesList.get(i).getShape();
                String GEOFENCE_REQ_ID = fencesList.get(i).getName();

//                    mGeoList.add(GEOFENCE_REQ_ID);
//                    String GEOFENCE_IDS = fencesList.get(i).getId();
//                    mGeoIdList.add(GEOFENCE_IDS);
                Foreground.fencesMap.put(fencesList.get(i).getName(), fencesList.get(i).getId());

                if (shape != null) {

                    double radius = shape.getRadius();
                    double latitude = 0.0f, longitude = 0.0f;
                    Center center = shape.getCenter();
                    if (center != null) {
                        latitude = center.getLatitude();
                        longitude = center.getLongitude();
                    }
                    LatLng latLng = new LatLng(latitude, longitude);
                    float radius_float = ((float) radius);
                    Geofence geofence = geoFenceUtils.createGeofence(GEOFENCE_REQ_ID, latLng, radius_float);
                    GeofencingRequest geofenceRequest = geoFenceUtils.createGeofenceRequest(geofence);
                    if (ContextCompat.checkSelfPermission(mInstance, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {

                        addGeoFences(geofenceRequest);

                    }
                }

            } else if ("polygon".equals(type)) {

                Shape shape = fencesList.get(i).getShape();
                String GEOFENCE_POLYGON_REQ_ID = fencesList.get(i).getName();

//                    mGeoList.add(GEOFENCE_POLYGON_REQ_ID);
//
//                    String GEOFENCE_POLYGON_ID = fencesList.get(i).getId();
//                    mGeoIdList.add(GEOFENCE_POLYGON_ID);
                Foreground.fencesMap.put(fencesList.get(i).getName(), fencesList.get(i).getId());

                ArrayList<LatLng> newLatLngList = new ArrayList<LatLng>();

                if (shape != null) {

                    List<Point> pointsList = shape.getPoints();
                    if (pointsList.size() > 0) {

                        for (int j = 0; j < pointsList.size(); j++) {
                            double latitude = pointsList.get(j).getLatitude();
                            double longitude = pointsList.get(j).getLongitude();
                            LatLng latLng = new LatLng(latitude, longitude);
                            newLatLngList.add(latLng);
                        }
                        LatLng centerPointLatLng = geoFenceUtils.getPolygonCenterPoint(newLatLngList);
                        double center_lat = centerPointLatLng.latitude;
                        double center_long = centerPointLatLng.longitude;

                        List<Float> distanceList = new ArrayList<>();
                        float res[] = new float[3];
                        for (int m = 0; m < newLatLngList.size(); m++) {
                            LatLng latLng = newLatLngList.get(m);
                            double lat = latLng.latitude;
                            double longitude = latLng.longitude;
                            Location.distanceBetween(center_lat, center_long, lat, longitude, res);
                            if (res.length > 0) {
                                for (float f : res) {
                                    distanceList.add(f);
                                }
                            }
                        }

                        Float max_dist = Collections.max(distanceList);

                        Geofence geofence = geoFenceUtils.createGeofence(GEOFENCE_POLYGON_REQ_ID, centerPointLatLng, max_dist);
                        GeofencingRequest geofenceRequest = geoFenceUtils.createGeofenceRequest(geofence);

                        if (ContextCompat.checkSelfPermission(mInstance, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {

                            addGeoFences(geofenceRequest);

                        }

                    }
                }
            }
        }
    }

}

@pramodit - thanks for your response, I really appreciate your support!
I don't actually get the point. You are asking each second, whether the GeofencePendingIntent still exists - if not you will recreate all the registered Geofences? I thought we need to poll the current Location in the background or anything? I think just recreating them in the background will not actually help for a long term perspective - or I am still not getting it right ...
Thanks a lot! Kind regards,
Jan.

Manage to get this working with the example. Turns out my issue was the lat and long were passed incorrectly. I was passing long then lat, when it should of been lat then long.

Sadly I have still no idea why it should help to register the geofences within the JobService ...

Sadly I have still no idea why it should help to register the geofences within the JobService ...

In the example it uses JobIntentService, with a BroadcastReceiver. I think if you just use IntentService, maybe this might help you https://www.raywenderlich.com/7372-geofencing-api-tutorial-for-android

@pramodit thanks for your response. I guess it's clear, why we need to use the BroadcastReceiver. The thing is, if I use the example provided in this project with a BroadcastReceiver - the Geofences are not triggered when the app is killed or in the background (Android Pie, Pixel 1). That's why @pramodit provided an example, where the Geofences are registered within a JobIntentService. And I don't understand why we need to use the JobIntentService to register the Geofences at all.

@janbrodhaecker  Sorry was busy and couldn't respond you ASAP.  There's no requirement of polling your current lat long here . There was something called GeofenceHelper which was checking for the GeofenceTransitions internally with the current lat long. So i'll register the fences to the GeofencingAPI only once by that GeofencingPendingIntent and thats the reason why i do have the check if the pendingIntent is null or not . if its null only then i do re-register them . else am just scheduling the job to make sure the services doesnt get killed.

I hope its clear now. @ergun-p  @janbrodhaecker

@pramodit - thanks a lot for your response again! Just one last question: How are you creating the PendingIntent for the Geofences - via .getService or via .getBroadcast ? Really looking forward to try out your approach! Is ist still working fine on your devices? Are you also testing on Android Pie?

I hope its clear now. @ergun-p
Thanks, but my issue was different and is resolved.

@janbrodhaecker  Yes its working on Android Pie and Android O as well.  I used PendingIntent.getBroadcast for the Geofences Creation.

Hi have a basic question on this App: it does not show anything. When I click on "add geofences" nothing happen. Do you guys use the code as is, or you make some change?

You could use the code from this thread as a workaround solution for the add the geofences which keeps running in Android O and Android Pie. And from this example. it shows a notification when you enter into the geofence region. Please ensure you have changed the radius and lat longs as per your requirement according to your location in the example. @mcanonic

ok, I see many different contributions and some link to external resource code. Is there a place where I can find the complete source code working? Thanks

Anyone tried with work manager - beta?
I tried work manager on Android P, seems fine to me so far.
Hopefully, it will stays that way. fingers crossed
My geofences will expires after 24 hours, which i will register the geofences again at the 23rd hour by removing all geofences and register again.

@secureCam2018 can you describe what you want to achieve with the work manager? Or what you've implemented in detail?

@janbrodhaecker,
I used workmanager with a one time work request to register Geofences.
And instead of jobIntentService, I used workmanager to handle the triggering events. (After broadcast receiver received the events)
So a total of 2 workmanagers is used.
I think using one workmanager would suffice too, changing the jobIntentService to workmanager.
But have not had the chance to try it out yet.
Hope this clears your doubt


[2.0.1] Update SQLitePCL.raw to 1.1.8

Part of aspnet/Microsoft.Data.Sqlite#428

Would need reaction PR in coherence about third party tool.

Yes, but we need to branch Coherence for 2.0.1 first. I'll suppress in the repo for now.

Recalling


Pytest hot reloader issues

First off, thanks for this great library. I've used it to implement a pytest hot reloading daemon. I had some issues that I worked around using monkey patching, and I think it would make sense to update the library rather than use monkey patches.
Here's the list of issues I needed to work around:

glob - needed more control over directories. You may have so many files, attempting to watch them all would exhaust the open file handle limit, so the ability to specify multiple root directories was needed.
assertion rewrites - pytest does assertion rewrites. When jurigged would hot reload a test function, the test function would no longer have the assertions rewritten. I think the best solution to this would be to add hook capability on reevaluate
line numbers off by one - I encountered this in two places. The first was rewritten functions having their line numbers shifted down by one line. The second issue is where there is an ensure_separation parameter in GroupDefinition.append that inserts a blank line. This creates line breaks where they don't exist, resulting in line numbers diverging after certain things in the file. It's not clear to me the purpose of this. When line numbers are off, the debugger and introspection libraries like varname quit working as expected, on top of errors giving the wrong line number.
jurigged logger - the default behavior was resulting in duplicated output
watchman - this isn't really on jurigged specifically but watchman seems to have compatibility problems so I use polling. I've been wanting to create a library that does file watching better by doing a hybrid of signals and polling but haven't gotten around to it.

Here's the full code of the monkey patches:
def monkey_patch_jurigged_function_definition():
    import jurigged.codetools as jurigged_codetools  # type: ignore
    import jurigged.utils as jurigged_utils  # type: ignore

    OrigFunctionDefinition = jurigged_codetools.FunctionDefinition

    import ast

    class NewFunctionDefinition(OrigFunctionDefinition):
        def reevaluate(self, new_node, glb):
            # monkeypatch: The assertion rewrite is from pytest. Jurigged doesn't
            #              seem to have a way to add rewrite hooks
            new_node = self.apply_assertion_rewrite(new_node, glb)
            obj = super().reevaluate(new_node, glb)
            return obj

        def apply_assertion_rewrite(self, ast_func, glb):
            from _pytest.assertion.rewrite import AssertionRewriter

            nodes: list[ast.AST] = [ast_func]  # type: ignore
            while nodes:
                node = nodes.pop()
                for name, field in ast.iter_fields(node):
                    if isinstance(field, list):
                        new: list[ast.AST] = []  # type: ignore
                        for i, child in enumerate(field):
                            if isinstance(child, ast.Assert):
                                # Transform assert.
                                new.extend(
                                    AssertionRewriter(glb["__file__"], None, None).visit(child)
                                )
                            else:
                                new.append(child)
                                if isinstance(child, ast.AST):
                                    nodes.append(child)
                        setattr(node, name, new)
                    elif (
                        isinstance(field, ast.AST)
                        # Don't recurse into expressions as they can't contain
                        # asserts.
                        and not isinstance(field, ast.expr)
                    ):
                        nodes.append(field)
            return ast_func

        def stash(self, lineno=1, col_offset=0):
            # monkeypatch: There's an off-by-one bug coming from somewhere in jurigged.
            #              This affects replaced functions. When line numbers are wrong
            #              the debugger and inspection logic doesn't work as expected.
            if not isinstance(self.parent, OrigFunctionDefinition):
                co = self.get_object()
                if co and (delta := lineno - co.co_firstlineno):
                    delta -= 1  # fix off-by-one
                    if delta != 0:
                        self.recode(jurigged_utils.shift_lineno(co, delta), use_cache=False)

            return super(OrigFunctionDefinition, self).stash(lineno, col_offset)

    # monkey patch in new definition
    jurigged_codetools.FunctionDefinition = NewFunctionDefinition

def monkeypatch_group_definition():
    import jurigged.codetools as jurigged_codetools  # type: ignore

    def append(self, *children, ensure_separation=False):
        for child in children:
            # ensure_separation creates line number diff
            # an example where this was a problem:
            #
            # 15 class MyClass:
            # 77     do_something()  # type: ignore  <--- blank line inserted between do_something() and comment
            # 78
            # 79     def my_func(...)  <--- becomes line 80
            #
            # the monkey patch removes it
            #
            # removed code:
            # if (
            #     ensure_separation
            #     and self.children
            #     and not self.children[-1].well_separated(child)
            # ):
            #     ws = LineDefinition(
            #         node=None, text="\n", filename=self.filename
            #     )
            #     self.children.append(ws)
            #     ws.set_parent(self)
            self.children.append(child)
            child.set_parent(self)

    jurigged_codetools.GroupDefinition.append = append

def setup_jurigged(config: Config):
    def _jurigged_logger(x: str) -> None:
        """
        Jurigged behavior is to both print and log.

        By default this creates duplicated output.

        Pass in a no-op logger to prevent this.
        """

    import jurigged

    monkey_patch_jurigged_function_definition()
    monkeypatch_group_definition()

    pattern = _get_pattern_filters(config)
    # TODO: intelligently use poll versus watchman (https://github.com/JamesHutchison/pytest-hot-reloading/issues/16)
    jurigged.watch(pattern=pattern, logger=_jurigged_logger, poll=True)

I also have an issue about mitigating / improving the start-up time impact:
https://github.com/JamesHutchison/pytest-hot-reloading/issues/17

Again, thanks again for the library! At Carta I wrote a hot reloader as a hackathon project (not in plugin form, but something much cruder) and also showed people how to run the big monolith using jurigged and they loved it!

Hi James!
First, I'm so sorry for the very late reply to this, I'm evidently not very good at responsive maintenance 😅 I'll try to be better.
Second, I can't reproduce the off-by-one problem with line numbers. When I test with a toy program (using varname), the line numbers are tracked perfectly... and when I apply your patch, then it starts messing up. There must be some specific edge case here that you're hitting. Could you provide a self-contained script and a patch to that script which, when applied, triggers the issue? Thank you!

I am able to reproduce the issue pretty easily using the Heavy Stack.
https://github.com/heavy-resume/heavy-stack/
If you have github codespaces, simply create a new codespace, run Hot Reload Heavy Stack. Note that you may need to wait a 5 - 10 minutes for the codespace to finish getting set up. You can check the .dev_container_logs/postStartBackground.out to see if the postgres image finished building.
Set a break point on the first line of the LandingPage component  at heavy_stack/frontend/landing.py:32. Open up port 8000 on the dialog that presents itself to view the server. This will trigger that component. Note that user is not one of the locals. Change something on the LandingPage component. It'll hot reload and rerender the component. The breakpoint should trigger again. Note that the user is now in the locals, indicating that it's actually setting the breakpoint one line later than it should be.
This screenshot illustrates the issue.

It's worth calling out that I didn't understand this issue well and didn't feel like the "off-by-one" fix was actually a good fix. It probably fixed something and broke something. I think I still encountered line number issues. Looking at it right now, I wouldn't be surprised if the issue here is that the line number for the function starts at the decorator rather than the def.

Actually... yeah thats probably whats going on. If I do this nutso thing the offset gets bigger.
@(
    component
)
def LandingPage() -> Component:
    user, set_user = use_state(cast(User | None, None))
    right_now, set_right_now = use_state(utc_now())

It's worth calling out the functions where I encountered this, pytest functions, there wasn't a decorator, so I'm wondering if there's a bit more to this. Perhaps I had something like this:
class MyTest
  @pytest.fixture(autouse=True)  # maybe this was breaking everything later in the file
  def setup(self):
    ...

  def test_where_doing_hot_reload_was_off_by_one(...)
     ...

There is indeed a problem when there are decorators. More precisely it's this code which explicitly adds them to the node's extent: https://github.com/breuleux/jurigged/blob/master/jurigged/codetools.py#L863
The thing is, I'm pretty sure I did this for a reason, but if I remove it, all tests still pass. It was possibly related to jurigged's capability to apply patches that don't come from file modifications and write back the patches to the files (I had an editor working a few years back where you could edit function definitions piecewise in an interactive session), but until I figure out why this exists, I'll just remove it and hopefully that'll resolve the problem.

Upon investigation, I think it's a lot more complicated, and the above fix appears to work only sometimes, and accidentally. In other cases it messes up the line updates for the other functions. The first line of a function definition does normally include the decorator, except, for some maddening reason, the initial @, so there was some code to force its inclusion.
My current hypothesis is that the issue happens because when a function is reevaluated, we purposefully do not want to reevaluate the decorators, and to ensure this, they are stripped from the AST node that we then recompile. This might introduce some kind of inconsistency that messes up the line numbers down the line. I'll have to take a deeper look another time.

This seems promising, although I vaguely feel like months ago I had tried this exact code and somehow it wasn't working somewhere
@dataclass
class FunctionDefinition(GroupDefinition):
    _codeobj: object = None

    ##############
    # Management #
    ##############

    def stash(self, lineno=1, col_offset=0):
        if not isinstance(self.parent, FunctionDefinition):
            co = self.get_object()
            if co and (delta := lineno - self.node.extent.lineno):
                self.recode(shift_lineno(co, delta), use_cache=False)

        return super().stash(lineno, col_offset)

Here's the results of testing with that change:

✔ Changing no decorator
✔ Changing with decorator
✔ Tests
✔ Multiline decorator, changing function itself
❌ Multiline decorator, change length of function then put breakpoint on function later in the file

For that last one, making a change to the function in question seems to fix the issue.

Seeing this error which I think is unrelated, but posting it just in case:
Traceback (most recent call last):
  File "/workspaces/heavy-resume/.venv/lib/python3.11/site-packages/jurigged/codetools.py", line 480, in _process_child_correspondence
    self.evaluate_child(new)
  File "/workspaces/heavy-resume/.venv/lib/python3.11/site-packages/jurigged/codetools.py", line 646, in evaluate_child
    return child.evaluate(self.get_globals(), attrproxy(obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/heavy-resume/.venv/lib/python3.11/site-packages/jurigged/codetools.py", line 590, in evaluate
    obj.__qualname__ = ".".join(self.dotpath().split(".")[1:])
    ^^^^^^^^^^^^^^^^
AttributeError: 'method' object has no attribute '__qualname__'

Bizarre
    def evaluate(self, glb, lcl):
        super().evaluate(glb, lcl)
        obj = (lcl or glb).get(self.name, None)
        if hasattr(obj, "__qualname__"):
            obj.__qualname__ = ".".join(self.dotpath().split(".")[1:])

Since this is an improvement over the existing off-by-one fix in the hot reloader I'm going to go ahead and update that library's monkeypatch. IMO, it's pretty good

@JamesHutchison I just tried your change. It seems to work fine for the first source code modification, but things seem to get mixed up on subsequent modifications (the tests in test_generated perform a bunch of random code edits in sequence and most end up crashing as they try to set the code to a negative line number -- these tests are brutal, but I'm glad I made them, they've uncovered so many bugs). Not sure why. I'm going to have to add a battery of tests for line number tracking that cover all the cases I'm currently checking manually, there's no way we're ever going to fix this otherwise.

That's awesome to hear! This library is so helpful, and fixing the line number issue and catching stability issues is a big win!


GitHub issue #3681

Purpose of this pull request
This pull request updates this section: https://help.sumologic.com/docs/observability/reliability-management-slo/#terminology
Select the type of change

[x] Minor Changes - Typos, formatting, slight revisions
[ ] Update Content - Revisions, updating sections
[ ] New Content - New features, sections, pages, tutorials
[ ] Site and Tools - .clabot, version updates, maintenance, dependencies, new packages for the site (Docusaurus, Gatsby, React, etc.)

Ticket (if applicable)
GitHub issue #3681.

The documentation is now updated: https://help.sumologic.com/docs/observability/reliability-management-slo/#terminology


MISRA C  Avoid implicit conversion between integers and boolean expressions

In order to clarify the real intent of an if/while statement, the evaluated expression must be a boolean. e.g:
if (pointer) { ... } /* is invalid */
if (pointer != NULL) { ... } /* is valid */

Some cases are hidden under macros.  For instance, the system call validation macros might call a function named _obj_validation_check(), which returns an int. A value of 0 signals that an object is valid, and a negative value signals the specific error. The macros test if this function returns 0 by using the "!" operator. While the implementation is correct (the assertion will only fail if the function returns non-zero), the expression should be changed so that it compares with 0 explicitly. It's easy to confound. Fixing this is just the matter of changing the macro itself.
Some macros, such as _must_enter_tickless_idle(), will be defined to (1) if Zephyr is built with CONFIG_TICKLESS_KERNEL. Macros like this should be expanded to (true) or (false) (using values from stdbool.h).
If this condition happens inside an assert statement:

If various conditions are asserted in a single assert statement, break it down in multiple statements. Smaller assertions are easier to read and reason.
Compare values explicitly: pointers should be compared against NULL, integers against constant values.
For assertions where it isn't simply "parameter != NULL" or "parameter == 0", document the invariant by using the string argument. An empty string should only be used for trivial invariants.

All other cases should be worked on a case-by-case basis. These points should be considered:

If the return value for a function is always 0 or 1, but it returns an int, consider changing it to a function that returns bool instead
If the return value for a function is 0 in the absence of errors and a negative value for errors:

Check for "no errors" by explicitly comparing its return value to 0
Check for "some error occurred" by checking the sign bit

part of: #9552

rules 16.7, 14.4, 10.1 ... 10.8


Azure Bastion in "southeastasia" region

A hack participant reported that Azure bastion is not available in the southeastasia region.
This page says it is not available.
But this update page published in 2020 says it is.
Verify the availability in the southeastasia region. If it is not available in that region, remove from README.

updated readme
closing


krt: support istio.io/rev filtering

Today we do this in some parts of Istio, but not all. KRT doesn't do it anywhere.
its not 100% clear to me what we should do, but probably we need something

Just to clarify this would be added here (https://github.com/istio/istio/blob/master/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex.go#L140) not in pkg/kube/krt itself


Make starting the daemon explicit

Currently, if there are multiple hosts with inferno commands on them, typing just inferno will start the daemon and automatic processing of configured rules. This puts a stop to that and makes you explicitly tell inferno you want it to start the daemon.

@tspurway If this change is OK with you I'll merge it in. It will prevent cases where a server could have all the prereqs to launch the daemon, but can't be started accidentally.


Add filterTime property

Works similarly to filterDate. Includes tests and an example. Let me know if there are any problems!
Related issue: #2378

Having a problem that the time of date larger than today are filtered unexpectedly.
`
export default function DatetimeSelector(props: IProps){
const {onCancel, onConfirm} = props
const [startDate, setStartDate] = useState(
setHours(setMinutes(new Date(), 0), 9)
);
const filterPassedTime = time => {
const currentDate = new Date();
const selectedDate = new Date(time);
return currentDate.getTime() < selectedDate.getTime();

}
return (
<DatePicker
selected={startDate}
onChange={date => setStartDate(date)}
showTimeSelect
filterTime={filterPassedTime}
dateFormat="MMMM d, yyyy h:mm aa"
/>
);
)
`


Add the ability to use an initialization script

@andreasohlund I have added additional CI coverage for the path that doesn't use an init script


Rearrange the template as an extension #3

The template is based on 71417d0ad7344365ab5da0ac3fe3dd93d43c4984

https://raw.githubusercontent.com/chainsawriot/ccr-quarto/ext/_extensions/ccr/ccr.cls
This file is actually identical to HEAD. Dunno why there are merge conflicts.

Fixed. If you are happy with this, my suggestion is squash and merge.


Change RpcMeasurementConstants.RPC_STATUS to "canonical_status".

/cc @zhangkun83 @dinooliva

Codecov Report

Merging #397 into master will increase coverage by 0.04%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master     #397      +/-   ##
============================================
+ Coverage     90.54%   90.59%   +0.04%
  Complexity      590      590
============================================
  Files           100      100
  Lines          2073     2073
  Branches        207      207
============================================
+ Hits           1877     1878       +1
  Misses          142      142
+ Partials         54       53       -1

Impacted Files
Coverage Δ
Complexity Δ

...a/io/opencensus/stats/RpcMeasurementConstants.java
100% <100%> (ø)
2 <1> (ø)
:arrow_down:

...a/io/opencensus/trace/export/SpanExporterImpl.java
91.66% <0%> (+1.66%)
6% <0%> (ø)
:arrow_down:

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 b34cd84...91304d7. Read the comment docs.


404 at /Machine/%EF%BC%89%E3%80%82

I found a broken link : https://docs.docker.com/Machine/）。
I arrived on this page through: https://ask.csdn.net/questions/384324

Hi @zslaa24, please contact the source page where you found the link.


Integrate language detection

Maybe use Tika Apache: https://tika.apache.org/1.16/api/org/apache/tika/language/detect/LanguageDetector.html
Example: If we notice a column with some Japanese characters, actually use some Japanese characters.

I actually want to make sure we don't touch any data, so I don't want to search for specific values.
But I do think adding different languages is a good idea.
I think instead I should look at what's allowed to be in a column (based on collation, encoding) and then input values from any language based on that. Doing it this way would also prevent people from pushing their biases on data.


UMAMaterial "No Atlas" setting is broken

At least on the Standard Shader - try changing it on UMA_Diffuse_Normal_Metallic and run the crowd scene (decrease crowd size) ends up with 0x0 textures.

Fixed!


Canisters have no air after being unanchored

Reproduction steps.

Spawn canister
Anchor canister to port.
Unanchor canister.
Canister loses all air! This really shouldn't happen.

Will fix after #4208 is merged. It's okay since canister ports can only be spawned with admin tools for now.


arduino-hal: Add support for Arduino Mega

Arduino support like in: https://github.com/Rahix/avr-hal/commit/5304fd0d923cb996b3274c75e3cd4bb0a3ffadfb

@Rahix compiled with cargo build --features arduino-mega in correct branch ;)


fix: replace removed fmt session by rustfmt and ruff

Close #3592

I think you can add CI-skip-changelog label to this PR.


Timeout a build after 6 hours

Current Jenkins build typically takes less than 3 hours. Timeout a build after 6 hours to account for the case when the build died badly (typically due to segfault) and didn't get a chance to report failure.

Not sure since we never used this before but I'd be surprised that there is no indication on whether a build is aborted due to timeout or not.

Jenkins Linux amd64 Build #15382 [push] Current Jenkins build ty... started at 15:37

Jenkins Linux s390x Build #15387 [push] Current Jenkins build ty... started at 16:37

Jenkins Linux ppc64le Build #14412 [push] Current Jenkins build ty... started at 16:37

Jenkins Linux amd64 Build #15382 [push] Current Jenkins build ty... passed after 1 hr 8 min

Jenkins Linux s390x Build #15387 [push] Current Jenkins build ty... passed after 1 hr 38 min

Jenkins Linux ppc64le Build #14412 [push] Current Jenkins build ty... passed after 2 hr 8 min


Dashboard profit wrong amount

Expected behavior
On the dasboard, profit in sats should be displayed correctly.

Actual behavior
In the summary, as well as the 'fees earned' box it's displayed incorrectly.
The summary displays it as 'actual sats earned' * 10 sats
The 'fees earned box' displays it as 'actual sats earned' * 1000
I've attached screenshots of the amounts.
E.g. 273 sats should be 27.3 sats
And 273,356 sats should also be 27.3 sats

To reproduce
View dashboard

System information

Standalone app

integrated-mode, pool-mode

0.12.2-alpha, website download

Raspberry pi

Can you share your exported CSV from the info button under the Spent category? Then, we can see the full list to see what's happening here?

earned_spent.csv
It only seems to affect the daily amounts.
Weekly, etc are correct.

Hi, this will be fixed in our next release next Tuesday! Thanks for reporting!

Should be fixed with the most recent release, but feel free to re-open if it's not!


Update tapir-core, tapir-json-circe, ... to 0.17.2

Updates

com.softwaremill.sttp.tapir:tapir-core
com.softwaremill.sttp.tapir:tapir-json-circe
com.softwaremill.sttp.tapir:tapir-openapi-circe-yaml
com.softwaremill.sttp.tapir:tapir-openapi-docs
com.softwaremill.sttp.tapir:tapir-swagger-ui-http4s
com.softwaremill.sttp.tapir:tapir-zio
com.softwaremill.sttp.tapir:tapir-zio-http4s-server

from 0.16.16 to 0.17.2.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "com.softwaremill.sttp.tapir" } ]

labels: library-update, semver-minor

Superseded by #163.

Superseded by #163.


Small spelling fix  (IDFGH-8815)

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.2 out of 18 committers have signed the CLA.:white_check_mark: suda-morris:white_check_mark: dobairoland:x: jingli:x: ESP-Marius:x: igrr:x: espzav:x: jack0c:x: esp-jiangguangming:x: mahavirj:x: Lindazhxy:x: Icarus113:x: jgujarathi:x: Shreyas0-7:x: BetterJincheng:x: esp-wzh:x: Weijian-Espressif:x: wmy-espressif:x: LuccaMorosiniGioiajingli seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

@LuccaMorosiniGioia Thank you for the PR. Looks like you are trying to merge a PR branch based on release/v4.4 into the master branch. That won't work, unfortunately. Please rebase your quick_fix branch to master, and reopen the PR when ready.


Fuji bugfix

This solves 2 problems of the current master:

Works on rafs
Works on vertical images

Thank you. I assume you have a Fuji camera. Would you be willing to help out more? I mapped everything from the top, left of the image to the top left of the focus box on my camera. I would assume Fuji gives the center point of the focus box and not the top left. As such, the focus box will be off by it's dimensions-scaled. Would you be interested in helping and confirming there?

Yes I own a few in fact (x-t1, x-t2, x30).
Yes no problem, I am happy to help. In fact I spent most of the time trying to find out how to add my changes to the git :-)
I can also help on other themes should you need capacity. My knowledge on .lua is very limited but it seems to be pretty straight forward.
I understand that your AFpoint is not the center of the focus box but the top left. This explains why I had some deviations.
What do you think ? Isn't it better to change your code to make it the middle of the box for all cameras ? This would require to change the few configuration files that already exist but I feel it to be more future proof to do it now.
Alternatively we could change the Fujidelegate to handle it but I am the opinion this is crap.
For example, the Fuji cameras (I assume many hybrids) can change the size of the focus points (very small, small, normal, big) I already searched for an exif field that could lead top the size but did not find it. I am pretty confident this exists in the exif and I will find it later.
For this reason, it seems more logical to center everything ?

I'm leaning towards yes i makes sense to change everything to center point. But it's time to go to work, so let me think about it a little later on. I appreciate the help thus far.

ok let me know what you decided and on what you'd like me to help

How about this:

Let's modify "DefaultDelegate.getDefaultAfPoints" to return the center points adjusting for it in code by adding 1/2 focusPointDimens to the return values.
Modify the default renderer to position the focus box based upon x,y being center.

If you're for the task, make a branch and give it a wack. If not, I can take it on.

ok, i'll do it

and what about changing the 3 existing focus_points files at the same time ? That way we have something consistent from the center

Let's leave those for now because I have a couple other people currently in the process of making some maps. If we go the route of having those centered, I'll just update them then remove the offset in the code.

Looking at the code, I am right if I say that right now, the focus box does not comply to the focusDimensions ?

correct. Unfortunately, lightroom does not allow me to dynamically resize the red focus box UI. So it's just an estimate (a really good one for my camera without a big crop)

Done. Hope this is fine.
Maybe we could add a folder with test images to be able to test the plugin for camera we don't own.
There is a bug in the calculation of the position of the focus points when a angled crop has been used. I did not fix it.

test images: https://github.com/musselwhizzle/Focus-Points-Sample-Images

RE: There is a bug in the calculation of the position of the focus points when a angled crop has been used. I did not fix it.
Yes, a gentleman is working on that and has a PR out for it right now. He got it close, but not exact.

Excellent

Can it be that it did not get it exact because the old algorithm was using the left top corner instead of the center ??

Nah, I dont think so. I tried many things and basically I'm sure I was just off. I THINK what it is is, the images rotates in the middle. so x,y focus point follows a path of a circle around the middle point of the image by "a" radius. There's then an offset for whatever is considered top-left now. Check out the PR that's opened right now if you want. Or feel free to play around with your own version too

Yeah ok. I integrated the PR#10 in my version and it is not working correctly even if it seems to be better. You can manage to get the point far away pretty easily.

2 questions:

Is there a way to let LR understand it should reload the plugin on every change ? Unloading/Loading is tiring and loose time. And sometimes it still does not reload it and you need to restart LR completely.
When you write log() in the code, where is it logged ?

see screen shot

for logging: I do this: tail -f ~/Documents/libraryLogger.log
in Utils.lua turn on isLog = true but dont check that in to "production" code.

if you add new files, yes you probably need to restart LR. Modifying, it should pick up the changes.

perfect, thanks

Can you confirm that the CropLeft Right Top Bottom values are the values of the top left and the bottom right corners ?
Can not find a description on this in the docs.

i read that as 0% off the left side 10% from the top. right size is at 92% percent away from the left edge and same for the bottom. All of the math worked out dead on for me for any crop minus rotation so that understanding should be right.

yes of course, but from the top left corner and from the bottom right corner thats the point. I verified that.
ok ill try to work on this tomorrow.


readme.md

The link to the GovHack Data Model (https://www.lucidchart.com/documents/edit/d36186be-0c77-4e89-a735-6022a716566a) appears to require a paid account - using 3rd party auth (Google) doesn't appear to give access?

I think Keith dumped this into a huge PNG at one stage which would be sitting on our Google drive somewhere. Perhaps we should publish it formally somewhere...

Yeah, let's publish this formally..but it needs updating first to reflect the reality of what has happened since we put it together.


Search bar in search results page in mobile devices should be large

Describe the bug
The current search bar in the mobile view looks clumsy and it affects both the user experience and interface.
To Reproduce

Go to https://ccsearch-dev.creativecommons.org/
Search for something
See error

Expected behavior
the button should be small compare to search bar
Screenshots

Desktop (please complete the following information)

OS: Ubuntu
Browser Chrome

Additional context
Want to work on it :)

This was fixed in https://github.com/creativecommons/cccatalog-frontend/pull/786


fix: correct swift checksum generation during packaging

Overview

Fixes Swift package checksum update
Checklist
My PR contains...

[ ] No code changes (changes to documentation, CI, metadata, etc.)
[x] Bug fixes (non-breaking change which fixes an issue)
[ ] Improvements (misc. changes to existing features)
[ ] Features (non-breaking change which adds functionality)

My changes...

[ ] are breaking changes
[x] are not breaking changes
[ ] If yes to above: I have updated the documentation accordingly

Documentation

[x] My changes do not require a change to the project documentation
[ ] My changes require a change to the project documentation
[ ] If yes to above: I have updated the documentation accordingly

Tests

[x] My changes can not or do not need to be tested
[ ] My changes can and should be tested by unit and/or integration tests
[ ] If yes to above: I have added tests to cover my changes
[ ] If yes to above: I have taken care to cover edge cases in my tests

Code Coverage

Total Project Coverage
92.53%
:white_check_mark:

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

v1.2.6
GitHub release

Your semantic-release bot :package::rocket:


Request: taskbar combining customization

I would humbly like to request the addition of this option :)
Right now I always want to disable combining taskbar buttons by
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 2
the values are:

to always combine, hide labels (default): 0
combine when taskbar is full: 1
never combine: 2

Thank you

This would be another thing along with showing taskbar search (#55), control panel icon size (#45) and possibly other things which are beyond simple "do / undo" pair and require 3 or more states instead. I'll think about if I want such tweaks in the script and how to implement them to be understandable and not collide with future developments plans which I have for the script.


Awesome work

Sorry, not an issue. Just want to sing your praise on the work you are doing here. Amazing stuff. 👍

Hey, @ctrlplusb I appreciate it!
We use react-walk-tree to walk the App tree and call getInitialProps , so grateful for your work as well (I actually tried to get loadable-components to use it as well - https://github.com/smooth-code/loadable-components/issues/102)
If you're ever interested in contributing, we'd love to leverage your expertise in Rogue. I'd also be happy to consider support for react-async-component, so let me know your thoughts!


Android releasing

Android release for push notification fix:
https://github.com/Azure/azure-sdk-for-android/pull/1123/files

What's the reasoning behind doing a major version bump? Is it only due to the minSdkLevel change or are there other things at play? I remember we had some APIs we were planning on deprecating, but I don't remember ever seeing those changes get into the main branch.
I was under the impression this kind of version upgrades would happen if we had breaking changes to make on the API level, but there might be other reasons I haven't considered. What is the guidance we follow on this, @JonathanGiles?

I am not certain on the version as well actually. This fix will break existing push notification users, though the number is pretty low, less than 100 probably. And there is a bump in min version. Please provide guidance on whether a major version bump is needed. Thanks

What's the reasoning behind doing a major version bump? Is it only due to the minSdkLevel change or are there other things at play? I remember we had some APIs we were planning on deprecating, but I don't remember ever seeing those changes get into the main branch.
I was under the impression this kind of version upgrades would happen if we had breaking changes to make on the API level, but there might be other reasons I haven't considered. What is the guidance we follow on this, @JonathanGiles?

I am not certain on the version as well actually. This fix will break existing push notification users, though the number is pretty low, less than 100 probably. And there is a bump in min version. Please provide guidance on whether a major version bump is needed. Thanks

The deprecating API change is not included this time. That is an optional change with low priority.

We follow semantic versioning in Java and Android. We will need to discuss in more depth what is breaking, why it is necessary, and how we have mitigated the breaks for existing users (e.g. updates to documentation, samples, release notes, etc) before we can determine what the version increment should be.


feat: Added async overload for DisposeComponents

From time to time our DisposeComponents test is failing, giving us another chance to solve it via a "real async" approach.
This time I am very much in favour of exposing the API completely (not only internal).
PS: I know I keep you busy with my ideas, apologies for that :D

Looks alright.
We need documentation and a changelog.

Added a small sample in the doc's plus the changelog-entry.

Tried tweaking the code docs a little, what do you think?

Do like it and added a small which implements I feel was missing.

Should I also have all the test's sync and async? And more important: Are we sure that we want this in v1? Or do we wanna go with internal as well?

Should I also have all the test's sync and async? And more important: Are we sure that we want this in v1? Or do we wanna go with internal as well?

Good carch. Yes to the async/sync, and probably keep this internal for now.

Should I also have all the test's sync and async? And more important: Are we sure that we want this in v1? Or do we wanna go with internal as well?

Good carch. Yes to the async/sync, and probably keep this internal for now.

After a second thought, internal will not work in the current setup.
You can't have an internal method on a public interface, which then get's implemented by a class.
So I could just remove it from the interface entirely and have it as an internal method on the renderer. That has other implications, where I am still figuring out what is the nicest solution. One of the problems would be, exposing internal stuff from core to web-project.

Let me also add the sync/async tests

Wild idea @egil : we could mark the new API as preview!? Any thoughts? The same would apply to the other PR.
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.versioning.requirespreviewfeaturesattribute?view=net-6.0

I like that. Users have to opt in, right?
Let's try it out in a preview release and see how it works.

Yes, users have two options:

pragma

#pragma warning disable CA2252
New();
#pragma warning restore CA2252

Enabling this via the  csproj. The same you would do to get preview features like generic math and stuff:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <!-- This will opt in into all preview features -->
        <EnablePreviewFeatures>true</EnablePreviewFeatures>
    </PropertyGroup>

If this sounds right, I would add the new attributes with a bit of explanation inside the attribute.

Hmmm it is only available with net6.0 or greater. That said, users using netcore3.1 or net5.0 can happily use it without opting in, which might cause issues, once the upgrade to the newest version.

If it's just an attribute, can we just include the attribute ourselves using #if xx conditionals?

If it's just an attribute, can we just include the attribute ourselves using #if xx conditionals?

Yes I did this locally... but of course the .net5 compiler can't do much with that... or better in .net5 there is no Roslyn analyzer indicating this as an issue.

See last commit: If you like it, we can keep it...otherwise I'll drop the commit again

Yeah, and it seems they are failing on both Windows and Mac OS. I hope Ill get some time this month to go deep on the new renderer logic again and perhaps some learnings from that can help us.

I'll close this in favor of pushing v2 and putting this feature in there.


Grandchild routes lose their notifications from the dispatcher.

I have an example of an application which has a grandchild route. This route only receives one event from the dispatcher. Attempting to navigate to another grandchild will result in no messages received from the dispatcher.
https://rawgit.com/acidbluebriggs/aurelia-flux-example/dist/
(code can be retrieved at: https://github.com/acidbluebriggs/aurelia-flux-example/tree/dist)
To reproduce:
Click on the Child link ( a child view will display, in an ugly manner).
Click on on of its descendants in the bulleted list.
The outcome is that a descendant receives the event from the dispatcher that an item has been selected.
Attempting to select another grandchild (same level as the previous selection) will result in no messages from the store to the child though the store has requested the dispatcher dispatch the event.

Getting a similar issue.
I got some router modules that get data on the activate method.
Basically the activate dispatch an event that ends up setting up an object on that module.
You can find the code for this here:
http://stackoverflow.com/questions/32994849/aurelia-flux-dispatch-only-call-once-on-activate-method
I'm assuming that maybe the activate method has something to do with it as I'm not getting that error if I move the dispatch to a different method.
Can anyone shed some light over this?

I managed to figure it out.
It seems that the module with the handler gets deactivated at some point and by doing that you miss the handler when an event is dispatched. In my case is when I move from one route item to another.
That handler module being also the one with the router might provoke this, since it's deactivated after a while.

If someone else encounters this issue, my solution was moving handling methods from a routing module.
Navigation provokes deactivation which provokes aurelia-flux to remove any handlers that get deactivated.


Show selector for classes and functions not working

What steps will reproduce the problem?

I have turned on Show selector for classes and functions.
In some project files it works and other it does not.
If I turn it off, apply, then turn it back on, it works in some open files but not others.  If I close the file and then reopen it works. Inconsistent behaviour.
I am unable to share my code.

Hey @muondude, thanks for reporting. Unfortunately you didn't report your Spyder version, but I think this is a duplicate of issue #16406, which we'll try to fix in the coming months.
If you're not using at least Spyder 5.1.5, please update to it because it fixes several issues with the Outline and the selector for classes and functions (both use the same info). The bugs left are the ones reported on issue #16406.

I’m running:

Spyder version: 5.1.5 None

Python version: 3.9.7 64-bit

Qt version: 5.12.9

PyQt5 version: 5.12.3

Operating System: Darwin 21.2.0

-- Sam

Samuel Gasster, PhD

From: Carlos Cordoba @.>
Reply-To: spyder-ide/spyder @.>
Date: Saturday, January 15, 2022 at 9:13 AM
To: spyder-ide/spyder @.>
Cc: Samuel Gasster @.>, Mention @.***>
Subject: Re: [spyder-ide/spyder] Show selector for classes and functions not working (Issue #17194)
Hey @muondude, thanks for reporting. Unfortunately you didn't report your Spyder version, but I think this is a duplicate of issue #16406, which we'll try to fix in the coming months.
If you're not using at least Spyder 5.1.5, please update to it because it fixes several issues with the Outline and the selector for classes and functions (both use the same info). The bugs left are the ones reported on issue #16406.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

Hey Spyder devs, this has been an on going problem for me, across multiple versions of Spyder on Windows and Mac OS. It seems like the selector for classes and functions work for a while, then "breaks" and no longer works. For example I am on Windows 10, Python 3.9, Spyder 5.4.3, and the selector only displays .

@bpruess, no one has reported that before but please update to Spyder 5.5.1 (if you're in Anaconda) and try again.
I think that version comes with some improvements related to that functionality.


Leader election mechanism prevents

Bug Report

While developing this External Secret Operator I ran into an issue with the leader election mechanism as summarized here: https://github.com/ContainerSolutions/externalsecret-operator/issues/22.
My intention is to run multiple instances of the same operator in the same namespace for isolation reasons, however the leader election mechanism gets in the way of this approach because it uses an hardcoded string for the lock id:
err = leader.Become(ctx, "externalsecret-operator-lock")

What did you do?
Deploy two instances of the same operator in the same namespace
What did you expect to see?
Both instances of the operator working correctly
What did you see instead? Under which circumstances?
Only the first instance starts correctly because both instances compete for the same lock in the leader election mechanism:
% kubectl logs dummy1-externalsecret-operator-654ccd8c5-rbzgz -n operators
{"level":"info","ts":1561133148.715241,"logger":"cmd","msg":"Go Version: go1.12.5"}
{"level":"info","ts":1561133148.7154908,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1561133148.7155504,"logger":"cmd","msg":"Version of operator-sdk: v0.6.0+git"}
{"level":"info","ts":1561133148.7156768,"logger":"cmd","msg":"External Secret Operator Version: 0.0.3"}
{"level":"info","ts":1561133148.7157323,"logger":"backend","msg":"initFromEnv","availableBackends":"asm,dummy,onepassword"}
{"level":"info","ts":1561133148.7158184,"logger":"backend","msg":"instantiate","name":"dummy1","type":"dummy"}
{"level":"info","ts":1561133148.7158797,"logger":"backend","msg":"initialize","name":"dummy1"}
{"level":"info","ts":1561133148.7162175,"logger":"leader","msg":"Trying to become the leader."}
{"level":"info","ts":1561133148.7607462,"logger":"leader","msg":"No pre-existing lock was found."}
{"level":"info","ts":1561133148.7654803,"logger":"leader","msg":"Became the leader."}

% kl dummy2-externalsecret-operator-77589468ff-tdftn -n operators
{"level":"info","ts":1561133153.1770334,"logger":"cmd","msg":"Go Version: go1.12.5"}
{"level":"info","ts":1561133153.1770985,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1561133153.1771052,"logger":"cmd","msg":"Version of operator-sdk: v0.6.0+git"}
{"level":"info","ts":1561133153.1771102,"logger":"cmd","msg":"External Secret Operator Version: 0.0.3"}
{"level":"info","ts":1561133153.1771166,"logger":"backend","msg":"initFromEnv","availableBackends":"asm,dummy,onepassword"}
{"level":"info","ts":1561133153.177162,"logger":"backend","msg":"instantiate","name":"dummy2","type":"dummy"}
{"level":"info","ts":1561133153.1771667,"logger":"backend","msg":"initialize","name":"dummy2"}
{"level":"info","ts":1561133153.177314,"logger":"leader","msg":"Trying to become the leader."}
{"level":"info","ts":1561133153.2079115,"logger":"leader","msg":"Found existing lock","LockOwner":"dummy1-externalsecret-operator-654ccd8c5-rbzgz"}
{"level":"info","ts":1561133153.2110562,"logger":"leader","msg":"Not the leader. Waiting."}

Environment

operator-sdk version:
v0.6.0+git

go version:
go1.12.5

Kubernetes version information:
1.14.0

Kubernetes cluster kind:
minikube

Are you writing your operator in ansible, helm, or go?
go

Possible Solution

The generated deployment manifests already use the OPERATOR_NAME environment variable. This could be used to choose the lock id programmatically, for example:
	// Become the leader before proceeding
	operatorName := os.Getenv("OPERATOR_NAME")
	if len(operatorName) == 0 {
		operatorName = "{{ .ProjectName }}"
	}
	err = leader.Become(ctx, operatorName+"-lock")

Additional context
The operator in question reads secrets from an external source (like AWS Secrets Manager, 1Password, etc.) and injects them as Kubernetes Secrets. To increase the level of isolation I depend on RBAC and namespace scope, for this reason I would like to keep multiple operators in the same namespace while allowing them to watch only one namespace, not necessarily the one they are deployed in.

Please let me know if this is a valid bug and the proposed solution is adequate. I would like to try contributing a PR if necessary.

@riccardomc I don't think this is a bug since the leader election mechanism is actually working as intended. The main.go that the SDK scaffolds is meant to cover the general use case (i.e. don't let two operator instances compete to watch and reconcile the same set of resources).
In your use case, you're watching separate sets of resources, so you can edit your main.go to generate an appropriate lock name.
As you mentioned, you could update your main.go to look like:
	operatorName := os.Getenv("OPERATOR_NAME")
	if len(operatorName) == 0 {
		operatorName = "externalsecret-operator"
	}
	err = leader.Become(ctx, operatorName+"-lock")

Ok, thank you. I thought it would be useful for the scaffolding to support this use case but I also see the value in keeping it simple and target the general use case.
I will implement the solution you suggested in our case. Closing.


ZR300 Issue

ZR300 Issue

Required Info

Camera Model
ZR300

Firmware Version

Operating System & Version
Ubuntu 16.04

Kernel Version (Linux Only)

Platform

SDK Version

Language

Segment

Issue Description
Hi,
I have followed the get started guide (https://software.intel.com/en-us/realsense/zr300/get-started) to install the ZR300 camera onto my ubuntu laptop. After typing "cpp-capture" the ZR300 camera is only able to display the colour video instead of the 2 infrared cameras and the fisheye camera. Then after a few minutes the camera window will hang and from the terminal there is an error:
terminate called after throwing an instance of 'std::runtime_error'
what():  VIDIOC_DQBUF error 19, No such device
Aborted (core dumped)
How do I make the ZR300 display video images from the 2 infrared cameras and also the fisheye camera? Also how do I stop the camera window from hanging? Thanks!

Hi @MangoFighter87
Usually this type of error indicates that the device was disconnect due to drawing too much power. Running with the laptop connected to the wall or using powered USB3 hub can help


Refactor identity show command to use rpc abstraction and to stop mapping errors manually

Command: identity show
Current
The current implementation is calling std::process::exit, which is something we want to stop using to handle errors properly and give the user a better-formatted output when a command fails.
It's also using the connect_to function, which can be simplified by using the Rpc utils. Check out how this is done in the subscription commands, for example.
Desired

run method (main entry point of the subcommand) should contain a single line of code calling a function (run_impl/rpc/...) that returns a crate::Result<()>
std::process::exit should not be used manually to map the errors of the command's logic
run method will return (). The error will be internally handled within the node_rpc function
If you need to replace an std::process::exit by an actual error, you can use something like Err(crate::error::Error::new(exitcode::..., anyhow!(...))
Use rpc abstraction instead of connect_to

You can take the subscription commands as a reference.

We love helping new contributors!
If you have questions or need help as you work on your first Ockam contribution, please leave a comment on this discussion.
If you're looking for other issues to contribute to, checkout this discussion and labels -  https://github.com/build-trust/ockam/labels/good first issue or https://github.com/build-trust/ockam/labels/help wanted

Hi, I'd like to contribute to this project.
I have a few queries related to this issue:

Is there a test I can run to see if I've refactored the code correctly?
I'm assuming the old show_identity function that is in use should now be deprecated (and hence deleted)
There is an error that was not directly convertible to the crate::Result error type, namely api::show_identity().to_vec()
For this I'm using Err(crate::error::Error::new(exitcode::DATAERR, anyhow!("An error occurred while converting short identity to vector"))
Is this ok?

Thank you for the reply in advance, really appreciate the help.

Hey @divyank-rs , thanks for showing your interest in the project. Let me answer your questions:

Is there a test I can run to see if I've refactored the code correctly?

We currently have some tests in place in the tests/commands.bats file. We don't have an explicit test for this but this command is being tested indirectly by the "inlet/outlet example with credentials, not provided" test, for example.
You could write a new test for this command checking that it runs successfully. You could also check that the first character of the output equals the IdentityId prefix P.

I'm assuming the old show_identity function that is in use should now be deprecated (and hence deleted)

Yeah, you can create the requests directly as in the subscription command linked in the description.

There is an error that was not directly convertible to the crate::Result error type

Don't worry about this. Once you have the rpc in place, you won't need to convert the request into a vector.

Let me know if you need anything else!

Hey @adrianbenavides ,
Your advice was really helpful and I've written the code. However upon running the tests, half of them including the inlet/outlet example with credentials, not provided test requires ockam enroll to have already occurred. What is the process through which I can run these tests?

You don't need to run those, as they test cloud-related functionalities. You can skip them by setting the ORCHESTRATOR_TESTS env variable. Likewise, you'll want to set the LONG_TESTS env variable:
$ export ORCHESTRATOR_TESTS=1
$ export LONG_TESTS=1

Back to this PR, the identity show command only needs a local node to work, so the basic setup would be to create one with the ockam node create command. Try this first on your terminal to see how it works, it will probably help you understand what to expect:
$ ockam node delete -af # To delete all your running nodes and start clean
$ ockam node create n1
$ ockam identity show --node n1

Hi @adrianbenavides ,
Thanks a lot for your help. I managed to test it locally by writing a short test in the bats file and it is working as expected.

I've added myself as a new contributor here
I've created a PR for this issue here

Please let me know if something more is needed from my side. Looking forward to contributing more to the project!

Hey @adrianbenavides,
I've deleted the unused methods as you requested and here is the test I used to verify the identity show command
@test "test the identity show command" {

  run $OCKAM node create n1

  assert_success

  run $OCKAM identity show --node n1

  assert_success

  assert_output --regexp '^P'
}


Refactor variable names of nearby_query.rq

(Please don't work on this before June 2018, as the file is currently being worked on)
Right now we have a mix of snake_case and camelCase at app/src/main/resources/queries/nearby_query.rq
Please note that refactoring must also be done in the Java source code, and tested.

@nicolas-raoul I can do this by the weekend, I am about to solve the previous issues that I was working on :)

is this issue still open??? I would like to take it :)

@Ksaboor  Yes, thanks! Please test it after refactoring.

@nicolas-raoul
Had some technical difficulties on my end. But I finally got the project open.
For clarity I just want to make sure I'm doing this correctly.

I am going into the nearby_query.rq and making changes to the variables names
Making them either all snake_case or camelCase.
While also going into the Java source code, refactoring them as well, and making all test pass.

I'm guess that problem I'm having is

it looks like most of this file (nearby_query.rq) is in snake_case.
and I am not sure where to look in the java source code to test.

Idk I just might be out of scope to get this done. most of my experience is in Java 8/ Spring Boot

Hi @Ksaboor.
It might be best to have a read through the developer documentation on the wiki
Also here is some information about Wikidata's SPARQL query service.
https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help
However, if you think this is too much to start with have a look around at the other beginner friendly issues :)

@Ksaboor Are you still working on this issue? Otherwise I would love to work on it :)

@FelixEder I'm finished working with it. It's all yours to complete.

@Ksaboor Currently working on issue #395. If I have more time afterwards I'll try to work on this :)

Hi!
Could I try to work on the issue?
But I'm new to android.

@VitalyVPinchuk Are you done any programming with Java (or a similar language) before? :-)

@nicolas-raoul Yes. Long time ago I had experience with C++ using MFC. And I've looked through "Advanced Android App Development" by Google at Udacity recently. So now seeking the opportunity to get my hands dirty.

@VitalyVPinchuk  Cool!
This issue is yours :-)
Please be sure to:

Before: Use the feature to understand how it works
After your refactoring: Test to see whether it still works as intended.

Please report here about your progress every two days at least, thanks!


Implement Incident RW part

Extend /incidents/ID view with modification part (only visible to authenticated users)

Done