text:
Windows 10/11 missing emoji flag support

Related: #268
Windows 10/11 currently render flags as letters, not flags. Firefox has fixed this using their own flag emoji, but Chromium have opted not to fix it.
My hope with emoji-picker-element is that eventually browsers and OSes would get their acts together and start supporting emoji more broadly. And aside from the glacial rollout of yearly emoji updates, this has largely been the case. (Windows 7 and IE 11, environments with no emoji support whatsoever, are slowly fading away.) But flag emoji on Windows are a big missing piece currently.

I've already filed bugs on Chromium and added instructions to the README for a workaround. There's not much more I can do here, so closing this issue.

Amazing, there is even a Chrome extension to fix this :smiling_face_with_tear: https://bugs.chromium.org/p/chromium/issues/detail?id=1209677#c6

add this
<script type="module" src="https://cdn.jsdelivr.net/npm/emoji-picker-element@^1/index.js"></script>
<script type="module">
  import { polyfillCountryFlagEmojis } from 'https://cdn.skypack.dev/country-flag-emoji-polyfill@v0.1.1'

  polyfillCountryFlagEmojis('Twemoji Mozilla')
</script>

in the index.html

authors: nolanlawson safaEF

repo: nolanlawson/emoji-picker-element


text:
uglify > optimize source map

Sourcemap generation is lossy when tracing back to the original source map unless the locations of js nodes are tracked.
Example from Rollup https://github.com/rollup/rollup/blob/0c73791ae64e770a1b3fb9498be4351c768cb499/src/ast/enhance.js#L7

more specifically this https://github.com/rollup/rollup/blob/0c73791ae64e770a1b3fb9498be4351c768cb499/src/ast/enhance.js#L54

source: gharchive/issue

repo: nolanlawson/optimize-js

license_type: permissive

license_source: bigquery


text:
Range slider not visible in native Android apps

This is a (multiple allowed):

[x] bug
[ ] enhancement
[ ] feature-discussion (RFC)

What you did
Used range element in form.
Expected Behavior
Slider knob shown.
Actual Behavior
Slider knob not shown in Android Cordova app.
(Slider known shown in iOS Cordova app and in Chrome web browser)

@scriptPilot perhaps a few more details. What version of Android were you testing on? What version of Cordova? Could you throw up a quick code pen that reproduces the bug?

@macdonst - Is this App okay for your tests?
https://play.google.com/store/apps/details?id=de.scriptpilot.appframework
Made with https://github.com/scriptPilot/app-framework

Would be good to know is it actual for Material theme? iOS theme is not designed to be used on Androids

Ah okay, could be the reason. But, isn't it possible to make both work on both systems? In fact, to have the same design people would try to use one theme and make it work on any device.

@nolimits4web @macdonst - Tested on Android 7.1 via Emulator. But the same on older real phone.

Same behaviour with iOS:
https://github.com/nolimits4web/Framework7/issues/1567
Screenshot from Android emulator (7.1):

I probably have a work around for this here: https://github.com/nolimits4web/Framework7/issues/1567

Same issue

Issue is closed because of outdated/irrelevant/not actual
If this issue is still actual and reproducible for latest version of Framework7, please create new issue and fill the issue template correctly:

Clearly describe the issue including steps to reproduce when it is a bug.
Make sure you fill in the earliest version that you know has the issue.
Provide live link or JSFiddle/Codepen or website with issue

authors: macdonst nolimits4web owen-mills rvanzon scriptPilot

license: MIT

license_source: github-api


text:
make parseQueryUrl more compatibility

when i update the framework7 to the version 1.5.2, i found the parseQueryUrl has been changed. I learn this change for fix the hash status.('http://www.baidu.com?name=li&age=18#tab1').
But for a normal occasion, when i set the pushState=true in app init, all my url will become this style (http://127.0.0.1:8080/#!/views/test-query.html?abc=333)， the parseQueryUrl can't get any params. so i do this request, and this change will fix more occasion.

can parse the hash status, such as http://www.ttt.com?name=li&age=18#tab1
fix the push status true status, such as http://127.0.0.1:8080/#!/views/test-query.html?abc=333
3.when parseQueryUrl without params ,it will get the location.href as default.

Merged, thanks

source: gharchive/pull-request


text:
Carousel not working correctly after Swiper.params.slidesPerView Auto

I'm working with Wordpress and Elementor on a simple landing page which has a carousel. I want slides to be added/subtracted in regard to the screen width. From the Elementor backend it is not possible to set the slidesPerView to 'auto'. So I'm using a small script to achieve this after the initialisation of the carousel. It works, however:

The loop doesn't work correctly, slides keep shifting/jumping after a few clicks on the navigation.
The slidesPerView set in the Elementor backend is not being changed by 'auto'. I expect the open space to be filled with additional slides, but that doesn't happen.

jQuery(document).ready(function($) {     var mySwiper = document.querySelector('.swiper-container').swiper;     mySwiper.params.slidesPerView = 'auto';     mySwiper.update(); })
Hope someone can shine some light on this.
Thank you

You also need to unset style="width:..." on slide elements before calling update

Hi there,
Thank you for answering the second question. Your input solved it!
However, the loop still doesn't work correctly. I use the prev and next navigation. When pressing the next button for the 4th time the loop skips to the 8th slide. After that the loop keeps skipping back after pressing next or prev.
Any idea?


text:
To have both "vertical" and "horizontal" direction option for the "cards" effect

Clear and concise description of the problem
Hello
First of all thank you for this awesome lib, such an amazing work! I'm speechless!
I was playing around with the "cards" effects and I noticed that you can only pick direction "vertical" or "horizontal" It would be amazing if you could actually have both, more or less like tinder
Suggested solution
Add new property for both directions on the "cards" effect
Alternative
No response
Additional context
No response
Validations

[X] Follow our Code of Conduct
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

[ ] I'm willing to open a PR

Sorry, but due to the nature how Swiper works it won't be possible to have both directions work at the same time

@nolimits4web I've been looking at the cards-effect myself in order to get a tinder-like gesture for a question-answer or yes-no behavior.
I have no idea how SwiperJS works internally but wouldn't it be possible to just interpret left & right swiping as "goto next slide" and just propagete the actual direction via events?
The Tinder-swipe mechanism can be so useful sometimes. It's a pitty SwiperJS doesn't support this ..


text:
Simmetry class improvement

Hi, I was looking at Simmetry class and I believe that this is very useful also in synthesis experiments.
Checking the code with @JosePizarro3 we saw some aflow database info, they are currently not fetched through an API call but hardcoded in nomad.
How about implementing a way of fetching all the info directly from their database? Something similar to what is implement for a PureSubstance querying the PubChem database.
I could take a look into that if you think that it might be interesting @JFRudzinski @ndaelman-hu @Bernadette-Mohr

@hampusnasstrom FYI

There is a paper: https://www.sciencedirect.com/science/article/pii/S0927025614003322?via%3Dihub#s0050
But the question is whether we need to do any API request if someone (maybe @lauri-codes) already did this and hard-coded it in nomad.atomutils. API calls might clutter the normalization and extraction of the Symmetry info.

Oki, I'm open to evaluate the best option

@aalbino2 Thank you for bringing this up. My main question is what data you would want to retrieve?
Typically, we use API calls during the normalization to obtain identifiers that are interoperable with other systems. As @JosePizarro3 pointed out, API calls are a frequent bottleneck and point of failure, but this application is still manageable.

How about implementing a way of fetching all the info directly from their database [AFLOW]? Something similar to what is implement for a PureSubstance querying the PubChem database.

This is a larger data migration project that should be overseen by Markus. These migrations did happen in the past to grow out the NOMAD database. In that sense, they remain useful, and I actually requested such a migration for R2SCAN data a few times now.
However, these migrations also have a political dimension. The original host databases also apply for funding and rightfully don't want to divert traffic away from their site. I'd therefore say that it's best to coordinate these endeavors with Pepe.
Finally, there is already a consortium tackling a common API language where NOMAD and AFLOW both participate in, namely OPTIMADE. From an end user's perspective, the only added values of a data migration to NOMAD are:

they have more choice about the schema they work with locally.
they also can stay fully within the NOMAD system, if that's all they know.

What I had in mind was something similar to what happens in PubChemPureSubstance, e.g., the user is filling one quantity within an instance of that class and on save the api query is filling the other quantities.
In this case the (experimental) user would log their own Sample and indicate the space group. On save, all the quyntities in Simmetry class would be automatically filled with info such as Bravais lattice, or whatever else that right now I'm now aware of.
I also see the Simmetry class as and important connection of data structure between A and C and apart from the API query I would in the future start to use it

In this case the (experimental) user would log their own Sample and indicate the space group. On save, all the quyntities in Simmetry class would be automatically filled with info such as Bravais lattice, or whatever else that right now I'm now aware of.

To start, I suggest going with a function which uses the aflow_prototype dictionary in nomad, and given some quantity (e.g., the space_group_number), it extracts the others. This should cover also cases when someone fills the space_group_symbol or any other related quantities.
Then, we wait for the decision on the API. This method I am talking about do not depend on the specific reading of the information.

This should not be done through an API. The information is so stable and small that it should be available offline. E.g. spglib contains a database of this information, but if it is too limited we should look at other alternatives or built our own.

We also do have an offline version of AFLOW protototype library, but this is actually very different from spacegroup number as it also contains the occupation of Wyckoff positions and is associated with a very specific example structure.

Ok, thanks @lauri-codes @aalbino2 !
I was checking a couple of other things regarding magnetic group symmetries over the weekend, so I see we have a couple of tasks to improve Symmetry. I think I can take over, and I will try to do it as general as possible so that we can use this in a generic way for data from any area.
For now, I will implement a method to resolve Symmetry quantities based on a given input and using spglib / aflow_prototypes from nomad.atomutils.
Later for magnetic symmetries, I want to get some feedback from other people as well. I will separate this in a different issue.
In any case, both implementations will take a while.

Okay, sounds good @JosePizarro3. Just pin me when you need some feedback, I can test it and check if everything needed from my side is included.

repo: nomad-coe/nomad-simulations


text:
fix: governance tests work for governor and non-governor chains

Motivation
If we run fork tests on other chains, the governance router tests need to function for both the governor domain and the non-governor domain

Solution
for non-governor domains,

for handle tests, ensure the remote domain is setUp to the governor domain. the GovernanceRouter tests assume that the remoteDomain is the governor domain; on the actual governor domain, the tests just transfer to the remote domain; but for non-governor domains, this is not possible
for TransferGovernor tests, don't assume homeDomain is the current governor domain.

PR Checklist

[ ] Added Tests
[ ] Updated Documentation
[ ] Updated CHANGELOG.md for the appropriate package

Merge https://github.com/nomad-xyz/monorepo/pull/559 and https://github.com/nomad-xyz/monorepo/pull/560 first

repo: nomad-xyz/monorepo


text:
[Bug]

请确认：

[x] 问题的标题明确
[x] 我翻阅过其他的 issue 并且找不到类似的问题
[x] 我已经阅读了相关文档 并仍然认为这是一个Bug

Bug
问题

bot.get_members返回空列表
已传入正确群号
如何复现

预期行为

使用环境:

操作系统 (Windows/Linux/Mac):
Python 版本: 3.10.11
Nonebot2 版本:2.1.0
Chronocat 版本: 0.0.52
Red 适配器版本:0.6.0

配置文件

日志/截图

https://github.com/chrononeko/bugtracker/issues/20
这是chronocat的问题，与本适配器无关

repo: nonebot/adapter-red


text:
Plugin: Bot上下线通知

PyPI 项目名
nonebot-plugin-BotMailNotice
插件 import 包名
nonebot_plugin_BotMailNotice
标签
[{"label":"Mail","color":"#52e5ea"}]
插件配置项
MAIL_NOTICE='{
"username": "xxx@qq.com",
"password": "qflgxxxxxx",
"hostname": "smtp.qq.com",
"port": 587
}'

