add default value to text column

I'm pretty sure default value used to be a functionality, so I am adding it in here so that people can specify a default value if there is nothing for any of the entries

A new inspection was created.

The inspection completed: No new issues

Hi @zachweix ,
Thanks for sharing! I checked, it doesn't look like we ever supported default on columns. You must have this confused with Fields - indeed, all fields can have a default.
I think this is pretty cool though - I see how it could be useful. A lot of columns are nullable, so for those columns it could be useful have something else written instead of  . Even a simple - is often more informative than null/empty. If we do add the default attribute, though, we should do it for ALL column types, not just text.
@pxpm what's your opinion on this feature? Anybody else please? Let's talk this through.
Cheers!

Thanks, over the weekend I'll go through and add a default value to all the columns, and I'll make sure to set it on the controller side, so I don't need the null coalescence for each column.

Thanks for the offer @zachweix !
Don't rush into it please. Best to get feedback from a few people first - don't want you to work any more on this PR if it won't be something we'll merge.
Hmm... how could we solve this on the controller side?

I guess CRUD panel is a better way to describe what I meant. In the function at https://github.com/Laravel-Backpack/CRUD/blob/master/src/app/Library/CrudPanel/Traits/Columns.php#L63 you can check if a default is set, and if not, set it to null

Hmm... I don't think that solution will work. Sure, inside addColumn() you can make sure $column['default'] exists. But you'd still need to use that $column['default'] inside every column blade file.
I think your solution here, in this PR, is better. It's simple and clear:
$column['name'] ?? $column['default'] ?? null

Any updated thoughts on this? Should I go ahead and implement it?

Hmm... still not sure. @pxpm what's your take on this?
Either way, if we do decide to do this, we should do it starting from the column-anchors branch, after PR https://github.com/Laravel-Backpack/CRUD/pull/2448 is finished, since that one will basically modify all columns. Otherwise it'll be super-difficult to fix all the merge conflicts, if both this PR and that PR modify all column types.

@pxpm just mentioned that a similar thing can be achieved with https://github.com/Laravel-Backpack/CRUD/pull/2448 - the wrapper allows you to set a default value.

Note: @pxpm proposed a similar thing in https://github.com/Laravel-Backpack/CRUD/pull/2448#issuecomment-600003983 - to set a default value, but also using a callback.

@pxpm what's been going on here? Do we have this feature by now? Default value for columns?


How to pass data to callback?

Hi, probably very naive question. How do I pass data to the callback method?
I would like to make an AJAX call to an API on select and clear methods, but I am trying to figure out how to pass information necessary for the API call.
Since content can be generated automatically, I usually set ids for ajax calls in the elements. For example:  <button id="myButton" data-id="10"> </button>
and then I can access that id in jquery. But I can't do this with bar-rating since it replaces the default select element.
Any hints would be appreciated!

Hi,
There's nothing stopping you from accessing the select field:
$('#example-pill').barrating('show', {
  theme: 'bars-pill',
  onSelect: function (value, text) {
    var id = $('#example-pill option:selected').data('id');
    console.log(id);
  }
});

Hope this helps.

Thanks for your reply.
I got stuck when there are multiple items to be rated. Then I need to be able to get the data from a specif option on a specific select. Let's say that the ids are of the form: example-pill-{{number}}, I tried this and gets the first select data, since the callback won't know which select was picked.
$('[id^=example-pill]').barrating('show', {
theme: 'bars-pill',
onSelect: function (value, text) {
var id = $('[id^=example-pill] option:selected').data('id');
console.log(id);
}
});

There are many ways to do that, you need to use the field with the correct #id in your callback or access this.$elem if that makes it more convenient -
onSelect: function (value, text) {
  console.log(this.$elem.find('option:selected').data('id'));
}

thanks for the help!

Your solution is print "undefined"
$('#example-pill').barrating('show', {
theme: 'bars-pill',
onSelect: function (value, text) {
var id = $('#example-pill option:selected').data('id');
console.log(id);
}
});
So it doesn't work !!!!!

The following worked for me
HTML:
<select class="priority-widget" data-field-name="a">
   <option>1</option>
   <option>2</option>
</select>
<select class="priority-widget" data-field-name="b">
   <option>1</option>
   <option>2</option>
</select>

Script:
$('.priority-widget').barrating({
  theme: 'bars-pill',
  onSelect: function (value, text) {
    var fieldValue= this.$elem.data().fieldName;
     // a or b
    console.log(fieldValue);
  }
});


[Feature]: Track last selected team and automatically select it again on login

Is there an existing issue for this?

[X] I have searched the existing issues

Summary
when dealing with multiple teams, I find that I am always reverted back to my own team when logging in to Coolify rather than whatever team I had last selected. it would be preferable if the last team I was on was tracked either in a cookie or in the db so it could be automatically selected when i log in next. presumably would also need another quick check to make sure I still have access to my last selected team
Why should this be worked on?
would be a pretty big UX improvement -- ik it sounds minor, but at work we have everything under a shared team and since the token cookie has an expiry of Session, this means I'm constantly having to re-select the shared team every single time i log in. it's a pretty frustrating UX and one that should be trivial to resolve, so could be a quick win

This is how it works in v4.
I'm closing this issue, because tracking features will be moved to GitHub discussions. Github issues will be only for bugs.
Version 4 is in full focus. v3 related issues will be closed, if it is not a critical bug.
Thanks for your understanding.


globvar ignore is ignored

Adding files or directories to the ignore global config variable does not have an effect on what is copied over to the __site directory.
(I found out about it because Manifest.toml and Project.toml are copied over to the __site directory, which also should not happen according to the docs).

Hello @stanvanlier!
Could you tell me how you defined ignore? I just did the following to test:

create a dummy dir, activate it, add Franklin
using Franklin; newsite(".") in the directory
adjusted config.md so it had ignore = ["node_modules/", "Project.toml", "Manifest.toml"]
ran serve(single=true, launch=false)
; ls __site gives

404.html	feed.xml	menu1		robots.txt
assets		index.html	menu2		sitemap.xml
css		libs		menu3		tag

which seems about right?

 Apparently I didn't restarting the server. I assumed the whole config.md would be reevaluated by just saving it, but it turns out there are some exceptions to that.

It definitely should, but the hard bit is that I think you're assuming that there's a cleanup pass to remove files afterwards, and there isn't.
What I mean is that you called serve, it copied stuff to site, then you saved config with a new ignore, but the copied files haven't been deleted. They will be deleted only if you call serve(clear=true) in which case the entire folder will be nuked and rebuilt.
You can always work with clear mode but if you have evaluated code cells, this will slow stuff down quite a bit; if you don't it's fine :)

Ah yes that's an interesting one; Franklin keeps a list of files being watched and given that it was there from the start, it will keep assuming it needs to copy it if it's not there.
What should ideally happen is that when ignore gets updated that list of files being watched also is. I'll reopen the issue to look a bit into it


[Enum Request] Table 299 "Reminder Comment Line" - Field "Type"

Hi,
Could you please change field 1 (Type) of table 299 (Reminder Comment Line) from option to enum?
        field(1; Type; Option)
        {
            Caption = 'Type';
            OptionCaption = 'Reminder,Issued Reminder';
            OptionMembers = Reminder,"Issued Reminder";
        }

Thanks!

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


Exam Mode

Add an option at the beginning to choose between "Quiz Mode" as currently exists and "Exam Mode" to skip feedback/explanations and just get a score at the end.

100 questions
60 min timer
No explanations/feedback during but still get the print out at the end
Can still flag questions


RangeTransform "undone" after another transform in GroupTransform?

Not sure the extent of this problem, but it seems that a RangeTransform setting a minimum value clip at 0.0 for in and out is "ignored" when it follows another operation in a GroupTransform.
EG:
    transform_list = [
        PyOpenColorIO.RangeTransform(
            minInValue=0.0,
            minOutValue=0.0
        ),
        PyOpenColorIO.MatrixTransform(
            shape_OCIO_matrix(compressed_matrix())
        ),
        PyOpenColorIO.AllocationTransform(
            allocation=PyOpenColorIO.Allocation.ALLOCATION_LG2,
            vars=[
                calculate_OCIO_log2(min_EV),
                calculate_OCIO_log2(max_EV)
            ]
        )
    ]

    group_transform = PyOpenColorIO.GroupTransform(
        transforms=transform_list,
        direction=PyOpenColorIO.TransformDirection.TRANSFORM_DIR_FORWARD
    )

Appears to work, properly clipping at 0.0.
However, the following fails.
    transform_list = [
        PyOpenColorIO.MatrixTransform(
            shape_OCIO_matrix(compressed_matrix())
        ),
        PyOpenColorIO.RangeTransform(
            minInValue=0.0,
            minOutValue=0.0
        ),
        PyOpenColorIO.AllocationTransform(
            allocation=PyOpenColorIO.Allocation.ALLOCATION_LG2,
            vars=[
                calculate_OCIO_log2(min_EV),
                calculate_OCIO_log2(max_EV)
            ]
        )
    ]

    group_transform = PyOpenColorIO.GroupTransform(
        transforms=transform_list,
        direction=PyOpenColorIO.TransformDirection.TRANSFORM_DIR_FORWARD
    )

RangeTransform appears to only work when it is the first item in a GroupTransform, and fails to work after.

in your allocation transform, I noticed you're not using a zero offset with your lg2 vars; is it possible that the transform is turning some positive input values negative?

I don’t think so? It is also leaving inf in place too? Feels like something may be up.

The RangeTransform here is only clipping values below zero.  If you try setting maxInValue and  maxOutValue., I think you'd find that output values won't exceed f(maxOutValue), where f is the AllocationTransform.

I agree with @zachlewis that not using offset with the AllocationTransform can produce negatives. If you are like me, I find it easier to look at the generated shader code to understand what's going on:
shader_desc = OCIO.GpuShaderDesc.CreateShaderDesc(language=OCIO.GPU_LANGUAGE_GLSL_4_0)
processor = config.getProcessor(group_transform).getDefaultGPUProcessor()
processor.extractGpuShaderInfo(shader_desc)
print(shader_desc.getShaderText())

Hopefully that can help in the discussion.

Hey Remi! Thanks for the tip:
// Declaration of the OCIO shader function

