fix(guide): Fix all frontmatter

This commit is contained in:
Bouncey
2018-10-19 13:53:51 +01:00
committed by Stuart Taylor
parent 569bd7c3a7
commit 6d511c558a
146 changed files with 926 additions and 1469 deletions

View File

@ -1,5 +1,5 @@
--- ---
title : Features of BlockTech title: Features of BlockTech
localeTitle: ميزات BlockTech localeTitle: ميزات BlockTech
--- ---
## ملامح تقنية Blockchain ## ملامح تقنية Blockchain

View File

@ -1,5 +1,6 @@
---
title: Smart Contracts title: Smart Contracts
localeTitle: undefined localeTitle: Smart Contracts
--- ---
## العقود الذكية ## العقود الذكية

View File

@ -1,5 +1,5 @@
--- ---
title : Types of Blockchain title: Types of Blockchain
localeTitle: أنواع blockchain localeTitle: أنواع blockchain
--- ---
![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true) ![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true)

View File

@ -1,6 +1,6 @@
--- ---
title: Create a Gradual CSS Linear Gradient title: Create a Gradual CSS Linear Gradient
localeTitle: إنشاء تدرج خطي متدرج CSS localeTitle: إنشاء تدرج خطي متدرج CSS
--- ---
\## إنشاء تدرج خطي متدرج CSS \## إنشاء تدرج خطي متدرج CSS
@ -8,8 +8,8 @@
الصيغة هي دائما: الصيغة هي دائما:
`background-image: linear-gradient(angle, color-stop1, color-stop2); `background-image: linear-gradient(angle, color-stop1, color-stop2);
` `
يمكن استخدام الألوان في تنسيقات hex () و rgb (). جرب قليلا وسوف تفهم كم هو سهل وجميل استخدامه. يمكن استخدام الألوان في تنسيقات hex () و rgb (). جرب قليلا وسوف تفهم كم هو سهل وجميل استخدامه.

View File

@ -1,17 +1,20 @@
title: Add a Submit Button to a Form ---
localeTitle: undefined title: Add a Submit Button to a Form
--- ## إضافة زر إرسال إلى نموذج localeTitle: إضافة زر إرسال إلى نموذج
---
## إضافة زر إرسال إلى نموذج
في هذا التحدي ، تريد إدراج زر الإرسال باعتباره آخر عنصر في النموذج (قبل علامة الإغلاق `</form>` ) ولإعطائه `type="submit"` السمة `type="submit"` (كل شيء صغير) ومحتوى نصي من "إرسال "(الحرف الأول من الأحرف الكبيرة) كما هو محدد في إرشادات التحدّي. في هذا التحدي ، تريد إدراج زر الإرسال باعتباره آخر عنصر في النموذج (قبل علامة الإغلاق `</form>` ) ولإعطائه `type="submit"` السمة `type="submit"` (كل شيء صغير) ومحتوى نصي من "إرسال "(الحرف الأول من الأحرف الكبيرة) كما هو محدد في إرشادات التحدّي.
1) تكون قيمة `submit` `type` السمة صالحة أيضًا داخل علامة `input` وستعرض زرًا له نفس السلوك تقريبًا ، ولكن هذه ليست العلامة التي تريد استخدامها في هذا التحدي. 1) تكون قيمة `submit` `type` السمة صالحة أيضًا داخل علامة `input` وستعرض زرًا له نفس السلوك تقريبًا ، ولكن هذه ليست العلامة التي تريد استخدامها في هذا التحدي.
`<input type="submit"> `<input type="submit">
` `
إذا لم تحدد قيمة ، فسيحتوي الزر على قيمة افتراضية تم اختيارها من قِبل وكيل المستخدم (عادةً ما يكون هذا بمثابة "إرسال" أو "إرسال الاستعلام"). إذا لم تحدد قيمة ، فسيحتوي الزر على قيمة افتراضية تم اختيارها من قِبل وكيل المستخدم (عادةً ما يكون هذا بمثابة "إرسال" أو "إرسال الاستعلام").
إذا كنت ترغب في تحديد قيمة مثل "إرسال طلب" ، فيمكنك إجراء ذلك على النحو التالي: إذا كنت ترغب في تحديد قيمة مثل "إرسال طلب" ، فيمكنك إجراء ذلك على النحو التالي:
`<input type="submit" value="Send Request"> `<input type="submit" value="Send Request">
` `

View File

@ -1,6 +1,6 @@
--- ---
title: "Use display: flex to Position Two Boxes" title: "Use display: flex to Position Two Boxes"
localeTitle: "استخدم العرض localeTitle: استخدم العرض
--- ---
## استخدام العرض: فليكس لوضع صناديق اثنين ## استخدام العرض: فليكس لوضع صناديق اثنين
@ -10,7 +10,7 @@ localeTitle: "استخدم العرض
مثال: مثال:
`#main-container { `#main-container {
display: flex; display: flex;
} }
` `

View File

@ -1,5 +1,5 @@
--- ---
title: Heroku title: Heroku
localeTitle: Heroku localeTitle: Heroku
--- ---
\## هيروكو \## هيروكو

View File

@ -1,5 +1,5 @@
--- ---
title: Rackspace Cloud title: Rackspace Cloud
localeTitle: Rackspace الغيمة localeTitle: Rackspace الغيمة
--- ---
\## Rackspace Cloud \## Rackspace Cloud

View File

