Monday, 24 April 2017

Dart SDK and Dartium 1.23.0 Chocolatey Packages for Windows

Chocolatey is a package manager for Windows similar to Linux's apt-get, based on Microsoft's Nuget tool and Powershell scripting language. It works from the command-line and from a WPF GUI interface.

You can install unmoderated versions by specifiying the install version during installation.
Chocolatey has also been updated with versions 1.23.0
Command line installation:
choco uninstall dart-sdk

choco install -y dart-sdk  -version 1.23.0
To verify you have the right version on your path.
dart --version
Dart VM version: 1.23.0 (Fri Apr 21 03:13:00 2017) on "windows_x64"

Command line installation:
choco uninstall dartium

choco install -y dartium  -version 1.23.0

Wednesday, 15 February 2017

Dart SDK and Dartium 1.22.0 Chocolatey Packages for Windows

Chocolatey is a package manager for Windows similar to Linux's apt-get, based on Microsoft's Nuget tool and Powershell scripting language. It works from the command-line and from a WPF GUI interface.

You can install unmoderated versions by specifiying the install version during installation.
Chocolatey has also been updated with versions 1.22.0
Command line installation:
choco uninstall dart-sdk

choco install -y dart-sdk  -version 1.22.0
To verify you have the right version on your path.
dart --version
Dart VM version: 1.22.0 (Mon Feb 13 17:39:28 2017) on "windows_x64"

Command line installation:
choco uninstall dartium

choco install -y dartium  -version 1.22.0

Saturday, 11 February 2017

Cellular Automata - Forest Fire

Cellular Automata has featured on this blog before - Conway's Game of Life. Whilst on the Rosetta Code site I stumble upon the Forest Fire model. Of course, a Dart version was soon underway - specifically designed to fit nicely on my phone's screen.

The model's rules are straightforward:

"A burning cell turns into an empty cell
A tree will burn if at least one neighbor is burning
A tree ignites with probability   f   even if no neighbor is burning
An empty space fills with a tree with probability   p"

Watch the video below, try it out here(link fixed) or view the source code.

Wednesday, 11 January 2017

Set The Title Of A Web Page in Angular2 / AngularDart

This is just a tiny snippet for Angular2 / AngularDart that I decided was worth a blog post because it is A) a FAQ and B) has lots of weird Angular 1 workarounds on the web that may be time wasting rabbit trails!

How to set the web page Title from Angular?
import 'package:angular2/src/platform/browser/title.dart';
....
 Title _title = new Title();
....
_title.setTitle(text);

Saturday, 17 December 2016

Notepad 8080 and AngularDart Update

As detailed in previous posts, I have been working on a notepad application using AngularDart. There's not been a blog post for while but it has slowly and steadily progressed.

AngularDart has had a couple of big updates since I started this and not caused any issues. So I am finding it very stable and easy to relate to Angular1. There's a lot of Angular features that I haven't used in there yet so I will continue to scour articles and samples. That said, the focus for np8080 will probably be on the end user functionality rather than the implementation technology. Adding markdown support was very easy thanks to the package on pub - the real battle was with the CSS.

I am going to continue to develop the application - I use it almost daily in the day job for notes and as a scratchpad. Feel free to raise a feature request! I am pondering making an Electron version at least for Windows.

Looks quite good on my Chromebook! Try it out at np8080.win

Finally, on an unrelated note, for a limited time my Dart book is just $5 for the ebook version!

Thursday, 8 December 2016

Dart SDK and Dartium 1.21.0 Chocolatey Packages for Windows

Chocolatey is a package manager for Windows similar to Linux's apt-get, based on Microsoft's Nuget tool and Powershell scripting language. It works from the command-line and from a WPF GUI interface.

You can install unmoderated versions by specifiying the install version during installation.
Chocolatey has also been updated with versions 1.21.0
Command line installation:
choco uninstall dart-sdk

choco install -y dart-sdk  -version 1.21.0
To verify you have the right version on your path.
dart --version
Dart VM version: 1.21.0 (Thu Dec 07 06:52:21 2016) on "windows_x64"

Command line installation:
choco uninstall dartium

choco install -y dartium  -version 1.21.0

Monday, 24 October 2016

Building A Notepad with Dart Angular 2 : Part Six

Another step in my personal 'Learn Angular 2' project... Here's some details of what made it into v0.06. I'd recommend looking at the entire project alongside this post.

Let's quickly add another function to the Text processing service:

  String getRepeatedString(String textToRepeat, num count) {
    count ??= 1;
    return textToRepeat * count.toInt();
  }

We use a null aware operator to set count to a default value and then use the string multiplication operator to do the required repeating.

The generate dialog is pretty much the same as the About dialog. It would be useful to have a base dialog class - alas I have not got this to work yet but I hope to follow it up.

There some more event stuff going on with the toolbar which now has a drop down menu (toolbar_component.html):

div (mouseenter)="show()" (mouseleave)="hide()" class="toolbarButton" 
The menu contents are hidden and shown with ngStyle:
[ngStyle]="{'display':  display}

Again, not too different to Angular 1 - just different syntax.

That's it for this time. Check the app out np8080.win and the code is on GitHub.