Installing Docker in Ubuntu
Installing Docker in UbuntuDocker (https://www.docker.com/) is an open-source technology that allows for applications to be packaged into ‘containers’ which include any required libraries and other dependencies. This makes it very easy to deploy applications (especially for large enterprises who need to setup their workstations), and you can run more applications on the same amount of hardware (as containers use less resources than virtual machines hosting the applications), among other benef...
Leetcode - 12. Integer to Roman
DescriptionSeven different symbols represent Roman numerals with the following values: Symbol ValueI 1V 5X 10L 50C 100D 500M 1000Roman numerals are formed by appending the conversions of decimal place values from highest to lowest. Converting a decimal place value into a Roman numeral has the following rules: If the value does not start with 4 or 9, select the symbol of the maximal value that can be subtracted from the input, append that symbol to the result, subtract...
Network layer
Network layerThe network layer is responsible for delivering packets from the source host to the destination host across multiple networks. Its main functions include logical addressing, routing, forwarding, and error handling. It also supports different service models such as virtual circuit and datagram service. Network ServicesVirtual Circuit vs Datagram Service Virtual Circuit: A pre-established path between source and destination. It provides reliability and order but requires setup over...
Leetcode - 10. Regular Expression Matching
DescriptionGiven an input string s and a pattern p, implement regular expression matching with support for ‘.’ and ‘*’ where: ‘.’ Matches any single character.‘*’ Matches zero or more of the preceding element.The matching should cover the entire input string (not partial). Example 1:123Input: s = "aa", p = "a"Output: falseExplanation: "a" does not match the entire string "aa".Example 2:123Input: s = "aa", p = "a*"Output: trueExpl...
Leetcode - 9. Palindrome Number
DescriptionGiven an integer x, return true if x is a palindrome, and false otherwise. Example 1:123Input: x = 121Output: trueExplanation: 121 reads as 121 from left to right and from right to left.Example 2:123Input: x = -121Output: falseExplanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.Example 3:123Input: x = 10Output: falseExplanation: Reads 01 from right to left. Therefore it is not a palindrome. 123Constraints:-231 <= ...
large language model
ReferencesDive Into Deep Learning Create Environmentuse conda or miniconda123conda env remove d2l-zhconda create -n d2l-zh -y python=3.8 pipconda activate d2l-zh install dependencies1pip install jupyter d2l torch torchvision download d2l-zh.zip123wget http://zh-v2.d2l.ai/d2l-zh.zipunzip d2l-zh.zipjupyter notebook
Leetcode - 7. Reverse Integer
DescriptionGiven a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-2^31, 2^31 - 1], then return 0. Example 1: 12Input: x = 123Output: 321 Example 2: 12Input: x = -123Output: -321 Example 3: 12Input: x = 120Output: 21 Example 4: 12Input: x = 0Output: 0 Constraints: -2^31 <= x <= 2^31 - 1 Approach1234567891011121314151617class Solution: def reverse(self, x: int) -> int: sign = -1 if ...
Leetcode - 8. String to Integer (atoi)
DescriptionImplement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. The algorithm for myAtoi(string s) is as follows: Whitespace: Ignore any leading whitespace (“ “). Signedness: Determine the sign by checking if the next character is ‘-‘ or ‘+’, assuming positivity if neither present. Conversion: Read the integer by skipping leading zeros until a non-digit character is encountered or the end of the string is reached. If no digits were read, then the resul...
Leetcode - 11. Container With Most Water
DescriptionYou are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a container can store. Notice that you may not slant the container. Example 1:123Input: height = [1,8,6,2,5,4,8,3,7]Output: 49Explanation: The above vertical lines are represented ...
large language model
Large Language ModelDefinitionA large language model is a machine learning model that is trained on a large corpus of text data, such as Wikipedia or the Web. These models can generate high-quality text that is similar to the training data, but can also generate text that is not present in the training data. History < 1990s: IBM’s statistical language model (SLM) 1990s-2000s: Neural language models (NLLMs) 2001s: n-gram model 2010s: GPT-2, GPT-3 Dataset PreprocessingTokenizationSplitting ...







