InitialValues from state with state load during the rendering

I have some trouble trying to initialize a redux-form decorated form with some data fetched from a backend (async with redux-thunk) and stored in redux state.
The fact is I need to perform the fetch when a user display the page where the form is and populate the initialValues of the form with the new state values.
My redux-form is connected to the state like it is explained in your example, and I fetch data with an action triggered on the componentWillMount() method.
But during the first render, the redux-form/INITIALIZE action occurs, setting the initialValues with empty data and my action fetching real data and storing them into the state come after. But there is no refresh on the displayed form.
Do you have a specific pattern to work with this case ?
How does it works in your exemple to be able to reload initialValues (and pristine state) when clicking on Load Account button ?
PS : I'm using redux-form 6.0.0.rc4

Just guessing, but I needed to set enableReinitialize to true:
RecordForm = reduxForm({
  form: 'recordForm',
  enableReinitialize: true,
})(RecordForm);

Another option would be to use https://github.com/makeomatic/redux-connect instead of implementing componentWillMount. I do this on a wrapper "page" component - see https://github.com/erikras/redux-form/issues/1407#issuecomment-235898906

Why not just preventing rendering until you received the backend data?
/* MyFormContainer.js */
// render method
render() {
        if (this.props.loadInProgress === true) { // <-- Use a state variable to know when the load is done or not
            return false; // <-- Prevent rendering
        } else {
            return (
                <MyForm onSubmit={this.props.myFormHandler} initialValues={this.props.initialData}/> // <-- MyForm is the redux-form
            );
        }
    }

function mapStateToProps(state) {
    return {
        loadInProgress: state.categoryRulesForm.loadInProgress, // <-- Pass the variable from state to props
        // Other mapping
    }
}

componentWillMount() {
        // Asynchronously load the initial data
        this.props.loadInitialData(this.props.loadParameter);
    }

/* MyFormAction.js */
// loadRequested and loadReceived are classic actions
export function loadInitialData(parameter) {
    // Async function (thunk)
    return function(dispatch) {
        dispatch(loadRequested(parameter));
        return fetch(`http://example/${parameter}`, {
                method: 'GET',
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
            })
            .then(response => response.json())
            .then(json => dispatch(loadReceived(json)));
    }
}

/* MyFormReducer.js */
const initialState = {
    loadInProgress: true
}

export default function loadInitialData(state = initialState, action) {
    switch (action.type) {
        case ActionTypes.LOAD_REQUESTED:
            return assign({}, state, {
                loadInProgress: true
            });

        case ActionTypes.LOAD_RECEIVED:
            return assign({}, state, {
                loadInProgress: false
            });

        default:
            return state;
    }
}

Thank you,
I'm going to  try your solutions !

Sorry that i'm bumping this issue but i wanted to further ask about this.
I've implemented the same flow that was suggested here by @Sir4ur0n  - using loadInitialData as an async action that fetches the data.
What i'm experiencing is the following:

Component starts to create itself and calls componentWillMount.
An action is dispatched that sets the loadInProgress to true
render function is called with the "old" store still (?!)
redux-form is initialized with an empty object
another render is called because of the INITIALIZE action. This time loadInProgress is true
redux-form is destroyed with DESTROY action
API call returns with data, setting loadInProgress back to false
redux-form is INITIALIZED once again but with the fetched data

I dont think this is the best flow and it has to be a mistake here... anyone cares to pitch in?

Hello, @slavab89  I'm encountering the same issue. Even with the loadInProgress. In fact what Happened is that :
First time we render the form so : FETCH VERSIONS (versions are the element of the select options) > FETCH_VERSIONS_SUCCESS then redux-form/INITIALIZE then REGISTER FIELD.
After we click cancel for example so RouterDidChange and redux-form-DESTROY.
Then we go again to the form,  so FETCH_VERSIONS, redux-form/INITIALIZE, and redux-form/DESTROY is called before FETCH_VERSIONS_SUCCESS.

I've done quite a bit of reading about this.
This is actually not a redux-form issue but rather a more react + redux combined.
You can read the excellent comment that explains the situation and offers a solution (There are a few more in the next comments).
What i did on my end was the same as offered in the comment.
I'm using the following route to display a form to edit some object /:objectId
export default connect((state, ownProps) => {
  const wantedObjectId = ownProps.params.objectId;
  const actualObjectId = state.objectToEdit.id;

  return {
    isFetching: state.isFetching || wantedObjectId !== actualObjectId
   };
})(MyComponent);

So if the isFetching is not yet set because the action did not happen yet, i check what am i supposed to edit against the route.


Passing java options with special characters has unexpected output