主页访问不了啊


text:
Ngrok is not generating link

Ngrok is not generating link please check your tool and update it

In the top of the screen, it shows
"line 27: lolcat:  command not found"

Bro ngrok is not generating link
In your grabcam tool please check
On Sat, 18 Sep, 2021, 6:33 pm PANKAJ KUMAR SHARMA, @.***>
wrote:

In the top of the screen, it shows
"line 27: lolcat: command not found"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-922273536,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4CB5FQYNHIXQB5SP4DUCSEZNANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

The issue is ngrok is not present. ("identified by the error")
Run these below commands for getting ngrok and then again run the script. (Ref-https://www.darkhackerworld.com/2020/06/how-to-install-ngrok-in-termux.html)
pkg update && pkg upgrade -y
pkg install zip wget -y
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip ngrok-stable-linux-arm.zip
chmod +x ngrok
Hope it helps.

Will grabcam tool work in Linux
On Mon, 20 Sep, 2021, 7:05 pm PANKAJ KUMAR SHARMA, @.***>
wrote:

The issue is ngrok is not present. ("identified by the error")
Run these below commands for getting ngrok and then again run the script.
(Ref-
https://www.darkhackerworld.com/2020/06/how-to-install-ngrok-in-termux.html
)
pkg update && pkg upgrade -y
pkg install zip wget -y
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip ngrok-stable-linux-arm.zip
chmod +x ngrok
Hope it helps.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-922934385,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4ARHDJPSNEPISWCLJ3UC42CLANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Still not giving link for me

It's working for me. Have a look.
Can you show your output of "ls" command.

Still not working
On Mon, 20 Sep, 2021, 7:15 pm Kepar 0001, @.***> wrote:

[image: Screenshot_20210920_094454_com.termux.jpg]
https://user-images.githubusercontent.com/67996155/134012861-323378d9-5c77-45d3-8fe0-0dae94c77fc5.jpg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-922942023,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4BWGBWRVDCMNNNXELTUC43GLANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Okk I will send you
On Mon, 20 Sep, 2021, 7:26 pm Lone Umar, @.***> wrote:

Still not working
On Mon, 20 Sep, 2021, 7:15 pm Kepar 0001, @.***>
wrote:

[image: Screenshot_20210920_094454_com.termux.jpg]
https://user-images.githubusercontent.com/67996155/134012861-323378d9-5c77-45d3-8fe0-0dae94c77fc5.jpg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-922942023,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4BWGBWRVDCMNNNXELTUC43GLANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Bro before few days I checked your tool in Linux it is working fine and
Also generating link but when you update the tool it is not generating link
in Linux but it works in termux modify again it to make run it in Linux
because today all people are using Linux
On Mon, 20 Sep, 2021, 7:31 pm Lone Umar, @.***> wrote:

Okk I will send you
On Mon, 20 Sep, 2021, 7:26 pm Lone Umar, @.***> wrote:

Still not working
On Mon, 20 Sep, 2021, 7:15 pm Kepar 0001, @.***>
wrote:

[image: Screenshot_20210920_094454_com.termux.jpg]
https://user-images.githubusercontent.com/67996155/134012861-323378d9-5c77-45d3-8fe0-0dae94c77fc5.jpg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-922942023,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4BWGBWRVDCMNNNXELTUC43GLANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Still not working for me

Check ngrok token
On Mon, 20 Sep, 2021, 8:49 pm Kepar 0001, @.***> wrote:

[image: Screenshot_20210920_111831_com.termux.jpg]
https://user-images.githubusercontent.com/67996155/134027886-73b2ff68-ae5e-4b96-8520-d5c0c8905a2a.jpg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-923025641,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4BMQ2UWQBKQFKWH3TTUC5GH7ANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Check ngrok token
On Mon, 20 Sep, 2021, 8:49 pm Kepar 0001, @.***> wrote:

[image: Screenshot_20210920_111831_com.termux.jpg]
https://user-images.githubusercontent.com/67996155/134027886-73b2ff68-ae5e-4b96-8520-d5c0c8905a2a.jpg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-923025641,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4BMQ2UWQBKQFKWH3TTUC5GH7ANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

How

How?

Leave this topic thanks for reply
On Mon, 20 Sep, 2021, 8:56 pm Kepar 0001, @.***> wrote:

How?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-923032190,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4GVHBG374MY6CKU2CLUC5HCTANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

????

i just verified my ngrok token but like i just realise how tf i can connect to ngrok if hotspot disable my wifi

Bro grabcam tool is not saving picture of target
On Mon, 20 Sep, 2021, 9:08 pm Kepar 0001, @.***> wrote:

i just verified my ngrok token but like i just realise how tf i can
connect to ngrok if hotspot disable my wifi
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-923043352,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4D77BKRPRVVRPDMUBTUC5IPZANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Where is the image file of target??
On Tue, 21 Sep, 2021, 2:16 pm Lone Umar, @.***> wrote:

On Tue, 21 Sep, 2021, 2:14 pm Lone Umar, @.***> wrote:

Bro grabcam tool is not saving picture of target
On Mon, 20 Sep, 2021, 9:08 pm Kepar 0001, @.***>
wrote:

i just verified my ngrok token but like i just realise how tf i can
connect to ngrok if hotspot disable my wifi
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/noob-hackers/grabcam/issues/38#issuecomment-923043352,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYUX4D77BKRPRVVRPDMUBTUC5IPZANCNFSM5EGPGURQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Link not generate

Switch on hotspot before generating the link

[x] Try as root bro

repo: noob-hackers/grabcam


text:
Serial read/write - 750ms delay necessary?

Somewhat an out-of-scope issue here, so I apologize if this is the wrong place for this, but I extended avrgirl-arduino to be able to send a message and wait for data back over serial, and it works beautifully. I hijack the automatic port finder and board validation to have a serialport instance ready to go before I send a message. Currently, I flashed one of our testing Arduino boards with an echo-echo Sketch, where it just spits back the data it reads over serial.
That said, I see an odd behaviour: I use a serialPort.on('data', function to wait for communications from the Arduino, but I have to wait approximately 750ms (minimum) after opening a connection before I can send a String over serial, and I can't do anything immediately after or the data coming back will be garbled.
Is this something you've noticed at all? Happy to provide code if you're interested in what I'm having it do, and I know it's outside of scope, just wondering if this is any behaviour you've seen before.
Thanks!

oh! This is really neat! Are you using the Mega still for this? If not, which board? I'm using three different protocols under the hood, so I'd need to start with the correct one to answer your questions in depth :smile:

@noopkat Still using the mega, and I'll post my code so you can see just what nonsense I'm getting up to.
Avrgirl.prototype.sendMessage = function(data, callback) {
  var _this = this;

  // validate board properties first
  _this._validateBoard(function(error) {
    if (error) { return callback(error); }

    // set up serialport connection
    _this.connection._init(function(error) {
      if (error) { return callback(error); }

      _this.connection.serialPort.open(function (error) {
        if ( error ) {
          console.log('failed to open: '+error);
        } else {
          console.log('open');

          _this.connection.serialPort.on('data', function(data) {
            console.log('data received: ' + data);
          });

          // Wait 750ms and then send data, in order to get an echo back
          setTimeout(function() { _this.connection.serialPort.write(data); }, 750);

        }
      });

    });
  });

};

Essentially a carbon copy of the initialization for your .upload() function, if I remember correctly, and I just take over serialPort for the opened connection from there. As for the setTimeout() function that writes the data, anything lower than 750 (have tested 700) and it receives nothing back.
Appreciate the help, Suz!

@JonLim ok! So I had a hunch about what might be causing the delay, but I had to actually play with an Arduino to prove it. Please forgive the radio silence!
My theory is that this delay is isolated to Arduino boards. Essentially, when the board's serialport is opened, the board is automatically reset and the software takes some time to reboot. This is by design, and it's due to the wiring of the board itself I believe. The delay therefore is tied to how long it takes for the board to reboot and start running your sketch again.
You can test this out with two different methods:

Using the Arduino IDE, and opening up the Serial Monitor. If you have any startup led blinks in your setup script (which can be a good test), you'll see them blink again, cos the board reboots as the connection opens for the Serial Monitor. I remember reading a while back that opening the Serial Monitor resets the Arduino no matter what. You'll see a delay there too before you get reads coming in.

Put a few led blinks into your setup script and connect using node-serialport. You will probably see the same behaviour. I think on average the delay can be anything between 600ms to 1000ms (yikes!).

SO. There are a few sneaky ways to fix this, which is essentially disabling the auto DTR style reset. Here is a link: http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection
The catch? Disabling the DTR pin will also stop the Arduino from being able to be reset into bootloader mode, which is necessary for AVRGirl Arduino to work when you're flashing new code to the board. So flashing the board will no longer be possible unless you manually press the reset button each time. Gah! Not sure if you wanted to use the flashing utility of AVRGirl Arduino or not, so if you don't need it, then go ahead and disable the DTR with a capacitor :smile:
Wrapping the first write in a setTimeout like you explained looks to be the only way to preserve all the functionality you'd like.
Hope this helps clear things up a little bit!

Hiyo @noopkat, apologies on the delay in responding.
Thank you so much for looking at this in-depth! I had completely forgotten about the reboot process when opening a serial port (like opening the Serial Monitor in Arduino IDE) which might cause the delay. I don't think we'll be disabling the DTR pin, so I think we will be sticking with the setTimeout method.
Thanks again, can't wait to keep plugging away with avrgirl-arduino!
Cheers.

:sparkles: np, let me know if you run into anything else!

authors: JonLim noopkat

repo: noopkat/avrgirl-arduino

license: mit


text:
Final cleanup of special characters

I think that's all of them!

Very nice!

authors: norvig pronoiac

repo: norvig/paip-lisp


text:
pip install時に意図しないファイルが展開されてしまう。

概要
pip installをした際にexample, tests, benchmarksがsite-packages下にインストールされており、import benchmarksのようなコードが通ってしまいます。
解決策
setup.cfgに設定を追加します。

This issue has been solved by #61. Thank you for your contribution.


text:
Problems with uploading chapters

When I try to upload a page, it is not added.
and
Excellent work :)

i think this caused by compatibility of my code for some browser
i will fix this problem as fast as possible

i already fix this problem by this commit 48182172888c9609dc738eb8fc8d2d3c05b3ea47


text:
feat: verify cert against crl

Introduce new flag verify-crl to verify certificate against crl

Codecov Report

Merging #18 (d00800a) into master (25d1184) will decrease coverage by 1.59%.
The diff coverage is 29.03%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
- Coverage   71.15%   69.57%   -1.59%
==========================================
  Files           7        7
  Lines         988     1009      +21
==========================================
- Hits          703      702       -1
- Misses        221      244      +23
+ Partials       64       63       -1

Files Changed
Coverage Δ

cmd/certify/command.go
64.43% <20.00%> (-5.96%)
:arrow_down:

cmd/certify/main.go
52.00% <40.00%> (-1.13%)
:arrow_down:

cmd/certify/helper.go
81.83% <50.00%> (-0.63%)
:arrow_down:

:loudspeaker: Have feedback on the report? Share it here.

authors: codecov-commenter nothinux

repo: nothinux/certify


text:
Markwon shows images twice

Markwon version: 4.2.2

Here's what I'm expecting to see:

But Markwon shows images twice:

Here's markdown:

An example RxJava exception:

![test](/uploads/353e70d9828e2271502fc64de9b073e8/image.png)

The same exception with Traceur enabled:

![test](/uploads/eacdd079683411e9776a2eee40925548/image.png)

Here's how I'm creating Markwon:
Markwon
    .builder(context)
    .usePlugin(object : AbstractMarkwonPlugin() {
        override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
            val serverPath =
                Toothpick
                    .openScopes(DI.SERVER_SCOPE, "MarkdownTextView_${hashCode()}")
                    .getInstance(String::class.java, ServerPath::class.java.canonicalName)
            builder
                .urlProcessor(UrlProcessorRelativeToAbsolute(serverPath))
        }
    })
    .usePlugin(GlideImagesPlugin.create(context))
    .build()

