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 8. joulukuuta 2012

DART-yhteisö Google+ palvelussa

Tässä se on:

                                       Dart-Community in Google+ 




TIETOJA

This is a place to talk informally with other Dart developers. 
 Other good places: - dartlang.org - dartlang.org/mailing-list - stackoverflow.com - dartbug.com

.

torstai 29. marraskuuta 2012

Dart suomeksi. Dart:in suomentaminen. DartLang Tour suomeksi.


DartLang Tour käännettynä suomeksi.

Chapter 2. A Tour of the Dart Language:    Suomeksi, suomennettuna..      


Olen kääntämässä (vastoin parempaa tietoani) DartLang Tour-tiedostoa suomeksi. 
Alkuperäinen engl. tiedosto on tässä:  


Keskeneräinen käännöstyöni, joka alkaa olla valmis, löytyy tästä linkistä: 



Ohjelmoijat eivät tarvitse käännöstä suomeksi.  Ne, jotka aikovat ohjelmoijiksi, kyllä opettelevat englantia. Tämä on siis vain satunnaisia ohikulkijoita varten. Ja heille, jotka ovat vasta alkamassa opiskelua.


Programmers don’t need translation from english, they can read, and think on it.
Those who want to be programmers should quickly learn english and use it.
So this is for casual bywalkers..


torstai 27. syyskuuta 2012

Getters and setters IN DART


Getter and setter methods provide read and write access to internal object state. When calling a getter or setter, omit the trailing parentheses. Define getters and setters using the getand set keywords.
class Rectangle {
  num left, top, width, height;

  Rectangle(this.left, this.top, this.width, this.height);

  num get right()           => left + width;
      set right(num value)  => left = value - width;
  num get bottom()          => top + height;
      set bottom(num value) => top = value - height;
}
Use explicit getters and setters just like you would use the generated getters and setters from instance variables.
var rect = new Rectangle(3, 4, 20, 15);
assert(rect.left == 3);
rect.right = 12;
assert(rect.left == -8);
With getters and setters, you can start with instance variables, later wrapping them with methods, all without changing client code

Methods in DART


Methods are functions that provide behavior for an object.
Instance methods on objects can access instance variables and this. The distanceTo() method in the following sample is an example of an instance method.
#import('dart:math');

class Point {
  num x, y;
  Point(this.x, this.y);

  num distanceTo(Point other) {
    return sqrt(((x-other.x)*(x-other.x)) + ((y-other.y)*(y-other.y)));
  }
}
Here’s how you invoke the distanceTo() method on an instance of Point:
var point = new Point(2, 2); num distance = point.distanceTo(new Point(4,4)); assert(distance < 2.9 && distance > 2.8);





Simple DART DEMO, Yksinkertainen DART esimerkki ohjelma

// Simple DART demo to show use of Control Flow-structure and varables
 // that give it some control control. Done with Editor 12784 27.9.2012
 // This is gonna be changed during coming days... Not happy with it..
 // Also here is simple class and its instance in main structure.
 // When buildin first DART programs it is better to begin with these small ones...
// Output of this is seen in editor Output windows


#import('dart:html');

var jobs   = ['+1-Coffee','+2-Play Computer','3-Read Posts','4-Window watching','5-Hmmm'];
num jCount = jobs.length;
num jNow   = 0;


class Listjobs  {
//   not so elegant...

  num doJobs()   {
  num     _i      = 0;
  for (_i = 0; _i < jCount; _i++){
    print('Job To do now:   ');
    print(jobs[jNow]);
    print('OK.');
    jNow = jNow + 1;
  }
  return(jNow);
  }
}


void main() {

print('listing jobs...  $jCount');

var myListJobs = new Listjobs();
myListJobs;
myListJobs.doJobs();

  print(' Lets DART AGAIN!!  ');
}


In try dartlang  http://try-dart-lang.appspot.com/   this seems to collect 5 errors,
but in my editor it runs without errors...

tiistai 25. syyskuuta 2012

Yksinkertainen TODO ohjelma DART-kielellä

Building a simple dartlang TODO app +Victor Savkin put together a cool screencast for building a TODO app with #dartlang and +JetBrains WebStorm IDE. Victor used his SimpleMVP framework: http://github.com/vsavkin/SimpleMVP

Aiheeseen liittyvä video on linkissä:  http://vimeo.com/49728673

Siinä esitetään  havainnollisesti ohjelman teko.


keskiviikko 29. elokuuta 2012

Can't send FeedBack in Dart Editor. Palautteen lähettäminen DartEditorissa ei onnistu.

Maaliskuusta lähtien palautteen lähettäminen on onnistunut.. en onnistunut selvittämään, miksi se ei aikaisemmin onnistunut.


