GVKun编程网logo

COEN 146: Computer Networks

1

在本文中,我们将带你了解COEN146:ComputerNetworks在这篇文章中,同时我们还将给您一些技巧,以帮助您实现更有效的146-删除链表倒数N个节点、146.LRUCache、146.LR

在本文中,我们将带你了解COEN 146: Computer Networks在这篇文章中,同时我们还将给您一些技巧,以帮助您实现更有效的146 - 删除链表倒数 N 个节点、146. LRU Cache、146. LRU缓存机制、Android 中 146 种颜色对应的 xml 色值

本文目录一览:

COEN 146: Computer Networks

COEN 146: Computer Networks

COEN 146: Computer Networks
Lab 3: TCP/IP Socket Programming

Objectives
1.To develop client/ server applications using TCP/IP Sockets
2.To write a C program to transfer file over TCP/IP Socket

TCP/IP Client/ Server[ http://beej.us/guide/bgnet/] 
The following figure shows the steps taken by each program:
On the client and server sides:

The socket() system call creates an unbound socket in a communications domain, and return a file descriptor that can be used in later function calls that operate on sockets.

int sockfd = socket(domain, type, protocol)
●sockfd: socket descriptor, an integer (like a file-handle)
●domain: integer, communication domain e.g., AF_INET (IPv4 protocol) , AF_INET6 (IPv6 protocol), AF_UNIX (local channel, similar to pipes)
●type: communication type
SOCK_STREAM: TCP (reliable, connection oriented)
SOCK_DGRAM: UDP (unreliable, connectionless)
SOCK_RAW (direct IP service)
●protocol: This is useful in cases where some families may have more than one protocol to support a given type of service. Protocol value for Internet Protocol (IP), which is 0. This is the same number which appears on protocol field in the IP header of a packet.

include <sys/socket.h>

...
...if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) 
{
    perror(“cannot create socket”); 
    return 0; 
}

On the server side:

After creation of the socket, bind() system call binds the socket to the address and port number specified in addr(custom data structure). In the example code, we bind the server to the localhost, hence we use INADDR_ANY to specify the IP address.

int bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen);
●addr: Points to a sockaddr structure containing the address to be bound to the socket. The length and format of the address depend on the address family of the socket.
●addrlen: Specifies the length of the sockaddr structure pointed to by the addr argument. 

The listen() function puts the server socket in a passive mode, where it waits for the client to approach the server to make a connection. 

int listen(int sockfd, int backlog);
●backlog: defines the maximum length to which the queue of pending connections for sockfd may grow. If a connection request arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED.

The accept() system call extracts the first connection request on the queue of pending connections for the listening socket (sockfd), creates a new connected socket, and returns a new file descriptor referring to that socket. At this point, connection is established between client and server, and they are ready to transfer data.

int new_socket= accept(int sockfd, struct sockaddr addr, socklen_t addrlen);

On the client side:

The connect() system call connects the socket referred to by the file descriptor sockfd to the address specified by addr. Server’s address and port is specified in addr.

int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);

Read and write over socket:

     bzero(buffer, 256);
     n = read(newsockfd, buffer, 255);
     if (n < 0) error("ERROR reading from socket");
     printf("Here is the message: %s\n", buffer);

This code initializes the buffer using the bzero() function, and then reads from the socket. 
Note that the read call uses the new file descriptor, the one returned by accept(), not the original file descriptor returned by socket(). 

Note also that the read() will block until there is something for it to read in the socket, i.e. after the client has executed a write(). It will read either the total number of characters in the socket or 255, whichever is less, and return the number of characters read

    n = write(newsockfd, "I got your message", 18);
         if (n < 0) error("ERROR writing to socket");

Once a connection has been established, both ends can both read and write to the connection. Naturally, everything written by the client will be read by the server, and everything written by the server will be read by the client. This code simply writes a short message to the client. The last argument of write is the size of the message.

Structures:

Address format
An IP socket address is defined as a combination of an IP interface address and a 16-bit port number. The basic IP protocol does not supply port numbers, they are implemented by higher level protocols like UDP and TCP. On raw sockets sin_port is set to the IP protocol.

