Tutorial by Examples: ad

JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/ HTML <div class="box_shadow"></div> CSS .box_shadow { -webkit-box-shadow: 0px 0px 10px -1px #444444; -moz-box-shadow: 0px 0px 10px -1px #444444; box-shadow: 0px 0px 10px -1px #444444; }
HTML <div class="box_shadow"></div> CSS .box_shadow { background-color: #1C90F3; width: 200px; height: 100px; margin: 50px; -webkit-box-shadow: inset 0px 0px 10px 0px #444444; -moz-box-shadow: inset 0px 0px 10px 0px #444444; box-shadow: inse...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/2/ HTML <div class="box_shadow"></div> CSS .box_shadow { background-color: #1C90F3; width: 200px; height: 100px; margin: 50px; } .box_shadow:after { content: ""; width: 190px; height: ...
Trailing spaces \s*$: This will match any (*) whitespace (\s) at the end ($) of the text Leading spaces ^\s*: This will match any (*) whitespace (\s) at the beginning (^) of the text Remarks \s is a common metacharacter for several RegExp engines, and is meant to capture whitespace characters (...
Running $ pip install --upgrade SomePackage will upgrade package SomePackage and all its dependencies. Also, pip automatically removes older version of the package before upgrade. To upgrade pip itself, do $ pip install --upgrade pip on Unix or $ python -m pip install --upgrade pip on ...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/5/ HTML <div class="box_shadow"></div> CSS .box_shadow { width: 100px; height: 100px; margin: 100px; box-shadow: -52px -52px 0px 0px #f65314, 52px -52px 0px 0px #7cbb00, -52px 52px 0px 0px #00...
So let's suppose you want to iterate only between some specific lines of a file You can make use of itertools for that import itertools with open('myfile.txt', 'r') as f: for line in itertools.islice(f, 12, 30): # do something here This will read through the lines 13 to 20 as i...
public void iterateAndFilter() throws IOException { Path dir = Paths.get("C:/foo/bar"); PathMatcher imageFileMatcher = FileSystems.getDefault().getPathMatcher( "regex:.*(?i:jpg|jpeg|png|gif|bmp|jpe|jfif)"); try (Direc...
class UsersController < ApplicationController def index hashmap_or_array = [{ name: "foo", email: "[email protected]" }] respond_to do |format| format.html { render html: "Hello World" } format.json { render json: hashmap_or_array } en...
resources :photos do member do get 'preview' end collection do get 'dashboard' end end This creates the following routes in addition to default 7 RESTful routes: get '/photos/:id/preview', to: 'photos#preview' get '/photos/dashboards', to: '...
Rails files - and Ruby files in general - should be named with lower_snake_case filenames. E.g. app/controllers/application_controller.rb is the file that contains the ApplicationController class definition. Note that while PascalCase is used for class and module names, the files in which they r...
View jsFiddle: https://jsfiddle.net/HimmatChahal/jb5trg67/ Copy + Pasteable code below: <html> <body> <h1>This will fade in at 60 frames per second (or as close to possible as your hardware allows)</h1> <script> // Fad...
int *ptr = nullptr; *ptr = 1; // Undefined behavior This is undefined behavior, because a null pointer does not point to any valid object, so there is no object at *ptr to write to. Although this most often causes a segmentation fault, it is undefined and anything can happen.
with pd.ExcelFile('path_to_file.xls) as xl: d = {sheet_name: xl.parse(sheet_name) for sheet_name in xl.sheet_names}
pd.read_excel('path_to_file.xls', sheetname='Sheet1') There are many parsing options for read_excel (similar to the options in read_csv. pd.read_excel('path_to_file.xls', sheetname='Sheet1', header=[0, 1, 2], skiprows=3, index_col=0) # etc.
If no ordering function is passed, std::sort will order the elements by calling operator< on pairs of elements, which must return a type contextually convertible to bool (or just bool). Basic types (integers, floats, pointers etc) have already build in comparison operators. We can overload this ...
To add a new unique column email to users, run the following command: rails generate migration AddEmailToUsers email:string:uniq This will create the following migration: class AddEmailToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :email, :string add_index...
df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) print(df) # Output: # A B # 0 1 4 # 1 2 5 # 2 3 6 Directly assign df['C'] = [7, 8, 9] print(df) # Output: # A B C # 0 1 4 7 # 1 2 5 8 # 2 3 6 9 Add a constant column df['C'] = 1 print(df) # Ou...
Sometimes, programmers who are new Java will use primitive types and wrappers interchangeably. This can lead to problems. Consider this example: public class MyRecord { public int a, b; public Integer c, d; } ... MyRecord record = new MyRecord(); record.a = 1; // OK ...
This tutorial explains how to download Image using AsyncTask in Android. The example below download image while showing progress bar while during download. Understanding Android AsyncTask Async task enables you to implement MultiThreading without get Hands dirty into threads. AsyncTask enables pro...

Page 18 of 114