validate_arguments coerces collections into iterators if annotated as Iterable

Initial Checks

[X] I have searched GitHub for a duplicate issue and I'm sure this is something new
[X] I have searched Google & StackOverflow for a solution and couldn't find anything
[X] I have read and followed the docs and still think this is a bug
[X] I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like FastAPI or mypy)

Description
validate_arguments decorator coerces input collections into their iterators, if they were annotated as typing.Iterable in a function's signature.
I know that
pydantic currently leans on the side of trying to coerce types rather than raise an error if a type is wrong
but I don't think this is the case here. It's tough to consider the input type as wrong and it's easier to consider the resultant iterator object as such (as it can happen to be consumed on first iteration and then gone - behavior not at all expected from collections).
Example Code
from pydantic import validate_arguments
from typing import Iterable, List, Set, Dict, Tuple

@validate_arguments
def foo_iter(arg: Iterable[str]):
    print(f"Type of arg is: {type(arg)}")

@validate_arguments
def foo_lst(arg: List[str]) -> None:
    print(f"Type of arg is: {type(arg)}")

@validate_arguments
def foo_set(arg: Set[str]) -> None:
    print(f"Type of arg is: {type(arg)}")

@validate_arguments
def foo_tuple(arg: Tuple[str, str]) -> None:
    print(f"Type of arg is: {type(arg)}")

@validate_arguments
def foo_dict(arg: Dict[int, str]) -> None:
    print(f"Type of arg is: {type(arg)}")

>>> foo_lst(["foo", "bar"])
Type of arg is: <class 'list'>

>>> foo_set({"foo", "bar"})
Type of arg is: <class 'set'>

>>> foo_tuple(("foo", "bar"))
Type of arg is: <class 'tuple'>

>>> foo_dict({1:"foo", 2:"bar"})
Type of arg is: <class 'dict'>

>>> foo_iter(["foo", "bar"])
Type of arg is: <class 'list_iterator'>

>>> foo_iter({"foo", "bar"})
Type of arg is: <class 'set_iterator'>

>>> foo_iter(("foo", "bar"))
Type of arg is: <class 'tuple_iterator'>

>>> foo_iter({1:"foo", 2:"bar"})
Type of arg is: <class 'dict_keyiterator'>

Python, Pydantic & OS Version
pydantic version: 1.10.4
pydantic compiled: False
install path: C:\Users\(...snip...)\.temp\venv\Lib\sitepackages\pydantic
python version: 3.7.5rc1 (tags/v3.7.5rc1:4082f600a5, Oct  1 2019, 20:28:14) [MSC v.1916 64bit (AMD64)]
platform: Windows-10-10.0.19041-SP0
optional deps. installed: ['typing-extensions']

Affected Components

[ ] Compatibility between releases
[ ] Data validation/parsing
[ ] Data serialization - .dict() and .json()
[ ] JSON Schema
[ ] Dataclasses
[ ] Model Config
[ ] Field Types - adding or changing a particular data type
[X] Function validation decorator
[ ] Generic Models
[ ] Other Model behaviour - construct(), pickling, private attributes, ORM mode
[ ] Plugins and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.

@z33kz33k thank you for the bug report. Could you please confirm that the bug is still relevant in Pydantic v2?

@lig the type of the input collection is still morphed, but this time into:
>>> foo_iter(["foo", "bar"])
Type of arg is: <class 'pydantic_core._pydantic_core.ValidatorIterator'>

I checked both validate_arguments() and validate_call() on:
pydantic version: 2.4.2
pydantic-core version: 2.10.1
pydantic-core build: profile=release pgo=true
install path: /home/(...snip...)/venv/lib/python3.10/site-packages/pydantic
python version: 3.10.5 (main, Jun  4 2023, 22:15:56) [GCC 11.3.0]
platform: Linux-5.15.0-88-generic-x86_64-with-glibc2.35
related packages: typing_extensions-4.8.0


[Create New Issue]:  Destructors in CPP

Description
Description
Domain
C/CPP
Type of Contribution
Documentation
Code of Conduct

[X] I follow Contributing Guidelines & Code of conduct of this project.

/assign

Closing as the PR got merged


Allow AreaInsert pickups for one item

About the PR
Mirror of https://github.com/new-frontiers-14/frontier-station-14/pull/2005
Allows entities with StorageComponent and AreaInsert set to pick up item sets with one item in range by clicking on the floor.
Why / Balance
Seems odd, comment implies it's a bug.
Technical details
Spawn trashbag.
Spawn trash.
Stand near the trash, click on the floor.
Trash should be picked up.
Media

https://github.com/user-attachments/assets/2aa12a85-f6f7-476f-b46d-fae696ddc136
Requirements

[X] I have read and am following the Pull Request and Changelog Guidelines.
[X] I have added media to this PR or it does not require an ingame showcase.

Breaking changes

Changelog

:cl: whatston3

fix: Area insert items can pick up single item sets when clicking on the floor.

Do you have evidence of this being relicensed as MIT?

Do you have evidence of this being relicensed as MIT?

it's literally one-liner (one-symbol, to be precise) that anyone other can come up with from their head
and it wasn't merged into frontier when the same author opened this pr, so this is just stupid to ask such questions

Do you have evidence of this being relicensed as MIT?

it's literally one-liner (one-symbol, to be precise) that anyone other can come up with from their head and it wasn't merged into frontier when the same author opened this pr, so this is just stupid to ask such questions

Frontier has complained about this in the past so this is a valid question and not "stupid" as you insinuate.

We want to have this fixed on upstream so we can have the same logical bug fix to the issue,
I merged it into Frontier after I opened it here so it can be fixed please.
Bug fixes should never be a "Frontier only" code when they effect everyone.

As the writer of this change, I'm sure relicensing under MIT is fine.  No concerns from my side, at the very least.

Thanks for the fix!


Add shortcut numpy and pandas data functions

"Draft" PR. Discussion about syntax etc...

"Projections, selections and operations" are now all stored in "operations" list.
Similarly these respective functions have been condensed to a single "operate" function.
"operate" returns the dataset allowing chaining of operations:
clsRadioFluxF107.operate('time,absolute_f107').operate('time<1952').operate('formatTime(yyyy.MM.dd)')

Also added download function which functions similar to data but generates file in given format

Please make Dataset.operation plural ("operations").

Went ahead and deleted the feature branch to keep the repo clean.


npcx: convert few device_get_binding to DEVICE_DT_GET

Hi, this converts the device_get_binding I've found in npcx drivers to DEVICE_DT_GET. It should be slightly more efficient, and for the i2c driver it also simplifies the instance code and init a fair bit.

(updated the patch description)


React: add minimal test coverage for all components

Implement minimal test coverage for all components in the React component library to ensure basic functionality and prevent regressions.
Our React component library is currently lacking in test coverage. We need to establish a baseline of minimal test coverage for all the components in the library.
Objectives

Establish Test Coverage Baseline: Each component should have at least one test case that verifies its primary functionality.
Identify Critical Paths: For each component, identify and test the critical path that is most likely to be used by consumers of the library.
Ensure Component Isolation: Tests should be isolated to individual components to prevent cascading failures and to pinpoint the exact source of any given issue.

Acceptance Criteria

At least one test per component. One ensuring that the component renders correctly given the data provided to it and an optional test making sure it interacts with the user in the way expected.
All newly added tests should pass and not introduce any new failures into the existing test suite.

@justintemps Before we start on this, I think it will be good to measure the test coverage so that we have a good idea of where we stand now. We can then clearly see which components are currently not being tested and add a basic "render check" to the components that are not currently tested to see if it renders with the expected elements. Later we can also use the test coverage report to find the components that are under tested and improve them.
Since the react package uses CRA to run jest, we should be able to get the coverage report by adding a single option to the test command. Ideally we should regularly measure and report the test coverage using the CI but we can also run it manually at certain intervals to track our progress.

Also we should probably move away from using CRA for the tests. It's really strange that it is being used for the tests alone. Do you know why the react package ended up using rollup for the builds and CRA for the tests?

Did an initial investigation on react test for components.
Components that require tests to be written.

Breadcrumb
Cards (All individual cards have a component for them)
CardGroups
Checkbox
Collapse
Credit
DatePicker
Empty
Fieldset
Fileupload
Footer
Form
FormControl
FormElement
GlobalProvider
Hero
Icon
Input
LocalNav
Logo
Logogrid
Navigation
NumberPicker
Radio
SocialMedia
Tabs
TextArea
TextInput
Toggle
Tooltip
Video

Components with tests already written.

Accordion
Button
Callout
ContextMenu
Dropdown
Heading
Image
Linklist
List
Loading
Notification
Pagination
Profile
ReadMore
Richtext
SearchField
TableOfContents
Tag

Also we should probably move away from using CRA for the tests. It's really strange that it is being used for the tests alone. Do you know why the react package ended up using rollup for the builds and CRA for the tests?

I'm not sure why we're using CRA for the tests, but I'm not married to it. If there's a better way of rendering React components for testing, I'm all for it.

Hey @Shashika6 this looks good to me.

Since we are looking into this, it might be better to switch the React project to using Vite and Vitest so that we don't have to refactor even more code.
What do you think @justintemps?

This is currently blocked by #985


Fix: WikiMed Installer Type

null
Microsoft Reviewers: Open in CodeFlow

PS C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs> winget install -m C:\Users\WDAGUtilityAccount\Desktop\winget-pkgs\manifests\k\Kiwix\WikiMed\<IP_ADDRESS> --verbose-logs
Found WikiMed by Kiwix [Kiwix.WikiMed] Version <IP_ADDRESS>
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Successfully installed

@msftrubengu @lechacon  - Could either of you take a look?

@ryfu-msft -


Mocking no response - causes fetch to throw an exception instead of triggering the Promise's catch

In issue #168, it is recommended to test a server not available using: fetchMock.mock('www.google.com', {throws: 'Server not found'}).  This functionality is causing my fetch call to throw an Error instead of resolving the Promise to an Error.

When I do the following (no mocking):
try{
    fetch('http://thisSiteDoesntExist.com/foo')
        .then( res => console.log('It worked'))
        .catch( err => console.log('Promise error'));
}catch(e){
    console.log('Fetch threw!');
}

Then this will print:
Promise error

If I mock, using fetchMock.mock(glob:*, {throws: 'Server not found'});) this causes the fetch function to throw, not the promise.  This will print:
Fetch threw!

I did some digging and this behavior seems to be enforced with a unit tests (responses.test.js):
			it('response that throws', async () => {
				fm.mock('http://it.at.there/', {
					throws: 'Oh no'
				});

				try {
					fm.fetchHandler('http://it.at.there/')
					expect(true).to.be.false
				} catch (err) {
					expect(err).to.equal('Oh no');
				}
			});

This seems odd to me.  Any input would be appreciated.

Hmmm, the more I investigate this, the more I think it's a mistake in my implementation.
I may consider a version 7 release to correct this and roll out one or two refinements to the codebase that, aside for maybe some really edge cases, probably aren't breaking changes, but I'd rather not risk them in a patch/minor.
I have a busy few weeks so it won't be addressed quickly though

