TypeError issue with AWR1443

Hi,
First of all, thanks for the code!
I was able to run the code on a raspberry pi 4 with python 2.7. I downloaded all the required libraries and I used pyqt4. I use an AWR1443 mmWave radar bought very recently. The demo code was compiled with mmWave SDK 2.1.0.
When I start the code, a graph window appears on the bottom left corner. It has axes but no data are being plotted.
I logged the output of the console and put them in the file in the attachment. Since the same error is displayed on the console repeatedly, I put a single instance of the recurring error below (for more details please see there attached log file).
It seems to be a type error between float and int:
TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int32') with casting rule 'same_kind'
Here is a single instance:

[22:53:16]  Ignored exception:
|==============================>>
|  Traceback (most recent call last):
|    File "readData_IWR1443.py", line 323, in <module>
|      dataOk = update()
|    File "readData_IWR1443.py", line 289, in update
|      QtGui.QApplication.processEvents()
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/widgets/GraphicsView.py", line 161, in paintEvent
|      return QtGui.QGraphicsView.paintEvent(self, ev)
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/debug.py", line 93, in w
|      printExc('Ignored exception:')
|    --- exception caught here ---
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/debug.py", line 91, in w
|      func(*args, **kwds)
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 1033, in paint
|      viewMask = self._maskAt(self.getViewBox().viewRect())
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 1157, in _maskAt
|      w *= px
|  TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int32') with casting rule 'same_kind'
|==============================<<

log-1st-Feb-2021.txt
Thanks in advance!

It seems to be a problem with the variable types. I am not sure if it will fix your issue, but anyway, you should use Python3 with this repository.
Also, I will close your other issue, let me know how it goes with this issue.
Ibai

Thank you very much for your answer.
It is really great when the author of the code replies to the issues.
Tomorrow I will test and edit this message with the result. I will test:

changing from python 2.7 to python 3.7 and 3.8
using your code from another repo for SDK2.1 (despite the board name)

No problem, and thanks for the patience.
I did not realize about the SDK version. Yes, you should definetely use the other repository. Sorry for the naming, I made this repository when the IWR1443 was only avaiable in the SDK version 1.

Sorry in advance for the long post...
Hardware

Raspberry pi 4
AWR1443, with code compiled for SDK 2.1.0

Software

python 2.7 and python 3.X
pyqt 4

Procedure

I used the official TI GUI on a win7 x64 PC with my AWR1443 to test if it works properly
I used git clone to download all the following repository to the /home/pi/ directory:
- AWR1843-Read-Data-Python-MMWAVE-SDK-3-
- AWR1642-Read-Data-Python-MMWAVE-SDK-2
- IWR1443-Read-Data-Python-MMWAVE-SDK-1
I changed the parameters in the .conf file of each of the directory with the one
I opened a terminal and cd to the appropriate directory
I check that I have the latest pip version with pip -V and pip3 -V
I checked I have the mentioned python libraries using pip -ver and pip3 -ver
I logged the output of the command line python3 name_of_the_python_script.py (python3.X)
I do the same for python name_of_the_python_script.py (python2.7)