vec4 OCIOMain(vec4 inPixel)
{
  vec4 outColor = inPixel;

  // Add Matrix processing

  {
    vec4 res = vec4(outColor.rgb.r, outColor.rgb.g, outColor.rgb.b, outColor.a);
    vec4 tmp = res;
    res = mat4(0.84247906225309444, 0.04232824226101229, 0.042375654905705065, 0., 0.078433599999999187, 0.87846863646977214, 0.078433599999999951, 0., 0.079223745147764313, 0.079166127460543398, 0.87914297379310369, 0., 0., 0., 0., 1.) * tmp;
    outColor.rgb = vec3(res.x, res.y, res.z);
    outColor.a = res.w;
  }

  // Add Log processing

  {
    outColor.rgb = max( vec3(1.17549435e-38, 1.17549435e-38, 1.17549435e-38), outColor.rgb);
    outColor.rgb = log2(outColor.rgb);
  }

  // Add Matrix processing

  {
    vec4 res = vec4(outColor.rgb.r, outColor.rgb.g, outColor.rgb.b, outColor.a);
    res = vec4(0.0500000007, 0.0500000007, 0.0500000007, 1.) * res;
    res = vec4(0.623696566, 0.623696566, 0.623696566, 0.) + res;
    outColor.rgb = vec3(res.x, res.y, res.z);
    outColor.a = res.w;
  }

  // Add Range processing

  {
    outColor.rgb = max(vec3(0., 0., 0.), outColor.rgb);
  }

  return outColor;
}

I'm curious though, even if it did generate negatives, why won't the RangeTransform when placed at the tail end of the chain not clip them at zero? Also, when the maximum is set, it does not appear to clip inf to the maximum?
It feels like it's just not working in any other place in the chain?

Thanks for sharing, looking at the generated shader it sure looks like it's clipping negatives at 0 on output. Maybe worth you give us a way to reproduce what you are seeing to investigate.


Cilium version (v1.10.17) wrong

Summary
When executing microk8s enable cilium after a fresh install, it shows many events that it's trying to get quay.io/cilium/cilium:v1.10.17 and quay.io/cilium/operator-generic:v1.10.17 but both of them aren't available in the repos. Meanwhile the process wait for termination.
 3m30s       Normal    SuccessfulCreate    daemonset/cilium                               Created pod: cilium-7plvz 3m30s       Normal    SuccessfulCreate    replicaset/cilium-operator-8549564             Created pod: cilium-operator-8549564-wstkl 3m29s       Normal    Scheduled           pod/cilium-7plvz                               Successfully assigned kube-system/cilium-7plvz to test 3m29s       Normal    Scheduled           pod/cilium-operator-8549564-wstkl              Successfully assigned kube-system/cilium-operator-8549564-wstkl to test 2m13s       Warning   FailedKillPod       pod/calico-kube-controllers-8544d5bc7c-st44q   error killing pod: failed to "KillPodSandbox" for "ff2ce1d6-7ab8-402b-905c-f8a3f41028aa" with KillPodSandboxError: "rpc error: code = Unknown desc = failed to destroy network for sandbox \"89625e0cd0606d57cee004e2db19df8d24dd1a9bff95f55fe6b2c69a9219d4be\": plugin type=\"cilium-cni\" name=\"cilium\" failed (delete): failed to find plugin \"cilium-cni\" in path [/var/snap/microk8s/4128/opt/cni/bin]" 2m3s        Normal    Pulling             pod/cilium-operator-8549564-wstkl              Pulling image "quay.io/cilium/operator-generic:v1.10.17" 2m2s        Warning   Failed              pod/cilium-operator-8549564-wstkl              Failed to pull image "quay.io/cilium/operator-generic:v1.10.17": rpc error: code = NotFound desc = failed to pull and unpack image "quay.io/cilium/operator-generic:v1.10.17": failed to resolve reference "quay.io/cilium/operator-generic:v1.10.17": quay.io/cilium/operator-generic:v1.10.17: not found 2m2s        Warning   Failed              pod/cilium-operator-8549564-wstkl              Error: ErrImagePull 111s        Normal    Pulling             pod/cilium-7plvz                               Pulling image "quay.io/cilium/cilium:v1.10.17" 111s        Warning   Failed              pod/cilium-operator-8549564-wstkl              Error: ImagePullBackOff 110s        Warning   Failed              pod/cilium-7plvz                               Failed to pull image "quay.io/cilium/cilium:v1.10.17": rpc error: code = NotFound desc = failed to pull and unpack image "quay.io/cilium/cilium:v1.10.17": failed to resolve reference "quay.io/cilium/cilium:v1.10.17": quay.io/cilium/cilium:v1.10.17: not found 110s        Warning   Failed              pod/cilium-7plvz                               Error: ErrImagePull 99s         Warning   Failed              pod/cilium-7plvz                               Error: ImagePullBackOff 96s         Normal    BackOff             pod/cilium-operator-8549564-wstkl              Back-off pulling image "quay.io/cilium/operator-generic:v1.10.17" 85s         Normal    BackOff             pod/cilium-7plvz                               Back-off pulling image "quay.io/cilium/cilium:v1.10.17"
What Should Happen Instead?
The proper cilium version should be pulled. In this case v1.10.16 or one of the more recent versions.
SIDENOTE
microk8s cilium:v1.10.16 works properly.
Reproduction Steps
fresh ubuntu (20.04 or latest 22.04) installation
apt install snapd
snap install microk8s --classic --channel=1.25/stable
microk8s enable community
microk8s enable cilium
(other term)
microk8s kubectl -n kube-system get events -w
Now you see the Error: ImagePullBackOff
Introspection Report

Can you suggest a fix?
It would be a way to check for the latest available version to query quay.io or the releases of github not the branches. Branches tend to be available before having a release. As such it's not very reliable to use the branch for version checks

Hi @eBeyond, thank you for raising this issue.
As you mentioned, currently the version is pulled from the GitHub branch https://github.com/canonical/microk8s-community-addons/blob/2aeb2a5a77ebf0617133a7d2b501d909dd2f4969/addons/cilium/enable#L65-L70, which may result in the release not yet being available.
As of right now, it looks like all required images have been pushed and are available, i.e.
$ docker manifest inspect quay.io/cilium/cilium:v1.10.17
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1787,
         "digest": "sha256:ccc7f1315bd36f360bed0eb3874c9b17fd2bc206f96be81ddc56cb5da772b5f5",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1787,
         "digest": "sha256:a0b9d38371707b4c910a4cd6998f94d1b814752ceec6e060b62135e2ea459146",
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      }
   ]
}

I'm not closing this issue, since the problem remains that during a new Cilium release, there may be a window where enabling Cilium will fail.
Given that the cilium addon is part of the community repository, the MicroK8s team will only attend to important security or bug-fixes. Contributions are always welcome, if anyone wants to fix this.
Thank you!


Traffic manager distance for leading vehicles not behaving as expected?

** Carla Version: 0.9.11 **
** OS: Ubuntu 18.04 **
Using the following, I thought that the following distance should be bumper to bumper for each vehicle?:
self.tm.set_global_distance_to_leading_vehicle(0.0)

But the cars still seem to have some distance even if these vehicles are moving or stopped?
E.g.:

There's always a minimum distance being kept between vehicle, and that parameter is meant to make it higher, not lower. Also, it only shows when the vehicles are stopped. If you want vehicles to ignore collisions between themselves, you can set the ignore_vehicles_percentage to 100.

@jackbart94 Thanks for the clarification. Setting ignore_vehicles_percentage to 100 certainly did make vehicles collide - but this happened even when distances were set_global_distance_to_leading_vehicle(100.0)
I guess the sort of functionality I am looking for is where the vehicles follow a particular spacing policy. I'll probably have to modify the motion planning code to do that.


[BUG]: drizzle-orm incorrectly imports @libsql/client causing build failure at the edge.

What version of drizzle-orm are you using?
0.28.5
What version of drizzle-kit are you using?
0.19.13
Describe the Bug
Starting with 0.28.4 drizzle-orm imports @libsql/client
See line 4 of<EMAIL_ADDRESS>
NOTE
0.28.3 drizzle-orm DOES NOT imports @libsql/client
See<EMAIL_ADDRESS>
This creates a problem because @libsql/client depends on node, which means it can't be deployed to edge environments. One gets a build error. The correct import for edge is @libsql/client/web
Expected behavior
Do not import @libsql/client
Environment & setup
No response

Fixed in #1122, currently available on drizzle-orm@beta and will be included in the next release.

I tried to install 0.28.6-6c516c3<EMAIL_ADDRESS>and it is back in. Did this regress?

Is there a workaround to use turso with drizzle on the edge?
Tried @beta but how @mhevery  already mentioned, the issue still persists.

Is there a workaround to use turso with drizzle on the edge?

Workaround is to use 0.28.3


helper tool to build examples in wasm

Objective