Thanks for the reply and consideration!  Mostly raised the issue because I found this behaviour to be surprising.

I thought I was going crazy. Yes, this is affecting my code as well. It's one of the few places I can't get code coverage in my tests currently.

We ran into this as well when upgrading from v5 to v6. Would be great with a v7 release.
@wheresrhys Thanks a lot for the effort you've put into fetch-mock! 🎈

@leogiertz @dwighthouse @JakeSummers This should be fixed in the v7 branch. Please give it a try if possible

@wheresrhys The v7 branch works for us. Thanks! ⭐

Just released an alpha so you can have some stability v7.0.0-alpha.1


Wildcards?

Hey man, I was just about to do a PR to add support for wildcard semver ranges like 1.x and 1.0.*, but just wondered if there was a particular reason they weren’t in already?

This module is for matching semver versions, not ranges. Not really interested in complicating it further. It seems like that should be a separate module. There are many more types of ranges.


EasyHook64.DLL is flagged as virus by Symantec

Just FYI,
It seems that Easyhook64.dll is being flagged as malware by my antivirus. Unfortunately I cannot uninstall it.
What I have been doing to keep it working is just redropping it into the directory where it is being used after every restart as the antivirus removes it during startup. This only happens when the antivirus does the scans.

Thanks Steve, I'll sign the next binary, hopefully that will help prevent the official release being abused. Other than that I don't think there will be much I can do.


[e2e]: go release main config-ldflags-noassets slsa3

Repo: https://github.com/slsa-framework/example-package/tree/v17.0.388
Run: https://github.com/slsa-framework/example-package/actions/runs/5428662573
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.release.main.config-ldflags-noassets.slsa3.yml
Workflow runs: https://github.com/slsa-framework/example-package/actions/workflows/e2e.go.release.main.config-ldflags-noassets.slsa3.yml
Trigger: release
Branch: v17.0.388
Date: Sat Jul  1 02:41:47 UTC 2023

Repo: https://github.com/slsa-framework/example-package/tree/v17.0.389
Run: https://github.com/slsa-framework/example-package/actions/runs/5434287859
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.release.main.config-ldflags-noassets.slsa3.yml
Workflow runs: https://github.com/slsa-framework/example-package/actions/workflows/e2e.go.release.main.config-ldflags-noassets.slsa3.yml
Trigger: release
Branch: v17.0.389
Date: Sun Jul  2 02:46:08 UTC 2023
Tests are passing now. Closing this issue.


provide CRD json schemas

Describe the feature request
Please provide json schemas in the CRDs so that we may statically analyse templates for correctness.
Maybe these schemas are published somewhere else? (But if so, then why not in the CRDs?)
Am I not looking well in all the corners?
Missing so far:
kind: IstioOperator

I looked into the 1.10 branch but found nothing...

These are provided for all types except IstioOperator. I think we exceed the size limit on that one size the api is so large

Ha, will ik make it in somehow later then?

