text:
Odbc for psql client support

Delete this PR https://github.com/nodeshift/kube-service-bindings/pull/43 after merging the current PR.

@mhdawson I was thinking of adding an if statement between these two lines, for throwing a warning about the file permissions https://github.com/pacostas/kube-service-bindings/blob/58f1ff931f41f50e625e6b06320300048cac475a/utils/index.js#L110-L111 , in case of allowCopy option is to 'false'
if( bindingOptions.hasproperty(path) && bindingOptions.hasproperty(allowCopy) && bindingOptions.allowCopy === false) then throw a warning about not proper permissions

again coverage behaves weird

@mhdawson I was thinking of adding an if statement between these two lines, for throwing the warning about the file permissions https://github.com/pacostas/kube-service-bindings/blob/58f1ff931f41f50e625e6b06320300048cac475a/utils/index.js#L110-L111 , in case of allowCopy option is to 'false' if( bindingOptions.hasproperty(path) && bindingOptions.hasproperty(allowCopy) && bindingOptions.allowCopy === false) then throw a warning about not proper permissions

the implementation is here https://github.com/nodeshift/kube-service-bindings/pull/44/commits/6edd850b7144ebf398e4c7a215dcd45e32604462

source: gharchive/pull-request

repo: nodeshift/kube-service-bindings

license_type: permissive

license_source: github-api


text:
Encountering "ERROR: ICE expected slice sizes" for slice members

Aim
Set a slice-of-slices member property value
Consider the following structs:
struct Property
{
    key : [u8],
    value : [u8],
}

struct JSON
{
    doc : [Property]
}

Let's look at the snippet below.
It does a linear search of key property bytes (eq is an extension method for [u8] provided privately), and looks to set/replace the value property bytes with a local prop instance bytes.
let json = JSON { doc: [] };
let prop = Property { key: [], value:[] };

// .. parse json ..

// .. set the property's key bytes ..
// .. set the property's value bytes ..

// add property to json or replace existing
let len : Field = json.doc.len();
let mut found = false;
for i in 0..len
{
    if (!found)
    {
        if (prop.key.eq(json.doc[i].key))
        {
            json.doc[i].value = prop.value;
            found = true;
        }
    }
}

This code worked fine until  nightly-2023-11-04. From this version onward the error "ICE expected slice sizes" is thrown by the compiler. This is confusing because it is missing contextual information.
The PR that lead to this breaking change is https://github.com/noir-lang/noir/commit/48cf1a7b15a838e928d774af6ab246f84fed2c78
A workaround is to refactor the code: create a copy of the doc property, skip the existing property, push the new property instance in the copy, then re-assign the copy to the initial json instance's doc property:
let mut copy : [Property] = [];
for current in json.doc { if (!prop.key.eq(current.key)) { copy = copy.push_back(current); } }
json.doc = copy.push_back(prop);

Expected Behavior
The code provided should work as it did before nightly-2023-11-04
Bug

Should work as before
The error should include more contextual information until 1 is fixed

To Reproduce
See details in Aim section
Installation Method
Binary
Nargo Version
nargo 0.19.2
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response

@grasshopper47 Do you have a more reproducible example? It would be helpful to see what your extension method eq is doing, as you shouldn't be able to declare impls on non-struct types unless you have it in your own version of the stdlib?
Also in the provided snippet this should not be possible to compile to ACIR as the loop bound that comes from let len : Field = json.doc.len(); is dynamic. I assume you are doing this in an unconstrained function?
I have this program here:
struct Property
{
    key : [u8],
    value : [u8],
}

struct JSON
{
    doc : [Property]
}

unconstrained fn main() {
    let mut json = JSON { doc: [] };
    let mut prop = Property { key: [], value:[] };

    let other_prop = Property { key: [0, 1, 2], value:[10] };
    json.doc = json.doc.push_back(other_prop);

    for i in 0..3 {
        prop.key = prop.key.push_back(i as u8);
    }
    prop.value = prop.value.push_back(5);

    // add property to json or replace existing
    let len : Field = json.doc.len();
    let mut found = false;
    for i in 0..len
    {
        if (!found)
        {
            if (prop.key.eq(json.doc[i].key))
            {
                json.doc[i].value = prop.value;
                found = true;
            }
        }
    }
    assert(found == true);
}