I'm trying to render this merge request https://gitlab.com/terrakok/gitlab-client/-/merge_requests/254 using this application, If you want to test it yourself (branch is mandatory): https://gitlab.com/terrakok/gitlab-client/-/tree/support/extend_markdown_support-upgrade-markwon

Hello @IlyaGulya !
This can happen when padding is used on a TextView which is used to display markdown. Try changing padding to margins or move padding to parent widget (you can disable clipping on parent widget to achieve initial padding effect)

@noties Hi!
Thanks, that's helped!

authors: IlyaGulya noties

repo: noties/Markwon


text:
Notify Security Level

Problem
We want to be able to see what DRM security level we are going to be using when creating a MediaDrm session.
Solution
Create a DrmSecurityLevelCallback which will notify clients after a DRM session is created of the security level in use for the content.
Test(s) added
Just updated where necessary.
Paired with
Nobody.

I'm doing some additional changes to force a security level on initial creation of a DRM session.

repo: novoda/no-player


text:
Do not scroll-to-top on initial page load

This fixes the undesirable behaviour described in #551.

Excellent!

authors: Cinamonas tannerlinsley

repo: nozzle/react-static


text:
"Couldn't find part of path to [path to object]" when trying to build plugin manually

Hi. I am trying to build plugin from ZIP files but keep getting errors, as it turns out there is no content (files, scripts) what compiler needs to build plugin. Examples:
All paths are the same and should lead to the same object but the object does not exist for some reason.
  Couldn't find part of path to "path to asset/script", later:

Failed to copy "path to asset/script" to "path leading to the same object", and later:
BUILD FAILED
Is there a way to solve it or am I downloaded ZIP file wrong?

Hi Elsa!
How are you doing? I encountered similar issues even though not the same issue.., here´s how my limited knowledge can be of help:
Make sure you have Visual Studio installed THEN compile it from source. Try to compile it from source.

Hi Blacksage
VS 2019 is installed, VC++ is installed too.
Exactly when I try to compile it from source it comes with such errors, and when I try to launch it with downloaded plugin version it says that it can't compile during runtime

Then I dont know man. It worked for me.

I'm compiling it from Command Prompt

Yeah, Im not sure. Im not such an expert. I compiled it from the VS file and it worked so I truly dont know how to help you

Hey @JetBro22 !
What do you mean by "compiling it from Command Prompt"?
Where did you put the plugin in your Unreal project folder structure?

Closing this now for tracking purposes. Feel free to re-open in case you've got an update!

authors: Blacksage-beep JetBro22 npruehs


text:
Wrong flowUrl value for facebook

The flowUrl used for facebook login currently is(line 25 of oauth.facebook.js):
var flowUrl = "https://www.facebook.com/v2.0/dialog/oauth?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=token&scope=" + appScope.join(",");
But the request parameter "scope" used above actually should be "fields" as per the facebook graph api. This is causing a error response "error_code=100 : Invalid permissions". Correcting the request parameter resolves the issue.

Can you provide a link to this documentation stating that scope is now fields?

You can see the url in graph api explorer https://developers.facebook.com/tools/explorer/
For different versions of api the parameter is "fields" only which takes comma separated values for list of permissions.

The Facebook APIs are not the same as Facebook Login:
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login
The Facebook documentation is still using scope.  If you are receiving a 100 error it means you are trying to include invalid permissions in your scope.
Here are the valid scope permissions:
https://developers.facebook.com/docs/facebook-login/permissions/
Regards,

authors: nraboy sn-satyendra

repo: nraboy/ng-cordova-oauth


text:
Add an option to forgo backups

Closes https://github.com/nrc/rustfmt/issues/171.

I had imagined that we would have a WriteMode for replace with no backups, rather than having a config option. That probably requires specifiying the WriteMode on the command line to be useful.
Is there a reason you prefer a config option?

Yea, that's most likely a better solution. Hadn't thought of it.

Updated!

r+ modulo the minor comments

authors: marcusklaas nrc

repo: nrc/rustfmt


text:
New Lesson - Robot Framework

@lara29  and I are planning to contribute a tutorial(primer) on the Robot Framework(wrt automated network verification). Please let us know if the tutorial outline seems appropriate.
@Mierdin @cloudtoad @jameskellynet
Robot Framework tutorial tentative outline
Chapter 1

Introduction
Installation
Types of libraries/keywords
Robot file format/syntax (introduction)
Basic Example 1 (without vSRX interaction)

Chapter 2

Project organization/directory structure
Robot file format/syntax (continued)
Basic example 2 (with vSRX interaction)

Chapter 3

Tags/Setup/teardown
Detailed example3 + Explanation (with vSRX interaction)

@saimkhan92 @lara29 This looks great. 👍 Chapter 2 and 3 are a little light on description but I think this is a good start and we can iterate on the pull request.
Have fun, and let us know if you need anything to keep moving.

Thanks @Mierdin
We'll add more sub-topics into chapter 2&3 once we have completed with the basic layout.

Detailed Project Outline
Chapter 1

Introduction

written in python
used for acceptance testing
keyword driven

Types of keywords

built-in, standard libnrary, external libraries, private library

Rules and Syntax

cell spacing, 4 tables
variable declaration(scalar, lists, dictionaries)

Explain 4 tables

settings, variables, keywords, testcases

Example1

basic syntax demo
import a simple private library
demo variables, settings, testcases (tables)
demo scalar variable
define multiple testcases in a testsuite
use built-in and library keywords
demo running a robot testsuite
demo a failure case

Chapter 2

Topology information vSRX

hostname: "vsrx-robot"
model: "VSRX"

Explain private library functions
Example1

use keywords from junos private library
passing variables from the command line, parsing them inside the robot file
passing arguments for private functions/keywords

Chapter 3

Demo user defined keywords
Create a separate resource file and demonstrate importing it
Project organization, directory structure best practices

data, libraries, resources, results, tests

Example1

demo user defined keywords
demo FOR loop for parsing a returned dictionary
demo logging

Example2

test setup/teardown
import resource file

I can't wait to try this lesson and learn this stuff. Great stuff!

Doesn't matter for now, pick one that's unique and we will make sure it's still unique before merge to master of this repo if applicable

Okay, we'll do that, thanks!

Utility container is fine.
On Mon, Oct 29, 2018, 10:29 AM Lakshmi Rajan notifications@github.com
wrote:

@Mierdin https://github.com/Mierdin Can we add the package
"robotframework" to the requirements.txt of utility Linux container(under
/images/utility)? Or would you prefer we create a special linux container
for this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nre-learning/antidote/issues/112#issuecomment-434001441,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AECM--2adP7wOcweRn5Zu3eJipKrnDQnks5upzsJgaJpZM4X5Erq
.

Thanks!

@Mierdin I do not have push permission for the linux utility container. Is it possible you could add the package "robotframework" to the requirements.txt, so that I can use it for testing. Thanks!

You don't need to push it, you can add it to requirements.txt in this PR.

Closed in #125

repo: nre-learning/antidote


text:
fix: correct pkg name

fixes package name in readme - will likely have repercussions on package site

I'm not sure this warrants a version bump/news update ...

Thank you @jcken95!

repo: nrennie/PrettyCols


text:
Fix for entities with composite names

