[web] TextFormField implicit contentPadding too big

Since the last SDK updates on master, TextFormFields include now an implicit contentPadding that is too big and also cannot be removed.
Minimal code reproduction:
TextFormField(
      maxLines: 1,
      validator: (text) {},
      onSaved: (text) {},
      onFieldSubmitted: (text) {},
      decoration: InputDecoration(
        contentPadding: EdgeInsets.all(0.0),
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(5.0),
          borderSide: BorderSide(color: Color(0xFFCED4DA), width: 0.5),
        ),
        hintText: 'ID',
        textStyle: TextStyle(
          fontWeight: FontWeight.w400
        ),
      ),
    )

As you can see, i added a contentPadding of 0.
This results in the following:

The TextFormField gets an implicit vertical padding that cannot be removed.

My flutter doctor -v output:
ja2375$ flutter doctor -v
[✓] Flutter (Channel master, v1.10.16-pre.67, on Mac OS X 10.14.6 18G103, locale es-ES)
    • Flutter version 1.10.16-pre.67 at /Users/ja2375/flutter
    • Framework revision e3742b6e41 (7 hours ago), 2019-11-06 23:13:17 -0500
    • Engine revision c448d39d53
    • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /Users/ja2375/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2, Build version 11B52
    • CocoaPods version 1.8.4

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 41.0.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.6.0

[✓] Connected device (4 available)
    • GM1913     • 0b6ce577   • android-arm64  • Android 10 (API 29)
    • macOS      • macOS      • darwin-x64     • Mac OS X 10.14.6 18G103
    • Chrome     • chrome     • web-javascript • Google Chrome 78.0.3904.87
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

Following changes to TextFormField are the cause.
https://github.com/flutter/flutter/issues/44726
Recently isDense property was added to class InputDecoration. Setting it to true along with contentPadding, resolves the issue.
Whether it should be included in collapsed by default is a separate discussion.

That solved the issue. Many thanks!

Hi!
I am experiencing this issue again. But this time the isDense + contentPadding como is not working.
I am trying to use this plugin, which is just a wrapper for the TextFormField class (that's why i'm reporting this here and not in the plugin's repo).
When i create a SimpleAutocompleteFormField<String>() (of course adding isDense & contentPadding to the decoration param), i get the same issue i described here back in november.
This is the code i used:
SimpleAutocompleteFormField<String>(
                controller: _provi,
                decoration: InputDecoration(
                  contentPadding: EdgeInsets.all(10.0),
                  isDense: true,
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(5.0),
                    borderSide: BorderSide(color: Color(0xFFCED4DA), width: 0.5),
                  ),
                  focusedBorder: OutlineInputBorder(
                    borderSide: BorderSide(
                      color: Colors.orange,
                    ),
                    borderRadius: BorderRadius.all(Radius.circular(4.0)),
                  ),
                  focusColor: Colors.orange,
                  counterText: '',
                  labelText: 'Provincia española',
                  labelStyle: TextStyle(
                    color: MediaQuery.of(context).platformBrightness == Brightness.light ? Colors.black54 : Colors.white70,
                  ),
                ),
                itemBuilder: (context, item) => Padding(padding: EdgeInsets.all(8.0), child: Text(item)),
                suggestionsHeight: 100.0,
                onSearch: (query) async => _provincias.where((item) => removeDiacritics(item.toLowerCase()).startsWith(removeDiacritics(query.toLowerCase()))).toList(),
              )

This code works fine. It's just the issue described here when compiled for the web.
My doctor output:
[✓] Flutter (Channel dev, 1.18.0-13.0.pre, on Mac OS X 10.15.4 19E287, locale es-ES)
    • Flutter version 1.18.0-13.0.pre at /Users/ja2375/flutter
    • Framework revision 8fbfe1cfbf (2 days ago), 2020-05-06 17:36:01 -0700
    • Engine revision d6aa099de7
    • Dart version 2.9.0 (build 2.9.0-5.0.dev 4da5b40fb6)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /Users/ja2375/Library/Android/sdk
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.8.4

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.0

[✓] Connected device (3 available)
    • macOS      • macOS      • darwin-x64     • Mac OS X 10.15.4 19E287
    • Web Server • web-server • web-javascript • Flutter Tools
    • Chrome     • chrome     • web-javascript • Google Chrome 81.0.4044.138

• No issues found!

Sorry for this. The issue is caused by the resetIcon that the plugins adds automatically.
I didn't notice that it is added by default.
Apologies.


Cannot use 256 colors in donuts widget.

As far as I can tell, you can only use 8 colors when drawing with drawille.
I can try and contribute to the repo so it supports 256 colors, but I cannot find the github repo for drawille-canvas-blessed-contrib.
If you tell me I can have a look and get more colors out of the canvas.
Cheers.

it was in bitbucket so I have moved it here:
https://github.com/yaronn/drawille-canvas-blessed-contrib
would be amazing if you can get more colors in!

I'll give it a try tomorrow.

Had a very quick look at it seems I that the package controlling the color output is "ansi-term".
I'm trying to get it to work with https://github.com/jbnicolai/ansi-256-colors
Still not sure how to adapt the widgets to this new color system.
Either we enumerate the already known colors and support more advanced colors, or switch the color input options to accept ansi-256-colors codes and rgb values.
cheers.

looks good! we need to have backward compatibility for existing users so it seems best to enumerate the known colors.

Okay. I almost have it.
I'm trying to get 256 colors support everywhere.
For that I need to do some changes to the ansi-term package.
You think you could move it from bitbucket also to githhub?
Cheers.

Sure: https://github.com/yaronn/ansi-term

Finished.
I didn't do extensive testing. I just ran the example dashboard and it all seemed okay.

There seems to be something wrong with the line chart labels.
The color seems correct, but the label will not show correctly.
Will look into it.

Fixed it! You can pull changes.

Some examples of the dashboard with 256 colors

This is so cool! I've merged this and also added your name to the readme, let me know if you want to link your name to some place.
do you think you can add something very short in the readme about this feature?
also wrt dashboard.js, it is impressive to add it random color capability, but I think the original palette is a good first impression for people trying blessed-contrib (random colors result can vary). Maybe we should revert it to use the fixed colors and add custom-color.js as a dedicated sample for this feature. What do you think?

Sure. The random color was just me trying the feature out, I agree that the original palette is good.
I'll write something for the Readme later tonight.

I added a short description to the readme.
On Sun, Feb 28, 2016 at 9:17 AM, Miguel Valadas<EMAIL_ADDRESS>wrote:

Sure. The random color was just me trying the feature out, I agree that
the original palette is good.
I'll write something for the Readme later tonight.
—
Reply to this email directly or view it on GitHub
https://github.com/yaronn/blessed-contrib/issues/79#issuecomment-189809719
.

--
I'm on Twitter (@YaronNaveh http://twitter.com/#!/YaronNaveh)

Thank you. I had completely forgotten that I had to do it, sorry about that.
I'm closing the issue.

no problem, great work on adding this capability.


Fix tests with assertions or setup mistakenly using wall clock

Came up in https://travis-ci.org/studentinsights/studentinsights/jobs/572807904 from the new school year.

selfie


refactor(firestore): add paging 3 in non-breaking way