add an helper to build examples in wasm (from #4700)

Solution

cargo run -p build-wasm-example -- lighting

Since the gitpod part is controversial. Can you extract the wasm build tool to a separate PR since that part is not really controversial and makes building wasm simpler.

Yeah I'd merge this asap if it was split out.

@cart in #4700

bors r+


[#156980708] platform can ask for servo / motor calibration params

As mentioned in the "Obtaining floating point parameters" section in the ros-serial limitations wiki, I needed to explicitly set the rosparam as a float. Did that, and the calls to getParam() returned true every time.


Use TypeScript imports resolver

Hi! Are there any plans to use TypeScript imports resolver in eslint-plugin-import? It seems a bit off that this package is designed for TypeScript but doesn't include this by default.
P.S. Thank you for all your hard work over the years! Your efforts deserve more recognition!

Thank you. This seems to introduce a good amount of details. Would you be interested in contributing it?

Sure! Just wanted to be sure that it's something you are interested in

@mightyiam I have created https://github.com/mightyiam/eslint-config-love/pull/1509 let me know what you think

Seems like the original PR was rejected. In my case, I'm not looking for a code mod feature, but somehow VSCode doesn't really provide great visibility for unused imports e.g.

As you can see, lower opacity is something not ideal. However, if I however over the the problem, I can see it clearly.

TS Language Server also doesn't seem to populate the Problems tab and my TypeScript compilier doesn't even complain about it!
Anyway for alternatives, I suggest:
https://github.com/un-ts/eslint-plugin-import-x
https://www.npmjs.com/package/eslint-import-resolver-typescript
https://www.npmjs.com/package/eslint-plugin-unused-imports

@psychobolt doesn't that seem like an IDE issue to you? Does tsc complain about it?

Seems like you have to explicitly tell TypeScript to warn about unused variables e.g
    "noUnusedLocals": true

If I turn on this compilierOption, tsc will complain. Anyways there is already a rule no-unused-vars for ts-eslint: https://typescript-eslint.io/rules/no-unused-vars/
Some more info on how the IDE works: https://github.com/microsoft/vscode/issues/219335


get_camera_transform from habitat.tasks.rearrange.utils uses inconsistent getting method

Habitat-Lab and Habitat-Sim versions
Habitat-Lab: v0.3.0 or master?
Habitat-Sim: v0.3.0 or master?
Habitat is under active development, and we advise users to restrict themselves to stable releases of Habitat-Lab and Habitat-Sim. The bug you are about to report may already be fixed in the latest version.
Master branch contains 'bleeding edge' code, but we do appreciate bug reports for it!
🐛 Bug
The cameras attached to articulated agents are initialized using ArticulatedAgentCameraParams class here. The position for this sensor is set using the logic here. However when habitat.tasks.rearrange.utils.get_camera_transform function is used to get the absolute transformation of this camera, the getter applies inconsistent logic taking only the translation component of camera's view-matrix. This leads to a camera-pose with right translation but wrong rotation wrt world frame.
Steps to Reproduce
Steps to reproduce the behavior:

Initialize environment with Spot in it
Access camera pose using get_camera_transform
Access camera pose using sim.agents[0]._sensors[<sensor-name>].render_camera.camera_matrix.inverted()
Output of 2 != output of 3

See PCD built with 3 (top) versus with 2 (bottom) below.

🤯

Yeah, this is a pain. @SergioArnaud happy to review a fix if you want to tackle this. :smiley:

Sorry this made you stumble @SergioArnaud! @aclegg3 given this bug has a greater damage than population of 1, I can prioritize this and push a fix today.

Fixed in the PR linked above. Tested with zf/obs-wm-updates branch of habitat-llm. See attached videos of point-cloud from get_camera_transform method and sim.agents[0]._sensors[<sensor-name>].render_camera.camera_matrix.inverted() method. Camera used is articulated_agent_jaw_rgb and articulate_agent_jaw_depth introduced in #1856 .
https://github.com/facebookresearch/habitat-lab/assets/9580531/81ef2577-5060-4d80-b568-bbc86ebb6da0
https://github.com/facebookresearch/habitat-lab/assets/9580531/1fdc7095-d8fa-4e1b-a6ec-cdf873622b5b


After capturing handshake unable to crack it

Handshake ready for cracking...

+--------+-------------+
| Number |     Mode    |
+--------+-------------+
|   1    |  Dictionary |
|   2    | Brute-force |
|   3    |    Manual   |
+--------+-------------+

Select an attack mode: 2

Input a brute-force pattern:
hashcat (v6.2.6-851-g6716447df) starting

The device #1 has been disabled as it most likely also exists as an OpenCL device, but it is not possible to automatically map it.
You can use -d 1 to use Metal API instead of OpenCL API. In some rare cases this is more stable.

METAL API (Metal 341.35)
========================
* Device #1: Apple M1, skipped

OpenCL API (OpenCL 1.2 (Nov 11 2023 23:48:17)) - Platform #1 [Apple]
====================================================================
* Device #2: Apple M1, GPU, 960/10922 MB (1024 MB allocatable), 8MCU

Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63

Hashes: 3 digests; 3 unique digests, 2 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates

Optimizers applied:
* Zero-Byte
* Brute-Force
* Slow-Hash-SIMD-LOOP

Watchdog: Temperature abort trigger set to 100c

Host memory required for this attack: 195 MB

Invalid mask length (0).

Started: Sat Jul 20 11:50:30 2024
Stopped: Sat Jul 20 11:50:33 2024

Hi there, you need to provide a brute-force pattern when the script prompts you.
See here:
Select an attack mode: 2

Input a brute-force pattern:
hashcat (v6.2.6-851-g6716447df) starting


feat(render): add render prop

What: This also moves all examples and tests to use render prop and adds one test to verify the children prop still works

Why: Closes #258
I'm trying to bring some cohesion to the render prop idea.

How: the source code change was as simple as this.props.render ||. Most of the changes are updating the stories, tests, and docs to use the render prop instead.

Checklist:

[x] Documentation
[x] Tests
[x] Ready to be merged
[ ] Added myself to contributors table N/A

NOTE: The children prop still works fine. I don't know whether I'll ever drop support for it. Can't think of a reason why I would...

Codecov Report

Merging #261 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #261   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files           4      4
  Lines         299    299
  Branches       71     72    +1
=====================================
  Hits          299    299

Impacted Files
Coverage Δ

src/downshift.js
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

Thanks for the review @petetnt! You've been added to the contributors table :tada:


feat(isJSX): Add support for optional chainning

Description
Add support for optional chaining in JS\TS.
Closes #120

NOTE: feature untested yet

Would love to see this merged as it's quite often getting in the way of using glean in my react / typescript project. Anything I can do to help?

:tada: This PR is included in version 5.2.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:

@mattvague check it out :)

@mattvague check it out :)

Amazing, thank you!


Fix Twig & Routing profilers

Fix the Twig template definition to show the "Twig" item in the profiler menu.
Use the service request_matcher which replace url_matcher in Silex 2.

Tests are failing due to an incompatibility between symfony/webprofiler-bundle 2.7 and symfony/http-kernel 2.6. This issue is resolved by https://github.com/symfony/symfony/pull/14645

Q
A

Bug fix?
yes

New feature?
no

BC breaks?
no

Deprecations?
no

Tests pass?
no

Fixed tickets
-

License
MIT

Thank you @GromNaN.


[question/enhncement] is there  currently a way to pin/link plugin to  observe specific pane or specific file?

Currently I have workflow with many panes open, one of them is  daily note, other are notes on topic
When I want to add something to daily note, the excalibrain switches to it, what I would like to achieve that it will stay connected with specific pane  and not the active one

I can add an enhancement to pin the leaf excalibrain responds to.

@zsviczian would be great!

I implemented pinning in 0.0.10. I will be releasing it soon.


Fix --kubeconfig flag priority

The kubeconfig flag on the app install command does not affect the actual kubernetes command execution. The kubernetes command is executed against the default kubeconfig file, not the one passed in via flags.
Expected Behaviour

Passing the kubeconfig flag on the app install command should use that kubeconfig file when installing the app.
Current Behaviour

The kubeconfig variable is only written out, but not utilized:
https://github.com/alexellis/k3sup/blob/master/pkg/cmd/openfaas_app.go#L42
Possible Solution

Since the kubernetes_exec.go file is also in the cmd package, it's possible for the kubectl and kubectlTask functions to look for changes on the flag to get that passed in value. Much the same as the above pasted code from one of the apps.
Steps to Reproduce (for bugs)

k3sup app install openfaas --kubeconfig any/path/to/file
Output will say something like: "Using kubeconfig {the path from above}"
Run kubectl get pods --all-namespaces --kubeconfig /same/path/above
Observe the app was not installed
Run kubectl get pods --all-namespaces (without the kubeconfig)
See the application was installed on the incorrect cluster

Context

I have several k8s cluster set up in various environments for testing. Swapping the config files, or env var is annoying, and really time consuming if I forget before I run the install command.
Your Environment

What OS or type or VM are you using? Where is it hosted?
Linux/ARM
Desktop (microk8s), GCP, DigitalOcean, Raspberry Pi 3+
Operating System and version (e.g. Linux, Windows, MacOS):
Linux

Please could someone suggest a simpler alternative fix?

Sooo... Is this going to be fixed or ?

See my comment from a month ago. What specific issue are you running into? Some people don't set their KUBECONFIG variable correctly. If you do that, then you shouldn't need this flag.

My KUBECONFIG variable is set to ./kubeconfig but I figured that when setting the --kubeconfig paramenter, one could override which kubeconfig ark would use.

You should never use ./, always use pwd to get the whole absolute path. Otherwise it won't work when you move out of the folder or another app does.


Disallow while loops in predicates in the frontend

This shouldn't compile:
predicate;

fn main() -> bool {
    let x = 0;
    while true { x += 1; }

    true
}

https://github.com/FuelLabs/sway/pull/3291 will disallow this in codegen. It would be better to disallow this in the frontend, potentially along with other things like storage intrinsics etc.

Looks like this could be achieved by refactoring the language into a core, which could be somewhat pure language (no loops, no storage effects, no contract calls(?), only local state modification is allowed, etc.) and the rest of it. This would greatly simplify developing static analyses for Sway, formal verification for Sway etc.

https://github.com/FuelLabs/sway/pull/3400 Closes this


fallback to Math.random for key generation on firefox

churn has some issues on Firefox. This is the easy fix, working around this issue:
https://github.com/uProxy/uproxy/issues/1593

:+1:

Keys should never be math.random. that already got flagged as a security
issue in our first review.
On May 29, 2015 11:58 AM, "trevj"<EMAIL_ADDRESS>wrote:

churn has some issues on Firefox. This is the easy fix, working around
this issue:
uProxy/uproxy#1593 https://github.com/uProxy/uproxy/issues/1593
You can view, comment on, or merge this pull request online at:
https://github.com/uProxy/uproxy-lib/pull/185
Commit Summary

fallback to Math.random for key generation on firefox

File Changes

M package.json
https://github.com/uProxy/uproxy-lib/pull/185/files#diff-0 (2)
M src/churn/churn.ts
https://github.com/uProxy/uproxy-lib/pull/185/files#diff-1 (10)

Patch Links:

https://github.com/uProxy/uproxy-lib/pull/185.patch
https://github.com/uProxy/uproxy-lib/pull/185.diff

—
Reply to this email directly or view it on GitHub
https://github.com/uProxy/uproxy-lib/pull/185.

This is a Caesar Cipher.  Using math.random hardly seems like the main cryptographic vulnerability.

Right, calling this a "key" is generous -- it just ensures we don't have a single, easily blockable signature. A very slight advance over a fixed "key".


Unmentioned requirements on installation page

Required for pip dependency builds.
libffi-dev
libssl-dev

A whole bunch of other packages should also be downloaded, see also https://github.com/cuckoobox/cuckoo/blob/8b5aad90b9e8aff1f645528ebde3e2fd7e1e1538/utils/setup.sh#L245-L248. Anyone care to update the documentation on this matter? :)

We really should keep track of all these dependencies. I wouldn't even be able to say what all of those are for. For the moment I'll update for the ones originally specified in the ticket. The others should be singularly documented.

Fixed, closing.


after services started hook

I use Binci to launch a Docker image that exposes a CMD that is a daemon. I have found the need to run shell commands against the container once it has come alive. Since the docker container name is some form of bc_serviceName_randomLetters, I'm stuck pretty much using grep/sed/awk to figure out which container I want to attach + run commands to.
Would this be an easy configuration option to add?
afterServicesStarted:
  containerName:
    - touch magicFile

I'll have to think about this one a bit, as it's something I've considered but not found a major use-case for. My first thought would be to define it in the service itself as something like task that would then pass the command when the service script is constructed, however, that doesn't flow asynchronously if the container is up but the service isn't.

