DART on Googlen avoimen lähdekoodin ohjelmointikieli, joka toimii verkkosivuilla ja servereissä, ja jolla voi JavaScriptiä paremmin hoitaa suurten verkkosovellusten koodaamisen. DART kielen kehitys aloitettiin 9/2011 ja 1.0-versio kielestä julkistettiin loppuvuodesta -2013. Nyt jo on olemassa lähes valmiit työkalut Chrome selainta varten. Blogger-blogien pitäjiä varten saamme ehkä kiintoisia Gadgetteja sivupalkkeihin ja muuta toiminnallisuutta verkkosivuille.
TÄMÄ blogi sisältää pääosin omia pohdintojani ja muistiinpanoja, eikä se varmaankaan tuo kovinkaan paljon uutta DART-kielen opiskeluun. Materiaali on pääosin KOPIOITU :( Dartlang-sivustoilta, josta kannattaa KÄYDÄ TARKISTAMASSA kielen viimeiset syntaksit.

lauantai 28. joulukuuta 2013

DartEditor; pakettien tuonti Pub:sta ja niiden käyttö.

Dart pakettien käyttö ohjelmissa on kaksivaiheinen prosessi:

Ensin ne tuodaan yaml -tiedoston avulla PUB-paketinjakelijasta käyttäjän ko. packages -hakemistoon.

Sitten ne otetaan .dart ohjelmassa käyttöön (tuodaan) import-lausekkeella.


Using Dart-packages in programs is two-phase process:

First you bring them from Pub to your packages-folder with .yaml -file.
then you use them with import-clause.

perjantai 27. joulukuuta 2013

DartEditor Keyboard Shortcuts 12-2013, from Pop-Up window in Editor

Dart Editor KeyBoard Shortcuts 12/2013
Find And ReplaceCtrl+ Shift + Fa
InlineAlt + Shift + Ia
RefreshF5a
Open Class HierarcyF4a USE
Show Key AssistCtrl + Shift + La USE
Content AssistCtrl + SpaceHelp
Extract Local VariableAlt + Shift + LLearn
Extract MethodAlt + Shift +MLearn
Quick FixCtrl + 1Learn
RedoCtrl Shift ZLearn
Rename RefactoringAlt Shift RLearn
Run ScriptCtrl + Shift + F1Learn
Save AllCtrl + Shift + SLearn
Search BoxCtrl + 3Learn
Show in FinderCtrl Alt Shift FLearn
Toggle BreakpointCtrl + Shift + BLearn
Open GlanceCtrl + F Learn __
CloseCtrl + WMenu
Manage LaunchesCtrl + Shift + MMenu
Reanalyze SourcesCtrl Alt Shift B --Menu
Who need these __NoNee
Activate EditorF12NoNeed
Backward HistoryAlt+ LeftNoNeed
Maximize Active Viev of EdCtrl + MNoNeed
Close allCtrl + Shift + WNoUse
Format ElementCtrl + Shift + RNoUse
Forward HistoryAlt+ RightNoUse
Generate JavaScriptCtrl + Shift + GNoUse
Next EditorCtrl + F6NoUse
Previous EditorCtrl + Shift + F6NoUse
Quick Switch EditorCtrl + ENoUse
PropertiesAlt + EnterObious )
No need to learn< easy to rememberObviou
CopyCtrl + CObvious
CutCtrl + XObvious
DeleteDeleteObvious
New FileCtrl + NObvious
Open Existing folderCtrl + OObvious
PasteCtrl + VObvious
RunCtrl + RObvious
SaveCtrl + SObvious
Select AllCtrl + AObvious
UndoCtrl + ZObvious

In this table is information from DartEditors keyboard-shortcyts, as they are in the end of year 2013.  Checked two times... but errors may still be...
I use them, want to learn, No-Use, or use menu instead.  Many are obvious...
For the case you do not want to memorize them all....
Check, if they are changed.  And be thankful co's this was not easy to do.. lol..
Maybe in SDK-folder there is easy copy of this information...


Here it is in Google-Docs for everybody to see and comment.
.

torstai 26. joulukuuta 2013

Just working; Future, event, Stream

Small code samples.. and again losing hours to stupid things...
Futures, events, strems...


& Planning new article...BIG!!   but lost appetitte on it, when losing five minutes when
trying to subscribe to my blog.  That article.. it might become great.. i hope.

In my Wordpress blog I use to write 10 articles at a time ( FuckWordressNewStyle_01... FuckNewWordPressStyle_10)  then you can fast take one of these, to write, what you want to.