DO NOT MERGE
This PR should serve as a draft to implement Paging 3 in our Firestore module. Paging 3 is currently in beta, so we'll need to wait and only merge this PR once it hits the stable channel. I've opened this to discuss those changes and gather feedback from the community. Once approved I can replicate the changes on the RTDB module.
TL;DR: Paging3 is backward-compatible with Paging2. This isn't a breaking change. ~The only change required from FirebaseUI users is to update to Java 8.~
About Paging 3
Paging 3 is a complete Kotlin rewrite of the Paging 2 Library, previously written in Java. It is fully compatible with Paging 2, that's why updating to paging 3 shouldn't break existing code and the migration process can be done in parts (since classes from paging3 are compatible with paging2 and vice-versa).
Java 8 and RxJava
Update: I've removed the RxJava and consequently Java 8 from this PR. So developers will no longer need to update to Java 8.
~Although Paging 3 was written in Kotlin, we can still use it in Java through either RxJava or Guava. However, both libraries require us to update to Java 8, so I had no choice but to add it to our gradle's compileOptions, making Java 8 our library's min required version. This shouldn't be a concern considering that creating a new project in most recent versions of Android Studio brings Java 8 enabled by default.~
~(Maybe someday we'll be able to migrate FirebaseUI to Kotlin)~
~My library of choice was RxJava due to its larger popularity over Guava. The paging library offers RxJava3 and their own RxJava-compatible classes (eg. RxPagingSource) through the androidx.paging:paging-rxjava3:3.0.0 package. Although we're using RxJava internally (and actually exposing the RxJava APIs too), users of FirebaseUI are not expected to have any previous knowledge on the subject since they don't necessarily need to use or interact with those APIs.~
Deprecated classes and methods
Only listing code used by FirebaseUI. The Paging 3 library might have more deprecations that are not relevant to our library, therefore not mentioned here.
From the Paging Library

Deprecated
Replacement

PagedList.Config
PagingConfig

PagedListAdapter
PagingDataAdapter

PageKeyedDataSource
PagingSource

PagedList<T>
PagingData<T>

From FirebaseUI

Deprecated
Replacement

FirestorePagingOptions.setQuery(Query, PagedList.Config, ...)
FirestorePagingOptions.setQuery(Query, PagingConfig, ...)

FirestorePagingOptions.setData(LiveData<PagedList<DocumentSnapshot>>)
FirestorePagingOptions.setPagingData(LiveData<PagingData<DocumentSnapshot>>)

FirestorePagingAdapter
FirestorePagingDataAdapter

~Additionally, I've removed the class FirestoreDataSource (which extended from the deprecated PageKeyedDataSource) and added a new FirestorePagingSource class that extends from RxPagingSource.~
Tests
Update: Tests remain unchanged.

~FirestoreDataSourceTest was renamed to FirestorePagingSourceTest.~
~Tests were updated to use the new FirestorePagingSource.~
~the testLoadAfter_retry() test was removed because the method retry() is not present in the new FirestorePagingSource. (this might sound like it breaks functionality, but developers can still retry their failed loads by calling retry() on their recyclerview adapter)~

TODO

[ ] Test these changes in a Kotlin app
[ ] Update firestore/README.md

@rosariopfernandes wow thank you for putting this together and laying out the case so cleanly.  I absolutely hate the way that the Android team has handled Java 8.  In my view there are very few Java 8 Android devs because you're either stuck on Java 7 or you're ready for Kotlin.
You make a good case for this! It's good to know that new projects support this by default. It's a bit awkward that the official Firebase Android SDK does not require Java 8 and FirebaseUI would.
The main reason I am hesitant is because the paging adapter is a relatively niche feature of this library, so doing a big breaking change for paging users may inconvenience many others.  After all the majority of usage of this library, especially in real apps, is for AuthUI.  And then for users that do use the database adapters, paging is only a subset of them.
What do you think?  You're more tuned in to the Android community than I am! Do a lot of non-Kotlin libraries require Java 8 these days?

@samtstern Thanks for outlining all the implications of Java 8, you raise some good points.

Q: Do a lot of non-Kotlin libraries require Java 8 these days?

A: TBH I don't know. I generally use Java 8 on my projects so I rarely check the library's min java version.
So from my point of view the only component requiring us to update to Java 8 is the new PagingSource so maybe we could keep the deprecated PageKeyedDataSource but update everything else. This means users of the FirebaseUI + Paging3 combination won't need to update to Java 8 and won't see many (or any at all) deprecation warnings on their IDE/builds.
I'll update this PR to give it a shot.

@samtstern So the plan I described in the previous comment actually worked! 🥳 The firestore module is now ready for Paging 3 and developers don't need to update to Java 8 🙂

@rosariopfernandes sorry for my slow response here!  Been a little busy but will take a look at this a soon as I can. Very impressed that you managed to work it out.

@samtstern Thanks for taking a look at this! Yes, a breaking change from Paging2 to Paging3 in 8.0.0 sounds fine, since we don't yet have a release date for a stable version of Paging 3.
Before I address your comments on addLoadStateListener: Since we're making a breaking change, what if we remove the onLoadingStateChanged and onError methods from our adapter? The only reason why I kept them and used AddLoadStateListener was because I was trying to keep supporting Paging 2, which doesn't provide an easy way to check for loading state and/or errors.
Paging 3 on the other hand exposes a loadStateFlow property in the new PagingDataAdapter which is a Flow that allows Kotlin developers to check the loading state directly (the alternative for Java developers is addLoadStateListener). And the Paging 3 documentation does explain how to use it, so it should be fine if we let developers handle load states themselves, right?

@rosariopfernandes that all sounds great, if we can put this in 8.0 then you can do a true breaking change and use more of the Paging 3 API as it was meant to be used. I think everyone wins there!

@samtstern Paging 3.0.0 is now stable! :tada:
This PR is ready for review. :)

Version 7.2.0 was released today which means we're ready to start with 8.0.0 development including this PR!

@rosariopfernandes ready to come back to this one?

@samtstern Sorry for the delay, I've been a bit busy and forgot to update this PR. I've replied to your last comment just now.

@samtstern Do you think it would make sense to have a separate module for pagination (e.g. firestore-paging)?
This module would require Java 8 because Paging 3 requires Java 8. And we could even write it in Kotlin, since Paging 3 was entirely rewritten in Kotlin.
Developers who are still using Paging 2 / Java 7 would stick to FirebaseUI 7.x

@rosariopfernandes I am fine to actually move the entire FIrebaseUI library to Java 8 for version 8.0 ... a lot of the AndroidX libs are starting to require it and as you said developers who can't afford to adopt Java 8 can stick to FirebaseUI 7.2.0 which is quite stable.
What do you think?

@samtstern sounds good to me. I'll update this PR to move entirely to Paging 3 + RxJava

@samtstern all done and ready for review!

@rosariopfernandes this looks great thank you for all the hard work! Really appreciate your taking the time to do the docs as well.

@samtstern My pleasure!
I'll start migrating the rtdb module now


Add Day-Night script from Futurelands

Archival purposes for teaching only - no testing needed. CR for styling

@robin-k-wilson Updated!


ReloadData() will cause additional expanded view

sorry to give u bad news again.
If expanded view is open, .reloadData() will cause it to remain and present.
Tapping on the expandableCell will open another detail page

Got it! No problem. I will tell you again if it is fixed. :)

Anyway, if you developed that cool feature(Down Arrow), could you introduce it for me? Thanks 👍

sure, will share you the code

@younatics
here's the rotate code
func rotateAnimation(_ img: UIImageView, duration: Double, isClose: Bool) {

        let angle = isClose == true ? CGFloat(M_PI) : CGFloat(-2 * M_PI)

        UIView.animate(withDuration: duration, animations: {
            img.transform = CGAffineTransform(rotationAngle: angle)
        })
    }

    func tableView(_ tableView: YNTableView, didDeselectRowAt indexPath: IndexPath, isExpandedCell: Bool)
    {
        if !isExpandedCell
        {
            self.taskTableView.deselectRow(at: indexPath, animated: true)
            print("selected no expandable cell")
        }
        else
        {
            guard let selectedCell = taskTableView.cellForRow(at: indexPath) as? ExpandableTaskCell else { return }
            isClose = selectedCell.upArrow.isHidden == true ?  true : false

            if !isClose
            {  print("close Deselect")
                selectedCell.upArrow.isHidden = true
                self.rotateAnimation(selectedCell.downArrow, duration: 0.3, isClose: false)
            }
        }
    }

    func tableView(_ tableView: YNTableView, didSelectRowAt indexPath: IndexPath, isExpandedCell: Bool)
    {
        if !isExpandedCell
        {
            self.taskTableView.deselectRow(at: indexPath, animated: true)
            print("selected no expandable cell")
        }
        else
        {
            guard let selectedCell = taskTableView.cellForRow(at: indexPath) as? ExpandableTaskCell else { return }
           isClose = selectedCell.upArrow.isHidden == true ?  true : false
            if isClose
            {   print("open Select")
                selectedCell.upArrow.isHidden = false
                self.rotateAnimation(selectedCell.downArrow, duration: 0.3, isClose: true)
            }
        }
    }

I override reload data method. It will work :)
Please see  v0.6.0

@younatics
awesome! looks good!
have you thought of creating a feature update later on for: "close all expanding" and "opening all expanding" ?

I have :) I will do it in this weekend!

+1

Hello, kohdesmond
I made expand & collapse all method I'm my project.
You can see it in v0.7.0
Cheers!

@younatics awesome thanks!
btw there's a bug at line 203 of YNTableView.swift
non expanded cell are returning TRUE instead of FALSE

should be
line 203 : delegate.tableView(self, didSelectRowAt: indexPath, isExpandedCell: false)
line 204 : didSelectRowAtSended = true
because non-expanded shouldn't call deselect as I assumed is a normal UITableView behaviour.

I will open this issue again

Maybe, I think isExpandedCell  method seems confusing because expanded cell and expandable cell returns same value. I purpose to make this function because didSelect method and didDeselect method should return same isExpandedCell  value. But I will consider adding isExpandedableCell  method too 👍

@younatics no worries, i'm glad to help you test out your new git!

Hello @kohdesmond ,
I published v0.8.0 with new didSelectRowAt and didDeselectRowAt method :)
Cheers!


Release 2.4.0

Kitchen Test Evidence: https://gist.github.com/bbaugher/f53d029b8a2dad422219bb8943855545
Milestone: https://github.com/cerner/cerner_tomcat/milestone/8

This is open for review

+1

Are there any other approvals we are wanting on release?

+1, looks good to me

+1

Have enough +1s, starting release

This has been released

Thanks @bbaugher !


Simple assembly debugger

This is a work in progress.  This PR introduces a primitive miden assembly debugger.  It allows the user to step through code and print out the vm state at each clock cycle.  The debugger supports the following commands:
    --------------------------------------------------------
    Miden Assembly Debug CLI
    ---------------------------------------------------------
    !next        steps to the next clock cycle
    !play        executes program until completion or failure
    !play.n      executes n clock cycles
    !prev        steps to the previous clock cycle
    !rewind      rewinds program until beginning
    !rewind.n    rewinds n clock cycles
    !print       displays the complete state of the virtual machine
    !stack       displays the complete state of the stack
    !mem         displays the complete state of memory
    !mem[i]      displays memory at address i
    !help        displays this message

It can be invoked via the CLI using: ./miden debug -a ASSEMBLY_FILE.masm -i INPUT_FILE
Example:

Let's remove VmState display logic from the processor crate. This should also fix the WASM compilation errors.
Done.

Could you fix this minor issue: #693 (comment)
I've removed all changes to the REPL module such that the debugger implementation is standalone.  I've made this issue which states that we should consolidate documentation and logic between the debugger and REPL #699.  It would also be cool to allow the REPL to be feature of the debugger.  Say you get to a particular clock cycle and you then enter repl mode where you can specify new instructions against the wm.

Let's create an issue for updating documentation (unless it has already been created).
created

#699


Deployment indicates successful but MDS stuck in creating on new build

Bug Report
What happened:
Building ceph with ceph-ansible 5.0 stable (2020/11/04)
Ansible-playbook deployment shows as successful.
Upon investigation the MDS status is stuck in "creating", under ceph status. ceph fs status also shows it as being creating.
A 'crashed' container also appears on each controller node with a similar timestamp as the MDS container.
And there are items listed under ceph osd blacklist ls immediately
What you expected to happen:
Ceph with cephfs in a working order
How to reproduce it (minimal and precise):
Latest ceph-ansible 5.0 stable (2020/11/04)
ansible-playbook -v -i /opt/ceph-ansible/inventory -e 'ansible_python_interpreter=/usr/bin/python3' /opt/ceph-ansible/site-container.yml

