افراد نابینا چگونه کدنویسی میکنند؟
نگران Angular 3 نباشید
in Angular 1.x we had this:
- Angular 1.0 - major version
- Angular 1.1 - major version (well, more a preview of Angular 1.2)
- Angular 1.2 - major version
- Angular 1.3 - major version (dropped IE8 support)
- Angular 1.4 - major version
- Angular 1.5 - major version
In “Angular 2”, you’re looking at this:
- Angular 2 - major version
- Angular 3 - major version
- Angular 4 - major version
- Angular 5 - major version
- Angular 6 - major version
- Angular 7 - major version
دوره 13 ساعته زبان Rust
Learn Rust Programming - Complete Course 🦀
In this comprehensive Rust course for beginners, you will learn about the core concepts of the language and underlying mechanisms in theory.
⭐️ Contents ⭐️
00:00:00 Introduction & Learning Resources
00:06:19 Variables
00:27:07 Numbers & Binary System
01:09:51 Chars, Bools & Unit Types
01:17:55 Statements & Expressions
01:24:50 Functions
01:32:53 Ownership
02:24:06 Borrowing
02:47:45 String vs. &str
03:17:59 Slices
03:31:35 Tuples
03:40:04 Structs
04:02:52 Enums
04:13:46 The "Option" Enum
04:21:32 Flow Control
04:44:43 Pattern Match
05:16:42 Methods & Associated Functions
05:31:50 Generics
06:06:32 Traits
06:47:15 Trait Objects
07:09:51 Associated Types
07:39:31 String
07:59:52 Vectors
08:29:00 HashMaps
08:52:45 Type Coercion
09:04:54 From & Into
09:36:03 panic!
09:44:56 Result
10:28:23 Cargo, Crates & Modules
11:08:28 Debug & Display
11:30:13 Lifetimes
12:14:46 Lifetime Elision
12:38:53 Closures
13:30:08 Iterators
در اینجا امکان قرار دادن یک مجموعهی کامل از ردیفها و ستونها، داخل یک ستون از پیش موجود نیز وجود دارد. برای اینکار ابتدا یک row جدید را داخل یک ستون موجود ایجاد میکنیم. با اینکار بلافاصله دسترسی به گرید 12 ستونهی بوت استرپ را داخل آن ستون خواهیم داشت؛ به همراه تمام کلاسهایی که تاکنون آنها را بررسی کردیم.
یک مثال: ایجاد ستونهای تو در تو
<head> <style> img { width: 100%; height: 200px; max-height: 200px; } </style> </head> <body> <div class="container" id="services"> <div class="row"> <section class="col-sm-8"> <img src="images/image.png" alt="sample image"> <h4>Exotic Pets</h4> <p>We offer <strong>specialized</strong> care for <em>reptiles, rodents, birds,</em> and other exotic pets.</p> </section> <section class="col-sm-4"> <div class="row no-gutters"> <div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 1</p> </div> <div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 2</p> </div> <div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 3</p> </div> <div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 4</p> </div> <div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 5</p> </div> <div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 6</p> </div> </div> </section> </div> </div> </body>
و با اندازهی صفحهی بزرگتر از sm:
توضیحات:
تعریف گرید تو در تو را در داخل دومین section تعریف شده، در کدهای فوق مشاهده میکنید:
<body> <div class="container" id="services"> <div class="row"> <section class="col-sm-8"> </section> <section class="col-sm-4"> <div class="row no-gutters"> </div> </section> </div> </div> </body>
به صورت پیشفرض در بین ستونها، یک فاصلهی 15px پیشفرض وجود دارد که به آن Gutter نیز گفته میشود. برای عدم نمایش و اعمال آن میتوان از کلاس no-gutters استفاده کرد. به همین جهت در تصویر دوم، ستونهای تعریف شده به هم چسبیدهاند.
سپس هر ستون داخل این ردیف را به صورت زیر تعریف کردهایم:
<div class="col-2 col-sm-4"> <img src="images/image.png" class="img-thumbnail" alt="sample image"> <p>Image 1</p> </div>
امکان تغییر ترتیب نمایش ستونهای گرید بوت استرپ 4
امکان تغییر ترتیب نمایش ستونهای گرید، در بوت استرپ 4 پیش بینی شدهاست و این مورد نیز بر اساس break-pointهای مختلف، قابل تنظیم است که فرمول کلاسهای آنرا در ذیل مشاهده میکنید:
در اینجا ذکر break-point اختیاری است و عدد ord بین یک تا 12 تغییر میکند.
یک مثال: تغییر ترتیب نمایش ستونهای گرید
<head> <style> img { width: 100%; height: 200px; max-height: 200px; } </style> </head> <body> <div class="container" id="services"> <h2>Flex Order</h2> <div class="row"> <section class="col order-2 d-flex flex-column"> <img src="images/image.png" class="order-2" alt="sample image"> <h4>1. Exotic Pets</h4> <p>We offer <strong>specialized</strong> care for <em>reptiles, rodents, birds,</em> and other exotic pets.</p> </section> <section class="col order-1"> <img src="images/image.png" alt="sample image"> <h4>2. Grooming</h4> <p>Our therapeutic <span class="font-weight-bold">grooming</span> treatments help battle fleas, allergic dermatitis, and other challenging skin conditions.</p> </section> <section class="col order-3"> <img src="images/image.png" alt="sample image"> <h4>3. General Health</h4> <p>Wellness and senior exams, ultrasound, x-ray, and dental cleanings are just a few of our general health services.</p> </section> </div> </div> </body>
در این مثال توسط کلاس order، مکان ستونها را تغییر داده و اولین ستون را در مکان دوم، دومی را در مکان اول و سومی را در همان مکان خودش نمایش دادهایم. باید دقت داشت که در حین تعریف کلاس order بهتر است برای تمام ستونها این ترتیب را تعریف کرد تا با نتایج ناخواستهای مواجه نشویم.
همچنین کلاس order را به سایر المانهای صفحه نیز میتوان اعمال کرد. برای مثال در تصویر فوق، در ستون دوم نمایش داده شده، متن در بالا و تصویر در پایین قرار گرفتهاست. اینکار را با تبدیل این ستون به یک flex column با افزودن کلاسهای d-flex flex-column انجام دادهایم. سپس با اعمال کلاس order-2 به تصویر، این تصویر ذیل متن نمایش داده شدهاست.
یکی از کاربردهای تغییر ترتیب نمایش ستونها در دنیای واقعی، افزودن break-point به آنها (مطابق فرمول یاد شده) و سپس نمایش منوها، پیش از محتویات صفحه در اندازههای کوچکتر صفحه است. برای مثال اگر در حالت عادی، منوهای کنار صفحه نمایش داده میشوند و در ستون سوم قرار گرفتهاند، شاید بخواهید در اندازهی نمایش موبایل، ترتیب نمایش این منوها بالاتر از متن صفحه باشد و در ابتدا قرارگیرد و نه در ترتیب سوم.
امکان تغییر تراز ستونهای گرید بوت استرپ 4
چون طراحی گرید بوت استرپ 4 مبتنی بر Flexbox است، کلاسهای قابل توجهی از آن جهت غنی سازی این سیستم طرحبندی قابل استفاده هستند:
- برای تغییر تراز عمودی ستونها، کلاس align-items-ALN را میتوان به «ردیفها» اعمال کرد. در اینجا ALN یکی از مقادیر start ،center و end را میتواند داشته باشد.
- برای تغییر تراز خود ستونها، کلاس align-self-ALN را میتوان به «ستونها» اعمال کرد. در اینجا نیز ALN یکی از مقادیر start ،center و end را میتواند داشته باشد.
- برای تغییر تراز افقی ستونها، کلاس justify-content-ALN را میتوان به «ردیفها» اعمال کرد. البته ذکر عرض ستونها در این حالت الزامی است. در اینجا ALN یکی از مقادیر start ،center ،around ،between و end را میتواند داشته باشد.
مثال: بررسی روش تغییر تراز ستونها
<head> <style> img { width: 100%; height: 100px; max-height: 100px; } </style> </head> <body> <div class="container" id="services"> <div class="row bg-info align-items-center" style="height: 100vh;"> <div class="col"> <div class="row"> <section class="col"> <img src="images/image.png" alt="sample image"> <h4>Exotic Pets</h4> <p>We offer specialized care for reptiles, rodents, birds, and other exotic pets.</p> </section> <section class="col"> <img src="images/image.png" alt="sample image"> <h4>Grooming</h4> <p>Our therapeutic grooming treatments help battle fleas, allergic dermatitis, and other challenging skin conditions.</p> </section> <section class="col"> <img src="images/image.png" alt="sample image"> <h4>General Health</h4> <p>Wellness and senior exams, ultrasound, x-ray, and dental cleanings.</p> </section> </div> </div> </div> <div class="row bg-success" style="height: 100vh;"> <section class="col"> <img src="images/image.png" alt="sample image"> <h4>Exotic Pets</h4> <p>We offer specialized care for reptiles, rodents, birds, and other exotic pets.</p> </section> <section class="col align-self-center"> <img src="images/image.png" alt="sample image"> <h4>Grooming</h4> <p>Our therapeutic grooming treatments help battle fleas, allergic dermatitis, and other challenging skin conditions.</p> </section> <section class="col align-self-end"> <img src="images/image.png" alt="sample image"> <h4>General Health</h4> <p>Wellness and senior exams, ultrasound, x-ray, and dental cleanings.</p> </section> </div> <div class="row bg-warning justify-content-center" style="height: 100vh;"> <section class="col-4"> <img src="images/image.png" alt="sample image"> <h4>Exotic Pets</h4> <p>We offer specialized care for reptiles, rodents, birds, and other exotic pets.</p> </section> <section class="col-4"> <img src="images/image.png" alt="sample image"> <h4>Grooming</h4> <p>Our therapeutic grooming treatments help battle fleas, allergic dermatitis, and other challenging skin conditions.</p> </section> </div> </div><!-- container --> </body>
در اینجا برای هر ردیف یک height: 100vh درنظر گرفته شدهاست تا کل ارتفاع view-port را پر کند و همچنین برای هر ردیف نیز یک رنگ پس زمینه درنظر گرفتهایم تا تغییر ترازها، مشخصتر باشند.
ابتدا داخل container چنین تعریفی را مشاهده میکنید:
<div class="row bg-info align-items-center" style="height: 100vh;"> <div class="col"> <div class="row"> <section class="col">
وجود row و col بعدی که داخل col اصلی تعریف شدهاست، سبب میشوند تا تمام آیتمها در یک سطر و در یک تراز افقی نمایش داده شوند. اگر این row و col دوم را حذف کنیم، هر آیتم نسبت به محتوای آن در میانهی صفحه قرار میگیرد و یکی بالاتر و دیگری پایینتر نمایش داده خواهند شد.
سپس در ردیف بعدی، کلاسهای align-self-center و align-self-end را بر روی ستونها آزمایش کردهایم:
و در آخر تاثیر اعمال justify-content-center را بر روی یک ردیف مشاهده میکنید:
همانطور که مشاهده میکنید، این کلاسهای Flexbox، کار با ستونهای بوت استرپ را بسیار انعطاف پذیر کردهاند.
روشهای دیگری برای تعیین محل قرارگیری ستونهای بوت استرپ 4
علاوه بر روشهایی که تاکنون آنها را بررسی کردیم، کلاسهای دیگری نیز برای تعیین محل قرارگیری ستونهای بوت استرپ تدارک دیده شدهاند:
- کلاسهای تعیین محل ستونها: fixed-top, fixed-bottom, sticky-top
fixed-top: ستون را در بالای صفحه قرار میدهد.
fixed-bottom: ستون و المان را در پایین صفحه قرار میدهد.
sticky-top: ستون و المان را در بالای صفحه قرار میدهد و با اسکرول صفحه به پایین، باز هم این المان در همان بالای صفحه قابل مشاهدهاست.
- کلاسهای نمایشی برای شبیه سازی ویژگیهای CSS:
این کلاسها با d شروع میشوند؛ به همراه یک break-point اختیاری که هدف آنها در اختیار گذاشتن توانمندیهای نمایشی CSS در بوت استرپ است.
برای مثال کلاس d-md-none به این معنا است که پس از رد شدن از اندازهی md، این المان دیگر نمایش داده نخواهد شد.
- کلاسهای container مقدماتی Flex:
این کلاسها که موارد داخل پرانتز آنها اختیاری است، المان را تبدیل به یک المان Flexbox میکنند. حالت نمایشی پیشفرض آنها block است؛ اما اگر نیاز بود میتوان آنها را تبدیل به in-line نیز کرد.
یک مثال: بررسی روشهای متفاوت تعیین محل قرارگیری المانها
اگر کلاس fixed-bottom را به المانی انتساب دهیم:
<div class="container bg-success"> <div class="bg-info fixed-bottom"> <div class="item">Exotic Pets</div> <div class="item">Grooming</div> <div class="item">Health</div> </div>
کلاس fixed-top نیز چنین کاری را انجام میدهد، فقط المان را بجای پایین صفحه، در بالای صفحه به صورت ثابت نمایش خواهد داد.
در اینجا اگر کلاس sticky-top را اعمال کنیم، هرچند شبیه به fixed-top عمل میکند، اما با container تراز است:
تاثیر کلاسهای flex را در قسمت بعدی به تفصیل بررسی خواهیم کرد.
کدهای کامل این قسمت را از اینجا میتوانید دریافت کنید: Bootstrap4_05.zip
ارتقاء از Gulp 3 به 4
روش امن نگهداری پسورد کاربران
/* * Password Hashing With PBKDF2 (http://crackstation.net/hashing-security.htm). * Copyright (c) 2013, Taylor Hornby * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Text; using System.Security.Cryptography; namespace PasswordHash { /// <summary> /// Salted password hashing with PBKDF2-SHA1. /// Author: havoc AT defuse.ca /// www: http://crackstation.net/hashing-security.htm /// Compatibility: .NET 3.0 and later. /// </summary> public class PasswordHash { // The following constants may be changed without breaking existing hashes. public const int SALT_BYTE_SIZE = 24; public const int HASH_BYTE_SIZE = 24; public const int PBKDF2_ITERATIONS = 1000; public const int ITERATION_INDEX = 0; public const int SALT_INDEX = 1; public const int PBKDF2_INDEX = 2; /// <summary> /// Creates a salted PBKDF2 hash of the password. /// </summary> /// <param name="password">The password to hash.</param> /// <returns>The hash of the password.</returns> public static string CreateHash(string password) { // Generate a random salt RNGCryptoServiceProvider csprng = new RNGCryptoServiceProvider(); byte[] salt = new byte[SALT_BYTE_SIZE]; csprng.GetBytes(salt); // Hash the password and encode the parameters byte[] hash = PBKDF2(password, salt, PBKDF2_ITERATIONS, HASH_BYTE_SIZE); return PBKDF2_ITERATIONS + ":" + Convert.ToBase64String(salt) + ":" + Convert.ToBase64String(hash); } /// <summary> /// Validates a password given a hash of the correct one. /// </summary> /// <param name="password">The password to check.</param> /// <param name="correctHash">A hash of the correct password.</param> /// <returns>True if the password is correct. False otherwise.</returns> public static bool ValidatePassword(string password, string correctHash) { // Extract the parameters from the hash char[] delimiter = { ':' }; string[] split = correctHash.Split(delimiter); int iterations = Int32.Parse(split[ITERATION_INDEX]); byte[] salt = Convert.FromBase64String(split[SALT_INDEX]); byte[] hash = Convert.FromBase64String(split[PBKDF2_INDEX]); byte[] testHash = PBKDF2(password, salt, iterations, hash.Length); return SlowEquals(hash, testHash); } /// <summary> /// Compares two byte arrays in length-constant time. This comparison /// method is used so that password hashes cannot be extracted from /// on-line systems using a timing attack and then attacked off-line. /// </summary> /// <param name="a">The first byte array.</param> /// <param name="b">The second byte array.</param> /// <returns>True if both byte arrays are equal. False otherwise.</returns> private static bool SlowEquals(byte[] a, byte[] b) { uint diff = (uint)a.Length ^ (uint)b.Length; for (int i = 0; i < a.Length && i < b.Length; i++) diff |= (uint)(a[i] ^ b[i]); return diff == 0; } /// <summary> /// Computes the PBKDF2-SHA1 hash of a password. /// </summary> /// <param name="password">The password to hash.</param> /// <param name="salt">The salt.</param> /// <param name="iterations">The PBKDF2 iteration count.</param> /// <param name="outputBytes">The length of the hash to generate, in bytes.</param> /// <returns>A hash of the password.</returns> private static byte[] PBKDF2(string password, byte[] salt, int iterations, int outputBytes) { Rfc2898DeriveBytes pbkdf2 = new Rfc2898DeriveBytes(password, salt); pbkdf2.IterationCount = iterations; return pbkdf2.GetBytes(outputBytes); } } }
Oracle Blockchain Cloud Service is a new offering that is part of Oracle’s comprehensive platform-as-a service (PaaS) portfolio. Delivered by the world’s most scalable, distributed transaction processing platform provider, Oracle Blockchain Cloud Service is the most comprehensive distributed ledger cloud platform