When passing a java option for Prometheus jmx_exporter: '-javaagent:$JMX_DIR/jmx_prometheus_javaagent.jar=9099:$JMX_DIR/conf/config.yaml' the resultant output in the zookeeper-env.sh file becomes:
export JVMFLAGS=-Xmx3013m\ -javaagent:$JMX_DIR/jmx_prometheus_javaagent.jar=9099:$JMX_DIR/conf/config.yaml
As you can see the resource takes the special characters , '$', and '=' and escapes them. Even if you try to escape them in the attributes it results in double escape characters ('\') instead of the expected clear result. I've tried numerous variations with no success. I'm not certain whether this is a problem with the hashed resource or Chef.

@jshrack-ssi this is likely something with the exports_config() method, provided by the [magic cookbook](
I just discovered that cookbook has been archived to a separate repo by its maintainer, @sczizzo, with the original repo deleted.
I dug up the archived version of the exports_config() method, and confirmed that is identical to the v1.5.0 published version of that method.
To save you a click:
def exports_config obj, header=nil
  obj.map do |k, v|
    if v.nil?
      k.to_s
    else
      "export #{k}=#{Shellwords.escape v.to_s}"
    end
  end.join("\n")
end

In this case, it’s that Shellwords.escape() that’s causing what you describe.
However, the string isn’t output with any quotations, so the escapes should make it work properly… Tricky business though.

@jeffbyrnes Totally agree with your analysis. I actually wrapped my expression in a Shellwords.escape to see what would happen. Sure enough, it adds additional escape characters. The only real option I can think of is overwriting the entire config file to achieve the desired outcome. Thoughts?

@jshrack-ssi, does it also quote your expression? If not, then the escaping might be a good thing.
Otherwise, if this is undesirable, we’ll want to abandon exports_config() in favor of our own version. Phooey. I dislike that sort of thing.

A pull request is welcome, by the way; I’ve very little bandwidth right now.

No, no quoting. I actually was attempting to insert quotes as it's required when using special characters in JVM options. Those too are escaped of course. Let me see what I can do with it as a workaround and I'll submit a PR if successful.

I’m going to go ahead & close this out; @jshrack-ssi if you ever managed a workaround, I’d still love to see it & perhaps include it.


chore(main): release 10.4.3

:robot: I have created a release beep boop
10.4.3 (2024-12-05)
Bug Fixes

tools: remove ANSI sequences from all output (2836849)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v10.4.3
:sunflower:


Exclude glide tests to avoid pinning glide

Does not fix submodule checkout issues with tip of glide.  Going to keep pinning.


[v1.13] envoy: Bump envoy image for golang 1.21.9

This is mainly for go 1.21.9 and ubuntu builder 22.04 image.
Related build: https://github.com/cilium/proxy/actions/runs/8552986534/job/23435236145

/test-backport-1.13

/test-backport-1.13

/test-1.21-4.19


Visualization issue when using Keen = require('keen-js')

Hey keen,
There's an issue when running the same chart using the external require vs requiring in a nodejs/webpack environment.
This works:
<!DOCTYPE html>

  <title>Keen Visualization</title>

But the same chart does not render when using Keen = require('keen-js'). It gets this exception: https://github.com/keen/keen-js/blob/master/src/dataviz/adapters/google.js#L27 . The "output" data gets mangled for some reason that doesn't happen in the cdn version.
I have "keen-js": "3.2.7", in my package.json.

@growlsworth this is an odd error.. I'm not sure why the bundled version would handle response data differently. Are there any new errors when running the bundled version? Can you share the bundled copy of the library, so we an compare that with the CDN copy?

Hey @dustinlarimer ,
The bundled version was 3.2.7. Would you like me to create a github repo that uses webpack to build a compiled source? Or are you able to do that? That scenario should demonstrate the issue.

Strange.. I just built the project with webpack and ran that code snippet, and it all seems to be working just fine.
Would you mind you copy/pasting the mangled data?

thanks @dustinlarimer . I'll re-investigate on my end. I appreciate the support.

Anytime! I apologize for the delayed response on my end.. let me know if I can do anything to help!

@growlsworth just checking back in to see if this issue is still causing problems for ya. Let me know if you would like us to take another look!


public assets are empty after build

Environment
node v.23.1.0
Reproduction
https://stackblitz.com/edit/github-dyuiz1?file=public%2Flogo.svg
Describe the bug
public assets are no longer copied when building
.output/public/ remains empty
Additional context
This is also not possible with a new nitro project.
Logs
No response

When srcDir points to server/ you need to put all sources into server/ directory, including server/public.
I will convert issue to an enhancement since it might be more ergonomic to auto add top level public dir but it is not current expectation.

Thanks @pi0 . I followed the documentation. Perhaps this should be updated as it shows that the public folder is in the root by default.
public/
  image.png     <-- /image.png
  video.mp4     <-- /video.mp4
  robots.txt    <-- /robots.txt
package.json
nitro.config.ts


Suggestion: Hide all Elements when the base token is hidden

I have a few mounts/vehicle types stuff, would it be possible to make them all hidden when the control token is also hidden or something similar?

Basically yes but it's more complicated.
I think I'll add a macro to do that for now in the next update.
The reason being tokens/tiles/drawings can be hidden and lights/sounds can be muted but templates/walls/journal notes would need more complex behaviour. Also content creators might add stuff to prefabs that are hidden by default and these shouldn't be unhidden when the base token becomes unhidden so even there I would need to add special logic.
I'll leave this open because I might add that as the default behaviour in the future once I've figured all the logic out.

Example macros in the next update that should help for the time being:
"Toggle hidden base+children"
"Propagate base hidden state to children"


Replace OrderedDict with dict

Hi @serhii73, thanks for your contribution! While this will work from a functional level, this is unfortunately breaking for anyone relying on the compat import. It also has potential flow implications for users extending the OPTION_DEFAULTS in custom configs. I don't think we'll be able to accept this at time.


Config example dropdown code menu

Feature request

[x] I confirm that this is a feature request rather than a question.

What problem does this feature solve?
Makes the documentation a bit easier to read and/or implement with code examples.
What does the proposed API look like?
N/A
How should this be implemented in your opinion?
There is a small code segment that I can implement for the dropdown menu:
https://gist.github.com/citrusui/07978f14b11adada364ff901e27c7f61
Sample Code:

JavaScript Code

module.exports = {
     title: 'Title'
}

Are you willing to work on this yourself?**
Yes!

@nickycutesc, where do you think there should be code examples?

Various places. The most probable place is in Config: https://docs.statusfy.co/config/#title

@juliomrqz what do you think?


WebGL performance brutally slow on Chrome 59

Worked fine on 58, update to 59 and all of a sudden scrolling between images is painfully slow.

same problem on Ubuntu 14.05
Chrome 59
5-14fps

This appears to have been caused by the parseInt issue referenced here: https://github.com/chafey/cornerstone/issues/175
I am now unable to reproduce it. Feel free to reopen this if you have this issue.


[Idea/feature request] Make levels as invisible modules or smth

Despite the good idea, this mod has one fatal flaw: performance impact. Because it adds many entities – copies of every machine, mod greatly affects performance on late-game; moreover, if you playing with lots of mods with complex production chains (Bob, Angel, Py etc.), it affects even on mid-game. So I think maybe if you make machine levels not as different entities for every machine, but something like an invisible module with level bonuses attached to machines, it will be more UPS-friendly? Moreover, level module instead of different entities for every level will fix an issue with power statistics mentioned in #35 because all machines of one tier will be grouped together like without "Factory levels" mod and will not divide by levels for each group.

Thats a good idea, do you know how to program an invisible module in factorio? The API is not very friendly to leveling up entities. Maybe with the quality API that is coming with the addon this mod can be implemented in a more efficient way.

Sorry, but I'm a total novice in LUA and in coding in general (for example, only one week ago I learned how to make multilayered icons by external patching). The maximum that I can do is copy-paste something (item, entity or so), a little tweak another mod directly or by external data.raw patch. Or make RU translation. And not all of them working, for example, I don't know how to patch 5Dim's mods, because direct data.raw patches in data-final-fixes just doesn't working for any 5Dim mod's entities.

i came here to suggest/request the mod devs to possibly make it where instead of showing every level of every machine in the
"made in" tab it shows only the default machines that stuff can be made in like base game but i also agree that having levels be handled with invisible entities(such as beacons)/modules would also fix the whole made in tab problem too

i came here to suggest/request the mod devs to possibly make it where instead of showing every level of every machine in the "made in" tab it shows only the default machines that stuff can be made in like base game but i also agree that having levels be handled with invisible entities(such as beacons)/modules would also fix the whole made in tab problem too

side note: also idk if this would work necessarily but maybe leveling could potentially be fixed with adding quality to machines instead of separate entities and you could just make the mod change its quality instead of swapping to a new entity?? idk that might also work


Confirm with ref doesn't seem to work with inject?

Versions
vue 2.5.x
vee-validate: 2.1.xbeta-6
Describe the bug
Trying to to a confirmation between the password field and the confirm field using a ref on the input as suggest. This works fine when I don't have the input living in isolation inside a component and injecting the validator into it, but it doesn't seem to work with the following process:
https://codesandbox.io/s/oonnkow1z9
Expected behavior
I expect the confirm field to either give me an error saying the two fields dont match OR give me zero errors since the fields DO match. It's doing the former but not the latter.
Demo Link
https://codesandbox.io/s/oonnkow1z9

Refs are scoped within the owning component. In your case Input.vue would contain all the refs the validator needs. But the validator belongs to the parent component HelloWorld.vue. So it cannot locate those refs.
I don't think this behavior will change since a lot of confusion can happen if we allowed refs from multiple components. Now you could instead move things up the tree and it will work:

Validate the input components in their parent.
Use refs on the components.

https://codesandbox.io/s/pm951j5o9j
There are a couple of caveats covered here:
https://baianat.github.io/vee-validate/concepts/components.html


Andem81.windroy 4.0.3 40e25fa1 e453 4e5c a220 8b812dd62f5e

Checklist for Pull Requests

[ ] Have you signed the Contributor License Agreement?
[ ] Is there a linked Issue?

Manifests

[ ] Have you checked that there aren't other open pull requests for the same manifest update/change?
[ ] This PR only modifies one (1) manifest
[ ] Have you validated your manifest locally with winget validate --manifest <path>?
[ ] Have you tested your manifest locally with winget install --manifest <path>?
[ ] Does your manifest conform to the 1.6 schema?

Note: <path> is the directory's name containing the manifest you're submitting.

Microsoft Reviewers: Open in CodeFlow

Verify:

This installer added numerous EXEs to the filesystem. I'm not sure which is the main EXE. I couldn't find how to have this EXE display its version number.


fix nightly build

Related:  https://github.com/tkaitchuck/aHash/issues/200, https://github.com/dalek-cryptography/curve25519-dalek/issues/631

Those Clippy errors were not related to this PR, but I tried to fix them.

Let me go ahead and merge this 🙏


Design a pair of active-player-other-player cards distinguishable from the past-present cards

implemented in #137


reorder runtests.jl

Is your feature request related to a problem? Please describe.
testing order should be:

shared utilities
standalone models
integrated models

so that we test in increasing order of complexity (for easier debugging)

closed by #405


refactor the  template of  yurt-tunnel-agent

refactor the template of yurt-tunnel-agent.

Ⅰ. Describe what this PR does
(1) delete nodeselector beta.kubernetes.io/os=amd64
(2) modify imagePullPolicy to IfNotPresent
Ⅱ. Does this pull request fix one issue?

No issue, the reason for the modification is as follows:
(1) yurt-tunnel-agent need support multiple cpu arch, include arm, arm64 and amd64.
(2) If the imagePullPolicy is always, the corresponding pod cann't be restarted when the edge node is disconnected.
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
make test
make build
_output/bin/yurtctl convert --provider [minikube|ack|kubeadm]
Ⅴ. Special notes for reviews

@zyjhtangtang how about update the volume of yurt-tunnel?

@zyjhtangtang how about update the volume of yurt-tunnel?

LGTM

LGTM


Number of hits per model?

Hi there. I'm still understanding how Howdy works, and it would be nice to know which models are being used and which not.
By now, I have 5 models:

front, with glasses;
front, without glasses;
front, with glasses and strong background light;
side left;
side right.

I tried setting end_report = true but it indeed breaks some UI apps. I imagine some kind of log I can analyse after a few days testing could do the trick.
Any ideas?

I'd like to add more logging as a whole, this would be a good start. See #226 for logging images


PMP

[Enter feedback here]

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 04097323-2f4c-b63a-1364-a827f850fbb4
Version Independent ID: 830a55a0-de32-4d5e-3c56-e2276975bfa5
Content: Request access to Azure Cosmos DB previews
Content Source: articles/cosmos-db/access-previews.md
Service: cosmos-db
GitHub Login: @gahl-levy
Microsoft Alias: gahllevy

@Talaqalotaibipmp
Could you please elaborate the query for better understanding. So, we can assist you further.

.


Dependencies requirement not honored if not using setuptools

When installing graphite-web, the following warning appears :
$ python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)

As an effect, the requirements like pyparsing < 2.10 are not honored, and the system one used if found in any version.
If the USE_SETUPTOOLS is not defined, then distutils is found and does not understand that keyword, as implemented in setup.py :
     45 if os.environ.get('USE_SETUPTOOLS'):
     46   from setuptools import setup
     47   setup_kwargs = dict(zip_safe=0)
     48
     49 else:
     50   from distutils.core import setup
     51   setup_kwargs = dict()

If USE_SETUPTOOLS is set, the install completely fails with the following error :
+ python setup.py install
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:333: UserWarning: Normalizing '0.10.0-rc1' to '0.10.0rc1'
  normalized_version,
running install
Checking .pth file support in /opt/graphite/webapp/
/usr/bin/python -E -c pass
TEST FAILED: /opt/graphite/webapp/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /opt/graphite/webapp/

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.

Would it work to only use setuptools and to patch PYTHONPATH at the beggining of the file to contain /opt/graphite/ (when GRAPHITE_NO_PREFIX is not set) ?

Not sure I did correctly what you're saying.
Basically I set PYTHONPATH to /opt/graphite and exported it. I don't think GRAPHITE_NO_PREFIX is set, and I get the same error, it shows PYTHONPATH is set accordingly :
Checking .pth file support in /opt/graphite/webapp/
/usr/bin/python -E -c pass
TEST FAILED: /opt/graphite/webapp/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /opt/graphite/webapp/

and your PYTHONPATH environment variable currently contains:

    '/opt/graphite'

That's a really strange issue. Which python version do you use?
Graphite Synthesize has master support and it works fine - https://github.com/obfuscurity/synthesize/blob/feature/graphite-master/install

That's Python 2.7

Synthesize is using requirements.txt file. Installing "pyparsing" so not honoring pinning requirements if I understand correctly.
Note that you would find much of an issue, the only problem I have so far is if you end up using pyparsing 2.10, then randomly panel load will error when reloading full pages.
Bottomline, I don't think Synthesize would give me pyparsing according to install_require defined in setup.py, would it?

Using requirements.txt is a documented way of installing Graphite IIRC. We should pin pyparsing version in requirements.txt too.
But in general, my knowledge of python packaging is vague. I should carefully read https://stackoverflow.com/questions/8295644/pypi-userwarning-unknown-distribution-option-install-requires and http://python-notes.curiousefficiency.org/en/latest/pep_ideas/core_packaging_api.html ¯_(ツ)_/¯
If someone from @graphite-project/committers knows how to fix that properly - please speak up.

Same here, I don't know much about it. What I know is that pyparsing 2.10 is broken, unless we finally merge #1810, and I don't think using requirements.txt will fix this.
In the end, it depends on what version of pyparsing is found. If the distribution, debina 8.7 for example, provides pyparsing 2.0, you're all set. But if you install setuptools (for example) and it comes with 2.10 as a dependency, you break graphite, silently.

@ybizeul can you answer my question on #1810 about packrat?

Yes, that's a known issue in Python world, you should use virtualenv to create a separate environment for installing Graphite together with other python software. Graphite has strong Django version requirements (>=1.9,<1.9.99), but you do not worry if some software brings Django 1.6 or 1.10, right? We can pin pyparsing version in a same way.
In the modern world, when we're using Docker and VMs we're usually installing every piece of software separately...

Maybe I'm wrong, but as far as I inderstand install_requires is setuptools options anyway and it's not possible to pin dependencies in setup.py w/o using setuptools.
So, I think we should merge #1810 or pin pyparsing version in requirements.txt.

Got it. Everything is on track to merge #1810 I suppose.
I should look into virtualenv then for my installs. But it's still confusing that a bare environment and simply running setup.py leads into dependencies not being honored.


resource azurerm_storage_container  is missing to make the the webpage accessible from web

the resource for the azurerm_storage_container is missing, that needs to be set to container_access_type = "blob"; otherwise the container is not accessible as anonymous from outside azure (i.e. my desktop where i installed TF according page).
the following code in main.tf fixes this:
resource "azurerm_storage_container" "web" {
    name = "$web"
    storage_account_name = azurerm_storage_account.storage.name
    container_access_type = "blob"
    timeouts {}
}

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: beba1825-1566-886a-4c72-e19fea420d9f
Version Independent ID: 9d7204f0-7ce3-a4f7-e700-bcde1f1454aa
Content: Quickstart: Deploy a static website on Azure Storage using Terraform
Content Source: articles/storage/blobs/storage-quickstart-static-website-terraform.md
Service: azure-blob-storage
GitHub Login: @normesta
Microsoft Alias: normesta

@bugrasan
Thanks for your feedback! We will investigate and update as appropriate.

@bugrasan
Thanks for your feedback! I've assigned this issue to the author who will investigate and update as appropriate.

Thanks for the insight. Private access to storage account containers (including the web container) is by default and is generally preferrable. That is why this QuickStart doesn't attempt to change container anonymous access settings. You can most certainly do this. In fact, we document that setting change here - Set the anonymous access level for a container. It's just not a part of this QuickStart. Thank you sharing your insight!
#please-close


Release 0.2.0

Release Version
0.2.0
Release Description
Features Added

Now support 2000+ organisms using AnnotationHub interface #7
Pathway view for enriched KEGG pathways added #17
Tables download option is added. It will zip all the tables and download in a single go.
APIs were created on SigBio so that app.R can be used as a standalone.

Bugs Fixed

Library missing in few situations are fixed. All the libraries now loaded from the namespace of SigBio package #16

Release Checklist

[x] Version modified in DESCRIPTION
[x] Version modified in app.R
[x] README.md updated to use current release.
[x] Changes logged in NEWS.md
[x] R CMD check passed without any error.
[x] Site is built using for the new version.

Codecov Report

Merging #18 into master will not change coverage.
The diff coverage is 0%.

@@         Coverage Diff          @@
##           master   #18   +/-   ##
====================================
  Coverage       0%    0%
====================================
  Files           7     8    +1
  Lines          94   103    +9
====================================
- Misses         94   103    +9

Impacted Files
Coverage Δ

R/get_kegg.R
0% <ø> (ø)
:arrow_up:

R/mapids.R
0% <ø> (ø)
:arrow_up:

R/gse.R
0% <ø> (ø)
:arrow_up:

R/sigbio_message.R
0% <ø> (ø)
:arrow_up:

R/load_org.R
0% <0%> (ø)

R/wego_plot.R
0% <0%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

Looks good to release.


feat(blockUser): changes spammer's article status when blocking an user

Design doc:
https://g0v.hackmd.io/XBJS-KEtScWyVCuQ9P_iNQ#M2-Script-for-setting-article-status
This PR modifies block user script so that it can set spammer's article status to "blocked"

Coverage: 88.003% (+0.02%) from 87.984% when pulling 1e89a1c54cfe7328bdd70ba7c5d1189f62cb32e3 on anti-seo-m2 into a4e24ec02c504d90e2fd77ac9e31e8340e81f260 on master.

Deployed to staging and test on user j4S8C_PM1BJIZ1acF-VZZPmA9Zm8AZUZC7Va2k1uN5p8CK23k (See user's reported articles https://old.cofacts.tw/articles?searchUserByArticleId=2ker4s3fv5rv2&filter=all&replyRequestCount=1 )
Sample article after migration: 2ker4s3fv5rv2


Prefer SHA256 fingerprints

I am going to close this because I don't think changing user visible fingerprints is a good idea. I am open to this for the next major release.


[Bug]: Avatar created with a totally different font

What happened?
An avatar created with a totally different font appears.
While the panel uses the default font (Inter, a sans-serif font), the avatar uses a font with serifs.
See image attached: to the left the correct font, to the right the font with serifs.

How to reproduce the bug
composer require voltra/filament-svg-avatar

Add the following to class AdminPanelProvider:
class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->defaultAvatarProvider(SvgAvatarsProviders::class)

Package Version
1.0.1
PHP Version
8.3.1
Laravel Version
10.39.0
Which operating systems does with happen with?
macOS
Notes
No response

Currently the avatar provider relies on the font() method of the panel (which I might as failed to document). I'll check things out to see if the svg can properly inherit the font from the body/html tag

That also stems from the fact that the default avatar component uses an image tag, so there's no way to actually inherit the font unlike using an inline svg

I'm not familiar enough with the matter to fully understand your comments.
Please let me know if I am supposed to do anything.
The log command Log::info(filament()->getCurrentPanel()->getFontFamily()); yields the Filament default font Inter ([2024-01-21 16:19:01] local.INFO: Inter), which is a sans-serif font: https://fonts.bunny.net/family/inter

It should use that font, I'm wondering if the generated SVG (as it's an  and not an <svg>) doesn't use the system's fonts instead of front-end loaded fonts.
I'm working on a release with more features, I'll probably add a blade/livewire component to help replace the original avatar one if need be.

I'm working on a release with more features, I'll probably add a blade/livewire component to help replace the original avatar one if need be.

How about implementing specifying the font manually in some config file?

That's a good idea, I'll add that as well. For now it does take the font from the currently loaded panel.

Hi there with the release of v1.1.0, can you check if everything works for you using the config file? I also have a mini guide in the README to replace filament's avatar component with an SVG one

Still doesn't work (a font with serifs is still used).
Setting 'fontFamily' => 'Inter', (v1.1.0) in the config file doesn't change anything.
Anyway, it looks like the cause must be somewhere else. Since the doc in the config file says ...
    /**
     * Global config for the avatar's font-family
     *
     * @type ?string
     *
     * @default \Filament\Facades\Filament::getFontFamily()
     */
    'fontFamily' => null,

... I tried obtaining the default with tinker, and the default is already Inter:
$ php artisan tinker
Psy Shell v0.12.0 (PHP 8.3.1 — cli) by Justin Hileman
> \Filament\Facades\Filament::getFontFamily()
= "Inter"

Do you have the Inter font available globally on your system? If you don't the problem comes from svg text rendering from within an image tag. In which case the avatar component override should help as it uses the svg directly

The font is installed locally in order to avoid external requests:
class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->id('admin')
            ->path('admin')
            ->login()
            ->font(
                'Inter',
                url: asset('fonts/inter/fonts.css'),
                provider: LocalFontProvider::class,  // Avoid external HTTP(S) requests
            )
            ->defaultAvatarProvider(SvgAvatarsProviders::class)  // Avoid external HTTP(S) requests
            [...]

Right, but you don't have the font installed on your PC's font repo?

Right, so as suspected some (if not all) browsers don't use fonts loaded on the websites to render SVGs, but only the ones on the already installed on the user's machine.
I suggest this approach and I'll make the readme clearer about what each approach can do

Creating a file resources/views/vendor/filament-support/components/avatar.blade.php with the content provided there doesn't fix the problem.

It'd seem I need to adjust a few things, I'll do so ASAP for a v1.1.1

With v1.2.0 this should be fixed, I'll be working on v1.2.1 to fix the proper text rendering

Is this good on your end with the new instructions and file content?

I'll assume this is fixed based on my testing, feel free to re-open if there's still an issue

Upgraded to 1.2.2, but the problem still persists.
Any further steps required except upgrading?

If the first approach (just the plugin, or just SvgAvatarsProviders::class) doesn't work, you have to try the second one.
As explained in the README:

Create an override of filament's avatar component resources/views/vendor/filament/components/avatar.blade.php
Fill it in with the provided code for the override
Change the default avatar provider to \Voltra\FilamentSvgAvatar\Filament\AvatarProviders\RawSvgAvatarProvider::class

This should render an inline <svg> tag (with all the right attributes and styling) instead of an  tag as filament does by default.

In a future major version, I'll advise this as the default route. I'll probably look into making a stub for the override and place it where it needs to be.

If the first approach (just the plugin, or just SvgAvatarsProviders::class) doesn't work, you have to try the second one.
As explained in the README:

Create an override of filament's avatar component resources/views/vendor/filament/components/avatar.blade.php
Fill it in with the provided code for the override
Change the default avatar provider to \Voltra\FilamentSvgAvatar\Filament\AvatarProviders\RawSvgAvatarProvider::class

This should render an inline <svg> tag (with all the right attributes and styling) instead of an  tag as filament does by default.

This results in the error
syntax error, unexpected token "endif", expecting end of file

with reference to the following line: resources/views/vendor/filament-svg-avatar/components/avatar-override.blade.php:16

resources/views/vendor/filament-svg-avatar/components/avatar-override.blade.php is an override of vendor/voltra/filament-svg-avatar/resources/views/components/avatar-override.blade.php. Is it up-to-date with the current version of the file?

$ diff resources/views/vendor/filament-svg-avatar/components/avatar-override.blade.php vendor/voltra/filament-svg-avatar/resources/views/components/avatar-override.blade.php
7,11c7,8
< /**
<  * @var \Voltra\FilamentSvgAvatar\Contracts\SvgAvatarServiceContract $service
<  */
< $service = resolve(\Voltra\FilamentSvgAvatar\Contracts\SvgAvatarServiceContract::class);
< $initials = $attributes->has('alt') ? $service->getInitials($attributes->get('alt')) : null;
---
> $initials = $attributes->has('alt') ? \Voltra\FilamentSvgAvatar\Services\Utils::initials($attributes->get('alt')) : '';
> $initials = $initials ?: ($attributes->has('src') ? $attributes->get('src') : '');
15,29c12,23
<     :initials="$attributes->get('alt')"
<     {{
<         $attributes
<             ->class([
<                 'fi-avatar object-cover object-center',
<                 'rounded-md' => ! $circular,
<                 'fi-circular rounded-full' => $circular,
<                 match ($size) {
<                     'sm' => 'h-6 w-6',
<                     'md' => 'h-8 w-8',
<                     'lg' => 'h-10 w-10',
<                     default => $size,
<                 },
<             ])
<     }}
---
>     :attributes="$attributes->class([
>         'fi-avatar object-cover object-center',
>         'rounded-md' => ! $circular,
>         'fi-circular rounded-full' => $circular,
>         match ($size) {
>             'sm' => 'h-6 w-6',
>             'md' => 'h-8 w-8',
>             'lg' => 'h-10 w-10',
>             default => $size,
>         },
>     ])"
>     :initials="$initials"