Group_vars - http://sprunge.us/uUlS1N
Inventory - http://sprunge.us/8JOSo7
Ansible.log (-vv) - http://sprunge.us/C7pZim
ceph osd tree - http://sprunge.us/brr1LX
ceph osd dump - http://sprunge.us/5hpHEm
ceph pg dump - http://sprunge.us/vEhRcj

listed 5 entries
<IP_ADDRESS>:6800/54 2020-11-05T09:13:14.798350+0200
<IP_ADDRESS>:0/1704729219 2020-11-05T09:13:14.798350+0200
<IP_ADDRESS>:0/3111397685 2020-11-05T09:13:14.798350+0200
<IP_ADDRESS>:6801/54 2020-11-05T09:13:14.798350+0200
<IP_ADDRESS>:0/3819409455 2020-11-05T09:13:14.798350+0200

When I remove the blacklist items above & fail the MDS over to a new MDS, it immediately starts with new blacklist items.
 ceph osd blacklist ls
listed 2 entries
<IP_ADDRESS>:6803/2535027803 2020-11-05T09:42:09.750221+0200
<IP_ADDRESS>:6802/2535027803 2020-11-05T09:42:09.750221+0200

ansible  -i /opt/ilifu_ceph-config/inventory osds,mons -m shell -a "ping <IP_ADDRESS> -c 2" -e 'ansible_python_interpreter=/usr/bin/python3' - all nodes can ping that IP, no firewall between nodes in cluster. all nodes can ping each other from both network interface ranges
Environment:

OS: Ubuntu 18.04.5 LTS
Kernel 5.4.0-48-generic #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Docker version: latest docker that comes with ceph-ansible
Ansible version: ansible-playbook 2.9.0
ceph-ansible version: stable-5.0 (2020/11/04)
Ceph version (e.g. ceph -v): 15.2.5

TLDR; network misconfig
Problem: Our outsourced network resource changed something on the fabric side which caused it to work incorrectly.
I just find it weird that ceph still deploys successful with no error.


WIP: Component tests

I started writing some tests for the components, but ran into some issues with React's shallow renderer related to its non-support for context: https://github.com/facebook/react/issues/3696
Anyone have any ideas? @gaearon would prefer not to use jsdom if we can avoid it, and I agree.
Either way, I'll track progress here.

Does it work with the workaround described in the issue?

Might help: https://github.com/facebook/react/issues/3721#issuecomment-106318499

I'll try that out, thanks.

I couldn't get any the workarounds to work :(
I'm going to use jsdom for now (via mocha-jsdom, which is nice) since it's better than nothing. If anyone can figure out how to use shallow rendering for our tests that deal with context, that'd be awesome.

:+1:

Component tests are done. Tests for shallowEqualScalar and shallowEqual are remaining, but I think we're good to release 0.10.
@gaearon Could you explain to me how shallowEqualScalar is different from shallowEqual, and why you'd use one over the other? It's not clear to me from reading the source.

Awesome stuff! :+1:

Could you explain to me how shallowEqualScalar is different from shallowEqual, and why you'd use one over the other? It's not clear to me from reading the source.

shallowEqualScalar bails out and returns false if any of the values is an object.
shallowEqual is not a safe default to use in our shouldComponentUpdate because it assumes the user never does deep mutations (which they might). On the other hand, shallowEqualScalar is safe. If your props are all scalar (no objects, just primitives, such as numbers, boolean, strings or functions), then you'll get some perf benefit for free.

Aha, makes sense. Thanks!

shallowEqual({ a: 3 }, { a: 3 }) // true
shallowEqualScalar({ a: 3 }, { a: 3 }) // true

const b = {};
shallowEqual({ a: 3, b: b  }, { a: 3, b: b }) // true
shallowEqualScalar({ a: 3, b: b  }, { a: 3, b: b }) // false

Question: do we want to pass dispatch to the decorated component?

I'd do that.

Do we want to fix #76 before 1.0?

 Anyway, do you want to get a fix for it in before cutting a release?

Yes please :)

Actually I did that already since I was writing a test for it, anyway. I'll close it.

:+1:

@gaearon I started writing some release notes for 0.10. I'll finish up when I get home and push to npm. Then I think we should wait until we get a universal app example finished before releasing 1.0. I'll work on that this weekend.

@acdlite
Overall, awesome job as always. :+1:

@acdlite @gaearon I was looking into the shallow rendering "problem" (also because jsdom works only with iojs) and found something weird.
If I run the test example from the react repository, it fails.
You can see it here https://gist.github.com/emmenko/d842e62513d6fb08aa93
Not sure if I'm doing something wrong or there is actually a problem somewhere...any idea?

Maybe they fixed it in master? Were you running master?

Hmm, I haven't tried master, just pulling latest version from npm

@gaearon you're right, using react from master works. I guess we just have to wait for the next release, then we can use shadow rendering.


Upstream adjustments

This set of changes adjusts files to point to the new repository location,
without attempting to address branding and topics raised in #1024.

Scanned through all the changes as well - all the link changes are correct, and the automated link check passes, so pending the two changes to copyright owner and repo owner, I think this is good to go.


Add ComponentState structs and sub enums

Issue #1224
Signed-off-by: Nathaniel Clark<EMAIL_ADDRESS>

Codecov Report

Merging #1225 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1225   +/-   ##
=======================================
  Coverage   95.39%   95.39%
=======================================
  Files           2        2
  Lines         152      152
=======================================
  Hits          145      145
  Misses          7        7

Impacted Files
Coverage Δ

iml-wire-types/wire-types.rs
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 1385f05...f6d1b06. Read the comment docs.


[Feature Request] Support non-function callables as activities

Is your feature request related to a problem? Please describe.
Currently the activity definition implementation here requires __code__ on a callable.  From what I can tell it seems like it's only using that to verify that there are no kwonly arguments.
Describe the solution you'd like
We can instead use the inspect module to analyze the callable's signature, allowing a broader set of non-function callables to be used as activities.

Definitely can fix this. Can you give an example of which callable you are using and now so I can include it in the integration tests?

So this isn't 100% related but I'm just dumping my thoughts here in case they're useful when changing the @activity.defn decorator.
I think it is nice to have a thin wrapper around activities that allows the developer to more easily customize their activity functions. Dramatiq uses a wrapper class which is applied using a decorator. I like this setup because:

It makes it easy to mock out the underlying function without messing up the task related attributes and without creating an otherwise useless wrapper function. For Dramatiq you just mock task.fn

As it stands in this SDK, if you directly mock the function things fail because it's missing __temporal_activity_definition

It makes the path to customization fairly clear and straightforward. Just subclass the Actor class
It's easier not to interfere with the internals of the framework when you customize how the callable is called, because the callable is an attribute of the wrapper, rather than the wrapper attributes stuff on the callable.

I'm still customizing how the current decorator is applied, it's just a little more complicated. Here's what I'm using in my project. It logs exceptions, injects a database access object and does some extra parsing of arguments that are Pydantic classes:
import functools
import inspect
from time import time
from typing import Any, Callable, no_type_check, Optional, TypeVar

from loguru import logger
from temporalio import activity

from bots_interface.actors import _parse_type
from dd.repositories import repo as repo_module

ActivityFunc = TypeVar("ActivityFunc", bound=Callable[..., Any])

@no_type_check
def define_activity(
    fn: ActivityFunc = None, name: Optional[str] = None
) -> ActivityFunc:
    if name is not None and fn is None:
        return functools.partial(define_activity, name=name)
    assert fn is not None
    defn = activity.defn(name=name or fn.__name__)(fn)
    fn_annotations = fn.__annotations__

    @functools.wraps(fn)
    def wrapper(*args: Any, **kwargs: Any) -> Any:
        if "repo" in fn_annotations:
            assert fn_annotations["repo"] is repo_module.Repository
            assert "repo" not in kwargs
            repo = repo_module.repo_factory()
            kwargs["repo"] = repo
        parsed_kwargs = _parse_args(fn, args, kwargs)
        if "repo" in fn_annotations:
            with repo.commit_and_close():
                return _run_func_log_exception(fn, parsed_kwargs)
        else:
            return _run_func_log_exception(fn, parsed_kwargs)

    wrapper.__temporal_activity_definition = defn.__temporal_activity_definition
    return wrapper

@no_type_check
def _run_func_log_exception(fn: ActivityFunc, kwargs: dict) -> Any:
    t_start = time()
    try:
        result = fn(**kwargs)
    except Exception:
        logger.exception(f"Activity function {fn.__name__!r} failed")
        raise
    duration = time() - t_start
    logger.debug(f"{fn.__name__} ran in {duration:.3f} seconds")
    return result

def _parse_args(fn: Callable, args: Any, kwargs: Any) -> dict:
    """Returns kwargs with args converted to kwargs and pydantic types parsed.
    Pendulum Datetimes are parsed as well"""
    call_args = inspect.getcallargs(fn, *args, **kwargs)
    for arg_name, value in call_args.items():
        annotation = fn.__annotations__.get(arg_name)
        call_args[arg_name] = _parse_type(annotation, value)
    return call_args

There is no customization beyond name. I just need a way to mark a callable as an activity and, at the time, an attribute seemed more reasonable than wrapping the function. This is what the @no_type_check decorator your showing in your example does, see: https://github.com/python/cpython/blob/40d81fd63b46cf998880ce3bf3e5cb42bc3199c1/Lib/typing.py#L2476-L2509. This allows other decorators that actually do need to proxy the invocation to do so without affecting our simple need to just set a small piece of metadata.
I may introduce an alternative activity concept that can be used instead of the decorator, but again the only customization is name. And the only thing I need is simple metadata, I do not want to proxy the function.