I think this issue is causing me problems when I try to deploy Istio using Terraform. I'm trying to use the new TF k8s resources kubernetes_manifest but it's throwing a warning concerning the lack of Schema.
This causes Terraform to force a recreation of the Istio CRD and thus recreation of the Istio install when there is any sort of update as it can't validate any of the fields.
 Warning: This custom resource does not have an associated OpenAPI schema.

   with module.istio.kubernetes_manifest.istio,
   on modules/istio/istio.tf line 12, in resource "kubernetes_manifest" "istio":
   12: resource "kubernetes_manifest" "istio" {

 We could not find an OpenAPI schema for this custom resource. Updates to this resource will cause a forced replacement.

Is there any easy way to generate a schema I could throw in to test. When you say it exceeded size limit, which limit is this?

Can we get this reopened? This is definitely an issue for anybody managing an Istio installation via Terraform.

It also precludes using kubectl explain effectively along with many other helpful tools.

It also precludes using kubectl explain effectively along with many other helpful tools.

It would but we added this years ago...? I use it daily so I'm sure it's there. Maybe you can provide more details if you are having issues, in a new issue.
Unless it's IstioOperator which does not and will not have it

Yes, I am referring to the Operator CRD


Adding error logging for failed photo upload attempts

What this PR does / why we need it:
adding error logging as we cannot understand why upload attempts are failing
Which issue(s) this PR fixes:
Trying to get more clarity around https://github.com/instagrambot/instabot/issues/1163
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
NONE

Codecov Report

Merging #1276 into master will increase coverage by 0.02%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #1276      +/-   ##
==========================================
+ Coverage    42.9%   42.92%   +0.02%
==========================================
  Files          32       32
  Lines        3550     3548       -2
  Branches      582      581       -1
==========================================
  Hits         1523     1523
+ Misses       1888     1886       -2
  Partials      139      139

Impacted Files
Coverage Δ

instabot/api/api_photo.py
6.85% <0%> (-0.03%)
:arrow_down:

instabot/api/api_video.py
10.06% <0%> (+0.19%)
: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 bc2bc26...818306b. Read the comment docs.


[ci:component:github.com/gardener/vpn2:0.8.0->0.9.0]

Release Notes:
vpn-seed-server and vpn-shoot-client container images now contain only a reduced set of binary/libaries.

Closed in favour of #6378.
/close


how to Download a specific artifact

how to Download a specific artifact
link: https://docs.microsoft.com/en-us/azure/devops/pipelines/release/artifacts?view=azure-devops#artifact-download

@testcase-Azure Could you clarify the question further? As mentioned in the doc, you can choose which specific artifacts should be downloaded on the agent when the job executes in the UI.

@testcase-Azure Could you clarify the question further? As mentioned in the doc, you can choose which specific artifacts should be downloaded on the agent when the job executes in the UI.


Links not working

Hi, I am looking for a simple sample for BOT to Human Handoff (e.g. Agent via Skype). If I try to open following links I get just this Error: Error establishing a database connection
http://tomipaananen.azurewebsites.net/?p=1851
http://tomipaananen.azurewebsites.net/?p=2231
May be you can fix it?
Kind regards Jan

@Cdlhj Thanks for bringing this to my attention! I'm investigating the issue, and it starts to look like the database is just not there anymore! I managed to rescue the content from cache. I may want to change the blog platform altogether, but in the meanwhile will add the articles here.

Hi Tomi,
I appreciate your quick answer very much and I am looking forward to your articles.  Despite my age of 69 I am very new to the whole BOT story and I haven’t work with C# for at least 6 years, so you can imagine how “easy” is to start for me J
Kind regards from Switzerland
Jan Linhart
Von: Tomi Paananen<EMAIL_ADDRESS>Gesendet: Montag, 16. April 2018 13:07
An: tompaana/bot-message-routing
Cc: Cdlhj; Mention
Betreff: Re: [tompaana/bot-message-routing] Links not working (#16)
@Cdlhj https://github.com/Cdlhj  Thanks for bringing this to my attention! I'm investigating the issue, and it starts to look like the database is just not there anymore! I managed to rescue the content from cache. I may want to change the blog platform altogether, but in the meanwhile will add the articles here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/tompaana/bot-message-routing/issues/16#issuecomment-381563092 , or mute the thread https://github.com/notifications/unsubscribe-auth/Akn9YBewBKEQmRBeIbsv8TVoIx9-xg0Dks5tpHtkgaJpZM4TVjSQ .  https://github.com/notifications/beacon/Akn9YONQABKKDrSPReE2XoTKYyUOqJ8Jks5tpHtkgaJpZM4TVjSQ.gif

Migration has begun: https://tompaana.github.io/


Emoji in regex breaks MS search

What problem has occurred? What issues has it caused?
Charcoal-SE/SmokeDetector#5550 links to https://metasmoke.erwaysoftware.com/search?utf8=✓&body_is_regex=1&body=(%3Fs%3A\b[\s.>]*😍😍%2B\W*\b) which however produces a Ruby traceback for me.
Mysql2::Error: Got error 'nothing to repeat at offset 14' from regexp: SELECT COUNT(*) AS count_all, `posts`.`is_tp` AS posts_is_tp, `posts`.`is_fp` AS posts_is_fp, `posts`.`is_naa` AS posts_is_naa FROM `posts` WHERE (IFNULL(`posts`.`body`, '') REGEXP '(?s:\\b[\\s.>]*😍😍+\\W*\\b)') GROUP BY `posts`.`is_tp`, `posts`.`is_fp`, `posts`.`is_naa`

  respond_to do \|format\|
       format.html do
>>>      @counts_by_accuracy_group = @results.group(:is_tp, :is_fp, :is_naa).count
         @counts_by_feedback = %i[is_tp is_fp is_naa].each_with_index.map do \|symbol, i\|
           [symbol, @counts_by_accuracy_group.select { \|k, _v\| k[i] }.values.sum]
         end.to_h

What would you like to happen/not happen?
The regex is not really wrong; the search should run and show the hits, instead of crash.
Looks like the regex engine in MariaDB doesn't think an emoji is something you can repeat? Dunno if we can devise a workaround or should just defer this upstream.

Related: https://chat.stackexchange.com/transcript/message/61347168#61347168

This appears to be a limitation in the Regex implementation which is used in the database. It doesn't accept, or ignores, characters which are > 0xFFFF (either as characters or as Unicode escapes; e.g. \x{0b03}, which can have a max of 4 hex digits), so a lot of emoji just won't be recognized.


[Python] Parsing timestamp  with microsecond in CSV fails even with %f

Describe the bug, including details regarding any error messages, version, and platform.
I have a large set of CSV files I want to read with pyarrow. It's too large to fit into memory. So I'm using pyarrow.dataset.dataset to stream it into a parquet file.
I can successfully parse a timestamp like 2016/04/20 10:12:10. But I cannot parse one like 2016/04/20 10:12:10.123 or 2016/04/20 10:12:10.123456, even when I add .%f.
data.csv
a,t
1,2016/04/20 10:12:10.123456

import pyarrow as pa

schema = {
    'x': pa.int64(),
    't': pa.timestamp('us'),
}
dataset = ds.dataset(
    source='data.csv',
    format=ds.CsvFileFormat(
        convert_options=csv.ConvertOptions(
            timestamp_parsers=[
                "%Y/%m/%d %H:%M:%S.%f",
                "%Y/%m/%d %H:%M:%S",
            ]
        )
    ),
    schema=pyarrow.schema(schema)
)

dataset.to_table().to_pandas()

This results in an error:

ArrowInvalid: Could not open CSV input source '/home/matthew/data/debug/testcsv/data.csv': Invalid: In CSV column #1: Row #2: CSV conversion error to timestamp[us]: invalid value '2016/04/20 10:12:10.123456'

Note that the documentation for timestamp_parsers says:

A sequence of strptime()-compatible format strings, tried in order when attempting to infer or convert timestamp values (the special value ISO8601() can also be given). By default, a fast built-in ISO-8601 parser is used.

And using plain datetime.datetime.strptime does work for this formatting string.
from datetime import datetime
datetime.strptime("2016/04/20 10:12:10.123456", "%Y/%m/%d %H:%M:%S.%f")

If I delete the microsecond component in the CSV, it runs without error. If I also delete the first format string, leaving only the one with .%f, I get an error, as expected. If I try with a CSV without the microsecond component, and with the 2 format strings swapped, it works. This shows the pyarrow is indeed using the format strings I'm trying to give it.
Note that for my real use case my data has only 3 decimal digits, not 6. (Initially I wondered whether %f only works for 6. But plain datetime.strptime works with 3 too.) For my use case I actually don't care if the fractional part is discarded.
Component(s)
Python

The strptime() format is processed by C's strptime() not Python's strptime.
So we can't use %f in it...


vsts release deploy to kubernetes. Container registry throws 400 with inner exception

Environment

Server - VSTS Linux Hosted

Issue Description

Add a "Deploy to kubernetes" task and configure it with Azure resource manager.
Expand "secrets" and enter Container registry type, Azure subscription, and try to get a list of azure container registry.

The action fetching the list for the Azure container registry dropdown is failing with a inner exception of:
{"$id":"1","innerException":null,"message":"Neither service connection id nor service connection details is present. Provide any one of them.","typeName":"Microsoft.TeamFoundation.DistributedTask.WebApi.InvalidServiceEndpointRequestException, Microsoft.TeamFoundation.DistributedTask.WebApi","typeKey":"InvalidServiceEndpointRequestException","errorCode":0,"eventId":3000}
All fields available in the UI is filled out, the registry is used in the build pipe to push the docker container image.
Error logs
POST to https://seamlessno.visualstudio.com/579487ca-9a4e-4149-92a1-90aed12ad374/_apis/serviceendpoint/endpointproxy?endpointId=azureSubscriptionEndpoint2
Response >
{"$id":"1","innerException":null,"message":"Neither service connection id nor service connection details is present. Provide any one of them.","typeName":"Microsoft.TeamFoundation.DistributedTask.WebApi.InvalidServiceEndpointRequestException, Microsoft.TeamFoundation.DistributedTask.WebApi","typeKey":"InvalidServiceEndpointRequestException","errorCode":0,"eventId":3000}
If adding the kubernete cluster as a Kubernetes service connection i can select correct Azure Container Registry, but i then have an error in kubernetes about not being able to fetch image due to credential errors.

Wonderfull @bansalaseem. Do you know when it will be live at dev.azure.com or the old vsts portal (probarly the same though)?

It should be live on dev.azure.com now.


Remove version: Sogou.SogouInput version <IP_ADDRESS>19

[Automated] It returns code over 400 in all urls
Microsoft Reviewers: Open in CodeFlow

URL: https://ime.sogoucdn.com/sogou_pinyin_<IP_ADDRESS>19.exe
Response Error: The remote server returned an error: (403) Forbidden.
(Automated message - build 910)


build: change verbosity and strip console in production env

Codecov Report

Merging #125 (f0be342) into master (2e2ffa4) will increase coverage by 1.71%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
+ Coverage   94.71%   96.42%   +1.71%
==========================================
  Files          24       24
  Lines         208      196      -12
  Branches       36       34       -2
==========================================
- Hits          197      189       -8
+ Misses          9        6       -3
+ Partials        2        1       -1

Impacted Files
Coverage Δ

src/context/createContext.ts
100.00% <100.00%> (ø)

src/errors/FatcherError.ts
100.00% <100.00%> (ø)

src/utils.ts
100.00% <100.00%> (+11.42%)
: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 2e2ffa4...f0be342. Read the comment docs.


fix: fellow shall not be block

RR: @kaiwalyakoparkar @Vyvy-vi

Closing PR as it is a duplicate config change, fellow already exists

@eddiejaoude not sure why does it block it?

from their docs the word fellow is grouped as part of gal-guy
woman (female), gal (female), lady (female), babe (female), bimbo (female), chick (female), guy (male), lad (male), fellow (male), dude (male), bro (male), gentleman (male)
https://github.com/retextjs/retext-equality/blob/main/rules.md
We need to write a wrapping around AlexJS to be more granular

We need to write a wrapping around AlexJS to be more granular
Eddie, wouldn't it be better to maybe make our own Retext-Plugin from a fork of Alexjs, instead of making a wrapper?
(The Alexjs maintainer recommended doing this, and I think this way we can make a tool that can be used by a lot of people in other communities, while also making specifications that are specific and applicable)


restricted account issue

Hello, I can't get access to chibisafe from my unraid server, I created a template from your directory. It is impossible to access my account because "This site has disabled public uploads. You need an account. " . what is the procedure to follow to be able to access it?

Hello @killforby
I think you've already asked this in the Discord but I'll respond to your issue on GitHub. You need to change the following value to true in the docker template on unRAID. Like so.

You can also edit it by signing into the admin account using the default login "admin" for both username and password.
Hope this helps. :)

I'm closing this since the new version was just pushed to master.


adding lethargy option to axis

It would be nice to allow per unit lethargy axis options to the plots
this would need to get the energy bin width as part of the calculation

this code might help, thanks to Patrick for this example

# makes the spectrum tally
energy_filter = openmc.EnergyFilter.from_group_structure('CASMO-70')
spectrum_tally = openmc.Tally(name="spectrum tally")
spectrum_tally.filters = [energy_filter]
spectrum_tally.scores = ['flux']

# gets the tally result
with openmc.StatePoint(sp_filename) as statepoint:
    spectrum_tally_out = statepoint.get_tally(id=spectrum_tally.id)

# gets the bin
bin_boundaries = np.unique(energy_filter.bins).copy()
bin_boundaries[0] = 1e-10

flux = spectrum_tally_out.mean.flatten() # particle / source

# need to normalize flux by the log-width of the energy bins
log_de = np.log10(bin_boundaries[1:]/bin_boundaries[:-1])
flux = flux / log_de

plt.step(np.unique(energy_filter.bins)[:-1], flux)
plt.xscale('log')
plt.show()


Cloning an object should mention .getOwnPropertyDescriptors

The question titled: How do you clone an object in JavaScript?
The answer should mention the fact that getters and setters do not get copied in the ways you've currently described and that you need to use Object.defineProperties({}, Object.getOwnPropertyDescriptors(obj)) to get a full shallow copy including the getters and setters. Using only spread to copy makes some kinda weird stuff happen with getters/setters. Spread operator copies the result of a getter if it was ran at that time and stores it as a property, it's pretty odd.
Here's a jsfiddle that shows what I'm talking about: https://jsfiddle.net/z3gszLmL/3/

There's two ways we can take this:

Assuming Objects are POJS(Plain Old Javascript) which means no Getter or Setters as then it becomes an instance of a custom type with no prototype
Include information about proxies(Getters, Setters, actual Proxies) and custom types and attempt to support them

I'm more for version 1 since program modification of an Object needs to be documented and should be known by the developer. At that point it's no longer an Object but a custom type as a Developer should always know what is happening in their code(after all they're the ones who maintain it)
This could open a corollary question about "How do you clone an Object with Proxy Methods?" which requires some CS knowledge on what a Proxy Method is, and thankfully can be marked Expert since this is some knowledge that most people can get by without ever actually needing, but in certain situations can be extremely useful.

Since there haven't been any other opinions expressed in the past week we'll be going with 'assume POJS' and issuing a won't fix tag.


doesn't work at all for me

i'm using pip3 install malmo and it's giving me this
edit: i'm on python 3.10
ERROR: Could not find a version that satisfies the requirement malmo (from versions: none)
ERROR: No matching distribution found for malmo
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\cozmo\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.

I believe this is only compatible with version 3.6 or lower. There are some comments in the install scripts that call for that.

Latest version (<IP_ADDRESS>) appears to only be downloadable when I'm using Python version 3.7.


sddm fails to start on 17.03, master

Issue description
sddm fails to start, complaining many times about being unable to find 'QtQuick'.
My configuration works on c458d7cf94ebe181665511a7daaa3cb337a04bc4 but fail on current nixos-17.03, release-17.03, and master branches.
It seems this was missed because the NixOS test for SDDM uses an auto-login mechanism that apparently avoids the problem.  Modifying the test to instead just let SDDM run reproduces the issue.  See below.
Steps to reproduce
AFAIK simply adding xserver.displayManager.sddm.enable = true; to configuration.nix does the trick, however here's a NixOS test that demonstrates the issue.  It works for me on the mentioned good-commit above, and fails on current master:
import ./make-test.nix ({ pkgs, ...} : {
  name = "sddm";

  machine = { lib, ... }: {
    imports = [ ./common/user-account.nix ];
    services.xserver.enable = true;
    services.xserver.displayManager.sddm.enable = true;
    services.xserver.windowManager.default = "icewm";
    services.xserver.windowManager.icewm.enable = true;
    services.xserver.desktopManager.default = "none";
  };

  enableOCR = true;

  testScript = { nodes, ... }: let
    user = nodes.machine.config.users.extraUsers.alice;
  in ''
    startAll;
    $machine->waitForText(qr/ALICE/);
    $machine->screenshot("sddm");
    $machine->sendChars("${user.password}\n");
    $machine->waitForFile("/home/alice/.Xauthority");
    $machine->succeed("xauth merge ~alice/.Xauthority");
    $machine->waitForWindow("^IceWM ");
  '';
})

Save this to a file named sddm-manual.nix in nixos/tests/ (next to the existing sddm.nix test), and execute it:
$ nix-build ./sddm-manual.nix

You'll see the QtQuick errors spewed many times before giving up.  Note that this test is a bit weak due to its OCR usage and in particular the hardcoding of 'ALICE' in caps due to the default slim theme.
LMK if you have any trouble reproducing this.
(PS: WOW these NixOS tests are powerful and amazing!! Haha GJ all involved :heart:)
Technical details

System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
Nix version: (run nix-env --version)
Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)

cc @abradar @ttuegel (SDDM maintainers, and recent SDDM/plasma activity that seems related)

Marked as a blocker by request to ensure it is triaged in time.

I was (trying) to bisect this on master just now. I wasn't having any success, because master is totally broken right now. Perhaps I will have more luck on release-17.03.
Thanks for writing this test; it seems much better than the one we have now.

@dtzWill Your test never completes on my machine. Is there anything we can do to speed it up?

Oh, that's my mistake. The indicated "good" commit is in fact bad, but for another reason.

@ttuegel it should complete on c458d7cf94ebe181665511a7daaa3cb337a04bc4, does it not?
On current master/17.03 it does not complete, I didn't make it fail particularly gracefully -- it'll just look forever for SDDM to start (which it doesn't due to the QtQuick errors).
If you've fixed those errors, it's possible the OCR isn't matching the theme used on newer nixpkgs.  You can check this by running the test manually.

Looks like the test should actually finish after 900 times of (check OCR + 1 second sleep), which means at least 15 minutes (which I certainly didn't wait for :innocent:).  If you're doing a bisect this does seem much to slow, it'd probably be worth putting together a fast-fail test that checks for the QtQuick error or something.  Would that be useful? (Also, are you on IRC? :))

Looks like the test should actually finish after 900 times of ('check OCR' + 1 second sleep), which means at least 15 minutes (which I certainly didn't wait for 😇).

I don't have the fastest test machine, but it was over 40 minutes. It is fixed on the release branch now. I am pushing it to master with your improved test after I check if this also fixes the Plasma test failure. If you wanted to make a PR to master for a faster-failing test, that would be most welcome!

Oh wow that seems wrong.  This is my first NixOS test (mostly looked to the lightdm test for inspiration) so I apologize if it does something silly that resulted in wasting your time.
Anyway, thanks for looking into this and for the fix! I'll confirm shortly.

Err, nevermind.  It doesn't seem to evaluate for me currently? It's not your change.  Lemme cherry-pick your fix over to a different branch ...

I cherry-picked 056db1c725be6d9db031dcc420c41cc30b36028b onto nixos-17.03-small (b1097b9cb3ab040badf526e9d15cfe798442d910) and ... it works! :+1:

Oh wow that seems wrong. This is my first NixOS test (mostly looked to the lightdm test for inspiration) so I apologize if it does something silly that resulted in wasting your time.

It's no problem! I was actually very confused because on Hydra, the tests have a very constraining timeout window. I guess that doesn't apply if you run the tests locally? I couldn't find out how the timeouts are implemented...
In any case, this was actually unrelated to the Plasma problem in master, but this fix is in master and release now.

Test actually completes in 22 secs here:
nix-build sddm-test.nix --check  1.06s user 0.11s system 5% cpu 22.853 total

Ah yeah failing test cases sadly always take 15 minutes to time out..


Removed LOG from IndexedSet for jira TACHYON-1289

This is a pull request for jira TACHYON-1289

Can one of the admins verify this patch?

Jenkins, test this please.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Tachyon-Pull-Request-Builder/6916/
Test PASSed.

Thanks!

@elonazoulay , could you please create PR to the master branch? Thanks!


changed error handler res.send to fix express deprecation warnings

I think I clicked the wrong button here, I meant to merge on Oct15th, thanks again


Enable Tide for DWD

How to categorize this issue?

/area dev-productivity
/kind enhancement
/priority 3
What would you like to be added:
DWD uses prow for builds & tests. With v1.0 version integrated into gardener we should now focus on the leftover of enabling Tide for DWD. This will also complete the prow integration and will bring the usage in conformance with what gardener also uses.
Why is this needed:

Following PRs have been merged and Tide is enabled

https://github.tools.sap/kubernetes/gardener-robot/pull/368
https://github.com/gardener/ci-infra/pull/685

Closing this issue.


Mobility docs TOC - add overview + rename tutorial and glossary

With mobility in its own section, there are some lingering content issues:

add overview topic, which used to be the main index.md file
rename terminology to glossary, which is the style we are adopting
rename Add routing to a map to Tutorial, which is simpler

Looks good in preview.


Use int instead of size_t in the CApi's structures

GCApiDictionary, AGCApiList, urlfilter_multirules_t - these structures use size_t

No need to test


Showcase Submission for 62-plinko-with-matterjs

Thank you Sahand Babali for your contribution! A member of the Coding Train team will review it shortly.

Galton Board Simulator
Sahand Babali

This is wonderful, thank you for sharing!


Angular translate - return value of .determinePreferredLanguage() for drop down menu

I have described my issue on Stack Overflow here - if I get an answer there, I'll make note of it on this request.
I have created a drop down menu of language choices using angular-translate. I want the default language choice to be the value obtained from $translateProvider.determinePreferredLanguage(). I cannot figure out how to access this value. The code below works in regards to allowing the user to change the language, but there is nothing displayed on the drop down menu by default. I know that "{{$translateProvider.determinePreferredLanguage()}}" is wrong, as it's the function itself and not what it's returning. However, I cannot figure out how to display the user's default language.
HTML for drop down:
<select class="form-control language-selector"
name="changeLanguage"
ng-model="langKey"
ng-change="changeLanguage(langKey)"
>
<option value="">{{$translateProvider.determinePreferredLanguage()}}</option>
<option ng-repeat="language in languages" value="{{language.abbr}}">{{language.lang}}</option>
</select>

In my helperService.js file, I have the languages defined as follows:
helper.languages = [
{abbr: "ar", lang: "العربية"},
{abbr: "zh-cn", lang: "简体中文"},
{abbr: "zh-tw", lang: "中國，繁體（台灣)"},
{abbr: "en", lang: "English"},
{abbr: "fr", lang: "Français"},
{abbr: "de", lang: "Deutsch"},
{abbr: "it", lang: "Italiano"},
{abbr: "ja", lang: "日本語"},
{abbr: "ko", lang: "한국어"},
{abbr: "pt-br", lang: "Português (Brasil)"},
{abbr: "ru", lang: "Pусский"},
{abbr: "es", lang: "Español"}
];

So, if the user's default is 'en', it should display 'English' in the drop down by default. Or, if it's 'de', it should say 'Deutsch'. Any suggestions? Thanks!

Maybe the additional language attribute https://angular-translate.github.io/docs/#/api/pascalprecht.translate.directive:translateLanguage ?


Save build artifacts in CI

Changes

Circle CI now saves the built libraries (including the metadata JSON) and the paclet file as artifacts.

Comments

Note that the paclet file only has the Linux library. We will need to either cross-compile or run jobs on Mac and Windows to get a multi-platform paclet file, which is the goal.
If we can achieve that, we will no longer need to rely on internal Wolfram infrastructure for building (which is inaccessible to external developers).

Examples

Here they are: https://app.circleci.com/pipelines/github/maxitg/SetReplace/1292/workflows/bea84003-2279-43e9-8b84-87d013e6d532/jobs/1683/artifacts

This change is

@taliesinb, that will definitely be useful, but it will be difficult to include them into the CI builds because Circle CI does not seem to support ARM yet: https://discuss.circleci.com/t/arm-builds/29102. Perhaps we can cross-compile them from Linux.

The goal is to have the builds on macOS and Windows as well. Then, we can create the multi-platform paclets suitable for releases completely on Circle CI, which means we won't have to rely on internal Wolfram infrastructure, which is suboptimal because:

Only internal people have access.
Even I don't have access to changing the build config, which means doing something as simple as changing Xcode or WL version might take 100+ hours.
It is congested, sometimes it takes a significant amount of time for the build to even start. It's gotten better recently after updating the Xcode version (see the previous item), but on Circle CI the builds always start instantly.
It is manual, one has to connect to the VPN, push a specific branch to stash, and start the build, whereas Circle CI will run automatically for all commits on all branches, and will immediately tell us if the builds on other platforms fail.

And also, once Circle CI can create paclets, we can implement a CD as well, where the paclets will just get deployed automatically after each new build to master without any manual involvement. We can even set it up in a way that it auto-updates users' paclets without any work from our side except for merging a branch to master.

I see, that seems really convenient.
I once wanted to build a paclet for macos and didn't know how to do that.


:bug: Refactor taint usage and flow controll in node_reuse e2e test attempt 2

This commit:

introduces wait loops that wait for all pods to be running at the end of scale up and scale down cycles to make sure that the workloads of the cluster won't get stuck or kept in scheduling longer than absolutely needed
disables control plane node tainting during the node_reuse test to get rid of the complexity of managing taints parallel to scale up/down async processes
noSchedule taints are disabled for control plane nodes because of an other reason also, namely that during most of the test there are no other nodes than control plane nodes available for scheduling so it doesn't make sense tainting them

/test-centos-e2e-feature-main

/test-centos-e2e-integration-main

/close


doc generation: optionally allow API doc author to specify packages in left navigation without duplicating those entries in the main package

This issue was originally filed by<EMAIL_ADDRESS>
For angular.dart, we have created libraries for filters and for directives to enable the user to view all filters in one location, or to view all directives in one location.
We can include these by specifying the appropriate files to include during doc generation. However, because angular/filter/module.dart and angular/directive/module.dart are also exported by angular.dart (developers never need to explicitly include them, they are part of angular.dart), the terms are then defined twice: the same filter doc appears on both angular.filter, and angular.dart library pages.
We'd like to be able to generate the docs for these libraries and have the docs for them appear only under angular.filter or angular.directive, not under angular.dart.

Thanks for the report. However, we don't plan to address this issue with dartdocgen. New dartdoc tool coming online: https://github.com/dart-lang/dartdoc


[Android] Enabling Offline Caching Using Room Persistence Library for Data Fetched with Retrofit in Jetpack Compose

Enabling Offline Caching Using Room Persistence Library for Data Fetched with Retrofit in Jetpack Compose
Proposed article introduction
Offline caching allows an application to access the data of the app even when not connected to the internet. This is possible in apps that require an internet connection only if the data is cached in the local storage. Room persistence library provides this capability by allowing you to cache the data from a remote server into your local database which can then be accessed offline. We will build the application using the Clean architecture pattern and Jetpack compose.
Key takeaways

What is offline caching.
How to use Room to cache data offline with retrofit
What is Clean Architecture
How to build an app that fetches data with Retrofit and cache using clean architecture

Article quality
The contents that are published online are lacking the implementation of offline caching with room in Jetpack compose and clean architecture. This article is going to use that clean architecture pattern and Jetpack compose.
References
N/A

Thank you for submitting your topic.
After some careful consideration, it struck us that this topic may be a bit over-saturated throughout other blog sites and official documentation.
We believe this is the best way for students to build a great portfolio (for potential employers) is by building what does not exist and what can provide the most value.
Please feel free to suggest an alternate topic to explore. 🚀


Template not work as expected

I'm using Visual Studio Community 2022 to create a basic c# mod using the template.
After building the project, I found the following issues :

Variables in SubModule.xml not being replaced
Both build output and  _Module are not copied to the GAMEPATH/Modules

Sorry for the delayed answer! Was the environment variable set? Was the path on a protected path that required specific access rights?

A strange issue then!
For the module to get copied into the game's module folder, our MSBuild tasks check whether the _Module folder exists, the GameFolder variable path exists and whether ModuleName is set.
 The template didn't depend on the latest version of the package because we haven't adapted to it, and the change didn't increase the major version part for some reason.
We split ModuleName into ModuleId and ModuleName, so you most likely lack the variable.
Adding <ModuleId>$(MSBuildProjectName)</ModuleId> should fix the issue!
Also, don't update Newtonsoft.Json, because the game installs the 11 version and it's used no matter what version your mod will distribute. Any 12.x or 13.x new feature usage will result in a crash

Adding <ModuleId> works, thanks for your help!


Numpy compatible logaddexp2

Description

Added np.logaddexp2 and its docs for future rendering. Scalar calculation is supported.
Fixed zero-size tensor error in BinaryBroadcastBackwardUseIn (GPU version).

Checklist
Essentials

[x] Changes are complete (i.e. I finished coding on this PR)
[x] All changes have test coverage:
Unit tests are added for small changes to verify correctness
[x] Code is well-documented:
For user-facing API changes, API doc string has been updated.
[x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

[x] Added np.logaddexp2 and its docs for future rendering. Scalar calculation is supported.
[x] Fixed zero-size tensor error in BinaryBroadcastBackwardUseIn.

Comments

The previous error case description: when one operand is non-zero-size (eg. shape of (1, 3)) and the other is zero-size (eg. shape of (2, 0, 3)), the backward calculation on GPU will raise a floating point error. Temporarily fixed in this PR as well as PR numpy compatible logaddexp.

@haojin2

Passed all CI tests on August 21st.


The code is missing the relogic.logickit file！please !

I'm trying to pre-train the GAP on my own datasets from scratch,  but I found that there is no logickit file under the relogic(more spercifically the 'AverageSpanExtractor' class is essential ), which is necessary in the TaBARTModel in 'relogic/pretrainkit/models/semparse/tabart.py' and somewhere else
Does the author have not uploaded yet?
Hope someone could hep.
Thanks

You can first refer to the https://github.com/Impavidity/relogic/blob/master/relogic/logickit/modules/span_extractors/average_span_extractor.py.
I will reorganize the pre-training code later.

You can refer to the pull request https://github.com/awslabs/gap-text2sql/pull/23 for more details.


[Feature Request] Connection state listener

It would be greate to have a listener for wifi connection state :)
States: Enabled / Disabled / Connected / Disconnected, ...

Hi @ithieund,
We use NetInfo for monitoring the network.
Check issues #4,#2

@devstepbcn ,
I used that way already.
It would be nice if these event can be handled within the plugin api :)


Add '001', '002', '003' etc - instead of '1', '2', '3', etc

https://github.com/brainlife/ezbids/blob/7848dbb9cd52628e2e2e45677a41eefcf721bc56/ui/src/libUnsafe.ts#L319
@dlevitas can we please default to run numbers with leading zeros (better for sorting on unix/linux and predicting larger datasets). What I mean is that, instead of filling in run number as
run1-
run2-
run3
etc
we should be filling in as
run001-
run002-
run003-
etc

@francopestilli according to the BIDS specification:
If several scans with the same acquisition parameters are acquired in the same session, they MUST be indexed with the run-<index> entity: _run-1, _run-2, _run-3, and so on (only nonnegative integers are allowed as run labels).
Based on this, ezBIDS doesn't zero-pad any entity label that requires an index (i.e. integer) value.
Newer versions of fMRIprep adhere more strictly to the use of run integer values. For example, if someone's BIDS dataset used run-01, the fMRIPrep derivatives output would be run-1. I believe this has to do with the use of PyBIDS.
I agree that not zero-padding can be visually unappealing from a sorting perspective with >10 runs. For now, I think the default ezBIDS behavior is correct and should remain this way unless the BIDS specification changes.

I agree with @dlevitas This is dictated by BIDS specification so we can't change it.
sub- on the other hand, can be 0-padded and we already do that.


#maybe_escape_html chokes when input is an Integer

My CI pipeline suddenly fails when upgrading from 3.8.0 to 3.9.0.
I believe this is related to #1950.
Steps to reproduce

It seems like my code hands over an integer to #maybe_escape_html. This is not expected by the code.

Expected behavior
No Exception
Actual behavior
     NoMethodError:
       undefined method `empty?' for 2016:Integer
             return text if text.nil? || text.empty?
                                             ^^^^^^^
     # /usr/local/bundle/ruby/3.1.0/gems/view_component-3.9.0/lib/view_component/base.rb:312:in `maybe_escape_html'
     # /usr/local/bundle/ruby/3.1.0/gems/view_component-3.9.0/lib/view_component/base.rb:326:in `safe_render_template_for'
     # /usr/local/bundle/ruby/3.1.0/gems/view_component-3.9.0/lib/view_component/base.rb:109:in `render_in'

first thoughts:

One could convert the text to string first before calling #empty?, similar to how Slot#html_safe? works. See https://github.com/ViewComponent/view_component/blob/main/lib/view_component/slot.rb#L99C6-L99C6

Note that to_s.html_safe? should actually be not necessary, since Rails implements html_safe? on the Numberic and Object classes

System configuration
Rails version: 7.0.8
Ruby version: 3.1.4
Gem version: 3.9.0

@tmaier i aprreciate your speedy bug report, could you possibly add a failing test case as a pr so we can fix this bug

Similarly, I've got a component that now errors when trying to render a slot.
class ArtworkLinkComponent < ViewComponent::Base
  renders_one :empty_state

  def initialize(attachment:, variation:, url:)
    @attachment = attachment
    @variation = variation
    @url = url
  end

  def call
    return empty_state unless @attachment.attached?

    link_to @url do
      image_tag @attachment.variant(@variation)
    end
  end
end

render ArtworkLinkComponent.new(attachment: user.avatar, variation: :thumbnail, url: user_url(user)) do |component|
  component.with_empty_state do
    'No avatar'
  end
end

This works fine on 3.8.0 but errors on 3.9.0. This is because here, text is a ViewComponent::Slot, which does not have an empty? method.
This results in:
NoMethodError:
  undefined method `empty?' for nil:NilClass

# .gems/ruby/3.2.0/gems/view_component-3.9.0/lib/view_component/slot.rb:95:in `public_send'
# .gems/ruby/3.2.0/gems/view_component-3.9.0/lib/view_component/slot.rb:95:in `method_missing'
# .gems/ruby/3.2.0/gems/view_component-3.9.0/lib/view_component/base.rb:312:in `maybe_escape_html'
# .gems/ruby/3.2.0/gems/view_component-3.9.0/lib/view_component/base.rb:326:in `safe_render_template_for'
# .gems/ruby/3.2.0/gems/view_component-3.9.0/lib/view_component/base.rb:109:in `render_in'

I guess that means ViewComponent::Slot's @__vc_component_instance is nil?

I just noticed if I add a .to_s, everything works fine:
return empty_state.to_s unless @attachment.attached?
                  ^^^^^ Added this

@tmaier @natematykiewicz thank you for letting us know, I am investigating this issue

Also keep in mind that a user may be producing HTML even if the request format isn't #html?.   For example I may request a json format but I'm using ViewComponent to render HTML into one of the fields in the json.   So this conditional my need to change: https://github.com/ViewComponent/view_component/pull/1950/files#diff-b69c75ffd85596e0b5fca1327059ecf3b2930f3f77004c78a268fa85e8ec8d9eR311

@jcoyne right I get that, but there's no way for the framework to know what format to render unless it checks request.html?. The only way to ensure safety for eg. JSON responses is for the #call method to return escaped HTML when necessary. In other words, I don't think the framework should be responsible for escaping in these cases.

@camertron Shoudn't it always work consistently?  It's more difficult to reason about if it works differently in different contexts.

@jcoyne how would you expect the framework to behave in this case? It could always escape, but then output from template engines like jbuilder will get escaped too, which I would argue is pretty surprising and undesirable. We could add a parameter somewhere, but it's not clear where it should go. Any ideas?

@jcoyne how would you expect the framework to behave? It could always escape, but then output from template engines like jbuilder will get escaped too, which I would argue is pretty surprising and undesirable. We could add a parameter somewhere, but it's not clear where it should go. Any ideas?

Just my thoughts we could add this together with actual support for other mime types such as json

@camertron I think the way that would be most explicit would be to add a method like render_with_escaping to be added as a controller method and steer people to use that if they render directly from a controller.

@jcoyne I disagree. It's a Rails convention to escape unsafe input by default. I'd instead argue for render_without_escaping, if we were to go that route.

@joelhawksley The problem I have right now is that it's not escaping html by default for me (because I'm putting it in a json request).   I need a way to do the escaping in a way that I do not have control of with the current implementation.

@reeganviljoen true, but we would still have the issue of rendering content for one MIME type for use in another.

The problem I have right now is that it's not escaping html by default for me.

@jcoyne I don't understand why this problem has arisen as a result of the change released in v3.9.0, since the original (unsafe) behavior was no automatic escaping by default as well. In other words, you should have had this problem in all previous versions of the framework.
I agree with @joelhawksley that we should escape by default, but only when generating HTML. Performing HTML escaping in non-HTML contexts is surprising and not appropriate IMO. The underlying issue here is that template engines like ERB escape HTML automatically, but in the case of content returned from a #call method, there is no template engine at play. Since the component creator is effectively providing their own template engine, it stands to reason they would also be responsible for any escaping. I added automatic escaping in v3.9.0 just in case someone forgets to do it themselves, which mimics what the template engine would do. The warning that gets printed should alert component authors to fix any HTML safety issues, since #call methods should always return HTML-safe strings. In other words, the framework should have no need to escape anything if #call returns sanitized output.

I need a way to do the escaping in a way that I do not have control of with the current implementation.

Is it possible to call #html_escape or #html_safe in your #call method, or when the JSON response is being constructed? I'd say you have exactly the same amount of control as you have with the current implementations of ERB, Slim, HAML, etc.

I don't understand why this problem has arisen as a result of the change released in v3.9.0, since the original (unsafe) behavior was no automatic escaping by default as well. In other words, you should have had this problem in all previous versions of the framework.

What I mean to say is that 3.9.0 is both broken (raises an error), but even with that fixed, it doesn't do the expected escaping for my use case.

What I mean to say is that 3.9.0 is ... broken (raises an error)

Ok gotcha. That error should be fixed in the upcoming 3.10.0 release, which I'm preparing now.

but even with that fixed, it doesn't do the expected escaping for my use case.

Sure, but the framework has never performed the kind of escaping your use case expects. Unless I'm really missing something, I think the right thing to do is to use the HTML escaping mechanisms already available to you, eg. #html_safe and #html_escape.

I think the right thing to do is to use the HTML escaping mechanisms already available to you

I'm just rendering a component to a string and then sticking that string into a json object.   It seems weird that I have to do some special escaping when I render a component to a string that is unnecessary when I render it in a controller (with html format).   This is coming back to consistency. It would be much simpler for the user if rendering a component that produces html, always produces the same output whether rendered to a string, mailer, turbo stream broadcast, or in a controller. I think it's unfortunate that you'd need to remember to do custom escaping in 3/4 of those cases.

Alright @jcoyne I hear what you're saying 😄 Let's move this discussion elsewhere, since it's really a feature request/bug report that's only tangentially related to this #maybe_escape_html issue. Would you mind filing a separate issue?

This should be fixed in v3.10.0 🎉


fixed adding of empty new header when no more header fields available

this also removes some unused code

@cianclarke could you please review?

Looks great


When i run the program. Error: network is unreachable

from mininet.net import Mininet
from mininet.node import Host, Node
from mininet.cli import CLI
from mininet.link import TCLink

def ipv6_to_ipv4_tunnel():
    net = Mininet()

    # IPv6 hosts
    h1 = net.addHost('h1', ip6='2001:db8:1::1/64', ipv6_default=True)
    h2 = net.addHost('h2', ip6='2001:db8:1::2/64', ipv6_default=True)

    # IPv4 host
    h3 = net.addHost('h3', ip='<IP_ADDRESS>/24', defaultRoute='via <IP_ADDRESS>')

    # Router for 6to4 tunnel
    r0 = net.addHost('r0', cls=Node, ip='<IP_ADDRESS>/30')

    # Links (h1, h2 connect to router with IPv6)
    net.addLink(h1, r0, intfName1='h1-eth0', intfName2='r0-eth0', params1={'ip': '2001:db8:1::1/64'}, params2={'ip': '2001:db8:1::2/64'}, ipv6=True)
    net.addLink(h2, r0, intfName1='h2-eth0', intfName2='r0-eth1', params1={'ip': '2001:db8:1::2/64'}, params2={'ip': '2001:db8:1::1/64'}, ipv6=True)

    # Link between router and h3 (uses IPv4)
    net.addLink(r0, h3, intfName1='r0-eth2', params1={'ip': '<IP_ADDRESS>/30'}, params2={'ip': '<IP_ADDRESS>/24'}, ipv4=True, cls=TCLink, bw=10)

    # Configure 6to4 tunnel on router
    r0.cmd('ip tunnel add tun0 mode sit remote <IP_ADDRESS> local <IP_ADDRESS>')
    r0.cmd('ip link set dev tun0 up')
    r0.cmd('ip addr add 2002:beef::1/64 dev tun0')
    r0.cmd('ip -6 route add ::/0 via 2002:c000:201::1 dev tun0')

    net.start()

    # Add default routes for h1 and h2
    h1.cmd('route add default gw <IP_ADDRESS>')
    h2.cmd('route add default gw <IP_ADDRESS>')

    # Test ping between IPv6 and IPv4 hosts
    print(h1.cmd('ping <IP_ADDRESS> -c 4'))
    print(h3.cmd('ping6 2001:db8:1::1 -c 4'))

    CLI(net)

    net.stop()

if __name__ == '__main__':
    ipv6_to_ipv4_tunnel()

If you have ruled out other potential errors such as

routing configuration
IPv6 configuration
subnet masks
IP Addr conflicts

There is a subtle error to consider:
In Mininet, by default, there may be firewall rules restricting network communication.
You can try disabling the firewall in the script or manually configuring the relevant rules.


Constant support

This is a work-in-progress constant support, defined with either const and define().
Side Note
I'm dubious about opening the PR here. Initially, I was going to make an issue before starting to work on it; but, unfortunately, for some unknown reason, the Issues pane is not available. This is why I started with a commit having nothing to do with the issue itself. :)
The topmost-upstream repository has the most stars, so I first decided to make the progress there. But, I'm now doing it here because of two reasons: (1) the vendor of the repo (php-stubs), both for its name and having other stub-related repositories focused, and (2) being more recently updated (and having a more active GitHub user as its maintainer).
So, I'm not really sure whether it's a good decision, but it's better than nothing. :) Waiting for your thoughts on this as well.

Hello @machitgarha!

the Issues pane is not available.

This is a fork under pressure :) See the latest commits.

This is a work-in-progress constant support, defined with either const and define().

Your PR is welcome.

Hello, @szepeviktor.
I love quick responses on GitHub. Thanks. :)