It should be split('_', 2) to split into only two substrings, allowing camelize.constantize to correctly get the entity name.
Just with split('_'), in case of  authenticate_composite_name_entity:
prefix, entity_name = 'authenticate_composite_name_entity'.split('_')

entity_name will only contain "composite" value.

Good catch! I didn't read your previous comment well enough 😄

authors: gustavovnicius nsarno

repo: nsarno/knock


text:
Fix/fix and document nil pointer conversion

closes #291
SDK version was bumped

Forgotten docs and/or tests for XXXFromV2 constructors:

audit.Result;
container.UsedSpaceAnnouncement;
container.NewAttributesFromV2;
object.SplitID;
token.NewBearerTokenFromV2;

@cthulhu-rider, added comments/tests to XXXFromV2 of:

audit.Result;
container.UsedSpaceAnnouncement;
container.NewAttributesFromV2.

but not for:

object.SplitID;
token.NewBearerTokenFromV2.

SplitID: i found it strange to XXXFromV2 from []byte
BearerToken has logic with checking if passed v2 is nil or not, so i kept that behavior

authors: carpawell cthulhu-rider

repo: nspcc-dev/neofs-api-go


text:
No answer from getUserTimelineWithScreenName

okay if getUserTimelineWithScreenName: @ "Moscow"
                                   successBlock: ^ (NSArray * statuses)
...
No answer from getUserTimelineWithScreenName: @ "Москва"
                                   successBlock: ^ (NSArray * statuses)

As far as I know, Twitter screen names cannot contain non-ASCII characters.

repo: nst/STTwitter


text:
Build type Debug implies using ASAN and UBSAN builds

The following line forces a Debug build to have address- and undefined behaviour analyzers enabled in the codebase: https://github.com/nsumner/cpp-tree-sitter/blob/17d720dfd02d363cbdae005839f7dd3f68b7006e/CMakeLists.txt#L12
This is a very sane default, but to the unknown it leads to weird linker errors.
My suggestion would be to make this configurable through a flag. Tha way the main codebase can choose which analyzers and flags are used.

Very fair point. The original use case for this was for students in course projects, and some extra hand holding was more reasonable in that context.
I'll put this in my TODO list.

Removed for now, as they can be set set by a project using the library anyway. Issue should be resolved.

Thank you very much!

authors: nsumner stonemaster

repo: nsumner/cpp-tree-sitter


text:
Fixed volume-range's position

Now this is not very close to the volume icon.

Thanks!


text:
using help doesn't display documentation in python / r

Description:
running help('read_csv') (R) or pd.read_csv? (python) shows a check mark but does not spawn an output bubble with documentation or open documentation in a browser window.
Steps to Reproduce:

load a python or r script with a conda installation
run

library(data.table)
help(fread)

import pandas as pd
pd.read_csv?

returns output like this:

Versions:
Atom 1.25.0 running on Ubuntu 16.04 LTS. Hydrogen 2.4.1

Cool, that works (for both python and r). Cheers!
For future reference, Alt-i opens the Find menu on linux, so I remapped Inspector to
'ctrl-alt-i'      : 'hydrogen:toggle-inspector'

repo: nteract/hydrogen


text:
feat: toggles with  domain only

Checks

[ ] Your YAML file has required fields as listed in Specs
[ ] All checks have passed yaml-lint passed
[ ] You agree to contribute your work under MIT license

Achieved!

authors: raymundlin rebeccaswc


text:
🛑 Agricoltura, Sovranità alimentare e Foreste is down

In d7d9738, Agricoltura, Sovranità alimentare e Foreste (http://www.politicheagricole.it/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Agricoltura, Sovranità alimentare e Foreste is back up in 73bc81f.


text:
🛑 Università e ricerca is down

In 83ed9aa, Università e ricerca (https://www.mur.gov.it/it) was down:

HTTP code: 403
Response time: 715 ms

Resolved: Università e ricerca is back up in 51e606b.


text:
🛑 Guardia di Finanza is down

In a329a76, Guardia di Finanza (https://www.gdf.gov.it) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Guardia di Finanza is back up in 3caaf1e after 13 minutes.


text:
计算机组成网络

https://nullskymc.site/computer_network/
计算机组成网络
功能组成：
资源子网
应用层
传输层
网络层
通信子网
数据链路层
物理层
数据单位
计算机网络速率单位：
bps: 比特每秒
Kbps: 千比特每秒
Mbps: 兆比特每秒
Gbps: 十亿比特每秒
Tbps: 万亿比特每秒
主机在1us内可以传输的比特数
存储容量单位：
bit: 比特
B: 字节
KB: 千字节
MB: 兆字节
GB: 十亿字节
TB: 万亿字节
吞吐量：
速率：单位时间内通过某个网络的数据量
带宽：网络中某一通道所能通过的最高速率
吞吐量：单位时间内通过某个网络的实际数据量
时延：
发送时延：主机发送数据帧所需时间
  发送时延 = 数据帧长度（比特）/ 发送速率（比特每秒）

传播时延：电磁波在信道中传播所需时间
  传播时延 = 信道长度（比特）/ 电磁波在信道上的传播速率（比特每秒）

处理时延：主机或路由器对帧进行处理所需时间
排队时延：帧在缓存器中排队所需时间
时延带宽积：
时延带宽积 = 传播时延 * 带宽
以比特为单位的链路长度
TCP/IP协议
TCP/IP协议分层
应用层
传输层
网络层
数据链路层
物理层
物理层
物理层的基本概念
信号
  数据的电气或电磁表现

信道
  信号传输的媒体

码元
  在信道上传输固定时长的基本波形，代表不同的离散数值，这个时长内的信号称为k进制码元，该时长为码元宽度

速率
  码元传输速率、信息传输速率。单位为波特（Baud）

码元传输速率 = 1 / 码元宽度
信息传输速率 = 码元传输速率 * $log_2V$
表示单位时间内数字通信系统传输的二进制码元个数

若一个码元携带n bit的信息量，则M Baud 的码元传输速率可以传输的信息速率为 $n * M bps(bit/s)$
带宽
  模拟信号系统中，信号的最高频率与最低频率之差，单位为赫兹（Hz）

数字信号系统中，从网络中某一点到另一点所能通过的最高数据率（单位时间内通过链路的数量值），单位为比特每秒（bps）
两个定理：
奈奎斯特定理：理想低通信道的极限数据传输率
  $C = 2 * B * log2V$

C: 信道极限传输率
B: 带宽
V: 传输电平数
理想低通信道的最高码元传输速率 = 2 * 带宽(W) * log2(传输电平数)
香农定理：信道极限传输率的实际上限
  信噪比：信号功率与噪声功率之比（S/N）单位为分贝（dB）

$C = B * log2(1 + S/N)$
C: 信道极限传输率
B: 带宽
S: 信号平均功率
N: 噪声平均功率
传输方式、通信方式、通信模式
传输方式：
并行传输
  一次发送n个比特

串行传输
  一次发送1个比特

通信方式：
单工通信
  只能有一个方向的通信

半双工通信
  双方都可以发送，但不能同时发送

全双工通信
  双方可以同时发送

通信模式：
单点通信
  一对一通信

多点通信
  一对多通信

init

repo: nullskymc/blogcomments


text:
feat: block isbsvc deleting when there is linked pipeline

This should sort of fix the problem in https://github.com/numaproj/numaflow/issues/1956.

repo: numaproj/numaflow


text:
add integration tests for awkward-array

I followed the instructions for adding the awkward-array test, though I don't understand the testing framework well enough to run it myself. However, I think the form I filled out should make my intent clear.
Thanks!

@jpivarski awesome! This looks good, I'll try it now.

This pretty much worked. I had to make the following two changes. The name of the project must be the name of the repository for now. While this is not set in stone, this is a requirement right now. Also Doing an execute("cd bla") won't succeed but instead I had to use os.chdir.
Additionally, there was a test failure which I will be able to link to soon, once the tests have run through on CircleCI.
Did you find the documentation useful? Does it still lack something?

For reference, here is the commit: https://github.com/numba/numba-integration-testing/commit/688e89b19f2f90e6b2d9791bcad03c3edc0cf9d8

It looks good on linux on CI: https://circleci.com/gh/numba/numba-integration-testing/58

Locally, I have a failure on MacOSX:
============================================================================== FAILURES ===============================================================================
_______________________________________________________________________ Test.test_numba_getiter _______________________________________________________________________

fmt_ = 'lowering "{inst}" at {loc}', args = ()
kwargs = {'inst': <numba.ir.Assign object at 0x11cf5b5f8>, 'loc': Loc(filename=/Users/vhaenel/git/numba-integration-testing/awkward/tests/test_numba.py, line=369, col=None)}
errcls = functools.partial(<class 'numba.errors.LoweringError'>, loc=Loc(filename=/Users/vhaenel/git/numba-integration-testing/awkward/tests/test_numba.py, line=369, col=None))
loc = Loc(filename=/Users/vhaenel/git/numba-integration-testing/awkward/tests/test_numba.py, line=369, col=None)
newerr = LoweringError('Failed in nopython mode pipeline (step: nopython mode backend)\nouter() takes 1 positional argument but...ore developers\ndirectly at: https://gitter.im/numba/numba\n\nThanks in advance for your help in improving Numba!\n\n')
config = <module 'numba.config' from '/Users/vhaenel/git/numba-integration-testing/miniconda3/envs/awkward/lib/python3.7/site-packages/numba/config.py'>, tb = None

    @contextlib.contextmanager
    def new_error_context(fmt_, *args, **kwargs):
        """
        A contextmanager that prepend contextual information to any exception
        raised within.  If the exception type is not an instance of NumbaError,
        it will be wrapped into a InternalError.   The exception class can be
        changed by providing a "errcls_" keyword argument with the exception
        constructor.

        The first argument is a message that describes the context.  It can be a
        format string.  If there are additional arguments, it will be used as
        ``fmt_.format(*args, **kwargs)`` to produce the final message string.
        """
        errcls = kwargs.pop('errcls_', InternalError)

        loc = kwargs.get('loc', None)
        if loc is not None and not loc.filename.startswith(_numba_path):
            loc_info.update(kwargs)

        try:
>           yield

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/errors.py:627:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <numba.lowering.Lower object at 0x11ee85cf8>, block = <ir.Block at /Users/vhaenel/git/numba-integration-testing/awkward/tests/test_numba.py (369)>

    def lower_block(self, block):
        """
        Lower the given block.
        """
        self.pre_block(block)
        for inst in block.body:
            self.loc = inst.loc
            defaulterrcls = partial(LoweringError, loc=self.loc)
            with new_error_context('lowering "{inst}" at {loc}', inst=inst,
                                   loc=self.loc, errcls_=defaulterrcls):
>               self.lower_inst(inst)

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <numba.lowering.Lower object at 0x11ee85cf8>, inst = <numba.ir.Assign object at 0x11cf5b5f8>

    def lower_inst(self, inst):
        # Set debug location for all subsequent LL instructions
        self.debuginfo.mark_location(self.builder, self.loc)
        self.debug_print(str(inst))
        if isinstance(inst, ir.Assign):
            ty = self.typeof(inst.target.name)
>           val = self.lower_assign(ty, inst)

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:301:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <numba.lowering.Lower object at 0x11ee85cf8>, ty = pair<array(float64, 1d, C), bool>, inst = <numba.ir.Assign object at 0x11cf5b5f8>

    def lower_assign(self, ty, inst):
        value = inst.value
        # In nopython mode, closure vars are frozen like globals
        if isinstance(value, (ir.Const, ir.Global, ir.FreeVar)):
            res = self.context.get_constant_generic(self.builder, ty,
                                                    value.value)
            self.incref(ty, res)
            return res

        elif isinstance(value, ir.Expr):
>           return self.lower_expr(ty, value)

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:459:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <numba.lowering.Lower object at 0x11ee85cf8>, resty = pair<array(float64, 1d, C), bool>, expr = iternext(value=$phi10.1)

    def lower_expr(self, resty, expr):
        if expr.op == 'binop':
            return self.lower_binop(resty, expr, expr.fn)
        elif expr.op == 'inplace_binop':
            lty = self.typeof(expr.lhs.name)
            if lty.mutable:
                return self.lower_binop(resty, expr, expr.fn)
            else:
                # inplace operators on non-mutable types reuse the same
                # definition as the corresponding copying operators.)
                return self.lower_binop(resty, expr, expr.immutable_fn)
        elif expr.op == 'unary':
            val = self.loadvar(expr.value.name)
            typ = self.typeof(expr.value.name)
            # Get function
            signature = self.fndesc.calltypes[expr]
            impl = self.context.get_function(expr.fn, signature)
            # Convert argument to match
            val = self.context.cast(self.builder, val, typ, signature.args[0])
            res = impl(self.builder, [val])
            res = self.context.cast(self.builder, res,
                                    signature.return_type, resty)
            return res

        elif expr.op == 'call':
            res = self.lower_call(resty, expr)
            return res

        elif expr.op == 'pair_first':
            val = self.loadvar(expr.value.name)
            ty = self.typeof(expr.value.name)
            res = self.context.pair_first(self.builder, val, ty)
            self.incref(resty, res)
            return res

        elif expr.op == 'pair_second':
            val = self.loadvar(expr.value.name)
            ty = self.typeof(expr.value.name)
            res = self.context.pair_second(self.builder, val, ty)
            self.incref(resty, res)
            return res

        elif expr.op in ('getiter', 'iternext'):
            val = self.loadvar(expr.value.name)
            ty = self.typeof(expr.value.name)
            signature = self.fndesc.calltypes[expr]
            impl = self.context.get_function(expr.op, signature)
            [fty] = signature.args
            castval = self.context.cast(self.builder, val, ty, fty)
>           res = impl(self.builder, (castval,))

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:942:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <wrapped <function _wrap_missing_loc.<locals>.wrapper at 0x11e5d1bf8>>, builder = <llvmlite.llvmpy.core.Builder object at 0x11deb50f0>
args = (<ir.LoadInstr '.154' of type '{i64*, {{i8*, i8*, i64, i64, i64*, [1 x i64], [1 x i64]}, {i8*, i8*, i64, i64, i64*, [1..., [1 x i64], [1 x i64]}, {i8*, i8*, i64, i64, double*, [1 x i64], [1 x i64]}, i1}}*', opname 'alloca', operands ()>]>,)
loc = None

    def __call__(self, builder, args, loc=None):
>       res = self._imp(self._context, builder, self._sig, args, loc=loc)

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/targets/base.py:1132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<numba.targets.cpu.CPUContext object at 0x11ee88b70>, <llvmlite.llvmpy.core.Builder object at 0x11deb50f0>, (iter(Jag... [1 x i64], [1 x i64]}, {i8*, i8*, i64, i64, double*, [1 x i64], [1 x i64]}, i1}}*', opname 'alloca', operands ()>]>,))
kwargs = {}

    def wrapper(*args, **kwargs):
        kwargs.pop('loc')     # drop unused loc
>       return fn(*args, **kwargs)
E       TypeError: outer() takes 1 positional argument but 4 were given

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/targets/base.py:1157: TypeError

During handling of the above exception, another exception occurred:

self = <tests.test_numba.Test testMethod=test_numba_getiter>

    def test_numba_getiter(self):
        a = JaggedArray.fromiter([[1.1, 2.2, 3.3], [], [4.4, 5.5]])
        a2 = JaggedArray.fromcounts([2, 0, 1], a)
        @numba.njit
        def test1(x):
            out = 0.0
            for xi in x:
                for xij in xi:
                    out += xij
            return out
>       assert test1(a) == 16.5

tests/test_numba.py:373:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/dispatcher.py:370: in _compile_for_args
    raise e
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/dispatcher.py:327: in _compile_for_args
    return self.compile(tuple(argtypes))
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler_lock.py:32: in _acquire_compile_lock
    return func(*args, **kwargs)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/dispatcher.py:659: in compile
    cres = self._compiler.compile(args, return_type)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/dispatcher.py:83: in compile
    pipeline_class=self.pipeline_class)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:940: in compile_extra
    return pipeline.compile_extra(func)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:372: in compile_extra
    return self._compile_bytecode()
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:871: in _compile_bytecode
    return self._compile_core()
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:858: in _compile_core
    res = pm.run(self.status)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler_lock.py:32: in _acquire_compile_lock
    return func(*args, **kwargs)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:254: in run
    raise patched_exception
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:245: in run
    stage()
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:733: in stage_nopython_backend
    self._backend(lowerfn, objectmode=False)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:683: in _backend
    lowered = lowerfn()
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:670: in backend_nopython_mode
    self.metadata)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/compiler.py:1109: in native_lowering_stage
    lower.lower()
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:177: in lower
    self.lower_normal_function(self.fndesc)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:218: in lower_normal_function
    entry_block_tail = self.lower_function_body()
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:243: in lower_function_body
    self.lower_block(block)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/lowering.py:258: in lower_block
    self.lower_inst(inst)