I may introduce an alternative activity concept that can be used instead of the decorator, but again the only customization is name. And the only thing I need is simple metadata, I do not want to proxy the function. Is there a more Pythonic way to carry around metadata without proxying the invocation? (forgive my naivete on Python here)

Nothing more pythonic comes to mind. In fact, stuffing attributes on whatever object feels very Python...
I like what you're saying about keeping it simple, and I think if I want to have proxied/mockable/customizeable tasks I can still do that under this model with my own decorator. I realize now that my current decorator could be cleaned up so it doesn't care about what activity.defn does if I apply it at the end (activity.defn(name=name or fn.__name__)(wrapper)).


FlexibleContexts is necessary for GHC 7.10

Database/HDBC/Sqlite3/Connection.hs:81:1:
    Non type-variable argument
      in the constraint: convertible-<IP_ADDRESS>:Data.Convertible.Base.Convertible
                           SqlValue a
    (Use FlexibleContexts to permit this)
    When checking that ‘fgettables’ has the inferred type
      fgettables :: forall a.
                    convertible-<IP_ADDRESS>:Data.Convertible.Base.Convertible SqlValue a =>
                    Sqlite3 -> ChildList -> IO [a]

Database/HDBC/Sqlite3/Connection.hs:94:6:
    Non type-variable argument
      in the constraint: convertible-<IP_ADDRESS>:Data.Convertible.Base.Convertible
                           SqlValue t
    (Use FlexibleContexts to permit this)
    When checking that ‘describeCol’ has the inferred type
      describeCol :: forall t.
                     convertible-<IP_ADDRESS>:Data.Convertible.Base.Convertible SqlValue t =>
                     [SqlValue] -> (t, SqlColDesc)
    In an equation for ‘fdescribeTable’:
        fdescribeTable o mchildren name
          = do { sth <- newSth o mchildren True
                        $ "PRAGMA table_info(" ++ name ++ ")";
                 execute sth [];
                 res1 <- fetchAllRows' sth;
                 .... }
          where
              describeCol (_ : name : typ : notnull : df : pk : _)
                = (fromSql name, describeType typ notnull df pk)
              describeType name notnull df pk
                = SqlColDesc
                    (typeId name) Nothing Nothing Nothing (nullable notnull)
              nullable SqlNull = Nothing
              nullable (SqlString "0") = Just True
              nullable (SqlString "1") = Just False
              nullable _ = Nothing
              typeId SqlNull = SqlUnknownT "Any"
              typeId (SqlString t) = typeId' t
              typeId (SqlByteString t) = typeId' $ BUTF8.toString t
              typeId _ = SqlUnknownT "Unknown"
              ....
Failed to install HDBC-sqlite3-<IP_ADDRESS>

Thanks for the report. I'm not using the sqlite3 bindings myself, but would be happy to release a fix. A pull request is very welcome :)

Fixed in #15.


Fix admin interface not displaying the correct role

If a role is not provided by the admin interface's list provider, it will now be displayed in the role selection.
Previously, there was a bug and the UI displayed [object, Object] in the role selection.
Now it shows the name of the role.
This fixes #1969.
Your pull request should…

[ ] have a concise title
[ ] close an accompanying issue if one exists
[ ] be against the correct branch (features can only go into develop)
[ ] include migration scripts and documentation, if appropriate
[ ] pass automated tests
[ ] have a clean commit history
[ ] have proper commit messages (title and body) for all commits

The second error is also reported as #1798

This pull request has conflicts frowning_face
Please resolve those so we can review the pull request.
Thanks.

Conflicts are against develop not against r/9.x

The issue with the notification "requiring at least one role with read and write privileges" seems to be fixed as well, at least I cannot replicate it anymore.

Seems to work. I did see the „requiring at least one role with read and write privileges“ once again but could not reliably reproduce this. In the end this is definitely a huge improvement → merging

I also saw the notification once during processing. But after finishing ingesting, it seems to work correctly.


Replaced usages of copymem with memcpy

This replaces usages of copymem with memcpy.
This makes Godot ECMAScript work with https://github.com/godotengine/godot/pull/48239

Thanks


Login function to page object model. Code has too many comments

Detail info.

NOTE. Just noticed that 2 functionality tests are missing (menu list items & current day marked in blue color). Wait for third commit.

Code ready for review.
"admin user logs in" test case:

Click into „User“ field.
Find user „Demo user“ and select it.
Click into „Role“ field.
Find role „Admin“ and select it.
Find button „Login“ and click on it.
User is logged in as „Demo user“ user:
• user name „Demo user“ is displayed on right up corner;
• there are displayed „Time logging“, „Invoices“, „Projects“, „Clients“, „Time entries“, „Tasks“ buttons in above menu list;
• „Time logging“ menu item is selected and marked in blue color.

The 4'th commit includes minor changes in login test module (the timelogging module seemed to be useless and was deleted. The css selector was put to the "common" module.) Also, the commit automates the following testcase:
Admin creates a new task:

Navigate to "Tasks" page (by url or clicking menu item).
Click button “Create Task“.
Fill the New Task form: “Task Name“ and “Description“ fields, choose “Yes“ as “Bill to Client“, set “Hourly Rate“.
Save new task by clicking “Save“ button.
Check if new task is created by going to all tasks list, filter and check if task is displayed.

New 5'th commit includes all changes suggested by reviewer. Main file was renamed


Small fixes

First off, thanks for creating a Java library for Instagram! There haven't been any good options for a long time. I appreciate your taking the time to make one!
My app needed a few things the library doesn't currently support, so I added them. I thought I'd share my changes in case others will find them useful. I made quick fixes to a couple things while I was in there. Some of them are breaking changes, in that existing code will need to be updated if the changes are merged -- sorry about that! Here's a summary of the changes:

Fixed a couple typos. I changed the name of the field org.jinstagram.entity.users.basicinfo.Counts#follwedBy to followedBy. This is a breaking change.
Renamed a few fields to use the more common Java convention of CamelCase versus Underscore_case, such as org.jinstagram.entity.users.basicinfo.UserInfoData#first_name. This is a breaking change.
Fixed various warnings. Moved a throw statement into a default case, organzied some imports, etc.
Added overloads with cursors for follower graph methods. My app passes around pagination cursors, so it was awkward to pass around Pagination objects, and passing around the "next url" didn't feel right either, so I added methods that take cursors instead.

It's poor ettiquette to include multiple changes into a pull request, so sorry for that too!
Let me know if you have any questions about the changes!

I added one more fix, which changed the Instagram method signature:
public MediaFeed getRecentMediaByLocation(String locationId, int minId, int maxId, Date maxTimeStamp, Date minTimeStamp) throws InstagramException

To this:
public MediaFeed getRecentMediaByLocation(String locationId, String minId, String maxId, Date maxTimeStamp, Date minTimeStamp) throws InstagramException

This is necessary for correctness because the next_max_id values returned by the API are wider than 31 bits. It also now matches the corresponding types in the Pagination object, which is nice too!


C nits

No indication in the tables of which immediates are sign extended (could use simm/nzsimm to make the table self-contained)
LI is falsely listed as rs1/rd
SLLI is falsely listed as rd only
ADD should be rs1/rd

LI and ADD got fixed last week.  I've just fixed SLLI.
Standardizing on simm/nzsimm for sign-extended immediates and imm/nzimm for zero-extended sounds ok; I don't have time to do that at the moment, but would review a PR.

I hope to have PR  ready tomorrow.

Thanks @DSHorner