After copying the file with cp vendor/voltra/filament-svg-avatar/resources/views/components/avatar-override.blade.php resources/views/vendor/filament-svg-avatar/components/avatar-override.blade.php the error disappears, but instead of an image a question mark is shown:

The link to the (missing) image is http://<IP_ADDRESS>:8000/user/SC (shown by "open image in new tab").

Are you missing the override of filament's avatar component?

Of course I also had updated the PanelProvider:
            ->defaultAvatarProvider(RawSvgAvatarProvider::class)

That is strange, because it outputs an inline <svg> not an

Can you check if a bugfix from v1.2.3 fixes the issue and properly renders an SVG?
Due to how filament registers plugins, if you're using it, you might have the user-declared avatar provider get overridden unintentionally (due to how the package used to function).
Which means that $panel->plugin(FilamentSvgAvatarPlugin::make())->defaultAvatarProvider(RawSvgAvatarProvider::class) would work, where $panel->defaultAvatarProvider(RawSvgAvatarProvider::class)->plugin(FilamentSvgAvatarPlugin::make()) would use the default SVG provider instead of RawSvgAvatarProvider.

I have removed the file resources/views/vendor/filament-svg-avatar/components/avatar-override.blade.php, updated to the current version 1.2.4 with composer update voltra/filament-svg-avatar, and changed the line in the panel to ->defaultAvatarProvider(RawSvgAvatarProvider::class), but the question mark appears again.
Adding ->plugin(FilamentSvgAvatarPlugin::make()) doesn't help.