Now I was close to do the same in Blogger.   lol  I DONT want to lose time.
.

perjantai 20. joulukuuta 2013

Pub dartlang path dependencies, how to use them locally without publishing in pub

Nice: with path dependencies I can locally tie 4 my packages together, so that they can use each others resources during developement, without publishing in Pub. One of them is kinda "base_library_routines",  one totally independent, and 2 closely tied-together-programs. 
Path: C:/Users/Public/myproject/base_library  is quite obvious.(not to me ) points to folder, where .yaml-file is. 

Now I can produce much reusable code. Changes in one package are immediately visible in other packages. 

http://pub.dartlang.org/doc/dependencies.html#path-packages

This was not right away obvious to me.. tried many paths..  lol 

Now seems it rquires still some get/build..  something missing from one of them...Not clear, in which order this should be done.

baselib   resources, that other packages use
prog_new, prog_old   are tight tied together and are meant to use each others resources,
they are html / browser based.  

prog_poly   is polymer based, and it is not clear to me, how I make it a package,

.yaml file is place, where I announce these path-dependencies, in overvew, and/or source-screen. 
This is the way I will work with all my coming programs. 
.

torstai 19. joulukuuta 2013

Some notes: what I know about Pub package manager:

Dartlang Pub is complicated system.. for beginner..  I have problems in start phase..
Most problems are my own errors: Testing Pub without reading/understanding instructions. Sometimes may also be, that Pub is out of order/anfunctional, when I do tests...
So I collect some poits, to deepen my knowledge of Pub and to solve my -dawo problems.
Check original text.. http://pub.dartlang.org/ this all is subject to changes!! 
-------------------------------------------------------------------------------------------------
What do I want to ask? 
1.  Is Publish the only way to push new version to my local package-folders?
2.  Does Pub use my local folders this way:
- Web, to start/rule package & main / entrypoint?
- Lib, to actual create packages content?
- Example, for others to use my package easily?
- Build, to show me, how my package looks out?
This, because global picture of folders, is still little unclear to me...
Question: is my package (which others use) a combination of web & lib folders??
--------------------------------------------------------------------------------------------------
http://pub.dartlang.org/doc/  Getting started:   My comments on red. 
reuse existing Dart code and bundle your Dart apps and libraries 
Import one or more libraries from the package:
If your app wants to use pub packages, it needs to be a package too.
An application package only consumes packages but doesn’t itself get reused. 
To turn your app into an application package so it can use other packages, you just need to give it a pubspec
The simplest possible pubspec just contains the name of the package.
Most packages just define a single entrypoint whose name is the same as the name of the package.      !!!!!!!!!
import '../../lib/parser.dart';
But that’s a pretty nasty relative path. 
When you are ready to upgrade your dependencies to the latest versions, do:  Ugrade. 
YES.   All seems quite clear. ===================================
http://pub.dartlang.org/doc/dependencies.html  Dependencies. 
 For library packages, you specify the range of versions of that package that you allow. 
allows any version, and looks it up using the default source, which is this site itself.   MEANS WHAT?  Ou!! it means pub-html-page... :)
the “live” version of that package on your local file system.
Relative paths are allowed and are considered relative to the directory containing your pubspec.
you cannot upload a package to pub.dartlang.org if it has any path dependencies in its pubspec.
Git & bVersion constrains.. Clear!!  Dev dependencies:  Clear.

http://pub.dartlang.org/doc/pubspec.html  Pubspec Format.. Quite clear.
Each time you publish your package, you will publish it at a specific version. Once that’s been done, consider it hermetically sealed: you can’t touch it anymore.

http://pub.dartlang.org/doc/package-layout.html      Package layout conventions
Many packages are library packages: they define Dart libraries that other packages can import and use. These public Dart library files go inside a directory called lib.
Most packages will define a single library that users can import. In that case, its name should usually be the same as the name of the package,
 Entrypoints—Dart scripts with a main() function—cannot go in lib.    !!!!!!!
much of a package’s code is internal implementation libraries that should only be imported and used by the package itself. Those go inside a subdirectory of lib called src
you should never import from another package’s lib/src directory. 
Web files:    Also, and this is important, any Dart web entrypoints (in other words, Dart scripts that are referred to in a <script> tag) go under web and not lib
Command-line apps:   can be run directly from the command line. These can be shell scripts or any other scripting language,   .... put it in a directory named bin.
Example:  Standalone example programs that use your package, of course!
This is an important place to consider using package: to import files from your own package. That ensures the example code in your package looks exactly like code outside of your package would look.
Tool: Mature packages often have little helper scripts and programs that people run while developing the package itself. Think things like test runners, documentation generators, or other bits of automation.