zimm is used in the description of ADDI4SPN. I wanted to use uimm consistently in the table for unsigned zero extended values, and revise ADDI4SPN accordingly. But zimm appears to be a directive to the assembler: "and expands to addi rd 0 , x2, zimm[9:2]". (as does nzimm by it's usage in "expands to" descriptions, but with sign extension instead). I've been trying to confirm zimm/nzimm directives in binutils, but it could also be a standard macro in any of the projects. Is it safe to switch to uimm as the variant for this document?

@DSHorner I'm pretty sure that's just informal notation, not a directive, and we should be consistent with it.  There are two axes for an immediate: signed/unsigned, and may-be-zero/must-be-nonzero; everything outside C is a "szimm" but C varies.

Zero extension of RVC instruction immediate values caught me out while working on an RVC implementation based on the spec.
While zero extension is mentioned in the text description for each RVC encoding with a zero-extended immediate, the zero extension property does not appear in tabular form such as in the immediate mnemonic in each instruction's encoding table or in the instruction set listing. The tables just contain 'imm' and don't indicate whether to sign or zero extend.  I made frequent reference to both while implementing but the zero extension property can only be derived from the text description of the instruction, and not from the tables.
As @DSHorner mentions, almost all of the Base ISA immediate values are sign extended (excepting shifts and the CSR instruction immediate values), so it is an easy mistake to make. Load and store offsets, including stack relative loads and stores, in the compressed ISA have zero-extended immediate values which is different from the default of sign extension in the Base ISA.
As mentioned: 'z' in zimm (zero-extend?) and 'z' in nzimm (non-zero) are ambiguous as non-zero collides with zero-extend or sign-extend which are on different dimensions so it would be nice to avoid this ambiguity altogether. I think "may be zero" should be implicit. I believed the 'z' in zimm was zero-extend as it was used for the CSR instructions which have zero-extended immediate values (this caught me out too). In any case, it would be nice to have unambiguous mnemonics that appear in a glossary and only use z in nz for non-zero to avoid confusion.
I have been using 'simm' and 'uimm' for signed and unsigned immediate values in metadata derived from riscv-opcodes and note that 'simm' and 'uimm' notation appear in LLVM and CompCert metadata.
This gives an idea of what the instruction listing might look like if we used simm, nzsimm, uimm, and nzuimm for "signed", "non-zero signed", "unsigned" and "non-zero unsigned" respectively:

https://github.com/michaeljclark/riscv-meta/blob/master/doc/pdf/riscv-instructions.pdf

Note:  I don't have the RVC hints as the ISA manual listing does, but it gives you an idea...

Didn't mean to write such a long comment, but it took me a while to track down a sign vs zero extend bug; realize @sorear kind of pointed this out succinctly in the first line of the first comment.

I think this is mostly resolved, but feel free to submit another issue (or preferably a PR) if not.


Stop Ollama

Hi,
How can I stop Ollama ?

Therefore I don't know how to totally stop Ollama...
(I'm on macos)

Are you using the Ollama Mac app? If so just exiting the toolbar app will stop the server. The Mac app will restart the server also, if left open.
Here:

Otherwise, in a terminal:
$ pgrep ollama
74877
$ kill 74877

Thanks a lot, I didn't check in the upper toolbar, my bad.
Indeed, closing properly from there stopped spawning new processes.
Thanks again :-)

The bug not fixed, can't kill it on Mac.
ollama version 0.1.1

@dongyuwei have you exited the mac app from the toolbar?

Yes. @BruceMacD
I logout my system then re-login, no more ollma.

This is happening on Linux too. After I issue the command ollama run model, and after I close the terminal with ctrl + D, the ollama instance keeps running.

Are you using the Ollama Mac app? If so just exiting the toolbar app will stop the server. The Mac app will restart the server also, if left open.
Here:
Otherwise, in a terminal:
$ pgrep ollama
74877
$ kill 74877

Thanks! This worked on MacOS.

sudo service ollama stop worked for me on ubuntu

For Mac:
pkill ollama  works

systemctl stop ollama.service

Should this not be made obvious by an abstraction?
ollama server start --system

# prompts for sudo to create system.d unit if it doesn't exist and start it

ollama server stop --system

# again, sudo required.

ollama server start

# no sudo required

# user presses: ctrl + d

# server stops.

This really is not a great behavior. Thanks to that notch, the llama icon gets obscured so its not obvious at all its running nor how to access that toolbar item. Is there some sort of config option to just forbid the system from putting things there and using command line start/stop instead? Can I just remove the service entirely?
pkill ollama does NOT solve the problem btw as it somewhat disobediently just restarts it.

also having this problem on mac - its def. running, but i don't have anything in the taskbar and pgrep/kill just causes a restart

I've been having similar problems on my mac... server is running, I don't see anything on my taskbar to stop it, and I can't install the new ollama since the process is running.  pkill/pgrep etc as per other users, killing the process just restarts it.
I worked around by rm -rf /Applications/Ollama; pkill ollama which caused an error.  Following that, ollama process was not running, and I could install the new Ollama.app into /Applications.

rm -rf /Applications/Ollama; pkill ollama

It has to be rm -rf /Applications/Ollama; pkill ollama

How do i stop on windows

In the Mac terminal, I am attempting to check if there is an active service using the command:
lsof -i :11434
This is to verify if anything is running on the ollama standard port.
Following suggestions from other users, I then execute also:
pgrep ollama
After this, if the lsof command shows any process, I use the kill command followed by the PID to terminate the service (pgrep show eventually all the ollama process)

I was only able to kill the process using the activity monitor.

I use 'systemctl stop ollama.service' to stop the ollama
But when I use 'systemctl start ollama.service', the default port is bind again.
How to stop the service really?

How do i stop on windows??

How do i stop on windows??

Use this commande in your powershell :  Get-Process | Where-Object {$_.ProcessName -like '*ollama*'} | Stop-Process

In my Debian I can reproduce it. Nothing works: kill, service stop or systemctl fails trying to stop the service, and also produce conflicts with my amdgpu driver: #3527

Not a good practice, but pkill -9 ollama works for now on Arch Linux (probably other distros as well). Haven't experienced any file corruption so far, but be careful with it.

re-open the issue? maybe yes..

rm -rf /Applications/Ollama; pkill ollama

It has to be rm -rf /Applications/Ollama.app; pkill ollama

it worked for me (Mac)

This works on Mac:  sudo pkill -9 ollama Ollama

@

How do i stop on windows??

Use this commande in your powershell :  Get-Process | Where-Object {$_.ProcessName -like '*ollama*'} | Stop-Process

On my side, this command seems to only kill the ollama server but does not release RAM. RAM needs to be released manually in task manager.

@jwandekoken On Linux Ollama is running on as a systemd service. You can stop it using systemctl.
$ systemctl stop ollama.service

We used systemctl and we noticed that ollama was running in the background.
We ran this command to disable the auto-starting of the ollama server, and we can start it manually.
To start it manually, we use this command: sudo systemctl start ollama.service
Thank you for the information.

Add an execstop for your systemd file
[Service]
ExecStop=/bin/kill -TERM $MAINPID

On Mac, this problem seems to be fixed as of a few releases ago (currently on 0.1.38). 👍 Quitting the Ollama app in the menu bar, or alternatively running killall Ollama ollama, reliably kills the Ollama process now, and it doesn't respawn.

in Windows the command is
Get-Process | Where-Object {$_.ProcessName -like 'ollama'} | kill

in Windows the command is Get-Process | Where-Object {$_.ProcessName -like 'ollama'} | kill

That causes it to restart here.  This works better:
Stop-process -name "ollama", "ollama app"
It's a horrible way to exit the program though.
Clicking 'quit ollama' from the systray app will close it down gracefully (ie. all ollama processes are quit too).  The systray app does not handle the WM_CLOSE message though so we can't use $process.CloseMainWindow() from Powershell to do the same.   It's gotta be nuked.
I'm tempted to write a Powershell wrapper to get around all my problems with the systray app.  The other night it even notified me of an update while I was watching a film.  🤨

RAM needs to be released manually in task manager.

@lzhhh93 what does this even mean? A process, when stopped, does not consume any memory, and "task manager" does not have any functionality for "manually" "releasing" memory.

RAM needs to be released manually in task manager.

@lzhhh93 what does this even mean? A process, when stopped, does not consume any memory, and "task manager" does not have any functionality for "manually" "releasing" memory.

I have the same problem. When you TerminateProcess ollama.exe on Windows ollama_llama_server.exe is not terminated.

RAM needs to be released manually in task manager.

@lzhhh93 what does this even mean? A process, when stopped, does not consume any memory, and "task manager" does not have any functionality for "manually" "releasing" memory.

I have the same problem. When you TerminateProcess ollama.exe on Windows ollama_llama_server.exe is not terminated.

I am having this exact same issue. Am able to end ollama.exe but the runners stay running and using RAM seemingly perpetually.

I too would appreciate the syntatic sugar of an 'ollama server_stop' command.

I found on mac pkill ollama doesn't work because the main process actually starts with a capital.
pkill Ollama should do it.

if you use Hombrew:
$ brew services stop ollama

@jwandekoken On Linux Ollama is running on as a systemd service. You can stop it using systemctl.
$ systemctl stop ollama.service

We used systemctl and we noticed that ollama was running in the background.
We ran this command to stop the process and disable the auto-starting of the ollama server, and we can restart it manually at anytime. To start it manually, we use this command: sudo systemctl start ollama.service
However, we noticed that once we restarted the ollama.service and then reboot the machine, the process gets added to the auto-start again.
 This prevents it from automatically starting when Linux is started. The commands are:
sudo systemctl stop ollama.service sudo systemctl disable ollama.service
Thank you for the original information in your post.

Very useful method, for an auto script:
`
#!/bin/bash
check_ollama() {
pgrep ollama > /dev/null
}
check_autostart() {
systemctl is-enabled --quiet ollama.service
}
check_service_active() {
if systemctl is-active --quiet ollama.service; then
echo "Ollama service is active."
else
echo "Ollama service is inactive."
fi
}
start_service() {
if check_ollama; then
echo "Ollama is already running."
else
echo "Starting Ollama service..."
sudo systemctl start ollama.service
echo "Ollama service started."
fi
}
disable_service() {
if check_ollama; then
echo "Disabling and stopping Ollama service..."
sudo systemctl stop ollama.service
sudo systemctl disable ollama.service
echo "Ollama service stopped and disabled."
else
echo "Ollama is not running. No need to disable."
fi
}
disable_autostart() {
if check_autostart; then
echo "Disabling Ollama service auto-start..."
sudo systemctl disable ollama.service
echo "Ollama service auto-start disabled."
else
echo "Ollama service auto-start is already disabled."
fi
}
echo "Checking Ollama service status..."
check_service_active
echo
PS3="Select an option: "
options=("Start Ollama service" "Disable Ollama service" "Disable Ollama auto-start" "Exit")
select opt in "${options[@]}"
do
case $REPLY in
1) start_service; break ;;
2) disable_service; break ;;
3) disable_autostart; break ;;
4) echo "Exiting."; exit ;;
*) echo "Invalid option. Please select 1-4." ;;
esac
done
`
Please sudo first to run the bash : ))

What works for me is:
killall pt_main_thread

why so many drama to stop Ollama. why not just ollama stop model/name. and stopped that.

This works on Mac: sudo pkill -9 ollama Ollama
Then double-click on Ollama in Applications to start it

Thus works for mac! THANKS!!

Facing this problem for 30 minutes, Solved it by just force-killing Ollam from Mac's activity monitor.

For Mac:
Close the ollama process from the Activity Monitor and avoid confirming it again with ollama ps from your terminal, as this will restart the process.

If ollama is managed by systemd, you can stop and disable it with these commands:
sudo systemctl stop ollama
sudo systemctl disable ollama

This worked for me

If ollama is managed by systemd, you can stop and disable it with these commands:
sudo systemctl stop ollama
sudo systemctl disable ollama

This worked for me

Thank you! This worked for me too!

It worked with me
sudo pkill -9 ollama Ollama


base64 and widebase64 modifiers