The plugin is for per-instance customization, it shouldn't change the behavior if you weren't using it before and you don't have to use it.
When you inspect the generated code for the avatar, do you see something that looks like this:
<svg width="500px" height="500px" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" class="fi-avatar object-cover object-center fi-circular rounded-full h-10 w-10 fi-user-avatar" src="A" alt="filament-panels::layout.avatar.alt">
    <rect x="0" y="0" width="500" height="500" rx="0" style="fill:rgb(0,135,179);"></rect>
    <text x="50%" y="50%" dy=".1em" fill="#ffffff" text-anchor="middle" dominant-baseline="middle" style="font-family: inherit; font-size: 250px; line-height: 1;">
        A
    </text>
</svg>

or do you see an  tag?
There shouldn't be any  tag for avatars with this setup.
Maybe something else is hooking into it? Maybe it's just a php artisan optimize:clear away?

When saving the avatar image to disk, the file is:
<svg width="500px" height="500px" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="500" height="500" rx="0" style="fill:rgb(245,158,11);"/><text x="50%" y="50%" dy=".1em" fill="#000000" text-anchor="middle" dominant-baseline="middle" style="font-family: Inter; font-size: 250px; line-height: 1;">SC</text></svg>

Executing php artisan optimize:clear doesn't help.

So it is an  tag that is rendered

So it is an  tag that is rendered

The SVG image is base64 encoded within an  tag being part of the HTML source of the page, it seems:

        <button aria-label="User menu" type="button" class="shrink-0">

        </button>

That is the problem. This tells me the filament avatar component override isn't used.
I have a project I use the package on.
In my panel provider, I only have ->defaultAvatarProvider(RawSvgAvatarProvider::class) (no plugin used).
I have the following content in resources/views/vendor/filament/components/avatar.blade.php (as per instructed in the README):

@props([
    'circular' => true,
    'size' => 'md',
])

<x-filament-svg-avatar::avatar-override
    :attributes="$attributes"
    :circular="$circular"
    :size="$size"
></x-filament-svg-avatar::avatar-override>

With this setup it does render an SVG as expected by using this approach.

Some progress: Now the correct fonts seems to be used, but the logo is totally oversized (nearly half of the window/viewport), and a rectangle instead of a circle is displayed:
<svg width="500px" height="500px" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg">
    <rect x="0" y="0" width="500" height="500" rx="0" style="fill:rgb(245,158,11);"></rect>
    <text x="50%" y="50%" dy=".1em" fill="#000000" text-anchor="middle" dominant-baseline="middle" style="font-family: inherit; font-size: 250px; line-height: 1;">
        SC
    </text>
</svg>

Also the other avatars (dashboard, user select in multi-tenancy mode) are too large.

That's curious, it should render properly and with the tailwind classes

With the setup explained above, I get:
<svg width="500px" height="500px" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" class="fi-avatar object-cover object-center fi-circular rounded-full h-8 w-8 fi-user-avatar" src="A" alt="filament-panels::layout.avatar.alt">
    <rect x="0" y="0" width="500" height="500" rx="0" style="fill:rgb(0,135,179);"></rect>
    <text x="50%" y="50%" dy=".1em" fill="#ffffff" text-anchor="middle" dominant-baseline="middle" style="font-family: inherit; font-size: 250px; line-height: 1;">
        A
    </text>
</svg>

At the very first glance, a width/height of 500px and font-size of 250px seems very large.

It would if it were a non-vector image. It is the default size and can be overridden using the plugin's config methods, or simply using the config file that can be published. The default size could change, but again it doesn't really matter since it'll be dynamically adjusted by the SVG rendering engine.

When I manually change to <svg width="50px" height="50px" in the browser, the size is correct (but displaying a square, not a circle).

Something is happening in your codebase that prevents the component from properly inheriting/applying the attributes

Indeed, with a fresh installation, font, size, and shape (circle) are displayed correctly.
However, the initials "AO" instead of the expected "TU" (for Test User) are used.
This still has to be fixed.
Installation script, modified panel (with diff), and the blade are attached.
Resulting HTML source is:
<button aria-label="User menu" type="button" class="shrink-0">

<svg width="500px" height="500px" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" class="fi-avatar object-cover object-center fi-circular rounded-full h-8 w-8 fi-user-avatar">
    <rect x="0" y="0" width="500" height="500" rx="0" style="fill:rgb(245,158,11);"></rect>
    <text x="50%" y="50%" dy=".1em" fill="#000000" text-anchor="middle" dominant-baseline="middle" style="font-family: inherit; font-size: 250px; line-height: 1;">
        AO
    </text>
</svg>
        </button>

Screenshot:

Looks like I have to re-build my app from scratch step by step and check if and when the size and shape problem pops up again.
Maybe there is a conflict with some other package.
(Attachments)
avatar_test.sh:
#!/bin/sh -e

echo "Reproducing https://github.com/Voltra/filament-svg-avatar/issues/1#issuecomment-2038070726"

# Laravel
composer create-project laravel/laravel avatar_test

cd avatar_test

# Filament
composer require filament/filament:"^3.2" -W
php artisan filament:install --panels
php artisan make:filament-user --name="Test User"<EMAIL_ADDRESS>--password=password

# Avatar plugin
composer require voltra/filament-svg-avatar
php artisan vendor:publish --tag="filament-svg-avatar-config"
php artisan vendor:publish --tag="filament-svg-avatar-views"

# Avatar plugin: config
mv app/Providers/Filament/AdminPanelProvider.php app/Providers/Filament/AdminPanelProvider.php.org
cp -p ../AdminPanelProvider.php app/Providers/Filament/
# Show difference, expect false (some difference)
! diff app/Providers/Filament/AdminPanelProvider.php.org app/Providers/Filament/AdminPanelProvider.php > ../diff.log

# Avatar plugin: blade
mkdir -p resources/views/vendor/filament/components
cp -p ../avatar.blade.php resources/views/vendor/filament/components/

echo "Now open http://<IP_ADDRESS>:8000/admin"

avatar.blade.php (as above):

@props([
    'circular' => true,
    'size' => 'md',
])

<x-filament-svg-avatar::avatar-override
    :attributes="$attributes"
    :circular="$circular"
    :size="$size"
></x-filament-svg-avatar::avatar-override>

AdminPanelProvider.php:
<?php

namespace App\Providers\Filament;

