Use immutable data structures

Thank you for sharing the concept of Cycle.js!
The architecture makes things really clear and simple.
This is my new favorite TodoMVC implementation :wink:
I was playing around with immutable.js and saw the issue https://github.com/staltz/todomvc-cycle/issues/4 later. Thought I might send a pull request.
Feel free to modify this, if I missed something. I'm pretty new to this technologies, so I probably don't use it all the right way yet..

Hi @jorin-vogel, thank you for this. I really like Immutable.js and I would use it myself in any project. But for TodoMVC itself, I'm afraid we have to keep it out because in order to compare with other frameworks, it's best if the TodoMVC implementation is "vanilla Cycle.js". Issue #4 was just a suggestion of how to speed up performance, it wasn't necessarily about Immutable.js (the name betrays, but there is a difference between "immutable" and "immutable.js").

@staltz ok cool. I totally get this.
I was just playing around with immutable.js. But I also felt like it would be overkill for TodoMVC.
If anyone asks how to integrate immutable.js thought, we have an example now to show them :smiley:

And to not completely lose the effort you put into this, I put a link to this PR on the README.

Thanks, that's awesome! Let me know if I can improve anything.

Thank you both. If anything can be improved, I'd be interested in a more complete version, too.


Updated 404 page detection

This pull request updates the 404 page detection by checking if the alt attribute on the 404 image contains 404.
Fixes https://github.com/sindresorhus/refined-github/pull/1837#discussion_r263643663
Since we're accessing the DOM, how should we handle the 404 tests?

Is there anything not working with the current approach? Because is404 is called by all features and should be available long before domready

I read your comment and I was under the appreciation you were looking for another solution. I thought maybe alt attribute was overlooked.

Yeah, but it would have to be in the head somewhere since all features wait at least for the head to be loaded, but not all wait for the entire page.

I see, no worries. Thanks for taking the time to look through the pull request!


Improve Status and State

Describe the solution you'd like
Status and state should be distinct.
For instance:

state = up or down
status = maintenance, in production, planned, etc...

The state and status should be put at multiple levels to be more flexible (be able to shutdown only one side of the BGP session, etc...).
Also todo: update the documentation.

Code merged, remaining task: update the documentation.


[Feature request] Support for custom input source types

Description
As a web app author,
when I use polymer-build to generate an artifact from my app,
I would like to begin the process with custom file transformations,
so that file formats that polymer-build did not anticipate can be used in my app
This feature request is motivated by my desire to plug-in a vinyl-fs transformation that converts a fictional HTML Module format in ES Modules. The transformation allows me to craft my app source using these HTML Modules.
One could imagine that such a transformation could be built-in to polymer-build. However, it seems like it would be better if we could somehow offer a spot where arbitrary transform streams could be slotted in, assuming they follow some basic contract (for example: vinyl-fs files in, vinyl-fs files out). This would unlock the ability to support many types of transformations not anticipated by the project or this feature request.

I don't use polymer-build anymore, so there is no explicit desire for this feature to be implemented. It seems like something someone might want, but no-one +1'd it so I will close it.


 IF YOU DO NOT FOLLOW THE FORMAT OR MAKE A GENERIC TOKEN REQUEST YOUR ISSUE WILL BE DELETED WITHOUT COMMENT
YOUR JUSTLIST MUST FOLLOW THE JSON SPECIFICATION
https://github.com/justswaporg/justlists/example.justlists.ts
Checklist

[x] I understand that this is not the place to request a token listing.
[x] I have tested that my JustList is compatible by pasting the URL into the add a list UI at justswap.org.
[x] I understand that filing an issue or adding liquidity does not guarantee addition to the justlists website.

Please provide the following information for your token.
JustList URL must be HTTPS.
JustList URL: https://token.ather.cyou/justswap/all.json
JustList Name: Ather
Link to the official homepage of the JustList manager:

Let's starts

Can you share a bit more about your project?

https://ather.cyou
Pada Selasa, 13 April 2021, JustSwapTeam @.***> menulis:

Can you share a bit more about your project?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/justswaporg/justlists/issues/367#issuecomment-818623515,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASCACW2HMO6TNOYGXTNROODTIQK2ZANCNFSM4XWNDAPQ
.


How to convert geotiffs programmatically to cogs

After I have verified the successful run of the command line rio cogeo example.tif example_cog_raw.tif --cog-profile raw then I'm trying to use the function cog_translate programmatically.
This snippet is failing:
cog_img = "cog" + "_" + name # name is for instance example.tif
cog_profile = cog_profiles.get('raw')
cog_profile.update(dict(BIGTIFF=os.environ.get("BIGTIFF", "IF_SAFER")))
block_size = 512
config = dict(
            NUM_THREADS=8,
            GDAL_TIFF_INTERNAL_MASK=os.environ.get("GDAL_TIFF_INTERNAL_MASK", True),
            GDAL_TIFF_OVR_BLOCKSIZE=os.environ.get("GDAL_TIFF_OVR_BLOCKSIZE", block_size),
)
cog_translate(
            img,
            cog_img,
            cog_profile,
            None,
            None,
            None,
            6,
            config
)

where img the binary image file which is properly opened previously by rasterio and checked for being or not a COG.
The error stack trace is:
File "/Users/geobart/Development/CallForCode/cog-k8s/app/api_views.py", line 87, in post
    block_size = 512
  File "/Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rio_cogeo/cogeo.py", line 52, in cog_translate
    with rasterio.open(src_path) as src:
  File "/Users/geobart/.pyenv/versions/3.6.2/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rasterio/__init__.py", line 178, in fp_reader
    dataset = memfile.open()
  File "/Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rasterio/env.py", line 360, in wrapper
    return f(*args, **kwds)
  File "/Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rasterio/io.py", line 132, in open
    writer = get_writer_for_driver(driver)
  File "/Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rasterio/io.py", line 179, in get_writer_for_driver
    if driver_can_create(driver):
  File "rasterio/_base.pyx", line 112, in rasterio._base.driver_can_create
  File "rasterio/_base.pyx", line 95, in rasterio._base.driver_supports_mode
AttributeError: 'NoneType' object has no attribute 'encode'

Do you have any hints on the cause of the error and if I'm using cogeo in a wrong way?

👋 @francbartoli
can you try
cog_translate(
            img,
            cog_img,
            cog_profile,
            overview_level=6,
            config=config
)

@vincentsarago still same error.
I have got now what you pointed out about kwargs rather than args but I was confused by this line

Oh the error comes from https://github.com/mapbox/rio-cogeo/blob/master/rio_cogeo/cogeo.py#L52 when trying to open the input files
File "/Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rio_cogeo/cogeo.py", line 52, in cog_translate
    with rasterio.open(src_path) as src:

To me it seems that your input files is not compatible with rasterio, but I could be wrong.

@vincentsarago If I enter into debugging the cli I can see the arguments of that function:
rio cogeo ~/Downloads/geonode_soviet_100k_10_37_136.tif geonode_soviet_100k_10_37_136_raw.tif --cog-profile raw
> /Users/geobart/pyenv/cog-k8s-2pcfZKQH/lib/python3.6/site-packages/rio_cogeo/scripts/cli.py(87)cogeo()
     86     import ipdb; ipdb.set_trace()