Add two new modifiers: base64 and widebase64.
These modifiers take the given text string and generate 3 different strings
being careful to trim off the bytes which are dependent upon leading or
trailing bytes in the larger search space.
I've implemented it by slightly cheating. I generate all the search strings in
a list and then creating one large string suitable for the RE compiler to deal
with. For example, the string "This program cannot" generates these three
base64 encoded strings:
VGhpcyBwcm9ncmFtIGNhbm5vd
RoaXMgcHJvZ3JhbSBjYW5ub3
UaGlzIHByb2dyYW0gY2Fubm90
Those three strings are then transformed into a RE that looks like this:
(VGhpcyBwcm9ncmFtIGNhbm5vd|RoaXMgcHJvZ3JhbSBjYW5ub3|UaGlzIHByb2dyYW0gY2Fubm90)
That string is then passed to the RE compiler for parsing and AST generation.
The AST is then emitted into the appropriate spot and YARA believes it was
given a regex from that point on.
I've also implemented support for specifying custom alphabets:
base64("!@#$%^&*(){}[].,|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu")
This means that I have to be careful to escape any special RE characters in the
string passed to the compiler. The base64 alphabet has to be 64 bytes long, and
does support escaped bytes properly too.
To avoid the need to deal with escaping I had a first implementation which
attempted to generate the AST by hand, which was mostly working but was very
cumbersome to maintain. In doing this I ended up improving yr_re_print_node()
so that it indents the tree properly, which made debugging that attempt easier.
My apologies for including it in this diff. I can split it out if you want.
Lastly, I did most of the work in re.c but I think it belongs in it's own
base64.c. I'm happy to move it out of re.c if you would prefer.

I'm putting this up for review so I can gather comments and iterate on it. I think this belongs in its own set of source files, instead of forcing it into re.(c|h) for the most part. I'll move things over to base64.(c|h) and get them into the build system, but would first like to gather feedback on the design.
The details are in the documentation (included in this PR) but the short version is that:
$a = "This program cannot" base64 will search for the three base64 representations of that string and $a = "This program cannot" base64 wide will apply the wide modifier and then the base64 - it does not include the plaintext version if you use base64.
The widebase64 modifier works just like the base64 modifier but inserts null bytes between each character in the base64 strings.
My first implementation of this was generating the RE AST by hand, but it was far too fragile so I switched over to the current method (generating an RE string and letting the RE compiler do the heavy lifting for me). This is an easy approach to this but I'm not super happy with it either. I think a better long-term answer here is to have a way to have different representations of strings but it is still only referenced by a single string internally. This is a lot more work and may not be worth the effort until a more concrete use-case is found.

I have two concerns about these modifiers, which are:

The more modifiers we have, the larger the number of possible combinations and therefore it's more difficult to understand how they interact between them. For example, a user may wonder what happens if base64 and nocase are used together. Does it take all possible case combinations for the original string and apply base64 to them? Does it find any case combination of the resulting base64 string? It's an error?. In this case it will be an error, but the more intuitive options if probably the first one. I'm afraid that by adding more modifiers is going to be difficult both for the user and for ourselves to reason about how the different modifiers interact between them.

These modifiers are convenient, but not necessary. Other modifiers like nocase and xor are necessary because the alternative would be writing hundreds or even thousands of possible strings, but base64 can be replaced by just three strings instead of one. It's certainly easier for the user to use base64 than having to deal with writing the three strings by herself, but considering the maintenance burden and the added complexity (even for the user) I'm not convinced about adding them.

Thoughts?

The more modifiers we have, the larger the number of possible combinations and therefore it's more difficult to understand how they interact between them. For example, a user may wonder what happens if base64 and nocase are used together. Does it take all possible case combinations for the original string and apply base64 to them? Does it find any case combination of the resulting base64 string? It's an error?. In this case it will be an error, but the more intuitive options if probably the first one. I'm afraid that by adding more modifiers is going to be difficult both for the user and for ourselves to reason about how the different modifiers interact between them.

I understand this concern but I believe the benefit of a more expressive and readable language is worth it.  You are right that it does increase the cognitive burden on users, but with good documentation (which I tried to provide a start to) we can help users understand what is and what is not supported. With tests, which I tried to make very thorough, I think we can lessen the burden on ourselves for maintenance.

These modifiers are convenient, but not necessary. Other modifiers like nocase and xor are necessary because the alternative would be writing hundreds or even thousands of possible strings, but base64 can be replaced by just three strings instead of one. It's certainly easier for the user to use base64 than having to deal with writing the three strings by herself, but considering the maintenance burden and the added complexity (even for the user) I'm not convinced about adding them.

You're right that these are more for convenience but not having them means each user needs to write code (or find someone else's) which does the base64 encoding with proper padding and trimming of the encoded strings. It's not hard to do, and there are a handful of implementations out there already. In fact, when I was writing this I was using one which turned out to be buggy. The fact that we can provide a convenient way for users to express this while also increasing readability makes this at least worth considering. The alternative is users needing to write or find a script to do this, and any bugs that may include. Also, this is more expressive than the versions I've seen that don't let you specify a custom alphabet or even wide support.
I'd much rather see $a = "This program cannot" base64 instead of the alternatives. :)

Jumping on the debate as a Yara user, as some feedback was asked on Twitter.
At the moment, and probably as other folks, I use a third-party script to generate the 3 possible base64 strings for every input. This technique proved to be successful to monitor some threat actors.
When you search a specific string without knowing if it will be ascii or wide, you need to generate not only 3 but 6 strings. In Yara, this could be replaced by one line, with the "ascii" and "wide" modifier in addition to "base64" and "widebase64". So, as a user, those new modifiers would be useful, convenient, and would make rules more readable as they would turn 6 lines into 1. The ability to specify the alphabet is a nice bonus.
Regarding the risk of "user confusion", my feeling is that the basic user will not bother with the modifier, and the advanced user will read the documentation.
I cannot say how much burden it adds as a developer, my first thought was that the base64 algorithm is not going to change, so once the code is written and tested you should be fine, but then I realized you will need to handle the modifier against every new modifier that you may add in the future. You are in the best position to answer this question, and I will still cherish Yara if you decide not to implement the feature :)

I strongly support this addition.
Base64 is a very common encoding format found across most major languages and platforms. It is used to encode multi-line parameters & scripts, encode binary content (e.g. compressed data), and to support common file encodings (e.g. X509 certificate encodings).
Attackers make use of Base64 encoding very often because it allows them to utilize native functionality to achieve simple obfuscation objectives. Payloads across .NET, PowerShell, Python, PHP, VBA Macros, and beyond have used base64. It is probably the #1 encoding used by attackers for simple evasion and obfuscation goals.
Matching encoded content is also the way an entry infosec practitioner can progress beyond matching on "plaintext strings" to find more advanced payloads.  These payloads require additional analysis skills and tools (e.g. CyberChef) that help practitioners gain the skills necessary to defend their environments. Giving defenders more power in a convenient way simplifies the progression of mastery.
While this feature can be approximated by generating the appropriate strings in standalone tools, native support for this encoding would simplify the effort required by defenders to match content and eliminate points of error (e.g. forgetting to including multiple base64 strings to account for leading and trailing bytes, neglecting unicode, etc).

Given the arguments, and how passionately @wxsBSD has defended this feature, I'm changing my mind. Let me do the final review before merging it.

I think all of the code I added in re.c belongs in a new file (I'm thinking base64.c) - really the majority of the code has nothing to do with the re code. By moving it to it's own file it will make things cleaner. Do you want me to do that?

I totally agree on creating the base64.c file.

I was about to merge this PR and noticed that for some reason the tests in Travis CI are failing. They  pass in my local machine though.

Not sure why those are failing and I can’t find a way to get the test logs to see what failed exactly. :(

The windows builds are broken because I didn't update the VS solution files - I can download a copy of VS in a VM if you want me to fix that, but it may be a day or two before I can get to it.
I have no idea why those tests are failing and I can't seem to get travis to give me the logs I need to debug it. Maybe it makes sense to modify the Makefile so it cats out the test-suite.log if tests fail? This way we can see the test failures in travis (and it just makes it easier to not have to cat that file all the time during development).

The tests fail because memory leaks:
=================================================================
==27990==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 585 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1010 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1010)
    #2 0x4b245b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b245b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 585 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1010 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1010)
    #2 0x4b21a1 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21a1)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 360 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1010 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1010)
    #2 0x4b23b8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b23b8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 360 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1010 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1010)
    #2 0x4b231b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b231b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 360 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1010 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1010)
    #2 0x4b21d8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21d8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 240 byte(s) in 6 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1010 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1010)
    #2 0x4b227b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b227b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 228 byte(s) in 3 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x44f420 in sized_string_new (/home/travis/build/VirusTotal/yara/test-rules+0x44f420)

Direct leak of 72 byte(s) in 3 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b245b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b245b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 72 byte(s) in 3 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b21d8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21d8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b23b8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b23b8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b21a1 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21a1)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 30 byte(s) in 2 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x42a91d in yara_yylex (/home/travis/build/VirusTotal/yara/test-rules+0x42a91d)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b231b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b231b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b227b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b227b)

Indirect leak of 1008 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x44f504 in sized_string_convert_to_wide (/home/travis/build/VirusTotal/yara/test-rules+0x44f504)
    #2 0x4b21a1 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21a1)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 558 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1502 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1502)
    #2 0x4b245b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b245b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 552 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x44f504 in sized_string_convert_to_wide (/home/travis/build/VirusTotal/yara/test-rules+0x44f504)
    #2 0x4b231b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b231b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 368 byte(s) in 6 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x44f504 in sized_string_convert_to_wide (/home/travis/build/VirusTotal/yara/test-rules+0x44f504)
    #2 0x4b227b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b227b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 330 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1502 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1502)
    #2 0x4b21d8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21d8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 330 byte(s) in 9 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b1502 in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b1502)
    #2 0x4b23b8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b23b8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 192 byte(s) in 8 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b231b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b231b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 168 byte(s) in 7 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b23b8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b23b8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 168 byte(s) in 7 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b21a1 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21a1)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 144 byte(s) in 6 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b245b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b245b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 144 byte(s) in 6 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b21d8 in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b21d8)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

