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 ...
Leetcode - 6. Zigzag Conversion
DescriptionThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) 123P A H NA P L S I I GY I R Write the code to convert a string to a zigzag pattern. You should do it in-place. Example 1: 12Input: s = "PAYPALISHIRING", numRows = 3Output: "PAHNAPLSIIGYIR" Example 2: 1234567Input: s = "PAYPALISHIRING", numRows = 4Output: "...
Leetcode - 6. Longest Palindromic Substring
DescriptionGiven a string s, return the longest palindromic substring in s. Example 1:123Input: s = "babad"Output: "bab"Explanation: "aba" is also a valid answer.Example 2:12Input: s = "cbbd"Output: "bb"1234Constraints:1 <= s.length <= 1000s consist of only digits and English letters. Approach: Expand Around Center1234567891011121314151617181920212223class Solution: def longestPalindrome(self, s: str) -> str: if not s or len...
Leetcode - 5. Median of Two Sorted Arrays
DescriptionGiven two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1:123Input: nums1 = [1,3], nums2 = [2]Output: 2.00000Explanation: merged array = [1,2,3] and median is 2.Example 2:123Input: nums1 = [1,2], nums2 = [3,4]Output: 2.50000Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5. 12345678Constraints:nums1.length == mnums2.length == n0 <= m <=...
Leetcode - 3. Longest Substring Without Repeating Characters
DescriptionGiven a string s, find the length of the longest substring without duplicate characters. Example 1:123Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3.Example 2:123Input: s = "bbbbb"Output: 1Explanation: The answer is "b", with the length of 1.Example 3:123Input: s = "pwwkew"Output: 3Explanation: The answer is "wke", with the length of 3.Notice that the answer must be a substring, “pwke”...
mininet
What is Mininet?Mininet is a lightweight network emulator that creates a virtual network with hosts, switches, links, and controllers all on a single machine. It’s widely used in Software-Defined Networking (SDN) research and education.mininet Key Features Lightweight and runs real code (like real Linux hosts) Allows fast prototyping of large networks Integrates well with OpenFlow and SDN controllers like POX, Ryu, and ONOS Installationmininet download Basic Concepts Host: virtual end device...
Leetcode - 2. Add Two Numbers
DescriptionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example 1:123Input: l1 = [2,4,3], l2 = [5,6,4]Output: [7,0,8]Explanation: 342 + 465 = 807. Example 2:12Input: l1 = [0], l2 = [0]Output: [0]Example 3:12Input: l1 = [9,9...
Leetcode - 1. Two Sum
DescriptionGiven an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1:123Input: nums = [2,7,11,15], target = 9Output: [0,1]Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].Example 2:12Input: nums = [3,2,4], target = 6Output: [1,2]Example 3:12Input: nums = [3,3], ...
Using Hexo to Build a Personal Blog
Build Your Own Blog with HexoThis guide walks you through the process of creating a personal blog using Hexo. It includes environment setup, Hexo installation, theme configuration, and running the site locally. 1. Install Development Environment (Node.js)Download and install the LTS version of Node.js from the official website: 🔗 https://nodejs.org/en 2. Install Hexo and Initialize BlogRun the following commands in your terminal: 12345npm install -g hexo-cli # Install Hexo CLI glo...
Queue
QueueQueue is a linear data structure that follows the First In First Out (FIFO) principle. Elements are added at the rear (enqueue) and removed from the front (dequeue). Circular QueueA circular queue is a linear data structure that follows the FIFO principle but connects the end of the queue back to the front, forming a circle. This allows for efficient use of space by reusing empty slots created by dequeued elements. 1234567891011121314151617181920212223242526public class CircularQueue ...