../miniconda3/envs/awkward/lib/python3.7/contextlib.py:130: in __exit__
    self.gen.throw(type, value, traceback)
../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/errors.py:635: in new_error_context
    six.reraise(type(newerr), newerr, tb)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

tp = <class 'numba.errors.LoweringError'>
value = LoweringError('Failed in nopython mode pipeline (step: nopython mode backend)\nouter() takes 1 positional argument but...ore developers\ndirectly at: https://gitter.im/numba/numba\n\nThanks in advance for your help in improving Numba!\n\n')
tb = None

    def reraise(tp, value, tb=None):
        if value is None:
            value = tp()
        if value.__traceback__ is not tb:
            raise value.with_traceback(tb)
>       raise value
E       numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend)
E       outer() takes 1 positional argument but 4 were given
E
E       File "tests/test_numba.py", line 369:
E               def test1(x):
E                   <source elided>
E                   out = 0.0
E                   for xi in x:
E                   ^
E
E       [1] During: lowering "$10.2 = iternext(value=$phi10.1)" at /Users/vhaenel/git/numba-integration-testing/awkward/tests/test_numba.py (369)
E       -------------------------------------------------------------------------------
E       This should not have happened, a problem has occurred in Numba's internals.
E
E       Please report the error message and traceback, along with a minimal reproducer
E       at: https://github.com/numba/numba/issues/new
E
E       If more help is needed please feel free to speak to the Numba core developers
E       directly at: https://gitter.im/numba/numba
E
E       Thanks in advance for your help in improving Numba!

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/six.py:659: LoweringError
================================================================ 1 failed, 22 passed in 29.02 seconds =================================================================
::>> The following tests failed: '['awkward']'

@esc In summary, it looks like you got the error and I didn't because you're running Numba master and I'm running the latest release, 0.43.1. Now the stream of consciousness:
It looks like the key issue is here:
args = (<numba.targets.cpu.CPUContext object at 0x11ee88b70>, <llvmlite.llvmpy.core.Builder object at 0x11deb50f0>, (iter(Jag... [1 x i64], [1 x i64]}, {i8*, i8*, i64, i64, double*, [1 x i64], [1 x i64]}, i1}}*', opname 'alloca', operands ()>]>,))
kwargs = {}

    def wrapper(*args, **kwargs):
        kwargs.pop('loc')     # drop unused loc
>       return fn(*args, **kwargs)
E       TypeError: outer() takes 1 positional argument but 4 were given

../miniconda3/envs/awkward/lib/python3.7/site-packages/numba/targets/base.py:1157: TypeError

some interface that used to have 4 arguments but now takes 1. The stack trace doesn't give a clue about what to look for in the awkward-array code because it fails in Numba... after I passed something bad to Numba, presumably. This is exactly the kind of Numba ↔ extended library dependency that tests like this can fix.
One clue is that it fails on the following line of the tests:
E       File "tests/test_numba.py", line 369:
E               def test1(x):
E                   <source elided>
E                   out = 0.0
E                   for xi in x:
E                   ^
E
E       [1] During: lowering "$10.2 = iternext(value=$phi10.1)" at /Users/vhaenel/git/numba-integration-testing/awkward/tests/test_numba.py (369)

which is when it tries to make an iterator for the JaggedArray x. Iterators are handled globally in awkward-array/awkward-numba/awkward/numba/array/base.py. This happened in the lowering, not the typing, so it's one of two functions: _AwkwardArray_lower_getiter or _AwkwardArray_lower_iternext. Both of these take 4 arguments and get wrapped by numba.extending.lower_builtin and (in the latter case) numba.targets.imputils.iternext_impl). There are other functions here that take 4 arguments, but they're called by my code, so if it was one of them, the stack trace would have included a line number from my library. So by process of elimination, it's probably one of these two decorators.
I just checked Numba's master and indeed the interface to numba.targets.imputils.iternext_impl has changed. It used to be a decorator by itself (for 4-argument functions) but now it's a 1-argument function returning a decorator. That's where the 4-argument vs 1-argument error comes in. In the head version of Numba, I need to say
@numba.targets.imputils.iternext_impl(numba.targets.imputils.RefType.BORROWED)

