星期五。見面

程式 | 學習 | 日記 | 玩樂

    [論文速速讀]系列文章介紹

前言

論文速速讀系列是從今年四月開始,我開始寫一些論文的中文讀書筆記,還記得第一篇是[論文速速讀]ReZero is All You Need: Fast Convergence at Large Depth,之後發現儘管自己已經陸續產出了幾篇文章,可是好像都沒正式的跟大家介紹這系列文章的由來xD

所以這篇文章就是來講講這系列文章到底是什麼,以及我會和會想寫這些文章。

論文速速讀系列是什麼?

由於在AI領域每年總是有一些非常重大的突破和應用,如果跟不上潮流很有可能就會錯失許多機會。例如,對NLP領域熟悉的話你一定聽過2013年的word2vec、2014年開始流行的attention、2018年的Bert…這些很有名的技術。

還記得Bert剛出的時候我好像剛進碩士實驗室,當時只知道這個技術屌打了當時一堆NLP的研究,但我想也想不到兩年後Bert已經造成如此大的影響力,一堆基於Bert的變形應用在各大領域上都取得了非常優異的結果。

因此,我想要藉由這系列的文章讓自己能夠更加快速的了解AI的新技術和研究,同時逼迫自己看論文xD

繼續閱讀

    [課程筆記]課程筆記系列總覽

本文記錄了自己在上課時所記錄的一些課程筆記,可以透過這邊文章連結到所有以往發過的課程筆記文章。

繼續閱讀

[UVA11389]The Bus Driver Problem

In a city there are n bus drivers. Also there are n morning bus routes and n afternoon bus routes with various lengths. Each driver is assigned one morning route and one evening route. For any driver, if his total route length for a day exceeds d, he has to be paid overtime for every hour after the first d hours at a flat r taka / hour.

Your task is to assign one morning route and one evening route to each bus driver so that the total overtime amount that the authority has to pay is minimized.

繼續閱讀

[UVA10533]Digit

A prime number is a positive number, which is divisible by exactly two different integers.

A digit prime is a prime number whose sum of digits is also prime. For example the prime number 41 is a digit prime because 4 + 1 = 5 and 5 is a prime number. 17 is not a digit prime because 1 + 7 = 8, and 8 is not a prime number.

In this problem your job is to find out the number of digit primes within a certain range less than 1000000.

繼續閱讀

[UVA706]LC-Display

A friend of you has just bought a new computer. Until now, the most powerful computer he ever used has been a pocket calculator. Now, looking at his new computer, he is a bit disappointed, because he liked the LC-display of his calculator so much. So you decide to write a program that displays numbers in an LC-display-like style on his computer.

Input

The input file contains several lines, one for each number to be displayed. Each line contains two integers s, n ( $1 \le s \le 10, 0 \le n \le 99\,999\,999$), where n is the number to be displayed and s is the size in which it shall be displayed. The input file will be terminated by a line containing two zeros. This line should not be processed.

Output

Output the numbers given in the input file in an LC-display-style using s <tt>-</tt>'' signs for the horizontal segments and <i>s</i>|’’ signs for the vertical ones. Each digit occupies exactly s+2 columns and 2s+3 rows. (Be sure to fill all the white space occupied by the digits with blanks, also for the last digit.) There has to be exactly one column of blanks between two digits. Output a blank line after each number. (You will find a sample of each digit in the sample output.)

Sample Input

2 12345
3 67890
0 0

Sample Output

      --   --        -- 
| | | | | |
| | | | | |
-- -- -- --
| | | | |
| | | | |
-- -- --

--- --- --- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- --- ---

繼續閱讀

[UVA11332]Summing Digits

For a positive integer n, let f(n) denote the sum of the digits of n when represented in base 10.

It is easy to see that the sequence of numbers n,f(n),f(f(n)),f(f(f(n))),… eventually becomes a single digit number that repeats forever. Let this single digit be denoted g(n).

For example, consider n = 1234567892.

Then: f(n) = 1+2+3+4+5+6+7+8+9+2 = 47 f(f(n)) = 4 + 7 = 11 f(f(f(n))) = 1 + 1 = 2 Therefore, g(1234567892) = 2.

Input

Each line of input contains a single positive integer n at most 2,000,000,000.

Input is terminated by n = 0 which should not be processed.

Output

For each such integer, you are to output a single line containing g(n).

Sample Input

繼續閱讀

[PHP]網購網站-簡易留言板製作

用PHP製作出簡易網路留言板

功能:

  1. 顯示該會員的個人留言紀錄
  2. 紀錄又分成買家跟賣家
  3. 可以做出買家公告(對所有會員)

做完大概長這個樣子:

擷取.PNG

原理: 透過PHP連結到MySQL對資料庫做存取的動作,買家和賣家的背景圖案則是用PowerPoint做出很陽春的圖示樣板。

繼續閱讀

[UVA272]TEX Quotes

TeX is a typesetting language developed by Donald Knuth. It takes source text together with a few typesetting instructions and produces, one hopes, a beautiful document.

Beautiful documents use `` and “ to delimit quotations, rather than the mundane “ which is what is provided by most keyboards.

Keyboards typically do not have an oriented double-quote, but they do have a left-single-quote ` and a right-single-quote ‘. Check your keyboard now to locate the left-single-quote key ` (sometimes called the ``backquote key”) and the right-single-quote key ‘ (sometimes called the ``apostrophe” or just ``quote”).

Be careful not to confuse the left-single-quote ` with the ``backslash” key. TeX lets the user type two left-single-quotes `` to create a left-double-quote `` and two right-single-quotes ‘’ to create a right-double-quote ‘’. Most typists, however, are accustomed to delimiting their quotations with the un-oriented double-quote “.

If the source contained

“To be or not to be,” quoth the bard, “that is the question.”

then the typeset document produced by TeX would not contain the desired form:

``To be or not to be,” quoth the bard, ``that is the question.”

In order to produce the desired form, the source file must contain the sequence:

``To be or not to be,’’ quoth the bard, ``that is the question.’’

You are to write a program which converts text containing double-quote (“) characters into text that is identical except that double-quotes have been replaced by the two-character sequences required by TeX for delimiting quotations with oriented double-quotes. The double-quote (“) characters should be replaced appropriately by either `` if the “ opens a quotation and by ‘’ if the “ closes a quotation. Notice that the question of nested quotations does not arise: The first “ must be replaced by ``, the next by ‘’, the next by ``, the next by ‘’, the next by ``, the next by ‘’, and so on.

Input and Output


Input will consist of several lines of text containing an even number of double-quote (“) characters. Input is ended with an end-of-file character. The text must be output exactly as it was input except that:

  • he first “ in each pair is replaced by two ` characters: `` and
  • the second “ in each pair is replaced by two ‘ characters: ‘’.

Sample Input

"To be or not to be," quoth the Bard, "that
is the question".
The programming contestant replied: "I must disagree.
To `C' or not to `C', that is The Question!"

Sample Output

``To be or not to be,'' quoth the Bard, ``that
is the question''.
The programming contestant replied: ``I must disagree.
To `C' or not to `C', that is The Question!''
#include  <iostream>
#include <cstdlib>
#include <math.h>
#include <vector>
using namespace std;

int main() {
//freopen("in.txt","r",stdin);
char c ;
int n = 0;
while(c = getchar() ) {
if(c == EOF) break;
if(c == '"' && n % 2 == 1) {
n++;
printf("''");
}
else if(c == '"' && n % 2 == 0) {
n++;
printf("``");
}
else {
printf("%c",c);
}
}
return 0;
}
繼續閱讀

>