text:
Ensure hvplot. hooks are run on every import

The hvplot.<ext> import mechanism is a convenient way to allow users to have to avoid running the holoviews/panel extensions. However since imports are cached only the first import actually embeds the extension JS code, meaning that if you re-run the cell(s) containing import hvplot.pandas (or some other integration) then the JS will no longer be available and on subsequent reloads/re-runs of the notebook plots may not appear. This probably accounts for most issues encountered and described in https://github.com/holoviz/hvplot/issues/1232.
Here we add an IPython hook which simply deletes the modules before every cell execution. This is a big hammer but the best @hoxbro and I could find and at least it is restricted to IPython environments.

We need to update the logic to only register hvplot extensions once, have updated it for some but we should update it for all.

We need to look more into how this is going to affect Polars' users.

@hoxbro can you please review?

oh my word, this explains so much, thanks for hunting it down...

authors: hoxbro maximlt michaelaye philippjfr


text:
Active Installations - Installation Type graph has flatlined

The graph at https://analytics.home-assistant.io/#installations is partially broken... more than 3000 additional users since yesterday, but the installation types numbers have not changed.

source: gharchive/issue

authors: Didgeridrew frenck

license_type: permissive

license_source: github-api


text:
Sun below horizon when we have midnight sun

Home Assistant release with the issue:

Operating environment (HassOS/Generic):

Supervisor logs:

Description of problem:
There seems to be an issue with the sun component when the system is located in a place where we have midnight sun. It shows "below horizon" all the time even though the sun is above the horizon 24 hours a day..

/move home-assistant/home-assistant

authors: agranaas frenck

repo: home-assistant/hassio


text:
Integration Manifestation

In #22699 we have introduced manifests to all integrations. Now it's time to use them when manifests are available.
Manifest validator

[x] Script to validate that each integration has a manifest with the required fields and that fields are the correct types #22708

Codeowners

[x] Generate CODEOWNERS based on a core template + fetch from manifests #22705
[x] Mention code owners when label of integration that they own is added to an issue or PR

Requirements

[x] Generate requirements_* based on manifests #22718
[ ] Remove REQUIREMENTS from all integrations. #23024
[ ] Deprecate REQUIREMENTS for custom components
[x] Install requirements from manifest (fallback to current REQUIREMENTS) #22717

Dependencies

[x] Load dependencies from manifest (fallback to current DEPENDENCIES) #22716
[ ] Remove DEPENDENCIES from all integrations. #23024
[ ] Deprecate DEPENDENCIES for custom components
[x] Use manifest when determining circular dependencies #22908

Document update

[x] PR template #22751
[x] Dev doc update home-assistant/developers.home-assistant#214

I'm working on

Load dependencies from manifest (fallback to current DEPENDENCIES)

What is missing here? DEPENDENCIES and REQUIREMENTS are removed from integrations if I didn't miss any.

If it's possible, we should install integration requirements before validating the integration config so requirements are available in config validation.

I will add that to #23112

363b3c5 👍

I think this issue has been completed and can be closed @balloob ?

Yessssss 💃

authors: MartinHjelmare balloob cgtobi frenck rohankapoorcom

repo: home-assistant/home-assistant


text:
Incorrect link when making new PRs

When making a PR there is a link to the following as ex-require:
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16
It should be line 14:
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L14

Thanks! 🐬 🍪 💯


text:
Zeroconf deprecated key

Description:
Address is deprecated in favour of addresses in zeroconf 0.23
Related issue (if applicable): fixes #
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for configuration.yaml (if applicable):

Checklist:

[x] The code change is tested and works locally.
[ ] Local tests pass with tox. Your PR cannot be merged unless tests pass
[x] There is no commented out code in this PR.
[x] I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

[ ] Documentation added/updated in home-assistant.io

If the code communicates with devices, web services, or third-party tools:

[x] The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
[x] New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
[x] Untested files have been added to .coveragerc.

If the code does not interact with devices:

[ ] Tests have been added to verify that the new code works.

@balloob

source: gharchive/pull-request


text:
Flux log with debug instead of info

Breaking Change:
Nothing breaks
Description:
Flux used to spam the log with debug messages that are labeled INFO. These messages are now labeled DEBUG and wont be shown by default.
Please reject this PR if there are good reasons to show these messages by default.
Related issue (if applicable): fixes #28332
Checklist:

[x] The code change is tested and works locally.
[x] Local tests pass with tox. Your PR cannot be merged unless tests pass
[x] There is no commented out code in this PR.
[x] I have followed the development checklist

Personally I don't need these logs. But I can understand someone who wants to see them. Just to see if the settings work as expected. I'd leave the debug messages.


text:
Restore state for Rfxtrx devices

Description:
This PR aims to add the ability to recover the previous state to Rrxtrx devices, in the same way as has been done for RFLink devices (see #18816).
Rfxtrx devices do not have the ability to ask for their status, so in the reboots, the previous state is lost. This PR gives these devices the ability to 'remember' the status on the reboots.
The new behavior does not apply to devices of the sensor and binary_sensor type, only for covers, switches and lights. In my opinion (and similar as the RFLink integration), I do not believe that the previous state should be restored in these cases, in the next update the correct state will be restored, regardless of the previous state.
Some of the points to review:
I don't own a cover device, so if somebody with a cover device could test the functionality, that would be helpful.
Checklist:

[x] The code change is tested and works locally.
[x] Local tests pass with tox. Your PR cannot be merged unless tests pass
[x] There is no commented out code in this PR.
[x] I have followed the [development checklist][dev-checklist]

If user exposed functionality or configuration variables are added/changed:

[ ] Documentation added/updated in home-assistant.io n/a

If the code communicates with devices, web services, or third-party tools:

[ ] [The manifest file][manifest-docs] has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest. n/a
[ ] New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all. n/a
[ ] Untested files have been added to .coveragerc. n/a

If the code does not interact with devices:

[ ] Tests have been added to verify that the new code works. see note

Note: I haven't added tests as the current test set seems to skip all the tests, see #30272. When #30272 is fixed, I will add tests. Unfortunately, I'm not capable to fix the tests myself.

@Ernst79 any chance we could restore binary sensor state also?  I have a use case of some dusk dawn sensors...

I can test cover func.

I can test cover func.

@tomeeka Please do, thanks.
The easiest to do this is to copy the files from homeassistant/components/rfxtrx (dev branch) into your custom_components folder. Make a folder rfxtrx inside this folder and copy all the files in this folder (also the files that were not updated). This will overrule the build-in integration. Make sure you restart Home Assistant after that, to load the updated integration. After that you can do a second restart to test it. Let me know if it works.

@Ernst79 any chance we could restore binary sensor state also? I have a use case of some dusk dawn sensors...

@pssc In the RFlink integration, they chose explicitly not to do this for the sensor and binary_sensor, see #18816. It feels weird to do it differently for the rfxtrx integration. Unless @Danielhiversen or @MartinHjelmare think otherwise, I was not planning to do this.

I can test cover func.

@tomeeka Please do, thanks.
The easiest to do this is to copy the files from homeassistant/components/rfxtrx (dev branch) into your custom_components folder. Make a folder rfxtrx inside this folder and copy all the files in this folder (also the files that were not updated). This will overrule the build-in integration. Make sure you restart Home Assistant after that, to load the updated integration. After that you can do a second restart to test it. Let me know if it works.

I did what you asked, but it is not working.
The problem is my Somfy RTS covers do not send status updates. (just receiving commands) But with an appdaemon script I set the new state for them after every command. After HA restarts the state is unknown again for every cover. But with this update the sate should be restored even if it is set by appdaemon, right?
On the rfxtrx lights integration page the IoT class is Assumed state.
I think most of 433mhz covers just receiving cmds. Cover class should be assumed state too.
In HA at the Developer / States page there is an attribute for every rfx cover: assumed_state: true

But the states are always unknown.

Yes, the state should be restored. Let’s try to find out why it is not working. A few step you could try.

Do you have a rfxtrx switch or light. Does restoring the state work on these? If not, can you show the path you placed the files in? They might be in the from folder
It sound strange to me that you need an appdaemon script to set the state. Are you sure the cover you use is a cover of the rfxtrx integration, not a template cover?
Could you try to add the following after line 75

    def _handle_event(self, event):
        """Adjust state if rfxtrx picks up a remote command for this device."""
        self.cancel_queued_send_commands()

        command = event["command"]
        if command in ["on", "allon", "up"]:
            self._state = True
        elif command in ["off", "alloff", "down"]:
            self._state = False

I think it is in the right folder, because I get warnings about the rfxtrx custom component:
WARNING (MainThread) [homeassistant.loader] You are using a custom integration for rfxtrx which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
I do not have any rfxtrx switch or light device, I just added 2 test devices with random ids to the config and state restoration is working.
My config folder: /home/homeassistant/.homeassistant/
RFXTRX files: /home/homeassistant/.homeassistant/custom_components/rfxtrx/

This is the configuration of my Somfy RTS covers:

rfxtrx:

  device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A120O843-if00-port0
  # debug: True
  # dummy: True

cover:

  - platform: rfxtrx
    automatic_add: False
    # signal_repetitions: 0
    devices:
      071a000000000001:
        name: Teraszajtó
      071a000000000002:
        name: Nappali kis ablakok 1
      071a000000000003:
        name: Nappali kis ablakok 2
      071a000000000004:
        name: Nappali nagy ablak 1
      071a000000000005:
        name: Nappali nagy ablak 2
      071a000000000006:
        name: Étkező ablak 1
      071a000000000007:
        name: Étkező ablak 2
      071a000000000008:
        name: Háló ablak 1
      071a000000000009:
        name: Háló ablak 2

Added the new lines to the code but still not updating the states.
Could you try adding my config to your system? I think if you uncomment "dummy: True" under rfxtrx, you can test it yourself without actual rfxcom GW and covers.

After sending open/close/stop commands, states are still unknown.

The warning is ok, this is normal for all custom components. I added the dummy cover to my config and it shows up, but I can see that the state is never updated at all. It always stays "unknown". Therefore, I cannot test if restoring the state works. The main issue however seems that the state is never updated for covers.
Could you create a new issue for this, as it seems to be a different issue? I can try to help figuring out what is wrong, but some help of the original developers would be helpful, as my programming skills are limited. They probably won't look in this PR for issues.

I see in several issues (related to google home) that the rfxtrx cover is called a stateless cover.

But this can be fixed, right? Because I could change my rfxcom gw to an rflink gw. My covers are supported by RFLink too.

Sure, but I’m not an experienced programmer, so it’s difficult for me to solve this alone. Also note that this should be discussed in a topic on the forum, not here. See also #14017, where this is also asked and they mention that such a feature request should be made on the forum. So, I would propose that you open a request on the forum and let’s see if we can solve this together, with the help of others.

authors: Ernst79 pssc tomeeka


text:
Initial commit of ZoneMinder Binary Sensor.

Description: A binary sensor for ZoneMinder monitors, reporting the status of each monitor as either motion (on) or no motion (off).  Most of the checklist is not complete as I need some help with this before I proceed with the checklist.
Pull request in home-assistant.github.io with documentation (if applicable): Not yet, will be added once this code is complete.
Example entry for configuration.yaml (if applicable):
binary_sensor:
        - platform: zoneminder
          second:
                  - 10

Checklist:
If user exposed functionality or configuration variables are added/changed:

[ ] Documentation added/updated in home-assistant.github.io

If the code communicates with devices, web services, or third-party tools:

[ ] Local tests with tox run successfully. Your PR cannot be merged unless tests pass
[ ] New dependencies have been added to the REQUIREMENTS variable (example).
[ ] New dependencies are only imported inside functions that use them (example).
[ ] New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
[x] New files were added to .coveragerc.

I need some assistance with my use of track_time_change.  Specifically, I am getting this error:
ERROR:homeassistant.core:Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/usr/home/kjohnson/home-assistant/homeassistant/helpers/entity_component.py", line 386, in _update_entity_states
    yield from update_coro
  File "/usr/home/kjohnson/home-assistant/homeassistant/helpers/entity.py", line 213, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/local/lib/python3.4/asyncio/futures.py", line 358, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.4/asyncio/tasks.py", line 297, in _wakeup
    future.result()
  File "/usr/local/lib/python3.4/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/local/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: update() missing 1 required positional argument: 'now'

In addition, the sensor does not appear to be updating every 10 seconds as I would expect it to.

update will be called automatically for you, and the interval can be specified by scan_interval - which you get for free.

tox reported one error, but I don't thin kit is my fault:
 tests/util/test_async.py

...

         - /usr/home/kjohnson/home-assistant/tests/test_remote.py:270: AttributeError: 'NoneType' object has no attribute 'state'

...

authors: kylejohnson lwis


text:
Xiaomi Philips Lights integration

Description:
Support for Xiaomi Philips Lights (LED Ball & Ceil).
Pull request in home-assistant.github.io with documentation: https://github.com/home-assistant/home-assistant.github.io/pull/3246
Example entry for configuration.yaml (if applicable):
light:
  - platform: xiaomi_philipslight
    name: Xiaomi Philips Smart LED Ball
    host: 192.168.130.58
    token: 2b00042f7481c7b056c4b410d28f33cf

I am not sure if we need this component. Why can't you use the Xiaomi component and light platform?

Xiaomi component supports the gateway and devices connected to it, these WiFi-bulbs are standalone and do not require nor cannot be connected to a gateway.

@balloob Do you need more informations about the differences? I will explain the difference in detail if needed.

okay, that's fine. Can you rename the platform to be xiaomi_philipslight

Is there something else I can do? If not I will prepare the documentation now.

Looks good 🐬
I was planning to add it to 0.52 which goes out tomorrow but won't do it since the documentation is not ready yet.

I just added the documentation. May be it will be merged before the release of 0.52. :-)