use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Voltra\FilamentSvgAvatar\Filament\AvatarProviders\RawSvgAvatarProvider;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->default()
            ->id('admin')
            ->path('admin')
            ->login()
            ->colors([
                'primary' => Color::Amber,
            ])
            ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
            ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
            ->pages([
                Pages\Dashboard::class,
            ])
            ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
            ->widgets([
                Widgets\AccountWidget::class,
                Widgets\FilamentInfoWidget::class,
            ])
            ->middleware([
                EncryptCookies::class,
                AddQueuedCookiesToResponse::class,
                StartSession::class,
                AuthenticateSession::class,
                ShareErrorsFromSession::class,
                VerifyCsrfToken::class,
                SubstituteBindings::class,
                DisableBladeIconComponents::class,
                DispatchServingFilamentEvent::class,
            ])
            ->authMiddleware([
                Authenticate::class,
            ])
            ->defaultAvatarProvider(RawSvgAvatarProvider::class);
    }
}

diff.log:
19a20
> use Voltra\FilamentSvgAvatar\Filament\AvatarProviders\RawSvgAvatarProvider;
56c57,58
<             ]);
---
>             ])
>             ->defaultAvatarProvider(RawSvgAvatarProvider::class);

With v1.2.6, translations of filament's default avatar alt text should be gone

I'm re-building my app from scratch, and the layout problem seems to be gone.
But it incorrectly uses the initials "AO" again (v1.2.6).

Maybe $user is not set when this function is being called:
    public function getInitials(Model|Authenticatable $user): string
    {
        return Utils::initials(Filament::getNameForDefaultAvatar($user));
    }

https://github.com/Voltra/filament-svg-avatar/blob/0455ff7fa0000de9e52ebb3c1a9f12c56ac242e1/src/Services/FilamentSvgAvatarService.php#L53
For example:

https://github.com/filamentphp/filament/discussions/4390
https://github.com/filamentphp/filament/issues/4398

Hmm I doubt that would be the issue, that's the signature from the interface

Did you have a translation for filament-panels::layout.avatar.alt ?

Or maybe your tenant model has a name attribute (and doesn't implement filament's HasName) that conflicts with filament's default name resolution
https://github.com/filamentphp/filament/blob/60afe878a45d45997d4d2fb33f60ef7e94f17337/packages/panels/src/FilamentManager.php#L395

Do you have a translation for filament-panels::layout.avatar.alt ?

No, and even with locale 'en' explicitly set it remains "AO".

Or maybe your tenant model has a name attribute (and doesn't implement filament's HasName) that conflicts with filament's default name resolution
https://github.com/filamentphp/filament/blob/60afe878a45d45997d4d2fb33f60ef7e94f17337/packages/panels/src/FilamentManager.php#L395

That doesn't seem to be the problem.
Implementing some widget shows the correct user, team, and initials:
use App\Models\Team;
use App\Models\User;
use Filament\Facades\Filament;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
use Voltra\FilamentSvgAvatar\Services\Utils;

class UserDisplay extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('User', ($user = User::current())->name),
            Stat::make('Team', ($team = Team::current())->name ?? '(none)'),
            Stat::make('Initials', Utils::initials(Filament::getNameForDefaultAvatar($user))),
        ];
    }
}

If I then implement HasName in both User and Team, the widget correctly displays "TU" for ("Test User"), but the avatar still displays "AO":
    public function getFilamentName(): string
    {
        return "Test User";
    }
}

That's very odd, I have no idea what could cause it to render AO, especially everytime.
Could you please dd the results of $attributes->get('src') and $attributes->get('alt') in the override template?
src should be TU, and I'm wondering if something somewhere doesn't override alt to AO

Adding {!! dd($attributes->get('src'), $attributes->get('alt')) !!} to resources/views/vendor/filament/components/avatar.blade.php yields:
"TU" // resources/views/vendor/filament/components/avatar.blade.php
"Avatar of Test User" // resources/views/vendor/filament/components/avatar.blade.php

Obviously "Avatar of" => "AO" :)

So there was a translation somewhere, interesting. Seems parameterized, so I'll adjust the template

So there was a translation somewhere, interesting. Seems parameterized, so I'll adjust the template

The search string Avatar of occurs only once in the source tree, in vendor/filament/filament/resources/lang/en/layout.php:
    'avatar' => [
        'alt' => 'Avatar of :name',
    ],

Should be fixed in v1.2.7. I dropped the use of alt since I couldn't reasonably determine if it were generated from the default translation string.

Still displaying "AO" (v1.2.7) ...

Not possible, I've removed any trace of alt from <x-filament-svg-avatar::avatar-override/> so that you don't even need to edit the core filament override.
Possibly a cache:clear or an optimize:clear can do the trick.

php artisan cache:clear && php artisan optimize:clear doesn't help.
Oddly, with $panel->defaultAvatarProvider(SvgAvatarsProviders::class) behaviour changes depending on whether resources/views/vendor/filament/components/avatar.blade.php exists.
With blade: $attributes->get('src') returns data:image/svg+xml;base64,[...].
Without blade: Correct initials, but serifs are used again.

That is "expected". The override of filament's core avatar component is specifically made for the RawSvgAvatarProvider which behaves completely differently than other avatar providers (for the sake of rendering a correct SVG whilst using Filament's whole avatar system).
Now I'm extremely confused. The override in resources/views/vendor/filament/components/avatar.blade.php delegates to <x-filament-svg-avatar::avatar-override/> which doesn't use the alt attribute anymore.

Excerpt from my file resources/views/vendor/filament-svg-avatar/components/avatar-override.blade.php (v1.2.7):
@php
    $filamentAvatarAltLangStr = 'filament-panels::layout.avatar.alt';
    $initials = $attributes->has('alt') ? $attributes->get('alt') : '';

    $unwantedLabels = [$filamentAvatarAltLangStr, __($filamentAvatarAltLangStr)];

    $initials = in_array($initials, $unwantedLabels)
        ? ''
        : \Voltra\FilamentSvgAvatar\Services\Utils::initials($initials);

    $initials = $initials ?: ($attributes->has('src') ? $attributes->get('src') : '');
@endphp

Oh... well that's on me. I should have put that somewhere else. You may delete it and re-publish the override using
php artisan vendor:publish --tag=filament-svg-avatar-core-overrides

Now the text tag contains a base64 encoded string again:
<text x="50%" y="50%" dy=".1em" fill="#000000" text-anchor="middle" dominant-baseline="middle" style="font-family: inherit; font-size: 250px; line-height: 1;">
        data:image/svg+xml;base64,[...]
    </text>

The displayed characters "4LD" are from the center of the base64 encoded string.

I believe you're not using RawSvgAvatarProvider

You are right. Now it works.
Thanks a lot!!!


encoding/csv: add field Quote to Writer

With a boolean field Quote in the csv.Writer one could force quotation of fields.

Why?

I had some compability problems, when forced to escape fields not needed to be escaped by current implementation.

Each field may or may not be enclosed in double quotes

[RFC 4180]

Even if there is no actual specification I guess the RFC is status quo.
And if you would wrap something around the writer as
func WriteWrapper(w *csv.Writer, record []string) error {
    for i, field := range record {
         record[i] = `"` + field+ `"`
    }
    return w.Write(record)
}

you would end up with """file2""","""field2"""

This package can't be all things to all people.
Unless the compatibility problems you alluded to are widespread, I'd prefer not to add more complexity to this package. I believe this package as it stands today matches the CSV produced by Microsoft Excel and Google Drive. That should be good enough.
If you really just want to print fully-quoted CSV, you don't even need this package:
func printCSV(w io.Writer, data [][]string) {
	for _, row := range data {
		sep := ""
		for _, cell := range row {
			fmt.Printf(`%s"%s"`, sep, strings.Replace(cell, `"`, `""`, -1))
			sep = ","
		}
		fmt.Printf("\n")
	}
}

what about
\n and \r\n
?


[Windows] Run SourceKit-LSP tests from build.ps1

Building and running the tests currently takes 2:10min locally on my machine, but quite a few tests are currently disabled on Windows.

https://github.com/swiftlang/sourcekit-lsp/pull/1772
@swift-ci Please smoke test

https://github.com/swiftlang/sourcekit-lsp/pull/1772
@swift-ci Please smoke test


Dec to bin

Description
Change List
Implementato algoritomo di conversione da b10 a b2
Reasons for the PR
Il codice funziona
New Dependencies and Reason
None
Issues List
Additional context
List of Developers

@Retr0mus

Type of changes
Please check relevant options.

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] Any dependent changes have been merged and published in downstream modules
[x] I have checked my code and corrected any misspellings

NOTE: the PR have to be labelled in-progress until the work is complete, the PR will be checked, reviewed and merged only after being labelled as complete

Ok, correggerò a breve

README ripristinato

Everything should be alright now


base64 extension v1

Description
quick commands to encode or decode the clipboard contents from/to base64
Type of change

New extension

Screencast
Quick snippet demo clip
Checklist

[X] I read the extension guidelines
[X] I read the documentation about publishing
[X] I checked that extension's icon has size of 512x512

Hi @DanielSinclair 👋
Do you need any help?

Hey @pernielsentikaer. Implemented those UX changes this evening!


LMStudio Embeddings support

Description
Add support for LMStudio embeddings provider
Checklist

[x] The base branch of this PR is dev, rather than main
[x] The relevant docs, if any, have been updated or created

Tested, works with LM studio default embeddings model

this is huge, I didn't know about the default model


Unable to set index property on dynamic template for generic type

NEST/Elasticsearch.Net version: 2.3
Elasticsearch version: 2.3.1
Description of the problem including expected versus actual behavior: There is no way to set a dynamic template to not index all fields by default when setting the mapping.
In Elasticsearch.Net 1.x, it is possible to do the following:
    .DynamicTemplates(d => d
                    .Add(t => t
                        .Name("base")
                        .Match("*")
                        .MatchMappingType("*")
                        .Mapping(m2 => m2
                            .Generic(s => s
                                .Index("no")
                            )
                        )
                    )
                )

