Today, I solved the Number of 1 Bits from Leetcode. Description: In this question, we are gonna work on changing the binary number to decimal numbers. There are two methods to solve this problem in Python: Solution1: The first solution, we are gonna divide the number to see the first bit is 1 or 0. For example, 17 is 10001. 10001 % 2 = 1 Now, keep moving to the right! 1000 % 2 = 0 100 % 2 = 0 10..
This is the SELECT & DELETE commands in postgresql. Show the list of tables and owner. \d See the data of table. SELECT * FROM (table name); Delete a row with condition. DELETE FROM (schema).(table name) WHERE (table name).(column) = '(value)';
Today I soled the "Sum of Two Integers" Description: This question ask us how to get sum of the two integers without using sign "+" and "-." In example 2, a is 2 => 10 b is 3 => 11 a+b: 10 + 11 ----- 101 (which is 5) In binary number, 1 + 1 makes the carry "1" to the next slot. For carry "1", we are gonna use & a & b: 10 & 11 ----- 100(so move to left
Today, I learned about the URL Redirection in PHP. Manual redirect The simpest technique is to ask the visitor to follow a link to the new page, usually using an HTML anchor like: Please follow this link Using server-side scripting for redirection One can use the "header" function: header("HTTP/1.1 301 Moved Permanetly"); header("Location: https://www.example.com/"); exit(); Header() Example:
Today, I learned about the Session and header. Session A Session starts when you launch a website or web app and ends when you leave the website or close your browser window. Session allows you to maintain state information even when cllients disable cookies in their Web browsers. Session cookies contain information that is stored in a temporary memony location Session is known as transient cook..
I made login and sign up page using PHP and MySQL. I skip the entire html code this time. Here is the method to pass the data to php files. Let's take a look at Sign up system first. Sign up I checked the email and password confirm first. For connecting this php file to our database we use the code: require_once("config.php"); So, we call the config.php for connecting current php file to databas..
Today, I learned about the CSMA collisions, "Taking turns" MAC protocols and Cable Internet. Compared to ALOHA, CSMA is more polite protocol algorithm. CSMA: Carrier Sense Multiple access CSMA: listen before transmit: If channel sensed idle: transmit entire frame. If channel sensed busy, defer transmission. In human analogy, "don't interrupt others!" Collision can still occur: Due to propagation..
Check the ubuntu server address and should have "~.pem" file Move to the library have .pem file Using file to enter Ubuntu server hosting on AWS. ssh -i "~.pem" ubuntu@(IP address) Enter Postgresql sudo -u (user) psql See the table [(user)=# \d Also, if you need to revise specific folder and using git. You need to move to the library. cd /var/www/html/ sudo git pull
Continue to previous review. An ideal multiple access protocol Given: broadcast channel of rate R bps Desiderata: When one node wants to transmit, it can send at rate R. When M nodes want to transmit, each can send at average rate R/M The protocol is fully decentralized: No special node to coordinate transmissions No synchronization of clocks, time slots No master node that represents a single p..