Release 0.52 30 minutes ago!

Ups! :-P I'm late.

0.55 - Ave! Somebody can help me with these error:
`2017-10-14 19:11:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
new_entity, self, update_before_add=update_before_add
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 210, in async_add_entity
yield from entity.async_update()
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/xiaomi_miio.py", line 216, in async_update
self.max_mireds, self.min_mireds)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/xiaomi_miio.py", line 226, in translate
value_scaled = float(value - left_min) / float(left_span)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'`

Do not use pull requests for support.

authors: balloob mcsimus rytilahti syssi


text:
Error: 'tagger.email' cannot be null

Hi!
I'm using a GitHub App to run the action that creates the new code version and I'm getting this error:
Error: 'tagger.email' cannot be null
I can't configure an email for the GitHub App. Can anybody help with this?

@mikrafizik do you know if this repository is maintained?

@mbarper, I don't have any write access to this repository, because it was created due to my work in HFN) you can fork it and make all changes

authors: mbarper mikrafizik

license: MIT


text:
reference custom tflite model from inside graph definition

Plugin Version or Commit ID
6b8c6743f23539f7604e74dc260b01e0f58f1707
Unity Version
2020.3.26f1
Your Host OS
Windows 10 Pro
Target Platform
UnityEditor
Description
I'd like to adapt the HelloWorld Scene with a graph that:

accepts a simple float array as input
converts the array into a tflite tensor
runs a tflite model
returns the output of the network (likewise a float array)

While this little toy example runs fine in mediapipe with some example driver code in c++, I cannot get it working in MediaPipeUnityPlugin.
In C++ I just had to specify a relative path to the tflite model in the TfLiteInferenceCalculator section of the graph definition
model_path: ""mediapipe/models/my_model.tflite""
Obviously this line has to be changed when switching to Unity, but how?
What are the exact steps to reference the tflite model correctly?
Code to Reproduce the issue
The graph definition looks like this:
var configText = @"
        input_stream: ""MATRIX:in""
        output_stream: ""FLOATS:out""

        node
        {
          calculator: ""TfLiteConverterCalculator""
          input_stream: ""MATRIX:in""
          output_stream: ""TENSORS:image_tensor""
          options:
          {
              [mediapipe.TfLiteConverterCalculatorOptions.ext]
              {
              zero_center: false
              }
          }
        }

        node
        {
          calculator: ""TfLiteInferenceCalculator""
          input_stream: ""TENSORS:image_tensor""
          output_stream: ""TENSORS:tensor_features""
          options:
          {
            [mediapipe.TfLiteInferenceCalculatorOptions.ext]
            {
              model_path: ""mediapipe/models/my_model.tflite""
            }
          }
        }

        node
        {
          calculator: ""TfLiteTensorsToFloatsCalculator""
          input_stream: ""TENSORS:tensor_features""
          output_stream: ""FLOATS:out""
        }
      ";

Here is the (not yet tested) driver code of the above graph:
      var graph = new CalculatorGraph(configText);
      var poller = graph.AddOutputStreamPoller<float[]>("out").Value();

      // load tflite model from assets
     // ... (not sure what to do here)

      Debug.Log("StartRun");
      graph.StartRun().AssertOk();
      for (var i = 0; i < 10; i++)
      {
        var floatArray = new float[6] { 0, 1, 2, 3, 4, 5 };
        var input = new FloatArrayPacket(floatArray, new Timestamp(i));
        graph.AddPacketToInputStream("in", input).AssertOk();
      }
      graph.CloseInputStream("in").AssertOk();

      Debug.Log("Poll output");
      var output = new FloatArrayPacket();
      while (poller.Next(output))
      {
        Debug.Log(output.Get());
      }

      graph.WaitUntilDone().AssertOk();
      graph.Dispose();

      Debug.Log("Done");
    }

Additional Context
I tried

to rename my_model.tflite to StreamingAssets folder (where apparantly all other tflite model reside) and rename it to my_model.bytes but it's still unclear to me how to reference it from there in the graph definition.

Thanks for the quick reply! This is useful information for a higher level understanding of the Plugin.
Meanwhile I found a hack to load the model at least when running the graph in UnityEditor.
It appears that my next problem is that the graph expects an Eigen::Matrix rather than a vector of floats.
MediaPipeException: INVALID_ARGUMENT: Graph has errors:
Packet type mismatch on calculator outputting to stream "in": The Packet stores "float [0]", but "class Eigen::Matrix<float,-1,-1,0,-1,-1>" was requested.
Mediapipe.Status.AssertOk () (at Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs:48)
Mediapipe.Unity.HelloWorld.Start () (at Assets/MediaPipeUnity/Samples/Scenes/Tutorial/HelloWorld.cs:72)

So far I did not figure out to Eigen::Matrix as input package, but I guess this is for a different issue...