or
@numba.targets.imputils.iternext_impl(numba.targets.imputils.RefType.NEW)

instead of
@numba.targets.imputils.iternext_impl

(I'm not sure which, but a segfault would tell me! Probably "borrowed," because my iterator implementation changes the index pointer in place, like Numba's arrayobj, which is also "borrowed.")
However, I can't do that in released versions of Numba because iternext_impl is a decorator, not a function returning a decorator. In other words, iternext_impl was not considered a stable, public-facing API, though I have need of it—exactly the kind of thing we wanted to learn from these tests.
Would the Numba team consider making this decorator backward compatible? Since 0.43.1 is the latest release (from conda), no Numba versions have been released with the new iternext_impl interface. If the old behavior was no argument list implies "borrowed," that behavior could be continued. The presence of an argument list would still require "new" vs "borrowed" to be explicit—an apparent goal. It might be easy to leave out an argument, but it's hard to mistake no argument list with an argument list!
Who should we contact about asking if this can become a public interface with backward compatibility?

Thanks for the elaborate comment @jpivarski - I appreciate it. @stuartarchibald @seibert @sklam and I will discuss next week in the Numba developers meeting and get back to you!

I also just joined https://gitter.im/numba/numba-dev so that I can be contacted there. If there's a few weeks before the next production release of Numba, then there's probably enough time to discuss it. I also learned from your tests that I can debug against numba==0.44.0dev0 (instead of debugging by reading stack traces). I need to be more plugged into the Numba release cycle to know what these are called and when to check, but presumably I'll see that on the Gitter channel.

authors: esc jpivarski

repo: numba/numba-integration-testing


text:
Error: 'Module' object has no attribute 'global_variables'

I upgrade to the latest numba (0.17.0) using macports on mac osx 10.10.02 and now I cannot compile any numba functions anymore. Compilation fails with the following error:
Python 2.7.9 (default, Dec 13 2014, 15:13:49)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import number
>>> numba.__version__
'0.17.0'
>>> @numba.jit
... def f(x):
...     return x
...
>>> f(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/dispatcher.py", line 157, in _compile_for_args
    return self.compile(sig)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/dispatcher.py", line 277, in compile
    flags=flags, locals=self.locals)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 547, in compile_extra
    return pipeline.compile_extra(func)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 293, in compile_extra
    return self.compile_bytecode(bc, func_attr=self.func_attr)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 301, in compile_bytecode
    return self._compile_bytecode()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 534, in _compile_bytecode
    return pm.run(self.status)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 191, in run
    raise patched_exception
AttributeError: Failed at object (object mode backend)
'Module' object has no attribute 'global_variables'
>>>

The same setup worked with numba version 0.16. Let me know if you need further information about my setup.

This looks like llvmlite needs updating. Running conda update llvmlite should resolve the issue.

Well, the problem was actually that I needed to downgrade llvmlite. My macports already installed llvmlite 0.3.0, which is apparently incompatible with numba 0.17.0 (which is also installed via macports).
One could argue that this is a problem with macports, but on the other hand a more useful error message on numbas site would also help.
Anyhow, I now have a running numba installation again.
David

On 20. Feb 2015, at 05:01 , Graham Markall notifications@github.com wrote:
This looks like llvmlite needs updating. Running conda update llvmlite should resolve the issue.
—
Reply to this email directly or view it on GitHub.

--
Dr. David Zwicker
School of Engineering and Applied Science
Harvard University
29 Oxford Street, Cambridge MA 02139
http://www.david-zwicker.de

We haven't officially released llvmlite 0.3.0 (although it is tagged, so I can see how the macports package maintainer might have assumed it was released), which contains a method name change that requires a corresponding change in numba.

authors: david-zwicker gmarkall seibert

repo: numba/numba


text:
If condition against an integer fails

Hi,
Considering the code below, I don't see why _test_tuple works fine in both  'if' cases whereas _test_int fails in one of the two cases :
from numba import njit, prange
import numpy as np

def _test_int(_input, additional_dimension: int):
    for x in prange(_input.shape[0]):
        if additional_dimension > 0:

            for dim_idx in prange(0, additional_dimension):

                local_slice = _input[x, dim_idx]
                # Do some specific treatement here
        else:
            local_slice = _input[x]
            # Do some other treatement here

def _test_tuple(_input, additional_dimension: tuple):
    """Same function as above but addtional_dimension is a tuple"""
    for x in prange(_input.shape[0]):
        if len(additional_dimension) > 0:

            for dim_idx in prange(0, additional_dimension[0]):

                local_slice = _input[x, dim_idx]
                # Do some specific treatement here
        else:
            local_slice = _input[x]
            # Do some other treatement here

np.random.seed(2021)
data_simple = np.random.random((10,))
data_complete = np.random.random((10, 2))

# Compilation :
_test_int_jitted = njit(_test_int)
_test_tuple_jitted = njit(_test_tuple)

# Executions :
# OK
_test_tuple_jitted(data_complete, (2,))
# OK
_test_tuple_jitted(data_complete, (0,))
# OK
_test_int_jitted(data_complete, 2)
# KO : why the if branching does fail here?
_test_int_jitted(data_simple, 0)

The latest line fails with the following error (meaning we took the wrong branch in the if since addtional_dimension equals zero :
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function getitem>) found for signature:

 >>> getitem(array(float64, 1d, C), UniTuple(int64 x 2))

There are 22 candidate implementations:
  - Of which 20 did not match due to:
  Overload of function 'getitem': File: <numerous>: Line N/A.
    With argument(s): '(array(float64, 1d, C), UniTuple(int64 x 2))':
   No match.
  - Of which 2 did not match due to:
  Overload in function 'GetItemBuffer.generic': File: numba/core/typing/arraydecl.py: Line 162.
    With argument(s): '(array(float64, 1d, C), UniTuple(int64 x 2))':
   Rejected as the implementation raised a specific error:
     TypeError: cannot index array(float64, 1d, C) with 2 indices: UniTuple(int64 x 2)
  raised from /home/claire/.virtualenvs/sunmet/lib/python3.8/site-packages/numba/core/typing/arraydecl.py:84

During: typing of intrinsic-call at numba_test.py (11)

File "numba_test.py", line 11:
def _test_int(_input, additional_dimension: int):
    <source elided>

                local_slice = _input[x, dim_idx]

The fact that the code works fine with a tuple and fails with an int feels incoherent to me, does any one have any tips or hints on this behaviour?
(Python==3.8.5, numba==0.52.0, numpy==1.19.4)
Thanks.

@mathisc thank you for asking about this on the Numba issue tracker. The problem here is that Numba isn't interpreted. So the error you are seeing is not actually during execution or runtime (i.e. the if branch isn't even being executed yet). Numba will try to do type inference based on the type of input_, it will see that this is a 1D array, then it will look for uses of _input and see that you are trying to index into a 1D array with a tuple. This doesn't make any sense and so Numba yields the error message above. My suggestion would be to make two Numba njit compiled functions, one for 1D arrays and one for 2D arrays. Then check the  dimensionality of your array and then decide on which Numba function to call.
Hope this makes sense and helps?

I should add that _test_tuple_jitted(data_simple, (0,)) will also fail. So, both test_* functions will fail if presented with a 1D array as input.

Arg, this is an error of me trying to reproduce my issue (I indeed wanted to run _test_tuple_jitted(data_simple, (0,)) but I mistakingly run _test_tuple_jitted(data_complete, (0,))). Also in the actual code I wasn't using (0,) but a true empty tuple. Sorry about that, please find another snippet below that works with with tuples but not an int :
from numba import njit, prange
import numpy as np

@njit()
def _test_int(_input, additional_dimension: int):
    for x in prange(_input.shape[0]):
        if additional_dimension > 0:

            for dim_idx in prange(0, additional_dimension):

                local_slice = _input[x, dim_idx]
                # Do some specific treatement here
        else:
            local_slice = _input[x]
            # Do some other treatement here

@njit()
def _test_tuple(_input, additional_dimension: tuple):
    """Same function as above but addtional_dimension is a tuple"""
    for x in prange(_input.shape[0]):
        for y in prange(_input.shape[1]):
            for z in prange(_input.shape[2]):

                if len(additional_dimension) != 0:
                    for dim_idx in prange(0, additional_dimension[0]):

                        local_slice = _input[x,y,z,dim_idx]
                        # Do some specific treatement here
                else:
                    local_slice = _input[x,y,z]
                    # Do some other treatement here

np.random.seed(2021)
data_simple = np.random.random((10,9,8))
data_complete = np.random.random((10,9,8,2))

# Executions :
# OK
_test_tuple(data_complete, (2,))
# OK
_test_tuple(data_simple, tuple())
# OK
_test_int(data_complete, 2)
# KO : why the if branching does fail here?
_test_int(data_simple, 0)

Indeed, this is an error of me trying to make a snippet reproduce the behaviour I am seeing : I indeed wanted to run _test_tuple_jitted(data_simple, (0,)) but I mistakingly run _test_tuple_jitted(data_complete, (0,))). What's more in the actual code I wasn't using (0,) but a true empty tuple.
Sorry about that, please find another snippet below that actually reproduces the behaviour I am talking about :
from numba import njit, prange
import numpy as np

@njit()
def _test_int(_input, additional_dimension: int):
    for x in prange(_input.shape[0]):
        if additional_dimension > 0:

            for dim_idx in prange(0, additional_dimension):

                local_slice = _input[x,dim_idx]
                # Do some specific treatement here
        else:
            local_slice = _input[x]
            # Do some other treatement here

@njit()
def _test_tuple(_input, additional_dimension: tuple):
    """Same function as above but addtional_dimension is a tuple"""
    for x in prange(_input.shape[0]):
        if len(additional_dimension) != 0:
            for dim_idx in prange(0, additional_dimension[0]):

                local_slice = _input[x,dim_idx]
                # Do some specific treatement here
        else:
            local_slice = _input[x]
            # Do some other treatement here

np.random.seed(2021)
data_simple = np.random.random((10))
data_complete = np.random.random((10,2))

# Executions :
# OK
_test_tuple(data_complete, (2,))
_test_tuple(data_simple, tuple())

# KO
#_test_int(data_complete, 2)
#_test_int(data_simple, 0)