Ongelman pohtimista aikaisemmin:  
Hmm.  This might be related to:

This versions of dart seem to demand  Java 6 !!
You have not jre,  or Java development kit; jdk.
I installed jdk  under my dart program directory, and now it works

or:   Try DartEditor in Linux/Ubuntu system....


And same in finish language:
Ja sama suomeksi:

Palautteen lähettäminen Dart Editorissa ei onnistu.  Editorit 10994,  11397

Ratkaisu:  
Ehkä Sinulla ei ole jre, Java Runtime environment
tai                           jdk, Java Development Kit  
Nämä DartEditorin versiot siis taitavat vaatia   version   6 noista edellämainituista.

Tai:     Asenna koneeseen Linux, vaikka Windowsin sisälle ja käytä Editoria sieltä.

kokeilin lopulta kaikenlaista, sorkin joka paikkaa.. ehkä uusi editorin versio korjasia asian...
.

Ongelma Dart-editorin asentamisessa. RATKAISTU

(Huom, nämä DartEditorin versiot näyttävät vaativan jre tai jdk version 6.  Kun latasin JDK 6:n dart-hakemistooni, niin kaikki näyttää toimivan hyvin.)
Klikkaan editorin asennuspaketin kuvaketta (darteditor.exe)  se avautuu, logo näkyy noin 5 sekunnin ajan, sitten Editori antaa pitkän virheilmoituksen:  
"   \DartEditor\.metadata" is read-only.  " 

Tällainen voisi liittyä ongelmaan, joka minulla oli editorien 10994 ja 11397 kanssa:

Windows Defender esti DartEditorin asentamisen, eikä edes antanut mitään varoitusta tai tiedotusta siitä.  Ei, vaikka olen koneeni "Administrator".  

DART-editori asennetaan toistaiseksi muista ohjelmista poikkeavalla tavalla; Siinä ei ole erillistä asennusohjelmaa, VAAN käyttäjän on avattava se "Windows pääkäyttäjänä", Administraattorina.  

Vasta kun avasin kuvakkeen vartavasten hiiren OIKEAN painikkeen kautta "Windows Administrator:ina", sain asennusohjelman käynnistymään.  Sitten minun piti normaaliin tapaan vastata:  "Kyllä, haluan antaa tämän ohjelman tehdä muutoksia koneeseeni"  

Nyt näyttää siltä, että minun on jatkossakin avattava DartEditori AINA Administratorina.  Toisessa koneessani ei tätä ongelmaa ole, koska olen ymmärtänyt laittaa Windows Defenderin pois toiminnasta.  Myöskin tämän koneen Linux/Ubuntu puolella asennus sujui ongelmitta.  
Eiköhän tämäkin ongelma ratkea joskus...

Kysyin neuvoa tähän ongelmaan Dartlang keskusteluryhmässä:  
Dart Editor FirstRun and missing User\Settings File 


Minä törmäsin tähän ongelmaan, koska tavallisessa koneessani en käytä *Windows Defenderiä.  Siksi se pääsi yllättämään niin pahasti toisessa koneessa. 

Ohjelmoijat eivät yleensäkään käytä Windowsia juuri tämänkaltaisten asioiden takia. 
Suosittelen Linuxia.

Huom!   Nämä DartEditorin versiot näyttävät vaatiivan jre tai jdk 6-version.  
Asensin JDK:n (Java Development Kit) 6:n  dart hakemistooni, ja kaikki näyttää sitten toimivan hyvin. 



Problem installing Dart Editor, caused By Windows Defender. Solved.

Click EditorFile to install it, Logo is seen for 5 seconds, then you get long error message:  
"   \DartEditor\.metadata" is read-only.  " 

This might be connected to same problem, that I had with editors 10994 and 11397. 

Windows Defender prevented DartEditor/installation from launching, and WD gave no warning or information about it. Editor logo was  visible for 5 sec, and then I got DartEditor error message..  And I am The administrator in computer.  

When I launched DartEditor "as Windows administrative"  and answered: "Yes I want to allow this unknown program to ....", I got it installed.  Now I must use this option also when launching editor, but I hope it will be solved soon... 

I asked about this in:  Dart Editor FirstRun and missing User\Settings File 
.

tiistai 28. elokuuta 2012

DartEditor (11434) in windows7 Vista with Problems

Cant Launch DartEditor, it can't create Settings Folder, because: "Read Only"   ??
Settled partly:  Look at the end:  

Editor 11434  Loaded To my bigger computer, HP,  OK.  (tought it was 11397---)

In smaller PB, also windows Vista, same problems contiunue...