struct sockaddr_in {
    sa_family_t    sin_family; / address family: AF_INET /
    in_port_t      sin_port;   / port in network byte order /
    struct in_addr sin_addr;   / internet address /
};

/ Internet address. /
struct in_addr {
    uint32_t       s_addr;     / address in network byte order /
};

This is defined in netinet/in.h

sin_family is always set to AF_INET. 

sin_port contains the port in network byte order. The port numbers below 1024 are called privileged ports (or sometimes: reserved ports). Only privileged processes) may bind to these sockets.

sin_addr is the IP host address. 

s_addr member of struct in_addr contains the host interface address in network byte order. 
in_addr should be assigned one of the INADDR_* values (e.g., INADDR_ANY) or set using the inet_aton, inet_addr, inet_makeaddr library functions or directly with the name resolver (see gethostbyname).

INADDR_ANY allows your program to work without knowing the IP address of the machine it was running on, or, in the case of a machine with multiple network interfaces, it allowed your server to receive packets destined to any of the interfaces. 

INADDR_ANY has the following semantics: When receiving, a socket bound to this address receives packets from all interfaces. For example, suppose that a host has interfaces 0, 1 and 2. If a UDP socket on this host is bound using INADDR_ANY and udp port 8000, then the socket will receive all packets for port 8000 that arrive on interfaces 0, 1, or 2. If a second socket attempts to Bind to port 8000 on interface 1, the Bind will fail since the first socket already “owns” that port/interface.
Example:
serv_addr.sin_addr.s_addr = htonl (INADDR_ANY);
●Note: "Network byte order" always means big endian. "Host byte order" depends on architecture of host. Depending on CPU, host byte order may be little endian, big endian or something else. 
●The htonl() function translates a long integer from host byte order to network byte order.

To bind socket with localhost, before you invoke the bind function, sin_addr.s_addr field of the sockaddr_in structure should be set properly. The proper value can be obtained either by 

my_sockaddress.sin_addr.s_addr = inet_addr("127.0.0.1")
or by 
my_sockaddress.sin_addr.s_addr=htonl(INADDR_LOOPBACK);
To convert an address in its standard text format into its numeric binary form use the inet_pton() function. The argument af specifies the family of the address. 

define _OPEN_SYS_SOCK_IPV6

include <arpa/inet.h>

int inet_pton(int af, const char src, void dst);

Recap - File transfer:
●Binary file: jpg, png, bmp, tiff etc.
●Text file: txt, html, xml, css, json etc.

You may use functions or system calls for file transfer. C Function connects the C code to file using I/O stream, while system call connects C code to file using file descriptor.
●File descriptor is integer that uniquely identifies an open file of the process.
●I/O stream sequence of bytes of data.

A Stream provides high level interface, while File descriptor provide a low-level interface. Streams are represented as FILE * object, while File descriptors are represented as objects of type int.

C Functions to open and close a binary/text file
fopen(): C Functions to open a binary/text file, defined as:
FILE fopen(const char file_name, const char *mode_of_operation);
where:
●file_name: file to open
●mode_of_operation: refers to the mode of the file access, For example:- r: read , w: write , a: append etc
●fopen() return a pointer to FILE if success, else NULL is returned
●fclose(): C Functions to close a binary/text file.

fclose(): C Functions to close a binary/text file, defined as:
fclose( FILE *file_name);
Where:
●file_name: file to close
●fclose () function returns zero on success, or EOF if there is an error

C Functions to read and write a binary file
fread(): C function to read binary file, defined as:
fread(void ptr, size_t size, size_t count, FILE stream);
where:
●ptr- it specifies the pointer to the block of memory with a size of at least (size*count) bytes to store the objects.
●size - it specifies the size of each objects in bytes.
●count: it specifies the number of elements, each one with a size of size bytes.
●stream - This is the pointer to a FILE object that specifies an input stream.
●Returns the number of items read

fwrite (): C function to write binary file, defined as:
fwrite (void ptr, size_t size, size_t count, FILE stream);
where:
●Returns number of items written
●*arguments of fwrite are similar to fread. Only difference is of read and write.

For example:
To open "lab3.dat" file in read mode then function would be:
FILE* demo; // demo is a pointer of type FILE
char buffer[100]; // block of memory (ptr)
demo= fopen("lab3.dat", "r"); // open lab3.dat in read mode
fread(&buffer, sizeof(buffer), 1, demo); // read 1 element of size = size of buffer (100)
fclose(demo); // close the file