Indirect leak of 120 byte(s) in 5 object(s) allocated from:
    #0 0x7fbe984d8602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x4b0f6a in _yr_base64_create_nodes (/home/travis/build/VirusTotal/yara/test-rules+0x4b0f6a)
    #2 0x4b227b in yr_base64_ast_from_string (/home/travis/build/VirusTotal/yara/test-rules+0x4b227b)
    #3 0x4f1f7f  (/home/travis/build/VirusTotal/yara/test-rules+0x4f1f7f)

SUMMARY: AddressSanitizer: 7118 byte(s) leaked in 158 allocation(s).

In Mac OS X the leaks are not detected by AddressSanitizer :(

Sigh, will fix these tonight.

OK, I've fixed the leaks (thanks for pointing them out) and also added a fix for an edge case I hadn't considered.
I've verified the leaks are fixed and all tests pass on a linux system and on OS X.

In the current (3.12.0 or 4.0.0) docs, I see that nocase and xor cannot be used with the base64 modifiers, and that base64 cannot be used with base64wide.
Should it also include a restriction on use with the fullword modifier?


Refactor codebase in action to defense feedback

What does this PR do?
This pull request makes changes to this codebase in action feedback received after the checkpoint defense
How can it be tested?

Removed duplicate code in the searchIndex method. Replaced it with the iterCollection method.
Removed redundant tests in inverted-index-test.js.
Modified getIndex method to return index for a JSON file
Modified multi-line comments
Tables for that display search results for multiple files now display the file name

Coverage increased (+0.4%) to 98.039% when pulling cfeb703cf9c42ee70cf06ca5fa03cb993f74c864 on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.4%) to 98.039% when pulling f077d3f8ee55dbf87d0df34ae7632c159924fe6c on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage decreased (-97.7%) to 0.0% when pulling 178a8372a738b9b7ecfa726cbaf925cf6ee0a7c6 on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.3%) to 97.959% when pulling 7ab015c29d25ac9362f2d550af24b7790e2a2ec1 on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.3%) to 97.959% when pulling e55dbedca5980f250ef9fabc3ddea0b1e457450c on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

@andela-rbabalola please review what you have under how it can be tested in your PR description

Coverage increased (+0.3%) to 98.0% when pulling d43f48bf36f3f4cf256cdd1eb76daa8d0db4cbed on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.3%) to 98.0% when pulling f510c127e6a91a89f9598bd2e272f5c7e91e66ed on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.3%) to 98.0% when pulling 8d7a12865599a477991054ec66f8e0cc2f34d514 on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.3%) to 98.0% when pulling 1178e2de144ab02708ec5ecfd6046fd2c1b7e925 on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.

Coverage increased (+0.3%) to 98.0% when pulling d3c2de67d6c6ce71272849062c779c0c143b2238 on defense-feedback into 20b72b7ab65fb59eb7a5f6d3442b1dbab3b36282 on master.


Alpine Docker Image cannot run CLI if built using Docker for Windows

Describe the bug
While the default Dockerfile builds and executes successfully when using MacOS, if one uses Docker for Windows, the image that is created has an unusable installation of the Azure CLI.
To Reproduce

Clone the Azure CLI repository.
Navigate to the repository root in a CLI environment.
Execute the commands:

docker build -t microsoft/azure-cli:alpine .
docker run microsoft/azure-cli:alpine az --version

Expected behavior
Version information about the CLI and all command modules is reported.
Environment summary
OS: Windows
Required Application: Docker for Windows

This bug discovered by @williexu.

What is unusable about the image?

@tjprescott
bash: /root/.bashrc: line 1: syntax error near unexpected token `$'{\r''
'ash: /root/.bashrc: line 1: `_python_argcomplete() {
bash-4.4# az
': No such file or directory
bash-4.4#


Improve documentation for our new API

Codecov Report

Merging #448 into master will decrease coverage by -0.02%.
The diff coverage is 66.67%.

@@            Coverage Diff             @@
##           master     #448      +/-   ##
==========================================
- Coverage   90.87%   90.84%   -0.02%
==========================================
  Files          76       76
  Lines        4982     4980       -2
==========================================
- Hits         4527     4524       -3
- Misses        299      300       +1
  Partials      156      156

Impacted Files
Coverage Δ

public_header.go
92.31% <ø> (ø)
:white_check_mark:

server.go
90.14% <ø> (ø)
:white_check_mark:

client.go
91.16% <66.67%> (-0.36%)
:x:

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 20b2069...5e76245. Read the comment docs.


ImportError

When I finish configuring the environment and start training according to the requirements in the document, the following errors are reported:
ImportError: /home/zhangsai/.conda/envs/MaskTrackRCNN/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
My environment configuration is as follows:
python:3.8.12
pytorch:1.7.1
torchvision:0.8.2
cudatoolkit:11.0.221
mmcv-full:1.3.14
mmdet:2.11.0
ubuntu:18.04
I want to know what went wrong. I look forward to your answer. Thank you very much!!!

It seems to be a compatibility issue of cuda and mmcv, you might need to recompile and install your mmcv. Hope this doc helps.


Ls fix npm cli

:tada: This PR is included in version 0.3.2 :tada:
The release is available on:

GitHub release
npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:


♻ Move project source files to top level from src, update Sentry dependency

Nice, thank you! :rocket:


anchor test for basic-1 error

basic-1
1) Creates and initializes an account in a single atomic transaction (simplified)
2) Updates a previously created account
3) Increment
4) Decrement
0 passing (30s)
4 failing

basic-1
Creates and initializes an account in a single atomic transaction (simplified):
Error: Transaction was not confirmed in 30.02 seconds. It is unknown if it succeeded or failed. Check signature 4VBPPd6Djpuf1vYwAbtJt8sbWr5YEpnjLCWP1UXG9XsXAeHpuAt8bntsPg3AoK18QAfK6mYtjX2sfrET5HoNsBDB using the Solana Explorer or CLI tools.
at Connection.confirmTransaction (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/node_modules/@solana/web3.js/lib/index.cjs.js:5689:13)
at async sendAndConfirmRawTransaction (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/provider.js:174:21)
at async AnchorProvider.sendAndConfirm (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/provider.js:89:20)
at async Object.rpc [as initialize] (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/program/namespace/rpc.js:15:24)
at async Context. (tests/basic-1.js:24:5)

basic-1
Updates a previously created account:
TypeError: Cannot read properties of null (reading 'publicKey')
at Context. (tests/basic-1.js:55:30)
at processImmediate (node:internal/timers:466:21)

basic-1
Increment:
TypeError: Cannot read properties of null (reading 'publicKey')
at Context. (tests/basic-1.js:79:30)
at processImmediate (node:internal/timers:466:21)

basic-1
Decrement:
ReferenceError: decrement is not defined
at Context. (tests/basic-1.js:101:5)

error Command failed with exit code 4.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
dont know how to fix this... please help

cargo clean
yarn install
npm install
anchor build
Replace the id
anchor test

basic-1 tests have been updated after this issue(https://github.com/coral-xyz/anchor/blob/fdda604d41837f1e04c3cae2da0b335ddc397c43/examples/tutorial/basic-1/tests/basic-1.js) and we also test it in our CI:
https://github.com/coral-xyz/anchor/blob/fdda604d41837f1e04c3cae2da0b335ddc397c43/.github/workflows/reusable-tests.yaml#L154
so the problem should be fixed now.


Add template / formatted data binding

Idea
Allow labels to have a template string.
Additional context
Label text is often constructed using a formatted string. Currently the whole text needs to be bind to a string store, then the update method or whatever sets the store to the result of a context.formatString. This could be done as part of the data binding.
const model = {
    numGuests: flex.store(0)
};

...

flex.label({
    text: {
        template: 'Number of guests: {BLACK}{COMMA16}',
        args: [model.numGuests]
    }
});

... or ...

flex.label({
    text: flex.template('Number of guests: {BLACK}{COMMA16}', model.numGuests)
});

Current work around:
const model = {
    numGuests: flex.store(0)
};
const viewModel = {
    numGuests: new FormattedStore('Number of guests: {BLACK}{COMMA16}', model.numGuests)
};

...

flex.label({
    text: viewModel.numGuests
});

...

class FormattedStore<T> implements flex.Store<string> {
    private readonly fmt: string;
    readonly store: flex.Store<T>;

    constructor(fmt: string, store: flex.Store<T>) {
        this.fmt = fmt;
        this.store = store;
    }

    get() {
        return context.formatString(this.fmt, this.store.get());
    }

    subscribe(callback: (value: string) => void): () => void {
        return this.store.subscribe(value => {
            callback(this.get());
        });
    }
}

This is actually a lot simpler that I expected. flex UI could simply provide a helper function that creates this facade.
class FormattedStore implements flex.Store<string> {
    private readonly fmt: string;
    readonly stores: flex.Store<any>[];

    constructor(fmt: string, ...stores: flex.Store<any>[]) {
        this.fmt = fmt;
        this.stores = stores;
    }

    get() {
        return context.formatString(this.fmt, ...this.stores.map(x => x.get()));
    }

    subscribe(callback: (value: string) => void): () => void {
        const subscriptions = this.stores
            .map(x => x.subscribe(_ => callback(this.get())));
        return () => subscriptions.every(x => x());
    }
}

function bindTemplate(fmt: string, ...args: flex.Store<T>[]) {
    return new FormattedStore(fmt, ...args);
}

flex.label({
    text: bindTemplate('Number of guests: {BLACK}{COMMA16}', model.numGuests)
}),

Thank you for your feature requests. 😃
Regarding this specific one, I haven't really used formatString as I've mostly been formatting using the ES5 JS functions, but I like the idea. Wouldn't this suffice as well though?
flex.label({
    text: compute(model.numGuests, guests => context.formatString('Number of guests: {BLACK}{COMMA16}', guests))
}),

It supports multiple stores as well.

The bindTemplate example is a nice shorthand, maybe that could use compute for the implementation?

Fixed as of c342c84. :)