DartEditor dont start...  It cant make its settings file to <users personal folder>
I try to move folder from my HP, no succes.
    .metadata is read only...

So, what next?   Go to work?   No.   Seems I like to be stucked with problems.  Can't leave them behind.       And I know that only stupid and lazy people use Windows.  I AM ashamed.
Any plans?  little something:

A.   Do check, what are the differencies between my 2 computers.

B.    Try, try, boy...  stuck your head to thick wall.. (never ever even dream of reading instructions).

C.     Conflicting with Eclipse?  so. settings...  And why are Dart folders full of Eclipse stuff?
         I thought i read ALL dart material, but this Eclipse thing i must have partly missed...

D.     Windows security / FireWall, and so.

E.       In HP /DartEditor I can not send FeedBack to Editor Group!  Why?
          How can i send mail directly to EditorTeam?  where can I find their GMail @ ?

..to be continued..   forever...   :)

Seems that this was all about stupid Windows Defender! 
I opened now installation file in Windows with administrative priviledges.  !!  Neither Windows or editor warned me, that I must do it.  Seems that I must now do it every time.  I AM in Windows with full administrative priviledges!  
Dart Editor is functionin, but I do not have now that    .metadata folder.  
     Maybe I should put Windows defender to sleep, when I first time install DartEditor.
In my HP-computer I do not use defender and there I did not have these problems.  

to be continued...







keskiviikko 22. elokuuta 2012

Dart Editor 10994 Problem ... With Eclipse Workspace (?)

I have downloaded about 20 versions of DART editors to my 2 computers without big problems.
I Uploaded 22.8.2012  DartEditor 10994 to my HP Computer without much problems, Java just had to be updated to both computers.    

Settled partly:  Look at the end of my next blog post.  

For PB computer, Win 7, 64 Bit, i get problems.  They are maybe connected to either:
1.   Conflicting settings with Eclipse
I do have Eclipse/Java in my Public folder...

If Dart Editor and Eclipse share the same workspace directory, they'll save conflicting settings, resulting in warnings and errors from both Dart Editor and Eclipse. 
The fix: Don't use the Dart installation directory for any other Eclipse-based software.
Hmm. How is it done?

Or.   2     Missing DART settings directory in my personal Folder,  Public/ USER / DartEditor
       Folder is deleted by me.
- DART editor settings folder in <user's home directory>\DartEditor  Dont exist.


DART EDITOR.INI     File is like this in both computers:

-data
@noDefault
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx1024m


CONFIG.INI  in  DART / Configuration is in both computers:

#Product Runtime Configuration File
eclipse.application=com.google.dart.tools.deploy.application
org.eclipse.update.reconcile=false
osgi.bundles.defaultStartLevel=4
eclipse.product=com.google.dart.tools.deploy.product
osgi.splashPath=platform:/base/plugins/com.google.dart.tools.deploy
osgi.bundles=org.eclipse.equinox.simpleconfigurator@1:start
org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/bundles.info

AND THIS CONFIGURATION FOLDER IS FULL OF ECLIPSE STUFF   WHY?


.Eclipseproduct file:

#Eclipse Product File
#Mon Aug 20 11:42:11 PDT 2012
version=1.0.0.201208201142
name=Dart Editor
id=com.google.dart.tools.deploy.product



=======================================================
When I try to run Dart Editor, I can see DART logo for 5 seconds,  then I get error log :

!SESSION 2012-08-22 17:40:03.005 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_01
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fi_FI
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data @noDefault

!ENTRY com.google.dart.tools.deploy 4 0 2012-08-22 17:40:12.126
!MESSAGE The folder "C:\Users\  *MY_OWN_DIRECTORY_*    \DartEditor\.metadata" is read-only.
!STACK 0

*   *    *    *    *     And much other stuff here.....

========================================================

The File:   C:\Users\  *MY_OWN_DIRECTORY_*    \DartEditor\.metadata" is read-only...
BECAUSE...   I have deleted The directory.     Why?
BECAUSE...   I had problems with Java and coult not run editor...
Got Java updated, and NOW editor could run,  BUT...

...   There is a conflict with   ECLIPSE..??   wich  I dont want, and wich  I dont need.

IT SEEMS THAT DART EDITOR CANT RECOVER FROM THIS.
Maybe Dart Editor cant create new     User\DartEditor    folder....
It cant do itself a new metadata....

In case that this could bring problem to other users, i had to make this public. 
Trying to find answer:

1.  I hope that someone who knows things, reads this, and could gave the right solution.

2.  Maybe I wait for the new editor version to solve this....
     Check this 64 or 32 bit system in your computer, and load THAT editor.
      Load bleeding edge versio every day, and try it...    23.8. it did not help.