C Functions to read and write the text file.
fscanf (): C function to read text file.
fscanf(FILE ptr, const char format, ...)
Where:
●Reads formatted input from the stream.
●Ptr: File from which data is read.
●format: format of data read.
●returns the number of input items successfully matched and assigned, zero if failure

fprintf(): C function to write a text file.
fprintf(FILE ptr, const char format, ...);
Where:
●*arguments similar to fscanf ()

For example:
FILE *demo; // demo is a pointer of type FILE
demo= FILE *fopen("lab3.dat", "r"); // open lab3.dat in read mode
/* Assuming that lab3.dat has content in below format
City
Population
….
*/
char buf[100]; // block of memory
fscanf(demo, "%s", buf); // to read a text file
fclose(demo); // close the file
*to read whole file use while loop

System Call to open, close, read and write a text/binary file.
open(): System call to open a binary/text file, defined as:
open (const char* Path, int flags [, int mode ]);
Where:
●returns file descriptor used on success and -1 upon failure
●Path :- path to file
●flags :- O_RDONLY: read only, O_WRONLY: write only, O_RDWR: read and write, O_CREAT: create file if it doesn’t exist, O_EXCL: prevent creation if it already exists

close(): System call to close a binary/text file, defined as:
close(int fd);
where:
●return 0 on success and -1 on error.
●fd : file descriptor which uniquely identifies an open file of the process

read(): System call to read a binary/text file.
read (int fd, void* buf, size_t len);
where:
●returns 0 on reaching end of file, -1 on error or on signal interrupt
●fd: file descriptor
●buf: buffer to read data from
●len: length of buffer

write(): System call to write a binary/text file.
write (int fd, void* buf, size_t len);
where:
●*arguments and return of write are similar to read(). 

For example:
int fd = open("lab3.dat", O_RDONLY | O_CREAT); //if file not in directory, file is 
created
Close(fd);

Implementation steps:
Step 1.[30%] Write a C program for a TCP server that accepts a client connection for file transfer. 
Step 2.[25%] Write a C program for a TCP client that connects to the server. In this case
a.The client connects to the server and request a file to download from the server. 
b.The server accepts the connection and transfers the file to the client

Step 3.Compile and run. Note: you may use the IP address 127.0.0.1 (loop back IP address) for a local host, i.e. both of your client and server run on the same machine. 

[20%] Demonstrate your program to the TA:
a.Your client and server on your same machine
b.Your client and your classmate’s server IP address. You may to discuss with the TA if you run into access problems  

Multiple Clients – Concurrent Server 
In general, a TCP server is designed as a concurrent server to server multiple clients. This means when a client sends a request for a file transfer, the sever accepts the connection request and spawns a thread to handle this transfer on the connection descriptor. The server will then continue in a loop listening for another client connection request to handle another file transfer.

Step 4.[20%] Write a C program for a concurrent TCP server that accepts and responds to multiple client connection requests, each requesting a file transfer. Modify your TCP server in Step 1 so that when the server accepts a connection from a client it spawns a separate thread to handle this specific client connection for file transfer. 

Note: You will have several threads (at the same time) running on the server transferring copies of src.dat files to clients that each will save at their destination as – dst.dat file (possibly needs to be numbered differently on the same host).

[5%] Demonstrate to the TA, multiple clients making file transfer request to the server and that the server makes multiple transfers at the same time. Make N = 5. Upload your source code to Camino. 

Note: To be able to see 5 threads handling connections at the same time, you may need to introduce a delay of a few second in the process of data transfer to make it visible. This is due to the fact completing thread file transfer takes a fraction of a millisecond if not a microsecond. 

Requirements to complete the lab
1.Demo to the TA correct execution of your programs [recall: a successful demo is 25% of the grade]
2.Submit the source code of your program as .c files on Camino

Please start each program with a descriptive block that includes minimally
WX:codinghelp

146 - 删除链表倒数 N 个节点

146 - 删除链表倒数 N 个节点

题目如下:
给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点。
给定一个链表: 1->2->3->4->5, 和 n = 2.