Can't load the full checkpoint

I downloaded the available checkpoint for ResNet-50 through the provided link: https://dl.fbaipublicfiles.com/vicreg/resnet50_fullckpt.pth
But upon loading the checkpoint, following error appears:
>>> torch.load(checkpoint_path)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/anaconda3/envs/pytorch_env/lib/python3.8/site-packages/torch/serialization.py", line 594, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/home/user/anaconda3/envs/pytorch_env/lib/python3.8/site-packages/torch/serialization.py", line 853, in _load
    result = unpickler.load()
AttributeError: Can't get attribute 'exclude_bias_and_norm' on <module '__main__' (built-in)>

Same error happens with the other checkpoints. Is there something I am doing wrong? Appreciate the help!
Using pytorch version 1.7.1 and torchvision 0.8.2

Hi,
Are you trying to load the checkpoint from the file "main_vicreg.py" of this repository, or from somewhere else ?
If it is from somewhere else you need to define the "exclude_bias_and_norm" as follows:
def exclude_bias_and_norm(p):
    return p.ndim == 1

Please tell me if that works.

Thanks!


Change out/-layout from foo.overridden to foo.super

Also reworked the documentation about the out/ folder.
This is in preparation of

https://github.com/com-lihaoyi/mill/issues/2107#issuecomment-1306119724

Just did a quick proofread pass. Some of these are actual grammar errors, others are stylistic choices to improve the fluency and readability of the text.

Thank you @Sailsman63! For a non-native English speaker, this kind of review is very helpful. I integrated all of your suggestions.


Ensure DoD of final release project

User story

As a PO
I want / need to make sure all criteria for DoD of final release project are met
So that we can achieve a high-quality completion of the project with a common understanding of "project completion"

Acceptance criteria

[ ] Go through DoD of final release project and make sure all criteria are met

Definition of done (DoD)

It builds without errors
code has been reviewed
Build has been made and deployed on a testing environment
Code coverage >75%
All acceptance criteria were met
Documentation updated whenever needed within planning documents (Tabs: Bill of materials, Documentations)
Branch/feature was merged into dev and then main

DoD general criteria

Feature has been fully implemented
Feature has been merged into the mainline
All acceptance criteria were met
Product owner approved features
All tests are passing
Developers agreed to release

@codingwithelijah
Regarding the technical part of the DoD for the whole project:

non functional requirements (test coverage...) are met, (at least the updated requirements markus gave us verbally in one of the meetings)
there's no half-implemented features of any kind or commented code in our codebase

Generally speaking, I would say we are fine.


Changing environment from 2.7 to 3.5 doesn't work without closing and re-opening solution

Create a project
Set environment to a 2.7 environment
Add a new environment, choose 3.5
** In Solution Explorer, under Python Environments it now shows that the project is set to 3.5, and right clicking the Project and choosing Properties confirms this.
Intellisense is not updated accordingly and still claims that 3.5 specific functionality is a syntax error, and running the program still uses the 2.7 environment.

Should be fixed


exports is not defined is ES module scope - still not working

Environment
Nuxt project info:                                                                                20:15:00

Operating System: Darwin
Node Version:     v16.13.0
Nuxt Version:     3.0.0-27292434.d68318f
Package Manager<EMAIL_ADDRESS>Bundler:          Vite
User Config:      build
Runtime Modules:  -
Build Modules:    -

Reproduction
https://github.com/sweepy84/nuxt3
Describe the bug
A fresh nuxt3 project fails when installing 'aws-amplify' as a plugin.
Replication of Bug
Steps performed

npx nuxi init nuxt3
yarn install
yarn add aws-amplify
Added 'amplify.ts' to /plugins directory
Added transpiling config to 'nuxt.config.ts'
yarn dev

Additional context
I know this was logged here https://github.com/nuxt/nuxt.js/issues/12688
and was supposed to be fixed with mlly fix but this did not solve problem for me even with latest fixes!
Logs
exports is not defined in ES module scope
  at $id_8b3bdae3 (file://./.nuxt/dist/server/server.mjs:3539:23)
  at __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:31429:9)
  at __ssrLoadModule__ (file://./.nuxt/dist/server/server.mjs:31376:25)
  at ssrImport (file://./.nuxt/dist/server/server.mjs:31401:13)
  at $id_d9f142a1 (file://./.nuxt/dist/server/server.mjs:3206:37)
  at async __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:31429:3)

Tracked in https://github.com/nuxt/nuxt/issues/13277#issuecomment-1397293299


cydia does not open Yalu app just restarts the device

This is not a support forum or generic mailing list.
This form is exclusively for reporting issues caused directly by the inner workings of yalu.
Direct your jailbreaking questions to one of these fine communities:

https://reddit.com/r/jailbreak
http://www.jailbreakqa.com/

Issues, which are not related to yalu's code, may be closed without comment. Do NOT post about: Cydia, tweak, respring/bootloop or app issues UNLESS you have evidence that they are caused by an error in the jailbreaking software itself.
(Delete this bit after reading, and replace it by "I read the issue posting guidelines.")

same

same


Maybe the click effect on the little star icon on the home page is a bit too sudden

It probably is not a great idea to have an element when, when clicked, brightens the screen instantly from one color, to another. Maybe replacing that effect with something less intrusive like little stars falling off of the big star, or just a little glow, would be best!
Great job with this language! Came from Theo's video about this.

We're keeping the rainbow, but if you want to add some transition animation that would be really cool!


PowerShell returns weird string when getting WINHOME

The GitHub vscode extension auto-created this issue on my upstream (i.e. this template), apologies. Feel free to delete the issue.


Program name update

Hello,
According to the latest recommendation, the correct name of the program is "ZABAPGIT_STANDALONE' (please see https://docs.abapgit.org/guide-install.html#install-standalone-version). Maybe some images need updating, but I don't have access to that. Please let me know if I can be of further assistance. Thank you.

@Thank you for your feedback. The proper way to suggest improvements to our tutorials is by creating a Github issue for that particular tutorial via the feedback button.

please check https://github.com/sap-tutorials/Tutorials/pull/20832


Upgrade everything but k256

i left k256 behind because upgrading that led to compile errors. I don't think they will be hard to fix, but I wanted to change as little as possible.

actually this doesn't compile when the "ethers" feature is enabled. fixing that now

Thank you


flutter run doesn't actually fetch the engine artifacts and so forth

Steps to reproduce:

start a clean clone of the github repo
run "flutter run --release" as your first command

I was able to reproduce this - I'll take a look at it.


Read The Docs

Port manual to RST to make it usable on readthedocs.
conf.py was only there to make it easy to preview changes if you have sphinx
installed.
Sorry I let hang for so long. I just couldn't organize in a way that I 100%
like. I still think it's an improvement. Especially that the most important
section, the jbuild specification, is more prominent.
If this is accepted I'll start working on polishing it.

Also, I've yet to delete the manual.org. Perhaps it's still useful for some of the WIP

Once this PR is merged, I expect the docs to show up here: http://jbuilder.readthedocs.io/en/latest/
To preview the docs locally if you have sphinx installed, the following command in the doc directory will work:
$ sphinx-build . _build

The docs will show up in _build/index.html
You can preview the docs before merging here:
http://testrtdxyz.readthedocs.io/en/latest/

readthedocs version of sphinx seems not to like utf8 in the source so I had to mangle your name @diml. Sorry about that.

Have you considered using pandoc to convert to rst instead of changing the
format in the repo?
On May 14, 2017 12:12 AM, "Rudi Grinberg"<EMAIL_ADDRESS>wrote:

readthedocs version of sphinx seems not to like utf8 in the source so I
had to mangle your name @diml https://github.com/diml. Sorry about that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/janestreet/jbuilder/pull/78#issuecomment-301289844,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArqJuT8qrPstBMjA3TMwZFqOVNojLTWks5r5n8zgaJpZM4NaRFQ
.

Yes. In fact, that was the starting point for my port. It required lots of
manual touch ups to make it look good however.
On Sun, May 14, 2017, 7:34 AM Yaron Minsky<EMAIL_ADDRESS>wrote:

Have you considered using pandoc to convert to rst instead of changing the
format in the repo?
On May 14, 2017 12:12 AM, "Rudi Grinberg"<EMAIL_ADDRESS>wrote:

readthedocs version of sphinx seems not to like utf8 in the source so I
had to mangle your name @diml https://github.com/diml. Sorry about
that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/janestreet/jbuilder/pull/78#issuecomment-301289844,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AArqJuT8qrPstBMjA3TMwZFqOVNojLTWks5r5n8zgaJpZM4NaRFQ
.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/janestreet/jbuilder/pull/78#issuecomment-301306315,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAIe-2fbOQRiFx-KrKZKQ6atDmjGy5uzks5r5uaygaJpZM4NaRFQ
.

Thanks,  looks good! Happy to move in this direction.
@yminsky, are you thinking that the doc won't look good on github? I think updating the link in the readme and adding a pointer to readthedocs at the beginning of the manual should be enough.
For the utf8 problems, did you try using u'...'? Not a blocker but it's shocking if they don't handle unicode...
Two things i noted while looking at the preview:

the link to the examples in the quickstart is broken
the code formatting in titles should be removed, it doesn't look good

@diml all fixed.

Ok, this looks good to me. Feel free to merge

OK. So I take it you'll delete manual.org and quickstart.org at a later commit?

You can delete them in this PR