To pass Eigen::Matrix to MediaPipe, we need a Packet<Eigen::Matrix> class (in C#), but there are no such classes currently.
cf. https://github.com/homuler/MediaPipeUnityPlugin/wiki/API-Overview#packett
So you need to implement it (PR is welcome!).
It may be convenient to implement a function that converts mediapipe::MatrixData (in practice, it should be serialized to const char*) into mediapipe::Packet<Eigen::Matrix> since it's easy to handle protocol buffer classes in C# and it seems that Eigen::Matrix can be derived from mediapipe::MatrixData easily with mediapipe::MatrixFromMatrixDataProto.
I think an example from Anchor3dVectorPacket would be helpful in this case (you may want to implement MpReturnCode mp__MakeMatrixPacket__PKc_i(const char* matrix_data, int size, mediapipe::Packet** packet_out)).
https://github.com/homuler/MediaPipeUnityPlugin/blob/d70c6f32c61ef4a199f04c580e75337038e746be/mediapipe_api/graphs/instant_motion_tracking/calculators/transformations.cc#L11-L32
https://github.com/homuler/MediaPipeUnityPlugin/blob/d70c6f32c61ef4a199f04c580e75337038e746be/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs#L22-L33
You can deserialize const char* to the corresponding protocol buffer class.
https://github.com/homuler/MediaPipeUnityPlugin/blob/d70c6f32c61ef4a199f04c580e75337038e746be/mediapipe_api/framework/calculator_graph.cc#L27-L33
https://github.com/homuler/MediaPipeUnityPlugin/blob/d70c6f32c61ef4a199f04c580e75337038e746be/mediapipe_api/framework/calculator_graph.cc#L11-L16

then I would need one more CalculatorNode in the graph that converts my custom Protobuf matrix into an Eigen::Matrix !?

in that case it might be easier to write a calculator that converts the already existing FloatArrayPacket into an Eigen::Matrix

No.
The error you reported in https://github.com/homuler/MediaPipeUnityPlugin/issues/632#issuecomment-1171430852 occurred because you sent a FloatArrayPacket to the in stream. By implementing MatrixPacket : Packet<MatrixData> (in C#) that manages mediapipe::Packet which holds Eigen::Matrix internally (in C++), it can be resolved (note that mediapipe is a namespace used in C++ and Mediapipe is a namespace used in C#).

While I can create a MatrixData matrix = new MatrixData(); object, I don't know how to 'fill it' with data. The only constructor I can find expects an already existing MatrixData object and clones data from there.

You can use setters to set values.
See the official protocol buffer document for more details.
To pass MatrixData to the Unmanaged Code, serialize it like this.
https://github.com/homuler/MediaPipeUnityPlugin/blob/d70c6f32c61ef4a199f04c580e75337038e746be/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs#L31

Can all this be done in C#?

No. MpReturnCode mp__MakeMatrixPacket__PKc_i(const char* matrix_data, int size, mediapipe::Packet** packet_out)) must be implemented in C++.
This function takes matrix_data, which is a serialized MatrixData (byte[] in C#).
In that function, I think you can convert matrix_data into Eigen::Matrix using mediapipe::MatrixFromMatrixDataProto, then build mediapipe::Packet that holds Eigen::Matrix insternally.
The pointer to the built mediapipe::Packet needs to be set to packet_out.

So I will

add a set of C++ functions which will be exposed to C# similar to

medipipe_api/.../transformations.cc, transformations.h
for example a pair:

medipipe_api/.../matrix_frame.cc, matrix_frame.h
the minimum required functions in those files are similar to those in transformations.cc (?), i.e. :

MpReturnCode mp__MakeAnchor3dVectorPacket__PA_i(const mediapipe::Anchor3d* value, int size, mediapipe::Packet** packet_out)`
MpReturnCode mp__MakeAnchor3dVectorPacket_At__PA_i_Rt(const mediapipe::Anchor3d* value, int size, mediapipe::Timestamp* timestamp, mediapipe::Packet** packet_out)

not sure what __PA_i an _At__PA_i_Rt stands for (?), but it seems the first function creates a packet without timestamp and the second one with timestamp (which is propably what I need)

I will create a function to send data from C# to C++

for example (as you mentioned) a function

 MpReturnCode mp__MakeMatrixPacket__PKc_i(const char* matrix_data, int size, mediapipe::Packet** packet_out))

-> wouldn't it be better / easier to send some kind of float array rather than const char* ? should be faster and easier for conversion or am I getting something wrong?

not sure what __PA_i an _At__PA_i_Rt stands for (?),

When porting, I make it a habit to add a suffix that is similar to the C++ mangling rules to distinguish functions with the same name (e.g. mediapipe::CalculatorGraph() -> mp_CalculatorGraph__, mediapipe::CalculatorGraph(const CalculatorGraphConfig& config) -> mp_CalculatorGraph__PKc_i).
I've not defined the rule strictly, but in this case,

MakeAnchor3dVectorPacket represents mediapipe::MakePacket<Anchor3d>
MakeAnchor3dVectorPacket_At represents mediapipe::MakePacket<Anchor3d>.At(mediapipe::Timestamp)
PA represents a pointer to Anchor3d (the type of value)
i reprensets int (the type of size, i)
Rt represents a reference to Timestamp (the type of timestamp)

wouldn't it be better / easier to send some kind of float array rather than const char* ? should be faster and easier for conversion or am I getting something wrong?

Maybe.
To initialize a MatrixPacket, you need to pass a value that represents Eigen::Matrix, and I thought Mediapipe.MatrixData would be convenient.
If you prefer float[] or float[][], it would be OK.
Which one is easier would depend on the person. Assuming mediapipe::MatrixFromMatrixDataProto, I thought Eigen::Matrix could be handled more easily than float[].
Probably float[] version would be faster, but const char* is actually a protocol buffer's serialized data, so I don't think float[] is clearly faster than the other.
P.S. You don't need to implement mp__MakeMatrixPacket__PKc_i in C#.
https://github.com/homuler/MediaPipeUnityPlugin/blob/d70c6f32c61ef4a199f04c580e75337038e746be/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs#L14-L18

regarding the second part of my question "how to fill the MatrixData object"  I guess I found the answer. It seem like the equivalent of this vector
var floatArray = new float[6] { 0, 1, 2, 3, 4, 5 };

is a MatrixData object filled via .PacketData.Add like this:
var matrix = new MatrixData();
matrix.PackedData.Add(0);
matrix.PackedData.Add(1);
matrix.PackedData.Add(2);
matrix.PackedData.Add(3);
matrix.PackedData.Add(4);
matrix.PackedData.Add(5);

Just in case you are interested, this is work in progress

@mgarbade the link is giving me a 404 page I can’t access it I think the repo is private

Just in case you are interested, this is work in progress

ups, sorry. I just repaired the link. it should work now

It seems like I cannot convert a const char * into a MatrixData object. I assume that I'm doing the exact same as [this snippet] (https://github.com/google/mediapipe/blob/e6c19885c6d3c6f410c730952aeed2852790d306/mediapipe/examples/desktop/youtube8m/extract_yt8m_features.cc#L66-L77) from the official mediapipe repo.
However in my case it only compiles if I use mediapipe::file::GetContents to write the serialized matrix data into a string:
MpReturnCode mp__MakeMatrixPacket__PKc_i(const char* matrix_data_serialized, int size, mediapipe::Packet** packet_out) {
  TRY
    mediapipe::Matrix matrix;

    // convert matrix data from char into mediapipe::MatrixData
    std::string content;
    mediapipe::MatrixData matrix_data;
    mediapipe::file::GetContents(matrix_data_serialized, &content);  // <-- using this function feels wrong!
    CHECK(matrix_data.ParseFromString(content));

    // fill matrix with data from matrix_data_serialized
    mediapipe::MatrixFromMatrixDataProto(matrix_data, &matrix);

    *packet_out = new mediapipe::Packet{mediapipe::MakePacket<mediapipe::Matrix>(matrix)};
    RETURN_CODE(MpReturnCode::Success);
  CATCH_EXCEPTION
}

As I said: it compiles, next will be testing. Meanwhile: Any feedback is welcome!
that "hack" was inspired by looking at calculator_graph.cc:
MpReturnCode mp_CalculatorGraph__PKc_i(const char* serialized_config, int size, mediapipe::CalculatorGraph** graph_out) {
  TRY_ALL
    auto config = ParseFromStringAsCalculatorGraphConfig(serialized_config, size);
    *graph_out = new mediapipe::CalculatorGraph(config);
    RETURN_CODE(MpReturnCode::Success);
  CATCH_ALL
}

me slowly moving forward. Meanwhile I've written some C# functions to paste data to the graph, but I'm still getting an Error:
MediaPipeException: INVALID_ARGUMENT: Graph has errors:
Calculator::Open() for node "TfLiteInferenceCalculator" failed: ; Can't find file: mediapipe/models/adder_model_single_input_2x3.tflite
Mediapipe.Status.AssertOk () (at Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs:147)
Mediapipe.Unity.HelloWorld.Start () (at Assets/MediaPipeUnity/Tutorial/Hello World/HelloWorld.cs:94)

Though it looks like the conversion of my input data didn't crash. The data itself might be corrupt though. Is there a way to debug / step into the C++ code while running Unity?

// convert matrix data from char into mediapipe::MatrixData
std::string content;
mediapipe::MatrixData matrix_data;
mediapipe::file::GetContents(matrix_data_serialized, &content);  // <-- using this function feels wrong!
CHECK(matrix_data.ParseFromString(content));

See
https://github.com/homuler/MediaPipeUnityPlugin/blob/a48603aa39ccee03d4ec158fd85778432aac9366/mediapipe_api/framework/calculator_graph.cc#L12-L13
What you should do here is convert const char* to const std::string and gives it to ParseFromString.
Although mediapipe::file::GetContents return std::string, as its name implies, it doesn't convert it to std::string but reads the contents from the given path.
matrix_data_serialized is not a file path (it is rather content), so it should always fail.
mediapipe::MatrixData matrix_data;
CHECK(matrix_data.ParseFromString(std::string(matrix_data_serialized, size)));

Is there a way to debug / step into the C++ code while running Unity?

Please google it.

Found a solution how to hit on C++ breakpoints inside the mediapipe_c.dll
That said, it seems that my code is breaking at
    std::string content;
    mediapipe::MatrixData matrix_data;
    CHECK(matrix_data.ParseFromString(std::string(matrix_data_serialized, size)));

    // fill matrix with data from matrix_data_serialized
    mediapipe::MatrixFromMatrixDataProto(matrix_data, &matrix);  // <- THIS LINE

From what I can I see so far it looks like the way I'm putting data into "MatrixData" is wrong. The parser cannot infer any matrix shape (rows, cols) from the byte string.
Will look further into this tomorrow.

data input is working now. I simply had to manually specify the shape of the input data:
var matrix = new MatrixData();
matrix.PackedData.Add(0);
matrix.PackedData.Add(1);
matrix.PackedData.Add(2);
matrix.PackedData.Add(3);
matrix.PackedData.Add(4);
matrix.PackedData.Add(5);

matrix.Rows = 2;
matrix.Cols = 3;

Next problem: My graph returns a vector<float>, which I'm currently unable to receive.
The current code is crashing Unity:
var poller = graph.AddOutputStreamPoller<float[]>("out").Value();
//...
//start graph
//...
Debug.Log("Poll output");
var output = new FloatArrayPacket();
while (poller.Next(output))  // <-- THIS LINE CAUSES UNITY CRASH
{
  Debug.Log(output.Get());
}

I'll keep on digging...

FloatArrayPacket stores float[], not std::vector<float>.
To receive std::vector<float>, you need to implement a new Packet class (FloatVectorPacket) or a calculator to convert std::vector<float> to float[].

puhh finally I got things working! 😄 🚀 🍻
thanks a lot for your help @homuler !
I will try to clean the code a bit, feel free to comment the code quality in case you are interested in me creating a pull request out of this

FYI: I rebased my changes onto the current master. How should I go forward to make a pull request out of this?

do you want to look at / give some feedback to the commits?

are variable names fine?

should I clean up the commits -> sum up everything into two commits?

one for C#
and one for C++ part)

automatic tests seem to be failing, do I need to write some tests?
what about binary files?

I have a tiny tflite model (just adds "+1" to the input matrix)
should I commit that as well to make the matrix classification demo runnable?

do you want to look at / give some feedback to the commits?

are variable names fine?

If you send me a PR, I'll review it.

should I clean up the commits

Please do it in a way that you think is best.

automatic tests seem to be failing, do I need to write some tests?

By default, tests will fail in a forked repository, so never mind.
It is preferable to write test code for the source code under Packages (e.g. https://github.com/homuler/MediaPipeUnityPlugin/blob/6efa5e1b75b7c6aa487254ade15fe7cd49fc6842/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs).

should I commit that as well to make the matrix classification demo runnable?

No, you don't need to do so.

authors: homuler mgarbade nenenkosi

repo: homuler/MediaPipeUnityPlugin


text:
文章提交三天了, 仍是待审核...

如题

现在应该都审核通过了，招了位小伙伴，每日负责审核，做到日清。

authors: hongyangAndroid javakam

repo: hongyangAndroid/wanandroid


text:
app.mount doesn't include formData

What version of Hono are you using?
4.0.8
What runtime/platform is your app running on?
Bun
What steps can reproduce the bug?
// index.tsx
import { Hono } from 'hono'
import test from './test'

const app = new Hono()

app.get('/', (c) => {
  return c.html(
  <form method="post">
    <button type="submit">submit</button>
    Name
    <input type="text" id="name" name="name" />
  </form>
  )
})
app.post('/', async (c) => {
  const body = await c.req.formData()
  const name = String(body.get('name'))
  return c.text(name)
})

app.mount('/test', test.fetch)

export default app

// test.tsx
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => {
  return c.html(
  <form method="post">
    <button type="submit">submit</button>
    Name
    <input type="text" id="name" name="name" />
  </form>
  )
})
app.post('/', async (c) => {
  const body = await c.req.formData()
  const name = String(body.get('name'))
  return c.text(name)
})

export default app

What is the expected behavior?
c.req.formData() can be obtained
What do you see instead?
Null
Additional information
No response

Hi @taisan11
I've ivenstigating this issue. This is a bug that only occurs when you run on Bun. Maybe there is a problem with Bun, but it is behaving weirdly and I haven't figured it out yet.
But you don't have to use app.mount(), you can use app.route().

Thank you.
I will try to use app.route().
Can I close this issues?

@taisan11
Ah, yeah. If we need to solve the problem again, let's reopen it.

Hiya, I have faced same issue so I have tried to fix this problem.
Then I have noticed the reason why such bug has happen is bun's Request's clone doesn't work properly for body data:  https://github.com/oven-sh/bun/issues/1381
The bun's bug made replaceRequest()(src/hono-base.ts 354-362)'s new Request(url, request) don't work properly (it lost body data).
So we should wait for bun's fix, ...or we can use my workaround code below.
    replaceRequest ||= (() => {
      const mergedPath = mergePath(this._basePath, path)
      const pathPrefixLength = mergedPath === '/' ? 0 : mergedPath.length
      return (request) => {
        const url = new URL(request.url)
        url.pathname = url.pathname.slice(pathPrefixLength) || '/'
        return new Request(url, {
            method: request.method,
            keepalive: request.keepalive,
            headers: request.headers,
            body: request.body,
            redirect: request.redirect,
            integrity: request.integrity,
            signal: request.signal,
            credentials: request.credentials,
            mode: request.mode,
            referrer: request.referrer,
            referrerPolicy: request.referrerPolicy,
        })
      }
    })()

authors: taisan11 yuniruyuni yusukebe

repo: honojs/hono


text:
FIX: Represent dates as msec not seconds

The spec at https://github.com/cognitect/transit-format says that points in time should be
represented as "int msecs since 1970". getTimestamp() returns seconds, so we need to
multiply by 1000.

OK I've tidied this up so that the Datetime test now works.
Note that the code would previously generate a transit\Timestamp object rather than a Datetime.
I have changed this default behaviour in the first commit.

Nice. Thanks!

authors: honzabrecka sminnee

repo: honzabrecka/transit-php

license: mit

license_source: bigquery


text:
CB-11697. Use Exception mapper for FlowsAlreadyRunningException (free…

…ipa).

seems like this one is covered by CloudbreakApiExceptionMapper by datalake or the core code.
use mapper only for FlowsAlreadyRunningException, not on all cloudbreak api eexception (to not break any test that could be built around that etc.)

See detailed description in the commit message.

retest this

retest this

repo: hortonworks/cloudbreak


text:
CB-16440 Add gateway nodes to Spark3 DataHub template

The Spark 3 template is missing the option to add gateway nodes and this has been requested by one of the customers. They would like to have this added to 7.2.11 and later templates.

@gyogal pls rebase

I have rebased my PR and one of the integration tests failed. I can't tell if it is due to my change (because I am not familiar with the project or the tests), but the failure seems CM-related.

retest this please

I have rebased my PR because 7.2.16 blueprints and templates were created in the meantime.

authors: doktoric gyogal


text:
🛑 Branex UK is down

In eaa7cfc, Branex UK (https://branex.co.uk) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Branex UK is back up in b12fb2d after 31 minutes.

repo: hostingnocteam/monitoring


text:
🛑 Console is down

In 4034c4d, Console (https://console.planetary-quantum.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Console is back up in faffc74.


text:
CUDA error during training

Hi, I received this CUDA error after training the model for 3000 steps. I used the exact same command as suggested in README. I suppose it's caused by an indexing out of range issue. Any suggestion where the issue might be? Thank you.

same question
torch 0.3
cuda 9.0

authors: cdhx mliu-dark-knight

repo: hotpotqa/hotpot


text:
Eager-loaded frame fetches but does not render its src

I have an account page which contains content from several different sources so the user can change password, view recent audit logs, etc.  To do this I have a frame for each source.
So my /account page has a turbo frame like this:
<turbo-frame id="change_password" src="/password/edit"></turbo-frame>

The /password/edit page looks like this:
<turbo-frame id="change_password">
  <form action="/password" method="post">...</form>
</turbo-frame>

When the submitted form is invalid, the server (Rails) renders /edit/password with a 422 status.  Turbo correctly updates the frame to have the form with validation errors.  So far, so good.
When the submitted form is valid, the server redirects to /account with a flash message.  The incoming /account page sent to the browser is of course the same as the original /account with the addition of the flash message.  Turbo replaces the content of the turbo frame containing the submitted form with the incoming frame's content, i.e. nothing.  Turbo then GETs the /password/edit page – which is helpful although I don't understand why it re-eager-loads the frame – and receives a 200 response with the /password/edit described above.  However this response's content is not inserted into the turbo frame.
The order of requests is:
Load account page:

GET to /account, results in 200
GET to /password/edit, results in 200 fetch, content type text/html

Submit valid form:

POST to /password, results in 302 fetch / redirect
GET to /account, results in 200 fetch
GET to /password/edit, results in 200 fetch, content type text/html

I don't understand why the account page's turbo frame, once it has updated its contents with the incoming turbo frame's contents (which is empty), re-eager-loads its src.
And since it does, I can't figure out why the src's content – the /password/edit's frame's content – isn't inserted into the /account's frame.
Can anyone explain what I'm doing wrong please?
(I realise that even if I figure out how to solve this, the flash message is still discarded.  Ideally I'd use morphing but as far as I understand using turbo frames prevents that – unless I can break out of the form server side...but the password-change controller is from a third-party gem which isn't as easy to change.)

Since the end result – the original frame winds up empty – is what I expected, there isn't actually an issue.
Perhaps the fact that the frame re-eager-loads itself after it has been updated is simply an implementation side-effect.

repo: hotwired/turbo


text:
Add Code for Bubble Sort.

Add a code for bubble sort following the contributing guidelines.

Hello. Can I help you?

repo: houseofgeeks/CP-Dictionary


text:
possible problems with Events API and Heroku

Putting this here for posterity's sake.
I've been attempting to port my Heroku-based bot to the Events API instead of the RTM API and have been having no luck so far.
This problem initially arose on my primary bot which does not use Botkit Studio. The bot would not respond to commands after switching to the Events API. Nothing would appear in Slack, and the Heroku logs only responded with a "Request timeout" message. Additionally, attempts to console.log the inbound messages to Heroku weren't responding with anything in the logs.
As an experiment, I booted up two Botkit Studio-based bots using the botkit-starter-slack repo, one locally and one on Heroku, leaving them otherwise identical and not making any modifications to the code. The local one continues to work as expected. The Heroku one responded to my first couple of interactions, but then stopped responding and now nothing appears in Slack when I direct message it. I am not getting any error messages in Slack. I am only getting a timeout message in my Heroku logs as the only sign of an error.
2017-03-20T19:19:00.104243+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/slack/receive" host=hbr-botkit-test-2.herokuapp.com request_id=[LONGSTRING] fwd="52.90.33.223" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0 protocol=https

Could you try and open a ticket with Heroku and see if they can provide any additional debug information?

Will do.

Have you checked out issue #504?

@jonchurch thanks for reminding me about these, Ill see about getting the info added to our docs.
@tylermachado Let me know if that fixes your problem!

Unfortunately I'm still seeing a 503 timeout error in my logs.
(To be clear, since my bot architecture is slightly different than that example, what I did was add a Procfile with node bot.js and made sure that new Worker dyno was on after deploying. Already had my config vars in place, a start script and PORT in all caps.)
The Worker dyno idea does kinda make sense to me though? Do requests to the /slack/receive URL require a certain type of dyno? I believe I've been on web only with the RTM API and attempts at Events API.

Still going back and forth with Heroku trying to get information, but I have a theory:
Using the botkit-starter-slack setup, the bot works fine until the Heroku dyno goes to sleep, after 30 minutes or so. When the dyno wakes back up, the bot is not working again unless I go back to the Oauth page and re-authorize it, then it's fine. So maybe the Oauth information stored somewhere on Heroku's ephemeral storage system, and subsequently wiped out, and so after it's been idle for a second those requests are coming from what the bot thinks is a non-authed place?
(I'm hazy on both the server storage stuff and exactly where Oauth tokens are required in the Slack setup, so maybe this is way off.)

@tylermachado yes, i think you nailed it. the starter kit, by default, uses the local filesystem storage, which Heroku clears each time.
We have an internal issue open to turn on a Mongo plugin automatically when deploying to Heroku, but have not yet implemented the change.

Hmmm Im not sure why you'd be seeing a timeout in this instance? Ben is right that a JSON filestore wont work on heroku, you can switch to the botkit mongo storage module
I could be misunderstanding the error heroku is throwing, but you say you dont have an error in your botkit logs? Even with debugging on?
When the JSON file system gets wiped out by heroku, itll cause the findAppropriateTeam() function in handleWebhookPayload() to throw an error (or at least it certainly should!).
But it sounds like from your logs the message is never hitting your server? Because we respond promptly with a 200 at the webhook, before we go looking in the db for team info. So the bot could fail without team info, but that request shouldn't timeout.
Can you confirm if you are getting a request sent to your webhook? Maybe stick a console.log in there to see that youre getting the request body.

@jonchurch Yeah the JSON file storage thing was mainly a problem on the sample bot I set up. We use a custom Postgres storage system on the real bot -- trying to figure out if something got disconnected from that when switching to Events.
I do have debug turned on, and I see the other usual debug events (like debug: Setting up a handler for direct_message,direct_mention,mention and so forth.)
But when I send a DM to the bot, I don't see any debug event or anything else from Slack. I only see the Heroku 503 error that I put in my initial post.
I think that's correct that the message isn't hitting the server? I put a console.log() as the very first thing in the default handler for any direct message, but nothing is getting logged from the Slack side. Like SOMETHING is coming from Slack to trigger that timeout, but anything in my direct message handler isn't coming through.

Just to be clear on my previous message: I am console.logging req.body in controller.webserver.post to the slack/receive URL, and that works fine. The place where console.log doesn't work is controller.on('direct_message, ... .

An update: now, just as with the starter-slack bot, I have it working on my regular bot after I have re-authed on my team. And I have to re-auth every time the dynos restart. So that further isolates the problem to a storage issue. What is weird to me here is that on my real bot, I already have all the original Oauth stuff saved in a database. Still testing to figure out what is missing.

Just to close the loop on this: I think all my issues were ultimately due to some differences in how my app was parsing my Postgres DB vs. how the Botkit samples do. Eventually solved by duplicating a lot of the library code in my custom additions, changing parts relating to storage as need be. Thanks for all the help and guidance, all.

I'm just facing the same issue after adding the urls of interactive message to myherokuapp.com/slack/receive
2017-04-27T18:43:17.493888+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/slack/receive" host=slack-uxbot.herokuapp.com request_id=c9b52875-2064-4bb5-b8fe-52df56a3eaa0 fwd="54.165.241.61" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https

Already posted this via heroku ticket.

I'm facing this issue too...

authors: abinashmohanty benbrown d4victory jonchurch peterswimm tylermachado

repo: howdyai/botkit


text:
Add FB payment settings API

Hello 👋
This PR adds Facebook payment settings to messenger profile API.
Docs here
Enjoy

No it's not related, that allows setting up "privacy policy URL", "public key" and "test users".


text:
Cannot use TokenType.Aad since 0 is equal to false

TokenType.Aad represents a 0 and this prop cannot be passed as a string.
0 when evaluated by JS is false.
Inside component implementation there is a function called getConfigFromProps that validates tokenType sent to the component, as it follows:
tokenType: tokenType || TokenType.Embed,
This always fails if left side of the expression is 0.
Maybe you could change Aad to 2 or allow to pass string as tokenType param.
Thanks.

same problem here.
this also happens with Permissions.Read (= 0).
I patched using ?? (nullish coalescing) instead of the || (logical OR).
permissions: permissions ?? Permissions.All,
tokenType: tokenType ?? TokenType.Embed,
type: embedType ?? 'report'
but this is a relatively new feature in ES, so it depends on which versions of node/typescript/target es/etc you are using.
if you can't use ??, you may use something like:
permissions: (permissions != (null || undefined)) ? permissions : Permissions.All,
tokenType: (tokenType != (null || undefined)) ? tokenType : TokenType.Embed,
type: (embedType != (null || undefined)) ? embedType : 'report'

authors: AaronJPA carlosedof

repo: howlowck/react-powerbi


text:
More rate limit improvements

Introducing a new rate limit rule that uses feedback from the Strava API about actual limit usage. It uses variable cool-down periods after each response processed by the client. The cool-down periods depend on the number of request left in the current period, and the priority given to the rule. There's no need to initialize this rule with explicit limits, it will get these from the API responses as well.

Please review for merge, and test (several functional tests are failing at my end because of dependencies on being a specific Strava user (getting 401 and 404 responses)?)
Thanks!

Excellent work.  I'm going to merge, though I have not re-run functional tests yet.  I'll do that before releasing anything.  I need to revisit those yet again to see if there's something better we can do.

One thing that would be really useful is any documentation in README.md or in the docs/ directory that provides an overview for using this new XRateLimitRule functionality.  I can help with this too.

authors: hozn jsamoocha

repo: hozn/stravalib


text:
[BUG]: "OverflowError: int too big to convert" during SFT training using Bloom model

🐛 Describe the bug
torchrun --standalone --nproc_per_node=2 train_sft.py \
    --pretrain "bigscience/bloom-560m" \
    --model 'bloom' \
    --strategy ddp \
    --log_interval 10 \
    --save_path  "./output/" \
    --dataset "/data/users/lcxyc/instinwild_ch.json" \
    --batch_size 2 \
    --accimulation_steps 8 \
    --lr 2e-5 \
    --max_datasets_size 512 \
    --max_epochs 1 \

When building the SFT dataset, the error occurs.
Environment
No response

I also get an error when running this file, and I can't import the package after downloading the transformers

train_sft.py => from coati.models.llama import LlamaLM line11

train_sft.py => from coati.models.llama import LlamaLM line11

It's so weird because your from coati.models.bloom import BLOOMLM can pass but for llama couldn't. Maybe you should check your coati module and reinstall it.

authors: GXKIM chengeharrison

repo: hpcaitech/ColossalAI


text:
New account creation

A user not affiliated with the HPI (i.e. no HPI-openID Login is possible) should be able to register an account with the system.

This is currently not needed. Usage is restricted to HPI students. External users can be added by admins via console.


text:
大哥注册的单词写错了

改一下吧  救救孩子吧
comporents====> components

@A2Data 这个从第一版就在了，实例应该改了吧

还木有、、、

的确是, 下了组件复制代码, 然后报错, 幸好看了这个issues

已改


text:
Disable completion when in a comment

I don't know if it's just me, but this would be a useful feature IMO.

It is useful feature, but comment parsing is very difficult.

Since the syntax highlighting knows when you are in a comment, is there any way that this could  piggyback off that?

The default syntax highlight knows it, but if treesitter is enabled it is hard.

cmp.setup({
  enabled = function()
    local lnum, col = vim.fn.line('.'), math.min(vim.fn.col('.'), #vim.fn.getline('.'))
    for _, syn_id in ipairs(vim.fn.synstack(lnum, col)) do
      syn_id = vim.fn.synIDtrans(syn_id) -- Resolve :highlight links
      if vim.fn.synIDattr(syn_id, 'name') == 'Comment' then
        return false
      end
    end
    return true
  end,

Yes, it only works for non treesitter syntax

I'm working on a function for this
I'll open a pr soon

authors: Shougo dmitmel max397574 mbpowers


text:
Create tutorial notebook(s)

We want to make at least:

one tutorial that demonstrates the usage of the entire code briefly
one notebook that runs as a test, making sure everything works all right

This is dependent on finding a smooth solution in #59
Depending on the implementation, these two could be realized with one notebook only.

Closed with #81.

repo: hrwakeford/ExoTiC-ISM


text:
done

Команда synergy выполнила задание

В целом хорошо, на 6 баллов можно принять без исправления замечаний

Мы исправили

Задание принято, 7 баллов. Замечания обсудим на семинаре

authors: AlenaLits MikhailovAlexander


text:
Support log4j2's Message objects

Hi @hseeberger, thanks for the great library!
Support for logging Message objects directly would be very beneficial for structured logging, something most libraries do using MDC. MDC, however, is not threadsafe and generally painful to use in Akka (can't log from Future callbacks, for example).
I'll gladly send a PR for this feature. What do you think?

I don't think this will work, because akka-log4j is just a backend for the logging API of Akka which only allows for String messages.

True, but I was planning on implementing an alternative LoggingAdapter (and corresponding ActorLogging trait) that has an API that supports passing Message objects.

I see. That's out of scope for this project, though.

authors: hseeberger iravid


text:
Received NaN for the x2 attribute. If this is expected, cast the value to a string.

{
    "name": "xxx",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "dev": "next",
        "build": "next build",
        "start": "next start"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
        "@vx/axis": "0.0.184",
        "@vx/event": "0.0.182",
        "@vx/gradient": "0.0.183",
        "@vx/grid": "0.0.184",
        "@vx/group": "0.0.183",
        "@vx/mock-data": "0.0.185",
        "@vx/scale": "0.0.182",
        "@vx/shape": "0.0.184",
        "@vx/tooltip": "0.0.184",
        "@zeit/next-css": "^1.0.1",
        "draft-js": "^0.10.5",
        "draft-js-export-html": "^1.3.3",
        "firebase": "^5.9.4",
        "immutable": "^4.0.0-rc.12",
        "next": "^8.0.4",
        "next-images": "^1.1.1",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "redux-zero": "^5.0.2"
    },
    "devDependencies": {
        "next-compose": "0.0.2"
    }
}

Current next version problem?

Component is Areas example.
import React from 'react';
import { AreaClosed, Line, Bar } from '@vx/shape';
import { appleStock } from '@vx/mock-data';
import { curveMonotoneX } from '@vx/curve';
import { GridRows, GridColumns } from '@vx/grid';
import { scaleTime, scaleLinear } from '@vx/scale';
import { withTooltip, Tooltip } from '@vx/tooltip';
import { localPoint } from '@vx/event';
import { bisector } from 'd3-array';
import { timeFormat } from 'd3-time-format';

const stock = appleStock.slice(300);

// util
const formatDate = timeFormat("%b %d, '%y");
const min = (arr, fn) => Math.min(...arr.map(fn));
const max = (arr, fn) => Math.max(...arr.map(fn));
const extent = (arr, fn) => [min(arr, fn), max(arr, fn)];
// accessors
const xStock = d => new Date(d.date);
const yStock = d => d.close;
const bisectDate = bisector(d => new Date(d.date)).left;

class Chart extends React.Component {
    constructor(props) {
        super(props);
        this.handleTooltip = this.handleTooltip.bind(this);
    }
    handleTooltip({ event, data, xStock, xScale, yScale }) {
        const { showTooltip } = this.props;
        const { x } = localPoint(event);
        const x0 = xScale.invert(x);
        const index = bisectDate(data, x0, 1);
        const d0 = data[index - 1];
        const d1 = data[index];
        let d = d0;
        if (d1 && d1.date) {
            d = x0 - xStock(d0.date) > xStock(d1.date) - x0 ? d1 : d0;
        }
        showTooltip({
            tooltipData: d,
            tooltipLeft: x,
            tooltipTop: yScale(d.close)
        });
    }
    render() {
        const {
            width,
            height,
            margin,
            hideTooltip,
            tooltipData,
            tooltipTop,
            tooltipLeft,
            events
        } = this.props;
        if (width < 10) return null;

        // bounds
        const xMax = width - margin.left - margin.right;
        const yMax = height - margin.top - margin.bottom;

        // scales
        const xScale = scaleTime({
            range: [0, xMax],
            domain: extent(stock, xStock)
        });
        const yScale = scaleLinear({
            range: [yMax, 0],
            domain: [0, max(stock, yStock) + yMax / 3],
            nice: true
        });

        return (

                <svg ref={s => (this.svg = s)} width={width} height={height}>
                    <rect x={0} y={0} width={width} height={height} fill="#32deaa" rx={14} />
                    <defs>
                        <linearGradient id="gradient" x1="0%" y1="0%" x2="0%" y2="100%">
                            <stop offset="0%" stopColor="#FFFFFF" stopOpacity={1} />
                            <stop offset="100%" stopColor="#FFFFFF" stopOpacity={0.2} />
                        </linearGradient>
                    </defs>
                    <GridRows
                        lineStyle={{ pointerEvents: 'none' }}
                        scale={yScale}
                        width={xMax}
                        strokeDasharray="2,2"
                        stroke="rgba(255,255,255,0.3)"
                    />
                    <GridColumns
                        lineStyle={{ pointerEvents: 'none' }}
                        scale={xScale}
                        height={yMax}
                        strokeDasharray="2,2"
                        stroke="rgba(255,255,255,0.3)"
                    />
                    <AreaClosed
                        data={stock}
                        x={d => xScale(xStock(d))}
                        y={d => yScale(yStock(d))}
                        yScale={yScale}
                        strokeWidth={1}
                        stroke={'url(#gradient)'}
                        fill={'url(#gradient)'}
                        curve={curveMonotoneX}
                    />
                    <Bar
                        x={0}
                        y={0}
                        width={width}
                        height={height}
                        fill="transparent"
                        rx={14}
                        data={stock}
                        onTouchStart={event =>
                                this.handleTooltip({
                                    event,
                                    xStock,
                                    xScale,
                                    yScale,
                                    data: stock
                                })
                        }
                        onTouchMove={event =>
                                this.handleTooltip({
                                    event,
                                    xStock,
                                    xScale,
                                    yScale,
                                    data: stock
                                })
                        }
                        onMouseMove={event =>
                                this.handleTooltip({
                                    event,
                                    xStock,
                                    xScale,
                                    yScale,
                                    data: stock
                                })
                        }
                        onMouseLeave={event => hideTooltip()}
                    />
                    {tooltipData && (
                        <g>
                            <Line
                                from={{ x: tooltipLeft, y: 0 }}
                                to={{ x: tooltipLeft, y: yMax }}
                                stroke="rgba(92, 119, 235, 1.000)"
                                strokeWidth={2}
                                style={{ pointerEvents: 'none' }}
                                strokeDasharray="2,2"
                            />
                            <circle
                                cx={tooltipLeft}
                                cy={tooltipTop + 1}
                                r={4}
                                fill="black"
                                fillOpacity={0.1}
                                stroke="black"
                                strokeOpacity={0.1}
                                strokeWidth={2}
                                style={{ pointerEvents: 'none' }}
                            />
                            <circle
                                cx={tooltipLeft}
                                cy={tooltipTop}
                                r={4}
                                fill="rgba(92, 119, 235, 1.000)"
                                stroke="white"
                                strokeWidth={2}
                                style={{ pointerEvents: 'none' }}
                            />
                        </g>
                    )}
                </svg>
                {tooltipData && (

                        <Tooltip
                            top={tooltipTop - 12}
                            left={tooltipLeft + 12}
                            style={{
                                backgroundColor: 'rgba(92, 119, 235, 1.000)',
                                color: 'white'
                            }}
                        >
                            {`$${yStock(tooltipData)}`}
                        </Tooltip>
                        <Tooltip
                            top={yMax - 14}
                            left={tooltipLeft}
                            style={{
                                transform: 'translateX(-50%)'
                            }}
                        >
                            {formatDate(xStock(tooltipData))}
                        </Tooltip>

                )}

        );
    }
}

export default withTooltip(Chart)

Could you check that width and height are defined?

Thank you for reply.
I'm tryng this code from 'page/index'(My Home Component)
import {Component} from 'react'
import {connect} from 'redux-zero/react';
import fn from '../../states/fn';
import Page from '../../layouts/page';
import Chart from '../../widgets/chart'

const mapToProps = ({ s , d}) => ({ s, d });

class Home extends Component {
    constructor(props) {
        super(props)
    }

    componentWillMount() {
        this.props.visibilityNav(false)
    }

    render() {
        return (
            <Page title="Home">
                <Chart width="100%" height="300" margin={{left: 10, right: 10, bottom: 10, top: 10}}/>
            </Page>
        )
    }
}

export default connect(mapToProps, fn)(Home)

then, I got same error.
Received NaN for the `x2` attribute. If this is expected, cast the value to a string.

width and height must be numbers. You are passing strings here
<Chart width="100%" height="300" margin={{left: 10, right: 10, bottom: 10, top: 10}}/>

  <ParentSize>
    {parent => {
      return (
        <Chart width={parent.width} height={300} margin={{left: 10, right: 10, bottom: 10, top: 10}} />
      );
    }}
  </ParentSize>

Here's where width + height get passed to the demo tile: https://github.com/hshoff/vx/blob/master/packages/vx-demo/components/gallery.js#L158
You can see another example of using <ParentSize> to make responsive charts here: https://vx-demo.now.sh/responsive

This issue seems come up often. I'm going to add default values to the width, height props for the demo code examples.

Going to close this as I think it's been resolved.

authors: amwo hshoff sto3psl

repo: hshoff/vx


text:
fix(CSS) remove position: relative

It is my understanding that position: relative is only needed for special cases. If people need it, they can add it to the element in question. Testing this change in my own app resulted in zero visual change, and a slightly smaller vendor.css.
This also facilitates the usage of ember-popper with flexi elements. As is, my tooltip addon is borked on the relatively positioned elements.
Eager to get this into 2.0.0 since it is a breaking change.

I will need confirmation on more browsers.

Seems fine to me, but agree with @runspired that we need to check all browsers. Definitely seen some things break in Safari for no reason with flexbox.

I don't think this is entirely worth the headache of breaking changes it may cause for people, and I'm happy to report that Popper.js now works fine with relatively positioned elements.
Closing this out for now

authors: kybishop runspired rwwagner90

repo: html-next/flexi-default-styles


text:
How to check if a route already exists?

I would like to know how to prevent replacing a route with other

Can't you do something like this?
fn route_exists(&self, path: &str) -> bool {
    self.router.recognize(path).is_ok()
}

repo: http-rs/route-recognizer


text:
🛑 Manhuagui is down

In bcb6dcc, Manhuagui (https://www.manhuagui.com) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Manhuagui is back up in b3f4f1b after 8 minutes.


text:
🛑 Manhuagui is down

In 717c112, Manhuagui (https://www.manhuagui.com) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Manhuagui is back up in f76b391 after 6 minutes.


text:
CORS and auth interaction

CORS passes the options request to the service on a pre-flight request.  When the service is protected by an auth middleware, the preflight request returns a 403.  This unsuccessful response prevents us from adding the CORS headers to the response.
I don't find a lot of support for this behavior:

CORS flowchart says to return a 200 response with no body.
The Tomcat CORSFilter dos not pass along the request.
The Jetty CrossOriginFilter also does not.
The W3C spec doesn't mention that a successful response to the preflight request implies a successful response to the actual request.

A more conservative change would be to respond to preflight requests with CORS headers if the OPTIONS request is successful, 401, or 403.  The latter has stronger support if the CORSConfig has allowCredentials = true.  But that also feels like a hack, where an outer middleware understands too much about an internal one, and I worry what other interactions with middleware aren't thought of.
/cc @jordantdavis

Is this only an auth-related problem, or is it not a more general problem? With the current behavior, I have to add support for OPTIONS requests to all services or else a 404 will be returned. I have solved this for now by using a fallback service which always succeeds for OPTIONS requests.
def alwaysSucceedForOptions = HttpService {
  case OPTIONS -> _ => Ok("...")
}
val myService = CORS(Service.withFallback(realService)(alwaysSucceedForOptions), CORSConfig(...))


text:
DSL Documentation Clarification

Both the primary DSL page and client DSL fail to mention working with parametric F which leads to confusion since this requires different imports and use patterns. We should try to be more explicit about the DSL and what we are doing in both sections of the docs.

Just to explain with a little more detail what happened for the outsiders! Here is a sample of code:
import cats._, cats.effect._, cats.implicits._

class Service[F[_]: Effect] {
  // ... has a bunch of things it can do with F
}

Now I want to add a method where I send an HTTP request. I look it up and http4s has a client, so let's use that. I add the sbt import and follow the guide. I end up with:
import cats._, cats.effect._, cats.implicits._

import org.http4s._
import org.http4s.client.blaze._
import org.http4s.client.dsl.io._
import org.http4s.client.Client
import org.http4s.headers._
import org.http4s.MediaType._
import org.http4s.Uri

class Service[F[_]: Effect](val underlying: Client[F]) {

  // ... has a bunch of things

  //want to send a request
  def post(): F[String] = {
    val req = Method.POST(
      Uri.uri("https://dummy.com"),
      UrlForm(
        "key" -> "value"
      ),
      Authorization(BasicCredentials("user", "password"))
    )
    underlying.expect[String](req)
  }
}

But I end up with an error like this:
[error]   (s: String)(implicit d: org.http4s.EntityDecoder[F,String])F[String] <and>
[error]   (uri: org.http4s.Uri)(implicit d: org.http4s.EntityDecoder[F,String])F[String] <and>
[error]   (req: F[org.http4s.Request[F]])(implicit d: org.http4s.EntityDecoder[F,String])F[String] <and>
[error]   (req: org.http4s.Request[F])(implicit d: org.http4s.EntityDecoder[F,String])F[String]
[error]  cannot be applied to (cats.effect.IO[org.http4s.Request[cats.effect.IO]])
[error]     underlying.expect[String](req)
[error]                      ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 1 s, completed 26-May-2018 8:46:24 AM

I'm confused because, I never used cats IO in my code but I have an error telling me basically that IO is not F.
It turns out that import org.http4s.client.dsl.io._ is what brings in IO. When I found out, it took me 2 minutes to fix, and the changes were really simple:
--- a/src/main/scala/Example.scala
+++ b/src/main/scala/Example.scala
@@ -2,13 +2,13 @@ import cats._, cats.effect._, cats.implicits._

 import org.http4s._
 import org.http4s.client.blaze._
-import org.http4s.client.dsl.io._
+import org.http4s.client.dsl.Http4sClientDsl
 import org.http4s.client.Client
 import org.http4s.headers._
 import org.http4s.MediaType._
 import org.http4s.Uri

-class Service[F[_]: Effect](val underlying: Client[F]) {
+class Service[F[_]: Effect](val underlying: Client[F]) extends Http4sClientDsl[F] {

   // ... has a bunch of things

Anyway, I'm glad for everything you've done. If I can help, I certainly will.

This is still not in the documentation! I had to add the extend Http4sClientDsl[F] to have the client work with IO


text:
Running background tasks in http4s

The current documentation doesn't have any information on how we can run background tasks in an http4s service. A few examples that highlight the common patterns used for running tasks in a background thread would be helpful - especially for those new to pure FP programming in Scala, with cats-effect, fs2, etc.

This is going to be more of a cats-effect or fs2 issue, as we entirely rely on their concurrency support.  But some pointers to their own documentation on the subject would be prudent.

authors: prvnsmpth rossabaker


text:
Fix pending tests in blaze-server on fs2-cats

A few tests in Http1ServerStage are marked pendingUntilFixed.  We need to fix them.
Rendering responses with chunked transfer encoding is currently in rough shape.  The scalaz-stream branch has a highly optimized "sink" for ProcessWriter which doesn't translate well to fs2.

Fixed by #879


text:
Skip some flaky tests

We're not fixing them, and we're not touching blaze internals much, and these spurious failures are frustrating other work.  This is regrettable, but the status quo is worse.

I regret this, but I can't get some PRs over the finish line without this, and if we start testing on 1.14, it's going to get worse.


text:
Update Prometheus Client To 0.10.0 And Fix Tests

Prometheus is changing the naming scheme of some of their metrics in order to be compatible with the OpenMetrics standard. Part of this means that all counters will have _total or _created as a suffix. There is no way to create a counter without a _total suffix.
See: https://github.com/prometheus/client_java/pull/615

I'm making this a draft because I'm not 100% satisfied with this situation.
Because of the way that the Prometheus client_java is changing the internal data model, users will silently have some of their exposed metrics changed. For example, with the default http4s metrics, the Metric name for the http4s counter defined here (https://github.com/http4s/http4s/blob/series%2F0.22/prometheus-metrics/src/main/scala/org/http4s/metrics/prometheus/Prometheus.scala#L248) will magically change from org_http4s_server_request_count to org_http4s_server_request_count_total, no matter what you explicitly set the metric name to (https://github.com/prometheus/client_java/blob/parent-0.10.0/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java#L70).
This means that if the user is not very closely following the upstream developments in Prometheus, they are going to have their counter related metrics just vanish.
Because Prometheus's client doesn't offer any way to optin to either the new or old metric naming, I don't see any way to give the user a clean and safe upgrade path. The only thing I can think of is that we re-implement the old behavior from client_java < 0.10.0 and immediately deprecate it pointing the users to the new upstream changes. That wouldn't be too hard, but is definitely not ideal.
Thoughts?

I'm making this a draft because I'm not 100% satisfied with this situation.
Because of the way that the Prometheus client_java is changing the internal data model, users will silently have some of their exposed metrics changed. For example, with the default http4s metrics, the Metric name for the http4s counter defined here (https://github.com/http4s/http4s/blob/series%2F0.22/prometheus-metrics/src/main/scala/org/http4s/metrics/prometheus/Prometheus.scala#L248) will magically change from org_http4s_server_request_count to org_http4s_server_request_count_total, no matter what you explicitly set the metric name to (https://github.com/prometheus/client_java/blob/parent-0.10.0/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java#L70).
This means that if the user is not very closely following the upstream developments in Prometheus, they are going to have their counter related metrics just vanish.
Because Prometheus's client doesn't offer any way to optin to either the new or old metric naming, I don't see any way to give the user a clean and safe upgrade path. The only thing I can think of is that we re-implement the old behavior from client_java < 0.10.0 and immediately deprecate it pointing the users to the new upstream changes. That wouldn't be too hard, but is definitely not ideal.
Thoughts?

Good questions.  If the opt-out path is to downgrade, we're taking away that option by proceeding with this upgrade.  And eyeballing the diff again, I think maybe 0.10 is backward compatible enough that people could upgrade the jar to opt in.  But the argument against that is the same as the argument against it in the ticket: at some point, users who aren't paying attention will be cut over, and it might as well be now.  Who are we to delay what the Prometheus experts have decided it's time to do?
I think we just highlight this change in the release notes and people really want to stay on 0.9 can implement metrics ops with some small copy and paste and if anyone wants to make an http4s-prometheus_0.9 nanolibrary to share, then so be it?

Good questions.  If the opt-out path is to downgrade, we're taking away that option by proceeding with this upgrade.  And eyeballing the diff again, I think maybe 0.10 is backward compatible enough that people could upgrade the jar to opt in.  But the argument against that is the same as the argument against it in the ticket: at some point, users who aren't paying attention will be cut over, and it might as well be now.  Who are we to delay what the Prometheus experts have decided it's time to do?
I think we just highlight this change in the release notes and people really want to stay on 0.9 can implement metrics ops with some small copy and paste and if anyone wants to make an http4s-prometheus_0.9 nanolibrary to share, then so be it?

should this be retargeted to 0.22 ?
I also agree that this needs a breaking flag.

should this be retargeted to 0.22 ?
I also agree that this needs a breaking flag.

Yes, 0.22 is the right target for this.

Yes, 0.22 is the right target for this.

@rossabaker @hamnis gah! I meant to target 0.22. I'm never going to get that right....

@rossabaker @hamnis gah! I meant to target 0.22. I'm never going to get that right....

Okay, making non-draft.

Okay, making non-draft.

authors: hamnis isomarcte rossabaker


text:
Update netty-buffer, netty-codec-http to 4.1.62.Final

Updates

io.netty:netty-buffer
io.netty:netty-codec-http

from 4.1.60.Final to 4.1.62.Final.
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 = "io.netty" } ]

labels: library-update

0.21

Superseded by #4692.

authors: rossabaker scala-steward


text:
Potentially redundant for-loop in extract_dino_correspondences.py

I see the following code:
https://github.com/hturki/suds/blob/main/scripts/extract_dino_correspondences.py#L96
    for k in range(n_clusters):
        for i, (label, rank) in enumerate(zip(kmeans.labels_, ranks)):
            if rank > bb_topk_sims[label]:
                bb_topk_sims[label] = rank
                bb_indices_to_show[label] = i

I don't understand the outermost for-loop. It doesn't seem to affect any computation.
Moreover, I find that this loop is taking up 80% of the total run time (another 15% is taken up by k means, so overall the GPU utilization is quite poor).

you are correct. nice catch, probably a mistake from refactoring into using sklearn's kmeans.labels_

authors: dllu fferroni

repo: hturki/suds


text:
RWTH Webseite in besser

Ich will bei HTWR übertreiben und der RWTH Website mal zeigen, was alles in diesem modernen Zeitalter möglich ist.

tacking in #44


text:
"WHERE" and "AND" clauses can produce syntax errors

Hello!
First of all, thanks a lot for this amazing tool. I've been using it a lot in my personal projects.
Recently, I came across several issues when working with WHERE and AND clauses. Previously in #149 and v1.30.1 you've added validation of arrays used in these queries. But they can still produce empty clauses if array is not empty but contains only empty strings.
Example:
sb.Distinct().Select("*").Where("")
sb.And("", "")
sb.Distinct().Select("*").Where(sb.And("", ""))

will produce accordingly:
SELECT DISTINCT * WHERE
( AND )
SELECT DISTINCT * WHERE ( AND )

In v1.30.1 you've implemented counting size in bytes of strings to be inserted into AND condition. I think this might be handy in resolving this issue. If nothing can be added except for predefined constants, so i think nothing should be added. So the And function can be changed like this:
func (c *Cond) And(andExpr ...string) string {
	if len(andExpr) == 0 {
		return ""
	}

	exprByteLen := estimateStringsBytes(andExpr)
	if exprByteLen == 0 {
		return ""
	}

	buf := newStringBuilder()

	// Ensure that there is only 1 memory allocation.
	size := len(lparen) + len(rparen) + (len(andExpr)-1)*len(opAND) + exprByteLen
	buf.Grow(size)

	buf.WriteString(lparen)
	buf.WriteStrings(andExpr, opAND)
	buf.WriteString(rparen)
	return buf.String()
}

Same logic can be applied to WHERE clause, if all andExprs are empty, so don't generate them. So AddWhereExpr can be changed like this:
func (wc *WhereClause) AddWhereExpr(args *Args, andExpr ...string) *WhereClause {
	if len(andExpr) == 0 {
		return wc
	}

	andExprsBytesLen := 0
	for _, expr := range andExpr {
		andExprsBytesLen += len(expr)
	}

	if andExprsBytesLen == 0 {
		return wc
	}

	// Merge with last clause if possible.
	if len(wc.clauses) > 0 {
		lastClause := &wc.clauses[len(wc.clauses)-1]

		if lastClause.args == args {
			lastClause.andExprs = append(lastClause.andExprs, andExpr...)
			return wc
		}
	}

	wc.clauses = append(wc.clauses, clause{
		args:     args,
		andExprs: andExpr,
	})
	return wc
}

With these fixes examples provided previously will produce these values:
SELECT DISTINCT *
empty_string
SELECT DISTINCT *

If you think that these changes are legit and I'm not missing something, I can work on them in a PR. Examples above are just some raw ideas not the final code.

Sounds reasonable. Besides And and AddWhereExpr, Not and Or can be changed in this way too.

Yes, sure. I can work on it in a PR in a couples of day.

It's highly appreciated! Thanks for your time.

authors: huandu rodionovv

repo: huandu/go-sqlbuilder


text:
how to test own pointcloud ?

Thanks for your great work!
1）what is the steps for data preprocessing?
i normalize to unit cube like this:
LOD_input, normals = load_ply(ply_path)
LOD_input_min = np.min(LOD_input, 0)
LOD_input_max = np.max(LOD_input, 0)
LOD_input_scale = np.max(LOD_input_max - LOD_input_min)
LOD_input = LOD_input - np.reshape(LOD_input_min, [1, 3])
LOD_input = LOD_input / LOD_input_scale
input_points = LOD_input - np.reshape([0.5, 0.5, 0.5], [1, 3])
I don't know if that's true
2）the result i get seem not very good.
vis the SubsamplePointcloud (N=10000):

get the mesh

there is no points but output mesh

mesh seems not very good
Am I missing something？？ Any suggestions？？

Hi @zuixiaosanlang sorry for the late response.
For 1), I think this should be correct if your data is already y-up.
For 2) this seems weird. May I know which model you're using? If you want you may also give me a link of your test point cloud so that I can try it on my end.

@heiwang1997
i am sorry to reply so late.
my input data:
matterport.zip
run the demo:
python test.py none --ckpt checkpoints/matterport/without_normal/paper/checkpoints/best.ckpt
and get the result(i save as .ply):
result.zip

repo: huangjh-pub/neural-galerkin


text:
WIP: Speed up imitation learning training by allowing users to jump to a timestamp

During the training, we will replace one of the vehicles in history data with an agent. However, this agent might appear in the middle of an episode but SMARTS still step through the replay data from the beginning until the agent shows up.
In this PR, I exposed a param start_time to allow us to set the frame start time.

I don't think this is the right design. The reset(..., start_time=...) isn't actually doing what the API makes it seem. One would think it's offsetting the sim by the given start_time, but really just changing the internal clock.
This looks to be a one-off solution for the history data replay work and not useful to anything else (or applicable to anything else). Can we just offset the timestamps of the data replay data directly / modify the data replay input?

Yes, the side effect of changing the clock is hidden, I am not sure about the change of reset too. I can try your suggested approach by maintaining an offset that just applied to the history provider.

I don't think this is the right design. The reset(..., start_time=...) isn't actually doing what the API makes it seem. One would think it's offsetting the sim by the given start_time, but really just changing the internal clock.
This looks to be a one-off solution for the history data replay work and not useful to anything else (or applicable to anything else). Can we just offset the timestamps of the data replay data directly / modify the data replay input?

Yes, the side effect of changing the clock is hidden, I am not sure about the change of reset too. I can try your suggested approach by maintaining an offset that just applied to the history provider.

Underestimated the difficulty. Not only the history provider has the clock issue, but also the trap manager. The time that an agent is emitted, is specified in the mission's start time.
So two things:

the history provider needs to know the offset
mission starts at time 0 sec (Supporting multiple agent missions makes it harder :thinking: )

I will try to work towards the approach above.

repo: huawei-noah/SMARTS


text:
上传3G大小的文件返回错误23

文件3.2G,  最终put_object的时候返回OBS_STATUS_XmlParseFailure错误,  其他小于1G的都是可以的

可以根据这个文档https://support.huaweicloud.com/sdk-c-devg-obs/obs_20_1603.html
配置日志后可获取更详细的错误信息，方便定位

repo: huaweicloud/huaweicloud-sdk-c-obs


text:
Doesn't seem to be working

"You should be good to add Asana tasks now!"
I was expecting a link or something, or "task added". Right now, it's telling me "i can add tasks" when i just added one! So confused :p
asana: asdfasdf
bot: "You should be good to add Asana tasks now!" (asana task no where to be found).
Maybe my vars are messed up .. what is my "project name"?  Can anyone give me an example? it's the only one i thought is weird.
Also can anyone confirm that it's supposed to respond "you should be good"?

https://www.npmjs.com/package/hubot-asana
Using the example itself,
asana: ship some code
"You should be good to add Asana tasks now!"
I looked at the code itself and it seems that this is the response if I were to give hubot the API key! This is 100% not normal after looking at the code. I'm not sure how to resolve it though, not good at coffee or asana API

repo: hubot-scripts/hubot-asana


text:
chore(coveralls): Remove badge

Removing the coveralls badge. #1605

Just pinging the thread in hopes to get these merged.

repo: hubotio/hubot


text:
AbstractMethodError on SwipeableItemClickListener

SwipeableItemClickListener should be updated to implement onRequestDisallowInterceptTouchEvent() method. Now it throws java.lang.AbstractMethodError. If anyone faces this problem it can easily be solved by extending  SwipeableItemClickListener and implementing onRequestDisallowInterceptTouchEvent()

I am too getting same error.

got the solution, change the following function
addOnItemTouchListener(new SwipeableItemClickListener(this,
                new OnItemClickListener() {
                    @Override
                    public void onItemClick(View view, int position) {
                        if (view.getId() == R.id.txt_delete) {
                            touchListener.processPendingDismisses();
                        } else if (view.getId() == R.id.txt_undo) {
                            touchListener.undoPendingDismiss();
                        } else { // R.id.txt_data
                            Toast.makeText(AlertsActivity.this, "Position " + position, Toast.LENGTH_SHORT).show();
                        }
                    }

                }) {
            @Override
            public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
            }
        });

Awesome, it works, thank you very much!

repo: hudomju/android-swipe-to-dismiss-undo


text:
Remove unused filters

These rules should not be in use anymore for of one of these reasons:

the domain can't be resolved anymore
the domain redirects
the domain expired and shows completely different content
the file is not there anymore

@Teko012 Thank you for your contribution!
I plan to upload a script that checks dead domains. I see you also filtered out the dead paths, what did you use?

@scripthunter7 The dead paths (if we mean the entries pointing to individual files) were mostly manual checks, as there were only a few of them, but it could be automated, based on a Content-Type header and response code check for example. All the others were either dead domains (won't resolve), immediately redirecting to a fully different domain (so rules won't work), or a few cases of just being advertisements (those were caught manually).

@Teko012 Oh, I see. By the way, I am planning a major update in January, the current scripts will be removed from the repo, only the source code of the core adblock list remains here.
Probably 3 packages will be included:

compiler (CLI tool similar to the current build)
linter (CLI tool for linting adblock rules)
orderer (CLI tool for ordering filter rules)

I plan to remove the named sections from the orderer, as it is only a temporary solution. Related to this, adguard-specific.txt and ublock-specific.txt will be removed, as I will include them in the other categories with pre-processor directives, something like this:
ads.txt
! Common rules
example.hu##.ad
! ...

!#if (adguard)
! AdGuard-specific ad filter rules
! ...
!#endif

!#if (ext_ublock)
! uBlock-specific ad filter rules
! ...
!#endif

!#if (ext_abp)
! ABP-specific ad filter rules
! ...
!#endif

The build tool will take these pre-processor directives into account, and the orderer will probably define the groups automatically along the empty lines.
And the dead domains check should be checked periodically, for example every 1-2 weeks, similar to how dependabot works.
I only wrote this because I know there are gaps in the repo, I just haven't gotten around to changing them yet. 🙂

@Teko012 By the way, I see that you have a good understanding of this topic, if you are interested and if you have some free time, I will gladly accept your help in refactoring the filter rules. This typically means that we should go through the current ones and write the actual, optimal selectors. There are probably a lot of obsolete rules anyway. It's also perfect if there are only a few sites in a PR.
Most of my time is now taken up by development, unfortunately I don't have time to optimize the filter rules until at least February.
See also https://github.com/hufilter/hufilter-dev/issues/246

repo: hufilter/hufilter-dev


text:
🛑 Akkoma is down

In dbc20cc, Akkoma (https://akkoma.chez.chat) was down:

HTTP code: 404
Response time: 464 ms

Resolved: Akkoma is back up in f2185d5 after 6 minutes.

repo: hufman/upptime


text:
UI suggestion - smaller fontSize of placeholder

I think  it will be better to change the fontSize of input's placeholder to be smaller visually.

Will add the ability to customize fonts

authors: PaulChess cyrilzakka

repo: huggingface/chat-macOS


text:
Restored broken link to FAQ

What does this PR do?

Fixes #136.
Updated broken link 😄
Who can review?
@merveenoyan and @stevhliu.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

authors: HuggingFaceDocBuilderDev sergiopaniego

repo: huggingface/cookbook


text:
Import error

https://github.com/huggingface/datasets/blob/cd3d8e637cfab62d352a3f4e5e60e96597b5f0e9/src/datasets/__init__.py#L28
Hy,
I have error at the above line. I have python version 3.8.13, the message says I need python>=3.7, which is True, but I think the if statement not working properly (or the message wrong)

Hi ! Can you
import platform
print(platform.python_version())

to see that it returns ?

Then it should work as expected if you use the same python when using datasets
Please make sure you're running your code in the right environment

If you're having an error then you're not running your code in the right environment.

repo: huggingface/datasets