However, in Elasticsearch.Net 2.x there is no way to set this. There is no GenericMappingDescriptor available, and the index property is hidden for the "object" type.

Hey @tagg7, thanks for reporting.
@gmarz, @Mpdreamz - was this removed in 2.x for some reason?
Where in NEST 1.x you would have done something like
client.PutTemplate("do_not_index", p => p
    .Template("*")
    .AddMapping<object>(m => m
        .Type("_default_")
        .DynamicTemplates(d => d
            .Add(t => t
                .Name("base")
                .Match("*")
                .MatchMappingType("*")
                .Mapping(m2 => m2
                    .Generic(s => s
                        .Index("no")
                    )
                )
            )
        )
    )
);

You could write an IProperty implementation to do this in 2.x for the time being
public class GenericProperty : PropertyBase
{
	public GenericProperty() : base(null) {}

	[JsonProperty("index")]
	public FieldIndexOption Index { get; set;}
}

client.PutIndexTemplate("do_not_index", p => p
	.Template("*")
	.Mappings(m => m
		.Map("_default_", mm => mm
			.DynamicTemplates(dt => dt
				.DynamicTemplate("base", dtd => dtd
					.Match("*")
					.MatchMappingType("*")
					.Mapping(sm =>
                        new GenericProperty { Index = FieldIndexOption.No }
					)
				)
			)
		)
	)
);

which will give the following request
PUT http://localhost:9200/_template/do_not_index
{
  "template": "*",
  "mappings": {
    "_default_": {
      "dynamic_templates": [
        {
          "base": {
            "match": "*",
            "match_mapping_type": "*",
            "mapping": {
              "index": "no"
            }
          }
        }
      ]
    }
  }
}

Awesome, thank you for the workaround @russcam!

was this removed in 2.x for some reason?

It was removed, but not for any good reason.  Probably missed this during the refactoring.  It should be added back.

@tagg7 This will go into the next release of 2.x. Thanks again for raising this :+1:


Confusing error message

One gets a confusing (to me) error message when there is a comma missing in the exposes list, e.g., after map2 below.
interface Pair exposes [
      first, second,
      mapFirst, mapSecond, map2
      showIntPair, testFirst,testSecond ] imports []

Here is the compiler error message:
➜  roc git:(jim) ✗ vr parser
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s
     Running `target/debug/roc examples/benchmarks/ParseApp.roc`
thread 'main' panicked at 'not yet implemented: unhandled parse error ListEnd(3, 6)', compiler/reporting/src/error/parse.rs:3114:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: Failed at the parser script

And yes, I also panic 😄

The imports list syntax isn't used anymore and there is a better error message on the exposes list, so I am going to close this.


By default, use dictionary encoding for the attribute key

Due to a limitation of the Arrow Go library regarding the definition of metadata, the existing code don't enable dictionary encoding for the attribute key.

Fix in Apache Arrow v12.


Fix white screen when use radio with overflow-scrolling

this issue is produced when we use -webkit-overflow-scrolling: touch within z-index: -1
Example:
https://jsfiddle.net/fvck7rq3/3/
https://drive.google.com/file/d/15HNgzmi8fX7_CPte9pS7ZA_MYX6fPpAp/view
Device
iPhone XS / IOS 12.0
iPhone 7 / 12.1.1
iPhone 8 / 12.1.4 (16D57)

Your fiddle is missing an id on the <input> and a for attribute on the <label>. Add those to connect the label to the radio and you should be set.

@mdo  id and for are not related to this issue. So if I add them or not it still error. Did you check it on the device that I noted?

@patrickhlauke @XhmikosR could you take a look?


Tickets

Hello, how can i disable to ticket-system.
And, how can i enable to chat-system.
I want to disable the ticket system and only chat.
For example:
If my customer writes again after meeting with my customers and closing the conversation, I want to open them so that I can see the old messages over the same chat.

its not possible yet, we havent this feature for now, but thx for the ideia

Hi @eserjpeg. By default, the old ticket is open if it was close within 2 hours. You can change it on backend/src/services/TicketServices/FindOrCreateTicketService.tsbackend/src/services/TicketServices/FindOrCreateTicketService.ts
line  47

this setting did not work
Note: I did 2000 instead of 2

