Enum frequencies - error UndefinedFunctionError - enums

I am trying to use Enum function frequencies but it isn't work.
Base on documentation Enum - Elixir v1.10.2
When I try to use that example:
Enum.frequencies(~w{ant buffalo ant ant buffalo dingo})
# OR
Enum.frequencies(["ant", "buffalo", "ant", "ant", "buffalo", "dingo"])
I always revive error:
** (UndefinedFunctionError) function Enum.frequencies/1 is undefined or private
I have already tried to execute that code example at iex shell, .ex file body and online Repl.
My local elixir version Elixir 1.9.4 (compiled with Erlang/OTP 22)
It seems to me that I miss some essential point at documentation, so I am looking for some pro tip ;)

The documentation what you provided is describes Elixir v1.10.2 but you use Elixir 1.9.4. Looks like the function Enum.frequencies/1 is not exist in Elixir 1.9.4 at all and this function was added in version 1.10.0 and higher. By this reason you see error. I suppose, if you need to use Enum.frequencies/1, you need upgrade Elixir to latest version or at least until of version 1.10.0.

Related

Unable to execute PHPUnit Tests in Adobe Commerce (Magento 2)

I’m running a local Docker instance of Adobe Commerce (Magento 2) with the following versions:
Magento Enterprise version 2.4.3-p3
phpunit/phpunit version 9.5.28
doctrine/annotations version 2.0.0
allure-framework/allure-php-api version 1.4.0
I’m unable to run PHPUnit tests in PhpStorm (Build #PS-223.8214.64)
The error I’m getting is the following:
Call to undefined method Doctrine\Common\Annotations\AnnotationRegistry::registerUniqueLoader()
Searching for registerUniqueLoader in the vendor directory, I’m seeing the following in Yandex\Allure\Adapter\Annotation\AnnotationProvider:: registerAnnotationNamespaces()
public static function registerAnnotationNamespaces()
{
AnnotationRegistry::registerUniqueLoader('class_exists');
}
However, class Doctrine\Common\Annotations\AnnotationRegistry only has methods reset() and loadAnnotationClass().
Is there a set of module versions I need to be at in order to be able to run PHPUnit tests? Thanks in advance for the help.
Try to change doctrine/annotations version to 1.14.2 in composer.json. It works for me.

TypeError: Updater.__init__() got an unexpected keyword argument 'use_context'

It occurred when I perform this :
updater = Updater('5502935975:AAGcE8wtPOUMXVCOI3PXr0fygpXsdaEn-HI', use_context=True)
Many Thanks!
You should revoke the token that you just posted. Also double check which version of python-telegram-bot you are using and followng the resources that PTB provides for that version.
Disclaimer: I'm currently the maintainer of python-telegram-bot.
"Down grade" or "upgrade" the python-telegram-bot to the relevant version , e.g i downgraded by using "pip install python-telegram-bot==13.7" from the lastest python-telegram-bot 20.0 version, and it worked for me,
NOTE: my version might be different from yours so use the right version that wont call the error

How to install older version of statsmodels

Is there a way to install an older version of statsmodels? Such as using pip install statsmodels x.xx? I cant find any documentation on their website about this. Thanks
I've tried using the current version but encounter errors when running the code. if i use import statsmodels.tsa.arima_model.ARMA i get the following error
statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been removed in favor of statsmodels.tsa.arima.model.ARIMA
When i replace arima_model with arima.model other lines of code will not work such as
` 2 # Build Model
3 model = ARIMA(train_data, order=(1,1,0))
----> 4 fitted = model.fit(disp=-1)
5 print(fitted.summary())
TypeError: fit() got an unexpected keyword argument 'disp'`
I'd like to revert the version of statsmodels so i can get the program to run

Compile errors when setting up Plone development environment

I'm trying to follow the walkthrough here to produce a new theme for my Plone 5.1 server:
https://training.plone.org/5/theming/theme-package.html
I'm using MacOS 10.13.6 running clang clang-1000.11.45.5 (the one that comes with XCode) and Python 3.6.4 (installed through Anaconda). I've run into some trouble since the buildout script that is produced by mr.bob doesn't appear to contain all of the dependencies, specifically plone.recipe.zope2instance==4.2.22. When I attempt to install that dependency manually, I get the following compilation error:
src/Persistence/_Persistence.c:178:5: error: non-void function 'init_Persistence' should return a value [-Wreturn-type]
return;
^
17 warnings and 7 errors generated.
error: command 'clang' failed with exit status 1
I tried upgrading to the latest version of mr.bob and the templates, then using the plonecli to create and start the buildout, but I get the same compilation errors.
There are many like it in that module. How do I resolve this so I can finish installing that dependency and finish my buildout?
Try to use Python 2.7, it's better supported by Zope and Plone.
Plone is using Python 2.7.x until Version 5.1.
In Plone 5.2 you will have the option to run Plone under Python 3, but then you have to use the WSGI-Server instead of the ZServer. For now just use Plone 5.1 with Python 2.7 as Plone 5.2 is still not finally released.

`ReferenceError: Meteor is not defined` in `meteor-client.js` Angular-Meteor Project

After an npm install which triggered meteor-client bundle during postinstall, I am receiving this new error in the browser console:
"ReferenceError: Meteor is not defined
at Object.eval (webpack-internal:///../../../../meteor-client.js:32502:3)
at eval (webpack-internal:///../../../../meteor-client.js:32507:30)
at Object.../../../../meteor-client.js (http://localhost:4200/vendor.bundle.js:1395:1)
at __webpack_require__ (http://localhost:4200/inline.bundle.js:55:30)
at eval (webpack-internal:///../../../../../clients/browser/main.ts:3:72)
at Object.../../../../../clients/browser/main.ts (http://localhost:4200/main.bundle.js:424:1)
at __webpack_require__ (http://localhost:4200/inline.bundle.js:55:30)
at Object.0 (http://localhost:4200/main.bundle.js:439:18)
at __webpack_require__ (http://localhost:4200/inline.bundle.js:55:30)
at webpackJsonpCallback (http://localhost:4200/inline.bundle.js:26:23)"
```
Triggered at:
if (Package.reload) {
Meteor._reload.onMigrate(function () {
return [false];
});
}
This behavior occurs with:
#angular/cli: both 1.6.3 & 1.6.6
meteor-client-bundler: 0.3.0
Meteor: both 1.6.0.1 & 1.6.1
I had the same issue, and downgrade as John mentioned worked for me.
If you are wondering how to downgrade your meteor app follow the instructions bellow that I've taken from how do I install a previous version of meteor JS?
1) Go to your project root folder
2) Run meteor update --release x.y.z
Where x.y.z is the desired version, for example 1.6.0
Might be related to this issue with a normal angular-meteor setup? It seems like the Meteor version 1.6.0.1 is crashing the meteor-angular setup. I was testing both project setups, with and without AngularCLI, and experienced exactly the errors described here and at angular-meteor issues.
However, resetting the project to Meteor 1.6 worked for me in both cases.

Resources