Result
When using python3, irrespective of the repository, I have (the name of the .py file and line n# are different each time, of course):

Traceback (most recent call last):
File "readData_AWR1642.py", line 299, in
CLIport, Dataport = serialConfig(configFileName)
File "readData_AWR1642.py", line 27, in serialConfig
CLIport = serial.Serial('/dev/ttyACM0', 115200)
AttributeError: module 'serial' has no attribute 'Serial'

Traceback (most recent call last):
File "readData_AWR1843.py", line 271, in
CLIport, Dataport = serialConfig(configFileName)
File "readData_AWR1843.py", line 27, in serialConfig
CLIport = serial.Serial('/dev/ttyACM0', 115200)
AttributeError: module 'serial' has no attribute 'Serial'

Which I think means the code was meant for python2.7 because the call to this library has changed.
Reference: https://stackoverflow.com/a/11404052
When I use python2.7, it seems I the code goes through. A figure always start at the bottom left on the monitor, the parameters are listed on the console (seems to be the same as in the file I modified). Then the code stops for 10s and then spits out some errors:
Small version:

TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int32') with casting rule 'same_kind'

Complete version: (from AWR1642-Read-Data-Python-MMWAVE-SDK-2 but similar for all directories)

% ***************************************************************
% Created for SDK ver:01.02
% Created using Visualizer ver:<IP_ADDRESS>
% Frequency:77
% Platform:xWR14xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.047
% Maximum unambiguous Range(m):2.41
% Maximum Radial Velocity(m/s):1
% Radial velocity resolution(m/s):0.13
% Frame Duration(msec):50
% Range Detection Threshold (dB):15
% Range Peak Grouping:disabled
% Doppler Peak Grouping:disabled
% Static clutter removal:enabled
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg 0 1 0 1
profileCfg 0 77 267 7 57.14 0 0 70 1 240 4884 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 100 1 0
lowPower 0 1
guiMonitor 1 0 0 0 0 1
cfarCfg 0 2 8 4 3 0 1280
peakGrouping 1 1 1 1 229
multiObjBeamForming 1 0.5
clutterRemoval 0
calibDcRangeSig 0 -5 8 256
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 123 0
CQSigImgMonitor 0 119 4
analogMonitor 1 1
sensorStart
[13:58:06]  Ignored exception:
|==============================>>
|  Traceback (most recent call last):
|    File "readData_AWR1642.py", line 325, in <module>
|      dataOk = update()
|    File "readData_AWR1642.py", line 291, in update
|      QtGui.QApplication.processEvents()
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/widgets/GraphicsView.py", line 161, in paintEvent
|      return QtGui.QGraphicsView.paintEvent(self, ev)
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/debug.py", line 93, in w
|      printExc('Ignored exception:')
|    --- exception caught here ---
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/debug.py", line 91, in w
|      func(*args, **kwds)
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 1033, in paint
|      viewMask = self._maskAt(self.getViewBox().viewRect())
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 1157, in _maskAt
|      w *= px
|  TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int32') with casting rule 'same_kind'
|==============================<<

[13:58:06]  Ignored exception:
|==============================>>
|  Traceback (most recent call last):
|    File "readData_AWR1642.py", line 325, in <module>
|      dataOk = update()
|    File "readData_AWR1642.py", line 291, in update
|      QtGui.QApplication.processEvents()
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/widgets/GraphicsView.py", line 161, in paintEvent
|      return QtGui.QGraphicsView.paintEvent(self, ev)
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/debug.py", line 93, in w
|      printExc('Ignored exception:')
|    --- exception caught here ---
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/debug.py", line 91, in w
|      func(*args, **kwds)
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 1033, in paint
|      viewMask = self._maskAt(self.getViewBox().viewRect())
|    File "/home/pi/.local/lib/python2.7/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 1157, in _maskAt
|      w *= px
|  TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int32') with casting rule 'same_kind'
|==============================<<

Thank you for the detailed report. Did you install pyserial in Python3? (pip3 install pyserial) My guess is that the problem you are having is a problem with pyserial, check this similar problem:
https://stackoverflow.com/questions/11403932/python-attributeerror-module-object-has-no-attribute-serial
Also, since you are using the mmWave SDK 2, then you just need to try the  AWR1642-Read-Data-Python-MMWAVE-SDK-2 repository, the others will give you errors later on because the data format from the radar is different.


Use 'package' module instead of yum, apt and dnf

Refactor the code using 'package' module
Fix Issue #520
(However it doesn't cover all cases because some of them are not refactorable.
Ex: because of diverging packages name between distribution)

jenkins test this please

jenkins test this please

jenkins test ansible2.2-xenial-cluster

jenkins test ansible2.2-dmcrypt-journal-collocation
jenkins test ansible2.2-journal-collocation

jenkins test ansible2.2-journal-collocation

jenkins test this please

jenkins test this please


Events no longer show up on Receipts as of 0.2.2

When I use 0.2.1, my Starknet receipts contain the expected events.
However, when upgrading to 0.2.2, the events field is always an empty list on receipts.
My method and event:

@event
func balance_increased(amount : felt):
end

# Increases the balance by the given amount.
@external
func increase_balance{
        syscall_ptr : felt*, pedersen_ptr : HashBuiltin*,
        range_check_ptr}(user : felt, amount : felt):
    let (initialized) = is_initialized.read()
    assert initialized = TRUE

    let (res) = balance.read(user=user)
    balance.write(user, res + amount)
    balance_increased.emit(amount)
    return ()
end

Some simple code:
self.starknet_client.wait_for_tx_sync(txn_hash)
receipt = self.starknet_client.get_transaction_receipt_sync(tx_hash=txn_hash)

Let me know if you need more reproduction steps, but it is pretty standard contract txn i think

Which command are you using to run Devnet?

starknet-devnet --host <IP_ADDRESS> --port 8545

I slightly modified your contract to be able to compile it:
%lang starknet

from starkware.cairo.common.cairo_builtins import HashBuiltin

@storage_var
func balance(user : felt) -> (res : felt):
end

@event
func balance_increased(amount : felt):
end

# Increases the balance by the given amount.
@external
func increase_balance{
        syscall_ptr : felt*, pedersen_ptr : HashBuiltin*,
        range_check_ptr}(user : felt, amount : felt):

    let (res) = balance.read(user=user)
    balance.write(user, res + amount)
    balance_increased.emit(amount)
    return ()
end

I used Starknet CLI (starknet deploy, starknet invoke and starknet get_transaction_receipt) and got the following transaction receipt (didn't use any account/wallet utilities):
{
    "actual_fee": "0x0",
    "block_hash": "0x35ed2dab17fabbc66d2f1f378eca1b7e3d5aaed636183c1a67fdb9d84f237f9",
    "block_number": 1,
    "events": [
        {
            "data": [
                "0xa"
            ],
            "from_address": "0x49c4bbb991b27cc6083a6275ec58c5cff83d7688155d6052ebe36ab2de61028",
            "keys": [
                "0x3bec334a035524b3b31728bfc91f817edefdc0660cfa309fd1b317d810b3607"
            ]
        }
    ],
    "execution_resources": {
        "builtin_instance_counter": {
            "bitwise_builtin": 0,
            "ec_op_builtin": 0,
            "ecdsa_builtin": 0,
            "output_builtin": 0,
            "pedersen_builtin": 2,
            "range_check_builtin": 6
        },
        "n_memory_holes": 20,
        "n_steps": 174
    },
    "l2_to_l1_messages": [],
    "status": "ACCEPTED_ON_L2",
    "transaction_hash": "0x29346980f1de65e5c555d33ff714163c2fff4f05cabe7cfdbea82f2911869e",
    "transaction_index": 0
}

So the event seems to be here.

Yeah, seems to be an issue when running the transaction through an account.

Sorry for the delated response.
Yes, I can confirm I am running it through an account.


[nrf noup] SafePointerCast.h: match upstream version

Problem
This file has a 2020 copyright upstream, but commit
00ac05f5fd880aad6acf332b198353696b9ddf9e
("[nrf fromup] Fix unaligned access or ARM") pulls it in with a
different date.
Reconcile the difference before taking a snapshot of the repository
for history rewrite.
This allows us to rebase cleanly.
Change overview
Change to a comment.
Testing
No testing is required because comments are semantically irrelevant.

@Damian-Nordic just FYI.


Exception on DNN 9.5 when same MVC module inserted several times on a page

Description of bug
An MVC module working properly on DNN 9.2 to 9.4 returns an exception when inserted several times on a page. DNN returns following exception:
DotNetNuke.Services.Exceptions.ModuleLoadException: A single instance of controller 'Dnn.Modules.MyModuleName.Controllers.MyController' cannot be used to handle multiple requests. If a custom controller factory is in use, make sure that it creates a new instance of the controller for each request. ---> System.InvalidOperationException: A single instance of controller 'Dnn.Modules.MyModuleName.Controllers.MyController' cannot be used to handle multiple requests. If a custom controller factory is in use, make sure that it creates a new instance of the controller for each request. at System.Web.Mvc.ControllerBase.VerifyExecuteCalledOnce() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at DotNetNuke.Web.Mvc.Framework.Modules.ModuleApplication.ExecuteRequest(ModuleRequestContext context) at DotNetNuke.Web.Mvc.MvcHostControl.ExecuteModule().
As the same module works fine for year on different versions of DNN, I have not spent much time on trials. Wanted to get your feedback first to learn if something can be changed in module code to fix this.
Steps to reproduce
List the precise steps to reproduce the bug:

Place an MVC module several times on a page.
Display the page.
The exception above is returns on second module. First module is displayed properly.

Current behavior
Only the first module is displayed properly. The other ones on the same page return the exception above.
Expected behavior
All modules should work properly as they did on previous version.
Affected version

[ * ]  9.5.0 latest supported release
[ ]  9.4.4 and prior work fine

Affected browser
Does not depend on browser.

Can you confirm that this does still occur in 9.5.0?  Just want to confirm first as there were changes in 9.5.0 that could improve and your notes say that 9.4 is the issue

Hi. No. I'm saying the opposite. The module was developed on DNN 9.2 and upgrade to latest 9.4.4 without issue. Problem only occurs on 9.5.0 after upgrading the web site.

I tried with the attached module in 9.5.0 and 9.5.1, I was able to reproduce only on 9.5.0 and not in 9.5.1 using the attached module. So I would start by upgrading, if that does not fix it, please report back and I will be glad to reopen the issue.
TestModule_<IP_ADDRESS>_Install (1).zip

Thanks for prompt reply. Tested some minutes ago on 9.5.1rc1. The test module still returns the same error. I suppose the fix is not yet applied to release.
Error returned :  DotNetNuke.Services.Exceptions.ModuleLoadException: A single instance of controller 'Wingman.FPF.Modules.TestModule.Controllers.DefaultController' cannot be used to handle multiple requests. If a custom controller factory is in use, make sure that it creates a new instance of the controller for each request.

Strange... @jacoch let's continue this on #3634 as it has a possible solution path in there...


shift does not work in byte mode

Attached program produces the output of 06
The real compiler produces  61
assumption - such a transpilation is not correct - the xstring is not character type
lv_xstring = '0061736D' . ->lv_xstring.set(new abap.types.Character({length: 8}).set('0061736D'));
shift_does_not_work_in_bynary_mode.txt

reduced example
    DATA lv_xstring TYPE xstring.
    lv_xstring = '0061736D' .
    SHIFT lv_xstring IN BYTE MODE BY 1 PLACES CIRCULAR.
    WRITE: lv_xstring+0(1).

SHIFT runtime = https://github.com/abaplint/transpiler/blob/main/packages/runtime/src/statements/shift.ts
SHIFT transpiler = https://github.com/abaplint/transpiler/blob/main/packages/transpiler/src/statements/shift.ts
SHIFT unit tests = https://github.com/abaplint/transpiler/blob/main/test/statements/shift.ts


(Super tiny unimportant bug): Missing a "p" in this console message

LOL.  Thanks for pointing this out.


Support of Git submodules in Build process

Hi,
After reading various white papers on IBM DBB, and the implementation of zAppBuild, I deduced that the management of the search context of COPYBOOKs / INCLUDEs could be quite difficult to implement in Groovy scripts.
I'll suggest another approach: using Git's submodules feature.
A Git submodule allows you to reference a secondary Git repository branch from a primary Git repository:

the main Git repository would contain all the sources for the programs
the secondary Git repositories would contain all the COPYBOOKs / INCLUDEs necessary for the programs

The COPYBOOKs / INCLUDEs of external Applications would be searched in the master branch of secondary Git repositories.
The COPYBOOKs / INCLUDEs of the current Application would be searched for in the develop branch of the secondary Git Repository of the current Application, except for hotfix maintenance where the master branch should be used (switchover to be done before launching the hotfix build).
Would this mode of operation be compatible with IBM DBB (and Git for z/OS)?
See All languages (COBOL first) - Search for COPYBOOKs / INCLUDEs in Git Repositories in IBM / zopeneditor-about.

Apologies for the late reply. We have customers who use ibm/dbb-zappbuild  with git submodules.
So, yes. This is an absolutely valid scenario to include external dependencies into your build and also the IDE.


CB-22077 cloud-azure module should be enhanced to fetch and populate Availability zones for cloud resources

cloud-azure module should be enhanced to fetch and populate Availability zones for cloud resources
See detailed description in the commit message.

retest this please

retest this please


Add  flatMapAssoc()

Add imlpementation of flatMap() which uses + array concatenation instead of array_merge().


nixos/virtualisation/lxd: add support for OVS bridges to LXD

Description of changes

Extend LXD module to support creation of Open vSwitch bridges.
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[x] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
22.11 Release Notes (or backporting 22.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[x] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[ ] Fits CONTRIBUTING.md.

I ran nixos/doc/manual/md-to-db.sh as requested by the manual checks error message. What is the appropriate way to include the generated rl-2211.section.xml file in my PR? Do commit that file then push again?


[DOC] autostaging_project_task description

[DOC] autostaging_project_task description

Prepare technical doc please

autostaging_project_task/init.py:1: [E7998(absent-doc), ] File: doc/index.rst is absent in module. Get a template here: https://odoo-development.readthedocs.io/en/latest/dev/docs/usage-instructions.html

@Englishrain fix the remarks


fix(combobox): only set aria-controls when open, fix reference id to list

resolves #2552
This solves the issue by not adding aria-controls until the popup is visible (and in the DOM).
This also makes use of floating uis internal id, so the id is also correct.

Setting this as ready for review, but will not be merging when approved.
After approval a release for version 0.63.1 will be done

Tested with ARC toolkit and the error is no longer reported. I have not tested using a JAWS screen-reader though, as i dont have a license. 😅

Great! I'll fix the storybook deployment and get a release going

Closing PR but not deleting branch


Debuff Collors (MM) Hunters

Hey,
It would be awsome to have debuff colors enabled for (MM) Hunters.
My suggestion would be:
.) Targets affected by Serpent Sting should have the nameplate turn green.
wether it be through the Hunter Talent (ID: 271788) or Serpentstalkers Trickery (ID: 378888)
.) Targets affected by Razor Fragments (ID 384790) should turn orange
Happy to supply more suggestions for Hunters when it comes to debuff colors, those are just the two most important ones for me personally.
Hope you enjoy DF launch.

Cheers! I will get this updated sometime in the next day or so, enjoy the launch!

Sorry for the delay, taking a look shortly.

Release 1.2.7

heyo, thanks a lot for the time you put in during release week!
I tested it on some random mobs, works perfect so far.
since BM and SV can also specc into serpent sting, maybe you wanna add the serpent tracking for those two speccs too.


Provide GPU version of lifelong cityscapes example.

What type of PR is this?
kind/documentation
What this PR does / why we need it:
Provide GPU version of lifelong cityscapes example.

\lgtm


DataArray.argsort should be deleted

Originally posted to https://groups.google.com/forum/#!topic/xarray/wsxeiIPLhgM
DataArray.argsort() appears to simply wrap the result of DataArray.values.argsort() in a same-shape DataArray. This is semantically nonsensical. If anything the index on the resulting argsort() values should simply be range(len(da)), but that adds little to the underlying numpy structure. And there's not much reason to have da.argsort() simply return the (raw) result of da.values.argsort(). So really DataArray.argsort() should simply be deleted.
On the other hand a new function DataArray.rank() that wraps da.values.argsort().argsort() (note repeated call to ndarray.argsort()) in the structure of the original DataArray would make sense, and perhaps even be useful... (Note that I'm not claiming that .argsort().argsort() is the fastest way to calculate this, but it's probably good enough, at least for an initial implementation.)

It seems like another reasonable choice would be for DataArray.argsort() to keep its current value but dropping coordinate labels along the sorting dimension. This would give a consistent result for use with broadcasting indexing (https://github.com/pydata/xarray/pull/1473).
I think this utility function is equivalent to your second argsort:
https://github.com/pydata/xarray/blob/2949558b75a65404a500a237ec54834fd6946d07/xarray/core/nputils.py#L38=L55
In practice, we might use bottleneck.rankdata() or nanrankdata():
https://kwgoodman.github.io/bottleneck-doc/reference.html#non-reduce-with-axis

I think that makes sense, though I don't quite understand what would go in its place. Another possibility -- perhaps a bad one -- is to permute the values in the sorted dimension so that they match the resulting values (i.e. something like result.coords[dim] = np.take(da.coords[dim].values, result.values, axis=axis)).
Note that ndarray.argsort(axis=None) sorts the flattened array, so the returned DataArray should respect this
Alternative suggestion: have DataArray.argsort() return an ndarray filled with labels from the sorted dimension, i.e. something like:
class DataArray:
    def argsort(self, **kwargs):
        # TODO: update kwargs['axis'] based 'axis' and 'dim', and remove 'dim'
        if kwargs['axis'] is None:
            kwargs['axis'] = -1
            return self.stack(dim=self.dims).argsort(**kwargs)
        return np.take(self.coords[self.dims[kwargs['axis']].values, self.values.argsort(**kwargs))

BTW, I'm just thinking in terms of ndarrays. Someone more knowledgeable than me may want to consider how to make it work intelligently with dask.

Note that ndarray.argsort(axis=None) sorts the flattened array, so the returned DataArray should respect this

I'm not a huge fan of auto-flattening for xarray, but I can see this logic.

Alternative suggestion: have DataArray.argsort() return an ndarray filled with labels from the sorted dimension

I would probably implement a new method for this, maybe idxsort for symmetry with idxmax (https://github.com/pydata/xarray/issues/60). Though that name could be read several different ways. Maybe sortby_labels()?

I'm not a fan of auto-flattening either, but that's what nd.argsort does...
One option is to have DataArray.arg{min,max,sort}() all take an optional flag argument specifying whether to return integer indices or index labels. But I think my preference would be be to have six separate functions: DataArray.{idx,}arg{min,max,sort}() (or some such nomenclature that includes arg in all six functions).

I think this issue is still relevant.

I agree that at least the index should show the reflect the order of the ranking found using argsort.

import xarray as xr
import numpy as np

np.random.rand(10)

ds = xr.DataArray(np.random.rand(10) )

ds.argsort().dim_0

returns
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
however it should return an array with the order of the elements ranked using argsort
e.g.
array([3, 8, 5, 1, 7, 2, 9, 4, 6, 0])
Where ds[3] is the smallest value in ds and ds[0] is the biggest etc.
The current behaviour is confusing / nonsenical. Return the index unchanged implies that the initial array is already ordered.


segmentation fault when running testsuite on centos-6

To reproduce:
$ sudo docker run -e OPAMBUILDTEST=true ocaml/opam:centos-6_ocaml-4.02.3 sh -c 'opam depext -u ctypes.0.11.1 && opam install -t ctypes.0.11.1'
# Detecting depexts using flags: x86_64 linux centos
# The following system packages are needed:
#  - libffi-devel
#  - m4
#  - ncurses-devel
#  - pkgconfig
package libffi-devel is not installed
Name        : m4                           Relocations: (not relocatable)
Version     : 1.4.13                            Vendor: CentOS
Release     : 5.el6                         Build Date: Thu Nov 11 17:17:34 2010
Install Date: Mon Dec  5 11:32:28 2016         Build Host: c6b3.bsys.dev.centos.org
Group       : Applications/Text             Source RPM: m4-1.4.13-5.el6.src.rpm
Size        : 560949                           License: GPLv3+
Signature   : RSA/8, Sun Jul  3 04:44:33 2011, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://www.gnu.org/software/m4/
Summary     : The GNU macro processor
Description :
A GNU implementation of the traditional UNIX macro processor.  M4 is
useful for writing text files which can be logically parsed, and is used
by many programs as part of their build process.  M4 has built-in
functions for including files, running shell commands, doing arithmetic,
etc.  The autoconf program needs m4 for generating configure scripts, but
not for running configure scripts.

Install m4 if you need a macro processor.
Name        : ncurses-devel                Relocations: (not relocatable)
Version     : 5.7                               Vendor: CentOS
Release     : 4.20090207.el6                Build Date: Mon Mar 16 08:54:02 2015
Install Date: Mon Dec  5 11:33:48 2016         Build Host: c6b9.bsys.dev.centos.org
Group       : Development/Libraries         Source RPM: ncurses-5.7-4.20090207.el6.src.rpm
Size        : 1795830                          License: MIT
Signature   : RSA/SHA1, Mon Mar 16 14:43:08 2015, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://invisible-island.net/ncurses/ncurses.html
Summary     : Development files for the ncurses library
Description :
The header files and libraries for developing applications that use
the ncurses terminal handling library.

Install the ncurses-devel package if you want to develop applications
which will use ncurses.
Name        : pkgconfig                    Relocations: (not relocatable)
Version     : 0.23                              Vendor: CentOS
Release     : 9.1.el6                       Build Date: Thu Aug 19 03:30:32 2010
Install Date: Wed Nov  2 12:52:34 2016         Build Host: c6b1.bsys.dev.centos.org
Group       : Development/Tools             Source RPM: pkgconfig-0.23-9.1.el6.src.rpm
Size        : 140091                           License: GPLv2+
Signature   : RSA/8, Sun Jul  3 04:57:05 2011, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://pkgconfig.freedesktop.org
Summary     : A tool for determining compilation options
Description :
The pkgconfig tool determines compilation options. For each required
library, it reads the configuration file and outputs the necessary
compiler and linker flags.
# The following new OS packages need to be installed: libffi-devel
The following command needs to be run through "sudo":
    yum -y update
Loaded plugins: fastestmirror, ovl
Setting up Update Process
Determining fastest mirrors
 * base: mirrors.m247.ro
 * extras: mirrors.m247.ro
 * updates: mirrors.m247.ro
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.18.44-20.el6 will be installed
---> Package kernel-devel.x86_64 0:3.18.44-20.el6 will be installed
---> Package kernel-firmware.noarch 0:2.6.32-642.11.1.el6 will be updated
---> Package kernel-firmware.noarch 0:3.18.44-20.el6 will be an update
---> Package kernel-headers.x86_64 0:2.6.32-642.11.1.el6 will be updated
---> Package kernel-headers.x86_64 0:3.18.44-20.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch       Version               Repository           Size
================================================================================
Installing:
 kernel              x86_64     3.18.44-20.el6        centos-virt-xen      37 M
 kernel-devel        x86_64     3.18.44-20.el6        centos-virt-xen     9.6 M
Updating:
 kernel-firmware     noarch     3.18.44-20.el6        centos-virt-xen     6.4 M
 kernel-headers      x86_64     3.18.44-20.el6        centos-virt-xen     921 k

Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)

Total download size: 53 M
Downloading Packages:
--------------------------------------------------------------------------------
Total                                           9.3 MB/s |  53 MB     00:05
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 61e8806c: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization
Importing GPG key 0x61E8806C:
 Userid : CentOS Virtualization SIG (http://wiki.centos.org/SpecialInterestGroup/Virtualization<EMAIL_ADDRESS> Package: centos-release-virt-common-1-1.el6.centos.noarch (@extras)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction

  Updating   : kernel-firmware-3.18.44-20.el6.noarch                        1/6

  Installing : kernel-devel-3.18.44-20.el6.x86_64                           2/6

  Updating   : kernel-headers-3.18.44-20.el6.x86_64                         3/6

  Installing : kernel-3.18.44-20.el6.x86_64                                 4/6

  Cleanup    : kernel-firmware-2.6.32-642.11.1.el6.noarch                   5/6

  Cleanup    : kernel-headers-2.6.32-642.11.1.el6.x86_64                    6/6

  Verifying  : kernel-headers-3.18.44-20.el6.x86_64                         1/6

  Verifying  : kernel-firmware-3.18.44-20.el6.noarch                        2/6

  Verifying  : kernel-3.18.44-20.el6.x86_64                                 3/6

  Verifying  : kernel-devel-3.18.44-20.el6.x86_64                           4/6

  Verifying  : kernel-firmware-2.6.32-642.11.1.el6.noarch                   5/6

  Verifying  : kernel-headers-2.6.32-642.11.1.el6.x86_64                    6/6

Installed:
  kernel.x86_64 0:3.18.44-20.el6      kernel-devel.x86_64 0:3.18.44-20.el6

Updated:
  kernel-firmware.noarch 0:3.18.44-20.el6
  kernel-headers.x86_64 0:3.18.44-20.el6

Complete!
# OS package update successful
The following command needs to be run through "sudo":
    yum install -y libffi-devel
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.m247.ro
 * extras: mirrors.m247.ro
 * updates: mirrors.m247.ro
Resolving Dependencies
--> Running transaction check
---> Package libffi-devel.x86_64 0:3.0.5-3.2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch           Version                 Repository    Size
================================================================================
Installing:
 libffi-devel         x86_64         3.0.5-3.2.el6           base          18 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 18 k
Installed size: 21 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction

  Installing : libffi-devel-3.0.5-3.2.el6.x86_64                            1/1
install-info: No such file or directory for /usr/share/info/libffi.info.gz
warning: %post(libffi-devel-3.0.5-3.2.el6.x86_64) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package libffi-devel-3.0.5-3.2.el6.x86_64

  Verifying  : libffi-devel-3.0.5-3.2.el6.x86_64                            1/1

Installed:
  libffi-devel.x86_64 0:3.0.5-3.2.el6

Complete!
The following command needs to be run through "sudo":
    rpm -q libffi-devel
libffi-devel-3.0.5-3.2.el6.x86_64
# OS packages installation successful
The following actions will be performed:
  - install ctypes-foreign  0.4.0                               [required by ctypes]
  - install conf-pkg-config 1.0                                 [required by ctypes]
  - install conf-m4         1                                   [required by ocamlfind]
  - install result          1.2                                 [required by lwt]
  - install ocamlfind       1.7.1                               [required by ctypes]
  - install ppx_tools       5.0+4.02.0                          [required by lwt]
  - install ounit           2.0.0                               [required by ctypes]
  - install base-bytes      base                                [required by ctypes]
  - install lwt             2.6.0                               [required by ctypes]
  - install ctypes          0.11.1
===== 10 to install =====
Do you want to continue ? [Y/n] y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ctypes: http] Command started
[lwt: http] Command started
[ocamlfind: http] Command started
[ocamlfind: http] Command started
[ocamlfind.1.7.1] http://download.camlcity.org/download/findlib-1.7.1.tar.gz downloaded
[ounit: http] Command started
[ounit: http] Command started
[ounit.2.0.0] http://forge.ocamlcore.org/frs/download.php/1258/ounit-2.0.0.tar.gz downloaded
[ppx_tools: http] Command started
[ctypes: http] Command started
[ctypes.0.11.1] https://github.com/ocamllabs/ocaml-ctypes/archive/0.11.1.tar.gz downloaded
[result: http] Command started
[lwt: http] Command started
[lwt.2.6.0] https://github.com/ocsigen/lwt/archive/2.6.0.tar.gz downloaded
[ppx_tools: http] Command started
[ppx_tools.5.0+4.02.0] https://github.com/alainfrisch/ppx_tools/archive/5.0+4.02.0.tar.gz downloaded
[result: http] Command started
[result.1.2] https://github.com/janestreet/result/archive/1.2.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[conf-m4: sh echo | m4] Command started
[conf-pkg-config: pkg-config] Command started
-> installed ctypes-foreign.0.4.0
[result: make] Command started
-> installed conf-m4.1
[ocamlfind: ./configure] Command started
-> installed conf-pkg-config.1.0
-> installed result.1.2
[ocamlfind: make all] Command started
[ocamlfind: make opt] Command started
[ocamlfind: make install] Command started
-> installed ocamlfind.1.7.1
-> installed base-bytes.base
[ounit: make build] Command started
[ppx_tools: make all] Command started
[ppx_tools: make install] Command started
-> installed ppx_tools.5.0+4.02.0
[lwt: ocaml setup.ml] Command started
[ounit: make install] Command started
-> installed ounit.2.0.0
[lwt: make build] Command started
[lwt: ocaml setup.ml] Command started
[lwt: make test] Command started
[lwt: make install] Command started
-> installed lwt.2.6.0
[ctypes: make libffi.config] Command started
[ctypes: make ctypes-base] Command started
[ctypes: make ctypes-foreign] Command started
[ctypes: make test] Command started
[ERROR] The compilation of ctypes failed at "make test".
[ctypes: ocamlfind remove] Command started

#=== ERROR while installing ctypes.0.11.1 =====================================#
# opam-version         1.2.2 (58ef3b8213100953848d362f7120a30356d7f77d)
# os                   linux
# command              make test
# path                 /home/opam/.opam/4.02.3/build/ctypes.0.11.1
# compiler             4.02.3
# exit-code            2
# env-file             /home/opam/.opam/4.02.3/build/ctypes.0.11.1/ctypes-10928-51aaa5.env
# stdout-file          /home/opam/.opam/4.02.3/build/ctypes.0.11.1/ctypes-10928-51aaa5.out
# stderr-file          /home/opam/.opam/4.02.3/build/ctypes.0.11.1/ctypes-10928-51aaa5.err
### stdout ###
# [...]
# cd _build/tests/test-threads && ocamlfind  ocamlc -c -package str -package bigarray -package oUnit -package bytes -thread -package threads  -ccopt -fPIC -ccopt -Wall -ccopt -g -ccopt -I/usr/lib64/libffi-3.0.5/include -ccopt -I -ccopt /home/opam/.opam/4.02.3/build/ctypes.0.11.1/src/ctypes -ccopt -I -ccopt /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests -o generated_stubs.o -principal -short-paths -g /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-threads/generated_stubs.c
# ocamlfind  opt -I _build -linkpkg -principal -short-paths -g -thread -package str -package bigarray -package oUnit -package bytes -thread -package threads  _build/ctypes.cmxa _build/ctypes-foreign-base.cmxa _build/ctypes-foreign-threaded.cmxa _build/cstubs.cmxa _build/tests-common.cmxa _build/test-threads-stubs.cmxa -o _build/test-threads.native _build/tests/test-threads/generated_bindings.cmx _build/tests/test-threads/test_threads.cmx _build/tests/test-threads/generated_stubs.o -cclib -Wl,--no-as-needed -cclib -L_build/clib -cclib -ltest_functions
# ocamlfind  opt -bin-annot -c -o _build/tests/test-ldouble/test_ldouble.cmx -package str -package bigarray -package oUnit -package bytes -thread -package threads  -principal -short-paths -g -thread -package str -package bigarray -package oUnit -package bytes -thread -package threads   -I _build/tests/test-ldouble  -I _build/src/ctypes tests/test-ldouble/test_ldouble.ml
# ocamlfind  opt -I _build -linkpkg -principal -short-paths -g -thread -package str -package bigarray -package oUnit -package bytes -thread -package threads  _build/ctypes.cmxa -o _build/test-ldouble.native _build/tests/test-ldouble/test_ldouble.cmx  -cclib -Wl,--no-as-needed
# running test-raw
# ..
# Ran: 2 tests in: 0.00 seconds.
# OK
# running test-pointers
# ....
### stderr ###
# [...]
# /usr/include/stdlib.h:755: note: expected '__compar_fn_t' but argument is of type 'int (*)(void *, void *)'
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-foreign_values/generated_stubs.c: In function 'cstubs_tests_2_plus_callback':
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-foreign_values/generated_stubs.c:11: warning: initialization from incompatible pointer type
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-views/generated_stubs.c: In function 'cstubs_tests_1_concat_strings':
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-views/generated_stubs.c:11: warning: passing argument 1 of 'concat_strings' from incompatible pointer type
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/clib/test_functions.h:49: note: expected 'const char **' but argument is of type 'char **'
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-oo_style/generated_stubs.c: In function 'cstubs_tests_2_new_chorse':
# /home/opam/.opam/4.02.3/build/ctypes.0.11.1/tests/test-oo_style/generated_stubs.c:14: warning: initialization from incompatible pointer type
# /bin/sh: line 1: 17616 Segmentation fault      (core dumped) CAML_LD_LIBRARY_PATH=. LD_LIBRARY_PATH=clib DYLD_LIBRARY_PATH=clib ./test-pointers.native -runner sequential
# make: *** [run-test-pointers] Error 139

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  - install ctypes 0.11.1
The following changes have been performed
  - install base-bytes      base
  - install conf-m4         1
  - install conf-pkg-config 1.0
  - install ctypes-foreign  0.4.0
  - install lwt             2.6.0
  - install ocamlfind       1.7.1
  - install ounit           2.0.0
  - install ppx_tools       5.0+4.02.0
  - install result          1.2

The former state can be restored with:
    opam switch import "~/.opam/4.02.3/backup/state-20161112211543.export"

Originally noticed at https://travis-ci.org/mirage/ocaml-conduit/jobs/183348113

Thanks for the report.  This may be due to SELinux policies that prevent libffi from creating trampolines for closures.

Yeah it could be some security mechanism and CentOS-6 version of libffi using some deprecated technique. This is on a Ubuntu host though, SELinux is not enabled and Apparmor didn't log anything.
Here is the stacktrace:
Core was generated by `./test-pointers.native -runner sequential'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f1b57544010 in ?? ()
Missing separate debuginfos, use: debuginfo-install libffi-3.0.5-3.2.el6.x86_64
(gdb) bt
#0  0x00007f1b57544010 in ?? ()
#1  0x00007f1b56cfecb8 in passing_pointers_to_callback (f=<value optimized out>) at tests/clib/test_functions.c:357
#2  0x00007f1b57125dac in ffi_call_unix64 () from /usr/lib64/libffi.so.5
#3  0x00007f1b57125b34 in ffi_call () from /usr/lib64/libffi.so.5
#4  0x00000000004c19ad in ctypes_call (fnname=7534120, function=139755386617664, callspec_=139755386685720,
    argwriter=139755386617624, rvreader=139755386617592)
    at /home/opam/ctypes.0.11.1/src/ctypes-foreign-base/ffi_call_stubs.c:404
#5  0x000000000044a5d1 in camlCtypes_ffi__fun_3313 () at src/ctypes-foreign-base/ctypes_ffi.ml:110
#6  0x000000000042ef78 in camlTest_pointers__test_callback_receiving_pointers_1516 ()
    at tests/test-pointers/test_pointers.ml:73
#7  0x000000000046fe4c in camlOUnitRunner__fun_1521 () at src/oUnitRunner.ml:46
#8  0x0000000000466000 in camlOUnitTest__section_ctxt_1090 () at src/oUnitTest.ml:129
#9  0x0000000000470c41 in camlOUnitRunner__run_one_test_1069 () at src/oUnitRunner.ml:41
#10 0x000000000046ff46 in camlOUnitRunner__iter_1131 () at src/oUnitRunner.ml:87
#11 0x000000000046103c in camlOUnitUtils__time_fun_1072 () at src/oUnitUtils.ml:172
#12 0x0000000000472870 in camlOUnitCore__run_test_tt_1087 () at src/oUnitCore.ml:83
#13 0x0000000000472d8c in camlOUnitCore__run_test_tt_main_1142 () at src/oUnitCore.ml:172
#14 0x0000000000433524 in camlTest_pointers__entry () at tests/test-pointers/test_pointers.ml:667
#15 0x000000000042b329 in caml_program ()
#16 0x00000000004e133e in caml_start_program ()
#17 0x00000000004e1dc5 in __libc_csu_init ()
#18 0x00007f1b564fed1d in __libc_start_main (main=0x4cfa48 <main>, argc=3, ubp_av=0x7ffe452b2688,
    init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>,
    stack_end=0x7ffe452b2678) at libc-start.c:226
#19 0x000000000042ab69 in _start ()

And valgrind:
[opam@6a4cae76e201 _build]$ CAML_LD_LIBRARY_PATH=. LD_LIBRARY_PATH=clib DYLD_LIBRARY_PATH=clib valgrind --trace-children=yes ./test-pointers.native -runner sequential
==18504== Memcheck, a memory error detector
==18504== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==18504== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==18504== Command: ./test-pointers.native -runner sequential
==18504==
....==18504== Use of uninitialised value of size 8
==18504==    at 0x4D0E8A: segv_handler (in /home/opam/ctypes.0.11.1/_build/test-pointers.native)
==18504==    by 0x50467DF: ??? (in /lib64/libpthread-2.12.so)
==18504==    by 0x402200F: ??? (in /tmp/ffiPmBsHX (deleted))
==18504==    by 0x7FF000147: ???
==18504==    by 0x7FF00010F: ???
==18504==    by 0x4E34B33: ffi_call (in /usr/lib64/libffi.so.5.0.6)
==18504==    by 0x5E7FFE7: ???
==18504==    by 0x44A8F5: camlCtypes_ffi__fun_3485 (ctypes_ffi.ml:220)
==18504==    by 0x646B2EF: ???
==18504==
==18504==
==18504== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==18504==  Bad permissions for mapped region at address 0x4022010
==18504==    at 0x4022010: ??? (in /tmp/ffiPmBsHX (deleted))
==18504==    by 0x7FF000147: ???
==18504==    by 0x7FF00010F: ???
==18504==    by 0x4E34B33: ffi_call (in /usr/lib64/libffi.so.5.0.6)
==18504==    by 0x5E7FFE7: ???
==18504==    by 0x44A8F5: camlCtypes_ffi__fun_3485 (ctypes_ffi.ml:220)
==18504==    by 0x646B2EF: ???
==18504==
==18504== HEAP SUMMARY:
==18504==     in use at exit: 6,956,188 bytes in 291 blocks
==18504==   total heap usage: 330 allocs, 39 frees, 6,962,006 bytes allocated
==18504==
==18504== LEAK SUMMARY:
==18504==    definitely lost: 0 bytes in 0 blocks
==18504==    indirectly lost: 0 bytes in 0 blocks
==18504==      possibly lost: 3,939,880 bytes in 71 blocks
==18504==    still reachable: 3,016,308 bytes in 220 blocks
==18504==         suppressed: 0 bytes in 0 blocks
==18504== Rerun with --leak-check=full to see details of leaked memory
==18504==
==18504== For counts of detected and suppressed errors, rerun with: -v
==18504== Use --track-origins=yes to see where uninitialised values come from
==18504== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)
Segmentation fault
```

Let me know if you need more information.

I can reproduce the problem with the Centos-provided libffi.  Switching to a local install of libffi-3.2.1 fixes it.
strace reveals that the system libffi uses a /tmp file mapping for exceutable pages, while libffi-3.2.1 uses an anonymous mapping, which probably accounts for the difference.

I'm going to close this, since it appears to be due to an old version of libffi on Centos 6 (or perhaps an incompatibility between Centos security policies and earlier libffi trampoline strategies) rather than a problem with ctypes.
But I'd be happy to merge a patch that allows ctypes to work with vanilla Centos 6 if you (@edwintorok) or someone else would like to propose one.

@edwintorok: it would be interesting to know whether #511 (now merged into master) addresses this issue in Centos 6.


Bring back "xRateLimitRemaining" data

Thanks for your pull request.
So they just changed the name for the header I gather?
I've looked through the file and it seems that the rate limiting isn't used anywhere in the library. It just provides a getter to check in one's own application, right?

Hi Florian,
Yes it's just a getter (I added an "isset" condition to prevent new
renaming of this data.)
This attribute is set after your call to tell you if you want to call again
if you don't have reached your rate limitation.
For example, in my script I will call a lot, and after I will verify if I
can still call. If I can't anymore, I will use another token.
2016-04-20 5:31 GMT-04:00 Florian Beer<EMAIL_ADDRESS>
Thanks for your pull request.
So they just changed the name for the header I gather?
I've looked through the file and it seems that the rate limiting isn't
used anywhere in the library. It just provides a getter to check in one's
own application, right?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/florianbeer/Instagram-PHP-API/pull/2#issuecomment-212349961

--
Samuel Hecquet - Web Developer
@SamHecquet http://twitter.com/#!/SamHecquet

Sounds good to me. Merged 👍


Heartbeat Interval should have a max allowed value.

⚠ Please verify that this bug has NOT been raised before.

[X] I checked and didn't find similar issue

🛡 Security Policy

[X] I agree to have read this project Security Policy

Description
(I actually did not read the security policy. this is not a security issue)
I tried to get Uptime Kuma Push mode and wanted it to wait for a request indefinetely. Tried setting interval to 0 which is not supported. Then I entered a random large number and noticed after a certain point uptime kuma started actingn as if I had entered fractions of a second. Browser cpu usage shot up and the heartbeat bar went crazy. It happens with<PHONE_NUMBER>0000  seconds (if you remove one zero it doesn't happen. Something must be flipping in the calculation around there.)
In short heartbeat interval shoud not accept an arbitrarily large value.<PHONE_NUMBER>0000  seconds is close to 317 million years and the interface allows going way past that.
In addition, could a 0 value be accepted? I am not sure if all monitoring would stop currently - even when a push request comes in. A passive check like the push service should work without an interval set in my opinion. One possible scenario being to only push a status when something fails.
👟 Reproduction steps
Set hearbeat interval to >=<PHONE_NUMBER>0000  . I did not try to find the actual turning point. Lower values can trigger the same.
👀 Expected behavior
I expected it to wait 387 millenia between heartbeats.
😓 Actual Behavior
It started checking heartbeat status many times per second.
🐻 Uptime-Kuma Version
1.11.3
💻 Operating System and Arch
docker image
🌐 Browser
firefox 95.0.2
🐋 Docker Version
20.10.12
🟩 NodeJS Version
No response
📝 Relevant log output
Did not check.

I ran into this scenario by accident. I was looking to setup a passive monitor that expects a ping from a cron script that's going to run every 28 days (+ 1 hour grace) = 2422800 seconds. As described here, the UI became unresponsive and server CPU spiked, almost like it was stuck in a loop.
2147483 is the highest value before the problem occurs. Interestingly, that might have something to do with signed 32-bit integers. 2073600 seconds (24 days) seems like a reasonable maximum if the root cause is unfixable.

Thank you for your explanation. Should be fixed now.


Default files does not consider Accept header

Describe the bug
If you have an API that returns json from a / path but you also have a index.html in wwwroot folder and make a request with Accept:application/json you will get back HTML.
To Reproduce
Steps to reproduce the behavior:

Using this version of ASP.NET Core 2.2

           app.UseDefaultFiles();
           app.UseStaticFiles();

            app.UseCarter() OR app.UseMvc() OR app.UseRouting()

curl -H "Accept:application/json" localhost:5000
See index.html response from wwwroot folder

Expected behavior
To see the json response

Is there a specific problem you're trying to solve by using default files? This is the documented behaviour.

If I have a browser go to foo.com I'd want the HTML returned, if I curl with application/json i'd expect to see the json.  It's conneg but without invoking anything server side for view rendering i guess

The static files middleware is intended to be quite basic. This sounds like a job for a higher-level system, such as MVC, where con-neg exists, and you can also return static files based on some logic.

I went with this approach
app.MapWhen(context => context.Request.Path == "/" &&
!context.Request.Headers["Accept"].ToString().Contains("json"),
builder =>
{
builder.UseDefaultFiles();
builder.UseStaticFiles();
});
app.UseStaticFiles();
app.UseCarter();
On Sat, 16 Mar 2019 at 23:07, Eilon Lipton<EMAIL_ADDRESS>wrote:

The static files middleware is intended to be quite basic. This sounds
like a job for a higher-level system, such as MVC, where con-neg exists,
and you can also return static files based on some logic.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/AspNetCore/issues/8550#issuecomment-473600015,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGapgNrBhn71suLNsonO8QvWskFBsxlks5vXXkggaJpZM4b2SM4
.

I went with this approach
app.MapWhen(context => context.Request.Path == "/" && !context.Request.Headers["Accept"].ToString().Contains("json"),
  builder =>
  {
      builder.UseDefaultFiles();
      builder.UseStaticFiles();
  });

app.UseStaticFiles();

app.UseCarter();

Sounds like this is resolved. Static files isn't really designed to do content negotiation like this.


[Editor] Minor UI tweaks.

Moved the render mode dropdown next to the editor camera settings, leaving it next to the translation mode doesn't make a lot of sense.
On the project selection window, the default tab selected points to recent projects instead of new when the user already has one.
The other changes can be seen in the two screenshots below, they are described right under.

In the asset view pane, reduced the font size, weight and opacity of the asset's type, the name of the asset should be the most visually important element, the icon already serves the same purpose as that label does and users will more often find their assets by visually scanning through asset names first.
Added a separator between the asset view option and filter to avoid grouping them visually since they aren't related.
I'm not sure about the size fix for it though, it sets itself by default to {16,16} since it's not a bitmap, I set it to fallback to auto instead, no idea if this was intended.
I tried to fix a bunch of other stuff but couldn't get the WPF preview to work so I'll leave it at that.

nice, i like the font weight switch for assets. if i might have a wish, isn't there a nicer flat icon for folders? this mountain/rose things looks a bit alien besides for example the game settings or scene icon...

I'll see if I can create a bunch of those tomorrow, 'not sure where/if I should store the vector files and resources in the repo though.

how about this one?

its pretty minimal:

this mountain/rose things looks a bit alien

Yeah, it does. In previous versions of Xenko, we had a better icon but we couldn't use it for the MIT version because of license issues.

@tebjan @Kryptos-FR Yes, I remember not being able to quickly find a nice-looking large size flat folder icon with proper license. I agree this one is quite... ugly and out of place.
You're very welcome to replace it with another one, thanks!

is creative commons license ok? the one i made is derived from one that only needs author attribution. i can make a PR that changes the file and adds the original author info to the Thirdparty.md.

@Kryptos-FR @tebjan @SebastianStehle @Eideren @0xaryan  Wanted some opinions, do you think monochrome is better or something with color (i.e. similar to VS solution explorer icons) so that it is easier to recognize?
I would personally vote for colored one (esp, so that it matches Solution Explorer treeview, and to be able to use color as faster visual cue). Switching to a .svg one should make it looks good even if big.

Yeah I'd also prefer a colored icon for the folder. Monochrome blends too much into the background, but folders should stand out in my opinion.

I would rather use vectors since we already have a bunch of other vector icons.
Here's a bunch I just did:

The left one is windows-like flat, middle one is generic and right one is based on the current icon.
I could also redo the one @tebjan gave us in vectors if you guys would rather have that one.

'just saw the last couple of messages, I'll use VS's folder color then once you choose the design you prefer.

I'm not exactly sure that which icon is suitable in that case, but I prefer the colored one. As I remember that folder icon is not located in a ResourceDictionary, but in a resx file. I think some additional changes needed in code-behind if you want to use a vector icon.

We already have a couple of examples for vector images in ImageDictionary.xaml, we just have to convert vector files to wpf's format.

@Eideren I know, but those are DrawingImage resources, code-behind only accepts BitmapImage as thumbnail. Not sure, but I think you should change that Thumbnail loader method to pass vectors to the view.

@Eideren the original file i used is a .svg you can find it here, its under creative commons: https://thenounproject.com/search/?q=folder

@Eideren Take a look at project Xenko.Core.Assets.Editor. folder icon is located in Resources/Images.resx.
In ViewModel/DirectoryViewModel.cs there is a method named GetFolderThumbnail which access to that resource.
private static ThumbnailData GetFolderThumbnail(IDispatcherService dispatcher)
{
    using (var ds = new DigestStream(new MemoryStream()))
    {
        var bytes = Resources.Images.folder;
        ds.Write(bytes, 0, bytes.Length);
        var objectId = ds.CurrentHash;
        var data = new ThumbnailData(objectId, new MemoryStream(bytes));
        data.PrepareForPresentation(dispatcher).Forget();
        return data;
    }
}

It passes a MemoryStream of image to Xenko.Core.Assets.Editor.Services.ThumbnailData class. Then that stream will be converted to a BitmapImage with BuildBitmapImage method. That's why I say you can't simply pass a DrawingImage to the view without changing the mechanism, although the View only wants an ImageSource which both DrawinImage and BitmapImage are accepted.

So it looks really better, thanks for the work you've done!

how about something like that?

I`m also  supporter of yellowish folders..

folder icon PR continued in #155

Merged, thanks!


Can I specify more than one stationboard?

I looked into the code for this https://github.com/home-assistant-ecosystem/python-opendata-transport/blob/master/opendata_transport/init.py and it looks like the opendata stationboard object (used by this project) only accepts a string (possibly a number).
The config seems to suggest that one can add more than one stationboard.  I doubt that will work, from a cursory reading of the code.
Can this be clarified in the documentation please?

The class OpendataTransportStationboard does indeed accept only one station. If you want to add more than one stationboard, just add multiple sensors:
  - platform: swiss_public_transport_mod
    name: Schüpfen
    limit: 4
    stationboard:
    - Schüpfen
  - platform: swiss_public_transport_mod
    name: Langenthal
    limit: 4
    stationboard:
    - Langenthal

In the lovelace dashboard, you can also add multiple cards:
type: custom:swiss-stationboard
name: Abfahrt
hide_title: true
platform_name: Gl.
entity:
  - sensor.schupfen

type: custom:swiss-stationboard
name: Abfahrt
hide_title: true
platform_name: Gl.
entity:
  - sensor.langenthal

... which leads to:

If you add multiple stations into the same sensor, then they will be aggregated. The lovelace ui will display them together:
  - platform: swiss_public_transport_mod
    name: Schüpfen
    limit: 4
    stationboard:
    - Schüpfen
    - Langenthal

This behaviour is meant for stations which are almost in the same location, but have different names. i.e. "Bern, Bahnhof" and "Bern, Hirschengraben".

This should be clarified in the documentation.

Fixed in https://github.com/neuhausf/swiss-public-transport-mod/commit/89acae29e12bf06086a1d2921a0eac00d0813d47