Tested against my other project, Bimoo, and it seems to work fine.
P.S.: Unrelated to the repository itself, but would you mind moving Bimoo completely to php-stubs organization? It may become more visible and useful to people using Moodle.

moving Bimoo completely to php-stubs organization?

To php-stubs/moodle-stubs?

If you are wiling to move, please clone e.g. the WooCommerce stubs repo and set up finder.php

by adding all files with user-facing (non-internal) classes, functions
excluding compatibility and deprecated ones

@szepeviktor
Does this PR need something more to be done in order to be merged?

Just change those double quotes to single quotes.

moving Bimoo completely to php-stubs organization?

To php-stubs/moodle-stubs?

Maybe. Personally, I prefer the project name 'Bimoo' to remain, if it's possible. However, being used by more people is much more important than that. So, I would like to move it, willing you not renaming it. :)

So, I would like to move it, willing you not renaming it. :)

It may keep its name. moodle-stubs is SEO and user friendly!

Just change those double quotes to single quotes.

Oh... it's easier for me to change all single quotes to double quotes than those double quotes to single quotes. My mind doesn't work that way. :)
But OK. I'll do it.

If you are wiling to move, please clone e.g. the WooCommerce stubs repo and set up finder.php
* by adding all files with user-facing (non-internal) classes, functions