Assets and Transformers  http://pub.dartlang.org/doc/assets-and-transformers.html  The pub serve and pub build commands use transformers to prepare a package’s assetsto be served locally or to be deployed, respectively.  Ou!!  Seven screens... I leave this in side now.. hope not need this ever... BUT: I can put my empty folder structure here!

Commands:   Build:  generates the assets for the current package and all of its dependencies, putting them into a new directory named build.
Pub also automatically compiles your Dart application to JavaScript using dart2js.
Cache:  lists information about packages currently downloaded into your system cache
Get:  Check later... must be all clear...
Publish;  All files in your package will be included in the published package, with the following exceptions:  If you aren’t using Git, all “hidden” files (that is, files whose names begin with .


To be on the safe side, pub publish will list all files it’s going to publish for you to look over before it actually uploads your package. GREAT!! I CAN "ALMOST" PUBLISH...
Options
--dry-run or -n

With this, pub goes through the validation process but does not actually upload the package. This is useful if you want to see if your package meets all of the publishing requirements before you’re ready to actually go public.  
Upgrade:   gets the latest versions of all the dependencies   TL:DR  lol 
Serve: This command starts up a development server, or dev server, for your Dart web app.
Hope never need this... 
So going now to "try" publish.. to 0.0.02.

lauantai 7. joulukuuta 2013

Import files from other folders (parallel folders) in Dart. How to?

How can I import (NOT part/partOf) dart files from parallel folders?
|lib/src/myLib.dart
|web/myProg.dart     How can myProg import myLib ?
DartEditor have some problems in parsing URI:s.. i think..?

?? import '/C:/Users/Public/daw_pubtest/...'  lol   seems strange!  I have tried several hours to guess, how this is done. NEVER would have guessed this /C:   -thing.

http://stackoverflow.com/questions/12951989/how-to-reference-another-file-in-dart
Here.. in second answer was this:
import 'someDartFile.dart';
If you have on Windows a library at: K:\SomeDir\someFile.dart you will need to write:
import '/K:/SomeDir/someFile.dart';

http://stackoverflow.com/questions/12325488/importing-library-in-dart-on-windows
This page have same kind of answer.

Problems rise:  My heart is aching.  My mind is cloudy.  Coffee dont taste as it should.
Use this solution?  Is it nice?  Do's it work in my dawo package?
More reading:  Read these again.  Read issues.   7 webpages talk the same thing. Read.
Do.  Try it in your dawo package.. even if coffee tastes bad :(
Be a man..  and put all your 147 files in same folder :(
Read;  Pub layout conventions.. lib/src
Study other packages; How they did it.
Live in hope, that you are dumb.  I hope I have missed something very obvious. I confess, that I am not very eager to read instructions...
But I can use it test and example folder also.

I really hope that it is not this difficult.  If beginning Windows users must do this, so it is very big misery.
x   Waiting for better solution...
This can also be a security measure.. you can't let Dart mess freely in users folders..?


keskiviikko 4. joulukuuta 2013

What are you doing in package world? Just collecting errors.

Maybe I should delete all erraneous stuff immediately?  I keep separete folder: error_coll, where is now:  Dart_Web_Toolkit and google_Task_Api (My error).
Somehow I should get my mind over these errors to be able to work again...

Many of these errors seem to be related to my way of keeping My_package_testing_programs in subfolders. So it works if i put extra yaml-file to my collection_of_nine_separate_packages -folder, where i name again all packages, that are used in subfolders.
Second problem might be: maybe some of packages are dependent on older versions of other packages.  hop?  bot?
Reanalyze sources might correct something.

http://www.youtube.com/watch?v=Gs7MBnoFu9k

Was macht der Maier am Himalaja?1927


Got in editor:  57 problems, 297 warnings. 254 hints.  Mainly just testing packages from pub, very little anything own.  DartEditor is slow to analyze.  What to do?

pop-pop-win-1 have 17 problems, 132 warnings.
Package bot is empty. ( in bot_io and bot_web is needed stuff.. I suppose).
Multiple markers at this line.   - 'const' variables must be constant value.    aso.

my own dawo-package;  22 problems, 17 warnings.  AUTS!  it was here.
mainly because DartEditor can not find url:
Target of URI does not exist: 'lib/src/dawo_base_lib.dart'   AUTS!   AUTS!!


in polymer_dart_examples are many errors. So in my polymer_test.
These packages that i take in zip mode from github, should be updated more often.

So now dealing with these errors...  when do I get my package out? :(
.