Executing Dart File takes too long - dart

As a newbie in dart dev , I starting by setting up my VS Code for Dart/Flutter .
When I try to run a simple Dart program ( just to check everything works fine printing sum of 2 int 4+6 )
PS B:\Flutter> dart .\Sum_Course_Exemple.dart
'git' is not recognized as an internal or external command,
operable program or batch file.
Building flutter tool...
Running pub upgrade...
4+6=10
These lines takes too long to show the output .
Am I doing something wrong ? why it's taking 3min to show that output for a simple code ?

Either Flutter or pub is trying to install or upgrade dependencies, but this relies on Git, which you do not have installed.
As a result, the Flutter SDK tries to perform some first-run initialisation every time you run your program, which is why it takes so long each time.
Git can be obtained from its website.

Related

simple program output does not appear anymore in command window after python upgrade

I have been running simple programs with python3.4 without trouble, directly typing the program name (without the .py extension) from a command shell, in the directory where the python scripts are located. The expected output would then appear in the shell, and upon termination of the program the next prompt appears, as expected. I recently upgraded to 3.6.4 to develop more complex applications using NumPy and pandas. since the upgrade however, running the same programs still work (e.g., I can see the tk windows appear and behave as before), but the next prompt immediately appear in the command window while the program is still running, and the expected output from simple print statements is redirected somewhere (where?). On another hand, running the program by typing 'python program_name.py' rather than just 'program_name' works as before, with the output appearing in the command window as expected. what configuration settings could have been present with 3.4.0 and missing with 3.6.4 that would explain those discrepancies? Thank you.

Troubleshooting Lua "qdbus" command via os.execute()

I'm using ArchLinux/KDE/Plasma and I'm trying to program a lua script (as a plugin in TeamSpeak 3) that will execute the following command, which works in my terminal emulator, but not via a Lua script (that seems to be running as the same user).
The following fails:
os.execute("qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Pause")
I'm wondering if it's a permissions or library requirement? I know os.execute is working though, because I can run system notifications. I've tried alternative commands like machinectl, but those fail as well. I'm very new to Lua, do I need a dbus library? If so, I have no clue how to implement it.

What does 'pub run' differs from normal execution?

I find there are some differences that I can't figure out which nor how when executing a binary withpub run bin_executable.dart args rather than dart bin/bin_executable.dart args.
Execution is notably slow in the first form, and the output is worst, sometimes erroneous...
I searched here but didn't find anything useful. Any help?
pub run bin_executable.dart runs pub, and pub starts an new process that runs dart bin_executable.dart
There was a recent change that allows pub to run bin_executable.dart in a new Dart isolate instead of a new process. That might make it a little faster but I think the main purpose is to allow to attach a debugger to debug bin_executable.dart when run with pub (especially for pub run test)
I assume the main part or the slower execution is the start time for pub

Error while running pub deploy: Cannot read link

I'm trying to run pub deploy command in my Dart project, but it always ends with this error: "Pub deploy failed, [1] Cannot read link". No more information outputs into console.
I tried to run it in basic Dart browser project (the one with text reversing), but same error occurred again.
Did anyone have same problem? Any ideas how to fix it?
I have the same issue.
In my case, the Dart project is stored in NTFS hard drive (I share it with Windows OS) and Dart deploy (run from Eclipse) runs on Ubuntu.
Simply move the Dart project to Ubuntu hard drive then things come back to normal.
GS
This is probably a problem with the packages symlinks. If you delete them and run pub install it should work again.
According to dart-sdk/lib/io/link.dart:
On the Windows platform, the link will be created as a Junction
On other platforms, the posix symlink() call is used to make a symbolic link
On Linux platforms, storing Dart project in NTFS drive causes Pub to fail. Because posix symlink() is used on NTFS partition and doesn't create a valid NTFS junction point.
The solution is to move the project folder to a partition that uses posix symlinks natively, such as one formatted to ext4.

Eclipse freezes when erlide tries to run

I'm just getting started with erlide, using a fresh install of Eclipse Juno and erlide. I've used erlang on my system (64-bit Fedora) from the command-line, so I'm just trying to make the switch. I started with R15B, and have upgraded to R15B02 (built from source) as suggested by another SO post. If I right-click on a .erl file and pick Run As..Erlang Application, the IDE freezes and I have to kill it. If I try to run from Run Configurations and specify the module and function, it will start to execute, but never progresses beyond 27%. This is on a simple function that runs instantaneously on the command line.
Please try with the latest nightly from http://erlide.org/update_nightly, we did some work about similar issues, I hope they will solve yours too.
It would help to see the log from /erlide.log.
You can also open the launch configuration from run->configurations and see if there is some weird value in any of the fields in the "runtime" tab, most probably the node host name.
[I will be away for a week or so, so I can't answer very soon. Sorry about that.]
/Vlad

Resources