This program successfully executes following this PR (https://github.com/noir-lang/noir/pull/3617).

This program successfully executes following this PR (#3617).

I have pulled this out into the PR here: https://github.com/noir-lang/noir/pull/3634.

@grasshopper47 Yes this is the issue, but this was only just merged into master. On the next nightly and release this should be fixed. The most recent nightly was published 16 hours ago. What version of nargo are you using? I just tested your simple example when building from source and it passes as expected.

@grasshopper47 Yes this is the issue, but this was only just merged into master. On the next nightly and release this should be fixed. The most recent nightly was published 16 hours ago. What version of nargo are you using? I just tested your simple example when building from source and it passes as expected.

I'm getting a bit confused; i thought the change went in via https://github.com/noir-lang/noir/pull/3634, which is already in master. I've built the latest master, with this change in, and the error still happens....

I'm getting a bit confused; i thought the change went in via #3634, which is already in master. I've built the latest master, with this change in, and the error still happens....

When I build from master the error is gone. Are you using noirup to build from source?

Previous comments "deleted"

@vezenovm I'm re-reopening this
Still an issue, please run the code below and check the output
I've included printing to see the actual values in memory
global BEGIN_OBJECT    : u8 = 0x7B; // { left curly bracket
global END_OBJECT      : u8 = 0x7D; // } right curly bracket
global BACKSLASH       : u8 = 0x5C; // \ reverse solidus

global chars =
[
    "\0","\0","\0","\0","\0","\0","\0","\0","\0","\t","\n","\0","\0","\r","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0","\0",
    " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
    "0","1","2","3","4","5","6","7","8","9",
    ":",";","<","=",">","?","@",
    "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
    "[","\\","]","^","_","`",
    "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
    "{","|","}","~"
];

trait ByteArrayExtensions
{
    fn print(self);
}

struct Property
{
    key : [u8]
,   value : [u8]
}

type Object = [Property];

struct JSON
{
    doc : Object
}

impl<SIZE> ByteArrayExtensions for [u8; SIZE]
{
    unconstrained
    pub fn print(self)
    {
        dep::std::println("{");
        for byte in self { let c = chars[byte]; dep::std::println(f"    {c}"); }
        dep::std::println("}");
    }
}

impl Property
{
    unconstrained
    fn print(self)
    {
        dep::std::println(f"key");
        self.key.print();

        dep::std::println("value\n{");

        let mut object = false;
        for byte in self.value
        {
            if (object & (byte != END_OBJECT) & (byte != BACKSLASH))
            {
                dep::std::println(f"        {byte}");
            }
            else
            {
                let c = chars[byte];
                dep::std::println(f"    {c}");

                object = (byte == BEGIN_OBJECT);
            }
        }

        dep::std::println("}");
    }
}

impl JSON
{
    unconstrained
    fn store(mut self, prop : Property) -> Object
    {
        for i in 0..self.doc.len() { self.doc[i].value = prop.value; }

        self.doc
    }
}

#[test]
unconstrained
fn property_key_number_and_key_array_object()
{
    let mut json = JSON { doc: [ Property { key: "a".as_bytes(), value: "1".as_bytes() } ] };
    let mut prop = Property { key: "a".as_bytes(), value:"123".as_bytes() };

    json.doc = json.store(prop);

    for prop in json.doc { prop.print(); }
}

the output is:
{
    1

    a
    1
    2
    3

}
value
{

}

not at all the expected key "a" and value "123" bytes

If this works better as a separate issue, I can open a new one, just let me know what is preferred.

If this works better as a separate issue, I can open a new one, just let me know what is preferred.

This is a separate bug so a new issue would be preferred.

source: gharchive/issue

repo: noir-lang/noir


text:
Add serialisation format of ABIs into JSON

Related issue(s)
Serialisation logic relies on array lengths fitting in a u64 #525
Logic being format used to serialise ABI described in #524
Closes #524
Description
Summary of changes
This PR adds logic to serialise/deserialise circuit ABIs so it can be saved to a JSON file and used elsewhere.
The Abi struct is not suitable for serialising directly (see #524 and #525) so we convert it to an intermediary format and then serialise this instead (this allows us to use the derived serde implementations rather than making the modifications inside a custom implementation).
Storing the ABI in JSON is useful as it makes generating/verifying proofs from TS much more robust. Currently TS users don't get any typechecking on their inputs  to proving/verifying which means they get arcane wasm errors should they update their circuit and forget to update their TS code to match. With this however, we could automatically generate TS bindings for Noir circuits ("typechain for noir") which would avoid these issues.
More generally, this is very useful anywhere you need to generate/verify proofs without having access to the noir source code.
The generation of Prover.toml/Verifier.toml template files was piggybacking on the Deserialize trait so I had to create a new function to create those.
Dependency additions / changes
Added serde_json as a dev dependency to noirc_abi for a test
Test additions / changes
Added a test that we can successfully deserialise a JSON representation of an ABI.
Checklist

[x] I have tested the changes locally.
[x] I have formatted the changes with Prettier and/or cargo fmt with default settings.
[x] I have linked this PR to the issue(s) that it resolves.
[x] I have reviewed the changes on GitHub, line by line.
[x] I have ensured all changes are covered in the description.

Additional context
(If applicable.)

I'm not sure I follow. Even if we say that we're going to receive input from the user as a flattened array of field elements, we still need to expose information on how they should generate that set of field elements.
Let's say I'm running a server which users can send the circuit arguments to and I will generate a proof for them on this circuit, and to do this they need to provide the arguments encoded as an array of field elements. We now need some client-side code which will take structured inputs and flatten it down into this array, otherwise how will the user know the correct order for the arguments, etc?
We could just allow this function to take any input and attempt to flatten it but then we run into potential troubles with misordering of parameters, missing inputs, etc. as mentioned in #524. The client doesn't know that its encoding data incorrectly so the issue will only arise once my server has received the input and is attempting to prove it. To avoid this, we need to tell the client what format of data I'm expecting it to send me in a flattened form.
I can't just send the client the source code and tell it to compute the ABI itself as it's running in the browser so it'll be hard to run nargo on it. It's also unlikely that my server will even store the source code itself as opposed to just the circuit + ABI, realistically I'd compile the program locally and upload the build outputs to avoid bloat.

I thought you wanted to serialise the witness... my bad!
In fact this is not about the values but about the types only, which we need to serialize, because we also serialize the circuit, I do agree with this.
However there were already a serialize method, which if I understand now correctly does not work because of this u128 thing.
You are fixing this by creating an intermediate type which uses u64 instead of the u128 and I don't think it is the proper way to fix this, because indirectly this means we cannot have arrays with u128 length as it will crash if we do.
So either we are able to serialise u128 values or we change the ABI to use u64 directly, not inside an intermediate type.
Note that since we can use integers nearly up to u128 in noir, we should be able to serialize u128 values in any cases.

I'd support lowering array sizes to u64 in general as well. There's no real reason to support array sizes between u64::MAX and u128::MAX. If you're using an application that needs array sizes that big, it's more likely you actually need arbitrary array sizes over u128::MAX as well.

However there were already a serialize method, which if I understand now correctly does not work because of this u128 thing. You are fixing this by creating an intermediate type which uses u64 instead of the u128.

Yes and no, I guess. The current serialize method doesn't create a valid representation of an Abi which could be reversed by the generated deserialize method. If we removed the current serialize method and used the codegened one, then this would be broken by the u128 issue.
That's not the main reasoning behind the intermediate type however. Most of the changes are to ensure that ordering of the fields is maintained through a round of serialization and to make it easier to manipulate for programs which are just using it to validate arguments (I listed these in more detail in #524).
I agree that the mismatch between the accepted types in AbiType and Type aren't a long term solution however I wanted to avoid making changes to the inner workings of the compiler. Depending on how we resolve #525 we can either propagate out the changes to u64 or add a custom serializer for u128 values (however this would have a knock-on effect on any users of the ABI requiring this as well).

We should go for the long term solution and fix #525. I don't really mind if we change the array length to u64 or implement a custom u128 serialiser (because we need it anyway), but since Jake is in favor of the former, I suggest to change to u64.
I don't expect this to be a major change in the inner working of the compiler, let me know if I am wrong and it requires to modify stuff you are not comfortable with.

@TomAFrench this was failing CI since we last touched base, is there anything blocking you on it?

Hey @kevaundray, no blockers on my side. I've had a few things crop up which ate up a lot of my spare time so haven't been able to revisit this before.

Should be good now, the remaining issues will be fixed with #592

Thank you very much @TomAFrench , I've re-requested Guillaume to give this a once over, then we can merge :)

I agree to have the visibility only in the AbiParameter (and be it not optional here!), and not inside the AbiType, where it does not make sense (what means pub a : struct{ b:Field, pub c:Field}? or (private)a : struct{ b:Field, pub c:Field}?).
For the second issue, I am ok with using a Vec (but I wonder why rust can't just serialise a BTreeMap..)

(and be it not optional here!)

This was only to avoid creating yet another new struct to handle struct fields. To be clear, these structs are just glorified helpers for serde to derive the correct (de-)serialiser and wouldn't be used elsewhere so correctness is enforced by Abi and AbiType still. As AbiParameter is being adopted as part of Abi now, we should have specific logic for struct fields now.

For the second issue, I am ok with using a Vec (but I wonder why rust can't just serialise a BTreeMap..)

This is described in #524. This is an issue that won't pop up in Rust but could be very annoying in other languages. The reason for this is that BTreeMap has a well defined ordering for its keys.
This means that the Noir structs
struct orderedStruct {
  a: Field,
  b: Field,
  c: Field
}

struct misOrderedStruct {
  a: Field,
  c: Field,
  b: Field
}

are both represented as the array of witnesses [a_witness, b_witness, c_witness].
However the JSON spec doesn't define a ordering to maps so you could read this into Typescript (where objects/maps use insertion ordering for string keys) and the fields will be ordered in a potentially random order. This makes it much more difficult to perform ABI encoding in TS as on each struct you would have to know to manually check all of its field names and put them in order before continuing the encoding. If we represent structs as arrays in the JSON then it's much easier to go from the ABI to a vector of field elements without potentially transposing any of them.

authors: TomAFrench guipublic jfecher kevaundray


text:
Is all project property entries are relvent?

Is all project property entries are relvent (for example those that are pointed by the arrow in the follwing image).

Most of entries in Advanced tab, like Use of MFC, MSVC Toolset Version, is not used with Emscripten.

authors: aharondavid nokotan

repo: nokotan/VSExtForEmscripten

license: MIT


text:
Search only returns results for certain words

Somehow I cannot get search to find anything except if the query is work or pattern. Other terms like computer, lion and dog do not return any results. Test code is below. None of these terms are stopwords, so I don't understand why no results are found.
var assert = require('assert');
var uuid = require('node-uuid');
var PouchDB = require('pouchdb');
PouchDB.plugin(require('pouchdb-quick-search'));

var text = 'lion';

var db = new PouchDB('test-db');
var obj = {
  _id: uuid.v4(),
  text: text
};

function build(cb) {
  cb();
}

db.put(obj, function (err, res) {
  if (err) console.log(err, res);
  db.get(obj._id, function (err, o) {
    assert(!err && o._id === obj._id);

    var options = {
      query: text,
      fields: ['text'],
    };

    db.search(options, function (err, result) {
      assert(!err);
      assert(result.total_rows > 0);

      build(function (err) {
        assert(!err);

        db.search(options, function (err, result) {
          assert(!err);
          assert(result.total_rows > 0);
        });
      });
    });
  });
});

I have the same problem. Any my search options like
var options = {
query: text,
fields: ['text'],
};
don't work and I always get 0 rows

I am also experiencing this issue

I'm not really actively maintaining this library anymore, but this sounds like almost certainly a bug in Lunr rather than this library. I encourage anybody with the time to look into it and fix it; maybe if I'm lucky, I just need to update the Lunr dep.

@nolanlawson You're right, I upgraded to lunr 0.7.0 and the issue seems to be fixed.

Cool, I'd be happy to accept a PR for the fix. :)

authors: faustlife nchatu nolanlawson npow

repo: nolanlawson/pouchdb-quick-search

license_source: bigquery


text:
Remove unused variables and redundant code in swipeout.js

General code cleanup. This PR does:

Remove self assignment of direction variable in handleTouchMove
Remove unused noFold variable in handleTouchEnd
Remove unused noFold variable in swipeoutOpen
Remove unused noFold variable in swipeoutClose

Merged, thanks

Thanks for your valuable work


text:
Number in a payload delivered as NSString

When I send a notification like this
apn push fcc3551cd74e40d45beb109946a6ca6dc7423e16dd042e2b2aa06f07183d5b8c -c apns-dev-cert.pem -m "Credits" -d credits=100

payload's credits: value is delivered as instance of NSString but not a NSNumber

@intrigua How did you manage to send a JSON payload with push notifications? I am trying to send standard json as a payload from command line, but getting an exception parsing a JSON. @mattt Any help would be much appreciate.

@jayesh15111988 why not just convert the JSON payload to NSNumber or Int on the client and not worry about whether the JSON payload represents the number as a string or integer?

@jdraths My question was not about data type of JSON payload integer vs string. I was just curious to find out how to send JSON data as push payload through Houston.

@jayesh15111988 use -p to send a json payload per this code.
$ apn push "<token>" -c /path/to/apple_push_notification.pem -m "Hello from the command line! " -p {"your_json": "value", "more_json": "more values", "integer": 1}
Not sure if my format is right but it's close.

authors: intrigua jayesh15111988 jdraths

repo: nomad/houston

license: mit


text:
jay を omniauth 2 で動作するようにする

Created from AI0776 of minute 1149.

jay を omniauth 2 で動作するようにする -->(濵本，三宅，山田 !:0776)

#90 の Task Issue です．

omniauth2 の変更点
https://github.com/omniauth/omniauth/releases/tag/v2.0.0

CSRF 対策を行う必要がある

CSRF Token 検証用の Gem を追加
認証ページへのリンクのメソッドを GET → POST に変更する

https://github.com/nomlab/jay/pull/88/commits/ba0eda96349e117a9f7f4e660612590a9b231e07
にて対応

authors: sakamoto-a ymdkit yoshinari-nomura

repo: nomlab/jay


text:
Bug: 启动Bot报错

描述问题：
无法启动bot
C:\Users\Administrator\Desktop\bot\zxmbot>.\bot.py
01-24 03:29:22 [SUCCESS] nonebot | NoneBot is initializing...
01-24 03:29:22 [INFO] nonebot | Current Env: dev
01-24 03:29:22 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 2333, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev'}
01-24 03:29:23 [DEBUG] nonebot | Succeeded to load adapter "OneBot V11"
Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\bot\zxmbot\bot.py", line 23, in <module>
    driver.register_adapter(MIRAI2Adapter)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\drivers\__init__.py", line 111, in register_adapter
    self._adapters[name] = adapter(self, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\adapters\mirai2\adapter.py", line 35, in __init__
    self.mirai_config: Config = Config(**self.config.dict())
  File "pydantic\main.py", line 331, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for Config
mirai_host
  field required (type=value_error.missing)
mirai_port
  field required (type=value_error.missing)
mirai_qq
  field required (type=value_error.missing)

C:\Users\Administrator\Desktop\bot\zxmbot>

期望的结果
A clear and concise description of what you expected to happen.
环境信息：

OS: [Windows 10 x64]
Python Version: [python-3.9.8-amd64]
Nonebot Version: [今天用pip安装的最新版本]

协议端信息：

协议端: [e.g. go-cqhttp]
协议端版本: [e.g. 1.0.0]

截图或日志

If applicable, add screenshots to help explain your problem.

缺少 adapter 要求的相关配置，在对应的 .env 文件中给定 mirai_host mirai_port 和 mirai_qq 的值。


text:
Bot: ShigureBot

机器人名称：
ShigureBot
机器人功能：
给自己的综合性娱乐Bot写的插件集
机器人项目仓库/主页链接：
https://github.com/lgc2333/ShigureBot
标签：
[]

📃 商店发布检查结果

Bot: ShigureBot

✅ 所有测试通过，一切准备就绪!
详情✅ 项目 主页 返回状态码 200.

💪 Powered by NoneBot2 Publish Bot


text:
Draft - Node 20.9.0 upgrade

Explain the changes

Upgrade to nodejs 20.9.0
google_cloud.storage.nodejs-common.Util.getUserAgentFromPackageJson no longer exported. Currently commented out.
net-ping/nan - too old. Has drop-in replacement draft in net_utils.js.
nan 2.18.0 - has compiliation warning, had to remove -Werror in gyp. https://github.com/nodejs/nan/issues/953.
encryption tests - namespace creation uses same bucket, for some reason doesn't fail on node18.

Some more deatils on 2-4: https://docs.google.com/document/d/1uDgFDP2_2TYWEwBn5JtjLcStjOmeqYzBwTctY0pRfsc/edit?usp=drive_link
Some more details on 5: https://noobaa.slack.com/archives/C0NSK9ZNE/p1700419078270099
Issues: Fixed #xxx / Gap #xxx

Newer nodejs version.

Testing Instructions:

make tests

[ ] Doc added/updated
[ ] Tests added

Hi @alphaprinz
Thanks for this PR 🙂
Please divide it into several PRs.

The modules upgrade should be in a separate PR, prior to this one.
The modules that require node 20 (are there any?) should be with this PR.
The replacement of net-ping/nan should also be a separate PR, prior to this one.

Then, and only then we should have the bump to node 20.
This is to prevent backporting issues to previous branches, and downstream issues.
One more question:

Does this node version bump the major version of NPM from 9 to 10?
If it does, we need to make sure that the downstream builds can handle it, by asking @b-ranto to create a private build from this branch.

The downstream build passed.

Will be split into separate PRs.

authors: alphaprinz b-ranto liranmauda

repo: noobaa/noobaa-core


text:
Gulp tasks not being found

I have a gulpfile.js in the correct location with two tasks. The Ctrl-Alt-T view, however, tells me no build configurations can be found.
After some console.logging I found the following: My gulpfile.js is detected, so isEligable passes and it is being required. However, I placed console.log({ tasks: Object.keys(gulp.tasks) }); at the end of my gulpfile.js and in gulp-parser-task.js right after the require, which logged 2 and 0 tasks respectively.
My best bet is that either gulp has weird scoping issues, or something is wrong with the Task stuff atom-build does.

What OS are you on? What version of Atom?
There are tests which cover this functionality. Do they work in your environment?

Same here. Only the custom .atom-build.json task works. Neither package.json or gulpfile.coffee is detected. :disappointed:

gupfile.coffee support was introduces in c2f6e95c4945dee832a176f98610409127f3d60c, which is not part of a release yet. Please try again on master (or wait for v0.40.0 which shouldn't be too far off).

I made it work with package.json target (I was missing the "engines" field), but now it only runs npm install, which only invokes the "postinstall" script.
Shouldn't it instead run npm test or something that actually triggers all builds? "postinstall" is used only for compiling native libraries.
In summary, more sane behaviour would be to:

default to node when "engines" field is missing
run npm test or both npm install && npm test upon build

Well, test is one thing, build is another. I think what build is currently doing when it finds a  package.json is what most would expect. If there is anything else that should be done as part of the build, postinstall can be used as you so accutely pointed out.
I'm not sure what you mean with "default to node" ? Node wouldn't be able to do anything with the package.json file.
And as I said in previous comment. gulpfile.coffee will be supported in next version.

authors: Mesoptier noseglid phaux

repo: noseglid/atom-build


text:
getHot() method returns two items over the limit

My code:
require("dotenv").config();
const Snoowrap = require("snoowrap");

const r = new Snoowrap({
  userAgent: process.env.USER_AGENT,
  clientId: process.env.CLIENT_ID,
  clientSecret: process.env.CLIENT_SECRET,
  username: process.env.REDDIT_USER,
  password: process.env.REDDIT_PASS
});

const queryOptions = {
  limit: 4
};

r.getSubreddit("reactjs")
  .getHot(queryOptions)
  .then(posts => posts.forEach(post => console.log("hot -", post.title)));

r.getSubreddit("reactjs")
  .getNew(queryOptions)
  .then(posts => posts.forEach(post => console.log("new -", post.title)));

r.getSubreddit("reactjs")
  .getRising(queryOptions)
  .then(posts => posts.forEach(post => console.log("rising -", post.title)));

Output:
new - What is the point of server side rendering?
new - Can I use Redux `connect` on a React Component with Hooks?
new - What books and web subjects do you recommend other than programming languages?
new - useEffect dependencies, do you lie about them?
rising - Next.js 9.0.7 is the first to include Gzip compression and optimizations from the Google Chrome team
rising - React Redux form Level 0 - Tutorial for beginners
rising - useEffect dependencies, do you lie about them?
rising - Is SSR the way to go?
hot - Beginner's Thread / Easy Questions (September 2019)
hot - Who's Available? [Sept 2019]
hot - Next.js 9.0.7 is the first to include Gzip compression and optimizations from the Google Chrome team
hot - React Redux form Level 0 - Tutorial for beginners
hot - useEffect dependencies, do you lie about them?
hot - Is SSR the way to go?

The endpoint will return stickied posts as well which is not affected by the limit.
Try a Subreddit without stickies and you'll see the limit is correct

Thanks for clarifying!

authors: SpyTec felipeog

repo: not-an-aardvark/snoowrap


text:
Problems with 24/7 script (Code: 400)

Remove all spaces already present in the box.

[x] I have installed the latest version of PyInstaLive: 2.5.1.
[x] I have installed either Python 2.7.x or 3.5>=.
[x] I have read the README.
[x] I have read the FAQ.
[x] I have checked all existing issues, none of which could solve my issue.

I am using:

[ ] Windows 10
[x] Windows 8.1
[ ] Windows 7
[ ] Linux (distribution: )
[ ] macOS (version: )
[ ] Other (device & OS name: )

Command used
cd C:\Users\
:loop
pyinstalive -u "username" -p "password" -r "username_record"
timeout 150 > nul
goto loop

Behavior
I got blocked by IG 2 times in a row using 2 different accounts.  (CODE:400)
Steps to reproduce issue
Account 1: I was using the script with a timeout of 15s, then I got problems so I changed it to 600s. It worked for about 5/6h. (I am recording just 1 user!!!).
Account 2: I created the account in the same IP address and in the same device i'm running PyInstaLive. The script was with a timeout of 150s and worked for 4/5h. (Again, I am recording just 1 user!!!)
I tested the Account 1 on the command prompt (pyinstalive -r "username_record") and its working normally. The code 400 only occurs in the batch.

Question
I read in the FAQ that this error occurs if you're trying to record many users at the same time, or if the timeout is 5s or less. Why is this happening to me?

This isn't an issue with PyInstaLive or the batch script but rather with how Instagram handles spammy-like behaviour and that's something I have no control over.
Your IP and/or device has probably been flagged as suspicious. Making a bunch of requests (such as using a batch script like this) is always risky. The timeout specified in the FAQ is based on my own experience and not a guarantee that it'll work without any problems.
I check about 10 users 24/7 with a 1 minute timeout on most of them with no issues.

Ok. I'll try something diffent and I'll use a 1 minute timeout. Thank you anyway!

authors: notcammy vitoriach

repo: notcammy/PyInstaLive


text:
Add html to generic event details

Add html content for generic message html. This is to support html for the new fusion broadcast that will be generic event details instead of broadcast event details.

Looks good but seems is not yet onprod`. This causes the build fail, shall we merge it after being available.

Yep!

repo: notifi-network/notifi-sdk-ts


text:
ライセンスの追加

ライセンスのないソースコードって実は使えないコード。

自作の依存側にも追加する必要あり

repo: notoiro/voicevox-tts-discord


text:
Serde base64 serialization

Is there a reason our implementation of serde::Serialize and serde::Deserialize are checking for is_human_readable and de/encode with base64 in that case? Otherwise I would propose to remove this completely.

I believe this was added in here: https://github.com/novifinancial/opaque-ke/pull/168
@nitnelave it should not be necessary to include is_human_readable for the serialization and deserialization, right?

I think it's useful to have: if the protocol is implemented on top of a Json API for instance, base64 is often better. If we're talking about raw bytes, then the encoder/decoder will not be human readable.
What's the motivation for removing the check?

This should really be solved by the serializer, not by the library implementing the serialization. See https://github.com/serde-rs/json/pull/557, https://github.com/serde-rs/json/issues/360, https://github.com/dtolnay/request-for-implementation/issues/48 and the culmination: https://crates.io/crates/serde-bytes-repr.
The disadvantages of doing it here means that serializers can't handle their own binary encoding format if they like to, if something else for example is desired then base64, but they are human readable, they loose control or have to do de-serialization under the hood again.
Also removing a dependency is always great 😄.

Well, it does feel like a better solution if we wrap it with the new library. I'm not sure it's gonna be net negative on the dependencies though :) (since the library must depend on base 64, no?)

since the library must depend on base 64, no?

It doesn't, no.

I just realized something: the annotation needs to be in the client code, not in the opake library, right? That would seriously hurt the dev experience, because they suddenly have to know about the serde bytes library and to know to add the annotation. Moreover, in some cases there isn't really a place to add that annotation (if you just pass the OPAQUE message to a generic function that just accepts a serializable, for instance).
In order to have both a good default experience and the possibility to cut the dependency for those who care, how about putting the is_human_readable check behind a feature flag that is enabled by default? That way those who care about the dependencies can disable the feature, and the others get the correct behavior by default.
WDYT ?

Don't get me wrong, I'm all about making libraries as convenient as possible, I love going the extra mile too for it. But I think your feedback is at the wrong place.
A consumer has to select the serializer when using our Serde implementation, opaque-ke has nothing to do with the serializer, it only has to give it correct information. Base64 is not correct in this case.
I would argue the problem here is serde-json, it seems you believe that the best user experience is provided if binary data is encoded as base64, you should take it up with them. But from the links I provided you above, it seems they are against it.
What we could do is add it to the serialize and deserialize functions in the high-level API without affecting the Serde implementation. This could also be added behind a crate feature. Personally, I don't think this makes sense, opaque-ke isn't the place to handle serialization preferences.
Anyway, ultimately this is @kevinlewi decision, I'm happy to implement whatever decision we reach here, even if I disagree.

Right, after looking a bit more into this, I see that the problem is better handled by the serializer.
It's just a bit of a shame then that many web crates make it very easy to use the default Json but a bit harder to use anything else. Oh, well, that's life :)

authors: daxpedda kevinlewi nitnelave

repo: novifinancial/voprf


text:
feat: automatic rubygem release

This PR setup a github action workflow process for publishing this SDK to RubyGems.org on New Tagged Release.
What to do:

Get API key from RubyGems.org dashboard and add this variable to the env secrets: RUBYGEMS_AUTH_TOKEN.
Set the neccessary workflow permissions in the repository settings.

I just added the RUBYGEMS_AUTH_TOKEN secret to this repo.
There are a couple of things we might have to change. Since this is merged, it means a new PR will need to be submitted to effect this change.

The value of name in the release.yml should be more descriptive like this  Publish new Novu Ruby SDK release to Ruby Gems
I looked at the steps in the release.yml file. And it is in this manner:

A step to set up ruby
A step to run tests
A step to publish gem: This section creates a credentials file, appends our rubygems API to the file, builds the gemspec, and then publishes the gem. The first question I have is: How does it know the exact version, e.g v1.0.5 to publish as the version of the gem? Does it get it from the gemspec? Where does the number come from?

I think we also need a step to get the latest version of the GitHub tag of the repo. Something like this:
- name: Get the release version
      id: get_version
      run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT

And then we need a step to set the version as the gem version to publish: ${{ steps.get_version.outputs.VERSION }} to rubygems.
This is my assumption @Eazybright @Cliftonz. So how do we accomplish this? Because it's necessary.

This is a similar release workflow on another Novu SDK: https://github.com/novuhq/novu-java/blob/main/.github/workflows/maven-publish.yml

I just added the RUBYGEMS_AUTH_TOKEN secret to this repo.
There are a couple of things we might have to change. Since this is merged, it means a new PR will need to be submitted to effect this change.

The value of name in the release.yml should be more descriptive like this  Publish new Novu Ruby SDK release to Ruby Gems
I looked at the steps in the release.yml file. And it is in this manner:

A step to set up ruby
A step to run tests
A step to publish gem: This section creates a credentials file, appends our rubygems API to the file, builds the gemspec, and then publishes the gem. The first question I have is: How does it know the exact version, e.g v1.0.5 to publish as the version of the gem? Does it get it from the gemspec? Where does the number come from?

I think we might need a step to get the latest version of the GitHub tag of the repo. Something like this:
- name: Get the release version
      id: get_version
      run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT

And then we need a step to set the version as the gem version to publish: ${{ steps.get_version.outputs.VERSION }} to rubygems.
This is my assumption @Eazybright @Cliftonz. So how do we accomplish this? Because it's necessary.

RubyGems uses the configuration in the novu.gemspec file to determine the release version.
There's also a version file in the SDK lib/novu/version.rb but it's not being used at the moment.
@unicodeveloper

@unicodeveloper a PR has been raised: https://github.com/novuhq/novu-ruby/pull/46

authors: Eazybright unicodeveloper

repo: novuhq/novu-ruby


text:
Disabling/configuring loading spinner

Is your feature request related to a problem? Please describe.
I want to disable loading spinner, especially in production. This is especially important to me because this spinners usually is shown on language change. In my case language is part of url, so language change actually changes route. I don't want to show loading spinner, especially on language change.
Describe the solution you'd like
We could add a way to disable spinner, maybe a flag to static.config.js? I would be also nice to allow to configure spinner. Right now it is an blue spinner on a blank page. Not only it should be possible to provide own spinner implementation, but also I guess it should be possible to inject in anywhere, so it doesn't override the whole page
Describe alternatives you've considered
I tried to use  minLoadTime: 0 in static.config.js, but it would be kind of cheating which doesn't work anyway.
Additional context
n/a

In v6 you can configure the spinner on Routes, SiteData and RouteData with the Loader prop. Unfortunately this is undocumented and will be removed next version on favor of suspense. So proceed with caution.
Tanner Linsley
On Mar 21, 2019, 3:31 PM -0600, Konrad Lisiczyński notifications@github.com, wrote:

Is your feature request related to a problem? Please describe.
I want to disable loading spinner, especially in production. This is especially important to me because this spinners usually is shown on language change. In my case language is part of url, so language change actually changes route. I don't want to show loading spinner, especially on language change.
Describe the solution you'd like
We could add a way to disable spinner, maybe a flag to static.config.js? I would be also nice to allow to configure spinner. Right now it is an blue spinner on a blank page. Not only it should be possible to provide own spinner implementation, but also I guess it should be possible to inject in anywhere, so it doesn't override the whole page
Describe alternatives you've considered
I tried to use minLoadTime: 0 in static.config.js, but it would be kind of cheating which doesn't work anyway.
Additional context
n/a
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@tannerlinsley thx, I did the following: const Loader = () => null; It works, but ideally what I would like to have is not to show loader at all in some cases. So lets say I am on route /en/about-us and I switch language so I push new route /pl/about-us . Is it or will it be possible to just keep /en/about-us visible and switch /pl/about-us when it is available? Or to rephrase, to disable loader, not to make it blank.

What you’re describing is suspense 😉. Back in v4, we did routing in a similar way. We monkey patched and delayed actual page navigation until the data and template were resolved. While this looked like suspense, it was far from it and produced a TON of bugs. This is why we moved to the new fallback/loader strategy.
So, even if you were to disable or render a blank loader, react will still attempt to load the new page and you’ll see a splash of white until the data/template resolve. There isn’t much we can do here until async react and true suspense ship.
HOWEVER, there is another remedy to your problem. React Static will not show a loader if the data has already been preloaded. If you can detect early which language they are switching to, you might be able to call await prefetch('/lang/page’). When that promise resolves, it means any navigation to it will be immediate and not show a loader.
I hope this is making more sense.
Tanner Linsley
On Mar 22, 2019, 3:48 AM -0600, Konrad Lisiczyński notifications@github.com, wrote:

@tannerlinsley thx, I did the following: const Loader = () => null; It works, but ideally what I would like to have is not to show loader at all in some cases. So lets say I am on route /en/about-us and I switch language so I push new route /pl/about-us . Is it or will it be possible to just keep /en/about-us visible and switch /pl/about-us when it is available? Or to rephrase, to disable loader, not to make it blank.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@tannerlinsley thx for detailed answer. I cannot wait for true async React, especially on server side.
In the meantime I will do the following. The problem is that I pass language to data to every component, like in #475 . Maybe I could use createSharedData because actually each component  will have exactly the same data apart from language, because I use i18next for translations. So this would solve all data props apart from language. And I was just enlightened that I don't really need to have language passed as data, because I can read it from path with React router. So then I won't have spinner because no new data will need to be fetched on lang switch :)

Perfect :) That’s a much better solution for now.
Hopefully in v7 we can figure out the right plugin points for this and just make it plug and play.
Tanner Linsley
On Mar 22, 2019, 7:13 AM -0600, Konrad Lisiczyński notifications@github.com, wrote:

@tannerlinsley thx for detailed answer. I cannot wait for true async React, especially on server side.
In the meantime I will do the following. The problem is that I pass language to data to every component, like in #475 . Maybe I could use createSharedData because actually each component will have exactly the same data apart from language, because I use i18next for translations. So this would solve all data props apart from language. And I was just enlightened that I don't really need to have language passed as data, because I can read it from path with React router. So then I won't have spinner because no new data will need to be fetched on lang switch :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

:+1:  thx again and I am sure this library is gonna be even more awesome than it is now. I also considered Gatsby but I don't really wanna use graphql for not remote stuff. I am sure that with future react with the possibility to pause and stop rendering will allow us to make such a flexible and simple plugin API which could be used for anything, including plug and play i18next.

@tannerlinsley apologies for asking here as it seems already closed, but I have a weird issue where the loader div just wraps around the first div element on the page (that happens after building and on page refresh). Its a bit annoying because it breaks mostly the page layout, so my question would be how I can disable the Loader and if it's possible to configure it (you mentioned above that is configurable but not documented).
Thanks in advance.

authors: klis87 pauloamgomes tannerlinsley

repo: nozzle/react-static


text:
react static basic the home link on nav broken and shows no logo, blog just loads

The react static basic the home link on nav broken and shows no logo, blog just continually loads

Are there any errors in the console?

Uncaught (in promise) TypeError: (0 , _reactStatic.getSiteProps) is not a function
at Object.eval (webpack-internal:///../../../../src/containers/Home.js:27)
at eval (webpack-internal:///../../../../src/containers/Home.js:57)
at Object.../../../../src/containers/Home.js (0.app.5149c7a9.js:7)
at webpack_require (app.5149c7a9.js:708)
at fn (app.5149c7a9.js:113)
at

I can't reproduce this on a clean install. Please provide more details on
how to replicate what you are experiencing.
On Mon, Feb 26, 2018 at 8:08 PM John Blakley notifications@github.com
wrote:

Uncaught (in promise) TypeError: (0 , _reactStatic.getSiteProps) is not a
function
at Object.eval (webpack-internal:///../../../../src/containers/Home.js:27)
at eval (webpack-internal:///../../../../src/containers/Home.js:57)
at Object.../../../../src/containers/Home.js (0.app.5149c7a9.js:7)
at webpack_require (app.5149c7a9.js:708)
at fn (app.5149c7a9.js:113)
at
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/nozzle/react-static/issues/416#issuecomment-368732032,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCfVsZkUptonogZ90kFR9aBuAD55Eks5tY3GvgaJpZM4ST10A
.

authors: inventanew tannerlinsley


text:
Getting Build time Error, Reference Error: Element is not defined

brahmaforces@brahmaforces:~/websites/test-site$ react-static build --staging --debug
DEBUG - Resolved static.config.js:
{ entry: '/home/brahmaforces/websites/test-site/src/index.js',
getSiteData: [Function: getSiteData],
renderToHtml: [Function: renderToHtml],
prefetchRate: 3,
disableRouteInfoWarning: false,
disableRoutePrefixing: false,
outputFileRate: 10,
getRoutes: [Function],
paths:
{ ROOT: '/home/brahmaforces/websites/test-site',
LOCAL_NODE_MODULES: '/home/brahmaforces/.nvm/versions/node/v8.9.4/lib/node_modules/react-static/node_modules',
SRC: '/home/brahmaforces/websites/test-site/src',
DIST: '/home/brahmaforces/websites/test-site/dist',
PUBLIC: '/home/brahmaforces/websites/test-site/public',
NODE_MODULES: '/home/brahmaforces/websites/test-site/node_modules',
PACKAGE: '/home/brahmaforces/websites/test-site/package.json',
HTML_TEMPLATE: '/home/brahmaforces/websites/test-site/dist/index.html',
STATIC_DATA: '/home/brahmaforces/websites/test-site/dist/staticData' },
siteRoot: '',
stagingSiteRoot: '',
basePath: '',
stagingBasePath: '',
devBasePath: '',
extractCssChunks: false,
inlineCss: false }
=> Info: No 'siteRoot' is defined in 'static.config.js'. This is suggested for absolute url's and a sitemap.xml to be automatically generated.
=> Copying public directory...
=> [✓] Public directory copied: 15.434ms
=> Building Routes...
=> [✓] Routes Built: 16.497ms
=> Bundling App...
=> [✓] App Bundled: 37073.420ms
=> Fetching Site Data...
=> [✓] Site Data Downloaded: 0.173ms
=> Fetching Route Data...
=> [========] 8/8 100% 8000/s 0.0s
=> [✓] Route Data Downloaded: 5.298ms
=> Exporting Route Data...
=> [✓] Route Data Exported: 1.051ms
ReferenceError: Element is not defined

uikit.js:432
[test-site]/[uikit]/dist/js/uikit.js:432:19

uikit.js:4 ref
[test-site]/[uikit]/dist/js/uikit.js:4:85

uikit.js:7 Object.
[test-site]/[uikit]/dist/js/uikit.js:7:2

module.js:643 Module._compile
module.js:643:30

module.js:654 Module._extensions..js
module.js:654:10

node.js:152 Object.require.extensions.(anonymous function) [as .js]
[lib]/[react-static]/[babel-register]/lib/node.js:152:7

module.js:556 Module.load
module.js:556:32

module.js:499 tryModuleLoad
module.js:499:12

module.js:491 Function.Module._load
module.js:491:3

module.js:587 Module.require
module.js:587:17

Are you reporting a bug?

Is this a feature request?

Environment

react-static -v:
node -v:
yarn --version or npm -v:
Operating system:
Browser and version (if relevant):

Steps to Reproduce the problem
Base your steps off of any freshly installed react-static template!

...
...
...

Expected Behavior

Reproducible Demo

This is likely an issue with uikit relying on document or window during SSR. Try guarding the import with a typeof document !== 'undefined' condition.
https://react-static.js.org/docs/concepts/#writing-universal-node-safe-code

authors: brahmaforces tannerlinsley


text:
compile node_modules with bare minimum too

as a general exclude on node_modules doesnt seem to be a good idea, we compile them too (but with a bare minimum of features). the idea is inspired by CRA https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/config/webpack.config.prod.js#L313-L353
Description
separate babel loaders for SRC and NODE_MODULES
Changes/Tasks

[x] Changed code

Motivation and Context
to be able to use external ESM
Types of changes

[ ] Refactoring/add tests (refactoring or adding test which isn't a fix or add a feature)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] My changes have tests around them

@tannerlinsley another attempt of #769 maybe you can give it a try with some external ESM packages too?! it seems to work here (https://github.com/uber/react-map-gl/pull/599 is an outstanding issue, but probably not related)

Sounds good. I tested this and it seems to work with the libraries I had in question so far.

authors: digitalkaoz tannerlinsley


text:
Can't transform packages in memory using node-tar

Just for reference, as talked about in irc.
Getting a package from the interwebz and piping it to a parser, changing its directory structure and then sending it back to the interwebz should be possible:
var request = require("request");
var tar     = require("tar");
var zlib    = require("zlib");

request
  .get("https://nodeload.github.com/dscape-testing/hello-world-flatiron-api/"+
       "tarball/master")
  .pipe(zlib.Gunzip())
  .pipe(tar.Parse())
  .on("entry", function (entry) {
    var path = entry.path && entry.path.split("/");
    if(Array.isArray(path)) {
      path[0] = "package"
      entry.path = path.join("/");
      console.log(entry.path);
    }
    return entry;
  })
  .pipe(tar.Pack({ noProprietary: true }))
  .pipe(zlib.createGzip())
  .pipe(fstream.Writer("output.tar.gz"))

Right now this errors out:
/Users/dscape/Desktop/dev/testing-tar/node_modules/tar/lib/pack.js:137
  Object.keys(entry.props).forEach(function (k) {
         ^
TypeError: Object.keys called on non-object
    at Function.keys (native)
    at Pack._process (/Users/dscape/Desktop/dev/testing-tar/node_modules/tar/lib/pack.js:137:10)
    at Pack.add (/Users/dscape/Desktop/dev/testing-tar/node_modules/tar/lib/pack.js:66:8)
    at Pack.<anonymous> (/Users/dscape/Desktop/dev/testing-tar/node_modules/tar/lib/pack.js:42:8)
    at Pack.EventEmitter.emit (events.js:93:17)
    at Parse.Stream.pipe (stream.js:112:8)
    at Parse.Reader.pipe (/Users/dscape/Desktop/dev/testing-tar/node_modules/tar/node_modules/fstream/lib/reader.js:238:32)
    at Object.<anonymous> (/Users/dscape/Desktop/dev/testing-tar/index.js:19:4)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)

Bummer :u5272:

This would be awesome.

This can be done in 3.1, because ReadEntry objects can be added to a Pack stream.
Here's some example code:
const tar = require('tar')
const Pack = tar.Pack
const Parse = tar.Parse
const fs = require('fs')

// the tarball input, creating just for the example
tar.c({
  file: 'input.tar',
  sync: true
}, ['mutate-tarball.js', 'README.md'])

// check that it has what we expect
// outputs:
// mutate-tarball.js
// README.md
tar.t({
  file: 'input.tar',
  sync: true,
  onentry: entry => console.log(entry.path)
})

// input stream can come from anywhere
const inputStream = fs.createReadStream('input.tar')

// packer
const packer = new Pack()

// parser
const parser = new Parse()
parser.on('entry', entry => {
  entry.uid = 999
  entry.uname = 'superman'
  packer.add(entry)
})
parser.on('end', _ => packer.end())

const outputStream = fs.createWriteStream('output.tar')
packer.pipe(outputStream)

inputStream.pipe(parser)

// verify on finish
outputStream.on('finish', _ => {
  const spawn = require('child_process').spawn
  spawn('tar', ['tvf', 'output.tar'], { stdio: 'inherit' })
})

Output:
$ node mutate-tarball.js
mutate-tarball.js
README.md
-rw-r--r--  0 superman 20        980 May 12 09:50 mutate-tarball.js
-rw-r--r--  0 superman 20      33485 May 12 09:42 README.md

authors: dscape isaacs rmg

repo: npm/node-tar

license: isc


text:
fix(header): npm expansions that push the other menu items into place instead of coincidentally working

The max-width of 650px was chosen to fit our current font and current words -- any additions would be disruptive to the header, causing wrapping. this gives a bit more breathing room by making all the flexes play together.

discussed this and paired with @aredridel on it. Definite 🐑

authors: aredridel jefflembeck

repo: npm/pivotal-ui


text:
Sharecard description can be truncated by a <u> or <a>

If there's a tag within the first <p> of a liveblog post (such as a hyperlink), then its sharecard text will only contain the <p>'s contents up until that point.
Eg: https://apps.npr.org/liveblogs/20181106-elections/sharecard/key-ballot-initiatives-to-watch-64.html renders with <meta name="twitter:description" content="While Washington struggles to find compromise on legislation, there are " />, since the next words are within a <u><a>.

Should be fixed by b409a7a

authors: mileswwatkins thomaswilburn

repo: nprapps/liveblog


text:
🛑 Portfolio is down

In 7a707d2, Portfolio (https://nikhil.engineer/) was down:

HTTP code: 500
Response time: 405 ms

Resolved: Portfolio is back up in c3492b8 after 28 minutes.


text:
Yandex & Mail.ru services

Hi!
Push big russian Yandex and Mail.ru services.

Just to confirm, since I am not familiar with this service.  You've tested it and it works great with your PR?
Once you confirm it is working, I'll merge it.
Referencing https://github.com/nraboy/ng-cordova-oauth/pull/299

Sorry for PR #299 where is incorrect response_type=code. Now works response_type=token fine.
Im recheck api and had tests works fine for this PR. But the mailru required redirect_uri an any url domain match app configure uri domain.

Greate Job @mche Like it the code. 👍  If it's working and after some changes I think this PR can be merged

Thanks @matheusrocha89

Ok, I had inspected the recomendations.

We ready to merge?

Does my comments in README.md are clean? Or may be remove them?

The comments for me are fine. I just remove the comments on the code.

@matheusrocha89 Im sorry but comments in code does needs like for me.

authors: matheusrocha89 mche nraboy

repo: nraboy/ng-cordova-oauth


text:
feat!: add new nrk tv with bg logo

Closes #266

@stefanogden kan du sjekke om det stemmer at logoen blir større? ref diff på filene her

authors: sjurlur skjalgepalg

repo: nrkno/core-icons


text:
Move "View on GitHub" button

Right now we have a "View on GitHub" button on the landing page (index.tsx).  Instead of having a button, let's create a badge that has no effect when hovered.  The badge should be about the same size, but should be above "Forms, reimagined.".  It should be centered, and have a curved border and a white background.  Keep the existing text and logo, but they should be in black, so the colors need to be inverted

lgtm

repo: nsbradford/TalkFormAI


text:
Swift package support

Hi,
I love your project - looks very useful! Would you be open to a PR that makes this project into a Swift Package Manager-compatible package? This would make it easier for me (and presumably others) to integrate your work into our projects. If yes, I would be happy to do the work.

Hello, of course I'd agree to make the file available through SPM, I just never took time to do so and I don't know how it works.

Great! I'll submit a PR very soon and include some information in that. :)

Closing issue in favour of continuing discussion in the PR #2.

authors: aidansteele nst

repo: nst/BinUtils


text:
Gmail issue?

URL issue : https://mail.google.com/mail/u/0/feed/atom
Add-on version: 2.6
i can't have my gmail feed ! it says it can recover the feed !
This issue occurs since a few monthes now

Does disabling Tracking Protection solve the issue ?

nope !

So is there any update on this? when I go to gmail, Livemarks offers me the opportunity to add the feed but when I attempt to add it it gives an error of "failed to fetch feed" BUT when I click on the "view source" link it shows the feed as I would expect it. Is there something that's allowing Livemarks to be able to see the feed but not able to read it?

here is what i have when i try to catch the gmail feed "impossible to catch the feed" or something like this, sorry i'm french

@GrosBourrin Thanks! I'm French too so no worries :)
So, there seems to be 2 issues:

the XHR to https://mail.google.com/mail/u/1/feed/atom gives you a 401 status, so it seems like Gmail doesn't want people to XHR the feed.
This console error: Request to access cookie or storage on “https://mail.google.com/mail/u/1/feed/atom” was blocked because it came from a tracker and content blocking is enabled.

I wonder if there are other APIs allowing us to workaround 1 (which may fix this issue), 2 can't be fixed without https://bugzilla.mozilla.org/show_bug.cgi?id=1502987 .

Ok, so thus far the feed was updated once and then it stopped which doesn't make a whole lot of sense, and the add-on I am using doesn't let me set the refresh period(that I can find) so I have no idea if it will update again but I'll let you know what happens in the next few hours.

@TheOncomingStorm Thanks for the update, that seems strange.
Btw, you mentioned another RSS reader works, which one is it ? This way we could look at how it's doing things.

I am going to try and compare the HTTP headers send when doing fetch in the webconsole on mail.google.com compared to a background XHR. I am curious how Google servers can tell the difference.

@nt1m it is Awesome RSS.  https://shgysk8zer0.github.io/
It doesn't seem to have updated my feed again so I'm kinda at a loss as to what happened. Maybe installing it allowed it a moment where it could grab it but whatever it is, I haven't yet worked it out. I do know I had not disabled Livemarks when I installed it so who knows.  I'll keep searching for a solution because this is the best way for me to keep up with all my email..

Thanks! From what I can see, Awesome RSS just redirects to the raw feed. You can view the raw feed going to the feed url shown by livemarks (above the "View source" link).

Well, it will give you a few ways to subscribe if you check the preferences. I just told it to use RSS.

Well, it will give you a few ways to subscribe if you check the preferences. I just told it to use RSS.
Can you maybe take a screenshot showing us what you mean?

When I click the link it literally just opens https://mail.google.com/mail/u/0/feed/atom, which is just a raw XML document. Looking at the code https://github.com/shgysk8zer0/awesome-rss/blob/master/js/background.js, there doesn't seem anything in this extension that actually loads or parses RSS feeds.

I am pretty sure we get that HTTP 401, because we are not sending Cookies, which we can't send because tracking protection is stripping them ...

I actually figure out how to hack around this problem. By requesting the cookies permission we can lookup the required cookies ourself and add them to the request.
I don't think we should do this, adding the cookies permissions will ask the users for additional permissions during updates, and it's doubt people will understand why we need it.
https://github.com/evilpie/livemarks/commit/ff996813a6601e0585c5c24d176badc3940ac30e

My feed just updated again for no reason that I can quite figure out. I did have to restart Firefox but that's never triggered a feed update before that I know of, and restarting it again got me nothing. Something is causing Livemarks to work, if even just for a moment.

Mozilla just fixed this with bug 1629436. The current Nightly (77) now allows access to gmail.

authors: GrosBourrin TheOncomingStorm evilpie nt1m


text:
Update package.json to include the repository

Hi there!
This change adds the repository property to your package.json file(s). Having this available provides a number of benefits to security tooling. For example, it allows for greater trust by checking for signed commits, contributors to a release and validating history with the project. It also allows for comparison between the source code and the published artifact in order to detect attacks on authors during the publication process.
We validate that we're making a PR against the correct repository by comparing the metadata for the published artifact on npmjs.com against the metadata in the package.json file in the repository.
This change is provided by a team at Microsoft -- we're happy to answer any questions you may have. (Members of this team include @s-tuli, @iarna, @rancyr, @Jaydon Peng, @Zhongpeng Zhou and @Jingying Gu). If you would prefer that we not make these sorts of PRs to projects you maintain, please just say. If you'd like to learn more about what we're doing here, we've prepared a document talking about both this project and some of our other activities around supply chain security here: microsoft/Secure-Supply-Chain
This PR provides repository metadata for the following packages:

@nteract/octicons

Is there anything that is needed to land this pull request ?

ls there anything else I can do to land this pull request?

repo: nteract/octicons


text:
Publish to npm registry

https://www.npmjs.com/package/github-buttons

Security holding package
This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.
You may adopt this package by contacting support@npmjs.com and requesting the name.

See #22. Basically some one posted this package, and I asked for removal.

As for the current state of this project, it is ready to be published as npm package.
However, most of the users use the it by embed a script. I haven’t heard much requests to make it available in npm, which is why I haven’t published it.
I can look into reclaiming the package name and publishing it if there is such a demand.
For now it can be installed with the following command if you really want to, but I won’t recommend it:
npm install git+https://github.com/ntkme/github-buttons.git

I'd like to see this as an NPM package so I can more easily use as a module. Consider this a 👍 vote :)

most of the users use it by embedding a script instead of using as module

That's the only way to use it, so yeah that stands to reason. Publish it and you'll likely see npm downloads start climbing. Especially because yours is the only button with React/Vue components - React/Vue users pretty much always have a build system and dependency management via npm.
You're the owner so no one else can really do this but you. Would you mind sending an email to support@npmjs.com asking for the name?

I want it as npm module as well. Take my 👍, please

OK. To really have this as a npm package, I'd like to do some change to the structure to this project first.
Today this project has two parts:

The library: buttons.js
The application: buttons.github.io

First, I will take them apart and have two separate repo.
Then the library hosted on buttons.github.io has to be versioned, and it might be a little bit more work on. Otherwise it might break the  auto-sizing for older browsers that does not support shadow DOM when a stylesheet change happen in the future.

Hey @ntkme I can help you with that

https://www.npmjs.com/package/github-buttons
https://unpkg.com/github-buttons@1.0.0/dist/

For npm releases, to solve the versioning issue for iframe fallback for old browsers, I decided to use unpkg.com instead of GitHub Pages.
In npm release build (NODE_ENV=production):
  var name = "github-buttons";
  var version = "1.0.0";
  var baseURL = (/^http:/.test(location) ? "http" : "https") + "://" + ("unpkg.com/" + name + "@" + version + "/dist");

authors: erquhart gavinr hiendv ntkme yakovlevyuri

repo: ntkme/github-buttons


text:
[bug]ログイン後Rootにアクセスすると白い画面になる

ログイン後Rootにアクセスすると白い画面になる
Index用のController作ってないね！！

対応：https://github.com/ntmk-git/ibalog/pull/3

repo: ntmk-git/ibalog


text:
Suggestion for improvement with YouTube URLs

Very useful add-on, but here is a suggestions for improvement with YouTube URLs:
Use the youtube ID and domain seperately as search term
E.g. see the difference between these searches:

ID and domain seperately
Short URL
Default URL

Hello, as far as I understand this is already happening exactly as you mean it. See the relevant line:
index.js#L201
The search term it produces for the example you provided would be:
(url:4XGHu28Y1FQ) (site:youtube.com OR site:youtu.be)
I also tried it directly in the addon and it displays all of the 3 submissions.
I am closing this, but if I am misunderstanding anything here then please point it out to me.


text:
🛑 Secret Site BIS is down

In a6d42db, Secret Site BIS ($SECRET_SITE) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Secret Site BIS is back up in 001c3f4 after 28 minutes.


text:
🛑 Difesa is down

In 686eec2, Difesa (http://www.difesa.it/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Difesa is back up in f79aec1.


text:
🛑 Infrastrutture e Trasporti [TCP PING] is down

In d5e752e, Infrastrutture e Trasporti [TCP PING] (www.mit.gov.it) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Infrastrutture e Trasporti [TCP PING] is back up in 38c7fa5 after 9 hours, 10 minutes.


text:
numba-RNG in 2D threads

In numba document,a sample program that uses the random number generator is provided:
from numba import cuda
from numba.cuda.random import create_xoroshiro128p_states, xoroshiro128p_uniform_float32
import numpy as np

@cuda.jit
def compute_pi(rng_states, iterations, out):
    """Find the maximum value in values and store in result[0]"""
    thread_id = cuda.grid(1)

    # Compute pi by drawing random (x, y) points and finding what
    # fraction lie inside a unit circle
    inside = 0
    for i in range(iterations):
        x = xoroshiro128p_uniform_float32(rng_states, thread_id)
        y = xoroshiro128p_uniform_float32(rng_states, thread_id)
        if x**2 + y**2 <= 1.0:
            inside += 1

    out[thread_id] = 4.0 * inside / iterations

threads_per_block = 64
blocks = 24
rng_states = create_xoroshiro128p_states(threads_per_block * blocks, seed=1)
out = np.zeros(threads_per_block * blocks, dtype=np.float32)

compute_pi[blocks, threads_per_block](rng_states, 10000, out)
print('pi:', out.mean())

In this program,  thread_id = cuda.grid(1), but I wonder how to use RNG when thread_id = [2] ?
for example:
import numpy as np
import math
from numba import cuda
from numba.cuda.random import create_xoroshiro128p_states, xoroshiro128p_uniform_float64
@cuda.jit
def RNG(rng_states,x):
    i,j = cuda.grid(2)

    if i >= x.shape[0] or j >= x.shape[1]:
        return
    x[i,j] = xoroshiro128p_uniform_float64(rng_states,   )

TPB = 16
threadsperblock = (TPB, TPB)
x = np.random.randint(1,10,(1024,1024))
blockspergrid_x = math.ceil(x.shape[0]/threadsperblock[0])
blockspergrid_y = math.ceil(x.shape[1]/threadsperblock[1])
blockspergrid = (blockspergrid_x, blockspergrid_y)
rng_states = create_xoroshiro128p_states(   , seed=  )
RNG[blockspergrid, threadsperblock](rng_states,x)
print(x)

What parameters should I set for create_xoroshiro128p_states( ) and xoroshiro128p_uniform_float64( )

RE formatting in GitHub issues, for future reference triple backticks are needed around a code block (with optional language syntax specified), for example: ```python <your code> ```. GitHub also has a basic guide to its markdown syntax available here.

Sorry,It's my first time to ask a question here.
I have learned how to insert my code. Thank you for your help.

Thanks for the query, and no problem about the formatting, the above is just a canned reply with info for users :)
To your question, I think this might do what you want:
from numba import cuda
from numba.cuda.random import create_xoroshiro128p_states, xoroshiro128p_uniform_float32
import numpy as np
import math

@cuda.jit
def RNG(rng_states, x):
    startx, starty = cuda.grid(2)
    stridex, stridey = cuda.gridsize(2)

    for i in range(startx, x.shape[0], stridex):
        for j in range(starty, x.shape[1], stridey):
            idx = i * stridey + j
            rng = xoroshiro128p_uniform_float32(rng_states, idx)
            x[i, j] = rng

TPB = 8
threadsperblock = (TPB, TPB)
x = np.zeros((50, 3), dtype=np.float32)
blockspergrid_x = math.ceil(x.shape[0]/threadsperblock[0])
blockspergrid_y = math.ceil(x.shape[1]/threadsperblock[1])
blockspergrid = (blockspergrid_x, blockspergrid_y)

total_threads = np.prod(threadsperblock)
total_blocks = np.prod(blockspergrid)

nstates = int(total_threads * total_blocks)

rng_states = create_xoroshiro128p_states(nstates, seed=1)

RNG[blockspergrid, threadsperblock](rng_states, x)
print(x)

the main thing to note is that looping over the grid with striding means the program becomes less dependent on the launch configuration. I can't really comment on the validity of this method of using the RNG as I don't recall the internal details of the implementation. Hope this helps.

The important thing is to ensure two threads never share an rng state, so computing a unique index the way Stuart has done is the way to go.

Stuart,Thank you for your answer. Your code really have helped me a lot.
My purpose is to get int-RNG  in range[1,8]. It seem that I can't find  a function in Numba which can do this job.So I have to use  'int(xoroshiro128p_uniform_float64(rng_states,ID)*8 + 1)' to  meet my requirement.
Besides,How could I know the size of my array exceeds the size of gridsize,in which case I  must use the loop to ensure the uniqueness of the index?In other word,how to compute the largest size of gridsize?

Besides,How could I know the size of my array exceeds the size of gridsize,in which case I must use the loop to ensure the uniqueness of the index?In other word,how to compute the largest size of gridsize?

The idea in the above is to make it so that the code works for whatever array, grid size and block size chosen. It essentially adds flexibility.

The idea in the above is to make it so that the code works for whatever array, grid size and block size chosen. It essentially adds flexibility.
Yes,I have learned to add flexibility for my code with your help.

import numpy as np
from numba import cuda
import math
from numba.cuda.random import create_xoroshiro128p_states, xoroshiro128p_uniform_float32

@cuda.jit
def A(rng_states,x, p):
    startx,starty = cuda.grid(2)
    stridex,stridey = cuda.gridsize(2)
    for i in range(startx,x.shape[0],stridex):
        for j in range(starty,x.shape[1],stridey):
            if 0 < i < x.shape[0] -1 and 0 < j < x.shape[1] - 1:
                ID = i * stridey + j
                if xoroshiro128p_uniform_float32(rng_states,ID) > p:
                    return
                count = np.bincount(x[i-1:i+2,j-1:j+2].ravel())
                x[i,j] = np.argmax(count)

def B(y, TPB, p):
    x = cuda.to_device(y)
    threadsperblock = (TPB, TPB)
    blockspergrid_x = math.ceil(x.shape[0]/threadsperblock[0])
    blockspergrid_y = math.ceil(x.shape[1]/threadsperblock[1])
    blockspergrid = (blockspergrid_x, blockspergrid_y)
    rng_states = create_xoroshiro128p_states(int(np.prod(threadsperblock) * np.prod(blockspergrid)), seed = 1)
    A[blockspergrid, threadsperblock](rng_states, x, p)
    return x

y = np.random.randint(1,4,(256,256))
TPB = 16
p = 0.5
x = B(y, TPB, p)
print(x)

In this code,x[i,j] will change to the mode of its 3*3 neighbourhood with a probability of 0.5.
Can I use 'np.bincount'   and 'np.argmax' in the kernel function?

authors: Aslan9602 seibert stuartarchibald

repo: numba/numba


text:
Detect and raise unsupported on generator expressions

As title.
Closes #4271

Seems like CI is breaking on this:
======================================================================
ERROR: test_bulk_use_cases (numba.tests.test_closure.TestInlinedClosure)
Tests the large number of use cases defined below
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vsts/work/1/s/numba/tests/test_closure.py", line 440, in test_bulk_use_cases
    cfunc(var)
  File "/home/vsts/work/1/s/numba/dispatcher.py", line 354, in _compile_for_args
    error_rewrite(e, 'unsupported_error')
  File "/home/vsts/work/1/s/numba/dispatcher.py", line 316, in error_rewrite
    raise e
  File "/home/vsts/work/1/s/numba/dispatcher.py", line 327, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "/home/vsts/work/1/s/numba/compiler_lock.py", line 32, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "/home/vsts/work/1/s/numba/dispatcher.py", line 668, in compile
    cres = self._compiler.compile(args, return_type)
  File "/home/vsts/work/1/s/numba/dispatcher.py", line 83, in compile
    pipeline_class=self.pipeline_class)
  File "/home/vsts/work/1/s/numba/compiler.py", line 956, in compile_extra
    return pipeline.compile_extra(func)
  File "/home/vsts/work/1/s/numba/compiler.py", line 377, in compile_extra
    return self._compile_bytecode()
  File "/home/vsts/work/1/s/numba/compiler.py", line 887, in _compile_bytecode
    return self._compile_core()
  File "/home/vsts/work/1/s/numba/compiler.py", line 874, in _compile_core
    res = pm.run(self.status)
  File "/home/vsts/work/1/s/numba/compiler_lock.py", line 32, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "/home/vsts/work/1/s/numba/compiler.py", line 254, in run
    raise patched_exception
  File "/home/vsts/work/1/s/numba/compiler.py", line 245, in run
    stage()
  File "/home/vsts/work/1/s/numba/compiler.py", line 768, in stage_ir_legalization
    raise_on_unsupported_feature(self.func_ir, self.typemap)
  File "/home/vsts/work/1/s/numba/ir_utils.py", line 1933, in raise_on_unsupported_feature
    raise UnsupportedError(msg, loc=stmt.loc)
numba.errors.UnsupportedError: Failed in nopython mode pipeline (step: ensure IR is legal prior to lowering)
The use of generator expressions is unsupported.

File "numba/tests/test_closure.py", line 359:
            def inner(x):
                yield x + z
                ^

----------------------------------------------------------------------
Ran 8160 tests in 1993.462s

@esc thanks. I think if you inline the IR for a closure that yields and then try and return it it looks like a generator expression, either way, not supported. Think it's just the error message that could do with an updated.

Feedback addressed in 19302e3, thanks.

authors: esc stuartarchibald


text:
[WIP] Stack array allocation

I'm opening this PR for feedback on the general design/idea of allowing local arrays to be created inside nopython functions, with a view to supporting it on CPU and GPU targets and for ufuncs and gufuncs as well. This PR is opened with the hope that I can get the design right and it be something that everyone is happy with before I go too far down thoroughly implementing and testing it.
This is the smallest example of an implementation, which has some limitations:

it only works on the CPU,
it only works for 1D arrays,
it is not tested thoroughly - there are some unit tests demonstrating its use, but they are not thorough.

Local arrays are created using numba.local_array.new(shape, dtype) inside a jitted function. This is macro-expanded to an instance of an AllocateArray IR node, which is added in this PR as well. Typing of the AllocateArray IR node works in the same way as typing of an Intrinsic node. In lowering, an ArrayTemplate struct is created and populated with the relevant data, as well as a pointer to newly-allocated space for the array data. The array data space is allocated using an alloca instruction.
My thoughts about where to proceed next include creating more thorough tests for operations on local arrays, and expanding the lowering implementation to handle multidimensional arrays, after making revisions to the design/idea based on any feedback.
Any thoughts/feedback appreciated!

Any plans to come back to this? I would find this very useful for Numbagg, even if it only works on CPUs and 1d arrays. Basically, it would let me write two types of functions that I can't write currently -- median and grouped aggregations such as nanmean.

In some discussions with @sklam, I think we have figured out how we want to handle memory allocation generally in nopython mode.  I'm not sure what a reasonable ETA is yet, but just deciding how to handle the general problem is a major internal milestone.  :)

Awesome - thanks for the update!

Closing this PR as it is superseded by the NRT work.

authors: gmarkall seibert shoyer


text:
Speed up originality by pre-sorting the submission

This was submitted by an anonymous contributor, and applies to #3.
Here's a demo of it:
import numpy as np
from scipy.stats import ks_2samp

def input_data(nusers=1000, nrows=4600, seed=0):
    rs = np.random.RandomState(0)
    submission = rs.rand(nrows)
    other_submission = rs.rand(nrows, nusers)
    return submission, other_submission

def run_originality(submission, other_submission):
    output = np.empty(other_submission.shape[1])
    for i in range(other_submission.shape[1]):
        x = originality_score(submission, other_submission[:, i])
        output[i] = x
    return output

# numerai's current implementation
def originality_score(submission1, submission2):
    return ks_2samp(submission1, submission2)[0]

# ---------------------------------------------------------------------------
# proposed speed up:

def run_originality2(submission, other_submission):
    output = np.empty(other_submission.shape[1])
    submission = np.sort(submission)
    for i in range(other_submission.shape[1]):
        x = originality_score2(submission, other_submission[:, i])
        output[i] = x
    return output

# this function is taken from scipy (ks_2samp) and modified and so falls
# under their BSD license
def originality_score2(data1, data2):
    data2 = np.sort(data2)
    n1 = data1.shape[0]
    n2 = data2.shape[0]
    data_all = np.concatenate([data1, data2])
    cdf1 = np.searchsorted(data1, data_all, side='right') / (1.0*n1)
    cdf2 = np.searchsorted(data2, data_all, side='right') / (1.0*n2)
    d = np.max(np.absolute(cdf1 - cdf2))
    return d

"""
demo

First check that the speed up gives the same results:

In [2]: submission, other_submission = input_data()
In [3]: originality = run_originality(submission, other_submission)
In [4]: originality2 = run_originality2(submission, other_submission)
In [5]: (originality == originality2).all()
Out[5]: True

Now test speed:

In [6]: timeit run_originality(submission, other_submission)
1 loop, best of 3: 929 ms per loop
In [7]: timeit run_originality2(submission, other_submission)
1 loop, best of 3: 636 ms per loop

Speed up is over 30%:

In [8]: (929 - 636) / 929.0
Out[8]: 0.3153928955866523
"""

Did you check correctness on the version being committed? The psudeocode in the description makes sense for why it works, but the code being commit seems a bit stranger that it works...

I tested the demo at the bottom of this, which emprically suggests it's the same.
import numpy as np
from scipy.stats import ks_2samp

def input_data(nusers=1000, nrows=4600, seed=0):
    rs = np.random.RandomState(0)
    submission = rs.rand(nrows)
    other_submission = rs.rand(nrows, nusers)
    return submission, other_submission

def run_originality(submission, other_submission):
    output = np.empty(other_submission.shape[1])
    for i in range(other_submission.shape[1]):
        x = originality_score(submission, other_submission[:, i])
        output[i] = x
    return output

# numerai's current implementation
def originality_score(submission1, submission2):
    return ks_2samp(submission1, submission2)[0]

# ---------------------------------------------------------------------------
# proposed speed up:

def run_originality2(submission, other_submission):
    output = np.empty(other_submission.shape[1])
    sorted_submission = np.sort(submission)
    for i in range(other_submission.shape[1]):
        x = originality_score2(sorted_submission, other_submission[:, i])
        output[i] = x
    return output

# This function is taken from scipy (ks_2samp) and modified and so falls
# under their BSD license
def originality_score2(data1, data2):
    """
    Computes the Kolmogorov-Smirnov statistic on 2 samples.

    This is a two-sided test for the null hypothesis that 2 independent samples
    are drawn from the same continuous distribution.

    Warning: data1 is assumed sorted in ascending order.

    Parameters
    ----------
    data1, data2 : ndarray
        Two arrays of sample observations assumed to be drawn from a
        continuous distribution. Arrays must be of the same size. data1 is
        assumed sorted in ascending order.

    Returns
    -------
    statistic : float
        KS statistic
    """

    # data1 is assumed sorted in ascending order
    data2 = np.sort(data2)
    n1 = data1.shape[0]
    n2 = data2.shape[0]
    if n1 != n2:
        raise ValueError("`data1` and `data2` must have the same length")

    # the following commented out line is slower than the two after it
    # cdf1 = np.searchsorted(data1, data_all, side='right') / (1.0*n1)
    cdf1 = np.searchsorted(data1, data2, side='right')
    cdf1 = np.concatenate((np.arange(n1) + 1, cdf1)) / (1.0*n1)

    # the following commented out line is slower than the two after it
    # cdf2 = np.searchsorted(data2, data_all, side='right') / (1.0*n2)
    cdf2 = np.searchsorted(data2, data1, side='right')
    cdf2 = np.concatenate((cdf2, np.arange(n1) + 1)) / (1.0*n2)

    d = np.max(np.absolute(cdf1 - cdf2))

    return d

"""
demo

First check that the speed up gives the same results:

In [2]: submission, other_submission = input_data()
In [3]: originality = run_originality(submission, other_submission)
In [4]: originality2 = run_originality2(submission, other_submission)
In [5]: (originality == originality2).all()
Out[5]: True

Now test speed:

In [6]: timeit run_originality(submission, other_submission)
1 loop, best of 3: 903 ms per loop
In [7]: timeit run_originality2(submission, other_submission)
1 loop, best of 3: 505 ms per loop

Speed up is 44%:

In [8]: (903 - 505) / 903.0
Out[8]: 0.4407530454042082
"""

We should also consider using this KS test for concordance as well. But that is less urgent.

This satisfies both conditions of #3, so the entire 40 NMR bounty will be paid to the anonymous contributor.

repo: numerai/submission-criteria


text:
Cannot set LevelOfParallelism

I am using 3.4.0-beta-2 and cannot seem to change the Number Of test Workers. I added this to my AssemblyInfo.cs and reran dotnet test, but it is still reporting as 3.

[assembly: LevelOfParallelism(1)]

Run Settings
    WorkDirectory: C:\repos\alliances
    NumberOfTestWorkers: 3

There is no parallelism in the PCL version of the NUnit framework because we don't have threading in Portable. This should be fixed when we release a netstandard version, hopefully next month.
I am not sure why it is reporting 3 for the workers, that is probably a bug. I expect it is one.

It is recording as three because that is the number of CPUs I have.
On Wednesday, August 10, 2016, Rob Prouse notifications@github.com wrote:

There is no parallelism in the PCL version of the NUnit framework because
we don't have threading in Portable. This should be fixed when we release a
netstandard version, hopefully next month.
I am not sure why it is reporting 3 for the workers, that is probably a
bug. I expect it is one.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/nunit/dotnet-test-nunit/issues/70#issuecomment-238991951,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB63ivUbV_XKgiYRc3CietZfKLD7lengks5qejMkgaJpZM4Jhcl4
.

authors: patrickjamesbarry rprouse

repo: nunit/dotnet-test-nunit


text:
Add C++\CLR project targets creation

Now for use nuget package in C++\CLR project needs build\nativeProjectName.targets file with content like below. Could you support it? Maybe as option.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Reference Include="MyDll">
  <HintPath>$(MSBuildThisFileDirectory)..\..\lib\net451\MyDll.dll</HintPath>
</Reference>
...
</ItemGroup>
</Project>

You can already add build\native\ProjectName.targets manually, as
<ItemGroup>
  <Content Include="build\native\ProjectName.targets" />
</ItemGroup>

I believe this should meet your needs, unless you expect something else?

I think the idea here to automatically generate that ProjectName.targets during build *.nuproj and include it to resulted package.

I'm thinking more about expected behavior, especially in complex scenarios. For example:

Package has assemblies targeting different frameworks. Which one to include in native references?
Assembly project has dependencies (NuGet and/or project reference).
NuProj project has dependencies  (nuproj or csproj).
What if one of the nuget dependencies does not have native targets file.

authors: AndirNotes Warlock78 kovalikp

repo: nuproj/nuproj


text:
Bug Fix: Logout User

Wired up GoogleId as deviceId
Wired up userType from manifest
Added proxy support for network calls

LGTM

Can you please point me to which changes accommodates the below requirements as mentioned in the description:

Added proxy support for network calls

@sagargpt have updated the description.Previosly had added explicit method for proxy binding.It can be now set from system settings

authors: debokarmakar sagargpt

repo: nurture-farm/clevertap-android-sdk


text:
Lab 8 Level 2

Hello, I've been stuck at Level 2.  I'm unsure if my approach of having Candle, Troll and Sword implement from an interface called "Item" is correct.  I used an interface because Candle, Troll and Sword seem to have common methods of different implementations each.  Also, I was thinking that a general Item should now be added to the ImList in Room class, instead of just Candle/ Troll/ Sword only.
However, I'm not sure how I can return a new Room object in the tick() method, since the Item requires a state change and I'm unable to initialise Item (an interface), unlike how I initialised Candle previously in Level 1.
I hope my description is not too confusing.  Any suggestions will be greatly appreciated, thanks!

hello maybe it would be easier if you implement "Item" as an abstract class :)

Sorry why would you want to instantiate the general item?
Even if you implement using abstract class, you also can't instantiate it.

I would honestly say it is personal preference as to whether to implement "Item" as an abstract class or interface. Both implementation will work nevertheless. I have completed using interface "Item", so don't worry, that implementation works! In my opinion, I find it more comfortable creating an interface and creating an attribute ImList<Item> items in Room class, whereby the ImList stores anything that is an interface of "Item", in this sense, it will be your Candle, Troll and Sword.
(May not be the best and most efficient implementation) I have a "Item next()" in my interface where it allows me to change the state of each object when tick() is called - "Item next()" is overridden in each of the different Item to change their states respectively. So in the tick() method, I will run through an ImList of Item, update each Item by calling e.g. newThings = newItems.set(i, this.items.get(i).next());, then return new Room(this.location, ImList.of(newItems), this.prevRoom).
Hope this helps!

Heyyy, I made an abstract class that took in an integer referred to as state level. Every time the tick method is called in the room class, it would invoke a state change method in the Item abstract class. This state change method simply increments the state level and prints out the relevant string for the Candle, Troll and Sword. The implementation of the state change method was defined in the individual classes (aka Candle, Troll and Sword) as each of these items have a different number of states. Hope this helps! and Good Luck :)

my items have their own states and are stored in an ImList in the room hence my tick basically just moves the status down by 1 for each item

Thanks a lot for your replies! :)

authors: herq-ules jlee1007 kkinmunn mehakAS rachelcsy1 yongchein-o


text:
project 9_11 incorrect output

Summary
my code runs on jshell but i've got this incorrect output error on codecrunch, does anyone know how to solve? is this error the same as time limit exceeded error? any help is appreciated, thank you!
Description

its either an infinite loop or you are not printing the result

if it is an infinite loop, might want to check either the mechanism of your server times updating or your wait event generating. Likely either one is the issue

authors: JovanFoo W-WJ-Ryan zenlxy


text:
[T4A5][F11-B1] Justin Ng

Ready for review.

Reviewed in tutorial.

:+1: Reviewed in tutorial ~

authors: Candiie njyjn


text:
release(main):  v0.17.0

:robot: I have created a release beep boop
0.17.0 (2024-09-27)

What's Changed
Exciting New Features 🎉

feat: Support XValidations (CEL) for CC variables by @jimmidyson in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pull/916
feat: Update addon versions by @jimmidyson in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pull/917

Other Changes

build: Fix up metadata missed in v0.16.0 release process by @jimmidyson in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pull/920
build: Consistently format even generated files by @jimmidyson in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pull/923

Full Changelog: https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/compare/v0.16.0...v0.17.0

This PR was generated with Release Please. See documentation.

Please update metadata for the new minor release as detailed in https://nutanix-cloud-native.github.io/cluster-api-runtime-extensions-nutanix/contributing/releasing/#cutting-a-release


text:
fix(picker): 修复model-value值污染问题

nut-picker 修复model-value值污染问题

Summary by CodeRabbit

新功能

增加了数组深度克隆和值比较的工具函数，提高了数据处理的准确性和效率。

改进

在countup组件中，使用cloneDeep函数替换了JSON.parse(JSON.stringify(...))进行深度克隆数组，优化了性能。
datepicker组件现在使用值等价性检查函数替换了直接的JSON字符串比较，增强了日期值更新和同步的逻辑。
guessgift组件中，shuffle函数现在使用cloneDeep来克隆数组，提高了数据操作的安全性和效率。
picker组件的逻辑更新，包括使用cloneDeep和isEqualValue函数替换了原有的深度比较和默认值设置方法，增强了数据处理的准确性。
range组件现在使用isEqualValue函数而不是之前的isSameValue函数来比较值，优化了值变化时的事件更新和触发逻辑。

关联 #243

repo: nutui-uniapp/nutui-uniapp


text:
Support camelCase key

Hi,
I don't really like having hyphenated key in my nuxt.config.json.
Would it be possible to add support for camelCase key too ?
- 'google-gtag': {
+ googleGtag: {
    id: 'UA-some-id',
},

I see in the code that this is supposed to be supported.
But it was never released to npm, the latest version is 1.0.4 and the commit adding this feature was release after.

repo: nuxt-community/google-gtag-module


text:
Add me to nuxt-community GitHub Org

Hey,
I am really excited about the active development and wanted to be a part of the nuxt-community organization on GitHub. In this regard, how can I become a member and would love if somebody would add me to it?
My GitHub username is YoginthS
Thanks, Yoginth

Hi @YoginthS, thank you for attention, we really hope that more and more friends to join our community and make Nuxt better and better together.
Firstly, I think you can help to solve the issues in community.
Or submit effective pull requests actively, create practicable repositories in nuxt-community.
If you have shown enough efforts and contributions in community, I think @Atinux will very welcome you to join our outstanding team. 😸
/cc @Atinux @alexchopin @pi0

Completely agree with @clarkdo, we would love to add you on Community, of course we need at first to see your contributions by helping out on issues & PRs :)
Please ping us (@pi0, @clarkdo and myself) for any PR or issues where you need help from us!

authors: Atinux YoginthS clarkdo


text:
NuxtServerError - Request failed with status code 500 - No indication of which API call failed

Version
v2.4.0
Reproduction link
https://github.com/kalenjordan/pros.global
Steps to reproduce
I'm not exactly sure how to reproduce, but usually within 2 to 8 hours it happens on my app (https://pros.global). It seems that axios is hitting a 500 error response but I have no indication of what API request failed exactly.
NuxtServerError
Request failed with status code 500
/home/forge/pros.global/node_modules/axios/lib/core/createError.js in createError at line 16:15
/home/forge/pros.global/node_modules/axios/lib/core/settle.js in settle at line 18:12
/home/forge/pros.global/node_modules/axios/lib/adapters/http.js in IncomingMessage.handleStreamEnd at line 201:11
events.js in IncomingMessage.emit at line 187:15
domain.js in IncomingMessage.EventEmitter.emit at line 459:23
_stream_readable.js in endReadableNT at line 1094:12
internal/process/next_tick.js in process._tickCallback at line 63:19
What is expected ?
I would expect that I would have some way to know which API call failed in the error log.
What is actually happening?
There is no indication of which API call failed.
Additional comments?
Perhaps there is a way within axios to log all API requests that go through so that I could at least correlate the error to that log?

This bug report is available on Nuxt community (#c8707)

If you use the nuxt axios module you can set debug to true so all requests are logged (be aware of disk space issues if you are logging this to file and running for 8 hrs!): https://axios.nuxtjs.org/options#debug

authors: kalenjordan pimlie


text:
refactor: load all modules with esm

previous change cannot distinguish scoped node modules.
use nuxt.resolveAlias may solve it, but it's more expensive.
our current esm config is 100% CJS support, so no need to seprate the require and import.

Codecov Report

Merging #3556 into dev will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##              dev    #3556      +/-   ##
==========================================
- Coverage   99.19%   99.19%   -0.01%
==========================================
  Files          18       18
  Lines        1116     1115       -1
  Branches      300      300
==========================================
- Hits         1107     1106       -1
  Misses          9        9

Impacted Files
Coverage Δ

lib/core/module.js
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfef525...f863637. Read the comment docs.

I let @pi0 answer about this, I'm not 100% sure if it's a good idea to load external modules with esm.

authors: Atinux clarkdo codecov-io


text:
change wrong tag  to

Types of changes

[x] Bug fix (a non-breaking change which fixes an issue)
[ ] New feature (a non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Description

Checklist:

[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly. (PR: #)
[ ] I have added tests to cover my changes (if not applicable, please state why)
[ ] All new and existing tests are passing.

Codecov Report

Merging #4476 into dev will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev    #4476   +/-   ##
=======================================
  Coverage   91.35%   91.35%
=======================================
  Files          60       60
  Lines        2105     2105
  Branches      506      506
=======================================
  Hits         1923     1923
  Misses        167      167
  Partials       15       15

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6589670...104f552. Read the comment docs.

The tag is completely fine since #4396
There might be problems when not using nuxt-edge for now but this will settle with the next Nuxt version.

authors: codecov-io manniL thedb