@mathisc thank you for updating your question. Just to make sure we are aligned:
_test_int(data_complete, 2) <--- this works
_test_int(data_simple, 0) <--- this doesn't

@mathisc I am not sure exactly why this example works for tuple. I think it is because the length of the tuple is not known at typing time, whereas the value of an integer may be literal and may be known at typing time. So with an int as parameter Numba can reject the function outright, but with a tuple it needs to partly execute before it can determine which branch to take.
@stuartarchibald do you concur?

On my side, neither of the _test_int methods work, but both of the _test_tuple calls are working fine on my side.
This feels weird as they basically do the same kind of branching.
Given your explanations above, what actually puzzles me really is that :
_test_tuple(data_simple, tuple())  works like a charm.

@esc yes, it's essentially that Numba "sees" the type of the tuple as "tuple with X things in it", and so at compile time len(<some tuple>) can be resolved to a constant X, the branch pruning algs then kick in and remove unreachable code based on constants they can work out. In the case of an integer input, Numba just sees the type as "it's some integer" and so cannot specialise further (without doing something complicated to tell it to do this). This is to prevent creating a new version of the function being compiled for every value of integer provided.

@esc @stuartarchibald thanks a lot of the clarification.
Would you consider this to be a "valid and sustainable trick" or would you recommend to split the code into 2 functions depending on the branching ?

@esc @stuartarchibald thanks a lot of the clarification.
Would you consider this to be a "valid and sustainable trick" or would you recommend to split the code into 2 functions depending on the branching ?

No problem. Numba uses it internally, and there's compiler passes on the default compilation pipelines to ensure this behaviour works. It was originally designed in part to deal with the common pattern:
def foo(n, x=None):
  if x is None:
    x = np.empty(n)
  #... do work with `x`

Thanks a lot guy ;)

Thanks a lot guys!

@mathisc no problem, thank you for using Numba.

authors: esc mathisc stuartarchibald


text:
Setting array elements with a[:] = 1 syntax silently fails in parallel

Reporting a bug

[x] I have tried using the latest released version of Numba (most recent is
visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
[x] I have included a self contained code sample to reproduce the problem.
i.e. it's possible to run as 'python bug.py'.

Setting all elements of an array with the arr[:] = 1 syntax doesn't seem to work if there is a previous increment statement, and the function is compiled with parallel=True.  Here's an example:
import numpy as np
import numba

@numba.njit(parallel=True)
def increment_then_set(a):
    a += 1
    a[:] = 3

x = np.ones(1)
increment_then_set(x)
print(x)  # expect 3, get 2

Interestingly, numba warns me that no parallel transformations were possible, so I wouldn't expect it to have done anything to the code, but it still seems to introduce the bug!
I saw there were some related-looking parallel bugs in the issue tracker that were fixed by #7171, so I tested on that branch, and it still seems to exhibit the bug (master too).

Thank you for reporting the issue. I can confirm that on #7171 and on master (0c499bfff)

Also fails (might just be a trivial transformation that numba is doing internally in the first example anyway):
import numpy as np
import numba

@numba.njit(parallel=True)
def increment_then_set(a):
    a += 1
    for i in numba.prange(len(a)):
        a[i] = 3

x = np.ones(1)
increment_then_set(x)
print(x)  # expect 3, get 2

authors: lgarrison sklam


text:
Also rewrite trivial array expressions

Simple non-nested array expressions need to be rewritten in order to enable scalar optimizations on them.  For example, this PR speeds up x ** 3 on arrays by 100x.

[Current coverage][cc-pull] is 87.26%

Merging [#1985][cc-pull] into [master][cc-base-branch] will decrease coverage by <.01%

@@             master      #1985   diff @@
==========================================
  Files           303        303
  Lines         53992      54062    +70
  Methods           0          0
  Messages          0          0
  Branches       5576       5579     +3
==========================================
+ Hits          47123      47179    +56
- Misses         5950       5960    +10
- Partials        919        923     +4

Powered by Codecov. Last updated by [b8eed30...6990217][cc-compare]
[cc-base-branch]: https://codecov.io/gh/numba/numba/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/numba/numba/compare/b8eed30b6cc561631dfcc021c52c77230287654a...6990217b6f05fbf5d56aa60419507a1ab1258fe4?src=pr
[cc-pull]: https://codecov.io/gh/numba/numba/pull/1985?src=pr

authors: codecov-io pitrou


text:
Link to read the docs instead of numba homepage

Hi everyone :-)
I just noticed that the links in the project readme were still pointing to the documentation hosted on pydata.org, which seems to be out of date.
According to my understanding readthedocs is now the preferred choice, so I just updated the links.
A minor question is if the link should point to /latest or to a different tag.
Cheers!

A minor question is if the link should point to /latest or to a different tag.

Good question, suggest stable, from the page headers:
https://numba.readthedocs.io/en/stable/ - reports 0.51.2
https://numba.readthedocs.io/en/latest/ - reports 0.53.0dev0

Thanks for the patch and fix up. Looks good!

You're welcome :) And thanks for the review!

authors: HPLegion stuartarchibald


text:
Move creation of mpm to optimize_final_module

Fixes #9646

Thanks for the patch @yashssh. Please could you add a release note to accompany this patch (instructions are here along with examples from other PRs in the directory above: https://github.com/numba/numba/blob/f3665c45463ce9ef561dfa10d6bff27079524862/docs/upcoming_changes/README.rst?plain=1#L1-L47)? I think this is an "improvement" type of change. Many thanks!

Thanks for the review @stuartarchibald! I have added the release notes and addressed the comments.

I'm just going to close and reopen this to trigger a rebuild on RTD now that #9675 resolved the issue.

@yashssh I think that this branch is going to need to have numba:main merged in to pick up the changes in #9675 so that RTD will build.

Are you suggesting to rebase my branch on top of main?

Are you suggesting to rebase my branch on top of main?

I suggest merging HEAD (currently 99f5cc6) of numba:main into this branch. If you do a rebase all the commit SHAs change and github sometimes struggles to track comments/review across such a change, which can then result in having to do a re-review of the entire PR. Thanks!

authors: stuartarchibald yashssh


text:
Passing options via dotnet test -- [additional arguments] doesn't work

Example:
> dotnet test -- "--timeout=30000"
...
NUnit .NET Core Runner 3.4.0
Copyright (C) 2016 Charlie Poole
Invalid argument: --timeout=30000
SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.

Timeout does not currently work in the .NET Core/PCL build of the NUnit framework because the required threading libraries were not available when it was written. That will hopefully be rectified when we release the CSPROJ version of the .NET Core runner, but it will not be updated in this tool because this adapter will no longer work with VS 2017 or the new CSPROJ .NET Core tooling.

authors: bcuff rprouse

repo: nunit/dotnet-test-nunit


text:
Add a rule disallowing the usage of global helper functions that depend on a booted application

[x] Added or updated tests
[x] Documented user facing changes
[x] Updated CHANGELOG.md

Changes
Except for a small subset of functions, most of the global helpers in laravel are dependent in some way or another on the state of a booted application. And while these functions are convenient ways to shorten the amount of code you have to write, they couple your code with the Laravel codebase. And furthermore, they decrease the testability of your codebase. This rule prevents the usage of those specific coupled helper methods, while still allowing usage of the other functions that don't rely on a booted application. for more information, see this blog post.
Breaking changes
Rule is disabled by default so this won't break anything

@canvural @szepeviktor Any idea how I can fix the test run running out of memory?

a shot in the dark: what if you use FunctionTypeSpecifyingExtension?
https://github.com/nunomaduro/larastan/blob/e67a1b09fc8da255f991e52b0cd29c9ac3565a28/src/Types/AbortIfFunctionTypeSpecifyingExtension.php#L16

@szepeviktor @canvural I found the source of the memory increase. As the now() and today() function calls are resolved using the  DateExtension, and that date extension actually calls the now() function, the memory increases by 50mb as a container is resolved. As the idea is probably that the dateExtension is returns the correct type even if the function is overwritten, I can't really fix that. Is there something I can do here to solve this?

Maybe I am the only conservative around here but no feature is worth adding an extra half gigabyte memory.
@canvural Could we free up memory by removing something from the app container?

Actually current memory usage (unit tests/static analysis) is so huge I consider them an error.

@szepeviktor I removed my comment within seconds of posting it because I was not entirely sure what was happening. The actual test case adds about 40mb of memory, but more things are going on the second i add any reference to now() or today(), but also the RelationExstinceRule test is failing the moment I add new tests for this rule. I am currently deep in the source code op PHPStan, the current suspect is the static $containers property in the PHPStanTestCase, but I am unsure atm.

So to clarify, I currently have two issues:

Memory increases whenever a new call to now() or today() is added and analyzed by phpstan.
A test execution order issue where the RelationExistenceRule test case is now broken because the newly added test is executed before it.

I was fed up with the memory issue as I wanted to go to sleep, so added the ridiculous new limit to see if my tests are at least passing, but that is not the case. I had a long day, so will continue debugging tomorrow. I suspect right now that part of the fix lies in the way the container is cached based on the sha1 of the additionalConfigFiles but not on the analyzed file set and that pollutes the phpstan container, but have to do some more research on that in the upcoming days.

Memory increases by about 40mb whenever a new call to now() or today() is added and analyzed by phpstan.

Does this happen if you add a reference to Carbon::now() instead?
Phpstan recently had a github issue whereby the Carbon class was adding a lot of overhead to analysis due to the phpdocs present in its traits etc. And I wonder if this is a symptom of that.

@mad-briller Yes, that is also the case.
I spent a couple more evenings on the ordering issue in test, where the newly added tests break tests further on. As it looks right now; As PHPStan is not built te be run on part of the code, the container is cached only based on the additional configuration. As that is the same for all test cases in the folder, the cached container is used for all test cases, but because the individual tests are only run on single files, it doesn't run as expected. I removed the test cases for now. I will further debug the container issues in the phpstan base test case, but it will take a few weeks before I have some more time to do a deep dive.

authors: PrinsFrank mad-briller szepeviktor

repo: nunomaduro/larastan


text:
Added test and extension for file method on Request.

Solves issue #248
This is my first PR, please add constructive feedback instead of just closing. Help me help you.

How do i configure my IDE so that it sorts the import statements in the order as StyleCI wants them? IntelliJ auto sorts them alphabetically, but StyleCI does not seem to like that.

Fell free to re-open this pull request once it's ready.

Ok i never figured it was closed and not merged. Anyway i fixed it. Still needed?

Hi @claystation This is fixed by #695
You can try the latest version of Larastan

Cool cool cool! Keep this pr closed then!

authors: canvural claystation nunomaduro


text:
Why is there a stub error zzz

Summary
Put a summary of the problem here
I create a new Pager, codecrunch says i have a PagerStub and "PagerStub cannot be converted to Pager" like I never made a PagerStub why is this thing here?????
Description
Describe the problem and any details if neceesary
Originally used "this" instead of making a new pager but they're both "PagerStub" or smth what the tiltzzz
Idea s
Describe the approach used (if applicable)
Screenshots (if any):
Insert Images here if necessary

Also like this thing compiles perfectly fine I used javac -Xlink *.java and I didn't see any warnings and jshell doesn't seem to have any complaints either and maybe my style slightly questionable but i'm pretty sure i didn't spawn a new class somewhere in my code someone help pls i'm so confused


text:
[T3A3][W14-A2]Ellango Vesali

Ready for review

Accepting this PR without a review because another of your PRs for this tutorial was reviewed in detail.

authors: mauris vesaliE


text:
Avoid consuming CPU when waiting for input.

When reading input, start by calling event::read, which efficiently blocks until input arrives, rather than polling for input every 100 milliseconds.
This preserves the existing POLL_WAIT polling behavior by moving the poll after the first read call returns.
Fixes #521.

I'm excited to see this. Thanks! Is there some way that once can confirm this is working? I've never see excess CPU so I'm not sure of the procedure exactly.

On Linux, for example, build the basic example, install strace, and then run strace target/debug/examples/basic. Before this PR, you'll see it calling epoll_wait 10 times a second, once it starts up. With this PR, it'll start up and then enter a call to epoll_wait that waits until a key is pressed.

Another way to see this on Linux is the powertop program. Before this PR, powertop shows a running basic example process having about 10 events/sec., which doesn't put it at the top of the list on my system, but it is on the list. With the PR, it's not on the list at all.

The strace trick works as described. I can also see it in powertop as you suggest.
Before

After - i'm guessing these 0.25 events per second are me doing ls twice

authors: fdncred sunfishcode

repo: nushell/reedline


text:
Init nutsdb doc sites by using docusaurus

This PR is related with #557 , details can be found in it.

Because it has been submitted in nutsdb-docs repo, this PR will be closed.

repo: nutsdb/nutsdb


text:
markdownit how to use highlight

i write markdown content.
after $md.render() ：

var a=123
console.log(2323)
println(2323)

highlight is not work,.
my nuxt.config.js:
markdownit: {
    breaks: true,
    linkify: true,
    injected: true,
    langPrefix: "language-"
  },

This question is available on Nuxt community (#c142)

@bookyo did you find a solution?

@bookyo @mmintel I got it working in 3 steps:
After installing markdownit (npm install @nuxtjs/markdownit):
// nuxt.config.js

export default {
    ....
    // 1.) add markdown-it to modules:
    modules: [
        '@nuxtjs/markdownit',
    ],
    css: [
        // 2.) use a style for syntax highlighting
        'highlight.js/styles/github.css'
    ]
    ....
    markdownit: {
      // 3.) use syntax highlighting:
      highlight: function(str, lang) {
        if (lang && hljs.getLanguage(lang)) {
          try {
            return hljs.highlight(lang, str).value
          } catch (__) {}
          return '' // use external default escaping
        }
      }
    },
    ...
}

You can use different styles, check out this list.
It's been working for me so far, so I hope it'll help you too! ☺
That weird highlight method is from the official and original markdown-it docs by the way (https://github.com/markdown-it/markdown-it#syntax-highlighting).

@fulopkovacs I follow the code method you provided and it still doesn't work. How can I solve the problem so that markdown-it can highlight the syntax

@fulopkovacs I follow the code method you provided and it still doesn't work. How can I solve the problem so that markdown-it can highlight the syntax

You can try this
highlight: function (str, lang) {
    if (lang && hljs.getLanguage(lang)) {
      try {
        return '
' +
               hljs.highlight(lang, str, true).value +
               '
';
      } catch (__) {}
    }

    return '
' + md.utils.escapeHtml(str) + '
';
  }

Reference - https://markdown-it.github.io/markdown-it/

I also have issues making highlight.js work with @nuxt/markdown-it.
I want to display formatted code in my article pages whose content comes from an API.
I get the following error when my article page loads: hljs is not defined in _slug.vue.
nuxt.config.js:
const hljs = require('highlight.js');
const axios = require('axios');

const generatedRoutes = async () => {
  try {
    const articleRoutes = await axios.get('http://localhost:1337/articles').then(res => {
      return res.data.map(article => `/blog/${article.slug}`);
    });
    console.log('Generated routes', [...baseRoutes, ...articleRoutes]);
    return [...baseRoutes, ...articleRoutes];
  } catch (e) {
    console.debug(err);
  }
};

module.exports = async () => {
  return {
    /*
    ** Nuxt.js modules
    */
    modules: [
      '@nuxtjs/markdownit',
    ],

    /*
    ** markdownit module configuration
    */
    markdownit: {
      html: true,
      preset: 'default',
      linkify: true,
      breaks: true,
      injected: true,
      highlight: function (str, lang) {
        // ➡ hljs is undefined here ⬅ 😢
        if (lang && hljs.getLanguage(lang)) {
          try {
            return '
' +
                   hljs.highlight(lang, str, true).value +
                   '
';
          } catch (__) {}
        }
        return '
' + md.utils.escapeHtml(str) + '
';
      }
    },
  }
}

_slug.vue:
<template>

      <sp-section>

      </sp-section>

</template>

@ChucKN0risK
Hmmm, are you sure that you need to import hls from highlight.js in _slug.vue? I took a quick glance at my repo, and I imported it only in nuxt.config.js. I'm still at work, but I'll look into the problem after I finished.

@fulopkovacs No I'm not sure I should import it inside _slug.vue. I only tried because of the error I had telling me that hljs is undefined in _slug.vue 😉

@fulopkovacs Did you have any chance of checking my issue? Thanks in advance ;)

@ChucKN0risK I did look into it, but couldn't find anything in my local setup. I am definitely not an expert (not event a front-end dev by now), but the only thing I can think of is that maybe the markdownit nuxt plugin is not able to display asynchronously fetched content, since it uses markdownit-loader for preprocessing markdown-files (= convert them to html) on the server side. If I were you I'd check out the markdown-it markdown parser (this is actually the library that the markdownit nuxt plugin uses for parsing md). It can be used with highlightjs, and loaded from a cdn if you want to use it in the browser.
Again, I'm not an expert, and I might be wrong about the markdownit nuxt plugin, but I'm pretty sure that the markdown-it library could help you. To be honest,  I'm probably not be the best person to help, since I've never used nuxt in production. I found that Hugo fits my needs a lot better (I use it for my personal blog). Oh, and sorry for the late response, I looked at the problem on the day I first replied, but didn't want to get back to you empty-handed. Time itself could not solve this problem though... 😅

@fulopkovacs Thanks for taking the time to answer me ;) I managed to directly use mardown-it inside my _slug.vue component like so:
export default {
  async asyncData({ app, params }) {
    try {
      const [ article ] = await app.$axios.$get(`http://localhost:1337/articles/?slug=${params.slug}`);
      const content = markdownit({
        html: true,
        preset: 'default',
        linkify: true,
        breaks: true,
        highlight: function (str, lang) {
          return `<pre class="hljs language-${lang}"><code class="language-${lang} ${lang}">${hljs.highlightAuto(str).value}</code></pre>`;
        }
      }).render(article.content);
      return {
        article,
        content,
      };
    } catch (err) {
      return false;
    }
  },
}

My content is fetched and rendered server side ;)

(opened until adding to docs or built-in feature)

repo: nuxt-community/modules


text:
Fix sitemap in production build

Version tested on each mode:

dev
generate
build & start

There are still few improvements to be made, but it works fine ;-)
TODO: we can find a better way to detect if the current command is "build", "start" or "generate".