当删除了倒数第二个节点后,链表变为 1->2->3->5.

解题思路:
1、计算链表的长度,删除倒数第 n 个,就是删除倒数第 len% n 个节点
2、快慢指针均指向头结点,慢指针在头结点处不动,快指针向后走 n 个节点
3、如果此时快指针指向空,就是意味着要删除的是第一个结点,return head->next, 即完成删除操作
4、如果此时快指针不为空,那么快慢指针开始一起向后走,直到快指针到达最后一个节点位置,此时的慢指针指向的就是要删除结点的前驱结点了



ListNode *removeNthFromEnd(ListNode *head, int n)
{
   
   
    if (head == NULL || n <= 0)
        return head;

    ListNode *p = head;
	ListNode *q = head;
    int len = 0;//定义len记录链表的长度
    while (p != NULL)//计算链表的长度 
    {
   
   
        len++;
        p = p->next;
    }
    n = n % len;//求出最简n 
    p = head;//p回到头结点 
    while (p != NULL && n--)//p往后走n个结点
    {
   
   
        p = p->next;
    }
    if (p == NULL)//说明要删除的那个结点是第一个结点 
        return head->next;
    while (p->next != NULL)//p,q一起往后走
    {
   
   
        p = p->next;
        q = q->next;
    }
    q->next = q->next->next;//删除结点 
    return head;//返回头结点即返回新链表 
}

代码运行图如下:

146. LRU Cache

146. LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.