@eserjpeg Lol it works for me. Just comment out the 50 to 52 and it will always retrieve the same conversation, so it will not open a new ticket instead it will pick always the same ticket.
  } else {
    ticket = await Ticket.findOne({
      where: {
        // updatedAt: {
        //   [Op.between]: [+subHours(new Date(), 2), +new Date()]
        // },
        contactId: contact.id
      },
      order: [["updatedAt", "DESC"]],
      include: ["contact"]
    });
    ```

@eserjpeg Lol it works for me. Just comment out the line 50 to 52 and it will always retrieve the same conversation, so it will not open a new ticket instead it will pick always the same ticket.
  } else {
    ticket = await Ticket.findOne({
      where: {
        // updatedAt: {
        //   [Op.between]: [+subHours(new Date(), 2), +new Date()]
        // },
        contactId: contact.id
      },
      order: [["updatedAt", "DESC"]],
      include: ["contact"]
    });

It didn't work, why won't it work I'll go crazy!

@eserjpeg Lol it works for me. Just comment out the line 50 to 52 and it will always retrieve the same conversation, so it will not open a new ticket instead it will pick always the same ticket.
  } else {
    ticket = await Ticket.findOne({
      where: {
        // updatedAt: {
        //   [Op.between]: [+subHours(new Date(), 2), +new Date()]
        // },
        contactId: contact.id
      },
      order: [["updatedAt", "DESC"]],
      include: ["contact"]
    });

@eserjpeg. Did you deleted "dist" folder and rebuild the app after doing this changes?

I am sorry this is my mistake. i don't rebuild.
Thanks for all!

How do I rebuild ?


Start Server error in alpha4

Seeing this error when I try to Start Server in alpha 4 --
Exception: Unhandled Exception.
ExceptionCode=C0000005
Address=0000000010002383 (00007FF947920000 + FFFF8006C86E2383)
OSVer: MajorVersion=10 MinorVersion=0 Build=17134
Module: 00007FF947920000
========== Startup Log ==========
[00:02:23.095 867] HmdDriverFactory IServerTrackedDeviceProvider_004 (IServerTrackedDeviceProvider_004)
[00:02:23.095 867] HmdDriverFactory server return
[00:02:23.095 867] Serial Number: ALVR-001
[00:02:23.095 867] Model Number: ALVR driver server
[00:02:23.095 867] Render Target: 2432 1344
[00:02:23.095 867] Seconds from Vsync to Photons: 0.005000
[00:02:23.095 867] Refresh Rate: 72
[00:02:23.095 867] IPD: 0.063000
[00:02:23.095 867] debugOptions: Log:0 FrameIndex:0 FrameOutput:0 CaptureOutput:0 UseKeyedMutex:1
[00:02:23.095 867] EncoderOptions:
[00:02:23.095 867] ControlSocket::Startup Successfully bound to <IP_ADDRESS>:9944
[00:02:23.096 363] UdpSocket::BindSocket successfully bound to <IP_ADDRESS>:9944
[00:02:23.096 363] UdpSocket::BindQueueSocket bound queue socket. port=63591
[00:02:23.096 363] UdpSocket::Startup success
[00:02:23.096 363] Startup: ALVR Server Driver 2.4.0-alpha4
[00:02:23.096 363] CRemoteHmd successfully initialized.
[00:02:23.096 363] TrackedDeviceAdded(HMD) Ret=1 SerialNumber=ALVR-001
[00:02:23.096 363] CRemoteHmd Activate 0
[00:02:23.101 323] Received packet. Type=6
[00:02:23.101 323] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.107 771] Received packet. Type=6
[00:02:23.107 771] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.109 755] Received packet. Type=6
[00:02:23.109 755] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.116 203] Received packet. Type=6
[00:02:23.116 203] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.121 659] Received packet. Type=6
[00:02:23.121 659] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.124 635] Received packet. Type=6
[00:02:23.124 635] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.130 091] Received packet. Type=6
[00:02:23.130 091] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.132 075] Using NVIDIA GeForce GTX 1080 as primary graphics adapter.
[00:02:23.132 075] OSVer: MajorVersion=10 MinorVersion=0 Build=17134
[00:02:23.132 075] Try to use VideoEncoderVCE.
[00:02:23.132 075] Initializing VideoEncoderVCE.
[00:02:23.132 571] AMF Error 1. g_AMFFactory.Init()
[00:02:23.132 571] Try to use VideoEncoderNVENC.
[00:02:23.132 571] Initializing CNvEncoder. Width=2432 Height=1344 Format=268435456 (useNV12:0)
[00:02:23.134 555] Received packet. Type=6
[00:02:23.134 555] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.139 515] Received packet. Type=6
[00:02:23.139 515] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.145 963] Received packet. Type=6
[00:02:23.145 963] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.151 419] Received packet. Type=6
[00:02:23.151 419] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.154 395] Received packet. Type=6
[00:02:23.154 395] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.159 851] Received packet. Type=6
[00:02:23.159 851] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.165 804] Received packet. Type=6
[00:02:23.165 804] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.170 267] Received packet. Type=6
[00:02:23.170 267] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.172 251] CNvEncoder is successfully initialized.
[00:02:23.172 748] CEncoder: Start thread. Id=5508
[00:02:23.172 748] CEncoder: Waiting for new frame...
[00:02:23.174 235] Received packet. Type=6
[00:02:23.174 235] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.174 731] Audio device: Speakers (Realtek High Definition Audio)
[00:02:23.176 715] MixFormat: nBlockAlign=8 wFormatTag=65534 wBitsPerSample=32 nChannels=2 nSamplesPerSec=48000
[00:02:23.176 715] PWAVEFORMATEXTENSIBLE: SubFormat=-904925456 wValidBitsPerSample=32
[00:02:23.179 691] Received packet. Type=6
[00:02:23.179 691] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.185 147] Received packet. Type=6
[00:02:23.185 147] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.190 107] Received packet. Type=6
[00:02:23.190 107] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.195 067] Initialize swresample. src_rate=48000 dst_rate=48000
[00:02:23.195 067] swresample successfully initialized. src_rate=48000 dst_rate=48000 src_nb_channels=2 dst_nb_channels=2 max_dst_nb_samples=1024
[00:02:23.195 067] Generate VSync Event by VSyncThread
[00:02:23.195 067] Sleep 13 ms for next VSync.
[00:02:23.195 564] GetComponent IVRDisplayComponent_002
[00:02:23.195 564] GetComponent IVRDriverDirectModeComponent_005
[00:02:23.195 564] GetComponent IVRCameraComponent_002
[00:02:23.195 564] GetComponent IVRVirtualDisplay_002
[00:02:23.195 564] Received packet. Type=6
[00:02:23.195 564] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.195 564] GetWindowBounds 0x0 - 2432x1344
[00:02:23.195 564] GetRecommendedRenderTargetSize 1216x1344
[00:02:23.195 564] GetProjectionRaw Eye=0 (l,r,t,b)=(52.000000,42.000000,53.000000,47.000004)
[00:02:23.195 564] GetEyeOutputViewport Eye=0 0x0 1216x1344
[00:02:23.195 564] GetProjectionRaw Eye=1 (l,r,t,b)=(42.000000,52.000000,53.000000,47.000004)
[00:02:23.195 564] GetEyeOutputViewport Eye=1 1216x0 1216x1344
[00:02:23.196 059] GetComponent IVRControllerComponent_001
[00:02:23.200 524] Received packet. Type=6
[00:02:23.200 524] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.204 987] Received packet. Type=6
[00:02:23.204 987] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.209 451] Generate VSync Event by VSyncThread
[00:02:23.209 451] Sleep 13 ms for next VSync.
[00:02:23.209 947] Received packet. Type=6
[00:02:23.209 947] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.217 883] Received packet. Type=6
[00:02:23.217 883] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.220 364] Received packet. Type=6
[00:02:23.220 364] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.223 339] Generate VSync Event by VSyncThread
[00:02:23.223 339] Sleep 13 ms for next VSync.
[00:02:23.225 323] Received packet. Type=6
[00:02:23.225 323] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.231 275] Received packet. Type=6
[00:02:23.231 275] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.236 235] Received packet. Type=6
[00:02:23.236 235] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.237 227] Generate VSync Event by VSyncThread
[00:02:23.237 227] Sleep 13 ms for next VSync.
[00:02:23.240 699] Received packet. Type=6
[00:02:23.240 699] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.245 163] Received packet. Type=6
[00:02:23.245 163] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.251 115] Generate VSync Event by VSyncThread
[00:02:23.251 115] Sleep 13 ms for next VSync.
[00:02:23.251 611] Received packet. Type=6
[00:02:23.251 611] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.254 587] Received packet. Type=6
[00:02:23.254 587] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.263 019] Received packet. Type=6
[00:02:23.263 019] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.265 003] Generate VSync Event by VSyncThread
[00:02:23.265 003] Sleep 13 ms for next VSync.
[00:02:23.266 987] Received packet. Type=6
[00:02:23.266 987] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.269 963] Received packet. Type=6
[00:02:23.269 963] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.275 915] Received packet. Type=6
[00:02:23.275 915] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.278 891] Generate VSync Event by VSyncThread
[00:02:23.278 891] Sleep 13 ms for next VSync.
[00:02:23.283 851] Received packet. Type=6
[00:02:23.283 851] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.285 835] Received packet. Type=6
[00:02:23.285 835] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.290 299] Received packet. Type=6
[00:02:23.290 299] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.292 779] Generate VSync Event by VSyncThread
[00:02:23.292 779] Sleep 13 ms for next VSync.
[00:02:23.295 259] Received packet. Type=6
[00:02:23.295 259] Recieved message from invalid address: <IP_ADDRESS>:9944
[00:02:23.298 731] Unhandled Exception.
ExceptionCode=C0000005
Address=0000000010002383 (00007FF947920000 + FFFF8006C86E2383)
========== Tail Log 1 ==========
========== Tail Log 2 ==========
========== Exception info start ==========
ExceptionCode=C0000005 Address=0000000010002383 ThreadId=5204
DllRegisterServer(DllRegisterServer) +4371
========== Exception info end ==========
--
I've tried turning off Steam Sound and changing the video codec. I have a 1080 with the latest driver. I've also tried different versions of ALVR with no luck. Thanks.

I finally figured this out. I looked in the Windows Event Logs and saw the crash info for SteamVR. The log had a line that said "Faulting module path: C:\Windows\USB_Vibration\00791800\EZFRD64.DLL" - I renamed that DLL to DLL.bak and it works now.


feat: support deletes

This adds support for basic delete command
Fixes #1352

Documentation PR : https://github.com/GlareDB/glaredb.github.io/pull/134

@adhish20 Just curious, what happens if you try to delete from an external table? does it panic, or does it error with an appropriate error message?

It will throw an error that the table is not found

@adhish20 Just curious, what happens if you try to delete from an external table? does it panic, or does it error with an appropriate error message?

It will throw an error that the table is not found


Fixes missing implicit return in example in README

Reviewers: @michael-ciniawsky, @ertrzyiks

:warning: Pull Request - Issues :warning:

Commit: 69327a502bb64b6ab71877ed07c666b100ac684a
Commits must be in the following format: %{type}(%{scope}): %{description}

This message was auto-generated by https://gitcop.com

Coverage remained the same at 95.455% when pulling 69327a502bb64b6ab71877ed07c666b100ac684a on lourd:patch-1 into cb3cfb13b4ebd5595552c032ffb18d30a863b3fc on michael-ciniawsky:master.

@lourd Good catch, that makes sense. We have a bunch of (ctx) => {, would you mind update them all?

Any update on this? :)

Thanks for the ping. I'll add the other fixes now

:warning: Pull Request - Issues :warning:

Commit: 443e1b46dbd70f4b29a91adcb4adb9c1cf0a55c8
Commits must be in the following format: %{type}(%{scope}): %{description}

This message was auto-generated by https://gitcop.com

Coverage remained the same at 95.455% when pulling 443e1b46dbd70f4b29a91adcb4adb9c1cf0a55c8 on lourd:patch-1 into cb3cfb13b4ebd5595552c032ffb18d30a863b3fc on michael-ciniawsky:master.

Coverage remained the same at 95.455% when pulling 443e1b46dbd70f4b29a91adcb4adb9c1cf0a55c8 on lourd:patch-1 into cb3cfb13b4ebd5595552c032ffb18d30a863b3fc on michael-ciniawsky:master.

Should be good to go now

Coverage remained the same at 95.455% when pulling 7d0d3a2627b0b4a0a081111697f33884c12906a9 on lourd:patch-1 into cb3cfb13b4ebd5595552c032ffb18d30a863b3fc on michael-ciniawsky:master.

👍  pls rebase -> docs(README): {{ message }} and add ourself to contriutors in README and package.json

you're fast 😛

I can add you in the next release aswell your prefence

Thanks for the offer to note me as a contributor 🙂 Since it's just tiny docs edits I'll forego being listed as a contributor, though.

yep kk I understand :) , it's just natural here that ever PR gets listed as Contributor, I do it within the next release. If you have something against being mentioned at all, please let me know.
Thx 👍

Nope, not against it. Cheers 👊🏼

:+1:


numpy error when testing simgenotype

Thanks for writing haptools! I'm running into an issue when testing the simgenotype module, example as follows:
$ haptools simgenotype \
> --model model.dat \
> --mapdir test_haptools/ \
> --invcf ALL.wgs.nhgri_coriell_affy_6.20140825.genotypes_no_ped.vcf.gz \
> --sample_info 1000genomes_sampleinfo.tsv \
> --out test
Traceback (most recent call last):
  File "/Users/alicia/Library/Python/3.7/bin/haptools", line 8, in <module>
    sys.exit(main())
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/haptools/__main__.py", line 181, in simgenotype
    from .sim_genotype import (
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/haptools/sim_genotype.py", line 13, in <module>
    from .data import GenotypesRefAlt, GenotypesPLINK
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/haptools/data/__init__.py", line 2, in <module>
    from .phenotypes import Phenotypes
  File "/Users/alicia/Library/Python/3.7/lib/python/site-packages/haptools/data/phenotypes.py", line 10, in <module>
    import numpy.typing as npt
ModuleNotFoundError: No module named 'numpy.typing'

numpy otherwise seems to work fine on my computer. Any ideas why this might be happening or how to fix it?

Hi @armartin !
Thank you for trying out haptools. What version of numpy is that? We might need to pin to a version recent enough that it contains numpy's typing module.
import numpy
import numpy.typing as npt

print(numpy.__version__)

As a temporary workaround, you can try just commenting out lines that import typing. It's only used for type checking, anyway.

Hi @aryarm,
Thanks for your quick response! It does indeed look like an older version of numpy:
print(numpy.__version__)
1.19.2

I upgraded my numpy and it now seems to run fine. Thanks a bunch!

great! I'm glad it was an easy fix
I've updated the version of numpy that we require to be $\ge$ 1.20.0 so that this issue doesn't crop up again in future releases of haptools


Added Calculator

Hey, bro I have added Please merge my request!!.
Thanks.

@HRC-123 make sure you follow the code of conduct by star the repo


How to have a diagnostic WITHOUT associated file?

Imagine you compile a C# program without a 'main' entrypoint, and it generates the error message
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/Users/ljw/code/c/c.csproj]

It's impossible to report this error via LSP! That's because the publishDiagnostics message has a mandatory uri field -- but for errors like this, there's no uri that would make sense! And so the C# plugin for VSCode shows this message in the build output window, but simply doesn't report this error at all to VSCode diagnostics list. @DustinCampbell
I experimented with VSCode behavior:

publishDiagnostics with uri = null -- this doesn't get shown in the diagnostics window at all
publishDiagnostics with uri = "" -- this sometimes pops up the Chrome debugger in VSCode, and sometimes crashes VSCode completely with a "report this crash to Apple" system dialog.
publishDiagnostics with uri = "file:///" or uri = "file:///some/directory -- this shows the error in the diagnostics window, and when you click on it, VSCode does some frenetic flickering of a new document tab before closing it again.

I think that "diagnostics not related to a particular file" are a real fact of life. LSP should be extended to cope with them. And VSCode should too.
My proposal: make the uri field optional. If it is absent/null, then treat it as a file-less diagnostic, and the range field inside each individual Diagnostic will be ignored.

Fully agree. From the alternatives I prefer having the workspace root as the URI for these errors.
Additional question is the range in this situation. That should be omittable.
@sandy081 can we add some code to the problems view to check if the URI is a file and if not then we don't try to open the editor ?

@dbaeumer Not sure if it is right approach. Because only opening file based resources might break other scheme resources which support opening.

Any update?

No, not yet. But thanks for pinging.
@sandy081 I am not sure I understand your concerns. The schema would be 'file' as well. When the user clicks on it in the problems view we would reveal it in the folder instead of opening the editor.

can we add some code to the problems view to check if the URI is a file and if not then we don't try to open the editor ?

@dbaeumer If I understand correctly, you do not want to open resources from the problems view? I think that will not be helpful, because most users prefer to open in the editor directly.

@dbaeumer I see.. I was confused with file scheme resource vs other scheme resources. Have to check with Ben if I can have such a check (api).

@sandy081 thanks.

Currently, opening a folder URI from Problems panel, reveals the folder in Explorer.

@sandy081 thanks for clarifying.

We currently have the same problem over in or LSP for Nim. It's more related to ranges, but as #249 was marked as a duplicate of this I'll comment here. So what is the right way to send an error, hint, or warning that's not related to a specific position in a document, or to no specific document at all? I think this should be a new type, instead of overloading the Diagnostics type with more optional fields (e.g. what does a range mean if you don't supply a uri?). So create a new type that just contains information from the compiler, and keep the Diagnostics type as it is today to show messages belonging to a piece of code.

I'm interested in this as well, any update?

Have you tried using a folder URI? If it is a project configuration error the URI could be the project file or if nothing else can be used the workspace folder URI.

You can use the folder URI, but IIRC then the diagnostic stays there forever, the editor never refreshes it.

You can use the folder URI, but IIRC then the diagnostic stays there forever, the editor never refreshes it.

@alessiostalla Which LSP client are you using? This sounds like something that might be client-specific.

I'm using Visual Studio Code.

You can use the folder URI,

Is that allowed by the protocol ? AFAICT the 'publishDiagnostics' notification takes a DocumentUri - i can't see how a folder can legitimately be described as a document. And the Diagnostic contains a Range which is source offsets. This also nonsensical for a folder.
Certainly my client has to have a "catch" on this because some servers like jdt.ls return URIs which are not files, which i consider to be noncompliant.

Is that allowed by the protocol ? AFAICT the 'publishDiagnostics' notification takes a DocumentUri - i can't see how a folder can legitimately be described as a document. And the Diagnostic contains a Range which is source offsets. This also nonsensical for a folder.

@puremourning Good point, I had forgotten about that detail.

Certainly my client has to have a "catch" on this because some servers like jdt.ls return URIs which are not files

Not too surprised by that given how Eclipse's Java compiler does things.

Good points. But you can always point to a project file. But I still think we could relax this a little and allow folder URIs as well.

I've ran into this issue as well.  Have the uri optional or pointing it to the workspace root dir would both be adequate.


MGDSTRM-7817 allow for the configuration of multiple profiles

This is an initial draft of supporting multiple profiles at runtime. Since we need access to all of the properties at runtime, we cannot  use a quarkus profile based mechanism.

any property that may change based upon the instance type must be moved onto the instance config.
it treats the existing managedkafka. properties as the standard/default
additional well-known instances profiles are built off of that looking for properties that are prefixed by the profile name
it does not yet look for where the instance type is defined

Possible refinements:

it was basically search replace on the usage of the config, a lot of those calls could be consolidated
the key names are getting pretty long.  We could change from managedkafka. to standard., and from trial.managedkafka, to just trial.
using the standard profile as the default means that we need to be careful about changing those values.  If not explicitly overridden, it will change in all instance types.  The alternative is to introduce separate default and standard property sets.
this does not yet account for different machine types (m5.2xlarge vs m5.4xlarge) or different providers (aws vs azure).
this of course also breaks logic I just added with the last pr for the instranceprofiler, but it will be easy to fix in subsequent commits.  Related to this, we may still want to use separate properties files, even if they are not managed through quarkus so that the main file does not get so out of control.

ack.

key names are getting pretty long

maybe could move to YAML format, you load into that anyways.

The alternative is to introduce separate default and standard property sets.

separate one seems less confusing IMO

this does not yet account for different machine types

essentially these become your keys to fetch the config like STANDARD now. YAML format may ease the pain in defining them.

maybe could move to YAML format, you load into that anyways.

Sorry, yes forgot to mention that will help / force the config file(s) to be more organized.

essentially these become your keys to fetch the config like STANDARD now. YAML format may ease the pain in defining them.

My thinking is that I'll move back to separate files, regardless of the file type.  They would initially have a naming standard like instance-platform - for example:
default-aws.yaml
trial-aws.yaml
standard-aws.yaml
and so forth
Then if needed we'll expand that to include the machine type instance-platform-machine - with the caveat that if we want to get really complex you could have standard offered under the same cluster on different machine types in which case we'd need other selection criteria to determine the placement.

My thinking is that I'll move back to separate files, regardless of the file type.

sounds good me.

Sorry, yes forgot to mention that will help / force the config file(s) to be more organized.

This is possible to do, but requires changing the kafka instance configuration to not use jsonunwrap and we'd have to change the logic about how we infer the property key set.  So for now I've just left things as property files.
Since the non application.properties properties files are managed by us and not quarkus, we can omit the managedkafka or any other prefix in them.
If you need to override them from an env property or other quarkus supported mechanism they do need to be prefixed - developer.kafka.something.

I tend to agree that having the configs for this out of application.properties is easier for reference purposes. But, I also like the option to override using the environment or system properties.

They will still be overridable via standard quarkus mechanisms.


Allow volumeMount helpers to optionally act on initContainers

Currently, mapContainers only acts on containers and not initContainers. This add an option to also map initContainers.
I am open to an alternative of adding separate mapInitContainers help methods, however, this seems most user friendly.
An example of where this would be useful is here: https://github.com/jsonnet-libs/k8s/blob/450a1f2a0d89d90faad2fc1eef7b8654d8daeab4/libs/k8s/custom/core/volumeMounts.libsonnet#L76-L95
It seems likely that when mounting volumes one probably wants to also mount them to initContainers as copying data from initContainers to containers is a fairly common pattern.
Closes #223

Sorry! Obvious typo!

checking on our codebase if it generates any issues the next days :) It looks sane and easy to use. Thx for this! 👍


Feat/container transform animation

Proposal: Add Container Transform Motion Upon Navigation of FAB.
The change is inspired by the Material Motion System (https://m2.material.io/design/motion/the-motion-system.html).
Rather than all transitions to different views jump-cutting from one to the other without a transition animation I suggest using motion system transition patterns to reinforce relationships between U.I. elements.
If you like the change then I can use the new widget on other pages that make sense like the WeightPage.

Note: Navigation and Removal of Navigator Imperative API Call to View (Page)

The OpenContainer widget part of the animations package created by the flutter dev team handles navigation under the hood and does not require the Navigator imperative API calls (Navigator.push, Navigator.pop, etc) in case you were wondering.

Note: OpenContainerFAB

I looked at the FAB implementation and ensured that the OpenContainerFAB matched that of the _FloatingActionButtonType.regular which is the default for FAB.

Sorry but I don't like the way these animations look
https://github.com/user-attachments/assets/20a1ae79-93a3-4f4c-9fdd-bab82cd3a6b8
https://github.com/user-attachments/assets/087f6174-9187-4628-9d22-57893b6f8183


color-scheme light dark does not apply consistently as expected

:root {
  color-scheme: light dark;
}

I would expect "when there is the option to go light / dark, we start at light then go dark". What appears to be happening on some browsers is: "when there is text it goes light because we are dark" even when there is no css telling it to go light on a dark background
This leads to bugs w/ dark mode where system defaults differ from browser differ from app and we get unexpected default behaviors where text does not render as expected. This is seen in our new demo element made by /create

demo fixed, the default is fine it's just that if something sets the background color this WILL NOT modify w/ light dark settings. It is then on the provider to reflect the change in the text as well. We still need to review light-dark usage in DDD anyway but that's a separate issue


multi objective function question

Hi all,
Nice work, I hafiz fahad working at German cancer research center (DKFZ.) Heidelberg Germany.
I have a question related to this method.

Can you please tell me if we have several parameters (5 or 6) which defines the objective 1 and objective 2 in the end after training this model will also gives us these optimize parameters as well related to objective functions?
If we need to minimize the objective 1 and maximize the objective 2 so what shoud we do? (suggestion just use - sign with objective 2)?
What about if we have a 2 different fit models for 2 objective functions what should we need to?
best,
Hafiz

Hi Hafiz, sorry, I saw your question just now. I'll paste my replies from our email conversation here for others to follow too:

I'm not sure what kind of model you are referring to. Our method is designed for neural networks which come with many more than 5 or 6 parameters.
Yes, use the negative.
Then you don't need multi-objective, you can just optimize each model for each objective.

If you have any question left feel free to reopen the issue. Best, Michael

Hi Thank you for reply, I have one more question if we have some constraints like equality and inequality constraint how we can deal with this in your model?
best,
Hafiz


I am trying to use the main.py but its showing error "ZeroDivisionError: float division by zero"

Traceback (most recent call last):
File "main.py", line 724, in
mAP = sum_AP / n_classes
ZeroDivisionError: float division by zero

Add 1e-6, and it will work well