Nice refactor 💅  For TODO issues, we have to just await for nuxt rc release with powerful tapable hooks :)

I've manually cherry-picked f515b0f as version bump is automatically handled by lerna :)


text:
"https://registry.npmjs.org/@nuxthub/core": 404 Not Found

Describe the bug
Cannot install package because it is not published (anymore ?) in npmjs :
https://www.npmjs.com/package/@nuxthub/core
npx nuxi module add hub

 ERROR  [GET] "https://registry.npmjs.org/@nuxthub/core": 404 Not Found           19:17:09

  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async $fetch2 (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/shared/nuxi.014dcc7f.mjs:352:15)
  at async resolveModule (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/chunks/add2.mjs:275:22)
  at async Object.setup (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/chunks/add2.mjs:142:15)
  at async runCommand$1 (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/shared/nuxi.f8a4d1b7.mjs:1620:5)
  at async runCommand$1 (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/shared/nuxi.f8a4d1b7.mjs:1639:11)
  at async runCommand$1 (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/shared/nuxi.f8a4d1b7.mjs:1639:11)
  at async runMain$1 (node_modules/.pnpm/nuxi@3.16.0/node_modules/nuxi/dist/shared/nuxi.f8a4d1b7.mjs:1777:7)

Steps to reproduce
npx nuxi module add hub
or
npm i @nuxthub/core
Expected behavior
Install the package

It seems to be related to npmjs or to myself because all packages in npmjs have the same problem.

repo: nuxt-hub/core


text:
fix: send real host to dynamic source endpoint so we can get right sitemap urls in Multi-Tenant System

Try to get right host in danymic source eventhandler and give right right urls back.
It's useful in some saas platform with custom domain support, The sitemap need to be different for each Tenant

Hi @harlan-zw , is this PR useful or anything I need change?

Hi @chenyuncai, thank you for the PR :raised_hands:!
There is one thing I need to investigate before merging this which is blocking it. I believe there is a way to call fetch where it will automatically forward these headers. I think it may be the event.fetch or something.
We should use as it will fix the problem for all use cases not just the host.

Yes, that's right, maybe we should send all headers to self event handler, and only safe headers to third-party sources.
Thanks for your response.

That also does seem reasonable :thinking: I'll have a think during the day and revisit this tonight

Thanks for the PR, I've merged this into 5.2.0 with a minor fix to avoid empty Host headers being passed.

authors: chenyuncai harlan-zw

repo: nuxt-modules/sitemap