👍


increasing next_version 'prerelease' with different prerelease_token

Situation
I am not shure if this should be seen as a bug or an enhancement. I have observed this behaviour in version 2.13 of semver.
If I have a version 1.2.3
ver = semver.VersionInfo.parse('1.2.3')
and would like to get the next dev Version,
I will get the version 1.2.4-dev.1 by calling
ver_dev1 = ver.next_version('prerelease', prerelease_token='dev')
If I would like to get the next release candidate, I would call
ver_rc1 = ver_dev1.next_version('prerelease', prerelease_token='rc')
which should be 1.2.4-rc.1
but the result is 1.2.4-dev.2
To Reproduce
import semver
ver = semver.VersionInfo.parse('1.2.3')
ver_dev1 = ver.next_version('prerelease', prerelease_token='dev')
ver_rc1 = ver_dev1.next_version('prerelease', prerelease_token='rc')
print(ver_rc1)

The result is
1.2.4-dev.2
Expected Behavior
I would assume, that according to semantic versioning the result should be
1.2.4-rc.1
Environment

OS: Linux
Python version 3.6.13
Version of semver library 2.13

Similar behavior is also observed with build bumps. A custom build string once set, cannot be reset in a subsequent call of the bump_build method.

Yes, this is similar to issue #369.

@hokreb Time flies! Sorry for the delay.
I've tried to confirm it, but if I use the latest version from the master branch, it works:
>>> import semver
>>> ver = semver.VersionInfo.parse('1.2.3')
>>> str(ver.next_version('prerelease', prerelease_token='dev'))
'1.2.4-dev.1'

Can you confirm? If yes, I'd like to close this issue. Thanks!


[SKCore] If 'Platform.currentPlatform' is nil use 'so' as library extension

Platform only detects the 'debian' linux flavor so if it is nil it's most likely an unknown linux flavor

LinuxFlavor should include an unknown case so when Process.checkNonZeroExit(args: "uname") returns linux we can at least return .linux(. unknown) in any case.

LinuxFlavor should include an unknown case so when Process.checkNonZeroExit(args: "uname") returns linux we can at least return .linux(. unknown) in any case.

That's a good idea but I think the change here is good to have regardless of your suggested improvement to Platform.
An unknown platform is more likely some unix-like platform, .so is a better fallback extension than .dylib.

Ah, yes, of course!

I'll tentatively merge this to allow the service to work on non-debian linux.


STORM-931: Python Scritps to Produce Formatted JIRA and GitHub Joint …

…Reports

+1

+1 looks a lot better then my original one.


Swift UI funtimes for iOS Sample App on KMP

Work in progress on #2188 (repos pictured are mine since it's my github key I'm using while working on this).

Notes:

Used SwiftUI instead of storyboards mostly for funsies and practice, also to prove it could be done. ⛰
Somewhat obnoxious side effect of K/N compiling down to Objective-C instead of Swift is that I needed to make an @ObservableObject to handle publishing changes of arrays instead of using @State for various properties since @State only works on structs (and arrays of structs - even if the Array itself is a struct, it has to contain structs for the SwiftUI magic™ to work properly) and anything coming out of ObjC is going to be a class.
Due to stupidity with Objective-C runtime collision, I've had to typealias one of the RepoFragments properties named description. On every NSObject subclass, description is essentially a debug description of an object, and whether the dynamic dispatch will resolve to that implementation or the implementation of a property named description is basically a crapshoot, with the dice slightly weighted in favor of Apple's implementation. I don't know if there's a great way to add an iOS-only alias - I think an extension that, within Kotlin, still called into .description, would run into the same problem on iOS, but I didn't try that since aliasing was easier.

Questions:

On the commits I'm running into the issue that the closure I get back from fetchCommits(repositoryName:) is returning [Any] - I'm guessing because this could return multiple possible types. Can you point me in the direction of what those possible types are, and how I'd find them in the future?
I noticed every K/N object is generating this componentN for all the properties - I don't think I've seen this in my prior work with K/N, so is this something we're doing (or causing it to do)? It still has the appropriate property names on top of this, but I thought this was weird:

Leaving as a draft until I can get the commits page up.

Component fields are coming from the fact that our generated models are data classes. Not sure if there is a way to hide them from objc header file

The other issue is related to List generics with nullable type:
fun fetchCommits(repositoryName: String, success: (List<GithubRepositoryCommitsQuery.Edge?>) -> Unit)

Looks like there is an issue with ObjectiveC interop https://kotlinlang.org/docs/reference/native/objc_interop.html#generics
I will reach out to Kevin as far as I remember he was working on adding this feature to KN.

That helps though, I can at least do some casting to get whatever edges are non-null and of the appropriate type. Thank you!

@sav007 Still wondering about the componentN stuff - I'm definitely seeing that in the generated Obj-C headers here.