3. Should I file a BUG or ask in Google+/DART?  When I know exactly WHAT to ask.

4. Try to UNDELETE that METADATA-file....    No possible. 
     Copied it from another computer, no succes. 

5. Compare DART in my HP-computer to DART in my PB-Computer, and....

6.  Forget this and load DartEditor to LINUX-system in my PB-Computer..    Works.
      But I did not forget this....

7.  Read these and other articles....
http://blog.dartwatch.com/2011/10/step-by-step-building-dart-eclipse-ide.html

https://plus.google.com/107675318329982835686/posts/W73PjjuZ7Qi

8.   Delete   ALL DART FOLDERS AND FILES  and hope that new installation will correct things.
      So that it acts like a new application....  Start from new....  Did not work. 
22.8.2012  klo  21.46   UIT +2  Helsinki  Time:
I DELETED  *ALL*  DART FILES AND FOLDERS FROM MY COMPUTER.  LOADED DART AGAIN.  RUN IT.   FAIL.   What then...  Go to  Ubuntu.... ?
      Maybe Dart should have an Uninstaller  ??

9    Try with other windows user profile.     No succes.  Same errors.

10.  Find OLDER VERSION of editor and hope that it makes directories, where all Dart Editor settings are saved.  And THEN the new versio...

11.   Delete temporarily Dart-settings directory in my other, HP-computer. Do I get an error? 

12   http://code.google.com/p/dart/issues/list?can=2&q=label%3AArea-Editor
       Did read it, no help.

13.   Is there a "first run" -option in Dart Editor?

14.   Loadeddart to my personal folder.  No Succes.
        Deleted all Java-Eclipse applications.  No Succes.
 
15.  Be clever and try to think something new answer.

And if i can make some useful material out of this for other users, so I must  File BUG /  Ask it in Stack Overflow /  or  ask in Dart Discussion..  so. collect all facts concerning this case..
But first I must understand what is essential in this matter.