---> 87     cog_translate(
     88         input, output, output_profile, bidx, nodata, alpha, overview_level, config

ipdb> print (input)
/Users/geobart/Downloads/geonode_soviet_100k_10_37_136.tif
ipdb> print (output)
/Users/geobart/Development/CallForCode/cog-k8s/geonode_soviet_100k_10_37_136_raw.tif
ipdb> print (output_profile)
{'driver': 'GTiff', 'interleave': 'pixel', 'tiled': True, 'blockxsize': 512, 'blockysize': 512, 'BIGTIFF': 'IF_SAFER'}
ipdb> print (bidx)
None
ipdb> print (nodata)
None
ipdb> print (alpha)
None
ipdb> print (overview_level)
6
ipdb> print (config)
{'NUM_THREADS': 8, 'GDAL_TIFF_INTERNAL_MASK': True, 'GDAL_TIFF_OVR_BLOCKSIZE': 512}

input and output are obviously absolute paths while in my case they are simply strings of the filenames that I'm handling, for instance example.tif and cog_example.tif. Does rasterio permit this? I guess this is the problem.
Does a MemoryFile instance for each of the input and output images overcome the issue? How would this happen?
Something like:
with MemoryFile() as inpt:
    with inpt.open() as img:
        with MemoryFile() as dst:
            with dst.open() as cog_img:
                 cog_translate(
                     img,
                     cog_img,
                     cog_profile,
                     overview_level=6,
                     config=config
                 )

input and output are obviously absolute paths while in my case they are simply strings of the filenames that I'm handling, for instance example.tif and cog_example.tif. Does rasterio permit this? I guess this is the problem.

This shouldn't be a problem except if you use ~/ maybe
I just tried
inp =  'internal-mask.tif'
out = 'test.tif'
cog_translate(inp, out, cog_profiles.get('ycbcr'))
  [####################################]  100%

and it worked fine

Does a MemoryFile instance for each of the input and output images overcome the issue? How would this happen?
I don't think this will be needed

Thanks @vincentsarago, I think doing that server side is a little bit different.
I found out the way to get it done through a MemoryFile instance and the trick to use the first item in the list files. The working snippet is below for those interested later:
with rasterio.open(img) as dataset:
    inpt_profile = dataset.profile
    block_size = 512
    config = dict(
        NUM_THREADS=8,
        GDAL_TIFF_INTERNAL_MASK=os.environ.get("GDAL_TIFF_INTERNAL_MASK", True),
        GDAL_TIFF_OVR_BLOCKSIZE=os.environ.get("GDAL_TIFF_OVR_BLOCKSIZE", block_size),
    )
    cog_profile = cog_profiles.get('ycbcr')
    cog_profile.update(dict(BIGTIFF=os.environ.get("BIGTIFF", "IF_SAFER")))
    with MemoryFile() as dst:
        with dst.open(**inpt_profile) as cog_img:
            cog_translate(
                            dataset.files[0],
                            cog_img.files[0],
                            cog_profile,
                            indexes=None,
                            nodata=None,
                            alpha=None,
                            overview_level=6,
                            config=config
                        )

@francbartoli sorry for pinging you back here but you deserve credit for things I didn't understand at the time
    with MemoryFile() as dst:
        with dst.open(**inpt_profile) as cog_img:
            cog_translate(
                            dataset.files[0],
                            cog_img.files[0],
                            cog_profile,
                            indexes=None,
                            nodata=None,
                            alpha=None,
                            overview_level=6,
                            config=config
                        )

This was in fact a great thing to do and I wish I had a better understanding at the time.
ref: #107

Nice @vincentsarago, many thanks indeed. Btw I wanted to come and say hello in Bucharest but the time was very tight. I'll do definitively next time ;)

@francbartoli thank you, this was super helpful.  I have an additional question I was hoping you could address regarding the creation of jpeg thumbnails.
assume I have an un-optimized tif in cloud storage (S3 bucket, az blob storage, etc.).  I am able to read the tif - in memory - create a cog and upload to my desired cloud storage thanks to your help.  But what if I need to also create a jpeg thumbnail of the tif?  I'm having trouble doing so and determining the most efficient way to do it.
Can I / Do I...

continue using the MemoryFile to make the conversion to avoid duplicating the initial read of the tif?
create the thumbnail from the new COG that's been uploaded?
create a separate function to handle this conversion independently from the COG conversion?

import rasterio

from rasterio.io import MemoryFile
from rio_cogeo.cogeo import cog_translate
from rio_cogeo.profiles import cog_profiles

from . import az_utils

def create_cog_and_thumbnail(uri, cog_upload_uri, thumbnail_upload_uri):
   """
   convert .tif image to cog and thumbnail

   :param uri: uri of .tif in az storage
   :type uri: str
   :param cog_upload_uri: uri of upload cog file in az storage
   :type cog_upload_uri: str
   :param thumbnail_upload_uri: uri of upload jpeg file in az storage
   :type thumbnail_upload_uri: str
   :return: none
   :rtype: None
   """

   with rasterio.Env(AZURE_STORAGE_ACCOUNT="some_acct", AZURE_STORAGE_ACCESS_KEY="some_key"):
       with rasterio.open(uri) as ds:
           input_profile = ds.profile
           config = dict(NUM_THREADS=8, GDAL_TIFF_INTERNAL_MASK=True, GDAL_TIFF_OVR_BLOCKSIZE=512)
           cog_profile = cog_profiles.get("deflate")
           cog_profile.update(dict(BIGTIFF="IF_SAFER"))

           with MemoryFile() as memfile:
               # cog
               with memfile.open(**input_profile) as cog_img:
                   cog_translate(ds.files[0], cog_img.files[0], cog_profile, config=config, in_memory=True)
                   az_utils.upload_file_to_blob(memfile, cog_upload_uri)

               # jpeg
               input_profile["driver"] = "JPEG"
               with memfile.open(**input_profile) as jpeg_img:
                   # ???
                   az_utils.upload_file_to_blob(
                       data = ,# memfile? jpeg_img.read()? ds.files[0]?
                       dest = thumbnail_upload_uri
                   )
   return

any help would be greatly appreciated

Here is the code snippet for converting a tiff to a jpg thumbnail:
import rasterio

from rasterio.io import MemoryFile
from rio_cogeo.cogeo import cog_translate
from rio_cogeo.profiles import cog_profiles

def create_thumbnail(uri, thumbnail_upload_uri):
    """
    converts tiff in cloud storage to a thumbnail jpg
    """

    with rasterio.open(uri) as ds:
        input_profile = ds.profile
        thumbnail_profile = cog_profiles.get("jpeg")

        with MemoryFile() as memfile:
            with memfile.open(**input_profile) as thumbnail:
                cog_translate(
                    ds.files[0],
                    thumbnail.files[0],
                    thumbnail_profile,
                    config=dict(
                        NUM_THREADS=8,
                        GDAL_TIFF_INTERNAL_MASK=True,
                        GDAL_TIFF_OVR_BLOCKSIZE=512
                    ),
                    in_memory=True,
                )
                upload_to_cloud_storage(thumbnail_upload_uri, memfile)

def upload_to_cloud_storage(destination_uri, data_stream):
    """
    uploads a file in memory to cloud storage
    """

    # specific to your provider (AWS - boto3, MSFT AZ - azure-storage-blob)
    client.upload_blob(name=destination_uri, data=data_stream)


Test Mode Maybe Not Working

Hello, I'm developing a simple iOS app which is not published to iTunes yet.  I am using isTesting equals true everywhere.  However, when I look at my AdMob console, I see impressions and revenue increasing!!!!  I would expect to see no data here since the app isn't public yet and isTesting is in use. Pardon my ignorance on this.  It's my first experience with admob itself and this plugin.
I really would like it if my account doesn't get  suspended from testing with this plugin... is this something I should be concerned about?
Thank You

Side note, my AdMob implementation is based on your ionic/angular JS example.

If you can see test Ad, your isTesting is working.

That's my point, even with isTesting = true, I see real ads, not testing ads.  Only seeing this on iOS

Weird, we never see such case.

Could you please paste your javascript code here?

Can you try the demo project with command plugin-verify cordova-plugin-admobpro ios? (after install npm utility plugin-verify)

no more reply, I suppose problem resolved.


Rename the global knockout variable to avoid clashing with minifiers

GeoGebra's CAS code introduces about 8000 global variables (😲), whose names get minified to one-to-three letters. Because they work through every combination of two letters, that means they set a global ko, which is the same name Knockout gives to its global variable.
Ideally, GeoGebra wouldn't set such an egregious number of globals, but for now we need to work round it. We could set a global variable Knockout to reference the same object as ko, which would be astronomically unlikely to be overwritten.
There are quite a few questions which try to do something clever with knockout in custom scripts, but the ko variable would still be available unless GeoGebra loads, so this wouldn't break them.

I reported the global scope pollution to GeoGebra at https://help.geogebra.org/topic/web-applet-adds-a-ton-of-variables-to-global-scope


Cant get notified for hackathons in the area

No matter what location i put in, it doesnt find it. Even if i put in the example "Chicago, IL", it still says that the location is not found.
I put this here instead of the frontend because i checked the network tab and its getting the error from the server.

Hey! Thanks for giving us a heads up! We've be investigating this already, and will hopefully have a solution soon!


Evidence code filter changed to MultiSelect dropdown

Do we not want the curators to search by name or curie?

Oh never mind I see we are changing it to: FilterMultiSelectComponentTemplate

I think search only by abrevation if we want the multiselect dropdown here.

@kthorat-prog what is happening with this PR?

Need to think on all options and the best way to implement this. So, closing this PR for now.


Implement users and categories pages

Added frontend and backend for users and categories pages. Added query to dynamically populate the dropdowns in the UserEvents dialogs.

Accidentally merged into main, creating new PR to pull this into develop first


bands is read as a dimension without a coordinate

import pystac_client
import planetary_computer
from shapely.geometry import Point
import stackstac
import xarray as xr

area_of_interest = Point((-120.963122, 37.025915)) # wright solar farm lon lat
range_old = "2015-01-01/2018-01-01"
range_new = "2020-01-01/2021-01-01"
max_cloud_cover = 15

catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)
search_new = catalog.search(
    collections=["sentinel-2-l2a"],
    intersects=area_of_interest,
    datetime=range_new,
    query={"eo:cloud_cover": {"lt": max_cloud_cover}, 's2:mgrs_tile':{'eq':'10SFF'}},
    max_items=4
)
items_new = search_new.item_collection()

using stackstac directly shows alls dimensions are coordinates
new_range_xarr = stackstac.stack(items_new, assets=["B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08", "B8A", "B09", "B10", "B11", "B12"])
new_range_xarr

using xpystac, only band is left without a coordinate
new_range_xarr = xr.open_dataset(items_new, engine="stac", assets=["B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08", "B8A", "B09", "B10", "B11", "B12"])
new_range_xarr

Yes! I think this is another flavor of https://github.com/pydata/xarray/issues/6038
One big difference between stackstac and xpystac is xpystac returns at dataset rather than a dataarray and to do that conversion it uses DataArray.to_dataset. I think the behavior should be that coords that depend only on band should be promoted to attrs on the data_vars. I'm opening up a PR to that effect.


ESC1 error code：0x80070057

This error happens because the CA corp-CA specified in your command doesn't match the name of the CA. You should find the name of the CA you want to enroll in rather than the on. You can use the certipy find to find the name of the CA

Problem solved, thank you very much


If the receiver holds 100,000 items, how to set the parameters?

hello, when the receiver holds 100,000 items, the parameters i set are:
{     "table_params": {         "hash_func_count": 3,         "table_size": 100000,         "max_items_per_bin": 4000     },     "item_params": {         "felts_per_item": 4     },     "query_params": {         "ps_low_degree": 310,         "query_powers": [ 1, 4, 10, 11, 28, 33, 78, 118, 143, 311, 1555]     },     "seal_params": {         "plain_modulus_bits": 26,         "poly_modulus_degree": 400000,         "coeff_modulus_bits": [ 50, 50, 50, 38, 30 ]     } }
And the code throw an ERROR: poly_modulus_degree is invalid, i find that SEAL set SEAL_POLY_MOD_DEGREE_MAX=131072. How to set the parameters in this case?

@BeStrongok what parameters did you finally use for 100K receiver items. Also did you find any upper bound of number of receiver elements for efficient PSI with APSI?


Library modifies provided export options

Hi Brent,
Please find following code which exports line to PPTX.
(One line has width: 0 and another has 1 )
// Create a new Presentation
var pptx = new PptxGenJS();
pptx.setLayout('LAYOUT_WIDE');

// Add a Slide, then add objects
var slide = pptx.addNewSlide();

slide.addShape(pptx.shapes.LINE,      { x:1, y:1, w:0, h:5, line:'FF0000', line_size:1 });
slide.addShape(pptx.shapes.LINE,      { x:3, y:1, w:1, h:5, line:'FF0000', line_size:1 });

// Export Presentation
pptx.save('Demo-Shapes');

which gets converted like this:

Observations:
when w is 0 , it gets modified to 1 automatically.
Could you please fix this soon?
Thanks & Regards,
Sangram

Hi @sangramjagtap ,
Please use 'lineSize' to set the line width, not 'w'. Setting the width to zero is by design.

Hi @gitbrent ,
Would be great if you can share code for adding a vertical line.

Lines can be rotated 360 degrees - see the examples folder for code.


End of 2014 email

Each year we send a final email after the 24 days of Christmas have finished, in previous years I sent them manually using mailchimp but I'd like to automate this in a similar fashion to the november mail.
Any help with the content of the email would be great, ideally I'll send it on christmas day.

is this done, if not, should we add to the launch list page https://github.com/24pullrequests/24pullrequests/issues/955 and close this?

It's half done here: https://github.com/24pullrequests/24pullrequests/pull/899


chore: update baselines files from typography update

After the typography update, the baselines needed to be updated.
Ready-for-merge Checklist

[x] Expected files: all files in this pull request are related to one request or issue (no stragglers or scope-creep).

Merging
Please squash when merging and ensure your commit message uses conventional commit formatting.
Be sure to share your updates with the<EMAIL_ADDRESS>mailing list!

The pfe-primary-detail component does not have any of the typographical styles, but it does include pfe-base.css. When I view it locally, it looks good:


Added  class extending from record as named-record see example  with …

…'@id' and 'xdm:name' named-record.example.1.json
Please link to the issue #…

Closing


Add ZH readme

We ever removed this file. But I get it back. It is very important for localization and I think it's very attractive for Chinese People.

I think I can translate it from the main version when it changed.

Hmm. Maybe this should be rather a part of the docs. I don't like the idea to have n README.md for each language in the project. 😉

I'm also not really happy with that. I would prefer to reduce the content of the readme and reference to a multilingual documentation.

In fact it's difficult to me to tell Chinese people to move to Gitea from Gogs since there are so many Gogs users in China. I think gitea needs more localization even if it need more work on translations. For Chinese, I think I can do that. So I think this PR is needed and I wish we can add more locale README if there is a man to maintain it. I have created a Chinese discuss place and added it on README_ZH.md so that more Chinese people could add to that QQ Qun. In China, most people is very difficult to visit gitter and google groups because of difference languages and Great Wall.

I think currently it is.

Maybe we should also add a joint to the pull request template if somebody changed the readme to /cc @lunny to update the translation

I don't see a problem with having a Chinese README.
LGTM

I'm also ok with the Chinese special case, at least until there's an active maintainer for it. LGTM

Thanks!


.vue file icons don't work in Rider

I think there exists a vue icon, but it doesn't work in Rider 2023.3.2

Hi, Thank you for the bug report! I'll close it as a duplicate of #7 since there are some discussions about this specific icon there, but that's something that we need to solve. Also, I think that this issue also appears in other JetBrains IDEs!

That being said if someome has the time to work on it, the only thing missing is that this extension should be registered in the base catppuccin/vscode-icons project


Surah info SEO

Deployed to: http://staging.quran.com:32784

Deployed to: http://staging.quran.com:32786

Deployed to: http://staging.quran.com:32787

rebuild

Deployed to: http://staging.quran.com:32788


Theme Next - Heading typography option Amplitude

### Tasks
- [x] Add new foundation typography headings token, default to Open Sans #3396
- [ ] Point h1/2/3/4, display 1/2/3 to new heading token
- [x] Add new palette layer types (heading / body), point text characteristics to palette instead of foundation ##3391
- [x] Add new amplitude typography foundation variable #3396
- [ ] Add new amplitude font-face declaration file
- [ ] Upload Amplitude font for storybook to use (but not distribute through npm package for licensing issue)
- [x] Add additional theme-next in palette point heading to amplitude #3396
- [x] Add additional option to Unstable SaltProvider, to switch between 2 font options #3396
- [x] Add new toggle to storybook toolbar to demo #3396
- [x] Font weight remapping #3500
- [x] Update theme next doc with relevant information

Released in #3507


feat(dev): add css helper function

Checklist:

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the main branch of freeCodeCamp.
[x] All the files I changed are in the same world language, for example: only English changes, or only Chinese changes, etc.

This PR adds a small css helper function for testing the curriculum. Example usage:
const astStyles = __helpers.getStyles(document, '*');
assert.equal(astStyles.boxSizing, 'border-box');
// Appears to work with the input value (not the processed value) - Good
const bodyStyles = __helpers.getStyles(document, 'body');
assert.equal(bodyStyles.height, '100vh');

Some notes about the reliability of this function:

Originally, document.styleSheets[1].cssRules returned an array - I do not know why it no longer does, but, honestly, it worked for a few tests, then changed to needing the Object.values. We might need to add a check for isArray
I have not tested this on non-Chromium browsers - if they do not follow the spec, then this will be bust (unless we find out what spec they use, and test for browser before using a specific function..)

PS: I am also working on an HTML helper function, because I am allergic to jQuery, and vanilla JS has so many DOM methods we could use better

Re-running Actions, because of this error:
remote: Internal Server Error.
  remote:
  Error: fatal: unable to access 'https://github.com/freeCodeCamp/freeCodeCamp/': The requested URL returned error: 500
  The process '/usr/bin/git' failed with exit code 128

Looks like they have an ongoing incident: https://www.githubstatus.com/incidents/zbpwygxwb3gw

I have not tested this on non-Chromium browsers - if they do not follow the spec, then this will be bust

MDN says .cssRules is on all browsers.
https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/cssRules

Any idea how this will handle browser specific css weirdness:
https://github.com/freeCodeCamp/freeCodeCamp/pull/39133 and https://github.com/freeCodeCamp/freeCodeCamp/pull/37688

Any idea how this will handle browser specific css weirdness?

I have not tested outside of Chromium-based browsers. This is what I meant by whether they follow spec or not. Ideally, it should allow the tests to follow the exact input of the CSS value (provided it is valid CSS), which means this would solve the issue of testing against values which have gone through compilation (e.g. 100vw -> 996px).
I would appreciate this being tested on Safari, before adoption.

If the spec is respected by all modern browsers, that's awesome - it should mean we don't need to worry about CSS parsers.  Do you know how media queries are handled?

cssRules: CSSRuleList
  0: CSSStyleRule {selectorText: "body", style: CSSStyleDeclaration, styleMap: StylePropertyMap, type: 1, cssText: "body {
    background: black; color: cornsilk; }", …}
  1: CSSMediaRule
    conditionText: "(max-width: 996px)"
    cssRules: CSSRuleList {0: CSSStyleRule, length: 1}
    cssText: "@media (max-width: 996px) {\n  p { border: 1px solid black; }\n}"
    media: MediaList {0: "(max-width: 996px)", length: 1, mediaText: "(max-width: 996px)"}
    parentRule: null
    parentStyleSheet: CSSStyleSheet {ownerRule: null, cssRules: CSSRuleList, rules: CSSRuleList, type: "text/css", href:
      "http://localhost:1234/styles.8986bff4.css", …}
  type: 4
  __proto__: CSSMediaRule
  length: 2
  __proto__: CSSRuleList
  disabled: false

@ojeytonwilliams Good catch. I will add some logic to check for CSSMedia Rule

Originally, document.styleSheets[1].cssRules returned an array - I do not know why it no longer does, but, honestly, it worked for a few tests, then changed to needing the Object.values. We might need to add a check for isArray

It looks like it's not an array, exactly, so it probably doesn't have all of Array's methods.

@ShaunSHamilton did you make the bot mad 😛

@ShaunSHamilton did you make the bot mad 😛

Umm.... I did an "oops" - Git betrayed me

Also, this helper passes with browser extensions (ref #42174 ):

This is kind of a better or for worse situation, where some Campers might say: "Hey, my text is not RED but it passed the tests"

So if I understand correctly from the examples, this helper will allow me to assert that a color: red; rule not only exists, but is within a p selector??

So if I understand correctly from the examples, this helper will allow me to assert that a color: red; rule not only exists, but is within a p selector??

Yes, but not quite yet that powerful. The getStyle method accepts any valid CSS selector - matching to the selector used in the editor. Then, you can see the styles associated with the matched selector. You cannot easily (yet) assert that color: red; has been used somewhere (anywhere, but in the wrong place).
You could (off the top of my head - do not trust):
const isColorRedUsedAnywhere = new __helpers.CSSHelp(document).getCSSRules().some(x => x.style.color === 'red');

This is still leaps and bounds above the parser I was exploring. Have I told you yet that you're amazing? ❤

Oliver, I think our TS config is too strict - The methods/functions are clearly able to infer what they return, but this prop is failing @typescript-eslint/explicit-module-boundary

Oliver, I think our TS config is too strict

Perhaps, yeah.  Let me take a look before we calm it down, though.

@ShaunSHamilton  It doesn't seem strictly necessary, but it's not that onerous to add it.  Without fully understanding why the rule exists in the first place, I'd rather not just rip it out.

The last 2 tests will keep failing because JSDOM does not implement conditionText property on CSSMediaRule:

https://github.com/jsdom/jsdom/issues/2974
https://github.com/NV/CSSOM/issues/105

So, shall I change the test? Or, block this until I can get a PR opened on CSSOM?

Or, block this until I can get a PR opened on CSSOM?

There hasn't been any activity on that project in like 6 months. Can we inject that property ourselves in the test environment?

Hmm I don't see a real clean way to do that - might be worth yoinking the test until/if the lib is updated.

Can we inject that property ourselves in the test environment?

@nhcarrigan We can. The exact value exists on the MediaList (media property)


Heatmap labelPosition bug

Set labelPosition to hidden on a full heatmap -->  Label background disappears, but label text remains. But refreshing or exporting the viewconf makes it work.

Set labelPosition to anything on split heatmaps --> no effect, even after refresh.

I have found this bug, also, in v1.7.2.
It seems to affect the first track in a series of tracks in a viewconf's top view. Subsequent tracks do not show the hidden label (as expected).
If I replace the labelPosition property (set to hidden) with topLeft and use a labelTextOpacity value of 0, I can hide the label in that way.
Here are a pair of viewconfs which I have used to test the issue locally:
https://gist.github.com/alexpreynolds/47106b9a0e0b33db41b86678615792b3
This gist contains two viewconfs: hidden.json and topLeft.json.
If I drag-and-drop hidden.json into the higlass.io site, I can see the label in the first track (as well as in my local site). If I drag in topLeft.json, the label is not shown.


Issue #4 Improve load json data

Couple of changes :

Changed read json file using for in file (faster and cleaner according to documentation)
Merged load schema function and convert data with column name in a single function.
Not sure about the efficiency of the function to concatenate lists preserving order and removing duplicates f7, but I couldn't find a better way (taken from SO :| )
Please excuse me in case my style is not appropiate to contribute to a project of this kind, I'm a newbie on this sort of stuff.

Hey, thanks for this, I'll need to digest the code flow a bit more, but looks ok in general.  I don't understand the usage of _col = column_data.get(column, [None]*(row_count-1)), but it may become clearer when I walk through it again.

There are a couple of things that I would rewrite (added comments in the PR). Can I change them and send a new PR ?


Review list - Next button behavior

After opening the list of matched locations - clicking the Next button takes me to the "not matched" list, but i expected it to show me the first item in the list.
wanted to make sure that was the correct behavior and see if there was a workflow map for all the next buttons given the current panel shown.

@NikkiGolding fyi

@NikkiGolding this should no longer be the case.


Remove workarounds in #39 when dapr-seattle is upgraded to 0.6

Remove workarounds in #39 when dapr-seattle is upgraded to 0.6

Removed in https://github.com/dapr/test-infra/pull/45


Erroneous extra indent?

Thanks for reporting a bug! Please include all of the following:
A description of the issue. A screenshot is often helpful too.
Is this indent intended?

-> $ git diff -- home-manager/programs/terminal/direnv.nix
home-manager/programs/terminal/direnv.nix --- Nix
2    {
3      programs.direnv = {
4        enable = true;
5        enableBashIntegration = true;
   6     nix-direnv.enable = true;
   7   };
   8 }

A copy of what you're diffing.
If you're diffing files, include the before and after files.
If you're using difftastic with a VCS repository (e.g. git), include the URL and commit hash.
Local file. Simple example:
-> $ cat home-manager/programs/terminal/direnv.nix
{config, ...}:
{
  programs.direnv = {
    enable = true;
    enableBashIntegration = true;
    nix-direnv.enable = true;
  };
}
-> $ bat home-manager/programs/terminal/direnv.nix
───────┬─────────────────────────────────────────────────────────
       │ File: home-manager/programs/terminal/direnv.nix
───────┼─────────────────────────────────────────────────────────
   1   │ {config, ...}:
   2   │ {
   3   │   programs.direnv = {
   4   │     enable = true;
   5   │     enableBashIntegration = true;
   6 + │     nix-direnv.enable = true;
   7   │   };
   8   │ }
───────┴─────────────────────────────────────────────────────────

The version of difftastic you're using (see difft --version) and your operating system.
-> $ difft --version
Difftastic 0.32.0
-> $ echo "https://github.com/NixOS/nixpkgs/blob/$(jq -r '.nodes.nixpkgs.locked.rev' < flake.lock)/pkgs/tools/text/difftastic/default.nix"
https://github.com/NixOS/nixpkgs/blob/aaa1c973c8c189195e1b1a702d3b74dbcde91538/pkgs/tools/text/difftastic/default.nix

That looks correct to me, what were you expecting?

That looks correct to me, what were you expecting?

No indent in the line numbers/left margin, as shown in this picture from the Readme of this repo?
https://github.com/Wilfred/difftastic/blob/master/img/js.png

Or timestamp ~0:30 from the demo gif located in the same repo (which actually shows inline diff).

The left column is the line numbers from the before file, and the right column is the line numbers from the after file. I think this particular example is clearer with the default display (but I would say that :) ).

Note that the closing brace is on line 8 in the after file, but line 7 in the before file.

The left column is the line numbers from the before file, and the right column is the line numbers from the after file. I think this particular example is clearer with the default display (but I would say that :) ).

