Worker package disfunction when importing postgresql package - dart

I'm trying to use the Worker package and the PostgreSQL package.
I'm not sure why but if I run the example in
https://diegorochablog.wordpress.com/2014/02/18/worker-dart-concurrent-programming-does-not-have-to-be-hard/
After changing nothing but adding an import statement: import 'package:postgresql/postgresql.dart';, The example stops working (the task's execute is not called).
Dart VM version: 1.17.0-dev.4.1 (Thu May 19 11:21:39 2016) on "macos_x64".
pubspec.yaml
name: fibFuturesConcu
version: 0.0.1
description: A simple console application.
dependencies:
worker: any
Update
Apparently it does not happen with the stable version of Dart (1.16.0).

The problem is gone when using Dart Stable 1.16.

Related

Serverless Version Upgrade Name resolution errors

I was trying to update the serverless version for my project from 2.72 to 3.x. Hence I started working on the resolution of the deprecations warnings. All are gone except of the following.
Cannot resolve variable at "resources.Resources.ApiGatewayAcessLogsSubscriptionFilter.Properties.DestinationArn": String value consist of variable which resolve with non-string value
The variable inside the serverless.yml is referenced as follow
{self:custom.localEnvironment.logs-destination.${self:provider.region}}
The custom section of the serverless.yml is defined as follow:
custom:
localEnvironment:
logs-destination:
region-x: "**** destination log group"
Environment Information
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.20.0
Framework Version: 2.72.3 (local)
Plugin Version: 5.5.4
SDK Version: 4.3.2
Components Version: 3.18.2
Note env says version is 2.72.3 but to enforce the new name resolver I am using the following in the file
variablesResolutionMode: 20210326
I looked for various resources on the serverless forums, didn't find something which match exactly with my situation. Though I have found the following un-answered question
https://forum.serverless.com/t/variables-resolution-errored/16999
P.S. New to the community please feel free to edit the question.

Why can't I see the deployed model in CVAT UI but see it in Nuclei Dashboard?

I have deployed CVAT (Server version: 2.2, Core version: 5.0.1, Canvas version: 2.13.2, UI version: 1.37.0) and Nuclio (with CLI version : 1.5.16, Git commit: ae43a6a560c2bec42d7ccfdf6e8e11a1e3cc3774, OS: darwin, Arch: amd64, Go version: go1.14.3) on a Mac.
Everything runs quite well but the serverless function (deployed from terminal).
I see the model deployed on the Nuclio Dashboard but I don't see this function on the Models page of CVAT.
I had been following https://openvinotoolkit.github.io/cvat/docs/manual/advanced/serverless-tutorial/ to deploy. In addition to the commands in this tutorial, I have to add the argument "--platform local". For example, nuctl get functions --platform local else it would yell me with some error.
Lastly, when I deployed the function "SIamMask" I added a port number to the "triggers" section of the Function.yaml like such:
triggers:
myHttpTrigger:
maxWorkers: 1
kind: 'http'
workerAvailabilityTimeoutMilliseconds: 10000
attributes:
port: 32003
maxRequestBodySize: 33554432 # 32MB
Any thoughts?

Spyder not handling relative imports

I am attempting to python3 proof my work and spyder seems to be having an issue with absolute_import.
For demonstration purposes I created two simple files. caller and callme
caller
from __future__ import absolute_import
from .callme import helloWorld
def runme(msg):
helloWorld(msg)
if __name__ == "__main__":
runme('It worked!')
callme
def helloWorld(msg):
print("helloWorld's message is '{}'".format(msg))
if __name__ == "__main__":
helloWorld('Hi')
When attempting to run caller from spyder I get the following error:
ValueError: Attempted relative import in non-package
Running from ipython via the anaconda prompt (python 2) or from jupyter notebook (running python3 or python2) both work properly.
Ideas on how to fix spyder's behavior so it properly recognizes absolute_import?
Spyder versions tried:
3.2.4 Python 2.7.14 64bits, Qt 5.6.2, PyQt5 5.6 on Windows 10
3.3.2 Python 2.7.14 64-bit | Qt 5.6.2 | PyQt5 5.6 | Windows 10
Update
Updating spyder via conda update spyder (now version 3.3.2) did not fix the issue.
If you run python caller.py in a system terminal, you'll get exactly the same error as the one you posted, i.e.
ValueError: Attempted relative import in non-package
So this is not a problem with Spyder (because Spyder runs something similar to python caller.py when you execute a file with Run > Run), but with the way relative imports works.
Please see this answer for a proper explanation:
https://stackoverflow.com/a/11537218/438386
In essence, you can't use relative imports in scripts.
Note: There's a workaround to avoid this error, as described in this answer:
https://stackoverflow.com/a/11536794/438386
However, we don't have the ability to execute a script as a package in Spyder, sorry.

Cannot deploy to Google App Engine due to bad import, not in my code

I am trying to deploy an application to Google AppEngine using the beta deploy command: gcloud beta app deploy app.yaml and I have even tried to add: --verbosity=info to get more information.
Nevertheless I keep getting this error:
Failed parsing input: parser: bad import "unsafe" in golang.org/x/sys/unix/dirent.go
From what I can tell the error does not come from my code and the only external libraries I use is
gorilla/mux
sirupsen/logrus
Which from what I can tell also do not use any unsafe code. My local go version is go version go1.8.3 linux/amd64 and I am using a standard environment on Google AppEngine.
Furthermore, locally the code runs as it should.
Any ideas on what might be wrong?
The github.com/sirupsen/logrus package is using the golang.org/x/sys/unix package.
See: https://github.com/sirupsen/logrus/search?q=unix&type=Code
You can't use on Google AppEngine standard any package that uses unsafe or imports other package that use it.

dart:uri in generated Dart html pages does not run

With the latest version of dart (editor 24275) I keep getting an error re: dart:uri
This is placed in my built html:
import "dart:isolate" as FB;import "dart:uri" as MH;import "dart:json" as ............
Dart VM version: 0.5.20.4_r24275 (Fri Jun 21 05:02:35 2013) on "macos_ia32"
dart:uri is now in dart:core I recall.. but my html keeps getting built with this in it and so doesn't run in Chromium with the Dart VM
I've removed the out folder and rebuilt, does not resolve it.
Have you definitely removed all instances of import "dart:uri" from your code, whether they are stand alone Dart scripts or scripts embedded in HTML templates/components etc?
It's always good to run "Reanalyze Sources" too.
It sounds like you need to run pub update.

Resources