In Linux / Ubuntu  Dart Editor loaded and run without problems in my PB-computer.  But it does not solve this problem.   But before I start disturbing Dart group programmers, I really must read everything in here:   http://www.dartlang.org/docs/editor/getting-started/
I wish I had more time and patience.   :(

I tried to send FeedBack to DartEditor team, from my HP-Computer, where DART is functioning.
I can not send FeedBack from Dart Editor!!  Is 2 pages too much?    Even 3 rows cant be sent.
And error message box is put UNDER text, so that I cant quit it... Without going to Windows Work-Control.

Now it seems I have very little that I can try...    exept to stop trying...
I mus do another blogtext,  some text have already disappeared from this file....


27.8.    FOUND THIS:      http://code.google.com/p/dart/issues/detail?id=702
Dart Editor as an Eclipse plugin [+10]
Is this accidentally  loaded to my PB-computer.  I read this and I must have pressed link.  !!    And now Editor thinks it is Eclipse Plugin?!

https://groups.google.com/a/dartlang.org/forum/?fromgroups=#!topic/misc/XQMT0FVLt_A
Dart Editor Plugin for Eclipse (Alpha) 15 viestiä 8 käyttäjältä ryhmässä Dart Discussion

27.8 Deleted all ALL!  *DART*  material from PB-computer.  New Download.  No Work.  :(  

28.8.  So the problem might be there in the  "Other, quick installation", The "Second Click".  Seems that  in PB i do not have that   MyPersonalWindowsAccount \ darteditor folder...  .metadata ...
When in UBUNTU it works, so this might be  WINDOWS-related problem ?  

By asking in Dart Discussion croup I wanted to close away some alternatives...
https://groups.google.com/a/dartlang.org/forum/?fromgroups=#!topic/misc/os00Yjx_UVs
Maybe I did not quite success....

Altogether, this must be something very simple and stupid mistake here, but I just cant figure it out.

Disabled Windows Defender.  No help.  New Editor 11397, same Problem.
DartEditor dont now make this  "Settings Directory.
!MESSAGE The folder "C:\Users\   <user's home directory>  \DartEditor\.metadata" is read-only.
!STACK 0
java.io.IOException: The folder "C:\Users\   <user's home directory>           \DartEditor\.metadata" is read-only.  







Yksinkertainen DART-koodi Videon esittämiseksi ja siihen liittyvä keskustelu


    Dart keskustelussa on yksinkertainen esimerkki videon esittämisestä:
    show a simple video using VideoElement
      #import('dart:html');

      void main () {
      var videoClip = new VideoElement();
      videoClip.src = "http://slides.html5rocks.com/src/chrome_japan.webm";
      videoClip.height = 100;
      videoClip.width = 100;
      videoClip.on['canplay'].add((_) {
      videoClip.play();
      });
      document.body.nodes.add(videoClip);
      }
Pastasin tämän koodin editoriin:  10993  ja se toimi. 


Bob Nyström esitti paremman version:   (joka tosin ei toimi minulla...  piti palata edelliseen )
    Vanhempi editori vaati päivitystä, ennenkuin suostui ajamaan koodin. 

keskiviikko 20. kesäkuuta 2012

Kuinka opiskelen Googlen uutta, verkossa toimivaa DART-ohjelmointikieltä


Ohje yksinkertaisimmillaan on:
DartLang    http://www.dartlang.org/    Lue KAIKKI, mitä täällä on.  
.                                                              Ja lue se sitten uudestaan.  
Tämä sivusto on TÄYNNÄ linkkejä.  Ne kannattaa kaikki käydä läpi, mukaanlukien artikkelit ja dia-esitykset.  Siellä on myös linkit DART-yhteisöihin eri verkko-palveluissa.  Ja kannattaa käydä läpi eri henkilöiden pitämät DART-blogit jotka löytyvät sivupalkeista.  Suomenkielistä aineistoa, tai sanastoa ei taida olla, joten englannin kieli on välttämätön. 

ja uutiset:   http://news.dartlang.org/
Editori kannattaa ladata:  http://www.dartlang.org/docs/editor/
Niin pääsee heti koodia kirjoittamaan ja ajamaan verkossa.


Aloittelijalle sopivin sivu opiskeltavaksi on luultavasti:
http://www.dartlang.org/docs/language-tour/   missä on syntaksit ja hyviä esimerkkejä.



Language Specification   http://www.dartlang.org/docs/spec/index.html    

Sisältää kaiken kielestä, mutta se on ehkä  aikalailla tekninen ja varsin kryptinen sivusto...  


https://groups.google.com/a/dartlang.org/group/misc/topics  Ohjelmoijien teknistä keskustelua kielestä..  

Varsinaista aloittelijoille tarkoitettua HELP-deskiä ei oikeastaan vielä, 6/2012 ole.  Itse pyrin olemaan häiritsemättä ohjelmoijien työtä ja esitän kysymyksiä VAIN kun on ehdoton pakko ja VASTA sitten, kun olen itse ensin lukenut kaikki mahdolliset sivustot.
     MUTTA Googlen ohjelmoijat ja DART-käyttäjäyhteisön jäsenet ovat intoutunutta ja fantastista porukkaa ja he vastaavat nopeasti kaikkiin kysymyksiin sekä G+, että keskustelupalstalla.   Myös aloittelijoiden esittämät, ns. 'tyhmät' kysymykset ovat sallittuja.  Nehän selventävät ja syventävät kaikkien näkemystä asioihin.   StackOverFlow on myös hyvä paikka esittää kysymyksiä.

Ja Blogi http://c.dart-examples.com/home   on myös hyvin havainnollinen, ja siellä on myös mahdollisuus suorittaa kielen koodi klikkaamalla TRY-dartlang-sivustolla.  Tämä on yksityisen henkilön pitämä blogi ja hänellä on hieno opettamisen asenne ja taito.  Vaikka sivusto on vasta alussa, niin odotan, että siihen tulee paljon hyvin opettavaista materiaalia.

Kirjoita ja aja DART-koodia suoraan verkossa.
http://try.dartlang.org/    Klikkaa vasemmasta yläkulmasta koodin suorittamiseksi.

Ja muistettava on, että DART on vasta kehittymässä, sen ensimmäistä, 'bugitonta' versiota ei ole vielä julkistettu.  DART-kielen rakenteet ja syntaksit voivat kokea suuriakin muutoksia, kun ohjelmoijat etsivät parhaita ratkaisuja.

Päivitän tätä artikkelia tarpeen mukaan...
.

Kuinka seuraan Googlen uuden, verkossa toimivan DART-ohjelmointikielen syntyä ja kehitystä.

Uuden ohjelmointikielen synty on harvinainen tapahtuma.  Vielä harvinaisempaa on, että osuu paikalle kielen syntyhetkellä, ja saa tilaisuuden seurata kielen kehittymistä alusta alkaen.

Sattumalta ajoitin paluuni ohjelmoinnin pariin juuri DART-kielen ensimmäisen julkistamisen hetkelle,  syksyllä 2011.  Päätin oitis, että seuraan tiiviisti sen kehitysprosessin kaikkia vaiheita, jotta näen, että kuinka tämä homma oikein tehdään, miten eri työkalut kehittyvät ja muutenkin vahvistan omaa osaamistani ohjelmoinnin alueella. 
     Urakka taitaa olla suurempi, kuin ensin ajattelin, ja se häiritsee ehkä varsinaista DART-kielen opiskeluani.  Tähän liittyvien sivujen lukeminen ei ole välttämätöntä varsinaiselle DART-kielen opiskelulle.

Mutta jos olet Ihan Oikea Nörtti, niin tässä aiheeseen liittyvät linkit:

Näistä voi tilata RSS syötteet, jos TODELLA haluaa seurata aihetta  :)
Bugilistat / Issues.    http://code.google.com/p/dart/issues/list
Bugit, joita haluaa seurata, voi tähdittää, jolloin muutoksista voi ilmoittaa.

Committed Changes
http://code.google.com/p/dart/source/list


General Dart Discussion  DART keskustelu kielen syntaksista, ongelmista ja käytöstä: 
https://groups.google.com/a/dartlang.org/group/misc/topics

Tähän ryhmään kannattaa liittyä, jolloin saa keskustelut sähköpostiin n. 25 ryhmissä.
Kiintoisat keskustelunaiheet voi tähdittää.  Ryhmää voi lukea liittymättä siihen.



Tavalliselle kielen opiskelijalla sopii paremmin:

DartLang    http://www.dartlang.org/
ja uutiset:   http://news.dartlang.org/

Aloittelijalle sopivin sivu opiskeltavaksi on luultavasti:
http://www.dartlang.org/docs/language-tour/

Ja Blogi http://c.dart-examples.com/home   on hyvin havainnollinen, ja sen kautta on myös mahdollisuus suorittaa kielen koodi klikkaamalla TRY-Dartlang-sivustolla.
http://try.dartlang.org/
= Käynnistyskuvake Try-Dartlang-sivuston vasemmassa yläkulmassa.

Oma artikkelini aiheesta tässä blogissa...
http://etdart.blogspot.fi/2012/06/kuinka-opiskelen-googlen-uutta-verkossa.html

Päivitän tätä artikkelia vielä tarpeen mukaan. 
.

sunnuntai 17. kesäkuuta 2012

In 1989, a guy decided a beat on a drum.

I Found this nice text from:  


https://groups.google.com/a/dartlang.org/group/misc/browse_thread/thread/1e0561c88f12b76d


In 1989, a guy decided a beat on a drum. It echo'd. 
A few years later, 
a club of nerds bought the team beating most often on the drum. 

Another few years later, and that club of nerds outcompeted another 
club of nerds eager to beat the drum. In 2000,
 there was only one guy beating on one drum,
 and the pace was slowing down significantly, 
grinding to a halt around 2002. 


But the guys previously outdrummed came back with a new performance; this time they shared the script of the performance.
 Meanwhile all the time, there was a red guy silently 
drumming on a shiny drum in the corner, and another guy drumming on a 
very shiney expensive looking laptop.


The guys offering a shop to search for new drums then decided they would like to join.
They didn't just stand there and made a new drum. 
They indeed made a new drum, but they also made new ways to beat the drum,
built loads of things to help drummers.


They decided to up the tempo and add another very shiny 
new drum. This new drum was made to be drummed very regularly. 
And they did beat the drum very regularly. 

Ruud 


Very, very very nice this... thanks, Ruud and others...

Hieno DART-Examples blogi. Hyviä DART esimerkkejä.

Brandon Donnelson on tehnyt erinomaisen ja havainnollisen blogin.  Tässä kopio siitä Google+:aan kirjoittamastani jaosta.  Jos olisin puoli vuotta sitten saanut tällaista kamaa ja säännöllisen verkkoyhteyden, niin minähän jo osaisin DARTia.  Ehkä.

http://c.dart-examples.com/home 




Dart-Examples blogi.  Rakenteista verkko-ohjelmointia. #Ohjelmointi 
Brandon Donnelson on yhdistänyt oivalla tavalla tekstiinsä kielen syntaksit ja havainnolliset esimerkit; tuloksena on selkeälukuisia blogikirjoituksia, joiden avulla aloittelijankin on helppo perehtyä DART-kieleen.  Blogi Dart-examples näyttää laajenevan vauhdilla, ja olen todella tyytyväinen sen sisältöön, ja siihen, että vihdoin osuin löytämään tämän blogin. Kaikkea en ole ehtinyt edes vielä lukea.  
     Editorin asettelu sisennyksineen ja väreineen tekee lukemisen erityisen hauskaksi.  Ruudulla on myös tämä TRY -linkki, jonka avulla koodia voi käydä kokeilemassa käytännössä.  
     Dartlang on erinomainen sivusto, mutta tätä Donnelsonin blogia on vaikea sivuuttaa, kun esim. valitaan oppimateriaalia DART-kielen kurssille tai itseopiskeluun.  
.

lauantai 9. kesäkuuta 2012

Testing markup.io for my Dart Library

Testaan Markup.io  -ohjelman ja sen Chrome-lisukkeen käyttöä Dart-opinnoissani.

Leikkeitä Dart-aineistosta....  Merkattu markup-ohjelmalla muistiinpanoja.
Teen verkkosivuun joitakin merkintöjä, ja jaan ne sitten linkillä.

Epäselvää minulle on tässä vaiheessa:
- Saanko jostakin listauksen KAIKISTA sivuista, joille olen tehn yt merkintöjä?
- Voinko poistaa merkintäni haluamiltani sivuilta?

http://active.tutsplus.com/articles/explanatory/what-is-dart-and-why-should-you-care/
http://markup.io/v/enrhhbzc6fj0  

http://blog.sethladd.com/2012/02/classes-in-dart-part-one.html
http://markup.io/v/0xpcyjg78gy9


Ohjelman käyttö:
Verkkosivulla klikkaan selaimen palkista Chrome-lisuketta markup.io, teen muistiinpanoni sivulle, julkaisen ne, jaan linkin blogiini ja sitten KLIKKAAN julkaisuruudun pois (?).

Päivitän lisää kokemuksia aiheesta:
.

maanantai 28. toukokuuta 2012

Opetetaan lapset laskemaan ja (heidän isänsä) ohjelmoimaan.

Tässä on alkutahdit laskemis / opetusohjelmalle - docount.
 Allaolevan koodin voi kopioida ja pastata sitten sivustolle; http://try.dartlang.org/
Siellä klikataan ikkunan vasemmassa yläkulmassa käynnistysnapia ja koodin pitäisi toimia kaikissa *nykyaikaisissa* selaimissa.
 Koodia voi tuossa ikkunassa muokata ja kokeilla erilisia vaihtoehtoja ja hakea esim. http://www.dartlang.org/docs/language-tour/ sivulta lisää ideoita.



  int Summa   = 0;
  int Luku1     = 0;
  int Luku2     = 0;

main(){
  print('Simple DART-program to Learn Children to Count and their fathers to program');
  print('');
  print('Learn to count, for to be Counted On!');
  print('Learn to program, for not to be programmed!');
  print('');

  getnumberstocount();
  docount();

  print('You are counted on, You are not to be programmed');
}

void getnumberstocount(){
  Luku1 = 3;
  Luku2 = 4;
}

void docount() {
  Summa = Luku1 + Luku2;
  print(Summa);
}





Yksinkertainen Dart-laskuohjelma joka käynnistyy HTML lomakkeesta

Docount

Docount

dart is not running

keskiviikko 9. toukokuuta 2012

Koska "Interface" :a käytetään DART-kielessä.

Eräissä ohjelmointikielissä OLIOT/LUOKAT sisälsivät Interface- ja Implementation -osat.
DARTissa Interface on erikseen luokkien, Class, ulkopuolella.
Tämä on hieman erilainen ja rakenteellisesti parempi järjestely.  Tavallaan kaksitasoinen rakenne...  Siihen liittyy myös "Single Ingeritance", ... "Yksikohteinen periytyvyys", tai mikä nyt sitten olisi sille paras suomennos.
Stack-Oferflowssa on hyvä englanninkielinen keskustelu aiheesta.  Ja siihen tuli hienoja vastauksia;

http://stackoverflow.com/questions/10502649/when-to-use-interfaces-in-dart
Pitääpä perehtyä tähän, sitten kun on aikaa.



DART-kielen kääntäminen suomeksi?!   Keskusteluissa tuli esiin myös kielen kääntäminen muihin kieliin; Googlellahan on tästä kokemusta, ja osan siitä voisi automatisoida...     MUTTA ilmeisesti tämä on käytännössä mahdotonta, koska DART-kieleen sisältyy niin paljon materiaalia; syntaksien lisäksi myös valtava määrä ohjeita ja avustavia sivuja.

ERI KIELTEN SANOJEN MERKITYS aiheuttaisi myös ongelmia, joten tämä tuskin tulee toteutumaan, ainakaan laajassa mitassa.
MUTTA minulla itselläni alkaisi olla tarve ainakin tiettyjä DART-kielen alueita kääntää suomen kielelle. Myös senkin takia, että se auttaisi minua ymmärtämään nämä asiat paremmin.
MINUN ON MAHDOTONTA SELITTÄÄ ASIAA, JOS EN OLE ITSEKÄÄN SITÄ TÄYSIN SISÄISTÄNYT.  Jos minulla suinkin olisi aikaa, niin yrittäisin kirjoittaa muutamia lyhyitä käännöksiä.

Suomalaista opiskelijaa sanasto;  Dart-Suomi, auttaisi kielen omaksumisessa.

lauantai 5. toukokuuta 2012

SQL tietokantojen käyttö DART ohjelmointi kielessä

Koska on mahdollista käyttää SQL tietokantoja DART ohjelmoinnissa?
Jokaisen ohjelmointikielen ei tarvitse ohjelmoida KAIKKEA.  Lienee luontevaa, että käytetään ulkoisia palikoita, esim. SQL-tietokantoja, HTML-kielen lomakkeita yms.  Tällöin käyttäjien ei tarvitse opetella uutta syntaxia.  DART-kielessä, joka on vasta syntymässä, nämä rakenteet eivät tietenkään vielä nyt, toukokuun alussa 2012, ole valmiina.

https://groups.google.com/a/dartlang.org/group/misc/browse_thread/thread/8dbfee57129de3ac/3c456d5f3b93141e?lnk=raot
"When will be possible for using sql databases from Dart. Is there any 
work (or plan) related to this subject in dart team. " 




https://bitbucket.org/vadimtsushko/mongo-dart    Mongolib.  
" I just wanted to hack together something just to see if I 
could even log into a mysql server from dart.  "

http://api.dartlang.org/html/SQLTransaction.html   And here they are, some API:s...  

MySQL Connector for Dart   


And who have done some nice blog text in this subject....   lets look it next....  
Some programmes surely have written somethin about this...
 For me this so important a question, that I must put this to my blog right away.  

To be continued.... 

perjantai 20. huhtikuuta 2012

Pohtimassa <> merkkien käyttöä, T, E , DART:issa

Lisäksi DART kielessä on näitä <T>   <E>  ilmaisuja.  Muiden sulkumerkkien jälkeen ne pysähdyttävät hieman miettimään...    Miksi juuri  T   ja  E  ?
(K,V)  Tarkoittaa siis Key ja Value,  sehän on selvää.
Kokoan leikkeitä ohjeista:

http://www.dartlang.org/language-tour/#generics

Generics

If you look at the API documentation for the basic array type, List, you'll see that the type is actuallyList<E>. The <...> notation marks List as a generic (or parameterized) type—a type that can declare formal type parameters.
For example, if you intend for a list to contain only strings, you can declare it as List<String> (read that as "List of String"). 
....
Generic types can save you the trouble of creating all these interfaces. Instead, you can create a single interface that takes a type parameter:
interface Cache<T> {
  T getByKey(String key);
  setByKey(String key, T value);
}
In this code, T is the stand-in type. It's a placeholder that you can think of as a type that a developer will define later.

Using collection literals

Both built-in collection types are parameterized: lists and maps. Parameterized literals are just like the literals you've already seen, except that you add <type> before the opening bracket. For example:
List<String> names = <String>['Seth', 'Kathy', 'Lars'];
Map<String, String> pages = <String>{ // specify value type: String
    'index.html':'Homepage',  // (the key type is implicitly String)
    'robots.txt':'Hints for web robots',
    'humans.txt':'We are people, not machines' };


NO?  Näyttää siltä siis, että <> merkinnän sisällä on "tyyppi"...
..
To specify one or more types when using a constructor, put the types in angle brackets (<...>
..

Generic collections and the types they contain

Dart generic types are reified, which is a fancy way of saying that they carry their type information around at runtime. 
= = = = = = = = = = = = = = = = = = = = = = = = = 



SIIS:  E   T   K   V 
What is this T  in <T>  ?

Interface Future<T>

Future is used to obtain a value sometime in the future. Receivers of a Future obtain the value by passing a callback to then

========================================================

What is this   E   in <E>  ?  

===========================================

Typedefs can be parameterized.
typedef int Compare<T>(T a, T b);

class SortedCollection<T> {
  Compare<T> compare;
  SortedCollection(this.compare);
}

main() {
  SortedCollection<int> s = new SortedCollection<int>((a,b) => a - b);
  print(s.compare is Compare<int>);  // true
  print(s.compare('a','b'));  // checked mode throws exception
}
dartlang  0.08

typeParameter:
identifier (extends type)?
;
typeParameters:
`<' typeParameter (`,' typeParameter)* `>'
;
A type parameter T may be suffixed with an extends clause that specifies
the upper bound for T.

A type parameter T may be suffixed with an extends clause that specifies
the upper bound for T.   ....

Tässäpä hieman sulattelemista...    Täydennän tekstiä vielä...  


http://c.dart-examples.com/learn/variables/collections
Tämä kirjoitus tuo hieman lisävalaistusta asiaan...

.