@ -1,32 +0,0 @@
Types of Motherboards. Motherboards come in different sizes, known as form factors. The most common motherboard form factor is ATX. The different types of ATX are known as micro-ATX (sometimes shown as µATX, mini-ATX, FlexATX, EATX, WATX, nano-ATX, pico-ATX, and mobileATX).localeTitle: اللوحة الأم
---
## العنوان: اللوحة الأم
## اللوحة الأم
اللوحة الأم هي طبقة الاتصال التي تسمح لمكونات الكمبيوتر بالتفاعل مع بعضها البعض. تحتوي اللوحة الأم عادة على وصلات لذاكرة الوصول العشوائي (RAM) ، ومحرك أقراص صلبة ، ووحدة معالجة الرسومات (GPU) ، ووحدة معالجة مركزية (CPU). في أجهزة سطح المكتب ، اللوحة الأم هي لوحة مادية تتصل بها جميع هذه المكونات. ومع ذلك ، في أجهزة الكمبيوتر المحمولة ، عادة ما تكون اللوحة الأم مدمجة في بعض هذه المكونات بسبب القيود المفروضة على مساحة أجهزة الكمبيوتر المحمولة.
توفر اللوحة الأم الطاقة والاتصال لمكونات الكمبيوتر ، وتعمل بمثابة لوحة التبديل لكافة الاتصالات بين المكونات. إذا احتاجت وحدة المعالجة المركزية لمعالجة المعلومات المخزنة في ذاكرة الوصول العشوائي ، على سبيل المثال ، فإن اللوحة الأم توفر اتصالاً بين وحدة المعالجة المركزية وذاكرة الوصول العشوائي ، تسمى ناقل الذاكرة ، للسماح بالوصول إلى البيانات. تشتمل اللوحة الأم على حافلات لبطاقات التوسعة (بما في ذلك GPU) وذاكرة الوصول العشوائي (RAM) ومحركات الأقراص الثابتة.
أهم الشركات المصنعة للوحات الأم هي INTEL و ASUS و ACER و GIGABYTE و IBM و SIMMTRONICS وغيرها الكثير.
## أجزاء من اللوحة الأم
إذا كنت ستقوم بفتح جهاز الكمبيوتر الخاص بك وإخراج اللوحة الأم ، فستحصل على بعض الخلط بين جميع الأجزاء المختلفة. اعتمادًا على طريقة عمل الكمبيوتر وطرازه ، قد يبدو الأمر كهذا. لفهم كيفية عمل أجهزة الكمبيوتر ، لا تحتاج إلى معرفة كل جزء من اللوحة الأم. ومع ذلك ، من الجيد معرفة بعض الأجزاء الأكثر أهمية وكيفية توصيل اللوحة الأم بأجزاء مختلفة من نظام الكمبيوتر معًا. فيما يلي بعض الأجزاء النموذجية:
* مقبس وحدة المعالجة المركزية (CPU) - يتم لحام وحدة المعالجة المركزية مباشرة على المقبس. نظرًا لأن وحدات المعالجة المركزية عالية السرعة تولد الكثير من الحرارة ، فهناك أحواض حرارة ونقاط تثبيت للمراوح بجوار مقبس وحدة المعالجة المركزية. ضع في اعتبارك أن وحدات المعالجة المركزية (CPUs) تدعم فقط نوع مأخذ توصيل منفرد بحيث تتطابق مع مقبس اللوحة الأم للعمل. عادةً ما تتغير أنواع المقبس كل بضعة أجيال ، كما تختلف أيضًا حسب التسمية (وحدات المعالجة المركزية (CPUs) للمستهلكين ، HEDT ، وحدات المعالجة المركزية للخوادم)
* موصل الطاقة لتوزيع الطاقة على وحدة المعالجة المركزية والمكونات الأخرى.
* فتحات الذاكرة الرئيسية للنظام ، وعادة في شكل رقائق DRAM.
* تشكل رقاقة واجهة بين وحدة المعالجة المركزية والذاكرة الرئيسية والمكونات الأخرى. في العديد من أنواع اللوحات الأم ، يشار إلى Northbridge. تحتوي هذه الشريحة أيضًا على بالوعة حرارية كبيرة. في السنوات الأخيرة ، تم دمج ميزات Northbridge بشكل متزايد في وحدة المعالجة المركزية نفسها.
* تتحكم الشريحة الثانية في وظائف الإدخال والإخراج (I / O). وهي غير متصلة مباشرة بوحدة المعالجة المركزية ولكن في Northbridge. يشار إلى وحدة تحكم الإدخال / الإخراج باسم Southbridge. يشار إلى Northbridge و Southbridge مجتمعين باسم chipset.
* عدة موصلات ، والتي توفر واجهة مادية بين المدخلات والمخرجات والأجهزة واللوحة الأم. يعالج Southbridge هذه الاتصالات.
* فتحات لواحد أو أكثر من محركات الأقراص الصلبة لتخزين الملفات. أكثر أنواع الاتصالات شيوعًا هي Integrated Drive Electronics (IDE) و Serial Advanced Technology Technology Attachment (SATA).
* رقاقة ذاكرة للقراءة فقط (ROM) ، تحتوي على البرنامج الثابت ، أو إرشادات بدء التشغيل لنظام الكمبيوتر. وهذا ما يسمى أيضا BIOS.
* فتحة لبطاقة فيديو أو بطاقة رسومية. هناك عدد من الأنواع المختلفة من الفتحات ، بما في ذلك منفذ الرسومات المسرّعة (AGP) و Peripheral Component Interconnect Express (PCIe). فتحات إضافية لتوصيل الأجهزة في شكل فتحات التوصيل البيني للمكونات الطرفية (PCI).
#### معلومات اكثر:
* [اللوحة الأم](https://www.computerhope.com/jargon/m/mothboar.htm)
* [الرقاقات (ويكيبيديا)](https://en.wikipedia.org/wiki/Chipset)
أنواع اللوحات. تأتي اللوحات الأم بأحجام مختلفة ، تُعرف باسم عوامل الشكل. عامل الشكل الأكثر شيوعًا هو ATX. تُعرف الأنواع المختلفة من ATX باسم ATX الصغير (يظهر أحيانًا على هيئة µATX و mini-ATX و FlexATX و EATX و WATX و nano-ATX و pico-ATX و mobileATX).

View File

@ -1,5 +1,5 @@
--- ---
title:Switch Statement title: Switch Statement
localeTitle: undefined localeTitle: undefined
--- ---
يسمح رمز التبديل باختبار متغير من أجل المساواة في قائمة القيم. تسمى كل قيمة بالحالة ، ويتم تحديد المتغير قيد التشغيل لكل حالة. يسمح رمز التبديل باختبار متغير من أجل المساواة في قائمة القيم. تسمى كل قيمة بالحالة ، ويتم تحديد المتغير قيد التشغيل لكل حالة.

View File

@ -1,5 +1,5 @@
--- ---
title:While-loop title: While-loop
localeTitle: undefined localeTitle: undefined
--- ---
تقوم عبارة loop while بتنفيذ العبارة المستهدفة بشكل متكرر طالما أن الشرط المعطى صحيح. تقوم عبارة loop while بتنفيذ العبارة المستهدفة بشكل متكرر طالما أن الشرط المعطى صحيح.
@ -10,22 +10,22 @@ localeTitle: undefined
مثال: مثال:
`#include <iostream> `#include <iostream>
using namespace std; using namespace std;
int main () { int main () {
// Local variable declaration: // Local variable declaration:
int a = 10; int a = 10;
// while loop execution // while loop execution
while( a < 20 ) { while( a < 20 ) {
cout << "value of a: " << a << endl; cout << "value of a: " << a << endl;
a++; a++;
} }
return 0; return 0;
} }
` `
انتاج: انتاج:

View File

@ -1,5 +1,5 @@
--- ---
title : Interface title: Interface
localeTitle: جهة تعامل localeTitle: جهة تعامل
--- ---
* * * * * *
@ -28,29 +28,29 @@ localeTitle: جهة تعامل
مثال على واجهة: مثال على واجهة:
`public Interface IUserFavoriteFood `public Interface IUserFavoriteFood
{ {
void AddFood(); void AddFood();
Task<User> EatFavoriteFood(int id); Task<User> EatFavoriteFood(int id);
} }
` `
* * * * * *
الميراث واجهة والتنفيذ: الميراث واجهة والتنفيذ:
`public class UserHungry : IUserFavoriteFood `public class UserHungry : IUserFavoriteFood
{ {
public AddFood() public AddFood()
{ {
// Implementation: // Implementation:
// A method to add food. // A method to add food.
} }
public Task<User> EatFavoriteFood(int id) public Task<User> EatFavoriteFood(int id)
{ {
// Implementation: // Implementation:
// A method to Eat food by id. // A method to Eat food by id.
} }
} }
` `

View File

@ -1,40 +0,0 @@
CSlocaleTitle: undefined
Sتم تصميم الأطر لتبسيط عمل الأنواع ، وإزالة الأخطاء عند إنشاء مشروع ، والتخلص من الكتابة الرتيبة المملة لنفس الشفرة.
مزايا أطر CSS:
`* Cross-browser compatibility
* Ability to create the correct HTML layout even for a not very experienced specialist.
* Code uniformity
* Increase development speed
`
السلبيات:
`* Attachment to CSS style library
* Redundant code
`
## التمهيد
واحدة من أشهر أطر CSS حتى الآن. يتضمن قوالب لأزرار الرسم ، والشرائط الجانبية ، وأشرطة التنقل ، والنماذج ، وعناصر الموقع الأخرى. يشمل نفسه ملحقات جافا سكريبت.
Bootstrap متوافق مع جميع المتصفحات الحديثة الرئيسية ، ولكن قد تكون هناك مشاكل في الإصدارات القديمة من المتصفحات. يدعم القدرة على التكيف. يستخدم لغات أقل وساس.
## هيكل عظمي
استنادًا إلى جافا سكريبت و CSS ، يتم استخدامه لإنشاء مواقع ويب سريعة الاستجابة يتم عرضها بشكل صحيح على الشاشات الكبيرة والشاشات الصغيرة. هيكل عظمي زائد كبير - يمكن أن يتكيف مع أي تصميم. تحتوي شبكة الترميز على 12 عمودًا ولها عرض أساسي يبلغ 960 بكسل. متوافق مع جميع المتصفحات الرئيسية.
## كوبي
الحرية الكاملة للمطور دون فرض الأنماط. يوفر أقصى مرونة في التصميم. لديها العديد من خيارات الشبكة ويتم وضعها من قبل المبدعين كإطار لمطوري CSS المحترفين. يستخدم أقل ، يدعم التصميم المتجاوب.
## المؤسسة
إطار CSS مشترك. جنبا إلى جنب مع العناصر الرئيسية الأخرى تشمل العديد من قوالب HTML مع ترتيب مختلف من كتل على الصفحة. يحتوي على مجموعة كبيرة من المكونات في JavaScript. الإطار شديد الخطورة في قدراته وتكوينه. يستخدم ساس. كود متوافق مع جميع المتصفحات الرئيسية.
## واجهة المستخدم الدلالية
دعم لمتصفح فايرفوكس و Chrome و Safari و Internet Explorer و Android 4 و Blackberry10. يحتوي على عدد كبير من المكونات: أيقونات ، صور ، ملصقات ، قوائم ومكونات قياسية أخرى. وهو يدعم أحدث إصدارات HTML و CSS ولديه مجموعة جيدة من وحدات البرامج النصية وواجهات برمجة التطبيقات. يستخدم أقل. على القدرة على المنافسة تتنافس مع bootstrap.
كل مهمة لها أداة خاصة بها. ستكون الخطوة الجيدة هي تجربة الإطار وفهمه "أنت" أو لا. يمكنك استخدام الهياكل العظمية للشفرة المعروضة في الأطر كصفيحة خداع وأخذ الحلول والكود من هناك.

View File

@ -1,32 +0,0 @@
#localeTitle: undefined
#W3 المغلق الحاويات يوفر W3.css فئة الحاوية التي تضيف 16 بيكسل قيمة الحشو اليسرى واليمنى لأي عنصر html و 0.01em من الحشو العلوية والسفلية. وهذا يجعله مثاليًا لعناصر html التي تحتوي على عناصر مثل `<header>, <div>, <footer>, <section>` إلخ. ولكن يمكن استخدامها أيضًا مع تأثير كبير على عناصر مثل `<img> and <p>.`
### مثال بسيط
`<header class="w3-container">
<h1>Header With W3 Container</h1>
</header>
`
`<header>
<h1>Header Without W3 Container</h1>
</header>
`
ستنتج النتيجة التالية.
![Header img](https://github.com/OcelotDive/randomImages/blob/master/images/WithWithout.PNG)
### لاستخدام حاويات W3.Css
ما عليك سوى إضافة رابط ورقة أنماط عادية إلى رأس صفحة الويب مثل:
`<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
`
أو قم بتنزيل أحدث ملف css إلى جهازك المحلي. هنا: (https://www.w3schools.com/w3css/4/w3.css)
#### مزيد من المعلومات حول حاويات W3.Css
##### W3schools.com (https://www.w3schools.com/w3css/w3css\_containers.asp)

View File

@ -1,5 +1,5 @@
--- ---
title: Tableau title: Tableau
localeTitle: طاولة localeTitle: طاولة
--- ---
# التابلوه لوحة حية # التابلوه لوحة حية

View File

@ -1,5 +1,5 @@
--- ---
title: kubernetes title: kubernetes
localeTitle: kubernetes localeTitle: kubernetes
--- ---
# Kubernetes # Kubernetes

View File

@ -1,16 +1,16 @@
--- ---
title: Git Show title: Git Show
localeTitle: undefined localeTitle: Git Show
--- ---
## إظهار بوابة ## إظهار بوابة
يُعد `git show` أمرًا مفيدًا يمكنك من مشاهدة عرض مفصل لكائن معين (التهم والعلامات والنقط والأشجار). يُعد `git show` أمرًا مفيدًا يمكنك من مشاهدة عرض مفصل لكائن معين (التهم والعلامات والنقط والأشجار).
بناء جملة هذا الأمر هو كما يلي: بناء جملة هذا الأمر هو كما يلي:
`git show [<options>] [<object>…​] `git show [<options>] [<object>…​]
` `
لكائنات مختلفة بوابة `git show` يعطي مخرجات مختلفة. لكائنات مختلفة بوابة `git show` يعطي مخرجات مختلفة.
@ -21,34 +21,34 @@ localeTitle: undefined
الاستخدام الأكثر شيوعًا لـ `git show` سيكون بالاشتراك مع كائن git commit الاستخدام الأكثر شيوعًا لـ `git show` سيكون بالاشتراك مع كائن git commit
`git show 3357d63 `git show 3357d63
` `
ستحصل على إنتاج مشابه لـ ، ستحصل على إنتاج مشابه لـ ،
``commit 3357d63d8f44104940e568a1ba89fa88a16dc753 ``commit 3357d63d8f44104940e568a1ba89fa88a16dc753
Author: John Doe <johndoe@acme.com> Author: John Doe <johndoe@acme.com>
Date: Tue Oct 2 00:57:38 2018 +0530 Date: Tue Oct 2 00:57:38 2018 +0530
add a section on git commit --amend --author add a section on git commit --amend --author
diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md
index fc9f568..8f1c8eb 100644 index fc9f568..8f1c8eb 100644
--- a/src/pages/git/git-commit/index.md --- a/src/pages/git/git-commit/index.md
+++ b/src/pages/git/git-commit/index.md +++ b/src/pages/git/git-commit/index.md
@@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme @@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme
Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository. Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository.
+With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit. +With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit.
+ +
+``` +```
+git commit --amend --author="John Doe <johndoe@email.com>" +git commit --amend --author="John Doe <johndoe@email.com>"
+``` +```
+ +
### More Information: ### More Information:
- Git documentation: [commit](https://git-scm.com/docs/git-commit) - Git documentation: [commit](https://git-scm.com/docs/git-commit)
`` ``
يمكنك فقط استخدام `git show` وعرض محتوى أحدث إلتزامات git. يمكنك فقط استخدام `git show` وعرض محتوى أحدث إلتزامات git.

View File

@ -1,19 +0,0 @@
# localeTitle: undefined
WebSockets
_Web Sockets_ هي تقنية تسمح لك بإنشاء اتصال تفاعلي بين العميل والخادم لتبادل البيانات في الوقت الحقيقي. WebSockets تسمح لك بالعمل في اثنين من دفق ، والذي يميز هذه التكنولوجيا من HTTP.
## كيف يعمل WebSockets؟
لا يحتاج WebSockets إلى مكالمات متكررة للرد. يكفي تقديم طلب واحد وانتظر الرد. يمكنك الاستماع إلى الخادم ، والذي سوف يرسل الإجابة على الاستعداد.
## متى يمكنني استخدام WebSockets؟
* تطبيقات في الوقت الحقيقي
* تطبيق الدردشة
* تطبيقات إنترنت الأشياء
* ألعاب متعددة اللاعبين
## متى لا تستخدم WebSockets؟
يتم دعم WebSockets بالفعل في 95٪ من المتصفحات ، ولكن في بعض الأحيان لا تكون هذه التقنية مطلوبة. على سبيل المثال ، إذا كنت تقوم بإنشاء CMS بسيط حيث لا تكون وظيفة الوقت الحقيقي مطلوبة.

View File

@ -1,7 +1,6 @@
--- ---
title: Simplify Square Roots title: Simplify Square Roots
localeTitle: undefined localeTitle: تبسيط جذور مربع
--- ---
## تبسيط جذور مربع ## تبسيط جذور مربع

View File

@ -1,5 +0,0 @@
tlocaleTitle: الحديث العكسية العكسية
itle: Converse معكوسه contrapositive
في الرياضيات المتقطعة ، في ضوء بيان شرطي "إذا كان a ، ثم b" ، فإننا يمكن أن يكون لديك 3 بيانات ذات صلة: أي بيان شرطي يتكون من جزئين: ط) فرضية ("إذا"): ب) الاستنتاج ("ثم"): "إذا تم تمثيل a ، ثم b" على النحو التالي: أ → ب لنفترض مثالاً: "إذا لم تكن هناك مدرسة ، فستكون نهاية الأسبوع". ع → س • للحصول على كونفيرس من البيان الشرطي أعلاه ، التبادل hypoth- esis والخاتمة. ف → ص وبالتالي ، فإن العكس سيكون: "إذا كانت نهاية الأسبوع ، فليس هناك مدرسة". • للحصول على معكوس البيان المشروط أعلاه ، خذ نفي كل من الفرضية والاستنتاج. →p → ¬q وبالتالي ، سيكون معكوس: "إذا كانت هناك مدرسة ، فعندها يكون يوم العمل الأسبوعي." • للحصول على كونترافيتيفي من البيان الشرطي أعلاه ، التبادل الفرضية وإبرام البيان العكسي. →q → ¬p ومن ثم ، فإن الاعتراض سيكون: "إذا كان يوم من أيام الأسبوع ، فهناك مدرسة".

View File

@ -1,5 +1,8 @@
##localeTitle: undefined ---
نظام الملفات title: File System
localeTitle: نظام الملفات
---
## نظام الملفات
تسمح لك وحدة نظام الملفات Node.js بالعمل مع نظام الملفات على جهاز الكمبيوتر الخاص بك. تسمح لك وحدة نظام الملفات Node.js بالعمل مع نظام الملفات على جهاز الكمبيوتر الخاص بك.
@ -7,8 +10,8 @@
من أجل تضمين وحدة نمطية ، استخدم الدالة `require()` مع اسم الوحدة. من أجل تضمين وحدة نمطية ، استخدم الدالة `require()` مع اسم الوحدة.
`const fs = require('fs'); `const fs = require('fs');
` `
الاستخدام الشائع لوحدة نظام الملفات: الاستخدام الشائع لوحدة نظام الملفات:
@ -24,16 +27,16 @@
رمز Node.js لقراءة الملف من جهاز الكمبيوتر وإرجاع المحتوى إلى وحدة التحكم. رمز Node.js لقراءة الملف من جهاز الكمبيوتر وإرجاع المحتوى إلى وحدة التحكم.
`const fs = require('fs'); `const fs = require('fs');
fs.readFile('input.txt', 'utf-8', (err, data) => { fs.readFile('input.txt', 'utf-8', (err, data) => {
if(err){ if(err){
console.log(err); console.log(err);
} }
else{ else{
console.log("Content present in input.txt file : " + data.toString()); console.log("Content present in input.txt file : " + data.toString());
} }
}); });
` `
يقرأ الكود أعلاه ملف _input.txt_ من جهاز الكمبيوتر ويعيد المحتوى إلى وحدة التحكم. يقرأ الكود أعلاه ملف _input.txt_ من جهاز الكمبيوتر ويعيد المحتوى إلى وحدة التحكم.
@ -52,16 +55,16 @@ _ملاحظة_ : يجب أن يكون ملف input.txt موجودًا في نف
رمز Node.js لكتابة المحتوى في ملف. رمز Node.js لكتابة المحتوى في ملف.
`const fs = require('fs'); `const fs = require('fs');
fs.writeFile('output.txt', "New content added", (err, data) => { fs.writeFile('output.txt', "New content added", (err, data) => {
if(err){ if(err){
console.log(err); console.log(err);
} }
else{ else{
console.log("The file is saved"); console.log("The file is saved");
} }
}); });
` `
تعمل الشفرة الموضحة أعلاه على إنشاء ملف _output.txt_ ومحتوى إضافة محتوى _جديد تمت إضافته_ إليه. تعمل الشفرة الموضحة أعلاه على إنشاء ملف _output.txt_ ومحتوى إضافة محتوى _جديد تمت إضافته_ إليه.

View File

@ -1,5 +1,8 @@
##localeTitle: undefined ---
HTTP title: HTTP
localeTitle: HTTP
---
## HTTP
يحتوي Node.js على مجموعة من الوحدات المضمنة التي يمكنك استخدامها بدون أي تثبيت إضافي. وبالمثل ، تحتوي **وحدة HTTP** على مجموعة من الوظائف المطلوبة لنقل البيانات عبر بروتوكول نقل النص التشعبي (HTTP). يحتوي Node.js على مجموعة من الوحدات المضمنة التي يمكنك استخدامها بدون أي تثبيت إضافي. وبالمثل ، تحتوي **وحدة HTTP** على مجموعة من الوظائف المطلوبة لنقل البيانات عبر بروتوكول نقل النص التشعبي (HTTP).
@ -7,24 +10,24 @@
من أجل تضمين وحدة نمطية ، استخدم الدالة `require()` مع اسم الوحدة. من أجل تضمين وحدة نمطية ، استخدم الدالة `require()` مع اسم الوحدة.
`const http = require('http'); `const http = require('http');
` `
## Node.js كملقم ويب ## Node.js كملقم ويب
يتم استخدام الأسلوب `createServer()` لإنشاء خادم HTTP. الوسيطة الأولى من أسلوب `res.writeHead()` هي رمز الحالة ، `200` يعني أن كل شيء على ما يرام ، والوسيطة الثانية هي كائن يحتوي على رؤوس الاستجابة. يتم استخدام الأسلوب `createServer()` لإنشاء خادم HTTP. الوسيطة الأولى من أسلوب `res.writeHead()` هي رمز الحالة ، `200` يعني أن كل شيء على ما يرام ، والوسيطة الثانية هي كائن يحتوي على رؤوس الاستجابة.
`const http = require('http'); `const http = require('http');
//create a server object: //create a server object:
http.createServer((req, res) => { http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello World!'); //write a response to the client res.write('Hello World!'); //write a response to the client
res.end(); //end the response res.end(); //end the response
}).listen(8000); //the server object listens on port 8000 }).listen(8000); //the server object listens on port 8000
console.log("Server is listening on port no : 8000"); console.log("Server is listening on port no : 8000");
` `
### خطوات التنفيذ: ### خطوات التنفيذ:

View File

@ -1,5 +1,8 @@
# localeTitle: undefined ---
React راوتر للمبتدئين title: React Router
localeTitle: React Router
---
# React راوتر للمبتدئين
# التركيب # التركيب
@ -21,8 +24,8 @@ React راوتر للمبتدئين
# بيان الاستيراد # بيان الاستيراد
`import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; `import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
` `
## IndexRoute والروابط ## IndexRoute والروابط
@ -34,10 +37,10 @@ React راوتر للمبتدئين
الطريقة الأساسية للسماح للمستخدمين بالتنقل حول تطبيقك. سيجعل علامة ارتساء يمكن الوصول إليها بالكامل مع href الصحيح. للقيام بذلك ، دعنا أولاً إنشاء مكون Nav. سيحتوي مكون Nav الخاص بنا على مكونات `<Link>` ، وسيبدو كما يلي: الطريقة الأساسية للسماح للمستخدمين بالتنقل حول تطبيقك. سيجعل علامة ارتساء يمكن الوصول إليها بالكامل مع href الصحيح. للقيام بذلك ، دعنا أولاً إنشاء مكون Nav. سيحتوي مكون Nav الخاص بنا على مكونات `<Link>` ، وسيبدو كما يلي:
`const Nav = () => ( `const Nav = () => (
<div> <div>
<Link to='/'>Home</Link>&nbsp; <Link to='/'>Home</Link>&nbsp;
<Link to='/address'>Address</Link> <Link to='/address'>Address</Link>
</div> </div>
) )
` `

View File

@ -1,5 +1,5 @@
--- ---
title : Features of BlockTech title: Features of BlockTech
localeTitle: BlockTech的特点 localeTitle: BlockTech的特点
--- ---
## 区块链技术的特点 ## 区块链技术的特点

View File

@ -1,5 +1,6 @@
---
title: Smart Contracts title: Smart Contracts
localeTitle: undefined localeTitle: Smart Contracts
--- ---
## 智能合约 ## 智能合约

View File

@ -1,5 +1,5 @@
--- ---
title : Types of Blockchain title: Types of Blockchain
localeTitle: 区块链的类型 localeTitle: 区块链的类型
--- ---
![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true) ![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true)

View File

@ -1,6 +1,6 @@
--- ---
title: Create a Gradual CSS Linear Gradient title: Create a Gradual CSS Linear Gradient
localeTitle: 创建渐进的CSS线性渐变 localeTitle: 创建渐进的CSS线性渐变
--- ---
##创建渐进式CSS线性渐变 ##创建渐进式CSS线性渐变
@ -8,7 +8,7 @@
语法总是: 语法总是:
``` ```
background-image: linear-gradient(angle, color-stop1, color-stop2); background-image: linear-gradient(angle, color-stop1, color-stop2);
``` ```
颜色可以以hex和rgb格式使用。尝试一下你会明白使用它是多么容易和美丽。 颜色可以以hex和rgb格式使用。尝试一下你会明白使用它是多么容易和美丽。

View File

@ -1,18 +1,21 @@
title: Add a Submit Button to a Form ---
localeTitle: undefined title: Add a Submit Button to a Form
--- ## 向表单添加提交按钮 localeTitle: 向表单添加提交按钮
---
## 向表单添加提交按钮
在此挑战中,您希望将提交按钮作为表单的最后一个元素(在`</form>`结束标记之前)插入,并为其提供属性`type="submit"` (全部小写)和文本内容“提交” “(第一个字母大写),在挑战指令中指定。 在此挑战中,您希望将提交按钮作为表单的最后一个元素(在`</form>`结束标记之前)插入,并为其提供属性`type="submit"` (全部小写)和文本内容“提交” “(第一个字母大写),在挑战指令中指定。
1属性`type` `submit`值也在`input`标记内有效,它将呈现具有几乎相同行为的按钮,但这不是您要在此挑战中使用的标记。 1属性`type` `submit`值也在`input`标记内有效,它将呈现具有几乎相同行为的按钮,但这不是您要在此挑战中使用的标记。
``` ```
<input type="submit"> <input type="submit">
``` ```
如果您未指定值,则该按钮将具有您的用户代理选择的默认值(通常这类似于“提交”或“提交查询”)。 如果您未指定值,则该按钮将具有您的用户代理选择的默认值(通常这类似于“提交”或“提交查询”)。
如果您希望指定类似“发送请求”的值,您可以这样做: 如果您希望指定类似“发送请求”的值,您可以这样做:
``` ```
<input type="submit" value="Send Request"> <input type="submit" value="Send Request">
``` ```

View File

@ -1,5 +1,5 @@
--- ---
title: Heroku title: Heroku
localeTitle: Heroku的 localeTitle: Heroku的
--- ---
\## Heroku \## Heroku

View File

@ -1,5 +1,5 @@
--- ---
title: Rackspace Cloud title: Rackspace Cloud
localeTitle: Rackspace Cloud localeTitle: Rackspace Cloud
--- ---
\## Rackspace Cloud \## Rackspace Cloud

View File

@ -1,32 +0,0 @@
Types of Motherboards. Motherboards come in different sizes, known as form factors. The most common motherboard form factor is ATX. The different types of ATX are known as micro-ATX (sometimes shown as µATX, mini-ATX, FlexATX, EATX, WATX, nano-ATX, pico-ATX, and mobileATX).localeTitle: 母板
---
## 标题:主板
## 母板
主板是连接层允许计算机的组件相互交互。主板通常具有用于随机存取存储器RAM硬盘驱动器图形处理单元GPU和中央处理单元CPU的连接。在台式机中主板是所有这些组件都连接到的物理板。然而在笔记本电脑中由于笔记本电脑的空间限制主板通常集成了一些这些组件。
主板为计算机的组件提供电源和连接并充当所有组件间通信的交换机。例如如果CPU需要处理存储在RAM中的信息则主板提供CPU和RAM之间的连接称为存储器总线以允许数据访问。主板包括用于扩展卡包括GPURAM和硬盘驱动器的总线。
主板的顶级制造商是INTELASUSACERGIGABYTEIBMSIMMTRONICS等等。
## 主板的部分
如果你打开电脑并取出主板,你可能会对所有不同部分感到困惑。根据计算机的品牌和型号,它可能看起来像这样。 要了解计算机的工作原理,您无需了解主板的每个部件。但是,了解一些更重要的部件以及主板如何将计算机系统的各个部分连接在一起是很好的。以下是一些典型的部分:
* CPU插槽 - 实际CPU直接焊接到插槽上。由于高速CPU会产生大量热量因此CPU插槽旁边的风扇有散热片和安装点。 请注意CPU仅支持单个插槽类型因此它与主板插槽匹配才能工作。套接字类型通常每隔几代就会更改一次并且每个标签也会有所不同消费级CPUHEDT服务器CPU
* 用于将电源分配给CPU和其他组件的电源连接器。
* 系统主存储器的插槽通常采用DRAM芯片的形式。
* 芯片形成CPU主存储器和其他组件之间的接口。在许多类型的主板上这被称为北桥。该芯片还包含一个大型散热器。近年来北桥的功能已越来越多地集成到CPU本身中。
* 第二个芯片控制输入和输出I / O功能。它不直接连接到CPU而是连接到北桥。该I / O控制器称为南桥。北桥和南桥的组合被称为芯片组。
* 几个连接器,提供输入和输出设备与主板之间的物理接口。南桥处理这些连接。
* 用于存储文件的一个或多个硬盘驱动器的插槽。最常见的连接类型是集成驱动电子设备IDE和串行高级技术附件SATA
* 只读存储器ROM芯片包含固件或计算机系统的启动指令。这也称为BIOS。
* 用于视频或图形卡的插槽。有许多不同类型的插槽包括加速图形端口AGP和外围组件互连高速PCIe。 附加插槽用于连接外围组件互连PCI插槽形式的硬件。
#### 更多信息:
* [母板](https://www.computerhope.com/jargon/m/mothboar.htm)
* [芯片组(维基百科)](https://en.wikipedia.org/wiki/Chipset)
主板类型。 主板有不同的尺寸称为外形尺寸。最常见的主板外形是ATX。不同类型的ATX被称为micro-ATX有时显示为μATXmini-ATXFlexATXEATXWATXnano-ATXpico-ATX和mobileATX

View File

@ -1,5 +1,5 @@
--- ---
title:Switch Statement title: Switch Statement
localeTitle: undefined localeTitle: undefined
--- ---
switch语句允许测试变量与值列表的相等性。每个值都称为一个案例并且针对每种情况检查要打开的变量。 switch语句允许测试变量与值列表的相等性。每个值都称为一个案例并且针对每种情况检查要打开的变量。

View File

@ -1,5 +1,5 @@
--- ---
title:While-loop title: While-loop
localeTitle: undefined localeTitle: undefined
--- ---
只要给定条件为真while循环语句就会重复执行目标语句。 只要给定条件为真while循环语句就会重复执行目标语句。
@ -11,21 +11,21 @@ while循环的一个关键点是循环可能永远不会运行。 当测试条
例: 例:
```C++ ```C++
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int main () { int main () {
// Local variable declaration: // Local variable declaration:
int a = 10; int a = 10;
// while loop execution // while loop execution
while( a < 20 ) { while( a < 20 ) {
cout << "value of a: " << a << endl; cout << "value of a: " << a << endl;
a++; a++;
} }
return 0; return 0;
} }
``` ```
输出: 输出:

View File

@ -1,5 +1,5 @@
--- ---
title : Interface title: Interface
localeTitle: 接口 localeTitle: 接口
--- ---
* * * * * *
@ -29,11 +29,11 @@ localeTitle: 接口
接口示例: 接口示例:
```csharp ```csharp
public Interface IUserFavoriteFood public Interface IUserFavoriteFood
{ {
void AddFood(); void AddFood();
Task<User> EatFavoriteFood(int id); Task<User> EatFavoriteFood(int id);
} }
``` ```
* * * * * *
@ -41,19 +41,19 @@ public Interface IUserFavoriteFood
接口继承和实现: 接口继承和实现:
```csharp ```csharp
public class UserHungry : IUserFavoriteFood public class UserHungry : IUserFavoriteFood
{ {
public AddFood() public AddFood()
{ {
// Implementation: // Implementation:
// A method to add food. // A method to add food.
} }
public Task<User> EatFavoriteFood(int id) public Task<User> EatFavoriteFood(int id)
{ {
// Implementation: // Implementation:
// A method to Eat food by id. // A method to Eat food by id.
} }
} }
``` ```

View File

@ -1,40 +0,0 @@
CSlocaleTitle: undefined
S框架旨在简化排字机的工作消除创建项目时的错误并摆脱相同代码的无聊单调写作。
CSS框架的优点
```
* Cross-browser compatibility
* Ability to create the correct HTML layout even for a not very experienced specialist.
* Code uniformity
* Increase development speed
```
劣势:
```
* Attachment to CSS style library
* Redundant code
```
## 引导
迄今为止最着名的CSS框架之一。包括用于绘制按钮侧边栏导航栏表单和其他网站元素的模板。包括自己的JavaScript扩展。
Bootstrap与所有主流现代浏览器兼容但旧版浏览器可能存在问题。支持适应性。使用Less和Sass语言。
## 骨架
它基于JavaScript和CSS用于快速准确地创建在大型监视器和小型小工具屏幕上正确显示的响应式网站。一个大加骷髅 - 它可以适应任何设计。标记网格包含12列基本宽度为960像素。兼容所有主流浏览器。
## KUBE
开发人员完全自由而不强加风格。提供最大的设计灵活性它有几个网格选项由创建者定位为专业CSS开发人员的框架。使用Less支持响应式设计。
## 基础
常见的CSS框架。与其他主要元素一起包括几个HTML模板页面上具有不同的块排列。它在JavaScript中有很多组件。该框架的能力和构成非常严肃。使用Sass。与所有主流浏览器兼容的代码。
## 语义UI
支持FirefoxChromeSafariInternet ExplorerAndroid 4Blackberry10。包含大量组件图标图像标签菜单和其他标准组件。它支持最新版本的HTML和CSS并且有很多脚本模块和API可供选择。使用更少。适用性与bootstrap竞争。
每个任务都有自己的工具。一个很好的步骤是尝试框架并理解“你的”与否。您可以使用框架中提供的代码的骨架作为备忘单,并从中获取解决方案和代码。

View File

@ -1,33 +0,0 @@
#localeTitle: undefined
#W3 CSS容器 W3.css提供了一个容器类它为任何html元素添加了16个像素的左右填充以及0.01em的 顶部和底部填充。 这使得它非常适用于包含`<header>, <div>, <footer>, <section>`等元素的html。但也可以在`<img> and <p>.`等元素上使用效果很好`<img> and <p>.`
### 简单的例子
```
<header class="w3-container">
<h1>Header With W3 Container</h1>
</header>
```
```
<header>
<h1>Header Without W3 Container</h1>
</header>
```
会产生以下结果。
![标头img](https://github.com/OcelotDive/randomImages/blob/master/images/WithWithout.PNG)
### 使用W3.Css容器
只需将常规样式表链接添加到网页的头部,如下所示:
```
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
```
或者将最新的css文件下载到本地计算机。这里https://www.w3schools.com/w3css/4/w3.css
#### 有关W3.Css容器的更多信息
##### W3schools.comhttps://www.w3schools.com/w3css/w3css\_containers.asp

View File

@ -1,5 +1,5 @@
--- ---
title: Tableau title: Tableau
localeTitle: 表 localeTitle: 表
--- ---
# 画面 # 画面

View File

@ -1,5 +1,5 @@
--- ---
title: kubernetes title: kubernetes
localeTitle: kubernetes localeTitle: kubernetes
--- ---
# Kubernetes # Kubernetes

View File

@ -1,7 +1,6 @@
--- ---
title: Git Show title: Git Show
localeTitle: undefined localeTitle: Git Show
--- ---
## Git Show ## Git Show
@ -10,7 +9,7 @@ localeTitle: undefined
该命令的语法如下: 该命令的语法如下:
```bash ```bash
git show [<options>] [<object>…​] git show [<options>] [<object>…​]
``` ```
对于不同的git对象 `git show`给出了不同的输出。 对于不同的git对象 `git show`给出了不同的输出。
@ -23,33 +22,33 @@ git show [<options>] [<object>…​]
`git show`的最常见用法是与git commit对象相关联 `git show`的最常见用法是与git commit对象相关联
```bash ```bash
git show 3357d63 git show 3357d63
``` ```
你会得到类似的输出, 你会得到类似的输出,
``` ```
commit 3357d63d8f44104940e568a1ba89fa88a16dc753 commit 3357d63d8f44104940e568a1ba89fa88a16dc753
Author: John Doe <johndoe@acme.com> Author: John Doe <johndoe@acme.com>
Date: Tue Oct 2 00:57:38 2018 +0530 Date: Tue Oct 2 00:57:38 2018 +0530
add a section on git commit --amend --author add a section on git commit --amend --author
diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md
index fc9f568..8f1c8eb 100644 index fc9f568..8f1c8eb 100644
--- a/src/pages/git/git-commit/index.md --- a/src/pages/git/git-commit/index.md
+++ b/src/pages/git/git-commit/index.md +++ b/src/pages/git/git-commit/index.md
@@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme @@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme
Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository. Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository.
+With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit. +With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit.
+ +
+``` +```
+git commit --amend --author="John Doe <johndoe@email.com>" +git commit --amend --author="John Doe <johndoe@email.com>"
+``` +```
+ +
### More Information: ### More Information:
- Git documentation: [commit](https://git-scm.com/docs/git-commit) - Git documentation: [commit](https://git-scm.com/docs/git-commit)
``` ```
您可以使用`git show` 它将显示最新git提交的内容。 您可以使用`git show` 它将显示最新git提交的内容。

View File

@ -1,19 +0,0 @@
# localeTitle: undefined
WebSockets
_Web套接字_是一种技术允许您在客户端和服务器之间创建交互式连接以实时交换数据。 WebSockets允许您在两个流中工作从而将此技术与HTTP区分开来。
## WebSockets如何工作
WebSockets不需要重复调用来响应。只需提出一个请求并等待响应就足够了。您可以收听服务器该服务器会在准备就绪时发送答案。
## 我什么时候可以使用WebSockets
* 实时应用程序
* 聊天应用
* 物联网应用
* 多人游戏
## 什么时候不使用WebSockets
95的浏览器已经支持WebSockets但有时这种技术并不是必需的。例如如果您要创建一个不需要实时功能的简单CMS。

View File

@ -1,7 +1,6 @@
--- ---
title: Simplify Square Roots title: Simplify Square Roots
localeTitle: undefined localeTitle: 简化平方根
--- ---
## 简化平方根 ## 简化平方根

View File

@ -1,5 +0,0 @@
tlocaleTitle: 逆逆对立
itleConverse Inverse Contrapositive
在离散数学中给出条件语句“if athen b”我们 可以有3个相关的陈述 任何条件陈述由两部分组成: i假设“如果” ii结论“当时” “如果a那么b”可以表示为 a→b 举一个例子:“如果没有学校,那就是周末。” p→q •要获得上述条件陈述的匡威,交换假设 - esis和结论。 q→p 因此,反过来说:“如果是周末,那么就没有学校。” •要获得上述条件语句的反转,请取消 假设和结论。 ¬p→¬q 因此,相反的是:“如果有学校,那就是工作日。” •要获得上述条件陈述的Contrapositive交换 逆句的假设和结论。 ¬q→¬p 因此,对立面将是:“如果是工作日,那么就有学校。”

View File

@ -1,5 +1,8 @@
##localeTitle: undefined ---
文件系统 title: File System
localeTitle: 文件系统
---
## 文件系统
Node.js文件系统模块允许您使用计算机上的文件系统。 Node.js文件系统模块允许您使用计算机上的文件系统。
@ -8,7 +11,7 @@ Node.js有一组内置模块无需进一步安装即可使用。类似地
要包含模块,请使用`require()`函数和模块名称。 要包含模块,请使用`require()`函数和模块名称。
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
``` ```
文件系统模块的常用用法: 文件系统模块的常用用法:
@ -26,15 +29,15 @@ const fs = require('fs');
Node.js代码从您的计算机读取文件并将内容返回到控制台。 Node.js代码从您的计算机读取文件并将内容返回到控制台。
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
fs.readFile('input.txt', 'utf-8', (err, data) => { fs.readFile('input.txt', 'utf-8', (err, data) => {
if(err){ if(err){
console.log(err); console.log(err);
} }
else{ else{
console.log("Content present in input.txt file : " + data.toString()); console.log("Content present in input.txt file : " + data.toString());
} }
}); });
``` ```
上面的代码从您的计算机读取文件_input.txt_并将内容返回到控制台。 上面的代码从您的计算机读取文件_input.txt_并将内容返回到控制台。
@ -55,15 +58,15 @@ _注意_ input.txt文件应该存在于Node.js代码文件所在的同一目
Node.js代码将内容写入文件。 Node.js代码将内容写入文件。
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
fs.writeFile('output.txt', "New content added", (err, data) => { fs.writeFile('output.txt', "New content added", (err, data) => {
if(err){ if(err){
console.log(err); console.log(err);
} }
else{ else{
console.log("The file is saved"); console.log("The file is saved");
} }
}); });
``` ```
上面的代码创建了一个文件_output.txt_并添加了_添加_到其中的_新内容_ 。 上面的代码创建了一个文件_output.txt_并添加了_添加_到其中的_新内容_ 。

View File

@ -1,5 +1,8 @@
##localeTitle: undefined ---
HTTP title: HTTP
localeTitle: HTTP
---
## HTTP
Node.js有一组内置模块无需进一步安装即可使用。类似地 **HTTP模块**包含通过超文本传输协议HTTP传输数据所需的一组功能。 Node.js有一组内置模块无需进一步安装即可使用。类似地 **HTTP模块**包含通过超文本传输协议HTTP传输数据所需的一组功能。
@ -8,7 +11,7 @@ HTTP模块可以创建一个HTTP服务器该服务器侦听服务器端口并
要包含模块,请使用`require()`函数和模块名称。 要包含模块,请使用`require()`函数和模块名称。
```javascript ```javascript
const http = require('http'); const http = require('http');
``` ```
## Node.js作为Web服务器 ## Node.js作为Web服务器
@ -16,16 +19,16 @@ const http = require('http');
`createServer()`方法用于创建HTTP服务器。 `res.writeHead()`方法的第一个参数是状态代码, `200`表示一切正常,第二个参数是包含响应头的对象。 `createServer()`方法用于创建HTTP服务器。 `res.writeHead()`方法的第一个参数是状态代码, `200`表示一切正常,第二个参数是包含响应头的对象。
```javascript ```javascript
const http = require('http'); const http = require('http');
//create a server object: //create a server object:
http.createServer((req, res) => { http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello World!'); //write a response to the client res.write('Hello World!'); //write a response to the client
res.end(); //end the response res.end(); //end the response
}).listen(8000); //the server object listens on port 8000 }).listen(8000); //the server object listens on port 8000
console.log("Server is listening on port no : 8000"); console.log("Server is listening on port no : 8000");
``` ```
### 执行步骤: ### 执行步骤:

View File

@ -1,47 +1,47 @@
--- ---
title: Relationships between * and args title: Relationships between * and args
localeTitle: *和args之间的关系 localeTitle: '*和args之间的关系'
--- ---
## 在函数定义中存在\* ## 在函数定义中存在\*
```Python ```Python
# How does *args work in a function definition # How does *args work in a function definition
def hardFunc(arg1, arg2): def hardFunc(arg1, arg2):
# create a tuple and pollute it with arguments passed to hardFunc # create a tuple and pollute it with arguments passed to hardFunc
args=(arg1, arg2) args=(arg1, arg2)
# print out results # print out results
print(args[0]) print(args[0])
print(args[1]) print(args[1])
hardFunc('hard_one', 'hard_two') hardFunc('hard_one', 'hard_two')
# output — Try it yourself now and in sequential snippets! # output — Try it yourself now and in sequential snippets!
def softFunc(*args): def softFunc(*args):
# at this point after calling softFunc a tuple with a name of a word # at this point after calling softFunc a tuple with a name of a word
# followed by * is created automatically (in this case the name is args) # followed by * is created automatically (in this case the name is args)
# print out results # print out results
print(args[0]) print(args[0])
print(args[1]) print(args[1])
softFunc('soft_one', 'soft_two') softFunc('soft_one', 'soft_two')
# Now try to do something illegal # Now try to do something illegal
hardFunc('one', 'two', 'three') hardFunc('one', 'two', 'three')
# Now do things legally # Now do things legally
softFunc('one', 'two', 'three') softFunc('one', 'two', 'three')
# or even # or even
softFunc('one', 'two', 'three', 'infinity') softFunc('one', 'two', 'three', 'infinity')
# softFunc handles arbitrary amount of arguments easily by virtue of * syntax # softFunc handles arbitrary amount of arguments easily by virtue of * syntax
# So using a single variable name in conjuction with * we gained the ability # So using a single variable name in conjuction with * we gained the ability
# to invoke a function with arbitrary amount of arguments. # to invoke a function with arbitrary amount of arguments.
# Once again when softFunc is called the newly args # Once again when softFunc is called the newly args
# tuple filled with provided arguments is created # tuple filled with provided arguments is created
# Conclusion softFunc is a more flexible/dynamic verson of a hardFunc # Conclusion softFunc is a more flexible/dynamic verson of a hardFunc
``` ```

View File

@ -1,6 +1,6 @@
--- ---
title: R title: R
localeTitle: [R localeTitle: R
--- ---
## 什么是R ## 什么是R
@ -21,23 +21,23 @@ R是用于统计计算和图形的开源编程语言和软件环境。它是数
## 在哪里免费学习R. ## 在哪里免费学习R.
* [R Studio](https://www.rstudio.com/online-learning/) * [R Studio](https://www.rstudio.com/online-learning/)
* [代码学校](http://tryr.codeschool.com/) * [代码学校](http://tryr.codeschool.com/)
* [Coursera-允许免费审核课程,但支付认证。](https://www.coursera.org/learn/r-programming) * [Coursera-允许免费审核课程,但支付认证。](https://www.coursera.org/learn/r-programming)
* [DataCamp - 允许免费完成介绍部分。](https://www.datacamp.com) * [DataCamp - 允许免费完成介绍部分。](https://www.datacamp.com)
* [R for Data Science-是一本可以免费在线阅读的书。](http://r4ds.had.co.nz/) * [R for Data Science-是一本可以免费在线阅读的书。](http://r4ds.had.co.nz/)
* [edX - 允许免费审核课程,但支付认证。](https://www.edx.org/learn/r-programming) * [edX - 允许免费审核课程,但支付认证。](https://www.edx.org/learn/r-programming)
* [高级R](https://adv-r.hadley.nz/) * [高级R](https://adv-r.hadley.nz/)
* [RSeek](http://rseek.org/) * [RSeek](http://rseek.org/)
## 参考 ## 参考
* [在Windows上安装R](http://youtu.be/Ohnk9hcxf9M) * [在Windows上安装R](http://youtu.be/Ohnk9hcxf9M)
* [在Mac上安装R](https://youtu.be/uxuuWXU-7UQ) * [在Mac上安装R](https://youtu.be/uxuuWXU-7UQ)

View File

@ -1,5 +1,8 @@
# localeTitle: undefined ---
R适用于初学者的eact Router title: React Router
localeTitle: React Router
---
# R适用于初学者的 React Router
# 安装 # 安装
@ -22,7 +25,7 @@ React Router已分为三个包 `react-router` `react-router-dom`和`react
# 进口声明 # 进口声明
```javascript ```javascript
import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
``` ```
## IndexRoute和链接 ## IndexRoute和链接
@ -36,11 +39,11 @@ import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
允许用户浏览应用程序的主要方法。 将使用正确的href呈现完全可访问的锚标记。 为此我们首先创建一个Nav组件。我们的Nav组件将包含`<Link>`组件,如下所示: 允许用户浏览应用程序的主要方法。 将使用正确的href呈现完全可访问的锚标记。 为此我们首先创建一个Nav组件。我们的Nav组件将包含`<Link>`组件,如下所示:
```javascript ```javascript
const Nav = () => ( const Nav = () => (
<div> <div>
<Link to='/'>Home</Link>&nbsp; <Link to='/'>Home</Link>&nbsp;
<Link to='/address'>Address</Link> <Link to='/address'>Address</Link>
</div> </div>
) )
``` ```

View File

@ -1,4 +1,8 @@
# KnuthMorrisPratt Algorithm for Pattern Searching ---
title: KnuthMorrisPratt Algorithm for Pattern Searching
---
## KnuthMorrisPratt Algorithm for Pattern Searching
Pattern searching is an important problem in computer science. When we do search for a string in notepad/word file or browser or database, pattern searching algorithms are used to show the search results. Pattern searching is an important problem in computer science. When we do search for a string in notepad/word file or browser or database, pattern searching algorithms are used to show the search results.
**Problem :** **Problem :**
@ -21,18 +25,18 @@ The basic idea behind KMPs algorithm is: whenever we detect a mismatch (after
- Name lps indicates **longest proper prefix** which is also suffix. A proper prefix is prefix with whole string **not** allowed. For example, prefixes of “ABC” are “”, “A”, “AB” and “ABC”. Proper prefixes are “”, “A” and “AB”. Suffixes of the string are “”, “C”, “BC” and “ABC”. - Name lps indicates **longest proper prefix** which is also suffix. A proper prefix is prefix with whole string **not** allowed. For example, prefixes of “ABC” are “”, “A”, “AB” and “ABC”. Proper prefixes are “”, “A” and “AB”. Suffixes of the string are “”, “C”, “BC” and “ABC”.
- We search for lps in sub-patterns. More clearly we focus on sub-strings of patterns that are either prefix and suffix. - We search for lps in sub-patterns. More clearly we focus on sub-strings of patterns that are either prefix and suffix.
- For each sub-pattern pat[0..i] where i = 0 to m-1, lps[i] stores length of the maximum matching proper prefix which is also a suffix of the sub-pattern pat[0..i]. - For each sub-pattern pat[0..i] where i = 0 to m-1, lps[i] stores length of the maximum matching proper prefix which is also a suffix of the sub-pattern pat[0..i].
`lps[i] = the longest proper prefix of pat[0..i] which is also a suffix of pat[0..i]. ` `lps[i] = the longest proper prefix of pat[0..i] which is also a suffix of pat[0..i]. `
**Note :** lps[i] could also be defined as longest prefix which is also proper suffix. We need to use properly at one place to make sure that the whole substring is not considered. **Note :** lps[i] could also be defined as longest prefix which is also proper suffix. We need to use properly at one place to make sure that the whole substring is not considered.
**Examples of lps[] construction :** **Examples of lps[] construction :**
``` ```
For the pattern “ABCDE”, For the pattern “ABCDE”,
lps[] is [0, 0, 0, 0, 0] lps[] is [0, 0, 0, 0, 0]
For the pattern “AABAACAABAA”, For the pattern “AABAACAABAA”,
lps[] is [0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 5] lps[] is [0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 5]
``` ```

View File

@ -1,9 +1,9 @@
--- ---
title : Features of BlockTech title: Features of BlockTech
--- ---
## Features of Blockchain Technology ## Features of Blockchain Technology
Blockchain is almost always used in lieu of Bitcoin and cryptocurrency. However, there are many other places this technology can be used. And we are beginning to barely scratch the surface of it. With all the hype around it, we know, the Blockchain Technology (BlockTech) is going to be huge. But what makes it unique? Blockchain is almost always used in lieu of Bitcoin and cryptocurrency. However, there are many other places this technology can be used. And we are beginning to barely scratch the surface of it. With all the hype around it, we know, the Blockchain Technology (BlockTech) is going to be huge. But what makes it unique?
In this article, we are going to explore the key characteristic features of BlockTech. In this article, we are going to explore the key characteristic features of BlockTech.

View File

@ -1,9 +1,10 @@
---
title: Smart Contracts title: Smart Contracts
--- ---
## Smart Contracts ## Smart Contracts
Transactions in a blockchain are a very basic contract - One party sends resources to another. Transactions in a blockchain are a very basic contract - One party sends resources to another.
In the Ethereum blockchain, transactions can support any kind of logic. They have the expressive In the Ethereum blockchain, transactions can support any kind of logic. They have the expressive
power of a Turing-Complete machine - meaning they can be steps for a task that a computer can do. power of a Turing-Complete machine - meaning they can be steps for a task that a computer can do.
As a piece of code that sits on the blockchain, a smart contract can automate tasks. As a piece of code that sits on the blockchain, a smart contract can automate tasks.

View File

@ -1,5 +1,5 @@
--- ---
title : Types of Blockchain title: Types of Blockchain
--- ---
![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true) ![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true)

View File

@ -1,4 +1,6 @@
---
title: Replacing If Else Chains with Switch
---
## Replacing If Else Chains with Switch ## Replacing If Else Chains with Switch
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds --> <!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
@ -26,8 +28,8 @@ function chainToSwitch(val) {
answer = "Ate Nine"; answer = "Ate Nine";
break; break;
} }
// Only change code above this line // Only change code above this line
return answer; return answer;
} }
// Change this value to test // Change this value to test
chainToSwitch(7); chainToSwitch(7);
@ -36,9 +38,9 @@ chainToSwitch(7);
We need to change the chained ```if/else if``` statements into a ```switch``` statement. We need to change the chained ```if/else if``` statements into a ```switch``` statement.
Heres a solution: Heres a solution:
Now, we need to comment (```//``` - select all lines and ```ctrl+/```) all chained ```if/else if``` statements: Now, we need to comment (```//``` - select all lines and ```ctrl+/```) all chained ```if/else if``` statements:
```javascript ```javascript
// if (val === "bob") { // if (val === "bob") {
// answer = "Marley"; // answer = "Marley";
@ -52,16 +54,16 @@ We need to change the chained ```if/else if``` statements into a ```switch``` st
// answer = "Ate Nine"; // answer = "Ate Nine";
// } // }
``` ```
Next, we need to create simple ```switch``` statement: Next, we need to create simple ```switch``` statement:
```javascript ```javascript
switch(val) { switch(val) {
} }
``` ```
and add in this ```switch``` statement ```case``` - for all ```if/else if``` statement (just copy it from our commented code above): and add in this ```switch``` statement ```case``` - for all ```if/else if``` statement (just copy it from our commented code above):
```javascript ```javascript
switch(val) { switch(val) {
case "bob": case "bob":
@ -80,13 +82,13 @@ We need to change the chained ```if/else if``` statements into a ```switch``` st
answer = "Ate Nine"; answer = "Ate Nine";
break; break;
} }
``` ```
Dont forget to use ```break``` in each ```case```! Dont forget to use ```break``` in each ```case```!
Now, we can delete commented code with ```if/else if``` statement above. Now, we can delete commented code with ```if/else if``` statement above.
Heres a full solution: Heres a full solution:
```javascript ```javascript
function chainToSwitch(val) { function chainToSwitch(val) {
var answer = ""; var answer = "";
@ -107,9 +109,9 @@ We need to change the chained ```if/else if``` statements into a ```switch``` st
case 7: case 7:
answer = "Ate Nine"; answer = "Ate Nine";
break; break;
} }
// Only change code above this line // Only change code above this line
return answer; return answer;
} }
// Change this value to test // Change this value to test
chainToSwitch(7); chainToSwitch(7);

View File

@ -1,4 +1,6 @@
---
title: Return Early Pattern for Functions
---
## Return Early Pattern for Functions ## Return Early Pattern for Functions
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds --> <!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
@ -9,7 +11,7 @@ Heres a setup:
// Setup // Setup
function abTest(a, b) { function abTest(a, b) {
// Only change code below this line // Only change code below this line
// Only change code above this line // Only change code above this line
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2)); return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
} }
@ -27,7 +29,7 @@ We add in body of function simple ```if``` statement, which, under the condition
} }
``` ```
Now, if ```a``` or ```b``` are less than ```0``` - function exit with a value of ```undefined```, in other cases - Now, if ```a``` or ```b``` are less than ```0``` - function exit with a value of ```undefined```, in other cases -
```javascript ```javascript
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2)); return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
@ -35,7 +37,7 @@ Now, if ```a``` or ```b``` are less than ```0``` - function exit with a value of
``` ```
Heres a full solution: Heres a full solution:
```javascript ```javascript
// Setup // Setup
function abTest(a, b) { function abTest(a, b) {
@ -43,7 +45,7 @@ function abTest(a, b) {
if (a < 0 || b < 0) { if (a < 0 || b < 0) {
return undefined; return undefined;
} }
// Only change code above this line // Only change code above this line
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2)); return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));

View File

@ -1,8 +1,8 @@
--- ---
title: Create a Gradual CSS Linear Gradient title: Create a Gradual CSS Linear Gradient
--- ---
## Create a Gradual CSS Linear Gradient ## Create a Gradual CSS Linear Gradient
To create a linear gradient you must define at least two color stops. Color stops are the colors you want to render smooth transitions among. You can also set a starting point and a direction (or an angle) along with the gradient effect. To create a linear gradient you must define at least two color stops. Color stops are the colors you want to render smooth transitions among. You can also set a starting point and a direction (or an angle) along with the gradient effect.
The syntax is always: The syntax is always:

View File

@ -1,5 +1,6 @@
title: Add a Submit Button to a Form ---
--- title: Add a Submit Button to a Form
---
## Add a Submit Button to a Form ## Add a Submit Button to a Form
In this challenge you want to insert the submit button as the last element of the form ( just before the `</form>` closing tag) and to give it the attribute `type="submit"` (everything lowercase) and a text content of "Submit" (first letter uppercase) as specified in the challenge instruction. In this challenge you want to insert the submit button as the last element of the form ( just before the `</form>` closing tag) and to give it the attribute `type="submit"` (everything lowercase) and a text content of "Submit" (first letter uppercase) as specified in the challenge instruction.

View File

@ -1,9 +1,9 @@
--- ---
title: Heroku title: Heroku
--- ---
## Heroku ## Heroku
Heroku is a cloud platform as a service (PaaS) supporting several programming languages that is used as a web application deployment model. Heroku, one of the first cloud platforms, has been in development since June 2007, when it supported only the Ruby programming language, but now supports Java, Node.js, Scala, Clojure, Python, PHP, and Go. For this reason, Heroku is said to be a polyglot platform as it lets the developer build, run and scale applications in a similar manner across all the languages. Heroku was acquired by Salesforce.com in 2010 for $212 million Heroku is a cloud platform as a service (PaaS) supporting several programming languages that is used as a web application deployment model. Heroku, one of the first cloud platforms, has been in development since June 2007, when it supported only the Ruby programming language, but now supports Java, Node.js, Scala, Clojure, Python, PHP, and Go. For this reason, Heroku is said to be a polyglot platform as it lets the developer build, run and scale applications in a similar manner across all the languages. Heroku was acquired by Salesforce.com in 2010 for $212 million
#### More Information: #### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article --> <!-- Please add any articles you think might be helpful to read before writing the article -->
* <a href='https://en.wikipedia.org/wiki/Heroku' target='_blank' rel='nofollow'>Wikipedia</a> * <a href='https://en.wikipedia.org/wiki/Heroku' target='_blank' rel='nofollow'>Wikipedia</a>

View File

@ -1,8 +1,8 @@
--- ---
title: Rackspace Cloud title: Rackspace Cloud
--- ---
## Rackspace Cloud ## Rackspace Cloud
The Rackspace Cloud is a set of cloud computing products and services billed on a utility computing basis from the US-based company Rackspace. Offerings include web application hosting or platform as a service ("Cloud Sites"), Cloud Storage ("Cloud Files"), virtual private server ("Cloud Servers"), load balancers, databases, backup, and monitoring. The Rackspace Cloud is a set of cloud computing products and services billed on a utility computing basis from the US-based company Rackspace. Offerings include web application hosting or platform as a service ("Cloud Sites"), Cloud Storage ("Cloud Files"), virtual private server ("Cloud Servers"), load balancers, databases, backup, and monitoring.
#### More Information: #### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article --> <!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -1,4 +1,9 @@
# Deadlocks ---
title: Deadlock
---
## Deadlock
### The Deadlock Problem ### The Deadlock Problem
- A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. - A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.
- Example - Example
@ -16,7 +21,7 @@
### Deadlock Characterization ### Deadlock Characterization
Deadlock can arise if four conditions hold simultaneously. Deadlock can arise if four conditions hold simultaneously.
- **Mutual exclusion** : only one process at a time can use a resource. - **Mutual exclusion** : only one process at a time can use a resource.
- **Hold and wait** : a process holding at least one resource is waiting to acquire additional resources held by other processes. - **Hold and wait** : a process holding at least one resource is waiting to acquire additional resources held by other processes.
- **No preemption** : a resource can be released only voluntarily by the process holding it, after that process has completed its task. - **No preemption** : a resource can be released only voluntarily by the process holding it, after that process has completed its task.
- **Circular wait** : there exists a set { P<sub>0</sub>, P<sub>1</sub>, …, P<sub>0</sub> } of waiting processes such that P<sub>0</sub> is waiting for a resource that is held by P<sub>1</sub>, P<sub>1</sub> is waiting for a resource that is held by P<sub>2</sub>, …, P<sub>n 1</sub> is waiting for a resource that is held by P<sub>n</sub>, and P<sub>0</sub> is waiting for a resource that is held by P<sub>0</sub>. - **Circular wait** : there exists a set { P<sub>0</sub>, P<sub>1</sub>, …, P<sub>0</sub> } of waiting processes such that P<sub>0</sub> is waiting for a resource that is held by P<sub>1</sub>, P<sub>1</sub> is waiting for a resource that is held by P<sub>2</sub>, …, P<sub>n 1</sub> is waiting for a resource that is held by P<sub>n</sub>, and P<sub>0</sub> is waiting for a resource that is held by P<sub>0</sub>.
@ -28,16 +33,16 @@ Deadlock can arise if four conditions hold simultaneously.
### Deadlock Prevention ### Deadlock Prevention
- **Mutual Exclusion** It is not required for sharable resources; must hold for nonsharable resources. - **Mutual Exclusion** It is not required for sharable resources; must hold for nonsharable resources.
- **Hold and Wait** It must guarantee that whenever a process requests a resource, it does not hold any other resources. - **Hold and Wait** It must guarantee that whenever a process requests a resource, it does not hold any other resources.
- Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none. - Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none.
- Low resource utilization; starvation possible. - Low resource utilization; starvation possible.
- **No Preemption** - **No Preemption**
- If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released. - If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released.
- Preempted resources are added to the list of resources for which the process is waiting. - Preempted resources are added to the list of resources for which the process is waiting.
- Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting. - Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting.
- **Circular Wait** It imposes a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration. - **Circular Wait** It imposes a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration.

View File

@ -1,60 +1,65 @@
# Running Web Server inside Docker ---
### Start docker and its container - title: Creating a Web Server inside Docker
---
# Creating a Web Server inside Docker
### Start docker and its container -
``` ```
$ systemctl restart docker $ systemctl restart docker
$ systemctl enable docker $ systemctl enable docker
$ docker run -it --name webserver centos:latest $ docker run -it --name webserver centos:latest
``` ```
### Install httpd ### Install httpd
- **yum** is already configured in centos docker image. - **yum** is already configured in centos docker image.
So directly install **httpd** software - So directly install **httpd** software -
`$ yum install httpd -y` `$ yum install httpd -y`
- Create a dummy web page to check the server - - Create a dummy web page to check the server -
``` ```
$ cd /var/www/html $ cd /var/www/html
$ vi index.html $ vi index.html
``` ```
### Start services - ### Start services -
- If we use **systemctl** to start the services, this will not work and gives an error. - If we use **systemctl** to start the services, this will not work and gives an error.
- **systemctl** doesn't work in docker. - **systemctl** doesn't work in docker.
- In actual RedHat system, when we start a service it actually runs a script in background. That script start daemons. - In actual RedHat system, when we start a service it actually runs a script in background. That script start daemons.
- To find the path of that script, check status of service - To find the path of that script, check status of service
`$ systemctl status httpd` `$ systemctl status httpd`
`Loaded` option shows script file path. `Loaded` option shows script file path.
- In that file, we have a line which actually starts service - - In that file, we have a line which actually starts service -
`ExecStart = /usr/sbin/httpd....... ` `ExecStart = /usr/sbin/httpd....... `
So the command `/usr/sbin/httpd` actually starts **httpd** server. So the command `/usr/sbin/httpd` actually starts **httpd** server.
- Service is running or not, can be checked by - - Service is running or not, can be checked by -
`$ ps -aux | grep httpd` `$ ps -aux | grep httpd`
- So we don't require `systemctl` we can directly start our web server using- - So we don't require `systemctl` we can directly start our web server using-
`$ /usr/sbin/httpd` `$ /usr/sbin/httpd`
This will start the web server. This will start the web server.
- `ifconfig` doesn't work in docker. - `ifconfig` doesn't work in docker.
- So install software, which gives `ifconfig` command. - So install software, which gives `ifconfig` command.
- It can be checked in actual Redhat system by running this command- - It can be checked in actual Redhat system by running this command-
`$ rpm -qf /usr/sbin/ifconfig` `$ rpm -qf /usr/sbin/ifconfig`
- This comes from **net-tools** package. - This comes from **net-tools** package.
- So Install **net-tools** in docker os. - So Install **net-tools** in docker os.
- Making _image_ of created web server - - Making _image_ of created web server -
`$ docker commit webserver apacheimg:v1` `$ docker commit webserver apacheimg:v1`
- Name of container is _webserver_. - Name of container is _webserver_.
- This image can be share with exact setup with other users. - This image can be share with exact setup with other users.
- To save created image - - To save created image -
`$ docker save apacheimg:v1 -o mywebserver.tar` `$ docker save apacheimg:v1 -o mywebserver.tar`
- To start **httpd** service automatically when container starts - - To start **httpd** service automatically when container starts -
- Write `/usr/sbin/httpd` in following file. - Write `/usr/sbin/httpd` in following file.
`$ vim /root/.bashrc` `$ vim /root/.bashrc`
- To copy a file in container from the base system - - To copy a file in container from the base system -
`$ docker cp /root/form.txt myconatiner:/` `$ docker cp /root/form.txt myconatiner:/`
## Summary ## Summary

View File

@ -1,9 +1,13 @@
---
title: Useful commands for Docker
---
# Useful commands for Docker # Useful commands for Docker
- Docker is mainly used for run programs on server side. - Docker is mainly used for run programs on server side.
- Companies customize their OS before use. They don't require many things like GUI. - Companies customize their OS before use. They don't require many things like GUI.
- Less program means less RAM used and more security. - Less program means less RAM used and more security.
- More features means more chances to hack, more vulnerabilities. - More features means more chances to hack, more vulnerabilities.
- We use OS to run program. Docker gives us an environment to run our program. - We use OS to run program. Docker gives us an environment to run our program.
## Installing docker-engine ## Installing docker-engine
### For Redhat OS ### For Redhat OS
@ -11,15 +15,15 @@
``` ```
[docker] [docker]
baseurl = https://yum.dockerproject.org/repo/main/centos/7 baseurl = https://yum.dockerproject.org/repo/main/centos/7
gpgcheck=0 gpgcheck=0
``` ```
- Then, install **docker-engine** - Then, install **docker-engine**
`$ yum install docker-engine` `$ yum install docker-engine`
### Start the services of docker ### Start the services of docker
`$ systemctl restart docker` `$ systemctl restart docker`
It starts the docker server. It starts the docker server.
### See all the images available in docker ### See all the images available in docker
`$ docker images` `$ docker images`
The default _docker images_ will show all top level images, their repository and tags, and their size. The default _docker images_ will show all top level images, their repository and tags, and their size.
@ -32,7 +36,7 @@ It loads an image or repository from a tar archive (even if compressed with gzip
### Docker run reference ### Docker run reference
- Docker runs processes in isolated containers. - Docker runs processes in isolated containers.
- A container is a process which runs on a host. The host may be local or remote. - A container is a process which runs on a host. The host may be local or remote.
- When an operator executes `docker run`, the container process that runs is isolated in that it has its own file system, its own networking, and its own isolated process tree separate from the host. - When an operator executes `docker run`, the container process that runs is isolated in that it has its own file system, its own networking, and its own isolated process tree separate from the host.
### Run or start a new OS ### Run or start a new OS
@ -67,8 +71,8 @@ press _ctrl + p + q_
### Stop all running OSs ### Stop all running OSs
``` ```
$ docker ps -q //shows id of every running OS $ docker ps -q //shows id of every running OS
$ docker stop $(docker ps -q) $ docker stop $(docker ps -q)
``` ```
### Permanently remove a container ### Permanently remove a container
@ -77,7 +81,7 @@ $ docker stop $(docker ps -q)
### Permanently Remove all the stopped containers ### Permanently Remove all the stopped containers
`$ docker rm $(docker ps -a -q)` `$ docker rm $(docker ps -a -q)`
- This command will delete all stopped containers. - This command will delete all stopped containers.
- The command `docker ps -a -q` will return all existing container IDs and pass them to the `rm` command which will delete them. - The command `docker ps -a -q` will return all existing container IDs and pass them to the `rm` command which will delete them.
- Any running containers will not be deleted. - Any running containers will not be deleted.
### Remove containers while running (forcefully) ### Remove containers while running (forcefully)
@ -91,19 +95,19 @@ $ docker stop $(docker ps -q)
### Copy a file in container ### Copy a file in container
`$ docker cp /root/form.txt myconatiner:/` `$ docker cp /root/form.txt myconatiner:/`
This command will copy a file form.txt from the base system to the specified container. This command will copy a file form.txt from the base system to the specified container.
### Download docker images ### Download docker images
[docker hub](http://hub.docker.com) - All the available docker images can be downloaded from this URL. [docker hub](http://hub.docker.com) - All the available docker images can be downloaded from this URL.
### Check different versions of OS that are available ### Check different versions of OS that are available
``` ```
$ docker search ubuntu //search $ docker search ubuntu //search
$ docker pull ubuntu:17.10 //downlaod required version $ docker pull ubuntu:17.10 //downlaod required version
``` ```
## Docker Storage ## Docker Storage
### Basic Storage types ### Basic Storage types
1. **Empheral disk (temporary)** OS removal will remove data (like windows C drive) 1. **Empheral disk (temporary)** OS removal will remove data (like windows C drive)
2. **Persistent disk (permanent)** - OS removal will not erase data (like windows D drive) 2. **Persistent disk (permanent)** - OS removal will not erase data (like windows D drive)
- **-v** gives persistent storage. OS removal will not remove data. - **-v** gives persistent storage. OS removal will not remove data.
@ -112,7 +116,7 @@ $ docker pull ubuntu:17.10 //downlaod required version
Docker by default takes space from **/** drive of host system to store data. Overall **/** drive amount of storage docker can use. Docker by default takes space from **/** drive of host system to store data. Overall **/** drive amount of storage docker can use.
### Give separate space to a docker container ### Give separate space to a docker container
- Make a partition, format it and mount in base system. - Make a partition, format it and mount in base system.
Let the partition created is **mypart** Let the partition created is **mypart**
- Then, run following command - Then, run following command
`$ docker run it -v /mypart:/data centos` `$ docker run it -v /mypart:/data centos`

View File

@ -1,5 +1,5 @@
--- ---
title:Switch Statement title: Switch Statement
--- ---
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each case. A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each case.
@ -12,7 +12,7 @@ switch(expression) {
case constant-expression : case constant-expression :
statement(s); statement(s);
break; //optional break; //optional
// you can have any number of case statements. // you can have any number of case statements.
default : //Optional default : //Optional
statement(s); statement(s);
@ -38,14 +38,14 @@ Example:
```C++ ```C++
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int main () { int main () {
// local variable declaration: // local variable declaration:
char grade = 'D'; char grade = 'D';
switch(grade) { switch(grade) {
case 'A' : case 'A' :
cout << "Excellent!" << endl; cout << "Excellent!" << endl;
break; break;
case 'B' : case 'B' :
case 'C' : case 'C' :
@ -61,7 +61,7 @@ int main () {
cout << "Invalid grade" << endl; cout << "Invalid grade" << endl;
} }
cout << "Your grade is " << grade << endl; cout << "Your grade is " << grade << endl;
return 0; return 0;
}``` }```

View File

@ -1,5 +1,5 @@
--- ---
title:While-loop title: While-loop
--- ---
A while loop statement repeatedly executes a target statement as long as a given condition is true. A while loop statement repeatedly executes a target statement as long as a given condition is true.
@ -18,7 +18,7 @@ Example:
```C++ ```C++
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int main () { int main () {
// Local variable declaration: // Local variable declaration:
int a = 10; int a = 10;
@ -28,7 +28,7 @@ int main () {
cout << "value of a: " << a << endl; cout << "value of a: " << a << endl;
a++; a++;
} }
return 0; return 0;
} }
``` ```

View File

@ -1,5 +1,5 @@
--- ---
title : Interface title: Interface
--- ---
--- ---
An interface is similar to a class or struct but without implementation for its members. An interface is similar to a class or struct but without implementation for its members.
@ -9,14 +9,14 @@ It may declare only properties, methods and events with NO access modifiers.
All the declared members must be implemented in the inharit class, otherwise will have an compile error. All the declared members must be implemented in the inharit class, otherwise will have an compile error.
as a convention we will mark interface with the letter I at the begenning (IMyInterface || IUserOptions). as a convention we will mark interface with the letter I at the begenning (IMyInterface || IUserOptions).
You define an interface by using the interface keyword. You define an interface by using the interface keyword.
All members of an interface are: All members of an interface are:
implicitly abstract, implicitly abstract,
implicitly public, cannot declare an access modifier such as protected, internal private etc... implicitly public, cannot declare an access modifier such as protected, internal private etc...
An Interface can: An Interface can:
* Inherit from other interfaces. * Inherit from other interfaces.
* Inherit from multiple interfaces at the same time * Inherit from multiple interfaces at the same time
* Contain only methods, properties, events, and indexers. * Contain only methods, properties, events, and indexers.
An Interface can not : An Interface can not :
@ -47,7 +47,7 @@ public class UserHungry : IUserFavoriteFood
// Implementation: // Implementation:
// A method to add food. // A method to add food.
} }
public Task<User> EatFavoriteFood(int id) public Task<User> EatFavoriteFood(int id)
{ {
// Implementation: // Implementation:

View File

@ -1,3 +1,7 @@
---
title: CSS Frameworks
---
CSS frameworks are designed to simplify the work of the typesetter, eliminate errors when creating a project, and get rid of the boring monotonous writing of the same code. CSS frameworks are designed to simplify the work of the typesetter, eliminate errors when creating a project, and get rid of the boring monotonous writing of the same code.

View File

@ -1,3 +1,6 @@
---
title: W3 CSS Containers
---
## W3 CSS Containers ## W3 CSS Containers
W3.css provides a container class which adds 16 pixels worth of left and right padding to any html element, and 0.01em of W3.css provides a container class which adds 16 pixels worth of left and right padding to any html element, and 0.01em of
@ -5,12 +8,12 @@ top and bottom padding.
This makes it ideal for html containing elements such as ```<header>, <div>, <footer>, <section>```etc. But can also be used with great effect on elements like ```<img> and <p>.``` This makes it ideal for html containing elements such as ```<header>, <div>, <footer>, <section>```etc. But can also be used with great effect on elements like ```<img> and <p>.```
### Simple example ### Simple example
``` ```html
<header class="w3-container"> <header class="w3-container">
<h1>Header With W3 Container</h1> <h1>Header With W3 Container</h1>
</header> </header>
``` ```
``` ```html
<header> <header>
<h1>Header Without W3 Container</h1> <h1>Header Without W3 Container</h1>
</header> </header>
@ -21,15 +24,15 @@ Would produce the following result.
### To use W3.Css Containers ### To use W3.Css Containers
Just add a regular stylesheet link to the head of your web page like so: Just add a regular stylesheet link to the head of your web page like so:
``` ```html
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
``` ```
or download the latest css file to your local machine. Here: (https://www.w3schools.com/w3css/4/w3.css) or download the latest css file to your local machine [from here](https://www.w3schools.com/w3css/4/w3.css)
#### More Information on W3.Css Containers #### More Information on W3.Css Containers
##### W3schools.com (https://www.w3schools.com/w3css/w3css_containers.asp) * [W3schools.com](https://www.w3schools.com/w3css/w3css_containers.asp)

View File

@ -1,12 +1,12 @@
--- ---
title: Tableau title: Tableau
--- ---
# Tableau # Tableau
Tableau is a data visualization software for business intelligence. Tableau is a commerically available thought the Tableau Software foundation. Capabilites include highly interactive visualizations, mapping capabilites, and dashbaords. A roboust community for tableau visualizations exists online, where many individauls publically publish their dashboards. Tableau is a data visualization software for business intelligence. Tableau is a commerically available thought the Tableau Software foundation. Capabilites include highly interactive visualizations, mapping capabilites, and dashbaords. A roboust community for tableau visualizations exists online, where many individauls publically publish their dashboards.
# Getting Started with Tableau Public # Getting Started with Tableau Public
If you want to learn Tableau on your own, it's possible to get a free license for the public version of Tableau. Not only can this allow you to import your own datasets into Tableau and create visualizations, but you can also publish these dashboards online and add to your public portfolio. If you want to learn Tableau on your own, it's possible to get a free license for the public version of Tableau. Not only can this allow you to import your own datasets into Tableau and create visualizations, but you can also publish these dashboards online and add to your public portfolio.
- Link: https://public.tableau.com/en-us/s/ - Link: https://public.tableau.com/en-us/s/
- Start by creating an online account on Tableau's website, using the 'Sign In' button at the top right, and then clicking on 'Create one now for free' - Start by creating an online account on Tableau's website, using the 'Sign In' button at the top right, and then clicking on 'Create one now for free'
- After you have done that, you can enter your email address and download the application to your local machine. - After you have done that, you can enter your email address and download the application to your local machine.
@ -15,4 +15,4 @@ If you want to learn Tableau on your own, it's possible to get a free license fo
### Links: ### Links:
* [Tableau Website](https://www.tableau.com) * [Tableau Website](https://www.tableau.com)
* [Tableau Public Gallery](https://public.tableau.com/en-us/s/gallery) * [Tableau Public Gallery](https://public.tableau.com/en-us/s/gallery)

View File

@ -1,4 +1,3 @@
--- ---
title: Functional Programming title: Functional Programming
--- ---

View File

@ -1,5 +1,5 @@
--- ---
title: kubernetes title: kubernetes
--- ---
# Kubernetes # Kubernetes
@ -9,7 +9,7 @@
* [Kubernetes on GitHub](https://github.com/kubernetes/kubernetes) * [Kubernetes on GitHub](https://github.com/kubernetes/kubernetes)
* [Kubernetes website](https://kubernetes.io) * [Kubernetes website](https://kubernetes.io)
* [Kubernetes tutorial](https://kubernetes.io/docs/tutorials/kubernetes-basics/) * [Kubernetes tutorial](https://kubernetes.io/docs/tutorials/kubernetes-basics/)
### Sources: ### Sources:
* The Kubernetes Authors, 2017, kubernetes.io. Accessed 27 Oct. 2017. * The Kubernetes Authors, 2017, kubernetes.io. Accessed 27 Oct. 2017.

View File

@ -1,4 +1,3 @@
--- ---
title: Git Show title: Git Show
--- ---
@ -29,17 +28,17 @@ You'd get an output similar to,
commit 3357d63d8f44104940e568a1ba89fa88a16dc753 commit 3357d63d8f44104940e568a1ba89fa88a16dc753
Author: John Doe <johndoe@acme.com> Author: John Doe <johndoe@acme.com>
Date: Tue Oct 2 00:57:38 2018 +0530 Date: Tue Oct 2 00:57:38 2018 +0530
add a section on git commit --amend --author add a section on git commit --amend --author
diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md
index fc9f568..8f1c8eb 100644 index fc9f568..8f1c8eb 100644
--- a/src/pages/git/git-commit/index.md --- a/src/pages/git/git-commit/index.md
+++ b/src/pages/git/git-commit/index.md +++ b/src/pages/git/git-commit/index.md
@@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme @@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme
Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository. Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository.
+With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit. +With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit.
+ +
+``` +```

View File

@ -1,4 +1,8 @@
# WebSockets ---
title: WebSockets
---
## WebSockets
*Web Sockets* is a technology that allows you to create an interactive connection between a client and a server for exchanging data in real time. WebSockets allow you to work in two streams, which distinguishes this technology from HTTP. *Web Sockets* is a technology that allows you to create an interactive connection between a client and a server for exchanging data in real time. WebSockets allow you to work in two streams, which distinguishes this technology from HTTP.

View File

@ -1,19 +1,18 @@
--- ---
title: Simplify Square Roots title: Simplify Square Roots
--- ---
## Simplify Square Roots ## Simplify Square Roots
In order to simplify square roots, it is important to know the radical product property. In order to simplify square roots, it is important to know the radical product property.
![Image showing radical product property. The square root of A multiplied by the square root of B is equivalent to the square root of A multiplied by B.](https://raw.githubusercontent.com/hayleycd/images/master/multiplying_radicals.jpeg) ![Image showing radical product property. The square root of A multiplied by the square root of B is equivalent to the square root of A multiplied by B.](https://raw.githubusercontent.com/hayleycd/images/master/multiplying_radicals.jpeg)
The Radical Product Property shows us that the square root of two numbers multiplied together is equivalent to the square root of the first number multiplied by the square root of the second. The Radical Product Property shows us that the square root of two numbers multiplied together is equivalent to the square root of the first number multiplied by the square root of the second.
The second important thing to know is the concept of Perfect Squares. When a whole number is multiplied by itself, a Perfect Square is the result. The second important thing to know is the concept of Perfect Squares. When a whole number is multiplied by itself, a Perfect Square is the result.
![Image showing perfect squares. Examples of Perfect Squares Include 1, 4, 9, 25, 36 and more.](https://raw.githubusercontent.com/hayleycd/images/master/perfect_squares.jpeg) ![Image showing perfect squares. Examples of Perfect Squares Include 1, 4, 9, 25, 36 and more.](https://raw.githubusercontent.com/hayleycd/images/master/perfect_squares.jpeg)
A square root can be simplified if the number you are trying to take the square root of has a factor that is a perfect square. If it does, the Radical Product Property can be used to simplify. Examples below simplify the square root of 48 and simplify the square root of 75. A square root can be simplified if the number you are trying to take the square root of has a factor that is a perfect square. If it does, the Radical Product Property can be used to simplify. Examples below simplify the square root of 48 and simplify the square root of 75.
![Image showing the square root of 48 being simplified to 4 multiplied by the square root of 3 and the square root of 75 being simplified to 5 multiplied by the square root of 3.](https://raw.githubusercontent.com/hayleycd/images/master/radical_examples.jpeg) ![Image showing the square root of 48 being simplified to 4 multiplied by the square root of 3 and the square root of 75 being simplified to 5 multiplied by the square root of 3.](https://raw.githubusercontent.com/hayleycd/images/master/radical_examples.jpeg)

View File

@ -1,6 +1,6 @@
---
title: Converse Inverse Contrapositive title: Converse Inverse Contrapositive
---
In Discrete Mathematics, given a conditional statement ”if a,then b”, we In Discrete Mathematics, given a conditional statement ”if a,then b”, we
can have 3 related statements:<br> can have 3 related statements:<br>

View File

@ -1,4 +1,9 @@
Installation of Nginx in Ubuntu ---
title: Installation of Nginx in Ubuntu
---
## Installation of Nginx in Ubuntu
Step 1: Update Apt-Get Step 1: Update Apt-Get
As always, we update and upgrade our package manager. As always, we update and upgrade our package manager.

View File

@ -1,3 +1,6 @@
---
title: File System
---
## File System ## File System
The Node.js File System module allows you to work with the file system on your computer. The Node.js File System module allows you to work with the file system on your computer.
@ -37,7 +40,7 @@ fs.readFile('input.txt', 'utf-8', (err, data) => {
``` ```
The above code reads a file *input.txt* from your computer and returns the content to the console. The above code reads a file *input.txt* from your computer and returns the content to the console.
### Steps for execution : ### Steps for execution :
* You should have Node.js installed in your computer. * You should have Node.js installed in your computer.
* Create a file *app.js* and paste the above code. * Create a file *app.js* and paste the above code.
@ -50,7 +53,7 @@ The above code reads a file *input.txt* from your computer and returns the conte
The ```fs.writeFile()``` method takes three arguments - filename, content and a call back function. The ```fs.writeFile()``` method takes three arguments - filename, content and a call back function.
Node.js code to write content into file. Node.js code to write content into file.
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
@ -65,7 +68,7 @@ fs.writeFile('output.txt', "New content added", (err, data) => {
``` ```
The above code creates a file *output.txt* and add content *New content added* to it. The above code creates a file *output.txt* and add content *New content added* to it.
### Steps for execution : ### Steps for execution :
* You should have Node.js installed in your computer. * You should have Node.js installed in your computer.
* Create a file *app.js* and paste the above code. * Create a file *app.js* and paste the above code.
@ -77,4 +80,4 @@ The above code creates a file *output.txt* and add content *New content added* t
* [Node.js API](https://nodejs.org/api/fs.html#fs_file_system) * [Node.js API](https://nodejs.org/api/fs.html#fs_file_system)
* [W3 Schools](https://www.w3schools.com/nodejs/nodejs_filesystem.asp) * [W3 Schools](https://www.w3schools.com/nodejs/nodejs_filesystem.asp)

View File

@ -1,3 +1,6 @@
---
title: HTTP
---
## HTTP ## HTTP
Node.js has a set of built-in modules which you can use without any further installation. Similarly **HTTP module** contains a set of functions which are required to transfer data over the Hyper Text Transfer Protocol (HTTP). Node.js has a set of built-in modules which you can use without any further installation. Similarly **HTTP module** contains a set of functions which are required to transfer data over the Hyper Text Transfer Protocol (HTTP).
@ -27,7 +30,7 @@ http.createServer((req, res) => {
console.log("Server is listening on port no : 8000"); console.log("Server is listening on port no : 8000");
``` ```
### Steps for execution : ### Steps for execution :
* You should have Node.js installed in your computer. * You should have Node.js installed in your computer.
* Create a file *app.js* and paste the above code. * Create a file *app.js* and paste the above code.

View File

@ -1,3 +1,6 @@
---
title: React Router
---
# React Router for beginners # React Router for beginners
# Installation # Installation

View File

@ -1,12 +1,12 @@
--- ---
Copywriting for UX/UI title: Copywriting for UX/UI
--- ---
##Copywriting for UX/UI ##Copywriting for UX/UI
###What is it? ###What is it?
To put it simply UX writing is a conversation with your audience. UX writing is the process of writing copy for user-facing touchpoints. To put it simply UX writing is a conversation with your audience. UX writing is the process of writing copy for user-facing touchpoints.
This must come first naturally even before wire-frames. Words are often the best starting points for creating your intital layout designs. This must come first naturally even before wire-frames. Words are often the best starting points for creating your intital layout designs.
Usually designers and writers need to work in unison as to get the message, tone, voice and language just right. Every word and space Usually designers and writers need to work in unison as to get the message, tone, voice and language just right. Every word and space
inbetween should speak to the intended user like a good friend. Boring cannot be in your vocabulary unless your product calls for it inbetween should speak to the intended user like a good friend. Boring cannot be in your vocabulary unless your product calls for it
(Portfolio Management?). A good writer can put a fund, modern touch onto anything. (Portfolio Management?). A good writer can put a fund, modern touch onto anything.

View File

@ -1,5 +1,5 @@
--- ---
title : Features of BlockTech title: Features of BlockTech
localeTitle: Recursos do BlockTech localeTitle: Recursos do BlockTech
--- ---
## Recursos da tecnologia Blockchain ## Recursos da tecnologia Blockchain

View File

@ -1,5 +1,6 @@
---
title: Smart Contracts title: Smart Contracts
localeTitle: undefined localeTitle: Smart Contracts
--- ---
## Contratos Inteligentes ## Contratos Inteligentes

View File

@ -1,5 +1,5 @@
--- ---
title : Types of Blockchain title: Types of Blockchain
localeTitle: Tipos de blockchain localeTitle: Tipos de blockchain
--- ---
![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true) ![Blockchain](https://github.com/Vagisha16/Hw3/blob/master/blockchain-what-and-why-19-638.jpg?raw=true)

View File

@ -1,6 +1,6 @@
--- ---
title: Create a Gradual CSS Linear Gradient title: Create a Gradual CSS Linear Gradient
localeTitle: Criar um gradiente linear de CSS gradual localeTitle: Criar um gradiente linear de CSS gradual
--- ---
\## Criar um Gradiente Linear CSS Gradual \## Criar um Gradiente Linear CSS Gradual
@ -8,7 +8,7 @@ Para criar um gradiente linear, você deve definir pelo menos duas paradas de co
A sintaxe é sempre: A sintaxe é sempre:
``` ```
background-image: linear-gradient(angle, color-stop1, color-stop2); background-image: linear-gradient(angle, color-stop1, color-stop2);
``` ```
As cores podem ser usadas nos formatos hex () e rgb (). Experimente um pouco e você entenderá como é fácil e bonito usá-lo. As cores podem ser usadas nos formatos hex () e rgb (). Experimente um pouco e você entenderá como é fácil e bonito usá-lo.

View File

@ -1,18 +1,20 @@
title: Add a Submit Button to a Form ---
localeTitle: undefined title: Add a Submit Button to a Form
--- ## Adicionar um botão Enviar para um formulário localeTitle: Adicionar um botão Enviar para um formulário
---
## Adicionar um botão Enviar para um formulário
Neste desafio, você deseja inserir o botão de envio como o último elemento do formulário (logo antes da tag de fechamento `</form>` ) e atribuir-lhe o atributo `type="submit"` (tudo em minúsculas) e um conteúdo de texto "Submit". "(primeira letra maiúscula) conforme especificado na instrução de desafio. Neste desafio, você deseja inserir o botão de envio como o último elemento do formulário (logo antes da tag de fechamento `</form>` ) e atribuir-lhe o atributo `type="submit"` (tudo em minúsculas) e um conteúdo de texto "Submit". "(primeira letra maiúscula) conforme especificado na instrução de desafio.
1) o valor `submit` do `type` atributo é válido também dentro de uma tag de `input` e renderizará um botão com quase o mesmo comportamento, mas essa não é a tag que você deseja usar neste desafio. 1) o valor `submit` do `type` atributo é válido também dentro de uma tag de `input` e renderizará um botão com quase o mesmo comportamento, mas essa não é a tag que você deseja usar neste desafio.
``` ```
<input type="submit"> <input type="submit">
``` ```
Se você não especificar um valor, o botão terá um valor padrão escolhido pelo seu agente de usuário (geralmente é algo como "Enviar" ou "Enviar Consulta"). Se você não especificar um valor, o botão terá um valor padrão escolhido pelo seu agente de usuário (geralmente é algo como "Enviar" ou "Enviar Consulta").
Se você deseja especificar um valor como "Enviar Pedido", você pode fazer assim: Se você deseja especificar um valor como "Enviar Pedido", você pode fazer assim:
``` ```
<input type="submit" value="Send Request"> <input type="submit" value="Send Request">
``` ```

View File

@ -1,6 +1,6 @@
--- ---
title: "Use display: flex to Position Two Boxes" title: "Use display: flex to Position Two Boxes"
localeTitle: "Use display localeTitle: "Use display: flex to Position Two Boxes"
--- ---
## Use display: flex para posicionar duas caixas ## Use display: flex para posicionar duas caixas
@ -11,8 +11,8 @@ Este desafio é definir o primeiro de três etapas ao usar o Flexbox. Você prec
Exemplo: Exemplo:
```CSS ```CSS
#main-container { #main-container {
display: flex; display: flex;
} }
``` ```

View File

@ -1,5 +1,5 @@
--- ---
title: Heroku title: Heroku
localeTitle: Heroku localeTitle: Heroku
--- ---
\## Heroku \## Heroku

View File

@ -1,5 +1,5 @@
--- ---
title: Rackspace Cloud title: Rackspace Cloud
localeTitle: Nuvem Rackspace localeTitle: Nuvem Rackspace
--- ---
\## Rackspace Cloud \## Rackspace Cloud

View File

@ -1,32 +0,0 @@
Types of Motherboards. Motherboards come in different sizes, known as form factors. The most common motherboard form factor is ATX. The different types of ATX are known as micro-ATX (sometimes shown as µATX, mini-ATX, FlexATX, EATX, WATX, nano-ATX, pico-ATX, and mobileATX).localeTitle: Motherboard
---
## título: Motherboard
## Motherboard
A placa-mãe é a camada de conexão que permite que os componentes de um computador interajam entre si. A placa-mãe normalmente tem conexões para memória de acesso aleatório (RAM), um disco rígido, uma unidade de processamento gráfico (GPU) e uma unidade de processamento central (CPU). Nos desktops, a placa-mãe é uma placa física à qual todos esses componentes estão conectados. No entanto, em laptops, a placa-mãe normalmente possui alguns desses componentes integrados devido às limitações de espaço dos laptops.
Uma placa-mãe fornece energia e conectividade aos componentes do computador e atua como o painel de controle para todas as comunicações entre componentes. Se a CPU precisar processar informações armazenadas na RAM, por exemplo, a placa-mãe fornece uma conexão entre a CPU e a RAM, chamada de barramento de memória, para permitir o acesso aos dados. Uma placa-mãe inclui barramentos para placas de expansão (incluindo a GPU), RAM e discos rígidos.
Os principais fabricantes de placas-mãe são INTEL, ASUS, ACER, GIGABYTE, IBM, SIMMTRONICS e muitos mais.
## Partes de uma placa-mãe
Se você fosse abrir seu computador e tirar a placa-mãe, provavelmente ficaria muito confuso sobre todas as partes diferentes. Dependendo da marca e modelo do seu computador, pode ser algo como isto. Para entender como os computadores funcionam, você não precisa conhecer cada parte da placa-mãe. No entanto, é bom conhecer algumas das partes mais importantes e como a placa-mãe conecta as várias partes de um sistema de computador. Aqui estão algumas das partes típicas:
* Um soquete da CPU - a CPU real é soldada diretamente no soquete. Como as CPUs de alta velocidade geram muito calor, há dissipadores de calor e pontos de montagem para os ventiladores ao lado do soquete da CPU. Observe que os processadores suportam apenas um único tipo de soquete para que ele corresponda ao soquete das motherboards para funcionar. Geralmente, os tipos de soquetes mudam a cada poucas gerações e também variam de acordo com o rótulo (CPUs para consumidores, HEDT, CPUs do servidor)
* Um conector de energia para distribuir energia para a CPU e outros componentes.
* Slots para a memória principal do sistema, normalmente na forma de chips DRAM.
* Um chip forma uma interface entre a CPU, a memória principal e outros componentes. Em muitos tipos de placas-mãe, isso é chamado de Northbridge. Este chip também contém um grande dissipador de calor. Nos últimos anos, os recursos do Northbridge foram cada vez mais integrados ao próprio processador.
* Um segundo chip controla as funções de entrada e saída (E / S). Não está conectado diretamente à CPU, mas ao Northbridge. Este controlador de E / S é referido como o Southbridge. O Northbridge e Southbridge combinados são referidos como o chipset.
* Vários conectores, que fornecem a interface física entre os dispositivos de entrada e saída e a placa-mãe. O Southbridge lida com essas conexões.
* Slots para um ou mais discos rígidos para armazenar arquivos. Os tipos mais comuns de conexões são Integrated Drive Electronics (IDE) e Serial Advanced Technology Attachment (SATA).
* Um chip de memória somente leitura (ROM), que contém o firmware, ou instruções de inicialização para o sistema do computador. Isso também é chamado de BIOS.
* Um slot para uma placa de vídeo ou gráfica. Há vários tipos diferentes de slots, incluindo a AGP (Accelerated Graphics Port) e PCIe (Peripheral Component Interconnect Express). Slots adicionais para conectar hardware na forma de slots PCI (Peripheral Component Interconnect).
#### Mais Informações:
* [Motherboard](https://www.computerhope.com/jargon/m/mothboar.htm)
* [Chipset (wikipedia)](https://en.wikipedia.org/wiki/Chipset)
Tipos de placas-mãe. Placas-mãe vêm em tamanhos diferentes, conhecidos como fatores de forma. O fator de forma mais comum da placa-mãe é o ATX. Os diferentes tipos de ATX são conhecidos como micro-ATX (às vezes mostrados como µATX, mini-ATX, FlexATX, EATX, WATX, nano-ATX, pico-ATX e mobileATX).

View File

@ -1,5 +1,5 @@
--- ---
title:Switch Statement title: Switch Statement
localeTitle: undefined localeTitle: undefined
--- ---
Uma instrução switch permite que uma variável seja testada quanto à igualdade em relação a uma lista de valores. Cada valor é chamado de caso e a variável que está sendo ativada é verificada para cada caso. Uma instrução switch permite que uma variável seja testada quanto à igualdade em relação a uma lista de valores. Cada valor é chamado de caso e a variável que está sendo ativada é verificada para cada caso.

View File

@ -1,5 +1,5 @@
--- ---
title:While-loop title: While-loop
localeTitle: undefined localeTitle: undefined
--- ---
Uma instrução while loop executa repetidamente uma instrução de destino, desde que uma determinada condição seja verdadeira. Uma instrução while loop executa repetidamente uma instrução de destino, desde que uma determinada condição seja verdadeira.
@ -11,21 +11,21 @@ Um ponto-chave do loop while é que o loop pode não ser executado. Quando a con
Exemplo: Exemplo:
```C++ ```C++
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int main () { int main () {
// Local variable declaration: // Local variable declaration:
int a = 10; int a = 10;
// while loop execution // while loop execution
while( a < 20 ) { while( a < 20 ) {
cout << "value of a: " << a << endl; cout << "value of a: " << a << endl;
a++; a++;
} }
return 0; return 0;
} }
``` ```
Saída: Saída:

View File

@ -1,5 +1,5 @@
--- ---
title : Interface title: Interface
localeTitle: Interface localeTitle: Interface
--- ---
* * * * * *
@ -29,11 +29,11 @@ O uso de interfaces nos permite alterar nossa implementação em nosso projeto s
Exemplo de interface: Exemplo de interface:
```csharp ```csharp
public Interface IUserFavoriteFood public Interface IUserFavoriteFood
{ {
void AddFood(); void AddFood();
Task<User> EatFavoriteFood(int id); Task<User> EatFavoriteFood(int id);
} }
``` ```
* * * * * *
@ -41,19 +41,19 @@ public Interface IUserFavoriteFood
Herança e implementação de interfaces: Herança e implementação de interfaces:
```csharp ```csharp
public class UserHungry : IUserFavoriteFood public class UserHungry : IUserFavoriteFood
{ {
public AddFood() public AddFood()
{ {
// Implementation: // Implementation:
// A method to add food. // A method to add food.
} }
public Task<User> EatFavoriteFood(int id) public Task<User> EatFavoriteFood(int id)
{ {
// Implementation: // Implementation:
// A method to Eat food by id. // A method to Eat food by id.
} }
} }
``` ```

View File

@ -1,40 +0,0 @@
CSlocaleTitle: undefined
SAs estruturas são projetadas para simplificar o trabalho do tipógrafo, eliminar erros ao criar um projeto e se livrar da escrita monótona e chata do mesmo código.
Vantagens dos frameworks CSS:
```
* Cross-browser compatibility
* Ability to create the correct HTML layout even for a not very experienced specialist.
* Code uniformity
* Increase development speed
```
Minuses:
```
* Attachment to CSS style library
* Redundant code
```
## Bootstrap
Um dos mais famosos frameworks CSS até hoje. Inclui modelos para desenhar botões, barras laterais, barras de navegação, formulários e outros elementos do site. Inclui-se extensões de javascript.
O Bootstrap é compatível com todos os principais navegadores modernos, mas pode haver problemas em versões mais antigas dos navegadores. Suporta adaptabilidade. Usa os idiomas Less e Sass.
## Esqueleto
Com base em JavaScript e CSS, ele é usado para criar com rapidez e precisão sites responsivos que são exibidos corretamente em monitores grandes e pequenas telas de gadgets. Um grande esqueleto mais - pode ser adaptado a qualquer desenho. A grade de marcação contém 12 colunas e tem uma largura de base de 960 pixels. Compatível com todos os principais navegadores.
## Kube
Liberdade total para o desenvolvedor sem impor estilos. Fornece flexibilidade máxima de design. Ele tem várias opções de grade e é posicionado pelos criadores como uma estrutura para desenvolvedores CSS profissionais. Usa menos, suporta design responsivo.
## Fundação
Estrutura CSS comum. Juntamente com outros elementos principais inclui vários modelos HTML com diferentes arranjos de blocos na página. Tem um grande conjunto de componentes em JavaScript. A estrutura é muito séria em suas capacidades e composição. Usa Sass. Código compatível com todos os principais navegadores.
## IU semântica
Suporte para Firefox, Chrome, Safari, Internet Explorer, Android 4, Blackberry10. Contém um grande número de componentes: ícones, imagens, etiquetas, menus e outros componentes padrão. Ele suporta as versões mais recentes de HTML e CSS e possui uma boa seleção de módulos de script e APIs. Usa menos. Na aplicabilidade compete com o bootstrap.
Cada tarefa tem sua própria ferramenta. Um bom passo seria tentar o framework e entender “seu” ou não. Você pode usar os esqueletos do código apresentados nas estruturas como uma folha de dicas e apenas pegar soluções e código a partir daí.

View File

@ -1,33 +0,0 @@
#localeTitle: undefined
#Contêineres CSS W3 O W3.css fornece uma classe contêiner que adiciona 16 pixels de preenchimento à esquerda e à direita a qualquer elemento html e 0,01 preenchimento superior e inferior. Isso o torna ideal para elementos contendo html, como `<header>, <div>, <footer>, <section>` etc. Mas também pode ser usado com grande efeito em elementos como `<img> and <p>.`
### Exemplo simples
```
<header class="w3-container">
<h1>Header With W3 Container</h1>
</header>
```
```
<header>
<h1>Header Without W3 Container</h1>
</header>
```
Produziria o seguinte resultado.
![Cabeçalho img](https://github.com/OcelotDive/randomImages/blob/master/images/WithWithout.PNG)
### Para usar contêineres W3.Css
Basta adicionar um link de folha de estilo regular ao cabeçalho da sua página da Web da seguinte forma:
```
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
```
ou faça o download do último arquivo css para sua máquina local. Aqui: (https://www.w3schools.com/w3css/4/w3.css)
#### Mais informações sobre contêineres W3.Css
##### W3schools.com (https://www.w3schools.com/w3css/w3css\_containers.asp)

View File

@ -1,5 +1,5 @@
--- ---
title: Tableau title: Tableau
localeTitle: mesa localeTitle: mesa
--- ---
# Quadro # Quadro

View File

@ -1,5 +1,5 @@
--- ---
title: kubernetes title: kubernetes
localeTitle: gubernets localeTitle: gubernets
--- ---
# Kubernetes # Kubernetes

View File

@ -1,7 +1,6 @@
--- ---
title: Git Show title: Git Show
localeTitle: undefined localeTitle: Git Show
--- ---
## Git Show ## Git Show
@ -10,7 +9,7 @@ O `git show` é um comando útil que permite ver em detalhes a visão de um dete
A sintaxe deste comando é a seguinte: A sintaxe deste comando é a seguinte:
```bash ```bash
git show [<options>] [<object>…​] git show [<options>] [<object>…​]
``` ```
Para diferentes objetos `git show` fornece saídas diferentes. Para diferentes objetos `git show` fornece saídas diferentes.
@ -23,33 +22,33 @@ Para diferentes objetos `git show` fornece saídas diferentes.
O uso mais comum do `git show` estaria em associação com o objeto git commit O uso mais comum do `git show` estaria em associação com o objeto git commit
```bash ```bash
git show 3357d63 git show 3357d63
``` ```
Você obteria uma saída semelhante a Você obteria uma saída semelhante a
``` ```
commit 3357d63d8f44104940e568a1ba89fa88a16dc753 commit 3357d63d8f44104940e568a1ba89fa88a16dc753
Author: John Doe <johndoe@acme.com> Author: John Doe <johndoe@acme.com>
Date: Tue Oct 2 00:57:38 2018 +0530 Date: Tue Oct 2 00:57:38 2018 +0530
add a section on git commit --amend --author add a section on git commit --amend --author
diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md diff --git a/src/pages/git/git-commit/index.md b/src/pages/git/git-commit/index.md
index fc9f568..8f1c8eb 100644 index fc9f568..8f1c8eb 100644
--- a/src/pages/git/git-commit/index.md --- a/src/pages/git/git-commit/index.md
+++ b/src/pages/git/git-commit/index.md +++ b/src/pages/git/git-commit/index.md
@@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme @@ -73,5 +73,11 @@ Premature commits happen all the time in the course of your day-to-day developme
Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository. Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. When you're working with others, you should try to avoid amending commits if the last commit is already pushed into the repository.
+With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit. +With `--amend`, one of the useful flag you could use is `--author` which enables you to change the author of the last commit you've made. Imagine a situation you haven't properly set up your name or email in git configurations but you already made a commit. With `--author` flag you can simply change them without resetting the last commit.
+ +
+``` +```
+git commit --amend --author="John Doe <johndoe@email.com>" +git commit --amend --author="John Doe <johndoe@email.com>"
+``` +```
+ +
### More Information: ### More Information:
- Git documentation: [commit](https://git-scm.com/docs/git-commit) - Git documentation: [commit](https://git-scm.com/docs/git-commit)
``` ```
Você poderia apenas usar o `git show` e ele mostrará o conteúdo do commit mais recente do git. Você poderia apenas usar o `git show` e ele mostrará o conteúdo do commit mais recente do git.

View File

@ -1,19 +0,0 @@
# localeTitle: undefined
WebSockets
_Web Sockets_ é uma tecnologia que permite criar uma conexão interativa entre um cliente e um servidor para a troca de dados em tempo real. Os WebSockets permitem trabalhar em dois fluxos, o que distingue esta tecnologia do HTTP.
## Como funcionam os WebSockets?
Os WebSockets não precisam de chamadas repetidas para responder. É o suficiente para fazer um pedido e esperar por uma resposta. Você pode ouvir o servidor, que enviará a resposta em prontidão.
## Quando posso usar WebSockets?
* Aplicativos em Tempo Real
* Aplicação de chat
* Aplicativos IoT
* Jogos multiplayer
## Quando não usar WebSockets?
WebSockets já são suportados em 95% dos navegadores, mas às vezes essa tecnologia não é necessária. Por exemplo, se você estiver criando um CMS simples em que a funcionalidade em tempo real não seja necessária.

View File

@ -1,7 +1,6 @@
--- ---
title: Simplify Square Roots title: Simplify Square Roots
localeTitle: undefined localeTitle: Simplifique Raízes Quadradas
--- ---
## Simplifique Raízes Quadradas ## Simplifique Raízes Quadradas

View File

@ -1,5 +0,0 @@
tlocaleTitle: Contrapositivo inverso inverso
itle: Contrapositivo inverso inverso
Em Matemática Discreta, dada uma declaração condicional "se a, depois b", nós pode ter 3 declarações relacionadas: Qualquer declaração condicional é composta de duas partes: i) Hipótese ("se"): ii) Conclusão ("então"): "Se a, então b" pode ser representado como: a → b Suponha um exemplo: "Se não há escola, então é o fim de semana." p → q • Para obter o inverso da declaração condicional acima, as hipóteses de intercâmbio esis e a conclusão. q → p Assim, o inverso será: "Se é fim de semana, então não há escola." • Para obter o inverso da declaração condicional acima, tome a negação de ambas as hipóteses e a conclusão. →p → ¬q Assim, o inverso será: "Se há escola, então é dia da semana." • Para obter o Contrapositivo da declaração condicional acima, o intercâmbio a hipótese e a conclusão da afirmação inversa. →q → ¬p Assim, o contrapositivo será: "Se é dia da semana, então há escola."

View File

@ -1,5 +1,8 @@
##localeTitle: undefined ---
Sistema de arquivo title: File System
localeTitle: Sistema de arquivo
---
## Sistema de arquivo
O módulo do sistema de arquivos Node.js permite que você trabalhe com o sistema de arquivos em seu computador. O módulo do sistema de arquivos Node.js permite que você trabalhe com o sistema de arquivos em seu computador.
@ -8,7 +11,7 @@ O Node.js tem um conjunto de módulos integrados que você pode usar sem qualque
Para incluir um módulo, use a função `require()` com o nome do módulo. Para incluir um módulo, use a função `require()` com o nome do módulo.
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
``` ```
Uso comum para o módulo do sistema de arquivos: Uso comum para o módulo do sistema de arquivos:
@ -26,15 +29,15 @@ O método `fs.readFile()` é usado para ler arquivos no seu computador. São nec
Node.js código para ler o arquivo do seu computador e retornar o conteúdo para o console. Node.js código para ler o arquivo do seu computador e retornar o conteúdo para o console.
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
fs.readFile('input.txt', 'utf-8', (err, data) => { fs.readFile('input.txt', 'utf-8', (err, data) => {
if(err){ if(err){
console.log(err); console.log(err);
} }
else{ else{
console.log("Content present in input.txt file : " + data.toString()); console.log("Content present in input.txt file : " + data.toString());
} }
}); });
``` ```
O código acima lê um arquivo _input.txt_ do seu computador e retorna o conteúdo para o console. O código acima lê um arquivo _input.txt_ do seu computador e retorna o conteúdo para o console.
@ -55,15 +58,15 @@ O método `fs.writeFile()` aceita três argumentos - nome do arquivo, conteúdo
Código Node.js para gravar conteúdo em arquivo. Código Node.js para gravar conteúdo em arquivo.
```javascript ```javascript
const fs = require('fs'); const fs = require('fs');
fs.writeFile('output.txt', "New content added", (err, data) => { fs.writeFile('output.txt', "New content added", (err, data) => {
if(err){ if(err){
console.log(err); console.log(err);
} }
else{ else{
console.log("The file is saved"); console.log("The file is saved");
} }
}); });
``` ```
O código acima cria um arquivo _output.txt_ e adiciona conteúdo _Novo conteúdo adicionado_ a ele. O código acima cria um arquivo _output.txt_ e adiciona conteúdo _Novo conteúdo adicionado_ a ele.

View File

@ -1,5 +1,8 @@
##localeTitle: undefined ---
HTTP title: HTTP
localeTitle: HTTP
---
## HTTP
O Node.js tem um conjunto de módulos integrados que você pode usar sem qualquer instalação adicional. Da mesma forma, o **módulo HTTP** contém um conjunto de funções que são necessárias para transferir dados através do protocolo HTTP (Hyper Text Transfer Protocol). O Node.js tem um conjunto de módulos integrados que você pode usar sem qualquer instalação adicional. Da mesma forma, o **módulo HTTP** contém um conjunto de funções que são necessárias para transferir dados através do protocolo HTTP (Hyper Text Transfer Protocol).
@ -8,7 +11,7 @@ O módulo HTTP pode criar um servidor HTTP que ouve as portas do servidor e reto
Para incluir um módulo, use a função `require()` com o nome do módulo. Para incluir um módulo, use a função `require()` com o nome do módulo.
```javascript ```javascript
const http = require('http'); const http = require('http');
``` ```
## Node.js como um servidor da Web ## Node.js como um servidor da Web
@ -16,16 +19,16 @@ const http = require('http');
O método `createServer()` é usado para criar um servidor HTTP. O primeiro argumento do método `res.writeHead()` é o código de status, `200` significa que tudo está OK, o segundo argumento é um objeto que contém os cabeçalhos de resposta. O método `createServer()` é usado para criar um servidor HTTP. O primeiro argumento do método `res.writeHead()` é o código de status, `200` significa que tudo está OK, o segundo argumento é um objeto que contém os cabeçalhos de resposta.
```javascript ```javascript
const http = require('http'); const http = require('http');
//create a server object: //create a server object:
http.createServer((req, res) => { http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello World!'); //write a response to the client res.write('Hello World!'); //write a response to the client
res.end(); //end the response res.end(); //end the response
}).listen(8000); //the server object listens on port 8000 }).listen(8000); //the server object listens on port 8000
console.log("Server is listening on port no : 8000"); console.log("Server is listening on port no : 8000");
``` ```
### Etapas para execução: ### Etapas para execução:

View File

@ -1,5 +1,8 @@
# localeTitle: undefined ---
Rroteador ect para iniciantes title: React Router
localeTitle: React Router
---
# React Router ect para iniciantes
# Instalação # Instalação
@ -22,7 +25,7 @@ Para o nosso projeto, vamos supor que o site será apoiado por um servidor dinâ
# Declaração de Importação # Declaração de Importação
```javascript ```javascript
import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
``` ```
## IndexRoute e links ## IndexRoute e links
@ -36,11 +39,11 @@ Dos docs:
A principal maneira de permitir que os usuários naveguem pelo seu aplicativo. irá renderizar uma tag âncora totalmente acessível com a href apropriada. Para fazer isso, vamos primeiro criar um componente Nav. Nosso componente Nav conterá componentes `<Link>` , e ficará assim: A principal maneira de permitir que os usuários naveguem pelo seu aplicativo. irá renderizar uma tag âncora totalmente acessível com a href apropriada. Para fazer isso, vamos primeiro criar um componente Nav. Nosso componente Nav conterá componentes `<Link>` , e ficará assim:
```javascript ```javascript
const Nav = () => ( const Nav = () => (
<div> <div>
<Link to='/'>Home</Link>&nbsp; <Link to='/'>Home</Link>&nbsp;
<Link to='/address'>Address</Link> <Link to='/address'>Address</Link>
</div> </div>
) )
``` ```

Some files were not shown because too many files have changed in this diff Show More