博文
(2022-10-22 09:32:25)
1.Why(x=y)=zisillegalinC?A:Becausex=ywillcreatervalue,wecannotassignavaluetorvalue.2.HowtocallCfunctioninC++?A:Useextern"C"{func();}becauseCandC++havedifferentsignaturesoffunctions,C++usesmanglingmechanismtodealwiththefunction.3.Howtoavoidmultipledefinitionerrorincompilingtime?inlikingtime?A:Use#ifndefsomething#definesomething...#endifinheaderfiletoavoidtheerrorincompilingtime;Useexterns...[閱讀全文]
閱讀 ()評論 (0)
在自然界有許多極值(最小值)現象。比如,荷葉上的水珠的表麵積最小(在相同體積
下)。光線從境麵反射,其真實路徑時間最短(費馬變分原理)。我們可以用求導數方
法求極值。對於更複雜的極值問題可以用變分法來解。歐拉用變分法解決了“最速
降落線問題”。考慮一物體從高處A點沿AB之間軌跡運動至低處B點。AB之間有一組
軌跡(函數)。問題是哪一個函數[閱讀全文]
閱讀 ()評論 (0)
為什麽有些問題不能解決?(1)一些問題沒有解決的方法(算法);(2)一些問題有解
決的方法(算法),但隨著問題的尺度的增加,無法算下去。第一類問題中典型的例子是圖靈(TURING)停止問題:是否存在一個程序,它可以用
來判斷另一個程序是死循環(不停地運行)或停止。一般來說,這樣的程序是不存在
的。如果存在這樣的程序H,它可以用來判斷另一個程序P,H(P):H將P作[閱讀全文]
閱讀 ()評論 (0)
(2022-10-15 13:44:05)
一個笑話:在美國,你聽到一個人講英語,如果老中能聽懂,老美聽不懂,這個人是
中國人。如果老中聽不懂,老美能聽懂,這個人是印度人。如果老中聽不懂,老美
也聽不懂,這個人是俄國人。
一個剛來美國的老中在餐館當服務員。當她問老美飯菜如何,老美說:It'scool.
她回答說:既然飯菜涼了,我去給你熱一下(warmup)。一個剛來美國的老中去餐館吃飯。他[閱讀全文]
閱讀 ()評論 (4)
(2022-10-15 13:29:08)
無論你是做科技研究或處理辦公室事務,遵從一些“事理”規則你可能會得到新的成
果或高效率地處理事務。這些RULES並沒有什麽新鮮,我隻是將它們概括在這裏。
1)“一份拷貝”:如果一個文件需要備份,一份備份就夠。準備多份備份會增加維
護工作量,而且會產生數據不一致性問題。設計計算機應用係統常遵從這個規則。
2)“合並重複事件”[閱讀全文]
閱讀 ()評論 (0)
WORLDORDERACCORDINGTOTWOCOWS1)FEUDALISM:Youhavetwocows.Yourlordtakessomeofthemilk.2)PURESOCIALISM:Youhavetwocows.Thegovernmenttakesthemandputs
theminabarnwitheveryoneelse'scows.Youhavetotakecareofallthe
cows.Thegovernmentgivesyouasmuchasyouneed.3)BUREAUCRATICSOCIALISM:Youhavetwocows.Thegovernmenttakesthem
andputstheminabarnwitheveryoneelse'scows.Theyarecaredforby
ex-chicken...[閱讀全文]
閱讀 ()評論 (0)
(2022-10-15 13:15:07)
THEWORLD'SEASIESTQUIZ1)HowlongdidtheHundredYearsWarlast?2)WhichcountrymakesPanamahats?3)Fromwhichanimaldowegetcatgut?4)InwhichmonthdoRussianscelebratetheOctoberRevolution?5)Whatisacamel'shairbrushmadeof?6)TheCanaryIslandsarenamedafterwhatanimal?7)Whatcolorisapurplefinch?8)WhereareChinesegooseberriesfrom?---------------------------------------------------------------------------Answers:1)1...[閱讀全文]
閱讀 ()評論 (0)
(2022-10-15 13:10:17)
MANANDWOMAN1)Smartman+smartwoman=romance2)Smartman+dumbwoman=pregnancy3)Dumbman+smartwoman=affair4)Dumbman+dumbwoman=marriage5)Smartboss+smartemployee=profit6)Smartboss+dumbemployee=production7)Dumbboss+smartemployee=promotion8)Dumbboss+dumbemployee=overtime9)Amanwillpay$2fora$1itemheneeds.10)Awomanwillpay$1fora$2itemthatshedoesn'tneed.11)Amanneverworriesaboutthefutureuntilhegetsawife.12)Awoma...[閱讀全文]
閱讀 ()評論 (0)
(2022-10-15 13:05:12)
SIGNSTHATYOUAREOLD
1)Youareasleep,butothersworrythatyou'redead.2)Youcanlivewithoutsex,butnotwithoutglasses.3)Yourbackgoesoutmorethanyoudo.4)Youquittryingtoholdyourstomachin,nomatterwhowalksintothe
room.5)Youbuyacompassforthedashofyourcar.6)Yourbestfriendisdatingsomeonehalftheirage.7)Youwouldrathergotoworkthanstayhomesick.8)Youconstantlytalkaboutthepriceofgasoline.9)Youconsidercoffeeone...[閱讀全文]
閱讀 ()評論 (0)
SOMEREASONSIT'SGREATTOBEAGUY
1)Phoneconversationsareoverin30secondsflat.2)Movienudityisvirtuallyalwaysfemale.3)Afivedayvacationrequiresonlyonesuitcase.4)Yourbathroomlinesare80%shorter.5)Oldfriendsdon'tgiveyoucrapifyou'velostorgainedweight.6)Drycleanersandhaircutter'sdon'trobyoublind.7)Yourbuttisneverafactorinajobinterview.8)Abeergutdoesn'tmakeyouinvisibletotheoppositese...[閱讀全文]
閱讀 ()評論 (0)
[1]
[2]
[3]
[4]
[5]
[>>]
[首頁]
[尾頁]