Git Product home page Git Product logo

til's People

Contributors

nghoapc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

til's Issues

Use 16 384 instead of 16 000

Why?

Selected powers of two(Hằng đẳng thức đáng nhớ)

  • \Large b^2 = 256:
    The number of values represented by the 8 bits in a byte.
  • \Large b^2 = 1 024:
    The binary approximation of the kilo-, or 1,000 multiplier, which causes a change of prefix. For example: 1024 bytes = 1 kilobyte.
    This number has no special significance to computers, but is important to humans because we make use of powers of ten.
  • \Large b^2 = 4 096:
    The hardware page size of an Intel x86-compatible processor.
  • \Large b^2 = 32 768:
    The number of non-negative values for a signed 16-bit integer.
  • ......

So?

  • You need to partition your hard drive:
    200Mb? No. Use 256Mb
  • You need define your password:
    123123123? No. Use 18446​744​073​709​551​616

Ref:

A service that inherit from BaseService should implement method call

Why?

  • Adding Syntactic Sugar to Make Rails Service Objects Suck Less
  • If only there were precedence in Ruby for calling something and having it execute itself immediately with the given parameters… oh wait, there is! It’s Proc#call

What's Proc#call ?

  • Invokes the block, setting the block's parameters to the values in params using something close to method calling semantics. Returns the value of the last expression evaluated in the block.
  • Note that proc.() invokes proc.call() with the parameters given. It's syntactic sugar to hide “call”.
  • For procs created using lambda or -> () an error is generated if the wrong number of parameters are passed to the proc. For procs created using Proc.new or Kernel.proc, extra parameters are silently discarded and missing parameters are set to nil.

Ref:

Ruby's Eigenclass
Rails Service Objects: A Comprehensive Guide
Proc#call

Debian "stretch" was removed then image ruby 2.5.3 apt get error 404 while updating

  • Issue while building docker image with ruby:2.5.3:
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found
deb http://archive.debian.org/debian stretch main
deb http://archive.debian.org/debian-archive/debian-security stretch/updates main

Then:

FROM ruby:2.5.3 AS builder
COPY etc/apt/archive_sources.list /etc/apt/sources.list

Quintillion

1 quintillion is equal to 1000000000 billions

LGTM

Loods good to me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.