From 3ea2b0b29ff004bfd4151dede0c1b55e52ea922d Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Fri, 31 May 2024 12:18:45 -0600 Subject: Remove email addresses --- de-de/javascript-de.html.markdown | 133 +++++++++++---------- es-es/javascript-es.html.markdown | 57 +++++---- es-es/matlab-es.html.markdown | 23 ++-- fa-ir/javascript-fa.html.markdown | 7 -- ko-kr/javascript-kr.html.markdown | 69 ++++++----- matlab.html.markdown | 85 +++++++------- pt-br/javascript-pt.html.markdown | 65 +++++------ pt-br/matlab-pt.html.markdown | 12 +- ta-in/javascript-ta.html.markdown | 236 +++++++++++++++++++------------------- tr-tr/csharp-tr.html.markdown | 54 ++++----- zh-cn/javascript-cn.html.markdown | 20 ++-- zh-cn/matlab-cn.html.markdown | 55 ++++----- zh-cn/red-cn.html.markdown | 2 +- 13 files changed, 381 insertions(+), 437 deletions(-) diff --git a/de-de/javascript-de.html.markdown b/de-de/javascript-de.html.markdown index a71d4316..3dc5b532 100644 --- a/de-de/javascript-de.html.markdown +++ b/de-de/javascript-de.html.markdown @@ -8,27 +8,24 @@ filename: learnjavascript-de.js lang: de-de --- -(Anmerkungen des Original-Autors:) JavaScript wurde im Jahr 1995 von Brendan Eich bei Netscape entwickelt. Ursprünglich war es als einfachere Skriptsprache für Websites gedacht, ergänzend zu Java, das für komplexere Webanwendungen verwendet wird. Die enge Integration in Websites und der in Browser eingebaute Support der Sprache haben dafür gesorgt, dass JavaScript weit häufiger für Web-Frontends verwendet wird als Java. Dabei ist JavaScript inzwischen nicht mehr auf Browser beschränkt: Node.js, ein Projekt, das eine eigene Laufzeitumgebung auf Grundlage von Google Chromes V8 mitbringt, wird derzeit immer populärer. -Feedback ist herzlich Willkommen! Der ursprüngliche Autor ist unter [@excitedleigh](https://twitter.com/excitedleigh) oder [l@leigh.net.au](mailto:l@leigh.net.au) zu erreichen. Der Übersetzer unter [gregorbg@web.de](mailto:gregorbg@web.de). - ```js -// Kommentare werden wie in C gesetzt: Einzeilige Kommentare starten mit zwei +// Kommentare werden wie in C gesetzt: Einzeilige Kommentare starten mit zwei // Slashes -/* während mehrzeilige Kommentare mit einem +/* während mehrzeilige Kommentare mit einem Slash und einem Stern anfangen und enden */ // Statements können mit einem Semikolon beendet werden machWas(); -// ...müssen sie aber nicht, weil Semikola automatisch eingefügt werden, wenn +// ...müssen sie aber nicht, weil Semikola automatisch eingefügt werden, wenn // eine neue Zeile beginnt, abgesehen von einigen Ausnahmen. machWas() -// Obwohl wir uns für den Anfang nicht um diese Ausnahmen kümmern müssen ist +// Obwohl wir uns für den Anfang nicht um diese Ausnahmen kümmern müssen ist // es besser die Semikola immer zu setzen. /////////////////////////////////// @@ -47,8 +44,8 @@ machWas() // Division funktioniert auch mit einem Ergebnis nach dem Komma. 5 / 2; // = 2.5 -// Bit-weise Operationen sind auch möglich; wenn eine Bit-weise Operation -// ausgeführt wird, wird die Fließkomma-Zahl in einen 32-bit Integer (mit +// Bit-weise Operationen sind auch möglich; wenn eine Bit-weise Operation +// ausgeführt wird, wird die Fließkomma-Zahl in einen 32-bit Integer (mit // Vorzeichen) umgewandelt. 1 << 2; // = 4 @@ -86,7 +83,7 @@ false; 2 <= 2; // = true 2 >= 2; // = true -// Strings können mit + verbunden +// Strings können mit + verbunden "Hello " + "world!"; // = "Hello world!" // und mit < und > verglichen werden. @@ -98,7 +95,7 @@ false; // ...solange man nicht === verwendet. "5" === 5; // = false -// Auf einzelne Buchstaben innerhalb eines Strings kann mit der Methode +// Auf einzelne Buchstaben innerhalb eines Strings kann mit der Methode // 'charAt' zugegriffen werden "This is a string".charAt(0); // = "T" @@ -110,17 +107,17 @@ false; // Es gibt außerdem die Werte 'null' und 'undefined' null; // wird verwendet um einen vorsätzlich gewählten 'Nicht'-Wert anzuzeigen -undefined; // wird verwendet um anzuzeigen, dass der Wert (aktuell) nicht - // verfügbar ist (obwohl genau genommen undefined selbst einen Wert +undefined; // wird verwendet um anzuzeigen, dass der Wert (aktuell) nicht + // verfügbar ist (obwohl genau genommen undefined selbst einen Wert // darstellt) -// false, null, undefined, NaN, 0 und "" sind 'falsy', d. h. alles andere ist +// false, null, undefined, NaN, 0 und "" sind 'falsy', d. h. alles andere ist // wahr. Man beachte, dass 0 falsch und "0" wahr ist, obwohl 0 == "0". /////////////////////////////////// // 2. Variablen, Arrays und Objekte -// Variablen werden mit dem Schlüsselwort 'var' und einem frei wählbaren +// Variablen werden mit dem Schlüsselwort 'var' und einem frei wählbaren // Bezeichner deklariert. JavaScript ist dynamisch typisiert, so dass man einer // Variable keinen Typ zuweisen muss. Die Zuweisung verwendet ein einfaches =. var einWert = 5; @@ -135,12 +132,12 @@ einAndererWert = 10; // Wert 'undefined'. var einDritterWert; // = undefined -// Es existiert eine Kurzform, um mathematische Operationen mit Variablen +// Es existiert eine Kurzform, um mathematische Operationen mit Variablen // auszuführen: einWert += 5; // äquivalent zu einWert = einWert + 5; einWert ist nun also 10 einWert *= 10; // einWert ist nach dieser Operation 100 -// Und es existiert eine weitere, sogar noch kürzere Form, um 1 zu addieren +// Und es existiert eine weitere, sogar noch kürzere Form, um 1 zu addieren // oder zu subtrahieren einWert++; // nun ist einWert 101 einWert--; // wieder 100 @@ -149,7 +146,7 @@ einWert--; // wieder 100 var myArray = ["Hello", 45, true]; // Auf einzelne Elemente eines Arrays kann zugegriffen werden, in dem der Index -// in eckigen Klammern hinter das Array geschrieben werden. Die Indexierung +// in eckigen Klammern hinter das Array geschrieben werden. Die Indexierung // beginnt bei 0. myArray[1]; // = 45 @@ -160,11 +157,11 @@ myArray.length; // = 4 // und sind veränderlich myArray[3] = "Hello"; -// Die Objekte in JavaScript entsprechen 'dictionaries' oder 'maps' in anderen +// Die Objekte in JavaScript entsprechen 'dictionaries' oder 'maps' in anderen // Sprachen: es handelt sich um ungeordnete Schlüssel-Wert-Paare. var myObj = { key1: "Hello", key2: "World" }; -// Schlüssel sind Strings, aber es werden keine Anführungszeichen benötigt, +// Schlüssel sind Strings, aber es werden keine Anführungszeichen benötigt, // sofern es sich um reguläre JavaScript-Bezeichner handelt. Werte können von // jedem Typ sein. var myObj = { myKey: "myValue", "my other key": 4 }; @@ -173,15 +170,15 @@ var myObj = { myKey: "myValue", "my other key": 4 }; // werden, myObj["my other key"]; // = 4 -// ... oder in dem man die Punkt-Notation verwendet, vorausgesetzt es handelt +// ... oder in dem man die Punkt-Notation verwendet, vorausgesetzt es handelt // sich bei dem Schlüssel um einen validen Bezeichner. myObj.myKey; // = "myValue" -// Objekte sind veränderlich, Werte können verändert und neue Schlüssel +// Objekte sind veränderlich, Werte können verändert und neue Schlüssel // hinzugefügt werden. myObj.myThirdKey = true; -// Der Zugriff auf einen noch nicht definierten Schlüssel, liefert ein +// Der Zugriff auf einen noch nicht definierten Schlüssel, liefert ein // undefined. myObj.myFourthKey; // = undefined @@ -203,7 +200,7 @@ while (true) { // Eine unendliche Schleife! } -// Do-while-Scheifen arbeiten wie while-Schleifen, abgesehen davon, dass sie +// Do-while-Scheifen arbeiten wie while-Schleifen, abgesehen davon, dass sie // immer mindestens einmal ausgeführt werden. var input; do { @@ -211,7 +208,7 @@ do { } while ( !isValid( input ) ) // Die for-Schleife arbeitet genau wie in C und Java: -// Initialisierung; Bedingung, unter der die Ausführung fortgesetzt wird; +// Initialisierung; Bedingung, unter der die Ausführung fortgesetzt wird; // Iteration. for ( var i = 0; i < 5; i++ ) { // wird 5-mal ausgeführt @@ -227,7 +224,7 @@ if (colour == "red" || colour == "blue"){ } // Die Auswertung von '&&' und '||' erfolgt so, dass abgebrochen wird, wenn die -// Bedingung erfüllt ist (bei oder) oder nicht-erfüllt ist (bei und). Das ist +// Bedingung erfüllt ist (bei oder) oder nicht-erfüllt ist (bei und). Das ist // nützlich, um einen Default-Wert zu setzen. var name = otherName || "default"; @@ -272,8 +269,8 @@ function myFunction() } myFunction(); // = undefined -// In JavaScript sind Funktionen 'Bürger erster Klasse', also können sie wie -// Variablen verwendet und als Parameter anderen Funktionen übergeben werden +// In JavaScript sind Funktionen 'Bürger erster Klasse', also können sie wie +// Variablen verwendet und als Parameter anderen Funktionen übergeben werden // - zum Beispiel, um einen 'event handler' zu 'beliefern'. function myFunction() { // wird ausgeführt, nachdem 5 Sekunden vergangen sind @@ -281,36 +278,36 @@ function myFunction() { setTimeout(myFunction, 5000); // Funktionen können auch deklariert werden, ohne ihnen einen Namen zuzuweisen. -// Es ist möglich diese anonymen Funktionen direkt als (oder im) Argument +// Es ist möglich diese anonymen Funktionen direkt als (oder im) Argument // einer anderen Funktion zu definieren. setTimeout(function(){ // wird ausgeführt, nachdem 5 Sekunden vergangen sind }, 5000); -// JavaScript hat einen Geltungsbereich, der sich auf Funktionen erstreckt: +// JavaScript hat einen Geltungsbereich, der sich auf Funktionen erstreckt: // Funktionen haben ihren eigenen Geltungsbereich, andere Blöcke nicht. if(true) { var i = 5; } -i; // = 5 - nicht undefined, wie man es von einer Sprache erwarten würde, die +i; // = 5 - nicht undefined, wie man es von einer Sprache erwarten würde, die // ihren Geltungsbereich nach Blöcken richtet -// Daraus ergibt sich ein bestimmtes Muster für sofort-ausführbare, anonyme +// Daraus ergibt sich ein bestimmtes Muster für sofort-ausführbare, anonyme // Funktionen, die es vermeiden, dass der globale Geltungsbereich von Variablen // 'verschmutzt' wird. (function(){ var temporary = 5; - // Auf eine Variable im globalen Geltungsbereich kann zugegriffen werden, - // sofern sie im globalen Objekt definiert ist (in einem Webbrowser ist - // dies immer das 'window'-Objekt, in anderen Umgebungen, bspw. Node.js, - // kann das anders aussehen). + // Auf eine Variable im globalen Geltungsbereich kann zugegriffen werden, + // sofern sie im globalen Objekt definiert ist (in einem Webbrowser ist + // dies immer das 'window'-Objekt, in anderen Umgebungen, bspw. Node.js, + // kann das anders aussehen). window.permanent = 10; })(); temporary; // wirft einen ReferenceError permanent; // = 10 -// Eines der mächtigsten Charakteristika von JavaScript sind Closures. Wird -// eine Funktion innerhalb einer anderen Funktion definiert, dann hat die +// Eines der mächtigsten Charakteristika von JavaScript sind Closures. Wird +// eine Funktion innerhalb einer anderen Funktion definiert, dann hat die // innere Funktion Zugriff auf alle Variablen der äußeren Funktion, sogar dann, // wenn die äußere Funktion beendet wurde. function sayHelloInFiveSeconds(name){ @@ -319,13 +316,13 @@ function sayHelloInFiveSeconds(name){ alert(prompt); } setTimeout(inner, 5000); - // setTimeout wird asynchron ausgeführt. Also wird sayHelloInFiveSeconds - // sofort verlassen und setTimeout wird die innere Funktion 'im nachhinein' - // aufrufen. Dennoch: Weil sayHelloInFiveSeconds eine Hülle um die innere - // Funktion bildet, hat die innere Funktion immer noch Zugriff auf die + // setTimeout wird asynchron ausgeführt. Also wird sayHelloInFiveSeconds + // sofort verlassen und setTimeout wird die innere Funktion 'im nachhinein' + // aufrufen. Dennoch: Weil sayHelloInFiveSeconds eine Hülle um die innere + // Funktion bildet, hat die innere Funktion immer noch Zugriff auf die // Variable prompt. } -sayHelloInFiveSeconds("Adam"); // wird nach 5 Sekunden ein Popup mit der +sayHelloInFiveSeconds("Adam"); // wird nach 5 Sekunden ein Popup mit der // Nachricht "Hello, Adam!" öffnen. /////////////////////////////////// @@ -339,7 +336,7 @@ var myObj = { }; myObj.myFunc(); // = "Hello world!" -// Wenn Funktionen aufgerufen werden, die zu einem Objekt gehören, können sie +// Wenn Funktionen aufgerufen werden, die zu einem Objekt gehören, können sie // auf das eigene Objekt mit dem Schlüsselwort 'this' zugreifen. myObj = { myString: "Hello world!", @@ -349,14 +346,14 @@ myObj = { }; myObj.myFunc(); // = "Hello world!" -// Worauf 'this' gesetzt wird, ist davon abhängig, wie die Funktion aufgerufen -// wird, nicht wo sie definiert wurde. Unsere Funktion wird daher nicht -// funktionieren, sofern sie außerhalb des Kontextes des Objekts aufgerufen +// Worauf 'this' gesetzt wird, ist davon abhängig, wie die Funktion aufgerufen +// wird, nicht wo sie definiert wurde. Unsere Funktion wird daher nicht +// funktionieren, sofern sie außerhalb des Kontextes des Objekts aufgerufen // wird. var myFunc = myObj.myFunc; myFunc(); // = undefined -// Umgekehrt ist es möglich eine Funktion einem Objekt zuzuweisen und dadurch +// Umgekehrt ist es möglich eine Funktion einem Objekt zuzuweisen und dadurch // Zugriff auf den this-Kontext zu erhalten, sogar dann, wenn die Funktion dem // Objekt nach dessen Definition zugewiesen wird. var myOtherFunc = function(){ @@ -396,8 +393,8 @@ var product = function(a, b){ return a * b; } var doubler = product.bind(this, 2); doubler(8); // = 16 -// Wenn eine Funktion mit dem Schlüsselwort 'new' aufgerufen wird, dann wird -// ein neues Objekt erzeugt. Funktionen, die darauf ausgelegt sind in dieser +// Wenn eine Funktion mit dem Schlüsselwort 'new' aufgerufen wird, dann wird +// ein neues Objekt erzeugt. Funktionen, die darauf ausgelegt sind in dieser // Art aufgerufen zu werden, werden Konstruktoren genannt. var MyConstructor = function(){ this.myNumber = 5; @@ -405,14 +402,14 @@ var MyConstructor = function(){ myNewObj = new MyConstructor(); // = {myNumber: 5} myNewObj.myNumber; // = 5 -// Jedes JavaScript-Objekt hat einen Prototyp. Wenn man versucht auf eine +// Jedes JavaScript-Objekt hat einen Prototyp. Wenn man versucht auf eine // Eigenschaft des Objekts zuzugreifen, das nicht im Objekt selbst existiert, // schaut der Interpreter in dessen Prototyp nach. -// Einige JavaScript-Implementierungen erlauben den direkten Zugriff auf den +// Einige JavaScript-Implementierungen erlauben den direkten Zugriff auf den // Prototyp eines Objekts durch die magische Eigenschaft __proto__. Obwohl das // nützlich ist, um Prototypen im Allgemeinen zu erklären, ist das nicht Teil -// des Standards; zum Standard-Weg der Nutzung von Prototypen kommen wir +// des Standards; zum Standard-Weg der Nutzung von Prototypen kommen wir // später. var myObj = { myString: "Hello world!", @@ -437,26 +434,26 @@ myPrototype.__proto__ = { myObj.myBoolean; // = true // Dafür wird nichts hin und her kopiert; jedes Objekt speichert eine Referenz -// auf seinen Prototypen. Das heißt wenn der Prototyp geändert wird, dann +// auf seinen Prototypen. Das heißt wenn der Prototyp geändert wird, dann // werden die Änderungen überall sichtbar. myPrototype.meaningOfLife = 43; myObj.meaningOfLife; // = 43 -// Es wurde bereits erwähnt, dass __proto__ nicht zum Standard gehört und es +// Es wurde bereits erwähnt, dass __proto__ nicht zum Standard gehört und es // gibt ebenso keinen Standard-Weg, um den Prototyp eines existierenden Objekts -// zu ändern. Es gibt dennoch zwei Wege, wie man ein neues Objekt mit einem +// zu ändern. Es gibt dennoch zwei Wege, wie man ein neues Objekt mit einem // gegebenen Prototypen erzeugt. // Der erste Weg ist die Methode Object.create, die eine jüngere Ergänzung des -// JavaScript-Standards ist und daher noch nicht in allen Implementierungen +// JavaScript-Standards ist und daher noch nicht in allen Implementierungen // verfügbar. var myObj = Object.create(myPrototype); myObj.meaningOfLife; // = 43 -// Der zweite Weg, der immer funktioniert, hat mit den Konstruktoren zu tun. +// Der zweite Weg, der immer funktioniert, hat mit den Konstruktoren zu tun. // Konstruktoren haben eine Eigenschaft, die Prototyp heißt. Dabei handelt es // sich *nicht* um den Prototypen der Konstruktor-Funktion; stattdessen handelt -// es sich um den Prototypen, der einem neuen Objekt mitgegeben wird, wenn es +// es sich um den Prototypen, der einem neuen Objekt mitgegeben wird, wenn es // mit dem Konstruktor und dem Schlüsselwort 'new' erzeugt wird. MyConstructor.prototype = { getMyNumber: function(){ @@ -466,8 +463,8 @@ MyConstructor.prototype = { var myNewObj2 = new MyConstructor(); myNewObj2.getMyNumber(); // = 5 -// Alle primitiven Typen, also strings und numbers, haben auch Konstruktoren, -// die zu dem Typ äquivalente Wrapper-Objekte erzeugen. +// Alle primitiven Typen, also strings und numbers, haben auch Konstruktoren, +// die zu dem Typ äquivalente Wrapper-Objekte erzeugen. var myNumber = 12; var myNumberObj = new Number(12); myNumber == myNumberObj; // = true @@ -480,8 +477,8 @@ if (0){ // Dieser Teil wird nicht ausgeführt, weil 0 'falsy' ist. } -// Das Wrapper-Objekt und die regulären, eingebauten Typen, teilen sich einen -// Prototyp; so ist es möglich zum Beispiel einem String weitere Funktionen +// Das Wrapper-Objekt und die regulären, eingebauten Typen, teilen sich einen +// Prototyp; so ist es möglich zum Beispiel einem String weitere Funktionen // hinzuzufügen. String.prototype.firstCharacter = function(){ return this.charAt(0); @@ -489,11 +486,11 @@ String.prototype.firstCharacter = function(){ "abc".firstCharacter(); // = "a" // Diese Tatsache wird häufig bei einer Methode mit dem Namen 'polyfilling' -// verwendet: Dabei wird ein neues Feature von JavaScript in einer älteren -// Untermenge der Sprache integriert, so dass bestimmte Funktionen auch in +// verwendet: Dabei wird ein neues Feature von JavaScript in einer älteren +// Untermenge der Sprache integriert, so dass bestimmte Funktionen auch in // älteren Umgebungen und Browsern verwendet werden können. -// Ein Beispiel: Es wurde erwähnt, dass die Methode Object.create nicht in +// Ein Beispiel: Es wurde erwähnt, dass die Methode Object.create nicht in // allen Umgebungen verfügbar ist - wir können sie dennoch verwenden, mit einem // 'polyfill': if (Object.create === undefined){ // überschreib nichts, was eventuell bereits @@ -503,7 +500,7 @@ if (Object.create === undefined){ // überschreib nichts, was eventuell bereits // Prototypen var Constructor = function(){}; Constructor.prototype = proto; - // verwende es dann, um ein neues Objekt mit einem passenden + // verwende es dann, um ein neues Objekt mit einem passenden // Prototypen zurückzugeben return new Constructor(); } @@ -514,7 +511,7 @@ if (Object.create === undefined){ // überschreib nichts, was eventuell bereits Das [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) bietet eine ausgezeichnete Dokumentation für die Verwendung von JavaScript im Browser. Es ist außerdem ein Wiki und ermöglicht es damit anderen zu helfen, wenn man selbst ein wenig Wissen angesammelt hat. -MDN's [A re-introduction to JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) führt sehr viele der hier vorgestellten Konzepte im Detail aus. +MDN's [A re-introduction to JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) führt sehr viele der hier vorgestellten Konzepte im Detail aus. Dieses Tutorial hat nur die Sprache JavaScript vorgestellt; um mehr über den Einsatz in Websites zu lernen, ist es ein guter Start etwas über das [Document Object Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) zu lernen. diff --git a/es-es/javascript-es.html.markdown b/es-es/javascript-es.html.markdown index 050154c7..a70c5160 100644 --- a/es-es/javascript-es.html.markdown +++ b/es-es/javascript-es.html.markdown @@ -8,22 +8,19 @@ translators: filename: javascript-es.js lang: es-es --- + Tutorial de JavaScript en español. -JavaScript fue creado por Brendan Eich en 1995 mientras trabajaba en Netscape. +JavaScript fue creado por Brendan Eich en 1995 mientras trabajaba en Netscape. Su intención original era crear un lenguaje simple para sitios web, complementándolo con Java para aplicaciones más complejas. Debido a su integracion estrecha con sitios -web y soporte por defecto de los navegadores modernos se ha vuelto mucho más común +web y soporte por defecto de los navegadores modernos se ha vuelto mucho más común para front-end que Java. Sin embargo, JavaScript no sólo se limita a los navegadores web: Node.js, un proyecto que proporciona un entorno de ejecución independiente para el motor V8 de Google Chrome, se está volviendo más y más popular. -¡La retroalimentación es bienvenida! Puedes encontrarme en: -[@ExcitedLeigh](https://twitter.com/ExcitedLeigh), o -[l@leigh.net.au](mailto:l@leigh.net.au). - ```js -// Los comentarios en JavaScript son los mismos como comentarios en C. +// Los comentarios en JavaScript son los mismos como comentarios en C. //Los comentarios de una sola línea comienzan con //, /* y los comentarios multilínea comienzan @@ -78,7 +75,7 @@ false; 'abc'; "Hola, mundo"; -// La negación se aplica con la expresión ! +// La negación se aplica con la expresión ! !true; // = false !false; // = true @@ -147,7 +144,7 @@ var miTerceraVariable; // = undefined // Existen atajos para realizar operaciones aritméticas: miPrimeraVariable += 5; // equivalente a miPrimeraVariable = miPrimeraVariable + 5; - // miPrimeraVariable ahora es 10 + // miPrimeraVariable ahora es 10 miPrimeraVariable *= 10; // ahora miPrimeraVariable es 100 // Y atajos aún más cortos para sumar y restar 1 @@ -157,7 +154,7 @@ miPrimeraVariable--; // de vuelta a 100 // Los arreglos son listas ordenadas de valores, de cualquier tipo. var miArreglo = ["Hola", 45, true]; -// Los miembros de un arreglo pueden ser accesados con la sintaxis +// Los miembros de un arreglo pueden ser accesados con la sintaxis // de indices dentro de corchetes []. // Los índices empiezan en cero. miArreglo[1]; // = 45 @@ -194,7 +191,7 @@ miObjeto.miCuartaLlave; // = undefined /////////////////////////////////// // 3. Lógica y estructura de control -// La sintaxis de esta sección es casi idéntica a la de Java. +// La sintaxis de esta sección es casi idéntica a la de Java. // La estructura if funciona de la misma forma. var contador = 1; @@ -236,8 +233,8 @@ var nombre = otroNombre || "default"; // la estructura switch usa === para sus comparaciones -// usa 'break' para terminar cada caso -// o los casos después del caso correcto serán ejecutados también. +// usa 'break' para terminar cada caso +// o los casos después del caso correcto serán ejecutados también. calificacion = 'B'; switch (calificacion) { case 'A': @@ -266,7 +263,7 @@ function miFuncion(miArgumentoString){ miFuncion("foo"); // = "FOO" // Note que el valor a ser regresado debe estar en la misma línea que la -// palabra clave 'return', de otra forma la función siempre regresará 'undefined' +// palabra clave 'return', de otra forma la función siempre regresará 'undefined' // debido a la inserción automática de punto y coma. function miFuncion() { @@ -299,7 +296,7 @@ if (true){ } i; // = 5 - en un lenguaje que da ámbitos por bloque esto sería undefined, pero no aquí. -// Este conlleva a un patrón de diseño común llamado "ejecutar funciones anónimas +// Este conlleva a un patrón de diseño común llamado "ejecutar funciones anónimas //inmediatamente", que preveé variables temporales de fugarse al ámbito global (function(){ var temporal = 5; @@ -313,7 +310,7 @@ permanente; // = 10 // Una de las características más útiles de JavaScript son los closures. // Si una función es definida dentro de otra función, la función interna tiene acceso -// a todas las variables de la función externa, incluso aunque la función +// a todas las variables de la función externa, incluso aunque la función // externa ya haya terminado. function decirHolaCadaCincoSegundos(nombre){ var texto = "¡Hola, " + nombre + "!"; @@ -323,7 +320,7 @@ function decirHolaCadaCincoSegundos(nombre){ alert(texto); } setTimeout(interna, 5000); - // setTimeout es asíncrono, así que la función decirHolaCadaCincoSegundos + // setTimeout es asíncrono, así que la función decirHolaCadaCincoSegundos // terminará inmediatamente, y setTimeout llamará a interna() a los cinco segundos // Como interna está "cerrada dentro de" decirHolaCadaCindoSegundos, interna todavía tiene // acceso a la variable 'texto' cuando es llamada. @@ -341,7 +338,7 @@ var miObjeto = { }; miObjeto.miFuncion(); // = "¡Hola Mundo!" -// Cuando las funciones de un objeto son llamadas, pueden acceder a las variables +// Cuando las funciones de un objeto son llamadas, pueden acceder a las variables // del objeto con la palabra clave 'this'. miObjeto = { miString: "¡Hola Mundo!", @@ -375,7 +372,7 @@ otraFuncion.call(miObjeto, " y hola Luna!"); // = "¡Hola Mundo! y hola Luna!" otraFuncion.apply(miObjeto, [" y hola Sol!"]); // = "¡Hola Mundo! y hola Sol!" -// Esto es útil cuando estás trabajando con una función que acepta una secuencia de +// Esto es útil cuando estás trabajando con una función que acepta una secuencia de // argumentos y quieres pasar un arreglo. Math.min(42, 6, 27); // = 6 @@ -407,7 +404,7 @@ miNuevoObjeto.miNumero; // = 5 // propiedad en un objeto que no existe en el objeto el intérprete buscará en // el prototipo. -// Algunas implementaciones de JavaScript te permiten acceder al prototipo de +// Algunas implementaciones de JavaScript te permiten acceder al prototipo de // un objeto con la propiedad __proto__. Mientras que esto es útil para explicar // prototipos, no es parte del estándar; veremos formas estándar de usar prototipos // más adelante. @@ -428,20 +425,20 @@ miObjeto.sentidoDeLaVida; // = 42 // Esto funcionan también para funciones. miObjeto.miFuncion(); // = "hello world!" -// Por supuesto, si la propiedad que buscas no está en el prototipo, +// Por supuesto, si la propiedad que buscas no está en el prototipo, // se buscará en el prototipo del prototipo. miPrototipo.__proto__ = { miBoolean: true }; miObjeto.miBoolean; // = true -// Esto no involucra ningún copiado, cada objeto guarda una referencia a su +// Esto no involucra ningún copiado, cada objeto guarda una referencia a su // prototipo. Esto significa que podemos alterar el prototipo y nuestros // cambios serán reflejados en todos lados. miPrototipo.sentidoDeLaVida = 43; miObjeto.sentidoDeLaVida; // = 43 -// Mencionabamos anteriormente que __proto__ no está estandarizado, y que no +// Mencionabamos anteriormente que __proto__ no está estandarizado, y que no // existe una forma estándar de acceder al prototipo de un objeto. De todas formas. // hay dos formas de crear un nuevo objeto con un prototipo dado. @@ -450,7 +447,7 @@ miObjeto.sentidoDeLaVida; // = 43 var miObjeto = Object.create(miPrototipo); miObjeto.sentidoDeLaVida; // = 43 -// El segundo método, el cual trabaja en todos lados, tiene que ver con los +// El segundo método, el cual trabaja en todos lados, tiene que ver con los // constructores. Los constructores tienen una propiedad llamada prototype. // Este NO ES el prototipo de la función constructor; es el prototipo que // se le da a los nuevos objetos cuando son creados con la palabra clave @@ -482,7 +479,7 @@ if (0){ } // Aún así, los objetos que envuelven y los prototipos por defecto comparten -// un prototipo. así que puedes agregar funcionalidades a un string de la +// un prototipo. así que puedes agregar funcionalidades a un string de la // siguiente forma: String.prototype.primerCaracter = function(){ return this.charAt(0); @@ -497,7 +494,7 @@ String.prototype.primerCaracter = function(){ // las implementaciones, pero podemos hacerlo con polyfill: if (Object.create === undefined){ // esta validación sirve para no sobreescribir Object.create = function(proto){ - // hace un constructor temporal con el prototipo correcto + // hace un constructor temporal con el prototipo correcto var Constructor = function(){}; Constructor.prototype = proto; // y luego lo usamos para hacer un objeto con el prototipo @@ -509,22 +506,22 @@ if (Object.create === undefined){ // esta validación sirve para no sobreescribi ## Fuentes y Referencias -La [Red para Desarroladores de Mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript) +La [Red para Desarroladores de Mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript) proveé excelente documentación para JavaScript para navegadores. Además, está en formato de wiki, por lo que mientras vayas aprendiendo podrás ayudar a los demás con tu experiencia. MDN [Una re-introducción a JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) -cubre muchos de los conceptos que vimos aquí pero a mayor detalle. Esta guía cubre, más que nada, +cubre muchos de los conceptos que vimos aquí pero a mayor detalle. Esta guía cubre, más que nada, el lenguaje JavaScript solo. Si quieres aprender a cómo usarlo en un ambiente web empieza aprendiendo sobre el [DOM](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) -[Aprende JavaScript con ejemplos y retos](http://www.learneroo.com/modules/64/nodes/350) es una +[Aprende JavaScript con ejemplos y retos](http://www.learneroo.com/modules/64/nodes/350) es una variante de esta guía pero con retos. [Jardín JavaScript](http://bonsaiden.github.io/JavaScript-Garden/) es una guía para todas las funciones y características contra-intuitivas del lenguaje. -[JavaScript: La guía definitiva](http://www.amazon.com/gp/product/0596805527/) es una guía clásica / libro de referencia. +[JavaScript: La guía definitiva](http://www.amazon.com/gp/product/0596805527/) es una guía clásica / libro de referencia. Aparte de las contribuciones directas para este artículo, algo del contenido se adaptó del tutorial de Python por Louie Dinh en este sitio. y el [Tutorial JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) en la Red de Desarrolladores de Mozilla. diff --git a/es-es/matlab-es.html.markdown b/es-es/matlab-es.html.markdown index 6c9800c2..2d1a1809 100644 --- a/es-es/matlab-es.html.markdown +++ b/es-es/matlab-es.html.markdown @@ -13,10 +13,6 @@ lang: es-es MATLAB significa 'MATrix LABoratory'. Es un poderoso lenguaje de computación numérica comúnmente usado en ingeniería y matemáticas. -Si tiene algún comentario, no dude en ponerse en contacto el autor en -[@the_ozzinator](https://twitter.com/the_ozzinator), o -[osvaldo.t.mendoza@gmail.com](mailto:osvaldo.t.mendoza@gmail.com). - ```matlab %% Una sección de código comienza con dos símbolos de porcentaje. Los títulos de la sección van en la misma líneas. % Los comentarios comienzan con un símbolo de porcentaje. @@ -24,7 +20,7 @@ Si tiene algún comentario, no dude en ponerse en contacto el autor en %{ Los Comentarios de multiples líneas se ven -como +como esto %} @@ -38,7 +34,7 @@ esto load learnmatlab.mat y %% Esta es otra sección de código -% Esta sección puede ser editada y ejecutada de manera repetida por sí misma, +% Esta sección puede ser editada y ejecutada de manera repetida por sí misma, % y es útil para la programación exploratoria y demostraciones. A = A * 2; plot(A); @@ -97,7 +93,7 @@ c = exp(a)*sin(pi/2) % c = 7.3891 load('myFile.mat', 'y') % argumentos entre paréntesis, separados por comas % Sintaxis del comando: load myFile.mat y % sin paréntesis, y espacios en lugar de comas -% Tenga en cuenta la falta de comillas en el formulario de comandos: +% Tenga en cuenta la falta de comillas en el formulario de comandos: % las entradas siempre se pasan como texto literal; no pueden pasar valores de variables. % Además, no puede recibir salida: [V,D] = eig(A); % esto no tiene equivalente en forma de comando @@ -241,7 +237,7 @@ A.' % Versión concisa de transposición (sin tomar complejo conjugado) A * B % Multiplicación de matrices A .* B % Multiplica cada elemento en A por su elemento correspondiente en B -% Hay varios pares de funciones, donde una actúa sobre cada elemento y +% Hay varios pares de funciones, donde una actúa sobre cada elemento y % la otra (cuyo nombre termina en m) actúa sobre la matriz completa. exp(A) % exponencializar cada elemento expm(A) % calcular la matriz exponencial @@ -443,7 +439,7 @@ abs(x) % Magnitud de la variable compleja x phase(x) % Fase (o ángulo) de la variable compleja x real(x) % Retorna la parte real de x (es decir, devuelve a si x = a + jb) imag(x) % Retorna la parte imaginaria de x (es decir, devuelve b si x = a + jb) -conj(x) % Retorna el complejo conjugado +conj(x) % Retorna el complejo conjugado % Constantes comunes @@ -507,15 +503,15 @@ find(x) % Encuentra todos los elementos distintos de cero de x y devuelve sus í % Clases % MATLAB puede soportar programación orientada a objetos. -% Las clases deben colocarse en un archivo del nombre de la clase con la extensión .m. +% Las clases deben colocarse en un archivo del nombre de la clase con la extensión .m. % Para comenzar, creamos una clase simple para almacenar puntos de referencia de GPS. % Comience WaypointClass.m classdef WaypointClass % El nombre de la clase. properties % Las propiedades de la clase se comportan como Estructuras - latitude - longitude + latitude + longitude end - methods + methods % Este método que tiene el mismo nombre de la clase es el constructor. function obj = WaypointClass(lat, lon) obj.latitude = lat; @@ -564,4 +560,3 @@ c = a + b * [The official MATLAB Answers forum (EN)](http://www.mathworks.com/matlabcentral/answers/) * [Loren on the Art of MATLAB (EN)](http://blogs.mathworks.com/loren/) * [Cleve's Corner (EN)](http://blogs.mathworks.com/cleve/) - diff --git a/fa-ir/javascript-fa.html.markdown b/fa-ir/javascript-fa.html.markdown index 16b18a7c..0aa8079a 100644 --- a/fa-ir/javascript-fa.html.markdown +++ b/fa-ir/javascript-fa.html.markdown @@ -13,13 +13,6 @@ lang: fa-ir با این حال جاوااسکریپت فقط محدود به مرورگر های وب نمیشود. Node.js پروژه ایست که یک نسخه ی مستقل از اجراکننده ی موتور جاوااسکریپت V8 از گوگل کروم را در اختیار قرار میده که هر روزه درحال محبوب تر شدن نیز هست.

-

-قدر دان نظرات سازنده شما هستم! شما میتوانید از طریق زیر با من تماس بگیرید: -

- -[@ExcitedLeigh](https://twitter.com/ExcitedLeigh), or -[l@leigh.net.au](mailto:l@leigh.net.au). -

// توضیحات همانند C هستند. توضیحات یک خطی با دو خط مورب شروع میشوند.,

diff --git a/ko-kr/javascript-kr.html.markdown b/ko-kr/javascript-kr.html.markdown index 619d8104..267b5b2f 100644 --- a/ko-kr/javascript-kr.html.markdown +++ b/ko-kr/javascript-kr.html.markdown @@ -9,18 +9,15 @@ filename: javascript-kr.js lang: ko-kr --- -자바스크립트는 넷스케이프의 브렌던 아이크(Brendan Eich)가 1995년에 만들었습니다. -원래 자바스크립트는 웹사이트를 위한 단순한 스크립트 언어를 목표로 만들어졌는데, -좀 더 복잡한 웹 애플리케이션을 만들기 위해 자바를 보완하는 역할이었지만 -웹 페이지와의 긴밀한 상호작용과 브라우저에 대한 지원 기능 덕분에 웹 프론트엔드에서 -자바보다 훨씬 더 보편적으로 쓰이게 됐습니다. +자바스크립트는 넷스케이프의 브렌던 아이크(Brendan Eich)가 1995년에 만들었습니다. +원래 자바스크립트는 웹사이트를 위한 단순한 스크립트 언어를 목표로 만들어졌는데, +좀 더 복잡한 웹 애플리케이션을 만들기 위해 자바를 보완하는 역할이었지만 +웹 페이지와의 긴밀한 상호작용과 브라우저에 대한 지원 기능 덕분에 웹 프론트엔드에서 +자바보다 훨씬 더 보편적으로 쓰이게 됐습니다. -그렇지만 자바스크립트는 웹 브라우저에만 국한되지 않습니다. 구글 크롬의 V8 자바스크립트 +그렇지만 자바스크립트는 웹 브라우저에만 국한되지 않습니다. 구글 크롬의 V8 자바스크립트 엔진을 위한 독립형 런타임을 제공하는 Node.js는 점점 인기를 얻고 있습니다. -피드백 주시면 대단히 감사하겠습니다! [@ExcitedLeigh](https://twitter.com/ExcitedLeigh)나 -[l@leigh.net.au](mailto:l@leigh.net.au)를 통해 저와 만나실 수 있습니다. - ```js // 주석은 C와 비슷합니다. 한 줄짜리 주석은 두 개의 슬래시로 시작하고, /* 여러 줄 주석은 슬래시 별표로 시작해서 @@ -30,7 +27,7 @@ lang: ko-kr doStuff(); // 하지만 꼭 그럴 필요는 없는데, 특정 경우를 제외하고 -// 새 줄이 시작할 때마다 세미콜론이 자동으로 삽입되기 때문입니다. +// 새 줄이 시작할 때마다 세미콜론이 자동으로 삽입되기 때문입니다. doStuff() // 여기서는 세미콜론을 생략하겠습니다. 세미콜론을 생략할지 여부는 @@ -57,7 +54,7 @@ doStuff() // 32비트까지 부호가 있는 int로 변환됩니다. 1 << 2 // = 4 -// 괄호를 이용하면 우선순위를 지정할 수 있습니다. +// 괄호를 이용하면 우선순위를 지정할 수 있습니다. (1 + 3) * 2 // = 8 // 실제 숫자가 아닌 특별한 세 가지 값이 있습니다. @@ -97,7 +94,7 @@ false // 그리고 <와 >로 비교할 수 있습니다. "a" < "b" // = true -// 비교 시 타입 강제변환이 수행됩니다. +// 비교 시 타입 강제변환이 수행됩니다. "5" == 5 // = true // ===를 쓰지 않는다면 말이죠. @@ -123,14 +120,14 @@ var someVar = 5 // var 키워드를 지정하지 않아도 오류는 발생하지 않습니다. someOtherVar = 10 -// 그렇지만 변수가 여러분이 정의한 유효범위가 아니라 +// 그렇지만 변수가 여러분이 정의한 유효범위가 아니라 // 전역 유효범위에 생성됩니다. -// 값을 할당하지 않은 채로 선언한 변수는 undefined로 설정됩니다. +// 값을 할당하지 않은 채로 선언한 변수는 undefined로 설정됩니다. var someThirdVar // = undefined // 변수에 수학 연산을 수행하는 축약형 표현은 다음과 같습니다. -someVar += 5 // someVar = someVar + 5;와 같음. 이제 someVar는 10. +someVar += 5 // someVar = someVar + 5;와 같음. 이제 someVar는 10. someVar *= 10 // somVar는 100 // 1을 더하거나 빼는 훨씬 더 짧은 표현도 있습니다. @@ -234,7 +231,7 @@ setTimeout(function myFunction(){ // 이 코드는 5초 내에 호출됨 }, 5000) -// 자바스크립트에는 함수 유효범위가 있습니다. +// 자바스크립트에는 함수 유효범위가 있습니다. // 함수는 자체적인 유효범위를 가지지만 다른 블록은 유효범위를 가지지 않습니다. if (true){ var i = 5 @@ -246,7 +243,7 @@ i // = 5 - 블록 유효범위를 지원하는 언어에서는 undefined가 아 (function(){ var temporary = 5 // '전역 객체'에 할당하는 식으로 전역 유효범위에 접근할 수 있는데, - // 브라우저에서 전역 객체는 항상 'window'입니다. 전역 객체는 + // 브라우저에서 전역 객체는 항상 'window'입니다. 전역 객체는 // Node.js와 같은 브라우저가 아닌 환경에서는 다른 이름일 수도 있습니다. window.permanent = 10 // 또는 앞에서 언급했다시피 var 키워드를 뺄 수도 있습니다. @@ -292,8 +289,8 @@ myObj = { } myObj.myFunc() // = "Hello world!" -// 여기서 설정한 것은 함수가 정의된 곳이 아닌 함수가 호출되는 -// 방식과 관련이 있습니다. 그래서 아래 함수는 객체 컨텍스트에서 +// 여기서 설정한 것은 함수가 정의된 곳이 아닌 함수가 호출되는 +// 방식과 관련이 있습니다. 그래서 아래 함수는 객체 컨텍스트에서 // 호출되지 않으면 동작하지 않습니다. var myFunc = myObj.myFunc myFunc() // = undefined @@ -320,8 +317,8 @@ myNewObj.myNumber // = 5 // 해당 프로퍼티를 찾습니다. // 일부 자바스크립트 구현체에서는 __proto__라는 마법의 프로퍼티로 -// 객체의 프로토타입에 접근하는 것을 허용하기도 합니다. 프로토타입을 -// 설명하기에는 이런 내용도 도움되겠지만 __proto__는 표준에 포함돼 +// 객체의 프로토타입에 접근하는 것을 허용하기도 합니다. 프로토타입을 +// 설명하기에는 이런 내용도 도움되겠지만 __proto__는 표준에 포함돼 // 있지 않습니다. 나중에 프로토타입을 사용하는 표준 방법을 살펴보겠습니다. var myObj = { myString: "Hello world!", @@ -346,18 +343,18 @@ myPrototype.__proto__ = { myObj.myBoolean // = true // 여기서 복사는 일어나지 않습니다. 각 객체에는 프로토타입에 대한 -// 참조가 보관돼 있습니다. 이는 프로토타입을 변경하면 변경사항이 +// 참조가 보관돼 있습니다. 이는 프로토타입을 변경하면 변경사항이 // 모든 곳에 반영된다는 의미입니다. myPrototype.meaningOfLife = 43 myObj.meaningOfLife // = 43 -// 앞에서 __proto__가 표준에 포함돼 있지 않다고 이야기했는데, -// 기존 객체의 프로토타입을 변경하는 표준 방법은 없습니다. +// 앞에서 __proto__가 표준에 포함돼 있지 않다고 이야기했는데, +// 기존 객체의 프로토타입을 변경하는 표준 방법은 없습니다. // 하지만 특정 프로토타입을 가지고 새로운 객체를 생성하는 두 가지 // 방법이 있습니다. -// 첫 번째 방법은 Object.create를 이용하는 것인데, -// Object.create는 최근에 자바스크립트에 추가된 것이라서 아직까지 +// 첫 번째 방법은 Object.create를 이용하는 것인데, +// Object.create는 최근에 자바스크립트에 추가된 것이라서 아직까지 // 모든 구현체에서 이용할 수 있는 것은 아닙니다. var myObj = Object.create(myPrototype) myObj.meaningOfLife // = 43 @@ -388,7 +385,7 @@ if (0){ // 0은 거짓이라서 이 코드는 실행되지 않습니다. } -// 하지만 래퍼 객체와 일반 내장 함수는 프로토타입을 공유하기 때문에 +// 하지만 래퍼 객체와 일반 내장 함수는 프로토타입을 공유하기 때문에 // 가령 문자열에 실제로 기능을 추가할 수 있습니다. String.prototype.firstCharacter = function(){ return this.charAt(0) @@ -399,7 +396,7 @@ String.prototype.firstCharacter = function(){ // 새로운 기능을 구현하는 "폴리필(polyfilling)"에 자주 이용되므로 // 오래된 버전의 브라우저와 같이 기존 환경에서 사용될 수 있습니다. -// 예를 들어, Object.create가 모든 구현체에서 사용 가능한 것은 아니라고 +// 예를 들어, Object.create가 모든 구현체에서 사용 가능한 것은 아니라고 // 했지만 아래의 폴리필을 이용해 Object.create를 여전히 사용할 수 있습니다. if (Object.create === undefined){ // 이미 존재하면 덮어쓰지 않음 Object.create = function(proto){ @@ -415,19 +412,19 @@ if (Object.create === undefined){ // 이미 존재하면 덮어쓰지 않음 ## 기타 참고 자료 -[모질라 개발자 네트워크](https://developer.mozilla.org/en-US/docs/Web/JavaScript)에서는 -자바스크립트에 대한 훌륭한 문서를 제공합니다. 더불어 위키 형식이라서 좀 더 많은 사항을 +[모질라 개발자 네트워크](https://developer.mozilla.org/en-US/docs/Web/JavaScript)에서는 +자바스크립트에 대한 훌륭한 문서를 제공합니다. 더불어 위키 형식이라서 좀 더 많은 사항을 배우게 되면 여러분만의 지식을 공유함으로써 다른 사람들에게 도움을 줄 수도 있습니다. -MDN의 ['자바스크립트 재입문'](https://developer.mozilla.org/ko/docs/A_re-introduction_to_JavaScript)에서는 -여기서 다룬 개념의 상당수를 더욱 자세히 다루고 있습니다. 이 자료에서는 자바스크립트 언어 자체에 -대해서만 상당히 신중하게 다뤘습니다. 웹 페이지에서 자바스크립트를 사용하는 방법을 배우고 싶다면 -[문서 객체 모델(Document Object Model)](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core)에 +MDN의 ['자바스크립트 재입문'](https://developer.mozilla.org/ko/docs/A_re-introduction_to_JavaScript)에서는 +여기서 다룬 개념의 상당수를 더욱 자세히 다루고 있습니다. 이 자료에서는 자바스크립트 언어 자체에 +대해서만 상당히 신중하게 다뤘습니다. 웹 페이지에서 자바스크립트를 사용하는 방법을 배우고 싶다면 +[문서 객체 모델(Document Object Model)](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core)에 관해 배우는 것으로 시작하길 바랍니다. [자바스크립트 가든](http://bonsaiden.github.io/JavaScript-Garden/)에서는 자바스크립트 언어에서 직관에 어긋나는 모든 부분들을 심도 있게 다룹니다. -더불어 이 글에 직접적으로 기여한 분들로, 내용 중 일부는 이 사이트에 있는 -루이 딘(Louie Dihn)의 파이썬 튜토리얼과 모질라 개발자 네트워크에 있는 +더불어 이 글에 직접적으로 기여한 분들로, 내용 중 일부는 이 사이트에 있는 +루이 딘(Louie Dihn)의 파이썬 튜토리얼과 모질라 개발자 네트워크에 있는 [자바스크립트 튜토리얼](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript)을 참고했습니다. diff --git a/matlab.html.markdown b/matlab.html.markdown index 07f73cfb..ddf79f05 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -10,10 +10,6 @@ contributors: MATLAB stands for MATrix LABoratory. It is a powerful numerical computing language commonly used in engineering and mathematics. -If you have any feedback please feel free to reach me at -[@the_ozzinator](https://twitter.com/the_ozzinator), or -[osvaldo.t.mendoza@gmail.com](mailto:osvaldo.t.mendoza@gmail.com). - ```matlab %% Code sections start with two percent signs. Section titles go on the same line. % Comments start with a percent sign. @@ -49,42 +45,42 @@ plot(A); % commands can be passed to the operating system !ping google.com -who % Displays all variables in memory -whos % Displays all variables in memory, with their types -clear % Erases all your variables from memory -clear('A') % Erases a particular variable +who % Displays all variables in memory +whos % Displays all variables in memory, with their types +clear % Erases all your variables from memory +clear('A') % Erases a particular variable openvar('A') % Open variable in variable editor -clc % Erases the writing on your Command Window -diary % Toggle writing Command Window text to file +clc % Erases the writing on your Command Window +diary % Toggle writing Command Window text to file ctrl-c % Abort current computation edit('myfunction.m') % Open function/script in editor type('myfunction.m') % Print the source of function/script to Command Window -profile on % turns on the code profiler -profile off % turns off the code profiler -profile viewer % Open profiler +profile on % turns on the code profiler +profile off % turns off the code profiler +profile viewer % Open profiler -help command % Displays documentation for command in Command Window -doc command % Displays documentation for command in Help Window -lookfor command % Searches for command in the first commented line of all functions +help command % Displays documentation for command in Command Window +doc command % Displays documentation for command in Help Window +lookfor command % Searches for command in the first commented line of all functions lookfor command -all % searches for command in all functions % Output formatting -format short % 4 decimals in a floating number -format long % 15 decimals -format bank % only two digits after decimal point - for financial calculations +format short % 4 decimals in a floating number +format long % 15 decimals +format bank % only two digits after decimal point - for financial calculations fprintf('text') % print "text" to the screen -disp('text') % print "text" to the screen +disp('text') % print "text" to the screen % Variables & Expressions -myVariable = 4 % Notice Workspace pane shows newly created variable +myVariable = 4 % Notice Workspace pane shows newly created variable myVariable = 4; % Semi colon suppresses output to the Command Window -4 + 6 % ans = 10 -8 * myVariable % ans = 32 -2 ^ 3 % ans = 8 +4 + 6 % ans = 10 +8 * myVariable % ans = 32 +2 ^ 3 % ans = 8 a = 2; b = 3; c = exp(a)*sin(pi/2) % c = 7.3891 @@ -92,7 +88,7 @@ c = exp(a)*sin(pi/2) % c = 7.3891 % Standard function syntax: load('myFile.mat', 'y') % arguments within parentheses, separated by commas % Command syntax: -load myFile.mat y % no parentheses, and spaces instead of commas +load myFile.mat y % no parentheses, and spaces instead of commas % Note the lack of quote marks in command form: inputs are always passed as % literal text - cannot pass variable values. Also, can't receive output: [V,D] = eig(A); % this has no equivalent in command form @@ -338,8 +334,8 @@ load('myFileName.mat') % Load saved variables into Workspace % Function name should match file name (so save this example as double_input.m). % 'help double_input.m' returns the comments under line beginning function function output = double_input(x) - %double_input(x) returns twice the value of x - output = 2*x; + %double_input(x) returns twice the value of x + output = 2*x; end double_input(6) % ans = 12 @@ -375,23 +371,23 @@ fprintf % Print to Command Window with more control % Conditional statements (the parentheses are optional, but good style) if (a > 23) - disp('Greater than 23') + disp('Greater than 23') elseif (a == 23) - disp('a is 23') + disp('a is 23') else - disp('neither condition met') + disp('neither condition met') end % Looping % NB. looping over elements of a vector/matrix is slow! % Where possible, use functions that act on whole vector/matrix at once for k = 1:5 - disp(k) + disp(k) end k = 0; while (k < 5) - k = k + 1; + k = k + 1; end % Timing code execution: 'toc' prints the time since 'tic' was called @@ -435,11 +431,11 @@ randi % Uniformly distributed pseudorandom integers randn % Normally distributed pseudorandom numbers %Complex math operations -abs(x) % Magnitude of complex variable x +abs(x) % Magnitude of complex variable x phase(x) % Phase (or angle) of complex variable x real(x) % Returns the real part of x (i.e returns a if x = a +jb) imag(x) % Returns the imaginary part of x (i.e returns b if x = a+jb) -conj(x) % Returns the complex conjugate +conj(x) % Returns the complex conjugate % Common constants @@ -496,23 +492,23 @@ median % median value mean % mean value std % standard deviation perms(x) % list all permutations of elements of x -find(x) % Finds all non-zero elements of x and returns their indexes, can use comparison operators, +find(x) % Finds all non-zero elements of x and returns their indexes, can use comparison operators, % i.e. find( x == 3 ) returns indexes of elements that are equal to 3 % i.e. find( x >= 3 ) returns indexes of elements greater than or equal to 3 % Classes -% MATLAB can support object-oriented programming. -% Classes must be put in a file of the class name with a .m extension. +% MATLAB can support object-oriented programming. +% Classes must be put in a file of the class name with a .m extension. % To begin, we create a simple class to store GPS waypoints. % Begin WaypointClass.m classdef WaypointClass % The class name. properties % The properties of the class behave like Structures - latitude - longitude + latitude + longitude end - methods - % This method that has the same name of the class is the constructor. + methods + % This method that has the same name of the class is the constructor. function obj = WaypointClass(lat, lon) obj.latitude = lat; obj.longitude = lon; @@ -543,12 +539,12 @@ a.longitude = 25.0 % Methods can be called in the same way as functions ans = multiplyLatBy(a,3) -% The method can also be called using dot notation. In this case, the object +% The method can also be called using dot notation. In this case, the object % does not need to be passed to the method. ans = a.multiplyLatBy(1/3) -% MATLAB functions can be overloaded to handle objects. -% In the method above, we have overloaded how MATLAB handles +% MATLAB functions can be overloaded to handle objects. +% In the method above, we have overloaded how MATLAB handles % the addition of two Waypoint objects. b = WaypointClass(15.0, 32.0) c = a + b @@ -560,4 +556,3 @@ c = a + b * [The official MATLAB Answers forum](http://www.mathworks.com/matlabcentral/answers/) * [Loren on the Art of MATLAB](http://blogs.mathworks.com/loren/) * [Cleve's Corner](http://blogs.mathworks.com/cleve/) - diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index e38804f3..c5be649d 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -16,13 +16,9 @@ integração com páginas web e seu suporte nativo nos browsers fez com que ela se tornasse mais comum que Java no frontend web. Javascript não é somente limitada a browsers web, existindo o Node.js, -que é um projeto que fornece um interpretador baseado no motor V8 do Google +que é um projeto que fornece um interpretador baseado no motor V8 do Google Chrome e está se tornando cada vez mais famoso. -Feedback são muito apreciados! Você me encontrar em -[@ExcitedLeigh](https://twitter.com/ExcitedLeigh), ou -[l@leigh.net.au](mailto:l@leigh.net.au). - ```js // Comentários são como em C. Comentários de uma linha começam com duas barras, /* e comentários de múltiplas linhas começam com barra-asterisco @@ -35,7 +31,7 @@ facaAlgo(); // inserido quando há uma nova linha, exceto alguns casos. facaAlgo() -// Como esses casos podem causar resultados inesperados, vamos continuar +// Como esses casos podem causar resultados inesperados, vamos continuar // a usar ponto-e-vírgula neste guia. /////////////////////////////////// @@ -107,7 +103,7 @@ null == undefined; // = true // ...a menos que use === "5" === 5; // = false -null === undefined; // = false +null === undefined; // = false // ...isso pode resultar em comportamentos estranhos... 13 + !0; // 14 @@ -134,7 +130,7 @@ undefined; // usado para indicar um valor que não é a atualmente definido /////////////////////////////////// // 2. Variáveis, Arrays e Objetos -// Variáveis são declaradas com a palavra-chave `var`. O Javascript é +// Variáveis são declaradas com a palavra-chave `var`. O Javascript é // dinâmicamente tipado, portanto você não precisa especificar o tipo. // Atribuições usam um simples caracter de `=`. var someVar = 5; @@ -185,7 +181,7 @@ myObj["my other key"]; // = 4 // válido. myObj.myKey; // = "myValue" -// Objetos são mutáveis, valores podem ser modificados e novas chaves +// Objetos são mutáveis, valores podem ser modificados e novas chaves // adicionadas. myObj.myThirdKey = true; @@ -265,8 +261,8 @@ function myFunction(thing){ myFunction("foo"); // = "FOO" // Repare que o valor a ser retornado deve começar na mesma linha que -// a palavra-chave `return`, senão você sempre irá retornar `undefined` -// visto que o ponto-e-vírgula é inserido automáticamente nas quebras de +// a palavra-chave `return`, senão você sempre irá retornar `undefined` +// visto que o ponto-e-vírgula é inserido automáticamente nas quebras de // linha. Preste atenção quando usar o estilo Allman. function myFunction() { @@ -287,21 +283,21 @@ setTimeout(myFunction, 5000); // Nota: `setTimeout` não é parte da linguagem Javascript, mas é provido pelos // browsers e o Node.js. -// Objetos de funções não precisam nem serem declarados com nome - você pode -// escrever a definição de uma função anônima diretamente nos argumentos de +// Objetos de funções não precisam nem serem declarados com nome - você pode +// escrever a definição de uma função anônima diretamente nos argumentos de // outra função. setTimeout(function(){ // este código será chamado em 5 segundos }, 5000); -// O Javascript tem escopo de função; as funções tem seu próprio escopo, +// O Javascript tem escopo de função; as funções tem seu próprio escopo, // mas outros blocos não. if (true){ var i = 5; } i; // = 5 - não `undefined` como você esperaria numa linguagem de blogo-escopo -// Isso levou a padrão comum chamado de IIFE (Imediately Invoked Function +// Isso levou a padrão comum chamado de IIFE (Imediately Invoked Function // Expression) ou (Expressão de Função Invocada Imediatamente), que previne // que variáveis temporárias vazem para o escopo global. (function(){ @@ -322,7 +318,7 @@ function sayHelloInFiveSeconds(name){ var prompt = "Hello, " + name + "!"; // Funções internas são colocadas no escopo local por padrão, assim como - // se fossem declaradas com `var`. + // se fossem declaradas com `var`. function inner(){ alert(prompt); } @@ -347,7 +343,7 @@ var myObj = { myObj.myFunc(); // = "Olá mundo!" // Quando uma função ligada a um objeto é chamada, ela pode acessar o objeto -// da qual foi ligada usando a palavra-chave `this`. +// da qual foi ligada usando a palavra-chave `this`. myObj = { myString: "Olá mundo!", myFunc: function(){ @@ -356,7 +352,7 @@ myObj = { }; myObj.myFunc(); // = "Olá mundo!" -// O `this` só funciona para dentro do escopo do objeto, portanto, se chamarmos +// O `this` só funciona para dentro do escopo do objeto, portanto, se chamarmos // um método do objeto fora de seu escopo, este não irá funcionar. var myFunc = myObj.myFunc; myFunc(); // = undefined @@ -369,7 +365,7 @@ var myOtherFunc = function(){ myObj.myOtherFunc = myOtherFunc; myObj.myOtherFunc(); // = "OLÁ MUNDO!" -// Nós podemos também especificar um contexto onde a função irá executar, +// Nós podemos também especificar um contexto onde a função irá executar, // usando o `call` ou `apply`. var anotherFunc = function(s){ @@ -389,7 +385,7 @@ Math.min(42, 6, 27); // = 6 Math.min([42, 6, 27]); // = NaN (uh-oh!) Math.min.apply(Math, [42, 6, 27]); // = 6 -// Mas, o `call` e `apply` são somente temporários. Quando você quiser que +// Mas, o `call` e `apply` são somente temporários. Quando você quiser que // permaneça sempre no escopo, use `bind`. var boundFunc = anotherFunc.bind(myObj); @@ -402,7 +398,7 @@ var doubler = product.bind(this, 2); doubler(8); // = 16 // Quando você invoca uma função com a palavra-chave `new`, um novo objeto -// é criado, e fica disponível para a função pela palavra-chave `this`. +// é criado, e fica disponível para a função pela palavra-chave `this`. // Funções são desenhadas para serem invocadas como se invocam os construtores. var MyConstructor = function(){ @@ -411,13 +407,13 @@ var MyConstructor = function(){ myNewObj = new MyConstructor(); // = {myNumber: 5} myNewObj.myNumber; // = 5 -// Todo objeto JavaScript possui um `prototype`. Quando você tenta acessar +// Todo objeto JavaScript possui um `prototype`. Quando você tenta acessar // uma propriedade de um objeto que não existe no objeto atual, o interpretador // vai olhar imediatamente para o seu prototype. -// Algumas implementações em JS deixam você acessar o objeto prototype com a -// propriedade mágica `__proto__`. Enquanto isso é útil para explicar -// prototypes, não é parte de um padrão; nós vamos falar de algumas formas de +// Algumas implementações em JS deixam você acessar o objeto prototype com a +// propriedade mágica `__proto__`. Enquanto isso é útil para explicar +// prototypes, não é parte de um padrão; nós vamos falar de algumas formas de // usar prototypes depois. var myObj = { @@ -436,7 +432,7 @@ myObj.meaningOfLife; // = 42 // Isto funciona para funções, também. myObj.myFunc(); // = "olá mundo!" -// É claro, se sua propriedade não está em seu prototype, +// É claro, se sua propriedade não está em seu prototype, // o prototype do prototype será procurado e por aí vai. myPrototype.__proto__ = { myBoolean: true @@ -450,8 +446,8 @@ myPrototype.meaningOfLife = 43; myObj.meaningOfLife; // = 43 -// Nós mencionamos que o `__proto__` não é uma forma padrão, e não há uma -// forma padrão de mudar o prototype de um objeto já existente. Entretanto, +// Nós mencionamos que o `__proto__` não é uma forma padrão, e não há uma +// forma padrão de mudar o prototype de um objeto já existente. Entretanto, // existem duas formas de se criar um objeto com um dado prototype. // A primeira forma é `Object.create`, que é uma adição recente do JS, @@ -475,7 +471,7 @@ myNewObj2.myNumber = 6 myNewObj2.getMyNumber(); // = 6 // Tipos originais da linguagem como strings e números também possuem -// construtores equivalentes. +// construtores equivalentes. var myNumber = 12; var myNumberObj = new Number(12); myNumber == myNumberObj; // = true @@ -500,7 +496,7 @@ String.prototype.firstCharacter = function(){ // uma nova característica do Javascript em uma versão mais velha, para que // assim funcionem em ambientes mais velhos como browsers ultrapassados. -// Havíamos mencionado que `Object.create` não estava ainda disponível em +// Havíamos mencionado que `Object.create` não estava ainda disponível em // todos as implementações, mas nós podemos usá-lo com esse polyfill: if (Object.create === undefined){ // Não o sobrescreve se já existir Object.create = function(proto){ @@ -517,12 +513,11 @@ if (Object.create === undefined){ // Não o sobrescreve se já existir O [Mozilla Developer Network](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript) dispõe de uma -excelente documentação sobre Javascript e seu uso nos browsers. E mais, +excelente documentação sobre Javascript e seu uso nos browsers. E mais, é uma wiki, portanto conforme você vai aprendendo, mais você pode ir ajudando os outros compartilhando do seu conhecimento. -[Uma re-introdução do JavaScript pela MDN] -(https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/A_re-introduction_to_JavaScript) +[Uma re-introdução do JavaScript pela MDN](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/A_re-introduction_to_JavaScript) cobre muito dos conceitos abordados aqui em mais detalhes. Este guia fala somente sobre a linguagem JavaScript em si; se você quiser aprender mais sobre e como usar o JavaScript em páginas na web, comece aprendendo sobre @@ -532,11 +527,11 @@ Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) [Aprenda Javascript por Exemplos e com Desafios](http://www.learneroo.com/modules/64/nodes/350) é uma variação desse guia com desafios. -[JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) é um guia +[JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) é um guia profundo de todas as partes do JavaScript. [JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) é o guia clássico -/ livro de referência. +/ livro de referência. Parte desse artigo foi adaptado do tutorial de Python do Louie Dinh que está nesse site e do [Tutorial de JS](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/A_re-introduction_to_JavaScript) diff --git a/pt-br/matlab-pt.html.markdown b/pt-br/matlab-pt.html.markdown index cd300f39..7da4aea4 100644 --- a/pt-br/matlab-pt.html.markdown +++ b/pt-br/matlab-pt.html.markdown @@ -8,15 +8,10 @@ translators: - ["Claudson Martins", "https://github.com/claudsonm"] lang: pt-br filename: learnmatlab-pt.mat - --- MATLAB significa MATrix LABoratory. É uma poderosa linguagem de computação numérica geralmente utilizada em engenharia e matemática. -Se você tem algum feedback, por favor fique a vontade para me contactar via -[@the_ozzinator](https://twitter.com/the_ozzinator), ou -[osvaldo.t.mendoza@gmail.com](mailto:osvaldo.t.mendoza@gmail.com). - ```matlab % Comentários iniciam com um sinal de porcentagem @@ -485,10 +480,10 @@ perms(x) % Lista todas as permutações de elementos de x % Início ClassePosicoesGPS.m classdef ClassePosicoesGPS % O nome da classe. properties % As propriedades da classe comportam-se como estruturas - latitude - longitude + latitude + longitude end - methods + methods % Este método que tem o mesmo nome da classe é o construtor. function obj = ClassePosicoesGPS(lat, lon) obj.latitude = lat; @@ -535,4 +530,3 @@ c = a + b * O site oficial [http://http://www.mathworks.com/products/matlab/](http://www.mathworks.com/products/matlab/) * O fórum oficial de respostas: [http://www.mathworks.com/matlabcentral/answers/](http://www.mathworks.com/matlabcentral/answers/) - diff --git a/ta-in/javascript-ta.html.markdown b/ta-in/javascript-ta.html.markdown index 539218a6..f7fd282e 100644 --- a/ta-in/javascript-ta.html.markdown +++ b/ta-in/javascript-ta.html.markdown @@ -4,7 +4,7 @@ contributors: - ['Leigh Brenecki', 'https://leigh.net.au'] - ['Ariel Krakowski', 'http://www.learneroo.com'] translators: - - ["Rasendran Kirushan", "https://github.com/kirushanr"] + - ["Rasendran Kirushan", "https://github.com/kirushanr"] filename: javascript-ta.js lang: ta-in --- @@ -12,37 +12,33 @@ lang: ta-in javascript 1995 ஆம் ஆண்டு Netscape இல் பணிபுரிந்த Brendan Eich என்பவரால் உருவாக்கபட்டது.ஆரம்பத்தில் மிகவும் எளிமையான ஸ்க்ரிப்டிங் மொழியாக இணையதளங்களில் பயன்படுத்தபட்டது. -இது ஜாவா (java ) வில் உருவாக்கபட்ட மிகவும் சிக்கலான இணைய செயலிகளுக்கு -உதவும் முகமாக உருவாக்கபட்டது. எனினும் இணையதள பக்கங்களில் இதன் முழுதான பயன்பாடு -மற்றும் உலாவிகளில் பயன்படுத்த கூடிய வகையில் இருந்தமையாலும் Java வை விட +இது ஜாவா (java ) வில் உருவாக்கபட்ட மிகவும் சிக்கலான இணைய செயலிகளுக்கு +உதவும் முகமாக உருவாக்கபட்டது. எனினும் இணையதள பக்கங்களில் இதன் முழுதான பயன்பாடு +மற்றும் உலாவிகளில் பயன்படுத்த கூடிய வகையில் இருந்தமையாலும் Java வை விட இணையதளகளின் முகப்பு உருவாக்கத்தில் இன்றளவில் முன்னிலை பெற்றுள்ளது. -உலாவிகளுக்கு மட்டும் மட்டுபடுத்தபடவில்லை , Node.js மூலமாக -மிகவும் பிரபல்யமடைந்து வருகின்றது , உதாரணமாக கூகிள்க்ரோம் உலாவியின் +உலாவிகளுக்கு மட்டும் மட்டுபடுத்தபடவில்லை , Node.js மூலமாக +மிகவும் பிரபல்யமடைந்து வருகின்றது , உதாரணமாக கூகிள்க்ரோம் உலாவியின் V8 JavaScript engine Node .js உதவியுடன் இயங்குகிறது . -உங்கள் கருத்துக்கள் மிகவும் வரவேற்கபடுகின்றன , என்னுடன் தொடர்புகொள்ள -[@ExcitedLeigh](https://twitter.com/ExcitedLeigh), or -[l@leigh.net.au](mailto:l@leigh.net.au). - ```js -// குறிப்புக்கள் C நிரலாக்கத்தை ஒத்தது .ஒரு வரி குறிப்புக்கள் "//" குறியீடுடன் ஆரம்பமாகும் +// குறிப்புக்கள் C நிரலாக்கத்தை ஒத்தது .ஒரு வரி குறிப்புக்கள் "//" குறியீடுடன் ஆரம்பமாகும் /* பலவரி குறிப்புக்கள் "/*" ஆரம்பமாகி "/*" இல் முடிவடையும் */ // ஒரு கூற்று முற்றுபெற செய்ய ; இடல் வேண்டும் . doStuff(); -// ...ஆனால் அரைபுள்ளி இட வேண்டும் என்று அவசியம் இல்லை ஏன் எனில் +// ...ஆனால் அரைபுள்ளி இட வேண்டும் என்று அவசியம் இல்லை ஏன் எனில் // ஒரு வரி புதிதாக இடப்படும் போது அரைபுள்ளிகள் தானாகவே இடப்படும் ஆனால் சில தருணங்களை தவிர . doStuff() -// ஆனால் அவ்வாறான தருணங்கள் எதிர்பாராத முடிவுகளை தரலாம் +// ஆனால் அவ்வாறான தருணங்கள் எதிர்பாராத முடிவுகளை தரலாம் // எனவே நாம் தொடர்ந்து ஒரு கூற்று நிறைவடையும் போது அரைபுள்ளி ஒன்றை இடுவோம் . /////////////////////////////////// -// 1. எண்கள்(Number) ,சரம் (String),செயற்குறிகள்(Operators) +// 1. எண்கள்(Number) ,சரம் (String),செயற்குறிகள்(Operators) // JavaScript ஒரே ஒரு எண்வகை காணப்படுகிறது தசமி (which is a 64-bit IEEE 754 double). // தசமி எண்வகை (Doubles) 2^ 52 வரை சேமிக்க கூடியது @@ -50,7 +46,7 @@ doStuff() 3; // = 3 1.5; // = 1.5 -// அடிப்படை கணித பொறிமுறைகள் +// அடிப்படை கணித பொறிமுறைகள் 1 + 1; // = 2 0.1 + 0.2; // = 0.30000000000000004 8 - 1; // = 7 @@ -61,29 +57,29 @@ doStuff() 5 / 2; // = 2.5 -//bitwise பொறிமுறையை உபயோகிக்கும் போது -//உங்கள் தசம எண்ணின் பெறுமானமானது ஒரு நேர் அல்லது மறை அல்லது பூசியமாகவுள்ள முழு எண்ணாக -//மாற்றம் பெறுகிறது இது 32 இருமம்(bit) வரை செல்லலாம் +//bitwise பொறிமுறையை உபயோகிக்கும் போது +//உங்கள் தசம எண்ணின் பெறுமானமானது ஒரு நேர் அல்லது மறை அல்லது பூசியமாகவுள்ள முழு எண்ணாக +//மாற்றம் பெறுகிறது இது 32 இருமம்(bit) வரை செல்லலாம் 1 << 2; // = 4 -// நிரலாக்கத்தில் செயலியை அமுல்படுத்தும் வரிசைமுறையில் அடைப்பு குறிக்கு முன்னிலை வழங்கபடுகிறது +// நிரலாக்கத்தில் செயலியை அமுல்படுத்தும் வரிசைமுறையில் அடைப்பு குறிக்கு முன்னிலை வழங்கபடுகிறது (1 + 3) * 2; // = 8 // மெய் எண் அல்லாத மூன்றுபெறுமானங்கள் உள்ளன : Infinity; // result of e.g. 1/0 -Infinity; // result of e.g. -1/0 -NaN; // result of e.g. 0/0, இது எண் அல்ல என்பதை குறிக்கும் +NaN; // result of e.g. 0/0, இது எண் அல்ல என்பதை குறிக்கும் // தர்க ரீதியில் ஆன கட்டமைப்பு காணப்படுகிறது . true; false; -// சரம் (string) ' அல்லது " குறியீட்டினால் உருவாக்கபடுகிறது +// சரம் (string) ' அல்லது " குறியீட்டினால் உருவாக்கபடுகிறது 'abc'; "Hello, world"; -// ஒரு boolean பெறுமானத்தின் எதிர்மறை பெறுமானத்தை பெற ! குறியீடு பயன்படுத்தபடுகிறது +// ஒரு boolean பெறுமானத்தின் எதிர்மறை பெறுமானத்தை பெற ! குறியீடு பயன்படுத்தபடுகிறது !true; // = false !false; // = true @@ -95,7 +91,7 @@ false; 1 !== 1; // = false 2 !== 1; // = true -// மேலும் சில ஒப்பீடுகள் +// மேலும் சில ஒப்பீடுகள் 1 < 10; // = true 1 > 10; // = false 2 <= 2; // = true @@ -107,15 +103,15 @@ false; // இரண்டு மாறிகளை/பெறுமானங்களை ஒப்பிட < and > "a" < "b"; // = true -// இரண்டு பெறுமானங்கள் / மாறிகள் ஒரேவகையை சேர்ந்தவையா என பார்க்க +// இரண்டு பெறுமானங்கள் / மாறிகள் ஒரேவகையை சேர்ந்தவையா என பார்க்க "5" == 5; // = true null == undefined; // = true // ...இல்லாவிடின் === "5" === 5; // = false -null === undefined; // = false +null === undefined; // = false -// ...கிழே உள்ள கூற்றுகள் எதிர்பாராத +// ...கிழே உள்ள கூற்றுகள் எதிர்பாராத வெளியீடுகளை தரலாம் ... 13 + !0; // 14 "13" + !0; // '13true' @@ -127,11 +123,11 @@ null === undefined; // = false //... ஒரு சரத்தை(string ) சொற்களாக பிரிக்க (substring) `substring "Hello world".substring(0, 5); // = "Hello" -// `length` ஒரு சரத்தில்(string) உள்ள சொற்களின் எண்ணிக்கை அல்லது நீளத்தை(length)அறிய +// `length` ஒரு சரத்தில்(string) உள்ள சொற்களின் எண்ணிக்கை அல்லது நீளத்தை(length)அறிய "Hello".length; // = 5 // `null` மற்றும் `undefined` இரு பெறுமானங்கள் உள்ளன . -null; // மதிப்பு அற்ற ஒரு பெறுமானத்தை குறிக்கும் +null; // மதிப்பு அற்ற ஒரு பெறுமானத்தை குறிக்கும் undefined; // பெறுமானம் இன்னும் நிர்ணயிக்க படவில்லை என்பதை குறிக்கும் ( // `undefined` இருப்பினும் இதுவும் ஒரு பெறுமானமாக கருதபடுகிறது ) @@ -142,35 +138,35 @@ undefined; // பெறுமானம் இன்னும் நிர்ண // 2. மாறிகள் (Variables),அணிகள் (Arrays) மற்றும் பொருட்கள் (Objects) // மாறிகளை உருவாக்க `var ` என்னும் குறியீட்டு சொல் (keyword ) பயன்படுகிறது . -//உருவாக்கப்படும் மாறிகள் எந்த வகையை சார்ந்தன என்பதை JavaScript -//தானாகவே நிர்ணயிக்கும் . மாறிக்கு ஒரு பெறுமானத்தை வழங்க `=` பாவிக்க +//உருவாக்கப்படும் மாறிகள் எந்த வகையை சார்ந்தன என்பதை JavaScript +//தானாகவே நிர்ணயிக்கும் . மாறிக்கு ஒரு பெறுமானத்தை வழங்க `=` பாவிக்க var someVar = 5; -// //நீங்கள் மாறிகளை நிறுவ 'var' குறியீட்டு சொல்லை பயன்படுத்தா விடினும் +// //நீங்கள் மாறிகளை நிறுவ 'var' குறியீட்டு சொல்லை பயன்படுத்தா விடினும் //அது தவறில்லை ... someOtherVar = 10; -// ...ஆனால் நீங்கள் நிறுவிய மாறி(variable) எல்லா உங்கள் ப்ரோக்ராம் இன் சகல இடங்களிலும் -//அணுக கூடியதாய் அமையும் , இல்லாவிடின் அது ஒரு குறிபிட்ட இடத்திற்கு மட்டும் +// ...ஆனால் நீங்கள் நிறுவிய மாறி(variable) எல்லா உங்கள் ப்ரோக்ராம் இன் சகல இடங்களிலும் +//அணுக கூடியதாய் அமையும் , இல்லாவிடின் அது ஒரு குறிபிட்ட இடத்திற்கு மட்டும் //மட்டுபடுத்தபடும் . -//பெறுமானம் வழங்கபடாத மாறிகளுக்கு ,இயல்பாக/தானாக undefined என்ற பெறுமானம் -//வழங்கப்படும் +//பெறுமானம் வழங்கபடாத மாறிகளுக்கு ,இயல்பாக/தானாக undefined என்ற பெறுமானம் +//வழங்கப்படும் var someThirdVar; // = undefined // மாறிகளில் கணித செயல்பாடுகளை நடத்த சுருக்கெழுத்து முறைகள் காணப்படுகின்றன : someVar += 5; // இது someVar = someVar + 5; ஐ ஒத்தது someVar இன் பெறுமானம் இப்போது 10 someVar *= 10; // someVar இன் பெறுமானம் இப்போது 100 -//மிகவும் சுருக்கமான சுருகேழுத்து முறை கூட்டல் அல்லது கழித்தல் செயன்முறையை -//மேற்கொள்ள +//மிகவும் சுருக்கமான சுருகேழுத்து முறை கூட்டல் அல்லது கழித்தல் செயன்முறையை +//மேற்கொள்ள someVar++; // someVar இன் பெறுமானம் இப்போது is 101 someVar--; // someVar இன் பெறுமானம் இப்போது 100 -// அணிகள்(Arrays) எல்லாவகையான பெறுமானங்களையும் உள்ளடக்க கூடியது +// அணிகள்(Arrays) எல்லாவகையான பெறுமானங்களையும் உள்ளடக்க கூடியது var myArray = ["Hello", 45, true]; -// அணிகள்(Arrays) உறுப்பினர்கள் சதுர அடைப்புக்குறிக்குள் அதன் தான இலக்கத்தை கொண்டு +// அணிகள்(Arrays) உறுப்பினர்கள் சதுர அடைப்புக்குறிக்குள் அதன் தான இலக்கத்தை கொண்டு //அணுகமுடியும் . // அணிகளில் உள்ள உறுப்புகள் 0 இருந்து ஆரம்பமாகும் . myArray[1]; // = 45 @@ -182,47 +178,47 @@ myArray.length; // = 4 // அணியில்(Array) ஒரு குறிப்பிட்ட இடத்தில உள்ள பெறுமானத்தை மாற்ற . myArray[3] = "Hello"; -// JavaScript's பொருள் (objects) அகராதியை ஒத்தன -// ஒழுங்கு படுத்த படாத சேகரிப்பு (collection) ஆகும் இதில் ஒரு சாவியும்(key) +// JavaScript's பொருள் (objects) அகராதியை ஒத்தன +// ஒழுங்கு படுத்த படாத சேகரிப்பு (collection) ஆகும் இதில் ஒரு சாவியும்(key) //அதுக்குரிய பெறுமானமும்(value) காணப்படும் . var myObj = {key1: "Hello", key2: "World"}; // விசைகள் சரங்களை, ஆனால் அவர்கள் சரியான என்றால் மேற்கோள் அவசியம் இல்லை //சாவிகளை உ.ம் : "key" என நிறுவலாம் ஆனால் , மேற்கோள் ஆனது சாவி முன்பே நிறுவபட்டிருப்பின் -//அவசியம் இல்லை -// சாவிகளுக்குரிய பெறுமானங்கள் எந்த வகையாகவும் இருக்கலாம் +//அவசியம் இல்லை +// சாவிகளுக்குரிய பெறுமானங்கள் எந்த வகையாகவும் இருக்கலாம் var myObj = {myKey: "myValue", "my other key": 4}; -//பொருள் பண்புகளை சதுர அடைப்புக்குறிக்குள் அதன் சாவியின் பெயரை (key) கொண்டு +//பொருள் பண்புகளை சதுர அடைப்புக்குறிக்குள் அதன் சாவியின் பெயரை (key) கொண்டு //அணுகமுடியும் , myObj["my other key"]; // = 4 // ... அல்லது புள்ளி குறியீட்டை பயன்படுத்தி ,சாவியின் (key is a valid identifier) -//பெயர் மூலம் அணுக முடியும் +//பெயர் மூலம் அணுக முடியும் myObj.myKey; // = "myValue" -// பொருட்கள்(ஒப்ஜெக்ட்ஸ்) மாற்றபடகூடியான சாவிகளின் பெறுமதிகளை மாற்ற முடியும் அத்துடன் புதிய -//சாவிகளை(keys) இடவும் முடியும் +// பொருட்கள்(ஒப்ஜெக்ட்ஸ்) மாற்றபடகூடியான சாவிகளின் பெறுமதிகளை மாற்ற முடியும் அத்துடன் புதிய +//சாவிகளை(keys) இடவும் முடியும் myObj.myThirdKey = true; -//பெறுமதி வரையறுக்கபடாத ஒரு சாவியினை அணுகும் போது +//பெறுமதி வரையறுக்கபடாத ஒரு சாவியினை அணுகும் போது //அது வெளியிடும் பெறுமதி `undefined`. myObj.myFourthKey; // = undefined /////////////////////////////////// // 3. தர்க்கம் மற்றும் கட்டுப்பாட்டு கட்டமைப்பு -// கீழே காட்டப்பட்டுள்ள தொடரியல் ஜாவா வை ஒத்தது +// கீழே காட்டப்பட்டுள்ள தொடரியல் ஜாவா வை ஒத்தது -// The `if` ஒரு குறித்த தர்க்கம் சரியாயின் -//அல்லது என்ற வடிவமைப்பை +// The `if` ஒரு குறித்த தர்க்கம் சரியாயின் +//அல்லது என்ற வடிவமைப்பை var count = 1; if (count == 3){ - // count இன் பெறுமானம் 3 சமமா என பார்க்கபடுகிறது + // count இன் பெறுமானம் 3 சமமா என பார்க்கபடுகிறது } else if (count == 4){ - // count இன் பெறுமானம் 4க்கு சமமா என பார்க்கபடுகிறது + // count இன் பெறுமானம் 4க்கு சமமா என பார்க்கபடுகிறது } else { - // count ஆனது 3 அல்ல 4 அல்ல எனின் + // count ஆனது 3 அல்ல 4 அல்ல எனின் } // ஒரு குறிப்பிட்ட ஒப்பீடு உண்மையாக இருக்கும் வரை `while`. @@ -230,40 +226,40 @@ while (true){ // இந்த இருக்கும் கூற்றுகள் முடிவிலி தடவை மறுபடி செயற்படுத்தப்படும் ! } -// while போல் அல்லாது do-while ,அவை ஒரு தடவையேனும் அதனுள் உள்ள கூற்றுகள் செயற்படுத்தபடும் +// while போல் அல்லாது do-while ,அவை ஒரு தடவையேனும் அதனுள் உள்ள கூற்றுகள் செயற்படுத்தபடும் var input; do { input = getInput(); } while (!isValid(input)) -// for (loop /சுற்று ) C , ஜாவாவை ஒத்தது +// for (loop /சுற்று ) C , ஜாவாவை ஒத்தது //மாறிக்கு பெறுமானத்தை வழங்கல் , மாறியானது தர்க்கத்தை பூர்த்தி செய்கிறதா என பார்த்தல் , -//சுற்றுக்குள் இருக்கும் கூற்றை செயற்படுதல் +//சுற்றுக்குள் இருக்கும் கூற்றை செயற்படுதல் for (var i = 0; i < 5; i++){ - // இந்த சுற்று 5 தடவைகள் தொடர்ந்து செயற்படுத்தபடும் + // இந்த சுற்று 5 தடவைகள் தொடர்ந்து செயற்படுத்தபடும் } -//for /In சுற்றுகள் prototype சங்கிலியில் உள்ள சகல காரணிகள் ஊடகவும் செல்லும் +//for /In சுற்றுகள் prototype சங்கிலியில் உள்ள சகல காரணிகள் ஊடகவும் செல்லும் var description = ""; -var person = {fname:"Paul", lname:"Ken", age:18}; +var person = {fname:"Paul", lname:"Ken", age:18}; for (var x in person){ description += person[x] + " "; } //ஒரு பொருளில் (Object) இடப்பட்ட பண்புகளை (properties) கருத்தில் கொள்ளும் போது -//குறிப்பிட்ட பண்புகளை அந்த Object கொண்டுள்ளதா என பார்க்க +//குறிப்பிட்ட பண்புகளை அந்த Object கொண்டுள்ளதா என பார்க்க var description = ""; -var person = {fname:"Paul", lname:"Ken", age:18}; +var person = {fname:"Paul", lname:"Ken", age:18}; for (var x in person){ if (person.hasOwnProperty(x)){ description += person[x] + " "; } } -//for /in ஆனது அணியில் உள்ள பண்புகள் ஒழுங்குபடுத்தப்பட்டவிதம் முக்கியம் -//ஆயின் பாவிப்பதை தவிர்க்கவும் ஏனெனில் அது சரியான ஒழுங்கில் -//வெளியீட்டை தரும் என்பது ஐயம் ஆகும் +//for /in ஆனது அணியில் உள்ள பண்புகள் ஒழுங்குபடுத்தப்பட்டவிதம் முக்கியம் +//ஆயின் பாவிப்பதை தவிர்க்கவும் ஏனெனில் அது சரியான ஒழுங்கில் +//வெளியீட்டை தரும் என்பது ஐயம் ஆகும் // && is logical and, || is logical or if (house.size == "big" && house.colour == "blue"){ @@ -298,16 +294,16 @@ switch (grade) { /////////////////////////////////// // 4. Functions, Scope and Closures -// JavaScript இல் functions நிறுவ `function` keyword.பயன்படும் +// JavaScript இல் functions நிறுவ `function` keyword.பயன்படும் function myFunction(thing){ return thing.toUpperCase(); } myFunction("foo"); // = "FOO" -//ஒரு பெறுமானத்தை return செய்ய வேண்டும் எனின் இரண்டும் ஒரே வரியில் -//இருக்க வேண்டும் இல்லாவிடின் return ஆனது `undefined ` return செய்யும் -//காற் புள்ளி தானாகவே இடப்படும் , நீங்கள் Allman style உபயோகிக்கும் போது -//அவதானமாக இருக்கவும் +//ஒரு பெறுமானத்தை return செய்ய வேண்டும் எனின் இரண்டும் ஒரே வரியில் +//இருக்க வேண்டும் இல்லாவிடின் return ஆனது `undefined ` return செய்யும் +//காற் புள்ளி தானாகவே இடப்படும் , நீங்கள் Allman style உபயோகிக்கும் போது +//அவதானமாக இருக்கவும் function myFunction() { return // <- semicolon automatically inserted here @@ -317,20 +313,20 @@ function myFunction() } myFunction(); // = undefined -// JavaScript functions ஆனது first class objects ஆகும் ,எனவே அவற்றை மாறிகளுக்கு -//assign செய்ய முடியும் அதுமட்டும் அல்லது functions களில் arguments ஆக அனுப்பமுடியும் +// JavaScript functions ஆனது first class objects ஆகும் ,எனவே அவற்றை மாறிகளுக்கு +//assign செய்ய முடியும் அதுமட்டும் அல்லது functions களில் arguments ஆக அனுப்பமுடியும் // உதாரணமாக ஒரு event handler: function myFunction(){ - //இந்த code 5 செக்கன்களில் செயற்படுத்தப்படும் + //இந்த code 5 செக்கன்களில் செயற்படுத்தப்படும் } setTimeout(myFunction, 5000); -// Note: setTimeout ஆனது ஜாவஸ்க்ரிப்ட் சேர்ந்தது அன்று , ஆனால் அந்த வசதி -//உலாவிகளிலும் ,Node .js காணப்படுகிறது +// Note: setTimeout ஆனது ஜாவஸ்க்ரிப்ட் சேர்ந்தது அன்று , ஆனால் அந்த வசதி +//உலாவிகளிலும் ,Node .js காணப்படுகிறது -// Function objects கட்டாயம் பெயரிடப்பட வீண்டும் என்று அவசியம் இல்லை -// அவை anonymous(பெயரிடப்படாமல்) உருவாக்கபடலாம் +// Function objects கட்டாயம் பெயரிடப்பட வீண்டும் என்று அவசியம் இல்லை +// அவை anonymous(பெயரிடப்படாமல்) உருவாக்கபடலாம் setTimeout(function(){ - //இந்த code 5 செக்கன்களில் செயற்படுத்தப்படும் + //இந்த code 5 செக்கன்களில் செயற்படுத்தப்படும் }, 5000); // JavaScript function ஒரு குறிப்பிட்ட scope(எல்லை) கொண்டுள்ளது ; @@ -339,42 +335,42 @@ setTimeout(function(){ if (true){ var i = 5; } -i; // = 5 - //இது undefined அல்ல +i; // = 5 - //இது undefined அல்ல -// இதன் காரணமாக anonymous functions உடனடியாக செயற்படுத்தபடுகின்றன +// இதன் காரணமாக anonymous functions உடனடியாக செயற்படுத்தபடுகின்றன //இதன் மூலம் தற்காலிக மாறிகள்(variable) குளோபல் scope //இற்கு மாறுவதை தவிர்க்கலாம் . (function(){ var temporary = 5; - //நாங்கள் ஒரு மாறியை எங்கிருந்தும் அணுக (access) அதை "global object" - //ஒன்றுக்கு வழங்க வேண்டும் உலாவியில் அது எப்போதும் `window` ஆகும் . - //உலாவி அல்லாத சூழலில் (Node.js) வேறு பெயருடன் இருக்கும் + //நாங்கள் ஒரு மாறியை எங்கிருந்தும் அணுக (access) அதை "global object" + //ஒன்றுக்கு வழங்க வேண்டும் உலாவியில் அது எப்போதும் `window` ஆகும் . + //உலாவி அல்லாத சூழலில் (Node.js) வேறு பெயருடன் இருக்கும் window.permanent = 10; })(); temporary; // raises ReferenceError permanent; // = 10 -//JavaScript's மிகவும் சக்தி வாய்ந்த ஒரு வசதி closures ஆகும் +//JavaScript's மிகவும் சக்தி வாய்ந்த ஒரு வசதி closures ஆகும் //ஒரு function இன்னொரு function உள் உருவாக்கபடின் -//அது உருவாகப்பட்ட function இன் மாறிகளை அணுக முடியும் +//அது உருவாகப்பட்ட function இன் மாறிகளை அணுக முடியும் function sayHelloInFiveSeconds(name){ var prompt = "Hello, " + name + "!"; - // Inner functions ஆனது local scope இல் காணப்படும் - //அது `var ` என்ற குறியீட்டு சொல்லால் நிறுவப்படும் + // Inner functions ஆனது local scope இல் காணப்படும் + //அது `var ` என்ற குறியீட்டு சொல்லால் நிறுவப்படும் function inner(){ alert(prompt); } setTimeout(inner, 5000); //setTimeout ஆனது background இல் இயங்கும் , எனவே sayHelloInFiveSeconds function, - //செயற்பாடு முடிவடைய ,setTimeout ஆனது inner function call செய்யும். + //செயற்பாடு முடிவடைய ,setTimeout ஆனது inner function call செய்யும். } -sayHelloInFiveSeconds("Adam"); // //இது ஒரு popup ஐ ஐந்து செக்கன்களில் காட்டும் +sayHelloInFiveSeconds("Adam"); // //இது ஒரு popup ஐ ஐந்து செக்கன்களில் காட்டும் /////////////////////////////////// -// 5. Objects; Constructors and Prototypes பற்றி மேலும் +// 5. Objects; Constructors and Prototypes பற்றி மேலும் -// Objects functions ஐ கொண்டிருக்கலாம் +// Objects functions ஐ கொண்டிருக்கலாம் var myObj = { myFunc: function(){ return "Hello world!"; @@ -382,8 +378,8 @@ var myObj = { }; myObj.myFunc(); // = "Hello world!" -//functions ஆனது objects உடன் இணைக்கப்பட்டுள போது அவை object ஐ அணுக முடியும் -//அவை this என்ற குறியீட்டு சொல்லை பயன்படுத்தி இணைக்கபடுகின்றன +//functions ஆனது objects உடன் இணைக்கப்பட்டுள போது அவை object ஐ அணுக முடியும் +//அவை this என்ற குறியீட்டு சொல்லை பயன்படுத்தி இணைக்கபடுகின்றன myObj = { myString: "Hello world!", myFunc: function(){ @@ -392,20 +388,20 @@ myObj = { }; myObj.myFunc(); // = "Hello world!" -//எங்கள் function ஆனது தொழிற் படாமல் போகலாம் அது context(அமைப்பு ) of the object call செய்யபடவிடின் +//எங்கள் function ஆனது தொழிற் படாமல் போகலாம் அது context(அமைப்பு ) of the object call செய்யபடவிடின் var myFunc = myObj.myFunc; myFunc(); // = undefined -//function ஆனது ஒரு object உக்கு assign செய்யலாம் பிறகு அதை நாம் அணுகமுடியும் -//`this` மூலம் +//function ஆனது ஒரு object உக்கு assign செய்யலாம் பிறகு அதை நாம் அணுகமுடியும் +//`this` மூலம் var myOtherFunc = function(){ return this.myString.toUpperCase(); } myObj.myOtherFunc = myOtherFunc; myObj.myOtherFunc(); // = "HELLO WORLD!" -//ஒரு function ஒரு அமைப்பை நாம் உருவாக்க முடியும் +//ஒரு function ஒரு அமைப்பை நாம் உருவாக்க முடியும் //அதை நாம் `call` அல்லது `apply` மூலம் செயல்படுத்த முடியும் var anotherFunc = function(s){ @@ -413,34 +409,34 @@ var anotherFunc = function(s){ } anotherFunc.call(myObj, " And Hello Moon!"); // = "Hello World! And Hello Moon!" -//apply செயற்பாட்டளவில் ஒத்தன ,ஆனால் அது array (அணி) argument +//apply செயற்பாட்டளவில் ஒத்தன ,ஆனால் அது array (அணி) argument //ஆக எடுக்கிறது. anotherFunc.apply(myObj, [" And Hello Sun!"]); // = "Hello World! And Hello Sun!" -//இது தொடர்ச்சியான arguments ஐ நாம் function ஒன்றுக்குள் pass பண்ண -//வேண்டும் எனில் மிகவும் உபயோகமானது +//இது தொடர்ச்சியான arguments ஐ நாம் function ஒன்றுக்குள் pass பண்ண +//வேண்டும் எனில் மிகவும் உபயோகமானது Math.min(42, 6, 27); // = 6 Math.min([42, 6, 27]); // = NaN (uh-oh!) Math.min.apply(Math, [42, 6, 27]); // = 6 -//ஆனால் `call ` ,`apply ` இரண்டும் தற்காலிகமானவை -//அவற்றை நிரந்தரமாக்க bind function ஐ பயன்படுத்தவும் +//ஆனால் `call ` ,`apply ` இரண்டும் தற்காலிகமானவை +//அவற்றை நிரந்தரமாக்க bind function ஐ பயன்படுத்தவும் var boundFunc = anotherFunc.bind(myObj); boundFunc(" And Hello Saturn!"); // = "Hello World! And Hello Saturn!" -//`bind ` ஐ உபயோகித்து ஒரு function ஐ பகுதியாக apply செய்ய முடியும் +//`bind ` ஐ உபயோகித்து ஒரு function ஐ பகுதியாக apply செய்ய முடியும் var product = function(a, b){ return a * b; } var doubler = product.bind(this, 2); doubler(8); // = 16 -//ஒரு function ஐ நாம் new என்ற குறியீட்டு சொல்லை பயன்படுத்தி -//அழைக்கும் போது புதிய object உருவாக்கப்படும் .இவ்வாறான functions -//constructors என அழைக்கப்படும் +//ஒரு function ஐ நாம் new என்ற குறியீட்டு சொல்லை பயன்படுத்தி +//அழைக்கும் போது புதிய object உருவாக்கப்படும் .இவ்வாறான functions +//constructors என அழைக்கப்படும் var MyConstructor = function(){ this.myNumber = 5; @@ -448,15 +444,15 @@ var MyConstructor = function(){ myNewObj = new MyConstructor(); // = {myNumber: 5} myNewObj.myNumber; // = 5 -//ஒவ்வொரு JavaScript object உம் ஒரு `prototype ` கொண்டுள்ளது -//நீங்கள் object ஒன்றின் ஒரு property ஐ அணுகும் போது -//அந்த property இல்லாவிடின் interpreter ஆனது -//அதன் prototype உள்ளதா என பார்க்கும் +//ஒவ்வொரு JavaScript object உம் ஒரு `prototype ` கொண்டுள்ளது +//நீங்கள் object ஒன்றின் ஒரு property ஐ அணுகும் போது +//அந்த property இல்லாவிடின் interpreter ஆனது +//அதன் prototype உள்ளதா என பார்க்கும் -//JS இன் சில செயலாக்கங்கள் ஒரு object இன் protoype ஐ +//JS இன் சில செயலாக்கங்கள் ஒரு object இன் protoype ஐ //இலகுவாக `__proto__` மூலம் access செய்ய முடியும் . -//இது prototype பாவணை யை இலகுவாக்கினாலும் -//இது சரியான ஒரு முறை அல்ல +//இது prototype பாவணை யை இலகுவாக்கினாலும் +//இது சரியான ஒரு முறை அல்ல var myObj = { myString: "Hello world!" }; @@ -473,21 +469,21 @@ myObj.meaningOfLife; // = 42 // This works for functions, too. myObj.myFunc(); // = "hello world!" -//உங்கள் property prototype இல் இல்லது இருப்பின் , protype இன் -//prototype search செய்யப்படும் +//உங்கள் property prototype இல் இல்லது இருப்பின் , protype இன் +//prototype search செய்யப்படும் myPrototype.__proto__ = { myBoolean: true }; myObj.myBoolean; // = true -//ஒவ்வொரு object உம் அதன் protype க்கும் reference (மேற்கோள் ) ஒன்றை வைத்திருக்கும் +//ஒவ்வொரு object உம் அதன் protype க்கும் reference (மேற்கோள் ) ஒன்றை வைத்திருக்கும் //நாம் ஒரு protype இணை மாற்றினால் அதன் மாற்றங்கள் எல்லா இடத்திலும் (program இல் ) -//பிரதிபலிக்கும் +//பிரதிபலிக்கும் myPrototype.meaningOfLife = 43; myObj.meaningOfLife; // = 43 - -//நாம் முன்பு கூறியது போல் `__proto__` பயன்படுத்துவது சரியான முறை அல்ல + +//நாம் முன்பு கூறியது போல் `__proto__` பயன்படுத்துவது சரியான முறை அல்ல //எனவே நாம் ஒரு protype ஐ object இல் உருவாக்க இரண்டு வழிமுறைகள் //உள்ளன @@ -550,7 +546,7 @@ String.prototype.firstCharacter = function(){ //இது பழைய சூழல்களில் உபயோகிகப்படும். -//நாங்கள் முன்பு கூறி இருந்தோம் Object.create சில இடங்களில் இந்த முறை இன்னும் +//நாங்கள் முன்பு கூறி இருந்தோம் Object.create சில இடங்களில் இந்த முறை இன்னும் //அறிமுகம் ஆகவில்லை என்று ஆனால் இதை polyfill ஐ பயன்படுத்தி உருவாக்க //முடியும் diff --git a/tr-tr/csharp-tr.html.markdown b/tr-tr/csharp-tr.html.markdown index 9834be20..e9dae611 100644 --- a/tr-tr/csharp-tr.html.markdown +++ b/tr-tr/csharp-tr.html.markdown @@ -9,17 +9,14 @@ translators: - ["Melih Mucuk", "http://melihmucuk.com"] lang: tr-tr filename: LearnCSharp-tr.cs - --- C# zarif ve tip güvenli nesne yönelimli bir dil olup geliştiricilerin .NET framework üzerinde çalışan güçlü ve güvenli uygulamalar geliştirmesini sağlar. -[Yazım yanlışları ve öneriler için bana ulaşabilirsiniz](mailto:melihmucuk@gmail.com) - [Daha fazlasını okuyun.](http://msdn.microsoft.com/en-us/library/vstudio/z1zx9t92.aspx) ```c# -// Tek satırlık yorumlar // ile başlar +// Tek satırlık yorumlar // ile başlar /* Birden fazla satırlı yorumlar buna benzer */ @@ -46,7 +43,7 @@ namespace Learning public class LearnCSharp { // TEMEL SÖZ DİZİMİ - daha önce Java ya da C++ kullandıysanız İLGİNÇ ÖZELLİKLER'e geçin - public static void Syntax() + public static void Syntax() { // Satırları yazdırmak için Console.WriteLine kullanın Console.WriteLine("Merhaba Dünya"); @@ -111,7 +108,7 @@ namespace Learning string fooString = "\"escape\" quotes and add \n (new lines) and \t (tabs)"; Console.WriteLine(fooString); - // İndeks numarası kullanarak bir string'in bütün karakterlerine erişilebilirsiniz: + // İndeks numarası kullanarak bir string'in bütün karakterlerine erişilebilirsiniz: char charFromString = fooString[1]; // => 'e' // String'ler değiştirilemez: fooString[1] = 'X' işlemini yapamazsınız; @@ -129,7 +126,7 @@ namespace Learning string bazString = @"Here's some stuff on a new line! ""Wow!"", the masses cried"; - // Bir değişkeni değiştirilemez yapmak için const ya da read-only kullanın. + // Bir değişkeni değiştirilemez yapmak için const ya da read-only kullanın. // const değerleri derleme sırasında hesaplanır const int HOURS_I_WORK_PER_WEEK = 9001; @@ -357,7 +354,7 @@ on a new line! ""Wow!"", the masses cried"; // // İLGİNÇ ÖZELLİKLER // - + // VARSAYILAN METOD TANIMLAMALARI public // Görünebilir @@ -369,7 +366,7 @@ on a new line! ""Wow!"", the masses cried"; int another = 3, params string[] otherParams // Metoda gönderilen diğer bütün parametreleri alır ) - { + { return -1; } @@ -382,8 +379,8 @@ on a new line! ""Wow!"", the masses cried"; // TKey ve TValue değerleri kullanıcı tarafından bu fonksiyon çağırılırken belirtilir. // Bu metod Python'daki SetDefault'a benzer public static TValue SetDefault( - IDictionary dictionary, - TKey key, + IDictionary dictionary, + TKey key, TValue defaultItem) { TValue result; @@ -428,7 +425,7 @@ on a new line! ""Wow!"", the masses cried"; // GENERIC'LER // - var phonebook = new Dictionary() { + var phonebook = new Dictionary() { {"Sarah", "212 555 5555"} // Telefon rehberine bir kaç numara ekleyelim. }; @@ -449,19 +446,19 @@ on a new line! ""Wow!"", the masses cried"; writer.WriteLine("Nothing suspicious here"); // Bu bölümün sonunda kaynaklar temilenir. // Hata fırlatılmış olsa bile. - } + } // PARALEL FRAMEWORK // http://blogs.msdn.com/b/csharpfaq/archive/2010/06/01/parallel-programming-in-net-framework-4-getting-started.aspx - var websites = new string[] { - "http://www.google.com", "http://www.reddit.com", + var websites = new string[] { + "http://www.google.com", "http://www.reddit.com", "http://www.shaunmccarthy.com" }; var responses = new Dictionary(); - - // Her istek farklı bir thread de işlem görecek + + // Her istek farklı bir thread de işlem görecek // bir sonraki işleme geçmeden birleştirilecek. - Parallel.ForEach(websites, + Parallel.ForEach(websites, new ParallelOptions() {MaxDegreeOfParallelism = 3}, // en fazla 3 thread kullanmak için website => { @@ -506,7 +503,7 @@ on a new line! ""Wow!"", the masses cried"; // ASPARALLEL // Linq ve paralel işlemlerini birleştirme var threeWheelers = bikes.AsParallel().Where(b => b.Wheels == 3).Select(b => b.Name); - // bu paralel bir şekilde gerçekleşecek! Threadler otomatik ve sihirli bir şekilde işleri paylaşacak! + // bu paralel bir şekilde gerçekleşecek! Threadler otomatik ve sihirli bir şekilde işleri paylaşacak! // Birden fazla çekirdeğiniz varsa büyük veri setleri ile kullanmak için oldukça uygun bir yapı. // LINQ - IQueryable objelerini mapler ve saklar, gecikmeli bir işlemdir @@ -524,9 +521,9 @@ on a new line! ""Wow!"", the masses cried"; .Select(b => b.Name); // hala sorgu çalışmadı // Şimdi sorgu çalışıyor, reader'ı açar ama sadece sizin sorgunuza uyanlar foreach döngüsüne girer. - foreach (string bike in query) + foreach (string bike in query) Console.WriteLine(result); - + } @@ -609,7 +606,7 @@ on a new line! ""Wow!"", the masses cried"; // Kurucular sınıf oluşturmanın bir yoludur // Bu bir varsayılan kurucudur. - public Bicycle() + public Bicycle() { this.Gear = 1; // bu objenin üyelerine this anahtar kelimesi ile ulaşılır Cadence = 50; // ama her zaman buna ihtiyaç duyulmaz @@ -621,13 +618,13 @@ on a new line! ""Wow!"", the masses cried"; // Bu belirlenmiş bir kurucudur. (argümanlar içerir) public Bicycle(int startCadence, int startSpeed, int startGear, - string name, bool hasCardsInSpokes, BikeBrand brand) + string name, bool hasCardsInSpokes, BikeBrand brand) : base() // önce base'i çağırın { - Gear = startGear; + Gear = startGear; Cadence = startCadence; _speed = startSpeed; - Name = name; + Name = name; _hasCardsInSpokes = hasCardsInSpokes; Brand = brand; } @@ -666,7 +663,7 @@ on a new line! ""Wow!"", the masses cried"; set { _hasTassles = value; } } - // Ayrıca tek bir satırda otomatik property tanımlayabilirsiniz. + // Ayrıca tek bir satırda otomatik property tanımlayabilirsiniz. // bu söz dizimi otomatik olarak alan oluşturacaktır. // Erişimi kısıtlamak için nitelik belirleyiciler getter veya setter'a ya da ikisine birden atanabilir: public bool IsBroken { get; private set; } @@ -819,7 +816,4 @@ on a new line! ""Wow!"", the masses cried"; * [ASP.NET Web Matrix Tutorials](http://www.asp.net/web-pages/tutorials) * [ASP.NET Web Forms Tutorials](http://www.asp.net/web-forms/tutorials) * [Windows Forms Programming in C#](http://www.amazon.com/Windows-Forms-Programming-Chris-Sells/dp/0321116208) - - - -[C# Kodlama Adetleri](http://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx) + * [C# Kodlama Adetleri](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions) diff --git a/zh-cn/javascript-cn.html.markdown b/zh-cn/javascript-cn.html.markdown index 45e30932..d637c21c 100644 --- a/zh-cn/javascript-cn.html.markdown +++ b/zh-cn/javascript-cn.html.markdown @@ -16,10 +16,6 @@ Javascript 于 1995 年由网景公司的 Brendan Eich 发明。最初它作为 不过,Javascript 不仅用于网页浏览器,一个名为 Node.js 的项目提供了面向 Google Chrome V8 引擎的独立运行时环境,它正在变得越来越流行。 -很欢迎来自您的反馈,您可以通过下列方式联系到我: -[@ExcitedLeigh](https://twitter.com/ExcitedLeigh), 或者 -[l@leigh.net.au](mailto:l@leigh.net.au). - ```js // 注释方式和C很像,这是单行注释 /* 这是多行 @@ -83,7 +79,7 @@ false; 1 !== 1; // = false 2 !== 1; // = true -// 更多的比较操作符 +// 更多的比较操作符 1 < 10; // = true 1 > 10; // = false 2 <= 2; // = true @@ -101,7 +97,7 @@ null == undefined; // = true // ...除非你是用 === "5" === 5; // = false -null === undefined; // = false +null === undefined; // = false // ...但会导致奇怪的行为 13 + !0; // 14 @@ -127,7 +123,7 @@ undefined; // 用来表示还没有设置的值(尽管`undefined`自身实际是 // 2. 变量、数组和对象 // 变量需要用`var`关键字声明。Javascript是动态类型语言, -// 所以你无需指定类型。 赋值需要用 `=` +// 所以你无需指定类型。 赋值需要用 `=` var someVar = 5; // 如果你在声明时没有加var关键字,你也不会得到错误... @@ -139,7 +135,7 @@ someOtherVar = 10; var someThirdVar; // = undefined // 对变量进行数学运算有一些简写法: -someVar += 5; // 等价于 someVar = someVar + 5; someVar 现在是 10 +someVar += 5; // 等价于 someVar = someVar + 5; someVar 现在是 10 someVar *= 10; // 现在 someVar 是 100 // 自增和自减也有简写 @@ -191,7 +187,7 @@ if (count == 3){ } else if (count == 4){ // count 是 4 时执行 } else { - // 其他情况下执行 + // 其他情况下执行 } // while循环 @@ -219,12 +215,12 @@ if (colour == "red" || colour == "blue"){ // colour是red或者blue时执行 } -// && 和 || 是“短路”语句,它在设定初始化值时特别有用 +// && 和 || 是“短路”语句,它在设定初始化值时特别有用 var name = otherName || "default"; // `switch`语句使用`===`检查相等性。 // 在每一个case结束时使用 'break' -// 否则其后的case语句也将被执行。 +// 否则其后的case语句也将被执行。 grade = 'B'; switch (grade) { case 'A': @@ -286,7 +282,7 @@ i; // = 5 - 并非我们在其他语言中所期望得到的undefined (function(){ var temporary = 5; // 我们可以访问修改全局对象("global object")来访问全局作用域, - // 在web浏览器中是`window`这个对象。 + // 在web浏览器中是`window`这个对象。 // 在其他环境如Node.js中这个对象的名字可能会不同。 window.permanent = 10; })(); diff --git a/zh-cn/matlab-cn.html.markdown b/zh-cn/matlab-cn.html.markdown index b74b153f..009020ff 100644 --- a/zh-cn/matlab-cn.html.markdown +++ b/zh-cn/matlab-cn.html.markdown @@ -7,16 +7,11 @@ contributors: translators: - ["sunxb10", "https://github.com/sunxb10"] lang: zh-cn - --- MATLAB 是 MATrix LABoratory(矩阵实验室)的缩写。 它是一种功能强大的数值计算语言,在工程和数学领域中应用广泛。 -如果您有任何需要反馈或交流的内容,请联系本教程作者: -[@the_ozzinator](https://twitter.com/the_ozzinator) -或 [osvaldo.t.mendoza@gmail.com](mailto:osvaldo.t.mendoza@gmail.com)。 - ```matlab % 以百分号作为注释符 @@ -68,10 +63,10 @@ disp('text') % 在命令窗口中显示 "text" % 变量与表达式 myVariable = 4 % 命令窗口中将新创建的变量 myVariable = 4; % 加上分号可使命令窗口中不显示当前语句执行结果 -4 + 6 % ans = 10 -8 * myVariable % ans = 32 -2 ^ 3 % ans = 8 -a = 2; b = 3; +4 + 6 % ans = 10 +8 * myVariable % ans = 32 +2 ^ 3 % ans = 8 +a = 2; b = 3; c = exp(a)*sin(pi/2) % c = 7.3891 @@ -114,7 +109,7 @@ b(2) % ans = 符 % 元组(cell 数组) -a = {'one', 'two', 'three'} +a = {'one', 'two', 'three'} a(1) % ans = 'one' - 返回一个元组 a{1} % ans = one - 返回一个字符串 @@ -126,7 +121,7 @@ A.d.e = false; % 向量 -x = [4 32 53 7 1] +x = [4 32 53 7 1] x(2) % ans = 32,MATLAB中向量的下标索引从1开始,不是0 x(2:3) % ans = 32 53 x(2:end) % ans = 32 53 7 1 @@ -137,7 +132,7 @@ x = [1:10] % x = 1 2 3 4 5 6 7 8 9 10 % 矩阵 -A = [1 2 3; 4 5 6; 7 8 9] +A = [1 2 3; 4 5 6; 7 8 9] % 以分号分隔不同的行,以空格或逗号分隔同一行中的不同元素 % A = @@ -146,7 +141,7 @@ A = [1 2 3; 4 5 6; 7 8 9] % 7 8 9 A(2,3) % ans = 6,A(row, column) -A(6) % ans = 8 +A(6) % ans = 8 % (隐式地将 A 的三列首尾相接组成一个列向量,然后取其下标为 6 的元素) @@ -185,7 +180,7 @@ A(1,:) % 第 1 行的所有元素 % 4 5 42 % 7 8 9 -% 等价于 +% 等价于 vertcat(A, A); @@ -226,7 +221,7 @@ A .* B % 元素乘法,要求 A 和 B 形状一致,即两矩阵行列数完 % 元素乘法的结果是与 A 和 B 形状一致的矩阵 % 其每个元素等于 A 对应位置的元素乘 B 对应位置的元素 -% 以下函数中,函数名以 m 结尾的执行矩阵运算,其余执行元素运算: +% 以下函数中,函数名以 m 结尾的执行矩阵运算,其余执行元素运算: exp(A) % 对矩阵中每个元素做指数运算 expm(A) % 对矩阵整体做指数运算 sqrt(A) % 对矩阵中每个元素做开方运算 @@ -290,7 +285,7 @@ clf clear % 清除图形窗口中的图像,并重置图像属性 % 图像属性可以通过图像句柄进行设定 % 在创建图像时可以保存图像句柄以便于设置 -% 也可以用 gcf 函数返回当前图像的句柄 +% 也可以用 gcf 函数返回当前图像的句柄 h = plot(x, y); % 在创建图像时显式地保存图像句柄 set(h, 'Color', 'r') % 颜色代码: @@ -323,8 +318,8 @@ cd /path/to/move/into % 以制定路径作为当前工作目录 % 变量可保存到 .mat 格式的本地文件 -save('myFileName.mat') % 保存当前工作空间中的所有变量 -load('myFileName.mat') % 将指定文件中的变量载入到当前工作空间 +save('myFileName.mat') % 保存当前工作空间中的所有变量 +load('myFileName.mat') % 将指定文件中的变量载入到当前工作空间 % .m 脚本文件 @@ -339,11 +334,11 @@ load('myFileName.mat') % 将指定文件中的变量载入到当前工作空间 % 函数文件的名称应当与其所定义的函数的名称一致 % 比如下面例子中函数文件就应命名为 double_input.m % 使用 'help double_input.m' 可返回函数定义中第一行注释信息 -function output = double_input(x) +function output = double_input(x) % double_input(x) 返回 x 的 2 倍 output = 2*x; end -double_input(6) % ans = 12 +double_input(6) % ans = 12 % 同样还可以定义子函数和内嵌函数 @@ -389,8 +384,8 @@ end for k = 1:5 disp(k) end - -k = 0; + +k = 0; while (k < 5) k = k + 1; end @@ -411,7 +406,7 @@ driver = 'com.mysql.jdbc.Driver'; dburl = ['jdbc:mysql://localhost:8889/' dbname]; javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); % 此处 xx 代表具体版本号 % 这里的 mysql-connector-java-5.1.xx-bin.jar 可从 http://dev.mysql.com/downloads/connector/j/ 下载 -conn = database(dbname, username, password, driver, dburl); +conn = database(dbname, username, password, driver, dburl); sql = ['SELECT * from table_name where id = 22'] % SQL 语句 a = fetch(conn, sql) % a 即包含所需数据 @@ -423,7 +418,7 @@ tan(x) asin(x) acos(x) atan(x) -exp(x) +exp(x) sqrt(x) log(x) log10(x) @@ -456,7 +451,7 @@ pinv(A) % 伪逆矩阵 zeros(m, n) % m x n 阶矩阵,元素全为 0 ones(m, n) % m x n 阶矩阵,元素全为 1 diag(A) % 返回矩阵 A 的对角线元素 -diag(x) % 构造一个对角阵,对角线元素就是向量 x 的各元素 +diag(x) % 构造一个对角阵,对角线元素就是向量 x 的各元素 eye(m, n) % m x n 阶单位矩阵 linspace(x1, x2, n) % 返回介于 x1 和 x2 之间的 n 个等距节点 inv(A) % 矩阵 A 的逆矩阵 @@ -485,14 +480,14 @@ flipud(A) % 将一个矩阵上下翻转 % 常用向量函数 max % 最大值 -min % 最小值 +min % 最小值 length % 元素个数 -sort % 按升序排列 -sum % 各元素之和 +sort % 按升序排列 +sum % 各元素之和 prod % 各元素之积 mode % 众数 -median % 中位数 -mean % 平均值 +median % 中位数 +mean % 平均值 std % 标准差 perms(x) % x 元素的全排列 ``` diff --git a/zh-cn/red-cn.html.markdown b/zh-cn/red-cn.html.markdown index a0abce6e..96ab117b 100644 --- a/zh-cn/red-cn.html.markdown +++ b/zh-cn/red-cn.html.markdown @@ -198,7 +198,7 @@ Red 相关的源码信息在 [Red 语言主页](https://www.red-lang.org)。 Red/System 特性在 [这里](https://static.red-lang.org/red-system-specs-light.html)。 -想要了解更多关于 Rebol 和 Red 的信息,加入 [Gitter 聊天室](https://gitter.im/red/red)。如果你无法加入,也可以给我们发[邮件](mailto:red-langNO_SPAM@googlegroups.com)。 +想要了解更多关于 Rebol 和 Red 的信息,加入 [Gitter 聊天室](https://gitter.im/red/red)。 也可以在 [Stack Overflow](https://stackoverflow.com/questions/tagged/red) 上查阅、提交问题。 -- cgit v1.2.3