Search

4/03/2006

Flickr photo restore

1. go to Flickr API
2. use Flickr.people.getPublicPhotos with per_page & page arguments
3. API explorer to generate a XML file
4. Photo URLs to generate static address for each photo

Flickr Badges

Flickr Badges
Flickr Badges Formatting
Flickr相片展示教學
通過CSS定義控制Flickr的顯示效果

CSS Example:


.flickrimg {border: 1px solid #ccc; padding:4px; margin:5px 5px 5px 0px; height: 55px;
width: 55px; opacity: 0.8;}
.flickrimg:hover {border: 1px solid #777; opacity:1;}

Flickr Random Photo Demonstration:



Integer Constants

int main(){

printf("%d ", 011);
//數字011, 八進位
printf("%d ", 0x11);
//數字0x11, 十六進位

printf("%o ", 10);
//把10用八進位印出來

printf("%x ", 25);
//把25用十六進位印出來
}
output
/*
9 17 12 19
*/

getchar()

main(){
char c;

while((c=getchar()) != EOF)
putchar(c);
}

getchar returns an integer
The getchar function returns the next character from the standard input,
or EOF(a value, defined in stdio.h, which is distinct from any character)
if there is no input left.
在VC中EOF的值為-1,如果用char不帶正負號,則這個程式會出錯。
正確的寫法應該宣告c為int

#define getchar() getc(stdin)

sscanf

void main()
{
char arr[80];
int i,j,k;
strcpy(arr,"1 2 3");
sscanf(arr,"%d",&i);
sscanf(arr,"%d",&j);
sscanf(arr,"%d",&k);
printf("( %d %d %d )",i,j,k);
}
// output: (1 1 1)


in your example, when you take the first input (i) from the string,
the string itself (arr) is never changing. so whenever you take
another input (j) from the same string (arr) , they (i and j) will be the same.

void main()
{
char arr[80];
int i,j,k;

strcpy(arr, "1 2 3");
sscanf(arr, "%d %[^n]", &i, arr);
//每次都把%[^n]的結果寫回arr
sscanf(arr, "%d %[^n]", &j, arr);
sscanf(arr, "%d %[^n]", &k, arr);
printf("(%d %d %d)n", i, j, k);
}
// output: (1 2 3)


[about using "sscanf" :=)]

[problem with sscanf()]

Bitwise operation

Bitwise operation

Setting k-th bit of x:       x |= 1 [shift] k
Clearing k-th bit: x &= ~(1 [shift] k)
Getting k-th bit: return (x [shift] k) & 1
Flipping k-th bit: x ^= 1 [shift] k (replaces 0 by 1, and 1 by 0.)

ex: 10311 - Goldbach and Euler
[via]

Adobe Reader Enterprise Edition

http://www.adobe.com/products/acrobat/readstep2.html?type=distrib

http://digg.com/software/Download_Adobe_Reader_Enterprise_Edition

No download manager, No Yahoo! toolbar or PASE, Simple licensing agreement.

ACM TW Ranklist

查詢在自己國家的解題數排名
http://www.felix-halim.net/oj/ranklist.php?country=tw

幫你找到簡單的題目
http://www.felix-halim.net/oj/problems.php

大數問題

This is a list I made by searching through my hard disk for calls to bigint *, /, % and pow operations. Some problems might be possible to solve using only +, - or long long (or maybe I missed the correct way to solve it, without big numbers).

485 - Pascal Triangle of Death
495 - Fibonacci Freeze - plus Fibonacci
10007 - Count the Trees - plus Catalan formula
10183 - How Many Fibs - plus Fibonacci
10219 - Find the Ways ! - plus Catalan formula
10220 - I Love Big Numbers ! - plus Catalan formula
10303 - How Many Trees? - plus Catalan formula
10334 - Ray Through Glasses - plus Fibonacci
10519 - !!Really Strange!!
10579 - Fibonacci Numbers - plus Fibonacci

239 Tempus et mobilius, time and motion
254 Towers of Hanoi
288 Arithmetic operations with large integers
324 Factorial frequencies
338 Long multiplication
367 Halting factor replacement systems
504 Random number
560 Magic
619 Numerically speaking
623 500!
748 Exponentiation
787 Maximum sub-sequence product
10007 Count the trees
10023 Square root
10070 Leap year or not leap year and...
10106 Product
10176 Ocean deep! - make it shallow!!
10213 How many pieces of land?
10220 I love big numbers!
10303 How many trees?
10359 Tiling
10494 If we were a child again
10519 !! Really strange !!
10521 Continuously growing fractions
10523 Very easy!!!
10527 Persistent numbers
10606 Opening doors
10658 ReArrange
10814 Simplifying fractions
10836 The maximum term
10862 Connect the cable wires

I’m sure that someone who’s solved more of volume 100-107 than me can add a lot of problems to this list.

Visual C Debugging

單步除錯

Step Into:追蹤進入副程式內部,[F11]
Step Over:可跳過副程式內部, [F10]
Stop Debugging: Debug->Stop Debugging [shift+f5]