I would agree, if both columns had continued all the way from the top to the bottom like in your screenshot and your examples in the Readme =)
That, I don't get in my example. I guess the pertinent question is if this is intended(the behavior I get where the leftmost column counts lines until diff, then stops - and where the rightmost column starts at diff, and continues all the way to EOF)?

@Wilfred> The left column is the line numbers from the before file, and the right column is the line numbers from the after file. I think this particular example is clearer with the default display (but I would say that :) ).

Note that the closing brace is on line 8 in the after file, but line 7 in the before file.

I think I managed to figure out my confusion. Your comment shows an inline diff  - however this output is not possible (with my example given in this thread) to reproduce when the --display inline flag is given to difft.
That's what I found counter-intuitive, and tripped me up. I'm able to reproduce your output if I set --display side-by-side and the diff/file is small enough (or if I don't specify --display option).

@Wilfred> That looks correct to me, what were you expecting?

I guess I can then understand why you find it so - we can close this thread if you'd like now, if you don't think this is something worth looking more into for ergonomic usage reasons.

What I would have expected, would have been for the --display inline flag to trigger the ensure:contiguous() code path, as the inline diff shows in  your screenshot.


Use Json serializer to process custom strategies

This matches serialization done by the
\Magento\Config\Model\Config\Backend\Serialized\ArraySerialized class
when saving the custom strategies in the admin area in Magento 2.2.
Fixes #9.

These changes look good.
Do we need to worry about other uses of serialize:
https://github.com/meanbee/magento2-serviceworker/blob/fdfbcdda9dec498ff448d4e2c06eb7b441de39a6/src/Setup/InstallData.php#L77
https://github.com/meanbee/magento2-serviceworker/blob/fdfbcdda9dec498ff448d4e2c06eb7b441de39a6/src/Setup/UpgradeData.php#L66
https://github.com/meanbee/magento2-serviceworker/blob/fdfbcdda9dec498ff448d4e2c06eb7b441de39a6/src/Setup/UpgradeData.php#L90

@bobbyshaw good catch on the UpgradeData, I missed that one. The InstallData usage is already in the PR though as far as I can see.

Ah yes, just UpgradeData. I thought the search would search the codebase at the commit of this PR but obviously, that's not true.

@bobbyshaw updated.


Animation Library

 engineersmith_4628 on Discord says

Tulkin wanted to make an animation library - but as he is busy it has fallen on us to pick up his burdens 💪 We must not disappoint

 engineersmith_4628 on Discord says

What are we animating?
We're animating create:contraptions by setting their nbt to a certain premade-structures

How are is the nbt data for the structures created?
Right now they're hard coded. Could we put these into a file and read them. (Has to be a json; or we add a read function to ptdye-plus)
What is animated currently? What does it do?
Right now; the only thing it really does is handle the "opening" sequence of the trading platform. Which requires it increasing by Y amount every tick until it reaches the desired height where it is then made solid from the create:contraption

 yarden.zamir on Discord says

What is needed?

We need a way to smi-quickly define structures and their animations and be able to call them through lets say a minecraft command.
Basically we need three main things

a way define structure

a way to inject some data, like we do for the starter trades in the first trading platform

a way to spawn structure
a way to assign animation sequence to structutre that gets triggered either on spawn or potentioally later on (not critical, on spawn is good enough)

 yarden.zamir on Discord says

How bad is generating json from nbt or vice versa?

 yarden.zamir on Discord says

If we can hold the structure data in an object at runtime that will be the best

 engineersmith_4628 on Discord says

Well we can just have a single string field

 yarden.zamir on Discord says

Well but I want to manipulate it

 yarden.zamir on Discord says

So that's not that good

 engineersmith_4628 on Discord says

mhm

 yarden.zamir on Discord says

I think making nbt from json could work, kjs has some helper functions that we can highjack

 yarden.zamir on Discord says

But making json from nbt...

 yarden.zamir on Discord says

Which we need if we want to build something and use it instead json define each block

 engineersmith_4628 on Discord says

So define each block as an json object?

[
  { "blocka": "dirt", "nbt":"{\t"I_am\":\"dirt\"}" },
  { "blocka": "container", "nbt":"{\"insertdata\":\"${here}\"}"
]

 engineersmith_4628 on Discord says

I think the biggest issue is creating these structures in a readable-or even an editable format

 engineersmith_4628 on Discord says

Since; in nbt world the position is a hash of the 3 axises

 engineersmith_4628 on Discord says

Oh; there's NBT.toJson() function in kjs globals. No idea what it actually does

 engineersmith_4628 on Discord says

https://github.com/KubeJS-Mods/Rhino/blob/1.19/main/common/src/main/java/dev/latvian/mods/rhino/mod/util/NBTUtils.java#L403

 engineersmith_4628 on Discord says

But there's no fromJson function

 engineersmith_4628 on Discord says

Ah; there's fromTag which has an edge case for the json format

 engineersmith_4628 on Discord says

Update time (mostly for self-reflection)
I found how to find glue. Which doesn't sound exciting... BUT with this new found power instead of making nbts with limited knowledge.
You can make a build; select it with glue and BAM we can find it in code to convert it into all the things we need to do
https://github.com/EngineerSmith/Create-Prepare-to-Dye/blob/animation/kubejs/server_scripts/base/animation/commands.js

 engineersmith_4628 on Discord says

Update time
Been busy (and got distracted with 'art' so now there's a new painting in the game).

Made a block that can be placed next to 'glued' structures. So that when you right click it, it saves the time of having to type any commands as it can all be done with a click. It will then highlight (similarly to glue) the connected blocks of the structure so the builder can check that everything is correctly included.
Current issue is that I found BlockEvents.rightClicked is being triggered twice in a row. Not sure what is causing it as it seems they're both running server side; so it's not running once on client and then on server... I'll have to keep looking into it.
Anyway; once this is done. I think adding some sort of interface (<:cry:1184476833090113606> ) for naming the structure. Then some sort of item, which you can link structures together and start animating them (without affecting the already built ones - think ghost blocks of create's schematics)

 yarden.zamir on Discord says

Twice one for each hand!

 yarden.zamir on Discord says

Check if main hand and it should work

 yarden.zamir on Discord says

I seems like you are making it player facing, that sounds like a lot more work

 engineersmith_4628 on Discord says

Just trying to make it UX friendly than end user friendly

 engineersmith_4628 on Discord says

Also

 engineersmith_4628 on Discord says

The end results will be "two" systems which work together

 engineersmith_4628 on Discord says

1st the creation of the animation; which will produce a json of keyframes (with functions like lerps to positions, and actions like adding/removing blocks (e.g. upside down fire))
2nd reading the jsons and putting them into action when it's called for it

 engineersmith_4628 on Discord says

Do you know how to add block entity values to jade? So they show when you look at the block?

 yarden.zamir on Discord says

not sure but kikis2111 did something similar with the ponder tooltip thing maybe he knows

 engineersmith_4628 on Discord says

yarden.zamirWhat's the mod that allows you to shift+click to pick up a block entity? And do you know how I can blacklist my block? If you don't know I can look into it

 engineersmith_4628 on Discord says

You know your luck for a simple solution is out when you find autistic.sack.of.friends asking a similar question https://discord.com/channels/303440391124942858/1149285329417797672/1149285329417797672

 kikis2111 on Discord says

Yeah its possible with the jade api if you add on to the java mod

 autistic.sack.of.friends on Discord says

json serialization isn't so bad, but not terribly efficient

 kikis2111 on Discord says

Code in these files is related: https://github.com/jasperalani/ptdye-plus/tree/main/src/main/java/com/kikis/ptdyeplus/integration

 autistic.sack.of.friends on Discord says

i don't know if it works for blocks

 autistic.sack.of.friends on Discord says

probably not...

 engineersmith_4628 on Discord says

I need the block position every frame

 autistic.sack.of.friends on Discord says

can't you just store a time and an animation id

 autistic.sack.of.friends on Discord says

and an origin

 engineersmith_4628 on Discord says

This is for the blocks within the structure

 engineersmith_4628 on Discord says

OHH big brain moment

 autistic.sack.of.friends on Discord says

isn't that a default feature of create structures...

 engineersmith_4628 on Discord says

I can just send the client aabb information and then let the client find the blocks instead of storing the blocks in nbt/entity data

 engineersmith_4628 on Discord says

While it won't be the most accurate; it should work fine as it'd use the same create function as the server is doing

 engineersmith_4628 on Discord says

and order doesn't matter for this

 autistic.sack.of.friends on Discord says

i meant if the bounding box thing runs after the blocks are placed

 engineersmith_4628 on Discord says

Imagine create glue visual outline; do you notice it lagging as it only draws 1/20 a second than the frame rate

 engineersmith_4628 on Discord says

Unless you mean for the actual animation

 engineersmith_4628 on Discord says

What I'm doing is just to put a box around the structure so the builder knows what is included in the structure

 engineersmith_4628 on Discord says

Although - I don't really need to do that now that I think about it

 engineersmith_4628 on Discord says

Yeah; so just press ctrl while holding your super glue to make sure it is all connected

 engineersmith_4628 on Discord says

🧠  text > hours of work

 engineersmith_4628 on Discord says

Update time (As always for self reflection)

I've seen more of a vision forward for how I want the workflow to go now. Optionally, you will be able to use my "animation block" or anything else that will save NBT structures. The benfit of using the animation block is that you will see the boundary as you build onto the structure. The builder will be required to place a renamed name tag inside any container or inventory inside the structure so it can be referenced later. E.g. think how the first trades are inserted into the trade drop pod.
Right now; my animation blocks can detect structures; and know their bounds. So tomorrow I'll be add some simple graphics for it client side, and then saving them out to file using NBTIO (which I found exists, which is nice).
Once that is all done; I can move onto the actual keyframe work. Which I've had some ideas of copying how create schmatics show the ghost structures and how you can move them. However, it will be different as you'll be able to see multiple at once. I will probably have to add a "key frame controller" item which you can use to go forwards or backwards between frames, and mark new key frames. Which sounds complex; but I aim to keep it simple. If that means only having "one direction" e.g. only go forward between frames.
I'll play with it when I get there to figure out the best UX to workflow ratio
o7 Also why no crouch in creative mode flying anymore SMH

 engineersmith_4628 on Discord says

Currently stuck. It seems from what I can gather is that me updating the entity data on the server isn't being reped onto the clients

 yarden.zamir on Discord says

tulkinrb didn't solve this already?

 yarden.zamir on Discord says

I remember him talking about something along those lines

 engineersmith_4628 on Discord says

Ah; instead of entity data, seems to be using persistent data?

 engineersmith_4628 on Discord says

I was about to go down the scary route of sending network packets to the client

 engineersmith_4628 on Discord says

Persistent data doesn't seem to be working for me either

 engineersmith_4628 on Discord says

Oh; it seems Tulk did use network events

 yarden.zamir on Discord says

Tulk was a brave lad

 engineersmith_4628 on Discord says

https://tenor.com/view/dwight-schrute-the-office-salute-yes-sir-rip-gif-16721894

 yarden.zamir on Discord says

 engineersmith_4628 on Discord says

He was the best of us... Taken too soon <:cry:1184476833090113606>

 tulkinrb on Discord says

Meow

 tulkinrb on Discord says

Lol did I?

 engineersmith_4628 on Discord says

NetworkEvents.dataReceived("landing_spot_preview_stage_change", event => {
current_preview_state = event.getData().getString("state");
});

 engineersmith_4628 on Discord says

persisent data didn't seem to work for me for server => client

 tulkinrb on Discord says

Wait for serverwide data as well?

 engineersmith_4628 on Discord says

entity.tick(20, 0, (blockEntity) => {
if (blockEntity.level.isClientSide()) {
let {x: bx, y: by, z:bz} = blockEntity.getBlockPos()
let min = blockEntity.persistentData.getIntArray("min")
let max = blockEntity.persistentData.getIntArray("max")
console.log(min.length + ":" + max.length) // Doesn't get anything
if (min.length >= 3 && max.length >= 3) {
console.log("hit")
let [minX, minY, minZ] = min
let [maxX, maxY, maxZ] = max
minX += bx, maxX += bx
minY += by, maxY += by
minZ += bz, maxZ += bz
CreateClient.OUTLINER.showAABB(blockEntity, AABB.of(minX, minY, minZ, maxX, maxY, maxZ), 20)
.colored(7580121)
.withFaceTexture(SpecialTextures.THIN_CHECKERED, SpecialTextures.HIGHLIGHT_CHECKERED)
.disableLineNormals(SelectionTexture, SelectionTexture)
.lineWidth(0.06)
}
}
})

 tulkinrb on Discord says

Yeah that's very weird, client-server things are kinda broken lol

 engineersmith_4628 on Discord says

the worse part is this function is within the startup scripts. So restart the game each change to find it still don't work 🃏

 tulkinrb on Discord says

Oh no

 tulkinrb on Discord says

Startup scripts are a pain

 engineersmith_4628 on Discord says

https://docs.minecraftforge.net/en/1.19.x/blockentities/#synchronizing-the-data-to-the-client

Honestly; sometimes the docs have the perfect thing you're looking for

 engineersmith_4628 on Discord says

The moment when you realise a block entity has 3-4 different 'compoundTags', so this whole time I've been accessing difference ones constantly

 engineersmith_4628 on Discord says

Found 5 different ways to give blocks data so far

 engineersmith_4628 on Discord says

After what feels like forever

 engineersmith_4628 on Discord says

in the block entity definition.

 engineersmith_4628 on Discord says

I had to add
entity.enableSync()
and then after I update entity.data call entity.sync()

 yarden.zamir on Discord says

maybe you can put the login in startup script but outside startup events?

 yarden.zamir on Discord says

on server side?

 engineersmith_4628 on Discord says

Both; since the code is ran in the startup

 engineersmith_4628 on Discord says

then whenever I want to send the data from the server to the client; then I'd call entity.sync

 engineersmith_4628 on Discord says

This is probably the most compilated block we have added so far lmao

const UtilsJS = Java.loadClass('dev.latvian.mods.kubejs.util.UtilsJS')
const CreateClient = Java.loadClass('com.simibubi.create.CreateClient')
const SpecialTextures = Java.loadClass('com.simibubi.create.AllSpecialTextures')

StartupEvents.registry("block", (event) => {
  event.create("ptdye:animation_block")
    .translationKey("block.ptdye.animation_block")
    .tag("forge:immovable")
    .soundType(SoundType.STONE)
    .material("stone")
    .hardness(-1)
    .item((blockItem) => {
      blockItem.rarity("epic")
      blockItem.tooltip(Text.translate("block.ptdye.animation_block.tooltip").gold())
      blockItem.group(null) // remove from creative tabs
    })
    .blockEntity((entity) => {
      entity.enableSync()
      entity.initialData({
        name: "",
        min: [],
        max: [],
      })
      entity.tick(20, 0, (blockEntity) => {
        if (blockEntity.level.isClientSide()) {
          let {x: bx, y: by, z:bz} = blockEntity.getBlockPos()
          let min = blockEntity.data.getIntArray("min")
          let max = blockEntity.data.getIntArray("max")
          if (min.length >= 3 && max.length >= 3) {
            let [minX, minY, minZ] = min
            let [maxX, maxY, maxZ] = max
            minX += bx, maxX += bx
            minY += by, maxY += by
            minZ += bz, maxZ += bz
            CreateClient.OUTLINER.showAABB(blockEntity, AABB.of(maxX, maxY, maxZ, minX, minY, minZ), 20)
              .colored(7580121)
              .withFaceTexture(SpecialTextures.CHECKERED)
              .disableLineNormals()
              .lineWidth(0.06)
          }
        }
      })
    })
    .property(BlockProperties.HORIZONTAL_FACING)
    .property(BlockProperties.TRIGGERED)
    .placementState((state) => {
      state.setValue(BlockProperties.HORIZONTAL_FACING, Direction.north)
      state.setValue(BlockProperties.TRIGGERED, UtilsJS.cast(false))
    })
})

 engineersmith_4628 on Discord says

So it was a lot of looking through forge docs, then looking through kubejs sauce to see if they've implemented the sync thing. Then working backwards to figure out how to use/enable it

after you load an external class probe again, it should provide completions

 engineersmith_4628 on Discord says

It's because I was using level.getBlockEntity which returns a BlockEntity - but I needed BlockEntityJS which extends/inherits from BlockEntity and JavaScript does no casting. Sooo. I had to hope I could access data even though it doesn't have that field.

const blockEntity = event.level.getBlockEntity(blockPos)
if (!(blockEntity instanceof BlockEntityJS))
  return

I got no idea if it will work; but I hope this will at least try to catch anything that isn't BlockEntityJS

 engineersmith_4628 on Discord says

 yarden.zamir on Discord says

oh I'm exited now, this looks epic

 engineersmith_4628 on Discord says

Me talking to myself to get a little feedback.

I've decided to write a java function for the actual creation of the contraption nbt than have it in javascript.
I'm not sure how javascript -> Java works. So I'm assuming it is some what like lua -> C[++]. Where after each lua call to C it has to then jump back to lua and that can cause some cache misses, and adds extra cycles that don't need to be.

 engineersmith_4628 on Discord says

and yes; I woke up at 1-2am to start this function and now I shall try to sleep again

 engineersmith_4628 on Discord says

/**

Get ptdye:animation_anchor_set with position set
@param {BlockPos} blockPos
@returns {Internal.ItemStack}
*/
function animation_getAnchorAt(blockPos) {
const {x, y, z} = blockPos;
const pos = [UtilsJS.parseInt(x, 0), UtilsJS.parseInt(y, 0), Utils.parseInt(z, 0)]
let item = Item.withNBT("ptdye:animation_anchor_set", {
target: NBT.intArrayTag(pos)
})
item = item.withName(Text.translate("item.ptdye.animation_anchor_set", pos.join(' ,'))) // this is italitic
return item
}

 engineersmith_4628 on Discord says

I could set the nbt easily tho since I'm already doing it

 yarden.zamir on Discord says

might be the text translate is already one

 engineersmith_4628 on Discord says

Text.translate returns a text component

 engineersmith_4628 on Discord says

Ooo it works

 engineersmith_4628 on Discord says

Update time!
I've finished the first system. It seems robust and feature rich for what is required for it. Right now it saves the contraptions to a directory.

Next I'm going to try and define what I have to do next and how to achieve it

 engineersmith_4628 on Discord says

https://github.com/game-design-driven/ptdye-plus/pull/13

 engineersmith_4628 on Discord says

yarden.zamir I know how busy you are with testing your typing speed - but it would be handy to have a message in the chat when the issue is mentioned in another so I don't have to post a link in discord too

 yarden.zamir on Discord says

Awesome! great job

 yarden.zamir on Discord says

lol, done with that now, only needed to top past yarden, he was taunting me. Yes I can add that, my plan is to just support prs as if they are regular issues and they will have their own dev thread. Have a few more things I wanted to add and change but been procrastinating on that as writing a discord bot is not as exciting as working on the pack lol

 engineersmith_4628 on Discord says

Yee yee; no pressure. work on what you want to

 engineersmith_4628 on Discord says

Just remember I believe the bot would come under community so it is on the low priority

 engineersmith_4628 on Discord says

So don't spend your life on it

 yarden.zamir on Discord says

oh that reminds me, should move the bot to the org too

 engineersmith_4628 on Discord says

https://github.com/game-design-driven/Create-Prepare-to-Dye/pull/544


an error occurred while splitting pdf into single pages with the pdftk burst command

static extractTextFromPdf(pdf, options) {
    console.log('entred to exctract');
    pdf = pathe.resolve(pdf)

    return new Promise((resolve, reject) => {
      const processor = pdfExtract(pdf, { ...options, clean: true }, (err) => {
        if (err) {
          reject(err);
        }
      });
      processor.on('complete', (data) => {
        resolve(data.text_pages);
        console.log('good');
      });
      processor.on('error', (err) => {
        console.log(' error extractTextFromPdf ');
        reject(err);
      });
    });
  }

It seems the pdfk link on their website isn't providing the latest installation package. See this issue on StackOverflow.
After installing the latest version of pdfk provided in the StackOverflow issue the problem should be solved!


When will there be a new package on NPM ?

I want to include the progress in my projects Testmybot and Botium, but the package on npmjs.org is rather old. I also don't want to point directly to the Git repository.
When will there be a new package released ?

@Schmavery will probably release new version after merging #572, #612, #617 and maybe #603
But this is just my guess

That's the plan. @bsansouci and I worked on the weekend to try and get everything merged & unified a bit so that we can push a working version out to npm. We ran out of time in the end but hope to finish up tonight. Sorry for the delay, it can be hard to make time for this and there's quite a few fiddly details involved in making the datatypes line up and deciding how the format we expose should evolve as fb changes what they expose.

Maybe you can use "pre-release" to keep latest version? Also if someday FB api is changed, you can release many unstable hotfix version to prevent disaster.

Hey @ravkr, @ALiangLiang , we did our best to merge in the GraphQL versions of getThreadInfo and getThreadHistory in the dev branch tonight. If you have a chance, feel free to give them a try and see if there are any bugs we missed before we merge to master and publish to npm.

@Schmavery I noticed that the new code contains ...Url in the returned objects but I think that we should call it ...URL (as we do with ID and not Id)

@ravkr I went with Url because that's how we've written it in the past.. hard to know with some of these things haha
As an update, we merged the dev bench to master and planning to publish soon.

@Schmavery I thought that if we are changing so much to unify style, this could also be changed to match the style (and because URL is normally typed uppercase)

I don't think that prettier was a good choice
These new if statements and throws splitted to multiple lines are not looking good in my opinion :(

same here, why use 5 lines instead of just one? :/ Now I can display less code at once on my screen

@ravkr we don't want to spend time arguing about coding style here, there is so much other work to do. Thanks for expressing your opinion but we'll move forward with using Prettier and its default rules.

We published version 1.5.0 to npm today. Thanks for everyone's patience.


⚠ Bofrost.de has degraded performance

In 8e79b9c, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 724 ms

Resolved: Bofrost.de performance has improved in 5745885 after 6 minutes.


add input perturbation noise

Method from https://arxiv.org/abs/2301.11706
Recommended value is 0.1. Values >0.2 are too high.
Example: https://files.catbox.moe/2h7dws.jpg
Very simple, but no one has added this yet.

What's the difference between input perturbation noise and offset noise? The inplementation seems the same to me.

For those who also wondered, I found the explanation from the author: https://github.com/forever208/DDPM-IP/issues/7#issuecomment-1563108075

What's the difference between input perturbation noise and offset noise? The inplementation seems the same to me.


fix(guide): Added solutions and some hints and problem explanations for curriculum related Guide articles being ported over to forum

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
[x] My changes do not use shortened URLs or affiliate links.

Title pretty much explains what this is for.  Most of the solutions came from the current curriculum challenge file.  The other information came from the forum topics for the same challenge.

Shouldn't all the titles be h1s or will this not matter when they're moved to the forum?  I just noticed that some of them use # and some ##.

@ojeytonwilliams I think I made all of your suggested changes.

Thanks @RandellDawson it all looks good now.


chore(backport): backport changes from main to v0.16.1 release branch

Updates v16 release branch with recent man changes

Codecov Report
Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (release/v0.16.1@a4739e8). Learn more about missing BASE report.

Files with missing lines
Patch %
Lines

core/listener.go
60.00%
3 Missing and 1 partial :warning:

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v0.16.1    #3776   +/-   ##
==================================================
  Coverage                   ?   46.55%
==================================================
  Files                      ?      314
  Lines                      ?    17999
  Branches                   ?        0
==================================================
  Hits                       ?     8380
  Misses                     ?     8597
  Partials                   ?     1022

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


No issues, only thanks!

I happen to (still?) be a Windows user and I happened to discover this excellent ipsum inadvertently in fact from https://github.com/AdguardTeam/AdguardDNS/issues/154 (I use Adguard filters with uBlockOrigin).
I most appreciate and download every morning when updating several blockers one of the available lists, master/levels/2.txt is my choice.
I don't use this list as primarily intended; rather I download it from
https://cdn.rawgit.com/stamparm/ipsum/master/levels/2.txt
and combine it with other address lists to make/update the address blacklist file to be used for DNSCrypt-Proxy.
What I most appreciate is this division into levels, a mighty clever and so handy approach for users.
I've chosen Level 2 because,
1- I like the idea "spotted once let it go, twice (or more!) block it! ;
2- Addresses spotted once only represent something like 75-80% of the complete list, too heavy in proportion of the risk
Many thanks, @stamparm , I repeat how I most appreciate your work. Daily updated lists moreover, what a worthy contribution to security.

@zymase glad that you like it. "Level" idea you mentioned is basically the most important concept part here. I hope that at some point other users will discover that too :)


fastmath=True gives invalid np.isfinite() value

Check off these boxes:

[x] I have tried using the latest released version of Numba (most recent is
visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
0.51.2

[x] I have included below a minimal working reproducer (if you are unsure how
to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).

[x] there is no other issue present that already describes the issue you have (search at https://github.com/numba/numba/issues?&q=is%3Aissue).

Details of the bug here, including, if applicable, what you expected to happen
fastmath=True gives invalid np.isfinite() value
in this case it's invalid:
@njit(fastmath=True,nogil=True,cache=False )
def _check_finite_matrix(a):
        for v in np.nditer(a):
            if not np.isfinite(v.item()):
              error=True

a=[[ inf -inf]
 [-inf 265.]]
_check_finite_matrix(a)

in linalg.py it's valid because no fastmath=True:
@register_jitable
def _check_finite_matrix(a):
    for v in np.nditer(a):
        if not np.isfinite(v.item()):
            raise np.linalg.LinAlgError(
                "Array must not contain infs or NaNs.")

Is it bug or feature? Is it possible to use fastmath with these checks? I have problem on py3.6 with try, because seems support for try only from py3.7

Thanks for the report. I think the fastmath flag is doing what is intended. If you add fastmath to a function it will permit a number of optimisations based on assumptions as described here. If you wish to limit the scope of the assumptions it's possible to select on a flag-by-flag basis which parts of fastmath to use, for example:
from numba import njit
import numpy as np

def foo(a):
    for v in a:
        print("-" * 40)
        print("--> isfinite(", v, "):", np.isfinite(v))
        print("--> isnan(", v, "):", np.isnan(v))

a=np.array([np.inf, -np.inf, np.nan, 12.])

base_flags = {'nsz', 'reassoc', 'arcp', 'contract', 'afn', 'reassoc'}

print("NumPy")
foo(a)

for flags in (False,
              True,
              base_flags,
              base_flags|{'nnan'},
              base_flags|{'ninf'},
              base_flags|{'ninf', 'nnan'}):
    def pflags(f):
        if not isinstance(f, set):
            return {f,}
        else:
            return f
    print("\nFlags {}".format(sorted(pflags(flags))))
    njit(fastmath=flags)(foo)(a)

Closing this question as it seems to be resolved. Numba now has a discourse forum https://numba.discourse.group/ which is great for questions like this, please do consider posting there in future :) Thanks!


Update to latest SB/SF milestones

SB M5 and SF 6 will be available ~ 09/19/2022.
Remove manual import file once we go to SB M5
Had to revert b188436ab5db56faf713d39593a67e2999864c2e (auto-generated auto-config imports file only in SB snapshot)
Originally posted by @onobc in https://github.com/spring-projects-experimental/spring-pulsar/pull/109#discussion_r969077443

We are tracking on snapshots rather than milestones - nothing left to do here.


Client with Java 8 runtime and Apache HttpClient 5 Transport fails with java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

Description
Client with Java 8 runtime and Apache HttpClient 5 Transport fails with java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer (thanks to @peekar). We changed tests (HeapBufferedAsyncEntityConsumerTest) but it slipped in sadly.
Issues Resolved
Closes https://github.com/opensearch-project/opensearch-java/issues/904
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@reta This doesn't need to be backported to 2.x, does it?

@reta This doesn't need to be backported to 2.x, does it?

Yeah we need, since we have Apache HttpClient 5 transport there as well (as non-default)


SORT_1 solved using java

Description
Solved SORT_1 using java
Question
You are given an array of 0s and 1s in random order.
Fixes

[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

[x] My code follows the style guidelines of this project
[x] I have made corresponding changes to the documentation
[x] I have added tests that prove my fix is effective or that my feature works

Works fine on my system

please assign this to me.

@arpitapadhy23 can you review this again


Major update to the Gaea user guide

This is a major update to the Gaea user guide.  This will be, essentially, a full rewrite of the Gaea information.  Other pages may be touched to ensure the information is correct with the Gaea updates.

@elisabethpatterson, this is ready for your review (again).

A link to the Conda documentation is now redirecting.  I added a fix to this PR.


Doesn't work

Not sure how you possibly tested this before publishing in the gallery...no matter what directory I give it after I hash my temp folder, it adds no new files doesn't honor recurse simply doesn't work.  Would love this if it worked!

Can you be more specific about your issue?

Here are my chronological runs should sum it up:
Run #1 broken right off the bat since this is the FIRST run, "12" seems to be some magic number here as the later runs show:
 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path C:\Temp -XML DB.XML
-----------------------------------
Total files processed      : 55
Total new added files      : 12
Total good files           : 0
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 43
-----------------------------------

Total   : 55
New     : 12
Ok      : 0
Bad     : 0
Missed  : 0
Locked  : 43
Unknown : 0
Deleted : 0

Run #2 fails because apparently unless you suddenly add the "include" switch, it sees no files in a root folder (THERE ARE 74 FILES IN MY D: ROOT):
 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path D:\ -XML DB.XML
-----------------------------------
Total files processed      : 0
Total good files           : 0
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 0
-----------------------------------

Total   : 0
New     : 0
Ok      : 0
Bad     : 0
Missed  : 0
Locked  : 0
Unknown : 0
Deleted : 0

Run #3, now only after adding include does it see the files as "processed"? No, they never were so it should have added far more than the 12 existing but shows how broken the logic is (THERE ARE 74 FILES IN MY D: ROOT):
 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path D:\ -Include *.* -XML DB.XML
-----------------------------------
Total files processed      : 12
Total good files           : 12
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 0
-----------------------------------

Total   : 12
New     : 0
Ok      : 12
Bad     : 0
Missed  : 0
Locked  : 0
Unknown : 0
Deleted : 0

Run #4, let's give it a huge folder structure to scan:
 C:\Data\Scripts\Sync\Scripts\PSScripts  
λ  Start-PsFCIV -Path 'D:\Data\My Documents\' -Recurse -XML DB.XML
-----------------------------------
Total files processed      : 12
Total good files           : 12
Total bad files            : 0
Total unknown status files : 0
Total missing files        : 0
Total locked files         : 0
-----------------------------------

Total   : 12
New     : 0
Ok      : 12
Bad     : 0
Missed  : 0
Locked  : 0
Unknown : 0
Deleted : 0

As you can see...very broken.

Code comment: "# if XML file exist, process and check all records. XML file will not be modified."
Reading the subsequent code, your logic is totally broken.  Once it sees a XML file exists, it will never add new entries.  In addition, checking for the path ending in a slash breaks the ability to start at a root drive folder.  Also, the logic on checking for a wildcard for "include" is broken.  Once it reads the existing XML, it then erroneously dumps that same XML into whatever path you scan.  I scanned 4 paths, each now has a duplicate copy of the first XML (the one run that added anything).
I don't see how there is any way this could have been tested before publishing it.


DisplayHex impls have different behaviours for different types

DisplayArray, DisplayByteSlice, and fmt_hex_exact each behave differently, this is surprising.
For example, how they handle Formatter::precision.

Part of the reason is that DisplayArray::display and DisplayByteSlice::display are currently different implementations.
One possible solution could be to have
fn internal_display(bytes: &[u8], f: &mut fmt::Formatter, case: Case) -> fmt::Result;

and both of these structs would call this internal function.
Then to have a single implementation that is also used for fmt_hex_exact, we could rewrite internal_display in terms of a T: IntoIterator, instead of a &[u8], with possibly the help of the ExactSizeIterator bound.
Thank you for your input.

This issue looks like it is almost done.

Then to have a single implementation that is also used for fmt_hex_exact, we could rewrite internal_display in terms of a T: IntoIterator, instead of a &[u8], with possibly the help of the ExactSizeIterator bound.

This sounds correct. Do you want to work on it?
I hacked the test_display_hex macro to try to verify exactly what was currently now working, here it is if you want to use it. It could do with cleaning up though.
diff --git a/src/display.rs b/src/display.rs
index 9dce504..dcf8221 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -534,6 +534,7 @@ where
             encoder.as_str()
         }
     };
+
     f.pad_integral(true, "0x", encoded)
 }

@@ -643,12 +644,54 @@ mod tests {
             assert_eq!(format!("{:.65}", dummy), "2a".repeat(32));
         }

+        struct Dummy2([u8; 2]);
+        impl fmt::Display for Dummy2 {
+            fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                fmt_hex_exact!(f, 2, &self.0, Case::Lower)
+            }
+        }
+        struct Dummy4([u8; 4]);
+        impl fmt::Display for Dummy4 {
+            fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                fmt_hex_exact!(f, 4, &self.0, Case::Lower)
+            }
+        }
+        struct Dummy512([u8; 512]);
+        impl fmt::Display for Dummy512 {
+            fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                fmt_hex_exact!(f, 512, &self.0, Case::Lower)
+            }
+        }
+
         macro_rules! test_display_hex {
             ($fs: expr, $a: expr, $check: expr) => {
-                let to_display_array = $a;
-                let to_display_byte_slice = Vec::from($a);
-                assert_eq!(format!($fs, to_display_array.as_hex()), $check);
-                assert_eq!(format!($fs, to_display_byte_slice.as_hex()), $check);
+                let array = $a;
+                let slice = &$a; // Obviously a byte slice.
+                let vec = Vec::from($a); // Uses `DisplayByteSlice` as well.
+
+                assert_eq!(format!($fs, array.as_hex()), $check);
+                assert_eq!(format!($fs, slice.as_hex()), $check);
+                assert_eq!(format!($fs, vec.as_hex()), $check);
+
+                if array.len() == 2 {
+                    let mut buf: [u8; 2] = [0; 2];
+                    buf.copy_from_slice(slice);
+                    let dummy = Dummy2(buf);
+                    assert_eq!(format!($fs, dummy), $check);
+                } else if array.len() == 4 {
+                    let mut buf: [u8; 4] = [0; 4];
+                    buf.copy_from_slice(slice);
+                    let dummy = Dummy4(buf);
+                    assert_eq!(format!($fs, dummy), $check);
+                } else if array.len() == 512 {
+                    let mut buf: [u8; 512] = [0; 512];
+                    buf.copy_from_slice(slice);
+                    let dummy = Dummy512(buf);
+                    assert_eq!(format!($fs, dummy), $check);
+                } else {
+                    eprintln!("You forgot to implement DummyX for array length: {}", array.len());
+                    panic!();
+                }
             };
         }

And running it we get
failures:

---- display::tests::alloc::precision_with_padding_truncates stdout ----
thread 'display::tests::alloc::precision_with_padding_truncates' panicked at src/display.rs:728:13:
assertion `left == right` failed
  left: "      1234"
 right: "1234      "

---- display::tests::alloc::precision_with_padding_pads_right stdout ----
thread 'display::tests::alloc::precision_with_padding_pads_right' panicked at src/display.rs:734:13:
assertion `left == right` failed
  left: "  12345678"
 right: "12345678  "
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    display::tests::alloc::precision_with_padding_pads_right
    display::tests::alloc::precision_with_padding_truncates

test result: FAILED. 53 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

I think we should do this for v1.0. @apoelstra do you have an opinion?

Legend.

Agreed we should do this for v1.


[stable/datadog] Event Collection with DaemonSet doesn't work helm chart v2

Describe the bug
After update to helm chart v2 Event Collection with DaemonSet doesn't work anymore. Infrastructure - Containers (Datadog UI). I tried to use datadog agent image tag 7.17.1, 7.18.0, 7.18.1
Version of Helm and Kubernetes:
AWS EKS 1.14.8
Helm 2.16.2
Which chart:
stable/datadog v2.1.1
What happened:
kubernetes event not collected to Datadog.
What you expected to happen:
kubernetes event collected to Datadog.
How to reproduce it (as minimally and precisely as possible):
Use the following values.
datadog:
  apiKeyExistingSecret: datadog-secret
  kubeStateMetricsEnabled: true
  clusterChecks:
    enabled: false
  dogstatsd:
    port: 8125
    useHostPort: true
    nonLocalTraffic: true
  collectEvents: true
  leaderElection: true
  logs:
    enabled: true
    containerCollectAll: true
  logsEnabled: true
  logsConfigContainerCollectAll: true
  apm:
    enabled: false
    port: 8126
  confd:
    disk.yaml: |-
      init_config:
      instances:
        - use_mount: false
          excluded_filesystems:
            - autofs
            - /proc/sys/fs/binfmt_misc
            - /host/proc/sys/fs/binfmt_misc
  processAgent:
    enabled: true
    processCollection: true
  systemProbe:
    enabled: false
    debugPort: 0
    enableConntrack: true
    seccomp: localhost/system-probe
    seccompRoot: /var/lib/kubelet/seccomp
    bpfDebug: false
    apparmor: unconfined

clusterAgent:
  enabled: false
  image:
    repository: datadog/cluster-agent
    tag: 1.5.2
    pullPolicy: IfNotPresent
  token: ""
  replicas: 1
  rbac:
    create: true
    serviceAccountName: default
  metricsProvider:
    enabled: false
    wpaController: false
    service:
      type: ClusterIP
      port: 443
  healthPort: 8080
  livenessProbe:
    httpGet:
      port: 5000
      path: /metrics
      scheme: HTTP
  readinessProbe:
    httpGet:
      port: 5000
      path: /metrics
      scheme: HTTP
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
kubeStateMetrics:
  enabled: true

agents:
  enabled: true
  image:
    repository: datadog/agent
    tag: "7"
    pullPolicy: IfNotPresent
  rbac:
    create: true
    serviceAccountName: default
  containers:
    agent:
      resources: {}
      livenessProbe:
        httpGet:
          path: /health
          port: 5555
        initialDelaySeconds: 15
        periodSeconds: 15
        timeoutSeconds: 5
        successThreshold: 1
        failureThreshold: 6
    processAgent:
      resources: {}
    traceAgent:
      resources: {}
      livenessProbe:
        tcpSocket:
          port: 8126
        initialDelaySeconds: 15
        periodSeconds: 15
        timeoutSeconds: 5
    systemProbe:
      resources: {}
    initContainers:
      resources: {}
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: "10%"

clusterChecksRunner:
  enabled: false
  image:
    repository: datadog/agent
    tag: "7"
    pullPolicy: IfNotPresent
  createPodDisruptionBudget: false
  rbac:
    create: true
    dedicated: false
clusterChecksRunner.replicas set to 2.
  replicas: 2
  resources: {}

affinity
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0

kube-state-metrics:
  rbac:
    create: true
  serviceAccount:
    create: true
    name:

Anything else we need to know:

All other features work as expected (logs, traces, statsd, checks)
event will be sent if I enable clusterAgent.

clusterAgent:
  enabled: false

DEBUG log shows

2020-03-30T05:30:34.184650061Z 2020-03-30 05:30:34 UTC | CORE | DEBUG | (pkg/util/kubernetes/apiserver/apiserver.go:180 in connect) | Could successfully collect Pods, Nodes, Services and Events

it's generated in this line.
https://github.com/DataDog/datadog-agent/blob/e423dcb592a8a1ee96153ed6d87bef0adce3eebb/pkg/util/kubernetes/apiserver/apiserver.go#L210

Hi @guitarrapc , thanks for the creating the issue. I believe it will be fixed by the referenced PR; let me know if you give it a try.

Hi @celenechang , thank you for the PR. I've confirmed PR fix election issue and Datadog now receives k8s event as expected!

Great news, thanks for the update!


Add Text Variables, Update test for Unknown

*Add Text Variables from stock MajorBBS
-BAUD
-TIME_ONLINE
-CREDITS
-CREATION_DATE (account)
-REG_NUMBER
*Added test for Unknown Variable
*Added tests for new Ushort Extensions

Added tests for new extensions (ToDosDate & FromDosDate)


Compilation step not copying over built css to public/assets folder

As per the README

This output is then picked up by the asset pipeline, digested, and copied into public/assets, as any other asset pipeline file.

However, no CSS file (application.css) makes it to public/assets when running rails assets:precompile (only JS).
In Package.json I added build script
"build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"

I'm also using sprockets-rails (3.4.2)
Any idea to get this working?

how did you start your new rails app, specifically? Did you start with --javascript=esbuild or --css=boostrap or both?

both --javascript=esbuild --css=boostrap

seems like it works for me following these steps
rails new Test3 --javascript=esbuild --css=bootstrap &&
cd Test3/ &&
bundle install && git add . && git commit -m "initial commit" &&
rails assets:precompile


integer wrapping

[x] add 'w' variants of integer types which means "wrapping". see code below.
[x] fix codegen for non 'w' variants of integers to emit correct nuw/nsw.
[x] make pointer arithmetic non wrapping
[x] in debug mode, make integer overflow in arithmetic panic. in release mode, undefined behavior.
[x] tests for add, sub, mul, shl, negate wrapping crashing
[x] tests for add, sub, mul, shl, negate working with wrapping types
[x] eval tests for add, sub, mul, shl, negate wrapping cause compile error
[x] eval tests for add, sub, mul, shl, negate working with wrapping types
[x] when adding normal int to wrapping int, wrapping type takes precedence
[x] @shl_with_overflow builtin fn

#max_value(i32) + 1 // undefined behavior. -nuw +nsw
#max_value(u32) + 1 // undefined behavior. +nuw -nsw
#max_value(iw32) + 1 == #min_value(iw32) // -nuw -nsw
#max_value(uw32) + 1 == #min_value(uw32) // -nuw -nsw

we also want "volatile" and perhaps other variable qualifiers. maybe wrappable keyword is in order and you can put multiple variable qualifiers in front of the type? instead of iw32, wrappable i32

IMO, there shouldn't be two separate types for wrapping and non-wrapping integers. It would be better to choose a sane default (wrapping) and make it the only option.

I argue that not wrapping by default is actually safer, less likely to result in bugs, and produces more optimal code. Here's why:
Zig plans to have significantly different debug and release builds. For example, it's planned to have array bounds checking in debug mode but not in release mode. Uninitialized memory is set to all 0xaa bytes in debug mode, uninitialized in release mode. And finally, in debug mode, all integer arithmetic is checked and the program will crash on overflow. In release mode, overflow is undefined behavior.
Programmers rarely want integers to overflow. By default, we want an overflow to crash the debug build. Only when a programmer explicitly states that they want the wrapping behavior - perhaps they're doing bit fiddling, creating a hash algorithm, or a pseudo random number generator - will they get it. On the other hand, if all integers were wrapping, we wouldn't know if the wrapping was intentional or not, so we couldn't crash the debug build when it accidentally occurred.
As for optimal code, the ability to assume integers will not wrap provides more optimal integer arithmetic.

I suggest using overflow by default (because this is what low level programmers will expect and maps more nicely onto the actual behavior of the CPU), and introducing a checked keyword for checked math. Perhaps something like this:
@maxValue(u32) + 1 == @minValue(u32)
checked { @maxValue(u32) + 1 ?? 0 } == 0

I personally expect and prefer to have overflow by default, it seems saner to me. Programmers should understand the underlying nature of their integers. Otherwise, I would prefer something like unchecked { ... } over the ugly macros.

see #159 for the current state of this feature.


[CRB-137] Fix warnings, update to Rust 2018, and update dependencies

Split off from #4

@will-gluwa

I think this looks good but what bothers me is that there isn't a single automated test job here. Not even a simple compile/lint job which would give us some confidence in the changes.

I agree. @atodorov please work with @nathanwhit to get some basic testing in place.

I agree. @atodorov please work with @nathanwhit to get some basic testing in place.

FTR that should be covered by CRB-147, CRB-51 and CRB-166 (#31) where I've had no luck so far to execute those tests inside GitHub Actions.


Add iproute2 to test sysroot to install tc cli

Summary: Add iproute2 to test sysroot to install tc cli
This is a prerequisite for creating network interfaces that will exhibit packet delays during bpf tests via a netem qdisc. This will allow us to improve test coverage for the tcp stats source connector by causing tcp retransmissions to occur within the test.
While busybox does include a tc command, I believe it doesn't support the tc qdisc add command. See test plan below to see the error caused when using busybox's version. I also looked at busybox's source code and it doesn't appear to handle the add command from what I can tell. I don't see any documentation that confirms this suspicion, but using the iproute2 version works as expected.
If there aren't concerns with this change, I will need assistance with pushing new sysroots to GCS and updating sysroots.bzl with the new sysroots.
Relevant Issues: N/A
Type of change: /kind test-infra
Test Plan: Built a new sysroot manually and scped the files into a qemu VM to verify that adding a netem qdsic works
# Try to create netem with busybox tc
bash-5.2# tc qdisc add dev eth1 root netem delay 100m
tc: invalid argument 'root' to 'command'

~/code/pixie/tools/docker/.build/sysroots (main) $ scp -i /tmp/tmp.crxC4TJvhi/ssh_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P 35975 sbin/tc root@<IP_ADDRESS>:/sbin/
~/code/pixie/tools/docker/.build/sysroots (main) $ scp -i /tmp/tmp.crxC4TJvhi/ssh_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P 35975 ./usr/lib/x86_64-linux-gnu/libbpf.so.1 root@<IP_ADDRESS>:/usr/lib/x86_64-linux-gnu/libbpf.so.1

# Successfully create netem qdisc with iproute2 tc
bash-5.2# /sbin/tc qdisc add dev eth1 root netem delay 100ms
bash-5.2#
bash-5.2# /sbin/tc qdisc show
[ ... ]
qdisc netem 8001: dev eth1 root refcnt 2 limit 1000 delay 100ms

cc @pixie-io/stirling for visibility

Will push sysroots and update this PR


CV arrayType problems

There are some known problems:

windbg doesn't allow to expand arrayType fields, the VS debugger works right;
values show two elements, when should show 1 (ProjectN shows 1)
class repro_TestArrays_MyClassA *[2];
ProjectN has better name for primitive arrays types (for example class System::Byte[,] *, when CoreRT names it as class UInt8__ *)

The second was fixed by #3932.
@davidwrighton maybe you also knows how to fix the rest?