* excluding compatibility and deprecated ones

Is there a guide for it to cover everything I have to do (and maybe talk about it there), or it is limited to these statements? If so, I have some questions:

Do I have to include every function and class that a user may need, but I'm not aware of? Or what you mean is, not to include something internal? Or both?
Moodle still supports version 3.9, while it's latest is 3.11. Do I have to (or should I) take those into serious consideration, or no, or at all I have not to care about it?

So, I would like to move it, willing you not renaming it. :)

It may keep its name. moodle-stubs is SEO and user friendly!

Right. It's up to you then. :)

Do I have to include every function and class that a user may need, but I'm not aware of? Or what you mean is, not to include something internal? Or both?

Simply include all minus internals, deprecated and compat.

Moodle still supports version 3.9, while it's latest is 3.11. Do I have to (or should I) take those into serious consideration, or no, or at all I have not to care about it?

Stubs follow the source with every tag. So initially we release 3.9.0 - up to the latest.
Please see the release script and the generator script: https://github.com/php-stubs/woocommerce-stubs

Do I have to include every function and class that a user may need, but I'm not aware of? Or what you mean is, not to include something internal? Or both?

Simply include all minus internals, deprecated and compat. (and anything else that should not be used by users)

Moodle still supports version 3.9, while it's latest is 3.11. Do I have to (or should I) take those into serious consideration, or no, or at all I have not to care about it?

Stubs follow the source with every tag. So initially we release 3.9.0 - up to the latest. Please see the release script and the generator script: https://github.com/php-stubs/woocommerce-stubs

Thanks for the info.

So... Are we able to merge this?

@machitgarha I'm sorry about Moodle.
That is something I do not want to have any nexus.

Thank you very much. :)
Waiting for version 0.7.0 to be released. :)

@machitgarha I'm sorry about Moodle. That is something I do not want to have any nexus.

I didn't mean that you have to be the maintainer of the package; I personally will do that, if that's the problem. But if the reason is something else, then that's OK, thanks for your patience. :)

reason is something else

Yes it is. Moodle is something I do not call a software.

reason is something else

Yes it is. Moodle is something I do not call a software.

Could you tell why?
P.S.: Sorry about being curious here. :)

Could you tell why?

Look at it's source code. It has no structure. It has many-many entry-points.
In PHP I expect code to be procedural or object-oriented. Moodle goes on another way.

It has many-many entry-points.

Exactly.
But I thought Wordpress would go in the same category (just from my readings and hearings, not an analysis of the Wordpress's source code).
And, it's all about backward compatibility I think.


Cb 9544

This PR implements the file plugin for OSX.

Merged in, but did not auto-close, so if you can close this that would be great.

thanks. there is a last change regarding the location of the applicationDirectory. this needs to point to the resource path of the application, so that the 'www' directory is directly underneath.


Deck not changing for regular play

Describe the bug
When entering a non-ranked "play" match, the deck does not change.  Instead, a deck is used that is for another mode, such as ranked or singleton.   However, the deck switching and detection seems to work fine for other modes, such as ranked and singleton.  This seemed to break after the mtg update around Feb 14th.
To Reproduce
Steps to reproduce the behavior:

Go to '...'
Click on '....'
Scroll down to '....'
See error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.

Please, add a screenshot of this problem! It will help us too investigate the reason of the current situation!


Potential Refactoring Estimate

Summary
I have identified a few classes with refactoring potential along with its estimated time to refactor, specifically OSecurityRemote.java. The estimated time is based on historical commits containing refactoring and the complexity of the involved classes. The class was refactored once on Aug 5, 2020 along with other classes in commit 36f52c52a5d6eb8d142671a516de9dcd66dedef3. Given the duration of the last refactoring, could it be possible to improve this class further? I am probably not qualified and experienced enough to point out the exact code needs to be refactored, given my limited knowledge of the project and codebase.
Urgency
Low priority. For maintenance of code in the long run.
Hi,
I am currently doing some research on Estimating Time Taken for Software Refactoring. Orientdb is one of my case studies being a highly popular project. Would appreciate your kind feedback on the appropriateness of the estimated time to refactor.
I am specifically looking at potential for refactoring, such as breaking functions that are too long into shorter functions, or to remove code duplication. Would you agree that there could be some modification to the code to make it better in the listed classes? And if so, is the estimated time appropriate to carry out the improvement? I will be grateful for any help you can provide.

OSecurityRemote.java - 2.5 hours
OSecurity.java - 2 hours
OSecurityShared.java - 2.5 hours

Thank you.
Regards,
Alvin

Hi,
Estimate refactors is hard, for the specific case I see that there is some heavy logic in OSecurityShared that may need a bit of double check and cleanup that would take probably half a day, the other two class require less work, the only thing that is needed there for now is to throw away old deprecated logic when is possible to be not compatible to the past, that would take an hour more or less.
In any case this estimations are a bit wrong, I mean the code changing effort is not the biggest part of this refactor, is way more hard to understand the logic and the context where that logic exists, often as well logic could be moved across classes, this is not counted in this case.
Also one thing to count is that refactor may bring regression, so running tests to verify that no regressions are there is quite important, and I find myself spending time a lot after a refactor to identify what is the reason for a regression in case it happen, this may translate a few hours of code changing in few days debugging, that is a cost that need to be factor in the estimations.
Regards

Hi @tglman,
Thank you very much for your input! Your insights are very valuable in helping me improve. I understand that my estimations are not accurate in this context, but it is really helpful in understanding why my estimations are incorrect.
Regards,
Alvin


I have a problem with the gui library using monogame.extended

I am experiencing this problem when I use a different ui library. I don't know if this is the cause of it being empty.
I think we need to improve this because most ui libraries have their own control scheme.

I have never used touch in the WPF interop, but I assume it's the same issue as I had with mouse and keyboard.
For mouse and keyboard I created WpfMouse and WpfKeyboard. You'll likely have to create a new abstraction for the touch APIs as well.
The big problem is that monogame assumes there is only one window (and that constraint is quite hardcoded) which is why I ended up writting WpfMouse/Keyboard that support multiple hosts/windows.
I'm afraid you'll have a hard time getting existing Monogame UI libraries to work inside the WPF interop.
My primary usecase of the interop was to create editors (with very minimal "ingame" gui).

Monogame is for cross-platform, it is very common to support touch, except for windows, there will be touch on most platforms. I will consider how to help you solve this problem. In order to solve this problem, I have to cancel the original monitor of the ui library. Or just let this ui library be compatible with you.

I'm not saying touch is uncommon, I just never used it in the interop as it is a WPF desktop application (I now have Windows touch devices as well, but back then it was quite uncommon).
Have a look at the mouse and keyboard classes I wrote, with the interop you can not use Mouse and Keyboard but only WpfMouse and WpfKeyboard.
The same has to happen for touch which means existing UI libraries that hardcoded "Touch.GetTouchState()" won't work.
However some UI libraries (like NuclexUI) allow you to inject your own input receivers which you can then wrap with a bit of interop code for wpf <-> monogame integration.
Back when I wrote multiplatform games I usually wrapped the input handlers myself (and then injected a touch input handler for windowsphone, vs. keyboard/mouse handlers for windows. For the wpf interop I then injected another mouse/keyboard handler using the Wpf interop input classes).
Is the GUI library you are having trouble with opensource somewhere? I could take a quick glance on what the best way to fix it would be.

https://github.com/craftworkgames/MonoGame.Extended/tree/develop/Source/MonoGame.Extended.Gui

Their TouchListener class uses the Monogame "TouchPanel.GetState()" call which is the issue.
They abstracted it nicely but TouchListener is not injected into GuiSystem. If they injected it (like IGuiRenderer) then you could have swapped it out for a custom "WpfTouchInput" and it would work.
The way they built it, you will have to modify their code.
I never really used other GUI frameworks when doing the WPF integration (it was always mainly for editors to build my games and then the games use GUI while running as "proper monogame").

You are right, I need to go to their side and submit a pr to modify these things. However, most ui libraries will not take into account that their control will be taken over by another library, which may be a flaw in their design.

Yes I have generally found this to be a problem. As I mentioned, most Monogame games/libraries assume that there is one window and the static input handlers: Mouse, Keyboard and Touch are available (an overall design flaw in the original XNA).
That's why I always ended up with my own UI wrappers and most of the time only used WPF interop for level editors, etc. where I don't need any UI libraries. With editors most UI controls where the WPF controls outside the game and then the monogame host only shows a few texts drawn via SpriteBatch along with the level.
The real game then obviously won't run in the editor, but I just launched that from a normal Monogame project where all UI libraries worked.

I support you to do this. I will help to improve this library when I am free. This library still has a lot of room for improvement. I am just developing the editor. I need this very much. If there is any problem, I will give you the first time.

Closing this as it is an issue with most GUI libraries and nothing that is fixable from my end.


Unable to hide "stats" primary navigation link

Hello!
My team has created a landscape for our open source project's ecosystem. It's a great start!
We are not currently a foundation, and we do not have any projects in different stats.
So, as a result, the stats page is blank.
It would be great if the stats page could be disabled via settings config.
We very much appreciate all the work you are all doing here. Thanks!

Hi @Relequestual 👋
We're glad you like it, thanks! It'd be great if you could add your landscape to the adopters file when you are ready 🙂
Regarding your request, maybe we could check when there are no stats at all to show and hide that navigation link automatically.

We will gladly add to the adopters file, thanks!
Yes, that sounds preferable. No need to configure then.

~We will gladly add to the adopters file, thanks!~ Looks like we are on it! Woop!

@benjagm took care of it yesterday 😉

Yes, that sounds preferable. No need to configure then.

Awesome 👍


More explicit naming

Just a random idea, wouldn't it be more explicit with something like that:
target.closure = strongify(weak: self, weak: other) { strongSelf, strongOther, some, arguments in
    /// ... code
}

First I thought about using guard but it's not possible:
target.closure = guard(weak: self, weak: other) { strongSelf, strongOther, some, arguments in
    /// ... code
}

If anything I'd just have the first one weak and then skip further one to avoid bloat

Indeed, it should be enough :+1:


Got java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer when parse json use JSONArrayModel

I got java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer when try to parse this json :
{"mst_areas":[{"id":"1","p_id":null,"name":"\u30d0\u30ea\u5cf6\u5168\u4f53","thumbnail":null,"created_at":"2015","updated_at":"2015","is_deleted":"0"},{"id":"2","p_id":null,"name":"\u30a2\u30e1\u30c3\u30c9","thumbnail":null,"created_at":"2015","updated_at":"2015","is_deleted":"0"},{"id":"3","p_id":null,"name":"\u30a6\u30d6\u30c9","thumbnail":null,"created_at":"2015","updated_at":"2015","is_deleted":"0"},{"id":"4","p_id":null,"name":"\u30ad\u30f3\u30bf\u30de\u30fc\u4e8c","thumbnail":null,"created_at":"2015","updated_at":"2015","is_deleted":"0"},{"id":"5","p_id":null,"name":"\u30b8\u30f3\u30d0\u30e9\u30f3","thumbnail":null,"created_at":"2015","updated_at":"2015","is_deleted":"0"}]}
Here is my code:
JSONArrayModel listArea = new JSONArrayModel<>(json.getJSONArray("mst_areas"), Area.class);
listArea.update(false);
My Model :
@Table(value = "mst_areas", databaseName = DB.NAME)
@ContainerAdapter
public class Area extends BaseCacheableModel {
@Column(name = "id", columnType = Column.PRIMARY_KEY_AUTO_INCREMENT)
int id;
@Column(name = "p_id")
int pId;

@Column(name = "name")
String name;

@Column(name = "thumbnail")
String thumbnail;

@Column(name = "created_at")
int createdAt;

@Column(name = "updated_at")
int updatedAt;

@Column(name = "is_deleted")
int isDeleted;

}
It seem that JSONArrayModel parser can't recognize json : {"id" : "1"...} as Int
Please help me

@ducna01598 its using underneath the JSONObject.get() method which does not try or attempt coerce values to what you expect them to be. I'd suggest extending the existing JSONModel class and adding in type checking, and then creating a "copy" of JSONArrayModel with the same functionality. Possibly the model containers are slightly too simple and need better support. That wouldn't happen in the near future, though.

thanks i solved the issue by changing my json data. But i got a new issue that it's adding some redundant  rows after a save to a table which have relations with "mst_area" for example this table:
@Table(tableName = "spots", databaseName = BaliGuideDB.NAME)
@ModelContainer
public class Spot extends BaseCacheableModel {
...
@Column
@ForeignKey(references = {@ForeignKeyReference(columnType = Integer.class, columnName = "area", foreignColumnName = "id")}, onDelete = ForeignKeyAction.NO_ACTION, onUpdate = ForeignKeyAction.NO_ACTION)
Area areaFK;
...
}
In my HomeActivity i call:
JSONArrayModel listArea = new JSONArrayModel<>(json.getJSONArray("mst_areas"), Area.class);
listArea.save(); ----> size of list area is 5 now
JSONArrayModel listSpot = new JSONArrayModel<>(json.getJSONArray("spots"), Spot.class);
listSpot.update();------------> size of listSpot is 4, and now size of listArea is 9
what is happened ?

@ducna01598 ensure that the Area object inside each Spot inside the JSONArrayModel is correctly populated. The JSON data must contain the proper fields. Also if the Area class has autoincrementing keys, that may be the case.

@agrosner I removed autoincrementing keys from all table but its not worked . Here is my JSON of Spot , don't think that it has problems:
"spots":[{"id":1,"title":"ABC\u30ab\u30d5\u30a7","area":1,"location":"139.6967912,35.6883178","description":"ABC\u30ab\u30d5\u30a7\u8aac\u660e\u6587","address":"\u795e\u5948\u5ddd\u770c\u6a2a\u6d5c\u5e02\u6e2f\u5317\u533a\u65b0\u6a2a\u6d5c 3-7-18 \u7b2c2\u4e0a\u91ce\u30d3\u30eb","publish":1,"show_at_top":1,"display_order":1,"created_at":2015,"updated_at":1432791945,"is_deleted":0},{"id":2,"title":"DEF\u30db\u30c6\u30eb","area":4,"location":"139.6967912,35.6883178","description":"DEF\u30db\u30c6\u30eb\u8aac\u660e\u6587","address":"\u795e\u5948\u5ddd\u770c\u6a2a\u6d5c\u5e02\u6e2f\u5317\u533a\u65b0\u6a2a\u6d5c 3-7-18 \u7b2c2\u4e0a\u91ce\u30d3\u30eb","publish":0,"show_at_top":1,"display_order":1,"created_at":2015,"updated_at":1432698560,"is_deleted":0},{"id":3,"title":"\u30c6\u30b9\u30c8","area":1,"location":"139.6967912,35.6883178","description":"\u30c6\u30b9\u30c8","address":"\u795e\u5948\u5ddd\u770c\u6a2a\u6d5c\u5e02\u6e2f\u5317\u533a\u65b0\u6a2a\u6d5c 3-7","publish":1,"show_at_top":1,"display_order":1,"created_at":2015,"updated_at":1432698560,"is_deleted":0},{"id":4,"title":"Test preview","area":1,"location":"139.6967912,35.6883178","description":"test preview","address":"\u795e\u5948\u5ddd\u770c\u6a2a\u6d5c\u5e02\u6e2f\u5317\u533a\u65b0\u6a2a\u6d5c 3-7-18 \u7b2c2\u4e0a\u91ce","publish":1,"show_at_top":0,"display_order":1,"created_at":2015,"updated_at":1432698560,"is_deleted":0}]

massive updates in ModelContainer land. try in 3.0, your issues should go away since I implemented stronger type retrieval in the ModelContainer via getStringValue(), getIntegerValue(), etc... when loading and saving to DB.


test.html mentioned in CONTRIBUTING.md doesn't exist.

Within the Pull Request Process section, of the contributing guidelines, it is mentioned to update the test.html file, but it doesn't exist. It should be index.html, within the test directory, I suppose?

@Being-Maverick good catch, it needs to be changed to index.html in test directory

Good spot! I originally had a test.html file, but moved it into its own directory.
For whoever picks this up, I'd like it changing to test/index.html rather than saying index.html in the test directory. 😊

Could I make these changes?


slack-android-api library forces min api to be 19

Hanji's minimum api level used to be 16, but we had to raise it to 19 because of this slack library. Since we didn't want to alienate users with older phone, we now have to two versions of the app, one with api 16 and one(the newest version) with api 19. This not ideal, so we should figure out a way to bring the api level back down to 16 while still using the slack-android-api.

Very few users have devices that are api level 16. Since, this number will only get smaller over time, we've decided to drop support for the older version. The minimum api level is now 19.


[objc] Interfaces within interfaces

As illustrated here I'm using NSNotificationCenter in my projects to work around the lack of events support in E4k. I declare my event args as interfaces to have them generated as protocols by E4k. I then implement those interfaces using NSObject derived objects and export the individual properties to the ObjC runtime.
The problem I'm having now is that I sometimes need to expose complex objects within my event args. So I tried to nest another interface in my event args interface but that causes E4k to incorrectly generate the binding for that property. Instead of generating it as id<ProtocolName> it simply is generated as ProtocolName.
You can see the managed declaration and the whole test project here: https://github.com/lemonmojo/E4kBackgroundTest/blob/master/E4kBackgroundTestLibrary/DownloaderEventArgs.cs#L17
Interestingly, declaring the property as an array of an interface actually works and is generated correctly as NSArray<id<ProtocolName>>.
So to sum up, this declaration:
public interface IThisBreaksEmbeddinator { }

public interface IEventArgs {
    IThisBreaksEmbeddinator thisBreaksEmbeddinator { get; set; }
    IThisBreaksEmbeddinator[] thisActuallyWorks { get; set; }
}

is incorrectly generated as:
@protocol Namespace_IThisBreaksEmbeddinator <NSObject>
@end

@protocol Namespace_IEventArgs <NSObject>
@property (nonatomic) Namespace_IThisBreaksEmbeddinator thisBreaksEmbeddinator;
@property (nonatomic) NSArray<id<Namespace_IThisBreaksEmbeddinator>> *thisActuallyWorks;
@end

while it should be generated as:
@protocol Namespace_IThisBreaksEmbeddinator <NSObject>
@end

@protocol Namespace_IEventArgs <NSObject>
@property (nonatomic) id<Namespace_IThisBreaksEmbeddinator> thisBreaksEmbeddinator;
@property (nonatomic) NSArray<id<Namespace_IThisBreaksEmbeddinator>> *thisActuallyWorks;
@end

Just noticed that the whole interface/protocol dance is not necessary (anymore?) since bindings for types that derive from NSObject are now generated in the registrar-x86_64.h header.
Unfortunately another inconvenience with this is that custom typed properties are surfaced as id instead of the actual type. Here's an example:
C# declaration:
[Register]
public class DownloaderInformation : NSObject
{
    [Export(nameof(url))]
    public string url { get; private set; }

    internal DownloaderInformation(string url)
    {
        this.url = url;
    }
}

[Register]
public class DownloaderWillStartEventArgs : EventArgs
{
    [Export(nameof(information))]
    public DownloaderInformation information { get; private set; }

    [Export(nameof(cancel))]
	public bool cancel { get; set; }

    internal DownloaderWillStartEventArgs(string url)
    {
        this.information = new DownloaderInformation(url);
    }
}

Generated binding in registrar-x86_64.h:
@interface E4kBackgroundTestLibrary_DownloaderInformation : NSObject {
}
	@property (nonatomic, assign) NSString * url;
	-(void) release;
	-(id) retain;
	-(int) xamarinGetGCHandle;
	-(void) xamarinSetGCHandle: (int) gchandle;
	-(NSString *) url;
	-(void) setUrl:(NSString *)p0;
	-(BOOL) conformsToProtocol:(void *)p0;
@end

@interface E4kBackgroundTestLibrary_DownloaderWillStartEventArgs : NSObject {
}
	@property (nonatomic, assign) id information;
	@property (nonatomic, assign) BOOL cancel;
	-(void) release;
	-(id) retain;
	-(int) xamarinGetGCHandle;
	-(void) xamarinSetGCHandle: (int) gchandle;
	-(id) information;
	-(void) setInformation:(id)p0;
	-(BOOL) cancel;
	-(void) setCancel:(BOOL)p0;
	-(BOOL) conformsToProtocol:(void *)p0;
@end

Note that property information is exposed as id in E4kBackgroundTestLibrary_DownloaderWillStartEventArgs instead of E4kBackgroundTestLibrary_DownloaderInformation*.


Let's talk about dependencies...

peerDependencies don't make sense because npm 3 doesn't install them, introducing an extra step before being able to work on this module. Conceptually, they're right for the non-bundled, webpack-ed build.
dependencies seems like the most appropriate way of defining them (they install when developing on this and are included for npm-style resolution), but it adds to the footprint when only the bundled assets are used.
devDependencies would install necessary runtime libraries and facilitate bundling (and keep the footprint small), but it would preclude npm-style module resolution (because nested modules would be unavailable).
#10's approach (facilitating npm-style resolution, which we're not currently doing) seems like the most appropriate mechanism for our use-cases, but we're also trying to hit these:

bundled assets, suitable for inclusion via <script>, with external (to avoid potential duplication) references to compatible dependencies (e.g. Leaflet, d3, ...)
bundled kitchen sink, suitable for inclusion via a single <script> tag (including all dependencies).

We're currently using (1), but incorporating it into a separate build system and potentially introducing confusion around how to incorporate upstream dependencies (e.g. react-leaflet).
Thoughts?

I'm not sure that supporting inclusion via <script> is something we really want to aim for. We're targeting an intermediate+ JS developer audience, one who should be ok running an npm install. If we make that explicit in our docs (I think we already have, in @panorama/toolkit and in panorama-template, I think our bases are covered.
That means that #10 is all we really need to aim for.
Going the npm route means also that we don't have to worry about the upstream deps confusion you mention -- npm will handle this if we get our build right.

Re: peerDependencies, yeah, it's annoying to have to run npm install twice, but peerDependencies theoretically allows us to avoid duplicate package versions in a @panorama/toolkit consumer. I'm still leaning toward peerDependencies because
a) I don't like the extra footprint of dependencies being installed in projects that don't use all of them ( / all of the components), and
b) because devDependencies will leave out required libs in an npm install scenario, as you describe above.

@mojodna have you seen @sconnelley's work here? I think he's moving toward what I describe above / what you are talking about in #10. @sconnelley correct me if I'm wrong / missed anything.

I'm not sure that supporting inclusion via

Coming back into this after a hiatus.
IIRC, we use peerDependencies because a project using @panorama/toolkit is not necessarily going to be using the modules that require each of those peerDependencies. So yes, these are direct dependencies, to be used at runtime, but only if the modules that require them are used in the downstream project.
Would there be any problems with a postinstall step that manually npm installs each of the peerDependencies? Other than maintenance of that list in package.json when new peerDependencies are added.
AFAICT, the goal is to have all the peerDependencies available locally in case they're needed, but to only package and deploy the ones that are actually used.

Here's one reason peerDependencies is weird: npm throws EPEERINVALID warnings for uninstalled peer deps from a downstream project (using @panorama/toolkit). Doesn't have anything to do with whether or not any modules that use those peer deps are in use in the downstream project, it happens on npm install.
I'm beginning to wonder if we want a solution like what lodash does, with all modules contained within a single repo but built out into a series of separate, discrete npm packages.
I don't know how to do that tho, especially with our need for per-module stylesheets.

And in fact...if the downstream project doesn't manually install those peer deps, it won't run, because @panorama/toolkit currently builds a hard requirement for those peer deps into dist/components.js (which is what is specified in package.json as the main for the package).
This really makes me think we need to figure out how to have separate builds per module.

Agreed on package per module.
On Wed, Mar 23, 2016 at 6:56 PM Eric Socolofsky<EMAIL_ADDRESS>wrote:

And in fact...if the downstream project doesn't manually install those
peer deps, it won't run, because @panorama/toolkit currently builds a
hard requirement for those peer deps into dist/components.js (which is
what is specified in package.json as the main for the package).
This really makes me think we need to figure out how to have separate
builds per module.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/americanpanorama/panorama/issues/12#issuecomment-200587286

If it doesn't run without them, aren't they true dependencies? ;-)
On Wed, Mar 23, 2016 at 8:14 PM Seth Fitzsimmons<EMAIL_ADDRESS>wrote:

Agreed on package per module.
On Wed, Mar 23, 2016 at 6:56 PM Eric Socolofsky<EMAIL_ADDRESS>wrote:

And in fact...if the downstream project doesn't manually install those
peer deps, it won't run, because @panorama/toolkit currently builds a
hard requirement for those peer deps into dist/components.js (which is
what is specified in package.json as the main for the package).
This really makes me think we need to figure out how to have separate
builds per module.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/americanpanorama/panorama/issues/12#issuecomment-200587286

Apparently so. :flushed:

Here's another style: https://github.com/mattdesl/eases
I'm not sure yet if this would work for us, needs some thought. But the idea is that the library is not compressed or transpiled (the latter, we can discuss), but is brought in as raw source. And each component has a single entry point, a js/x file, and you just import that file (and it imports whatever other local files are necessary).
Still don't see how this will help with dependencies at the npm level (would still have to specify everything used by each component in dependencies).
Another, somewhat-related thought: maybe we need to offload some of the complexity to the downstream project, in terms of determining which dependencies from the toolkit to package into its build? A bit less portable but we can shepherd the process, esp. on internal Richmond/Stamen projects. Might be simpler.

Oh yeah and that ^^ is somewhat similar to react-leaflet, maybe something in that structure we can use...

Looks like this is all worked out now in our fork. Closing.


Tokenizes paragraphs into sentences

Need to verify that old functionalities still work

Slow down is a big issue with this approach.

Slow down is a big issue with this approach.


perf counter -- addressing comments from previous PR

perf counter -- addressing comments from previous PR.
Description

file name update
uint64_t overflow to uint32_t
++overflow, instead of overflow++
project file clean up.

Checklist:

[ ] I have tested my changes. No regression in existing tests.
[ ] My code is Linted.

This PR is before we updated folder structure. Closing.


Multiline literal JS that is ignored by CPython

I want to include a few lines of raw JavaScript code that will be taken as-is during compilation, but will be ignored by CPython.
The way I've found to include literal JS is with # __pragma__ ('js', '{}', '<JavaScript code>'). But this only works for single-line statements because "comment-like" variety pragmas only work with # (single-line comments).
I wish I could do something like this:
""" __pragma__('js', '{}', '''
  function foo() {
    console.log("bar");
  }
''')
"""

Is there any workaround?

I've done something like this before where I create a Python reference to it (typically because I want to call the function elsewhere in the Python code). Transcrypt will then create an export for the function in the generated JS file:
foo = __pragma__('js', '''
  function foo() {{
    console.log("bar");
  }}
''')

I've done something like this before where I create a Python reference to it (typically because I want to call the function elsewhere in the Python code). Transcrypt will then create an export for the function in the generated JS file:
foo = __pragma__('js', '''
  function foo() {{
    console.log("bar");
  }}
''')

The generated JS code then looks like this:
export var foo=function foo(){console.log("bar")};

Although that's not specifically what I was looking for, your reply made me realize I can do what I want to do by using pragmas inside executable comments:
'''?
__pragma__('js', '{}', """
  function foo() {
    console.log("bar");
  }
""")
?'''

As long as the ecom pragma is active; or the --ecom command line switch

This is helpful for my use case, where I am basically exposing a library as both a Python package and a JS package.
I have started detailing a summary of tips relevant to that use case here: https://github.com/JGreenlee/e-mission-common?tab=readme-ov-file#tips-for-writing-code-to-work-in-both-python-and-javascript

But the short answer is yes, you can do it with:
'''?
__pragma__('js', '{}', """
  function foo() {
    console.log("bar");
  }
""")
?'''

The only weird thing is that there's extra indentation in the output JS file. But since JS is not sensitive to indentation level, I don't care and this works fine.