@designatednerd sorry for the confusion, but that what I said. componentN  is generated by default by Kotlin compiler for all data classes (the components are used in destructuring declarations https://kotlinlang.org/docs/reference/multi-declarations.html). There is no way we can hide those fields from ObjC, (unless we make our models to be a regular classes that I think is not an option).


I get a run time error

https://github.com/DSE-MSU/DeepRobust/blob/9ba3751f33f87d0eda281497ce84aa99fe1f2206/examples/image/test_deepfool.py#L45
RuntimeError: Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the moment
x = copy.deepcopy(image).requires_grad_(True)
how can I handle it?

Are you running the original code? I run it by myself and this problem didn't occur. I'm using torch 1.2 and python3.6.
Normally, this problem is because the image Tensor has been calculated gradient in the computational graphs. While it requires the tensor to be a leave node, which is a new tensor without any other operations. Check whether this tensor 'image' have been modified before you running deepcopy().

your help would be much help
On Sat, Oct 31, 2020 at 10:22 PM Yaxin Li<EMAIL_ADDRESS>wrote:

Are you running the original code? I run it by myself and this problem
didn't occur. I'm using torch 1.2 and python3.6.
Normally, this problem is because the image Tensor has been calculated
gradient in the computational graphs. While it requires the tensor to be a
leave node, which is a new tensor without any other operations. Check
whether this tensor 'image' have been modified before you running
deepcopy().
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/DSE-MSU/DeepRobust/issues/37#issuecomment-719973153,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIIZWMLY5O5D7EXREWREA7TSNRMFXANCNFSM4S7L6XKA
.

--
پاینده باشید


Fix responsive issues due to using scrollWidth instead of clientWidth…

… - paddingLeft - paddingRight.
el[0].scrollWidth is definitely not the same as el.width().
scrollWidth returns the larger of either the width of the container or the width of the scrolling context, which is the width of the existing content in the element. Therefore, this change completely breaks responsive containers when resizing to a smaller width. Since the width of the content is larger than the new width of the container, this is not useful for sizing responsive containers.
The changes changing el.width() to el[0].scrollWidth should all be reverted. I've been trying to track the cause of responsive issues down for weeks off and on, and finally dedicated enough time today to find this...

Is there a reason why this pull request has never been merged?

initially It was because it conflicted with the webcomponents.js, but that has become moot, now it's because there is a merge conflict.

@billschaller I know this is an old PR but would it be possible to discard the changes made at dist? dist is used so that upstream can offer an already built package to package managers, and should reflect the state of upstream. Other PR's could've changed that state before yours so it wouldn't be right to overwrite those changes.


TypeError: torch_replacement_knn_gpu() got an unexpected keyword argument 'device'

Hey looks like I'm having some issues working with Llama models. This is the modified script I'm using:
!python run_generation.py --model_type llama --model_name_or_path psmathur/orca_mini_3b \
    --prefix "<<SYS>>\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n<</SYS>>\n\n [INST] Summarize the following book: " \
    --prompt example_inputs/harry_potter_full.txt \
    --suffix " [/INST]" --test_unlimiformer --fp16 --length 200 --layer_begin 16 \
    --index_devices 1 --datastore_device 0

But I get this error:
2023-08-14 14:28:33.395015: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
08/14/2023 14:28:35 - WARNING - __main__ - device: cuda, n_gpu: 1, 16-bits training: True
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama.LlamaTokenizer'>. This means that tokens that come after special tokens will not be properly handled. We recommend you to read the related pull request available at https://github.com/huggingface/transformers/pull/24565, and set the legacy attribute accordingly.
Loading checkpoint shards: 100% 3/3 [00:08<00:00,  2.95s/it]
08/14/2023 14:29:16 - INFO - __main__ - Namespace(model_type='llama', model_name_or_path='psmathur/orca_mini_3b', prompt='example_inputs/harry_potter_full.txt', length=200, num_hidden_layers=None, stop_token=None, temperature=1.0, repetition_penalty=1.0, k=0, p=0.9, prefix='<<SYS>>\\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \\n<</SYS>>\\n\\n [INST] Summarize the following book: ', suffix=' [/INST]', padding_text='', xlm_language='', seed=42, no_cuda=False, stream_output=False, num_return_sequences=1, fp16=True, jit=False, device=device(type='cuda'), n_gpu=1)
08/14/2023 14:29:16 - INFO - Unlimiformer - Encoding 0 to 65 out of 65
Traceback (most recent call last):
  File "/content/unlimiformer/src/run_generation.py", line 577, in <module>
    main()
  File "/content/unlimiformer/src/run_generation.py", line 532, in main
    output_sequences = model.generate(
  File "/content/unlimiformer/src/unlimiformer.py", line 529, in pre_generate_hook
    return self.original_generate_func(input_ids_prefix, **new_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py", line 1642, in generate
    return self.sample(
  File "/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py", line 2724, in sample
    outputs = self(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/content/unlimiformer/src/unlimiformer.py", line 551, in pre_forward_hook
    result = self.original_forward_func(input_ids=input_ids, labels=labels, attention_mask=attention_mask, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/llama/modeling_llama.py", line 810, in forward
    outputs = self.model(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/llama/modeling_llama.py", line 698, in forward
    layer_outputs = decoder_layer(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/llama/modeling_llama.py", line 413, in forward
    hidden_states, self_attn_weights, present_key_value = self.self_attn(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/content/unlimiformer/src/unlimiformer.py", line 575, in attention_pre_forward_hook
    result = original_cross_attn_forward_func(hidden_states=hidden_states, attention_mask=attention_mask, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/llama/modeling_llama.py", line 310, in forward
    query_states = self.q_proj(hidden_states)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1547, in _call_impl
    hook_result = hook(self, args, result)
  File "/content/unlimiformer/src/unlimiformer.py", line 629, in attention_forward_hook
    _, top_search_key_indices = self.datastore[datastore_index].search(datastore_query, k=topk)
  File "/content/unlimiformer/src/index_building.py", line 34, in search
    scores, values = self.indices[i].search(queries[i], k)
  File "/content/unlimiformer/src/index_building.py", line 144, in search
    scores, values = faiss.knn_gpu(faiss.StandardGpuResources(), queries, self.keys, k,
TypeError: torch_replacement_knn_gpu() got an unexpected keyword argument 'device'

Any ideas on how to fix that?
Thanks again for all the help and for the new features!

 Answer with detailed responses according to the entire instruction or question. \n&lt;&lt;/SYS&gt;&gt;\n\n [INST] Summarize the following book: " --prompt example_inputs/harry_potter_full.txt --suffix " [/INST]" --test_unlimiformer --fp16 --length 200 --layer_begin 16

Hi @jordancole21 and @kekekawaii2839 ,
Thank you for your interest in our work!
We developed this with the newest versions of pytorch, transformers, and faiss.
In your case, it seems that maybe the faiss version is the problem. Can you install faiss-gpu version 1.7.4 from conda for example https://anaconda.org/conda-forge/faiss-gpu ?
Best,
Uri

Hi @jordancole21 and @kekekawaii2839 , Thank you for your interest in our work!
We developed this with the newest versions of pytorch, transformers, and faiss.
In your case, it seems that maybe the faiss version is the problem. Can you install faiss-gpu version 1.7.4 from conda for example https://anaconda.org/conda-forge/faiss-gpu ?
Best, Uri

Ok thank you! For some reason it looks like the latest version of faiss I can get in Google Colab is 1.7.2 but I'll see if I can find a way to get 1.7.4 to work!

Hi @jordancole21 and @kekekawaii2839 , Thank you for your interest in our work!
We developed this with the newest versions of pytorch, transformers, and faiss.
In your case, it seems that maybe the faiss version is the problem. Can you install faiss-gpu version 1.7.4 from conda for example https://anaconda.org/conda-forge/faiss-gpu ?
Best, Uri

Thank you! In my case, faiss-gpu has version 1.7.3 using conda install faiss-gpu from channel: pytorch. Using conda install -c conda-forge faiss-gpu can get 1.7,4 and it works!

Great, let us know if you have any questions!

Ok finally got it to work in Google Colab on an A100 40G. For anyone curious I used StableBeluga-13B and it took around 9 minutes to get a summary of Harry Potter, which is pretty good especially since you can't even fit the full book in Claude 100k! I'm thoroughly impressed!
Here is the Code I used to get it working in Colab:
First, in order to get the latest version of Faiss you have to upgrade Python to 3.10 since it's automatically set to 3.7
 !wget https://github.com/korakot/kora/releases/download/v0.10/py310.sh
!bash ./py310.sh -b -f -p /usr/local
!python -m ipykernel install --name "py310" --user

Then you'll want to install mini-conda so that you can use install faiss using conda.
################################################################################
# INSTALL CONDA ON GOOGLE COLAB
################################################################################
! wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-x86_64.sh
! chmod +x Miniconda3-py310_23.3.1-0-Linux-x86_64.sh
! bash ./Miniconda3-py310_23.3.1-0-Linux-x86_64.sh -b -f -p /usr/local
import sys
sys.path.append('/usr/local/lib/python3.10/site-packages/')

Install using conda-forge
!conda install -c conda-forge faiss-gpu -y
Then clone the repo in colab
!git clone https://github.com/abertsch72/unlimiformer.git
Install the requirements. (In this instance some of these aren't required but I liked to have them just in case)
%pip install -r requirements.txt
%pip install -q -U bitsandbytes
%pip install -q -U git+https://github.com/huggingface/transformers.git
%pip install -q -U git+https://github.com/huggingface/peft.git
%pip install -q -U git+https://github.com/huggingface/accelerate.git
%pip install -q datasets
%pip install tensorrt

Cd into the src folder in Unlimiformer
%cd /content/unlimiformer/src
Then you should be good to run the script! Just be sure that the --index_devices and --datastore_device are set correctly. In my case I set them to 0
!python run_generation.py --model_type llama --model_name_or_path stabilityai/StableBeluga-13B \
    --prefix "### System:\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n### User:\n\n [INST] Summarize the following book: " \
    --prompt example_inputs/harry_potter_full.txt \
    --suffix " ### Assistant" --test_unlimiformer --fp16 --length 200 --layer_begin 22 \
    --index_devices 0 --datastore_device 0

This worked pretty well after I set the --layer_begin to 22 (a little over half the number of layers in the model). Here's the summary:
Harry Potter is a young boy who discovers he is a wizard, invited to attend the Hogwarts School of Witchcraft and Wizardry. He embarks on an adventure with his friends Ronald Weasley and Hermione Granger to face various challenges and enemies such as Voldemort and Lord Voldemort's supporters. Their journey involves discovering their true identities, unraveling mysteries, and learning valuable lessons about friendship, courage, and the fight against evil.</s>
Thanks again for all the hard work you and your team did @urialon I'm pretty hyped about this!

Ok finally got it to work in Google Colab on an A100 40G. For anyone curious I used StableBeluga-13B and it took around 9 minutes to get a summary of Harry Potter, which is pretty good especially since you can't even fit the full book in Claude 100k! I'm thoroughly impressed!
Here is the Code I used to get it working in Colab:
First, in order to get the latest version of Faiss you have to upgrade Python to 3.10 since it's automatically set to 3.7
 !wget https://github.com/korakot/kora/releases/download/v0.10/py310.sh
!bash ./py310.sh -b -f -p /usr/local
!python -m ipykernel install --name "py310" --user

Then you'll want to install mini-conda so that you can use install faiss using conda.
################################################################################
# INSTALL CONDA ON GOOGLE COLAB
################################################################################
! wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-x86_64.sh
! chmod +x Miniconda3-py310_23.3.1-0-Linux-x86_64.sh
! bash ./Miniconda3-py310_23.3.1-0-Linux-x86_64.sh -b -f -p /usr/local
import sys
sys.path.append('/usr/local/lib/python3.10/site-packages/')

Install using conda-forge
!conda install -c conda-forge faiss-gpu -y
Then clone the repo in colab
!git clone https://github.com/abertsch72/unlimiformer.git
Install the requirements. (In this instance some of these aren't required but I liked to have them just in case)
%pip install -r requirements.txt
%pip install -q -U bitsandbytes
%pip install -q -U git+https://github.com/huggingface/transformers.git
%pip install -q -U git+https://github.com/huggingface/peft.git
%pip install -q -U git+https://github.com/huggingface/accelerate.git
%pip install -q datasets
%pip install tensorrt

Cd into the src folder in Unlimiformer
%cd /content/unlimiformer/src
Then you should be good to run the script! Just be sure that the --index_devices and --datastore_device are set correctly. In my case I set them to 0
!python run_generation.py --model_type llama --model_name_or_path stabilityai/StableBeluga-13B \
    --prefix "### System:\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n### User:\n\n [INST] Summarize the following book: " \
    --prompt example_inputs/harry_potter_full.txt \
    --suffix " ### Assistant" --test_unlimiformer --fp16 --length 200 --layer_begin 22 \
    --index_devices 0 --datastore_device 0

This worked pretty well after I set the --layer_begin to 22 (a little over half the number of layers in the model). Here's the summary:
Harry Potter is a young boy who discovers he is a wizard, invited to attend the Hogwarts School of Witchcraft and Wizardry. He embarks on an adventure with his friends Ronald Weasley and Hermione Granger to face various challenges and enemies such as Voldemort and Lord Voldemort's supporters. Their journey involves discovering their true identities, unraveling mysteries, and learning valuable lessons about friendship, courage, and the fight against evil.</s>
Thanks again for all the hard work you and your team did @urialon I'm pretty hyped about this!

Cool! I'm using llama2-7b-chat-hf on an A100 40G too, and wondering how to solve CUDA Out of Memory error. For me, adding --use_datastore True, --gpu_datastore False and --gpu_index False can deal with inputs of around 80k tokens. After using --layer_begin 22 instead of --layer_begin 16, it can deal inputs that longer than 130k tokens!
Thanks for all of you!

awesome! I'm glad to hear!
Let us know if you have any more questions.
 Answer with detailed responses according to the entire instruction or question. \n&lt;&lt;/SYS&gt;&gt;\n\n [INST] Summarize the following book: " \
    --prompt example_inputs/harry_potter_full.txt --suffix " [/INST]" --test_unlimiformer --fp16 --length 200 --layer_begin 20 \
    --stream_output --index_devices 1 --datastore_device 1

And the output is very strange:
=== GENERATED SEQUENCE 1 (input length: 131345) ===
||| Harry Potter and the Philosopher's Stone, J.K. Rowling.

He had been famous -- Harry -- since he'd become the
magic's hero...  He was a famous wizard -- that was a pretty
strange and exciting way... they didn't
know, did they?... how
many things... they didn't
-- nor did
Dumbledore. He'd been
several days ago... an' I
acknowledge him... It was the only
thing he didn't
know... Knew about the

So Harry
That night he'd had
already... When
famagic cup -- Harry. His father's

There were -- was in
serv -- points.
You --... first
wonder --
Owl.

Full logs for llama-2-7b:
08/15/2023 22:46:30 - WARNING - __main__ - device: cuda, n_gpu: 2, 16-bits training: True
Using pad_token, but it is not set yet.
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:13<00:00,  6.70s/it]
08/15/2023 22:47:42 - INFO - __main__ - Namespace(device=device(type='cuda'), fp16=True, jit=False, k=0, length=200, model_name_or_path='meta-llama/Llama-2-7b-chat-hf', model_type='llama', n_gpu=2, no_cuda=False, num_hidden_layers=None, num_return_sequences=1, p=0.9, padding_text='', prefix='&lt;&lt;SYS&gt;&gt;\\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \\n&lt;&lt;/SYS&gt;&gt;\\n\\n [INST] Summarize the following book: ', prompt='example_inputs/harry_potter_full.txt', repetition_penalty=1.0, seed=42, stop_token=None, stream_output=True, suffix=' [/INST]', temperature=1.0, xlm_language='')
08/15/2023 22:47:43 - INFO - Unlimiformer - Encoding 0 to 4096 out of 131345
08/15/2023 22:47:47 - INFO - Unlimiformer - Encoding 2048 to 6144 out of 131345
...
...
08/15/2023 22:48:42 - INFO - Unlimiformer - Encoding 127249 to 131345 out of 131345
This is a friendly reminder - the current text generation call will exceed the model's predefined maximum length (4096). Depending on the model, you may observe exceptions, performance degradation, or nothing at all.
miniconda/envs/unlimi/lib/python3.8/site-packages/faiss/contrib/torch_utils.py:44: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  x.storage().data_ptr() + x.storage_offset() * 2)

Also, for stabilityai/StableBeluga-7B, its output is strange too, my command is:
python src/run_generation.py --model_type llama --model_name_or_path stabilityai/StableBeluga-7B \
    --prefix "### System:\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n### User:\n\n [INST] Summarize the following book: " \
    --prompt example_inputs/harry_potter_full.txt \
    --suffix " ### Assistant" --test_unlimiformer --fp16 --length 200 --layer_begin 22 --index_devices 1 --datastore_device 1

Output:
=== GENERATED SEQUENCE 1 (input length: 131310) ===
||| Professor Dumbledore ###</s>

Why this happen? Is this because 7b version is less capable than 13b version? Or there's some other reason?

Hi @kekekawaii2839 ,
I'm not sure. We do see that LLama-13B works better, but we also see a large variance when using different values of --layer_begin.

Yes, I'm sorry, that's a copy error, and I'm using the right prompt acutally.

I'm not sure. We do see that LLama-13B works better, but we also see a large variance when using different values of --layer_begin.

I've tried different values of --layer_begin, here's some example on Llama-2-7b-chat-hf:
--layer_begin 8:
  Harry, you're!

Dumbledore.</s>
=====================================================
--layer_begin 10:
Harry?

"Definitely," said
... _(I omitted the remaining part since it didn't look like a summary of the book)_
=====================================================
--layer_begin 12:
  However, you have noted that (according to the text) he was the son of a wizard and a witch, which makes him a
 member of the noble and ancient house of Potion. However,
there is little evidence that his parents are able to influence him, and his parents had been attacked and disarmy had been, the -- yes, the Ministry had --"

</s>
=====================================================
--layer_begin 14:
 Harry's father's cloak... "Yes, that's right," said Professor
McGonagall, "he's dead, you see." It was as if
Dumbledore had granted him a little bit of his own house, Gryffindor,

"I think I'll just have a nice cup of tea and then, Professor

"Not a chance," said Dumbledore, who, according to

"I don't know what you're talking about," said McGonagall.
... _(I omitted the remaining part since it didn't look like a summary of the book too)_
=====================================================
--layer_begin 16:
  However, there are no additional chapters in "Harry Potter and the Philosopher's Stone." This book ends with Chapter Seventeen, "The lasting -- "

"</s>
=====================================================
--layer_begin 18:
 Harry's parents had been dead for years, but he never forgot them. He carried a photo of them in his pocket everywhere he went, and it made him feel a bit less alone.

Harry was grateful for the help of his friends, who stood by him
even when everyone
else had given up on him. He had an owlery. It was dark, and
Dark."

"I don't know what I'd --"
... _(I omitted the remaining part since it didn't look like a summary of the book too)_
=====================================================
--layer_begin 20:
 Harry Potter and the Philosopher's Stone, J.K. Rowling.

He stood up and did a little dance, his eyes shining.
This is my birthday present," he said. "What do yeh think?

"Excellent," said Hagrid, and he sounded as though he meant it
He wouldn't mind it

"Not bad," said Hermione, "But that's only
-- opened it --"

"And I'm going ter celebrate," said Ron.  said

"Oh, let me, my dear, tuck in."

"Gryffindor!" said Hagrid, and he
--
=====================================================
--layer_begin 22:
 Harry Potter and the Philosopher's Stone, J.K. Rowling.

He'd have/ve died! Ah... Dumbledore gave him the day off fervoldemort! Hagrid, however, was spotted me
Then Harry pictured this, their wardrobes were empty, their trunks were packed... they took their notes
There was a pogramma's up, students, an' it was
"Com -- er, five minutes... I mean ter tell you, he was -- d'yeh want ter
Gryffindor. It's goin' ter be --"
"He'd have/ve died!" He'd -- exams -- he'd -- you know the end o'f course... Every Flavor Beans... his was up, so -- Dumbledore approved -- pro -- you --"

Owl.

It seems the model didn't understand the summarization instruction.
And one more question, although in the printed log I can see temperature=1.0, but the model's outputs are the same every time unless I change the --layer_begin flag. Why is that?

I suggest trying larger values as well

I suggest trying larger values as well

Thanks, I tried larger values, but unfortunately, they didn't work on 7b models :(
I think it's because 7b models can't handle very long inputs like full version of harry potter. Now I'm working on shorter inputs to see whether 7b models can handle them.
And also, @jordancole21 , can you tell me more about running 13b model on A100 40G? Every time I run 13b model using the command on 3 A100 40G:
python src/run_generation.py --model_type llama --model_name_or_path stabilityai/StableBeluga-13B \
    --prefix "### System:\nYou are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n\n### User: Summarize the following book: " \
    --prompt example_inputs/harry_potter_full.txt \
    --suffix "\n\n### Assistant:\n" --test_unlimiformer --fp16 --length 200 --layer_begin 22 \
    --index_devices 1 --datastore_device 2 --stream_output

I encounter with CUDA OOM error.

Amazing @kekekawaii2839 !
Thank you for trying it out, and feel free to continue sharing your findings.
Just for future reference, command line did you use to generate the last output? (I am curious about the exact model, exact layer_begin, and exact prompt)
Best,
Uri

Just for future reference, command line did you use to generate the last output? (I am curious about the exact model, exact layer_begin, and exact prompt)
Best, Uri

here's the command for the 80k tokens input:
python src/run_generation.py --model_type llama --model_name_or_path meta-llama/Llama-2-7b-chat-hf \
    --prefix "<<SYS>>\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n<</SYS>>\n\n [INST] Summarize the following book: " \
    --prompt example_inputs/1.txt \
    --suffix " [/INST]" --test_unlimiformer --fp16 --length 200 --layer_begin 20 \
    --index_devices 1 --datastore_device 2 --stream_output

And surprisingly, I modified the instruction a little in the prefix and using a 135k tokens input to test again. Here's the result:
=== GENERATED SEQUENCE 1 (input length: 135830) ===
||| This is a cookbook with recipes for various types of salads. The book is divided into seasons, with a chapter for each season, and each chapter contains a variety of salad recipes, each with a brief description of the dish and an explanation of how to prepare it. Each recipe is accompanied by notes and suggestions for complementary dishes, and wine or beer pairings.

* Winter: Three-Alarm Salad, Galette of Greens and Goat cheese, with Braised Mushrooms and Mustard, Bitter greens, carrot and Pickled Zucchini.
* Spring: Sautéed Chicken, Kitchen Garden Greens, Chèvre, and Chive. Spring Onion Tarts, Toppings, 45
* Summer: Zucchettis, Cauliflower, Ratatelli, Chiveroli, and Chilled, and Lemon Dress.

Hello,
I got this error message while trying to run the prompt in the README file
python src/run_generation.py --model_type llama --model_name_or_path meta-llama/Llama-2-7b-chat-hf     --prefix "### System:\n You are a helpful assistant. Answer with detailed responses according to the entire instruction or question. \n### User:\n\n [INST] Summarize the following book: "     --prompt example_inputs/harry_potter_full.txt     --suffix " ### Assistant" --test_unlimiformer --fp16 --length 200 --layer_begin 22     --index_devices 0 --datastore_device 0

File "python3.9/site-packages/transformers/models/llama/modeling_llama.py", line 402, in forward
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
AttributeError: 'list' object has no attribute 'get_usable_length'


Don’t use XCTAssertEqual for NSIndexPath equivalence.

While we decide the best way to assert for object equivalence over at https://github.com/spotify/HubFramework/pull/259, we should fix the cases that are causing tests to fail on 32-bit systems (i.e. the NSIndexPath case).

@spotify/objc-dev

Current coverage is 93.48% (diff: 100%)

Merging #268 into master will increase coverage by 0.05%

@@             master       #268   diff @@
==========================================
  Files            72         72
  Lines          5019       5019
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits           4689       4692     +3
+ Misses          330        327     -3
  Partials          0          0

Powered by Codecov. Last update c707533...a7e1144

👍


Dates in some posts fail

There are some posts that the date fails in them.

Problem was due to the symbol & inside file names.


multimap.rebuild implemented on eo

https://github.com/objectionary/eo-collections/issues/15

@Graur @levBagryansky please have a look

@Graur @levBagryansky please have a look

@levBagryansky please have a look again

@rultor merge

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here


near-contract-standards/non-fungible-token: NEAR values instead of yoctoNEAR are returned in a storage management error message

Package version: near-contract-standards = "5.0.0"
Steps to reproduce:

Implement standard NFT contract from near-contract-standards, e.g. example from this repo - https://github.com/near/near-sdk-rs/tree/near-sdk-v5.0.0/examples/non-fungible-token.
Call method that requires attached storage with not enough deposit, e.g. nft_approve.

Actual result: Smart contract panicked: Must attach <0.001 NEAR yoctoNEAR to cover storage
Expected result: Message with proper amount of yoctoNEAR is returned.
Additional info:
This happens because panic message uses NearToken, which is formatted as NEAR amount - https://github.com/near/near-sdk-rs/blob/near-sdk-v5.0.0/near-contract-standards/src/non_fungible_token/utils.rs#L36.

@yandrushchak Good catch!
Let's extract the exact-display implementation from near-cli-rs into NearToken::exact_amount_display(&self) method in https://github.com/near/near-token-rs and use it here as:
format!("Must attach {} yoctoNEAR to cover storage", required_cost.exact_amount_display())

Would you have time to contribute the fix? I am happy to help you

Is the method "NearToken::exact_amount_display(&self)" the same as the Display implementation shown in src/trait_impls/display.rs? I'm having trouble localizing that specific method in near-token-rs

@nicosanc The point is to copy/move the implementation from https://github.com/near/near-cli-rs/blob/7fca81bb5544b40743290d3a951c1f1ff31a95d9/src/types/near_token.rs#L18-L35 to https://github.com/near/near-token-rs, and then use it here:
https://github.com/near/near-sdk-rs/blob/9bb16c2d08d522baf52ddd126e3fe0f01386f2ca/near-contract-standards/src/non_fungible_token/utils.rs#L36

I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
Hey! I'm Lau Chaves, and I would like to contribute to this issue!
I have over 5 years of experience working with JavaScript, React, TypeScript, ruby... I’m excited to dive deeper into smart contracts, and this looks like a fantastic chance to learn a bit more!
How I plan on tackling this issue
Based on the intrucstions mentioned on the comments above and the issue itself,  Here’s how I would approach the problem:

Extract Code: Obtain the exact_amount_display method from near-cli-rsand add it to the NearToken struct in near-token-rs.
Update Panic Message: Modify the panic message in the non_fungible_token contract to use:
format!("Must attach {} to cover storage", required_cost.exact_amount_display())
Test: Ensure that the updated message now correctly shows the required amount in yoctoNEAR.

@TropicalDog17 I think this is too simple for Rust devs, and given that you already have another issue assigned to, I decided to give @lauchaves a chance here.
@lauchaves Please, go ahead!

@frol awesome, thank you! I'll get started on it right away.

Hey @frol would you mind taking a look at this near-token pull request ?


Build: Pin conventional-changelog to 1.1.12

This issue has been fixed by the conventional-changelog team 👍


Allow for splitting test executables

This borrows the strategy (and source lists) from the DOS Make build to split tests into smaller executables. This is prep for translating a 16-bit DOS build with CMake, but is also valuable for running tests on other small devices.

Coverage: 99.323%. Remained the same when pulling 38c249c3913ee3e856f12ebc57880061d29d2fc1 on thetic:dos16 into 75057c40474beaf068e73accdb0b7b7411ec2536 on cpputest:master.


_.python.venv does not correctly prepend the venv path if a virtualenv is active (fish shell)

Describe the bug
When one already has a virtualenv active, a .mise.toml file with a _.python.venv directive will add the commanded venv to PATH but always after the already active one. For example if I have a $PATH like
/Users/gallegoj/.local/share/virtualenv/gallegoj/bin /Users/gallegoj/.cargo/bin /usr/local/bin /Users/gallegoj/.local/bin /usr/bin /bin

where /Users/gallegoj/.local/share/virtualenv/gallegoj/bin is an activated environment, and cd to a directory with a .mise.toml
[env]
_.python.venv = ".venv"

the resulting $PATH will be
/Users/gallegoj/.local/share/virtualenv/gallegoj/bin /Users/gallegoj/Documents/Code/sdss5/sdss-sep/.venv/bin /Users/gallegoj/.cargo/bin /usr/local/bin /Users/gallegoj/.local/bin /usr/bin /bin

instead of the expected
/Users/gallegoj/Documents/Code/sdss5/sdss-sep/.venv/bin /Users/gallegoj/.local/share/virtualenv/gallegoj/bin /Users/gallegoj/.cargo/bin /usr/local/bin /Users/gallegoj/.local/bin /usr/bin /bin

I've only tested this in fish.
mise doctor output
version: 2024.10.1 macos-x64 (7184e60 2024-10-07)
activated: yes
shims_on_path: no

build_info:
  Target: x86_64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 7 Oct 2024 19:08:40 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell:
  /usr/local/bin/fish
  fish, version 3.7.1-2332-g4c43819d3

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/Documents/Code/sdss5/sdss-sep/.python-version
  ~/Documents/Code/sdss5/sdss-sep/.mise.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:

toolset:
  python@sdss-sep  (missing)

env_vars:
  MISE_SHELL=fish

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cache_prune_age = "30d"
  cargo_binstall = true
  ci = false
  color = true
  debug = false
  disable_default_shorthands = false
  disable_hints = []
  disable_tools = []
  experimental = false
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  pin = false
  pipx_uvx = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  python_venv_auto_create = false
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  vfox = false
  yes = false

  [node]

  [ruby]
  default_packages_file = "~/.default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false
No warnings found
No problems found

Seconding this issue:
Paul_Glushak@Paul ~> pwd
/Users/Paul_Glushak
Paul_Glushak@Paul ~> echo $PATH | sed 's/ /\n/g'
/Users/Paul_Glushak/dev/forter-dev-cli/.venv/bin
/Users/Paul_Glushak/.local/share/mise/installs/pipx/latest/bin
/Users/Paul_Glushak/.local/share/mise/installs/python/latest/bin
/Users/Paul_Glushak/.local/share/mise/installs/poetry/latest/bin
/Users/Paul_Glushak/.local/share/mise/installs/usage/latest/bin
/Users/Paul_Glushak/.local/bin
/opt/homebrew/bin
...

Then cd somewhere else
Paul_Glushak@Paul ~> z boku
Paul_Glushak@Paul ~/d/boku (main)> cat .mise.toml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: .mise.toml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [tools]
   2   │ python = "latest"
   3   │
   4   │ [env]
   5   │ _.python.venv = { path = ".venv", create = true }
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Paul_Glushak@Paul ~/d/boku (main)> echo $PATH | sed 's/ /\n/g'
/Users/Paul_Glushak/dev/forter-dev-cli/.venv/bin
/Users/Paul_Glushak/dev/boku/.venv/bin
/Users/Paul_Glushak/.local/share/mise/installs/python/latest/bin
/Users/Paul_Glushak/.local/share/mise/installs/pipx/latest/bin
/Users/Paul_Glushak/.local/share/mise/installs/poetry/latest/bin
/Users/Paul_Glushak/.local/share/mise/installs/usage/latest/bin
/Users/Paul_Glushak/.local/bin
/opt/homebrew/bin
...
Paul_Glushak@Paul ~/d/boku (main)>

It looks like the incorrect path value exists in both $PATH as well as $MISE_SHELL:
MISE_SHELL=fish set -gx __MISE_ORIG_PATH /Users/Paul_Glushak/dev/forter-dev-cli/.venv/bin /Users/Paul_Glushak/.local/share/mise/installs/pipx/latest/bin ...

this is by design, mise doesn't modify PATH to override things after it was activated to prevent it from aggressively modifying PATH. The activate_aggressive setting modifies this behavior.

@jdx am I understanding correctly that the aggressive setting will prepend the new path, while the default should overwrite the old one? If so, the issue is that it’s not being overwritten.
Perhaps I misunderstood?

@jdx Hello :wave: Up?
From your point of view, how are we supposed to use the venv directory correctly in this case? Because by default a venv directory is created but never used :confused:

Hello :wave: @syhol
Thanks for your reply, concerning this point:

If /Users/Paul_Glushak/dev/forter-dev-cli/.venv or /Users/gallegoj/.local/share/virtualenv/gallegoj/bin is not managed by mise, then I would say its not mise's responsibility to deactivate them. Is there a precedent for this behaviour with any other tool? I don't mean to be dismissive, I'm just curious where your expectations come from.

If we use _.python.venv = ".venv" mise is supposed to be responsible of this virtual environment no? If no, what is the best way to managed it? If yes why is it not used by default without using activate_aggressive=true?

I don't think I understand this use-case. It sounds like you've activated a venv after mise, then are wanting mise to override that venv. Why activate the other one at all? I would just use mise for both of them.
mise is careful not to make modifications to PATH that overwrite changes after it was started. Otherwise it would be impossible to do something like export PATH="somenewpath:$PATH" because mise would just stomp on top of it. As far as mise is concerned, venv is just modifying env vars like PATH so it's not special. This is the behavior that activate_aggressive disables.

mise is actually activating the environment, check echo $VIRTUAL_ENV in this situation and you should see the correct directory. jdx explains why the path is not matching your expectation.
However, to your credit, I checked what happens when you have 2 venvs (both not managed by mise) and activate them one after the other. The second activation did remove the path from the first.

uv's venv clobbering old venv paths
# Code/sandbox/unmanaged-venv
❯ uv venv .venv
Using Python 3.13.0 interpreter at<EMAIL_ADDRESS>Creating virtualenv at: .venv
Activate with: source .venv/bin/activate.fish

# Code/sandbox/unmanaged-venv
❯ source .venv/bin/activate.fish

# Code/sandbox/unmanaged-venv via 🐍 v3.13.0 (unmanaged-venv)
❯ echo $PATH | sed 's/ /\n/g'
/Users/simon/Code/sandbox/unmanaged-venv/.venv/bin
/Users/simon/.local/share/mise/installs/node/21.4.0/bin
...

# ~/Code/sandbox/unmanaged-venv via 🐍 v3.13.0 (unmanaged-venv)
❯ mkdir ../unmanaged-venv-2

# ~/Code/sandbox/unmanaged-venv via 🐍 v3.13.0 (unmanaged-venv)
❯ cd ../unmanaged-venv-2/

# Code/sandbox/unmanaged-venv-2 via 🐍 v3.13.0 (unmanaged-venv)
❯ uv venv .venv
Using Python 3.13.0 interpreter at<EMAIL_ADDRESS>Creating virtualenv at: .venv
Activate with: source .venv/bin/activate.fish

# Code/sandbox/unmanaged-venv-2 via 🐍 v3.13.0 (unmanaged-venv)
❯ source .venv/bin/activate.fish

# Code/sandbox/unmanaged-venv-2 via 🐍 v3.13.0 (unmanaged-venv-2)
❯ echo $PATH | sed 's/ /\n/g'
/Users/syhol/Code/sandbox/unmanaged-venv-2/.venv/bin
/Users/syhol/.local/share/mise/installs/node/21.4.0/bin
...

@jdx would you be open to matching this behaviour? If you check to see what .venv/bin/activate.fish does, it calls the deactivate function before activating the new venv. The deactivate function uses a env var called $_OLD_VIRTUAL_PATH to reset the PATH:

venv deactivate fish function (runs on activate to clear out the old venv)

Here is the source of the virtualenv version https://github.com/pypa/virtualenv/blob/main/src/virtualenv/activation/fish/activate.fish
and a very similar source for uv:
https://github.com/astral-sh/uv/blob/main/crates/uv-virtualenv/src/activator/activate.fish
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
    # reset old environment variables
    if test -n "$_OLD_VIRTUAL_PATH"
        # https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling
        if test (echo $FISH_VERSION | head -c 1) -lt 3
            set -gx PATH (_fishify_path "$_OLD_VIRTUAL_PATH")
        else
            set -gx PATH $_OLD_VIRTUAL_PATH
        end
        set -e _OLD_VIRTUAL_PATH
    end

    if test -n "$_OLD_VIRTUAL_PYTHONHOME"
        set -gx PYTHONHOME "$_OLD_VIRTUAL_PYTHONHOME"
        set -e _OLD_VIRTUAL_PYTHONHOME
    end

    if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
       and functions -q _old_fish_prompt
        # Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functi
ons -e`.
        set -l fish_function_path

        # Erase virtualenv's `fish_prompt` and restore the original.
        functions -e fish_prompt
        functions -c _old_fish_prompt fish_prompt
        functions -e _old_fish_prompt
        set -e _OLD_FISH_PROMPT_OVERRIDE
    end

    set -e VIRTUAL_ENV
    set -e VIRTUAL_ENV_PROMPT

    if test "$argv[1]" != 'nondestructive'
        # Self-destruct!
        functions -e pydoc
        functions -e deactivate
        functions -e _bashify_path
        functions -e _fishify_path
    end
end

I can't see this behaviour in any formal spec but that does seem to be the practical standard for venv activation. Also it is what many (at least 3) people expect to happen. What do you think?

I would be, though I don't think we have any mechanism for removing entries from PATH. I don't think that would be simple to achieve.

what would probably need to be done is to have a special env var sort of like how we use MISE_ADD_PATH called MISE_RM_PATH that the plugin gets from here:
https://github.com/jdx/mise/blob/7ba9eab4d069f430c022f97237564d33ee1e27f5/src/plugins/core/python.rs#L425
however we wouldn't be able to use that in the same place MISE_ADD_PATH is consumed I don't think. This logic might need to go into hook-env directly to make the removal there. That might be tricky since the logic does a lot of dancing around undoing what mise did. What we might do here is just remove it forever since we won't ever need it again.
That only would solve mise activate though. For shims and mise x I think this code would need to perform the removal:
pub fn env_with_path(&self, config: &Config) -> Result<BTreeMap<String, String>> {

Are you suggesting you set the old ${VIRTUAL_ENV}/bin to MISE_RM_PATH? It's a bit different from what venv does but it should be a fine solution. Alternatively, could you call get_pristine_env while overriding PATH with _OLD_VIRTUAL_PATH? I'm not sure how that would work with ToolSet.env though.
Re: shims and mise x - Since env_with_path adds the paths to the start, the new venv path would take precedence anyway. Removing the old venv path would just avoid exposing any extra executables.

just remove it forever since we won't ever need it again

yeah that should be fine.

Mise activation to mise activation
When mise manages both venvs, I can't recreate this issue at all.

Click here to see how I tried to recreate your issue in a docker container
~/Code/sandbox
❯ docker run --pull=always -it --rm --entrypoint bash jdxcode/mise:latest
latest: Pulling from jdxcode/mise
82312fccb35f: Already exists
4ac722d9cf93: Already exists
261351ed796d: Already exists
a9d319298afc: Already exists
bfd886f8ab4a: Already exists
f41ffa9688c1: Pull complete
aba5a536d181: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:eecc479b6259479ffca5a4f9c68dbfe8631ca62dc59aa60c9ab5e4f6e9982701
Status: Downloaded newer image for jdxcode/mise:latest
root@4ea8237586b4:/mise# eval "$(mise activate bash)"
root@4ea8237586b4:/mise# mkdir -p /srv/proj1 /srv/proj2
root@4ea8237586b4:/mise# echo '[tools]
python = "latest"

[env]
_.python.venv = { path = ".venv", create = true }
'>/srv/proj1/mise.toml
root@4ea8237586b4:/mise# echo "[tools]
poetry = {version='latest', pyproject='pyproject.toml'}
python = '3.10'

[env]
_.python.venv = { path = '.venv', create = true }
">/srv/proj2/mise.toml
root@4ea8237586b4:/mise# mise trust /srv/proj1; mise trust /srv/proj2
mise trusted /srv/proj1
mise trusted /srv/proj2
root@4ea8237586b4:/mise# cd /srv/proj1
mise creating venv with stdlib at: /srv/proj1/.venv
root@4ea8237586b4:/srv/proj1# cd /srv/proj2
mise WARN  no venv found at: /srv/proj2/.venv

To create a virtualenv manually, run:
python -m venv /srv/proj2/.venv
mise WARN  missing<EMAIL_ADDRESS>mise WARN  no venv found at: /srv/proj2/.venv

To create a virtualenv manually, run:
python -m venv /srv/proj2/.venv
root@4ea8237586b4:/srv/proj2# mise install
mise hint use multiple versions simultaneously with mise use<EMAIL_ADDRESS><EMAIL_ADDRESS>mise hint installing precompiled python from indygreg/python-build-standalone
if you experience issues with this python (e.g.: running poetry), switch to python-build by running mise settings python.compile=1
mise WARN  no venv found at: /srv/proj2/.venv

To create a virtualenv manually, run:
python -m venv /srv/proj2/.venv
mise<EMAIL_ADDRESS>✓ installed                                                                                mise plugin:poetry ✓ https://github.com/mise-plugins/mise-poetry.git#c285853                                                                                mise<EMAIL_ADDRESS>✓ installed                                                                                mise creating venv with stdlib at: /srv/proj2/.venv
mise-poetry: No pyproject.toml found. Execute `poetry init` to create `/srv/proj2/pyproject.toml` first.
root@4ea8237586b4:/srv/proj2# python --version
Python 3.10.16
root@4ea8237586b4:/srv/proj2# cd ../proj1
root@4ea8237586b4:/srv/proj1# python --version
Python 3.13.1
root@4ea8237586b4:/srv/proj1# cd ../proj2
root@4ea8237586b4:/srv/proj2# python --version
Python 3.10.16

Can you help me reproduce your issue here?
Manual activation to mise activation
I think this (https://github.com/jdx/mise/issues/2718#issuecomment-2486132494) needs to be implemented to fix this.
But also, come on people, why are you still manually activating your venvs? 😂

when I test this it works fine if using aggressive which seems like exactly what it should be used for

@syhol I don't manually activate any venvs, this is mise that manage 2 venvs in my case.


Add account level metrics for container metrics

Summary
Add account level metric to aggregate its containers' metrics.
Details
Some accounts have lots of containers and it's very hard those those accounts to aggregate all the metrics for 40x, 50x and latency etc. This PR adds an AccountMetrics class and have its ContainerMetrics to record metrics for AccountMetrics.
This PR also adds a configuration to only enable some accounts to have this AccountMetrics as most accounts have very small set of containers that they just don't need extra metrics.
Test
Unit test

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

Project coverage is 15.93%. Comparing base (52ba813) to head (c9082a1).
Report is 125 commits behind head on master.

Files with missing lines
Patch %
Lines

.../github/ambry/frontend/EntityOperationMetrics.java
0.00%
39 Missing :warning:

...github/ambry/frontend/RestRequestMetricsGroup.java
0.00%
6 Missing :warning:

...va/com/github/ambry/frontend/ContainerMetrics.java
0.00%
5 Missing :warning:

...ub/ambry/frontend/AccountAndContainerInjector.java
0.00%
3 Missing :warning:

...n/java/com/github/ambry/config/FrontendConfig.java
0.00%
2 Missing :warning:

...java/com/github/ambry/frontend/AccountMetrics.java
0.00%
2 Missing :warning:

:exclamation:  There is a different number of reports uploaded between BASE (52ba813) and HEAD (c9082a1). Click for more details.
HEAD has 2 uploads less than BASE

Flag
BASE (52ba813)
HEAD (c9082a1)

3
1

Additional details and impacted files
@@              Coverage Diff              @@
##             master    #2926       +/-   ##
=============================================
- Coverage     64.24%   15.93%   -48.31%
+ Complexity    10398     3044     -7354
=============================================
  Files           840      866       +26
  Lines         71755    73683     +1928
  Branches       8611     8869      +258
=============================================
- Hits          46099    11742    -34357
- Misses        23004    61094    +38090
+ Partials       2652      847     -1805

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


branch: noobLuck

noobLuck

this branch took long time before getting published to the platform.
more than 10 commits made, i am happy with what i have whipped up in a matter of few hours.
still to progress on the actual landing page, think of this one as a 'preloader'

seems fair enough, i advocate for the continuation of the next phase: the landing page.
liked the type effect on the bottom text as the page refreshes.


Slide appears in bottom right corner

Describe the bug
Slides appear in the bottom right corner after a refresh. If I click either of the scale options, they are back where they belong. I can also fix by clearing localstorage. With either fix, the issue re-appears after a couple of refreshes.
To Reproduce
Steps to reproduce the behavior:

npm init slidev@latest, install and start now, npm. Browser will open to localhost:3030 automatically.
Refresh the page. Observe that the slides are now in the bottom right corner.

video demo: https://user-images.githubusercontent.com/2491257/119438940-241f8200-bcd6-11eb-8e4b-49fa599a6e31.mp4
Desktop (please complete the following information):

OS: MacOS Mojave 10.14.6
Browser: Chrome Version 90.0.4430.93 (Official Build) (x86_64)
Slidev version: v0.13.10

I've also notices this, working on a fix.


Added work and about me sections to index.html

Added work and about me sections to index.html which used grid and flexbox | aligned about me section with flexbox | used  for categories in about myself and Work sections | Added necessary image files

Used  for project card headers and 'LET'S CONNECT' and wrapped project technologies in list


Change the vector elision from none to selection

The default VECTOR_COPY_ELISION_LEVEL is selection, so test that instead of none.

@pateljm How about trying with all the four options to see the time to take, and then go with there?

GCC with VECTOR_COPY_ELISION_LEVEL=Selection failed in both debug and release modes. It's the same internal compiler error.
Does the number of concurrently running jobs affect the amount of memory available to each? If so, we should definitely not bump up the number of build types.

No, the total memory would be the same. gcc maybe just do not spend memory resource wisely.

@pateljm I think you should set MAKE_JOBS to 1 for Selection as well.

Good suggestion @navsan! Trying it now. Sad that gcc is fragile can can't deal with a parallel make.

@pateljm Before merging this PR, we need to rebase w/ master to get rid of previous merged commits.

@pateljm You might want to try add back the else case of MAKE_JOBS=2 for clang.

Creating a new PR tied to JIRA.


Fix: issue #300

Replace unwrapping the various ouputs with using the Result types

Sorry for the late reply! Is there something wrong with the pull request? Could you please reopen it?

Oh, sorry. Now I see that there is another pull request (https://github.com/stanislav-tkach/os_info/pull/303).

Oh, sorry. Now I see that there is another pull request (https://github.com/stanislav-tkach/os_info/pull/303).

It's alright. Does the code in the PR look like what you had in mind?

Oh yea, I opened this PR then realized I was working off an old branch, so I closed it, updated my local copies with main and put the fixes in a new branch leading to PR #303.


[PackageLoading] Use a simpler manifest cache

This switches the manifest cache approach used inside manifest loader to
directly use sqlite database instead of going through llbuild. The main
reason for this switch is to simplify caching behavior and take
advantage of SQLite's WAL mode for concurrent access. A separate PR will
make the manifest cache global for the user.

@swift-ci smoke test

Thanks for this simplification — I think it's great to reduce the complexity here!  I don't see any aging of entries from the database, though — what's the strategy for preventing unbounded growth?

I am considering cache eviction orthogonal since we don’t have that today either but it should be easy to do something since we now have full control over the cache.

@swift-ci smoke test self hosted

@swift-ci smoke test self hosted

@swift-ci smoke test

@swift-ci smoke test