get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
put(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.

Follow up:
Could you do both operations in O(1) time complexity?

Example:

LRUCache cache = new LRUCache( 2 /* capacity */ );

cache.put(1, 1);
cache.put(2, 2);
cache.get(1);       // returns 1
cache.put(3, 3);    // evicts key 2
cache.get(2);       // returns -1 (not found)
cache.put(4, 4);    // evicts key 1
cache.get(1);       // returns -1 (not found)
cache.get(3);       // returns 3
cache.get(4);       // returns 4

package logger;

import java.util.HashMap;

public class LRUCache {
    private class Node{
        Node prev;
        Node next;
        int key;
        int value;

        public Node(int key, int value) {
            this.key = key;
            this.value = value;
            this.prev = null;
            this.next = null;
        }
    }

    private int capacity;
    private HashMap<Integer, Node> hs = new HashMap<Integer, Node>();
    private Node head = new Node(-1, -1);
    private Node tail = new Node(-1, -1);

    public LRUCache(int capacity) {
        this.capacity = capacity;
        tail.prev = head;
        head.next = tail;
    }

    public int get(int key) {
        if( !hs.containsKey(key)) {
            return -1;
        }

        // remove current
        Node current = hs.get(key);
        current.prev.next = current.next;
        current.next.prev = current.prev;

        // move current to tail
        move_to_tail(current);

        return hs.get(key).value;
    }

    public void set(int key, int value) {
        // this internal `get` method will update the key''s position in the linked list.
        if (get(key) != -1) { //get的时候已经调整好顺序了,一旦查的到就吧current放在后面了。
            hs.get(key).value = value;
            return;
        }

        if (hs.size() == capacity) {
            hs.remove(head.next.key);
            head.next = head.next.next;
            head.next.prev = head;
        }

        Node insert = new Node(key, value);
        hs.put(key, insert);
        move_to_tail(insert);
    }

    private void move_to_tail(Node current) {
        current.prev = tail.prev;
        tail.prev = current;
        current.prev.next = current;
        current.next = tail;
    }
}



146. LRU缓存机制

146. LRU缓存机制

题目描述

运用你所掌握的数据结构,设计和实现一个LRU (最近最少使用) 缓存机制。它应该支持以下操作: 获取数据 get 和 写入数据 put

  • 获取数据 get(key) - 如果密钥 (key) 存在于缓存中,则获取密钥的值(总是正数),否则返回 -1。
  • 写入数据 put(key, value) - 如果密钥不存在,则写入其数据值。当缓存容量达到上限时,它应该在写入新数据之前删除最近最少使用的数据值,从而为新的数据值留出空间。

进阶:

你是否可以在 O(1) 时间复杂度内完成这两种操作?

示例:

LRUCache cache = new LRUCache( 2 /* 缓存容量 */ );

cache.put(1, 1);
cache.put(2, 2);
cache.get(1);       // 返回  1
cache.put(3, 3);    // 该操作会使得密钥 2 作废
cache.get(2);       // 返回 -1 (未找到)
cache.put(4, 4);    // 该操作会使得密钥 1 作废
cache.get(1);       // 返回 -1 (未找到)
cache.get(3);       // 返回  3
cache.get(4);       // 返回  4

算法

这题的时间复杂度的好坏比较依赖于所选择的数据结构。

LRU是操作系统中提出的一种应用于页置换的算法,这里不过多介绍,举个实际例子即可知道本题要求实现的功能需要什么步骤:

想象有一个队列的最大允许空间为3,
依次入队的顺序为 2,3,2,1,2,4;求LRU算法下队列的演变过程。
---------------------------------------------------
- 队列初始为空,2进入后队列情况为:2
- 队列还有2个剩余位置,3进入后队列情况为:2 3
- 队列还有1个剩余位置,这次入队的数据为2,它本来就已在队列中,根据LRU算法,需要将2调到队列末尾,因此队列情况为:3 2
- 队列还有1个剩余位置,这次入队数据为1,入队后队列情况为:2 3 1
- 队列已经没有剩余位置,但是入队数据为2,它本来就在队列中,根据LRU算法,需要将2调到队列末尾,因此队列情况为:3 1 2
- 队列已经没有剩余位置,新进入的数据为4,根据LRU需要淘汰最近最少被使用的数据,即队首的数据3,更新后队列情况为:1 2 4
---------------------------------------------------
上面即为LRU算法的一个例子

选择hash表与双向链表作为实现主体功能的两个数据结构,主要是因为双向链表便于插入删除,而hash表可以较快查找到需要返回的value。具体一点,整个LRUCache可能长下面这样:

<img src="https://img2018.cnblogs.com/blog/1531067/201902/1531067-20190219224010735-78102573.jpg" height=70% width=70%>

代码

#include <iostream>
#include <list>
#include <unordered_map>
using namespace std;
struct listNode{
    int key, value;
    listNode *pre, *next;
    listNode(int _key, int _value): key(_key), value(_value)
    { 
        pre = next = NULL;
    }
};

class LRUCache {
public:
    // hash_table末端保存最近刚被使用的节点,前端保存最近最少被使用节点
    unordered_map<int, listNode*> hash_table;
    listNode *head, *tail;
    int cap, size;

    LRUCache(int capacity) {
        cap = capacity;
        size = 0;
        head = new listNode(-1, -1);
        tail = new listNode(-1, -1);
        head->next = tail;
        tail->pre = head;
    }
    
    int get(int key) {
        if (hash_table.find(key) == hash_table.end())
            return -1;
        else
        {
            // 记录该ID指向节点的指针
            listNode *tmp = hash_table[key];

            /*** 更改节点在表中的顺序 ***/

            // 1. 删除hash_table[key]
            delNode(tmp);
            // 2. 将hash_table[key]插入末尾
            pushNodeBack(tmp);

            return tmp->value;
        }
    }
    
    void put(int key, int value) {
        // 这个key本身保存在表中
        if (hash_table.find(key) != hash_table.end())
        {
            listNode *tmp = hash_table[key];
            // 从链表头部去掉这个点
            delNode(tmp);
            // 更新表中key对应链表节点的value
            tmp->value = value;
            // 从链表尾部插入这个点
            pushNodeBack(tmp);
            return;
        }
        // 链表的空间已满
        if (cap == size)
        {
            // 空间不够,踢出队列最前端的ID
            listNode *tmp = head->next;
            // 在表中删除这个点
            hash_table.erase(tmp->key);
            // 从链表头部去掉这个点
            delNode(tmp);
            
            // 释放被删除的点的空间
            delete tmp;
        }
        else
            size++;
        listNode *node = new listNode(key, value);
        hash_table[key] = node;
        pushNodeBack(node);
    }

    void delNode(listNode *node)
    {
        node->pre->next = node->next;
        node->next->pre = node->pre;
    }

    void pushNodeBack(listNode *node)
    {
        tail->pre->next = node;
        node->pre = tail->pre;
        node->next = tail;
        tail->pre = node;
    }
};


int main()
{
    LRUCache *cache = new LRUCache(2);
    cache->put(1, 1);
    cache->put(2, 2);
    cout << cache->get(1) << endl;       // 返回  1
    cache->put(3, 3);                    // 该操作会使得密钥 2 作废
    cout << cache->get(2) << endl;       // 返回 -1 (未找到)
    cache->put(4, 4);                    // 该操作会使得密钥 1 作废
    cout << cache->get(1) << endl;       // 返回 -1
    cout << cache->get(3) << endl;       // 返回  3
    cout << cache->get(4) << endl;       // 返回  4
}

原文出处:https://www.cnblogs.com/shayue/p/10403863.html

Android 中 146 种颜色对应的 xml 色值

Android 中 146 种颜色对应的 xml 色值

哈哈哈

<?xml version="1.0" encoding="utf-8"?>

<resources>
    <color name="white">#FFFFFF</color> <!--白色 -->
    <color name="ivory">#FFFFF0</color> <!--象牙色 -->
    <color name="lightyellow">#FFFFE0</color> <!--亮黄色 -->
    <color name="yellow">#FFFF00</color> <!--黄色 -->
    <color name="snow">#FFFAFA</color> <!--雪白色 -->
    <color name="floralwhite">#FFFAF0</color> <!--花白色 -->
    <color name="lemonchiffon">#FFFACD</color> <!--柠檬绸色 -->
    <color name="cornsilk">#FFF8DC</color> <!--米绸色 -->
    <color name="seashell">#FFF5EE</color> <!--海贝色 -->
    <color name="lavenderblush">#FFF0F5</color> <!--淡紫红 -->
    <color name="papayawhip">#FFEFD5</color> <!--番木色 -->
    <color name="blanchedalmond">#FFEBCD</color> <!--白杏色 -->
    <color name="mistyrose">#FFE4E1</color> <!--浅玫瑰色 -->
    <color name="bisque">#FFE4C4</color> <!--桔黄色 -->
    <color name="moccasin">#FFE4B5</color> <!--鹿皮色 -->
    <color name="navajowhite">#FFDEAD</color> <!--纳瓦白 -->
    <color name="peachpuff">#FFDAB9</color> <!--桃色 -->
    <color name="gold">#FFD700</color> <!--金色 -->
    <color name="pink">#FFC0CB</color> <!--粉红色 -->
    <color name="lightpink">#FFB6C1</color> <!--亮粉红色 -->
    <color name="orange">#FFA500</color> <!--橙色 -->
    <color name="lightsalmon">#FFA07A</color> <!--亮肉色 -->
    <color name="darkorange">#FF8C00</color> <!--暗桔黄色 -->
    <color name="coral">#FF7F50</color> <!--珊瑚色 -->
    <color name="hotpink">#FF69B4</color> <!--热粉红色 -->
    <color name="tomato">#FF6347</color> <!--西红柿色 -->
    <color name="orangered">#FF4500</color> <!--红橙色 -->
    <color name="deeppink">#FF1493</color> <!--深粉红色 -->
    <color name="fuchsia">#FF00FF</color> <!--紫红色 -->
    <color name="magenta">#FF00FF</color> <!--红紫色 -->
    <color name="red">#FF0000</color> <!--红色 -->
    <color name="oldlace">#FDF5E6</color> <!--老花色 -->
    <color name="lightgoldenrodyellow">#FAFAD2</color> <!--亮金黄色 -->
    <color name="linen">#FAF0E6</color> <!--亚麻色 -->
    <color name="antiquewhite">#FAEBD7</color> <!--古董白 -->
    <color name="salmon">#FA8072</color> <!--鲜肉色 -->
    <color name="ghostwhite">#F8F8FF</color> <!--幽灵白 -->
    <color name="mintcream">#F5FFFA</color> <!--薄荷色 -->
    <color name="whitesmoke">#F5F5F5</color> <!--烟白色 -->
    <color name="beige">#F5F5DC</color> <!--米色 -->
    <color name="wheat">#F5DEB3</color> <!--浅黄色 -->
    <color name="sandybrown">#F4A460</color> <!--沙褐色 -->
    <color name="azure">#F0FFFF</color> <!--天蓝色 -->
    <color name="honeydew">#F0FFF0</color> <!--蜜色 -->
    <color name="aliceblue">#F0F8FF</color> <!--艾利斯兰 -->
    <color name="khaki">#F0E68C</color> <!--黄褐色 -->
    <color name="lightcoral">#F08080</color> <!--亮珊瑚色 -->
    <color name="palegoldenrod">#EEE8AA</color> <!--苍麒麟色 -->
    <color name="violet">#EE82EE</color> <!--紫罗兰色 -->
    <color name="darksalmon">#E9967A</color> <!--暗肉色 -->
    <color name="lavender">#E6E6FA</color> <!--淡紫色 -->
    <color name="lightcyan">#E0FFFF</color> <!--亮青色 -->
    <color name="burlywood">#DEB887</color> <!--实木色 -->
    <color name="plum">#DDA0DD</color> <!--洋李色 -->
    <color name="gainsboro">#DCDCDC</color> <!--淡灰色 -->
    <color name="crimson">#DC143C</color> <!--暗深红色 -->
    <color name="palevioletred">#DB7093</color> <!--苍紫罗兰色 -->
    <color name="goldenrod">#DAA520</color> <!--金麒麟色 -->
    <color name="orchid">#DA70D6</color> <!--淡紫色 -->
    <color name="thistle">#D8BFD8</color> <!--蓟色 -->
    <color name="lightgray">#D3D3D3</color> <!--亮灰色 -->
    <color name="lightgrey">#D3D3D3</color> <!--亮灰色 -->
    <color name="tan">#D2B48C</color> <!--茶色 -->
    <color name="chocolate">#D2691E</color> <!--巧可力色 -->
    <color name="peru">#CD853F</color> <!--秘鲁色 -->
    <color name="indianred">#CD5C5C</color> <!--印第安红 -->
    <color name="mediumvioletred">#C71585</color> <!--中紫罗兰色 -->
    <color name="silver">#C0C0C0</color> <!--银色 -->
    <color name="darkkhaki">#BDB76B</color> <!--暗黄褐色-->
    <color name="rosybrown">#BC8F8F</color> <!--褐玫瑰红 -->
    <color name="mediumorchid">#BA55D3</color> <!--中粉紫色 -->
    <color name="darkgoldenrod">#B8860B</color> <!--暗金黄色 -->
    <color name="firebrick">#B22222</color> <!--火砖色 -->
    <color name="powderblue">#B0E0E6</color> <!--粉蓝色 -->
    <color name="lightsteelblue">#B0C4DE</color> <!--亮钢兰色-->
    <color name="paleturquoise">#AFEEEE</color> <!--苍宝石绿 -->
    <color name="greenyellow">#ADFF2F</color> <!--黄绿色 -->
    <color name="lightblue">#ADD8E6</color> <!--亮蓝色 -->
    <color name="darkgray">#A9A9A9</color> <!--暗灰色 -->
    <color name="darkgrey">#A9A9A9</color> <!--暗灰色 -->
    <color name="brown">#A52A2A</color> <!--褐色 -->
    <color name="sienna">#A0522D</color> <!--赭色 -->
    <color name="darkorchid">#9932CC</color> <!--暗紫色 -->
    <color name="palegreen">#98FB98</color> <!--苍绿色 -->
    <color name="darkviolet">#9400D3</color> <!--暗紫罗兰色 -->
    <color name="mediumpurple">#9370DB</color> <!--中紫色 -->
    <color name="lightgreen">#90EE90</color> <!--亮绿色 -->
    <color name="darkseagreen">#8FBC8F</color> <!--暗海兰色 -->
    <color name="saddlebrown">#8B4513</color> <!--重褐色 -->
    <color name="darkmagenta">#8B008B</color> <!--暗洋红 -->
    <color name="darkred">#8B0000</color> <!--暗红色 -->
    <color name="blueviolet">#8A2BE2</color> <!--紫罗兰蓝色 -->
    <color name="lightskyblue">#87CEFA</color> <!--亮天蓝色 -->
    <color name="skyblue">#87CEEB</color> <!--天蓝色 -->
    <color name="gray">#808080</color> <!--灰色 -->
    <color name="grey">#808080</color> <!--灰色 -->
    <color name="olive">#808000</color> <!--橄榄色 -->
    <color name="purple">#800080</color> <!--紫色 -->
    <color name="maroon">#800000</color> <!--粟色 -->
    <color name="aquamarine">#7FFFD4</color> <!--碧绿色 -->
    <color name="chartreuse">#7FFF00</color> <!--黄绿色 -->
    <color name="lawngreen">#7CFC00</color> <!--草绿色 -->
    <color name="mediumslateblue">#7B68EE</color> <!--中暗蓝色 -->
    <color name="lightslategray">#778899</color> <!--亮蓝灰 -->
    <color name="lightslategrey">#778899</color> <!--亮蓝灰 -->
    <color name="slategray">#708090</color> <!--灰石色 -->
    <color name="slategrey">#708090</color> <!--灰石色 -->
    <color name="olivedrab">#6B8E23</color> <!--深绿褐色 -->
    <color name="slateblue">#6A5ACD</color> <!--石蓝色 -->
    <color name="dimgray">#696969</color> <!--暗灰色 -->
    <color name="dimgrey">#696969</color> <!--暗灰色 -->
    <color name="mediumaquamarine">#66CDAA</color> <!--中绿色 -->
    <color name="cornflowerblue">#6495ED</color> <!--菊兰色 -->
    <color name="cadetblue">#5F9EA0</color> <!--军兰色 -->
    <color name="darkolivegreen">#556B2F</color> <!--暗橄榄绿-->
    <color name="indigo">#4B0082</color> <!--靛青色 -->
    <color name="mediumturquoise">#48D1CC</color> <!--中绿宝石 -->
    <color name="darkslateblue">#483D8B</color> <!--暗灰蓝色 -->
    <color name="steelblue">#4682B4</color> <!--钢兰色 -->
    <color name="royalblue">#4169E1</color> <!--皇家蓝 -->
    <color name="turquoise">#40E0D0</color> <!--青绿色 -->
    <color name="mediumseagreen">#3CB371</color> <!--中海蓝 -->
    <color name="limegreen">#32CD32</color> <!--橙绿色 -->
    <color name="darkslategray">#2F4F4F</color> <!--暗瓦灰色 -->
    <color name="darkslategrey">#2F4F4F</color> <!--暗瓦灰色 -->
    <color name="seagreen">#2E8B57</color> <!--海绿色 -->
    <color name="forestgreen">#228B22</color> <!--森林绿 -->
    <color name="lightseagreen">#20B2AA</color> <!--亮海蓝色 -->
    <color name="dodgerblue">#1E90FF</color> <!--闪兰色 -->
    <color name="midnightblue">#191970</color> <!--中灰兰色 -->
    <color name="aqua">#00FFFF</color> <!--浅绿色 -->
    <color name="cyan">#00FFFF</color> <!--青色 -->
    <color name="springgreen">#00FF7F</color> <!--春绿色 -->
    <color name="lime">#00FF00</color> <!--酸橙色 -->
    <color name="mediumspringgreen">#00FA9A</color> <!--中春绿色 -->
    <color name="darkturquoise">#00CED1</color> <!--暗宝石绿 -->
    <color name="deepskyblue">#00BFFF</color> <!--深天蓝色 -->
    <color name="darkcyan">#008B8B</color> <!--暗青色 -->
    <color name="teal">#008080</color> <!--水鸭色 -->
    <color name="green">#008000</color> <!--绿色 -->
    <color name="darkgreen">#006400</color> <!--暗绿色 -->
    <color name="blue">#0000FF</color> <!--蓝色 -->
    <color name="mediumblue">#0000CD</color> <!--中兰色 -->
    <color name="darkblue">#00008B</color> <!--暗蓝色 -->
    <color name="navy">#000080</color> <!--海军色 -->
    <color name="black">#000000</color> <!--黑色 -->

</resources>

今天关于COEN 146: Computer Networks的介绍到此结束,谢谢您的阅读,有关146 - 删除链表倒数 N 个节点、146. LRU Cache、146. LRU缓存机制、Android 中 146 种颜色对应的 xml 色值等更多相关知识的信息可以在本站进行查询。

本文标签: