Re: [閒聊] 大家工作上看過哪些誇張的 CODE ?
※ 引述《wa120 (哇120)》之銘言:
不嘴炮,來,你現在接手 maintain 這個程式給我看
我幫你 syntax high light
if ( n % 2 ) {
<div class="question-summary narrow" id="question-summary-2831775">
<div
onclick="javascript:window.location.href='/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">68</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time"
class="question-hyperlink" title="Sorry, this is probably a terrible
question. I've JUST started learning python today. I've been reading a Byte
of Python. Right now I have a project for Python that involves time. I can't
find … ">Running a python script for a user-specified amount of
time?</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time/?lastactivity"
class="started-link"><span title="2010-05-16 16:41:22Z"
class="relativetime">6m ago</span></a>
<a href="/users/143880/shavenwarthog" >shavenwarthog</a>
<span class="reputation-score" title="reputation score">71</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844554">
<div
onclick="javascript:window.location.href='/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">3</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items"
class="question-hyperlink" title="I have written a Python application and
would like to give my users the option of having the app automatically launch
itself when the user logs in. It is important that the user is able to toggle
this … ">Using Python to add/remove Ubuntu login script items</a></h3>
<div class="tags t-python t-ubuntu t-linux t-login-script">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/ubuntu" class="post-tag" title="show questions tagged
'ubuntu'" rel="tag">ubuntu</a> <a href="/questions/tagged/linux"
class="post-tag" title="show questions tagged 'linux'" rel="tag">linux</a> <a
href="/questions/tagged/login-script" class="post-tag" title="show questions
tagged 'login-script'" rel="tag">login-script</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:54Z" class="relativetime">6m
ago</span>
<a href="/users/138256/codebox-rob" >codebox_rob</a> <span
class="reputation-score" title="reputation score">58</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844553">
<div
onclick="javascript:window.location.href='/questions/2844553/explaining-verity-index-and-document-search-limits'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">1</div>
<div>view</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844553/explaining-verity-index-and-document-search-limits"
class="question-hyperlink" title="As present, we currently have a CF8
standard edition server which have some limitations around verity indexing.
According to Adobe
Verity Server has the following document search limits (limits are
… ">Explaining verity index and document search limits</a></h3>
<div class="tags t-coldfusion t-verity t-collections t-indexing
t-limits">
<a href="/questions/tagged/coldfusion" class="post-tag"
title="show questions tagged 'coldfusion'" rel="tag">coldfusion</a> <a
href="/questions/tagged/verity" class="post-tag" title="show questions tagged
'verity'" rel="tag">verity</a> <a href="/questions/tagged/collections"
class="post-tag" title="show questions tagged 'collections'"
rel="tag">collections</a> <a href="/questions/tagged/indexing"
class="post-tag" title="show questions tagged 'indexing'"
rel="tag">indexing</a> <a href="/questions/tagged/limits" class="post-tag"
title="show questions tagged 'limits'" rel="tag">limits</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:50Z" class="relativetime">7m
ago</span>
<a href="/users/268667/ahmad" >Ahmad</a> <span
class="reputation-score" title="reputation score">173</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2840271">
<div
onclick="javascript:window.location.href='/questions/2840271/handling-email-bouncebacks-in-rails'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2840271/handling-email-bouncebacks-in-rails"
class="question-hyperlink" title="Hi there,
I've built a very basic CRM system for my rails app that allows me to
send weekly user activity digests with custom text and create multi-part
marketing messages which I can configure and … ">Handling Email
Bouncebacks in Rails</a></h3>
<div class="tags t-ruby-on-rails t-email t-bouncedemail
t-retrieve">
<a href="/questions/tagged/ruby-on-rails" class="post-tag"
title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a
href="/questions/tagged/email" class="post-tag" title="show questions tagged
'email'" rel="tag">email</a> <a href="/questions/tagged/bouncedemail"
class="post-tag" title="show questions tagged 'bouncedemail'"
rel="tag">bouncedemail</a> <a href="/questions/tagged/retrieve"
class="post-tag" title="show questions tagged 'retrieve'"
rel="tag">retrieve</a>
</div>
<div class="started">
<a
href="/questions/2840271/handling-email-bouncebacks-in-rails/?lastactivity"
class="started-link"><span title="2010-05-16 16:40:45Z"
class="relativetime">7m ago</span></a>
<a href="/users/242134/aressidi" >aressidi</a> <span
class="reputation-score" title="reputation score">27</span>
</div>
</div>
</div>
<div class="question-summary width" id="question-summary-2839959">
<div
onclick="javascript:window.location.href='/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications'"
class="cp">
<div class="votes">
<div class="mini-counts">-3</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">52</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications"
class="question-hyperlink" title="jQuery+jQueryUI Vs Yahoo UI..Which is the
best UI to use in asp.net web applications?
">jQuery+jQueryUI Vs Yahoo UI..Which is the best one for web
applications?</a></h3>
<div class="tags t-aspunet t-jquery-ui t-yahoo t-ui t-subjective">
<a href="/questions/tagged/asp.net" class="post-tag"
title="show questions tagged 'asp.net'" rel="tag">asp.net</a> <a
href="/questions/tagged/jquery-ui" class="post-tag" title="show questions
tagged 'jquery-ui'" rel="tag">jquery-ui</a> <a href="/questions/tagged/yahoo"
class="post-tag" title="show questions tagged 'yahoo'" rel="tag">yahoo</a> <a
href="/questions/tagged/ui" class="post-tag" title="show questions tagged
'ui'" rel="tag">ui</a> <a href="/questions/tagged/subjective"
class="post-tag" title="show questions tagged 'subjective'"
rel="tag">subjective</a>
</div>
<div class="started">
<a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:24Z"
class="relativetime">8m ago</span></a>
<a href="/users/135494/clement-herreman" >Clement
Herreman</a> <span class="reputation-score" title="reputation
score">1,412</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844516">
<div
onclick="javascript:window.location.href='/questions/2844516/python-filter-a-dictionary'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">25</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844516/python-filter-a-dictionary"
class="question-hyperlink" title="Hi,
I have a dictionary of points, say:
>>> points={'a':(3,4), 'b':(1,2), 'c':(5,5), 'd':(3,3)}
I want to create a new dictionary with all the points whose x and y value
is smaller than … ">Python: Filter a dictionary</a></h3>
<div class="tags t-python t-dictionary t-filter">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/dictionary" class="post-tag" title="show questions
tagged 'dictionary'" rel="tag">dictionary</a> <a
href="/questions/tagged/filter" class="post-tag" title="show questions tagged
'filter'" rel="tag">filter</a>
</div>
<div class="started">
<a
href="/questions/2844516/python-filter-a-dictionary/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:17Z"
class="relativetime">8m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-556525">
<div
onclick="javascript:window.location.href='/questions/556525/raw-socket-implementation-in-windows'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts warm"><span title='1446
views'>1</span></div>
<div class='warm'>kviews</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/556525/raw-socket-implementation-in-windows"
class="question-hyperlink" title="I need to create TCP/IP headers manually
for my application. For that i used Raw socket. My system os is win xp
(SP3).
My code compiles fine :) but it throws a run time error:
Initialising … ">Raw socket implementation in windows?</a></h3>
<div class="tags t-ccc t-sockets t-socket-programming t-tcpip">
<a href="/questions/tagged/c%2b%2b" class="post-tag"
title="show questions tagged 'c++'" rel="tag">c++</a> <a
href="/questions/tagged/sockets" class="post-tag" title="show questions
tagged 'sockets'" rel="tag">sockets</a> <a
href="/questions/tagged/socket-programming" class="post-tag" title="show
questions tagged 'socket-programming'" rel="tag">socket-programming</a> <a
href="/questions/tagged/tcpip" class="post-tag" title="show questions tagged
'tcpip'" rel="tag">tcpip</a>
</div>
<div class="started">
<a
href="/questions/556525/raw-socket-implementation-in-windows/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:15Z"
class="relativetime">8m ago</span></a>
<a href="/users/342456/dfak" >dfak</a> <span
class="reputation-score" title="reputation score">1</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844253">
<div
onclick="javascript:window.location.href='/questions/2844253/php-url-detection-regexp-includes-line-breaks'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">2</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">20</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks"
class="question-hyperlink" title="I want to have a function which gets a text
as the input and gives back the text with URLs made to HTML links as the
output.
My draft is as follows:
function autoLink($text) {
return … ">PHP: URL detection (regexp) includes line
breaks</a></h3>
<div class="tags t-regex t-php t-function">
<a href="/questions/tagged/regex" class="post-tag"
title="show questions tagged 'regex'" rel="tag">regex</a> <a
href="/questions/tagged/php" class="post-tag" title="show questions tagged
'php'" rel="tag">php</a> <a href="/questions/tagged/function"
class="post-tag" title="show questions tagged 'function'"
rel="tag">function</a>
</div>
<div class="started">
<a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:06Z"
class="relativetime">8m ago</span></a>
<a href="/users/89771/alix-axel" >Alix Axel</a> <span
class="reputation-score" title="reputation score 12100">12.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2842579">
<div
onclick="javascript:window.location.href='/questions/2842579/equivalent-to-unix-less-command-within-r-console'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">62</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console"
class="question-hyperlink" title="Is there an equivalent to the unix less
command that can be used within the R console?
">Equivalent to unix “less” command within R console</a></h3>
<div class="tags t-less t-r t-shell">
<a href="/questions/tagged/less" class="post-tag" title="show
questions tagged 'less'" rel="tag">less</a> <a href="/questions/tagged/r"
class="post-tag" title="show questions tagged 'r'" rel="tag">r</a> <a
href="/questions/tagged/shell" class="post-tag" title="show questions tagged
'shell'" rel="tag">shell</a>
</div>
<div class="started">
<a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:03Z"
class="relativetime">8m ago</span></a>
<a href="/users/16632/hadley" >hadley</a> <span
class="reputation-score" title="reputation score">4,252</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2841183">
<div
onclick="javascript:window.location.href='/questions/2841183/access-tree-object-in-netbeans-outline'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">14</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2841183/access-tree-object-in-netbeans-outline"
class="question-hyperlink" title="I'm using Outline from netbeans to display
some structured data.
How can I map selected row to an object in tree?
">Access tree object in netbeans outline</a></h3>
<div class="tags t-java t-swing t-outline">
<a href="/questions/tagged/java" class="post-tag" title="show
questions tagged 'java'" rel="tag">java</a> <a href="/questions/tagged/swing"
class="post-tag" title="show questions tagged 'swing'" rel="tag">swing</a> <a
href="/questions/tagged/outline" class="post-tag" title="show questions
tagged 'outline'" rel="tag">outline</a>
</div>
<div class="started">
<a
href="/questions/2841183/access-tree-object-in-netbeans-outline/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:58Z"
class="relativetime">8m ago</span></a>
<a href="/users/230513/trashgod" >trashgod</a> <span
class="reputation-score" title="reputation score">5,490</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844165">
<div
onclick="javascript:window.location.href='/questions/2844165/wpf-hwndhost-keyboard-focus'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844165/wpf-hwndhost-keyboard-focus"
class="question-hyperlink" title="The chart area in the screenshot is a
HwndHost control which hosts a native Win32 window (with it's own registered
WNDCLASS) implemented in C++/CLI and drawn with Direct2D. The HwndHost is
hosted in a … ">WPF HwndHost keyboard focus</a></h3>
<div class="tags t-wpf t-interop t-win32 t-hosted t-focus">
<a href="/questions/tagged/wpf" class="post-tag" title="show
questions tagged 'wpf'" rel="tag">wpf</a> <a href="/questions/tagged/interop"
class="post-tag" title="show questions tagged 'interop'"
rel="tag">interop</a> <a href="/questions/tagged/win32" class="post-tag"
title="show questions tagged 'win32'" rel="tag">win32</a> <a
href="/questions/tagged/hosted" class="post-tag" title="show questions tagged
'hosted'" rel="tag">hosted</a> <a href="/questions/tagged/focus"
class="post-tag" title="show questions tagged 'focus'" rel="tag">focus</a>
</div>
<div class="started">
<a
href="/questions/2844165/wpf-hwndhost-keyboard-focus/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:46Z"
class="relativetime">9m ago</span></a>
<a href="/users/212865/adal" >Adal</a> <span
class="reputation-score" title="reputation score">259</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2843053">
<div
onclick="javascript:window.location.href='/questions/2843053/go-through-a-number-of-functions-in-python'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">6</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">77</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2843053/go-through-a-number-of-functions-in-python"
class="question-hyperlink" title="I have an unknown number of functions in my
python script (well, it is known, but not constant) that start with site_...
I was wondering if there's a way to go through all of these functions in
some … ">Go through a number of functions in Python</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2843053/go-through-a-number-of-functions-in-python/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:33Z"
class="relativetime">9m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
else {
<div class="question-summary narrow" id="question-summary-2831775">
<div
onclick="javascript:window.location.href='/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">68</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time"
class="question-hyperlink" title="Sorry, this is probably a terrible
question. I've JUST started learning python today. I've been reading a Byte
of Python. Right now I have a project for Python that involves time. I can't
find … ">Running a python script for a user-specified amount of
time?</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time/?lastactivity"
class="started-link"><span title="2010-05-16 16:41:22Z"
class="relativetime">6m ago</span></a>
<a href="/users/143880/shavenwarthog" >shavenwarthog</a>
<span class="reputation-score" title="reputation score">71</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844554">
<div
onclick="javascript:window.location.href='/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">3</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items"
class="question-hyperlink" title="I have written a Python application and
would like to give my users the option of having the app automatically launch
itself when the user logs in. It is important that the user is able to toggle
this … ">Using Python to add/remove Ubuntu login script items</a></h3>
<div class="tags t-python t-ubuntu t-linux t-login-script">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/ubuntu" class="post-tag" title="show questions tagged
'ubuntu'" rel="tag">ubuntu</a> <a href="/questions/tagged/linux"
class="post-tag" title="show questions tagged 'linux'" rel="tag">linux</a> <a
href="/questions/tagged/login-script" class="post-tag" title="show questions
tagged 'login-script'" rel="tag">login-script</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:54Z" class="relativetime">6m
ago</span>
<a href="/users/138256/codebox-rob" >codebox_rob</a> <span
class="reputation-score" title="reputation score">58</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844553">
<div
onclick="javascript:window.location.href='/questions/2844553/explaining-verity-index-and-document-search-limits'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">1</div>
<div>view</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844553/explaining-verity-index-and-document-search-limits"
class="question-hyperlink" title="As present, we currently have a CF8
standard edition server which have some limitations around verity indexing.
According to Adobe
Verity Server has the following document search limits (limits are
… ">Explaining verity index and document search limits</a></h3>
<div class="tags t-coldfusion t-verity t-collections t-indexing
t-limits">
<a href="/questions/tagged/coldfusion" class="post-tag"
title="show questions tagged 'coldfusion'" rel="tag">coldfusion</a> <a
href="/questions/tagged/verity" class="post-tag" title="show questions tagged
'verity'" rel="tag">verity</a> <a href="/questions/tagged/collections"
class="post-tag" title="show questions tagged 'collections'"
rel="tag">collections</a> <a href="/questions/tagged/indexing"
class="post-tag" title="show questions tagged 'indexing'"
rel="tag">indexing</a> <a href="/questions/tagged/limits" class="post-tag"
title="show questions tagged 'limits'" rel="tag">limits</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:50Z" class="relativetime">7m
ago</span>
<a href="/users/268667/ahmad" >Ahmad</a> <span
class="reputation-score" title="reputation score">173</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2840271">
<div
onclick="javascript:window.location.href='/questions/2840271/handling-email-bouncebacks-in-rails'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2840271/handling-email-bouncebacks-in-rails"
class="question-hyperlink" title="Hi there,
I've built a very basic CRM system for my rails app that allows me to
send weekly user activity digests with custom text and create multi-part
marketing messages which I can configure and … ">Handling Email
Bouncebacks in Rails</a></h3>
<div class="tags t-ruby-on-rails t-email t-bouncedemail
t-retrieve">
<a href="/questions/tagged/ruby-on-rails" class="post-tag"
title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a
href="/questions/tagged/email" class="post-tag" title="show questions tagged
'email'" rel="tag">email</a> <a href="/questions/tagged/bouncedemail"
class="post-tag" title="show questions tagged 'bouncedemail'"
rel="tag">bouncedemail</a> <a href="/questions/tagged/retrieve"
class="post-tag" title="show questions tagged 'retrieve'"
rel="tag">retrieve</a>
</div>
<div class="started">
<a
href="/questions/2840271/handling-email-bouncebacks-in-rails/?lastactivity"
class="started-link"><span title="2010-05-16 16:40:45Z"
class="relativetime">7m ago</span></a>
<a href="/users/242134/aressidi" >aressidi</a> <span
class="reputation-score" title="reputation score">27</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2839959">
<div
onclick="javascript:window.location.href='/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications'"
class="cp">
<div class="votes">
<div class="mini-counts">-3</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">52</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications"
class="question-hyperlink" title="jQuery+jQueryUI Vs Yahoo UI..Which is the
best UI to use in asp.net web applications?
">jQuery+jQueryUI Vs Yahoo UI..Which is the best one for web
applications?</a></h3>
<div class="tags t-aspunet t-jquery-ui t-yahoo t-ui t-subjective">
<a href="/questions/tagged/asp.net" class="post-tag"
title="show questions tagged 'asp.net'" rel="tag">asp.net</a> <a
href="/questions/tagged/jquery-ui" class="post-tag" title="show questions
tagged 'jquery-ui'" rel="tag">jquery-ui</a> <a href="/questions/tagged/yahoo"
class="post-tag" title="show questions tagged 'yahoo'" rel="tag">yahoo</a> <a
href="/questions/tagged/ui" class="post-tag" title="show questions tagged
'ui'" rel="tag">ui</a> <a href="/questions/tagged/subjective"
class="post-tag" title="show questions tagged 'subjective'"
rel="tag">subjective</a>
</div>
<div class="started">
<a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:24Z"
class="relativetime">8m ago</span></a>
<a href="/users/135494/clement-herreman" >Clement
Herreman</a> <span class="reputation-score" title="reputation
score">1,412</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844516">
<div
onclick="javascript:window.location.href='/questions/2844516/python-filter-a-dictionary'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">25</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844516/python-filter-a-dictionary"
class="question-hyperlink" title="Hi,
I have a dictionary of points, say:
>>> points={'a':(3,4), 'b':(1,2), 'c':(5,5), 'd':(3,3)}
I want to create a new dictionary with all the points whose x and y value
is smaller than … ">Python: Filter a dictionary</a></h3>
<div class="tags t-python t-dictionary t-filter">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/dictionary" class="post-tag" title="show questions
tagged 'dictionary'" rel="tag">dictionary</a> <a
href="/questions/tagged/filter" class="post-tag" title="show questions tagged
'filter'" rel="tag">filter</a>
</div>
<div class="started">
<a
href="/questions/2844516/python-filter-a-dictionary/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:17Z"
class="relativetime">8m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-556525">
<div
onclick="javascript:window.location.href='/questions/556525/raw-socket-implementation-in-windows'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts warm"><span title='1446
views'>1</span></div>
<div class='warm'>kviews</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/556525/raw-socket-implementation-in-windows"
class="question-hyperlink" title="I need to create TCP/IP headers manually
for my application. For that i used Raw socket. My system os is win xp
(SP3).
My code compiles fine :) but it throws a run time error:
Initialising … ">Raw socket implementation in windows?</a></h3>
<div class="tags t-ccc t-sockets t-socket-programming t-tcpip">
<a href="/questions/tagged/c%2b%2b" class="post-tag"
title="show questions tagged 'c++'" rel="tag">c++</a> <a
href="/questions/tagged/sockets" class="post-tag" title="show questions
tagged 'sockets'" rel="tag">sockets</a> <a
href="/questions/tagged/socket-programming" class="post-tag" title="show
questions tagged 'socket-programming'" rel="tag">socket-programming</a> <a
href="/questions/tagged/tcpip" class="post-tag" title="show questions tagged
'tcpip'" rel="tag">tcpip</a>
</div>
<div class="started">
<a
href="/questions/556525/raw-socket-implementation-in-windows/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:15Z"
class="relativetime">8m ago</span></a>
<a href="/users/342456/dfak" >dfak</a> <span
class="reputation-score" title="reputation score">1</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844253">
<div
onclick="javascript:window.location.href='/questions/2844253/php-url-detection-regexp-includes-line-breaks'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">2</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">20</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks"
class="question-hyperlink" title="I want to have a function which gets a text
as the input and gives back the text with URLs made to HTML links as the
output.
My draft is as follows:
function autoLink($text) {
return … ">PHP: URL detection (regexp) includes line
breaks</a></h3>
<div class="tags t-regex t-php t-function">
<a href="/questions/tagged/regex" class="post-tag"
title="show questions tagged 'regex'" rel="tag">regex</a> <a
href="/questions/tagged/php" class="post-tag" title="show questions tagged
'php'" rel="tag">php</a> <a href="/questions/tagged/function"
class="post-tag" title="show questions tagged 'function'"
rel="tag">function</a>
</div>
<div class="started">
<a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:06Z"
class="relativetime">8m ago</span></a>
<a href="/users/89771/alix-axel" >Alix Axel</a> <span
class="reputation-score" title="reputation score 12100">12.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2842579">
<div
onclick="javascript:window.location.href='/questions/2842579/equivalent-to-unix-less-command-within-r-console'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">62</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console"
class="question-hyperlink" title="Is there an equivalent to the unix less
command that can be used within the R console?
">Equivalent to unix “less” command within R console</a></h3>
<div class="tags t-less t-r t-shell">
<a href="/questions/tagged/less" class="post-tag" title="show
questions tagged 'less'" rel="tag">less</a> <a href="/questions/tagged/r"
class="post-tag" title="show questions tagged 'r'" rel="tag">r</a> <a
href="/questions/tagged/shell" class="post-tag" title="show questions tagged
'shell'" rel="tag">shell</a>
</div>
<div class="started">
<a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:03Z"
class="relativetime">8m ago</span></a>
<a href="/users/16632/hadley" >hadley</a> <span
class="reputation-score" title="reputation score">4,252</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2841183">
<div
onclick="javascript:window.location.href='/questions/2841183/access-tree-object-in-netbeans-outline'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">14</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2841183/access-tree-object-in-netbeans-outline"
class="question-hyperlink" title="I'm using Outline from netbeans to display
some structured data.
How can I map selected row to an object in tree?
">Access tree object in netbeans outline</a></h3>
<div class="tags t-java t-swing t-outline">
<a href="/questions/tagged/java" class="post-tag" title="show
questions tagged 'java'" rel="tag">java</a> <a href="/questions/tagged/swing"
class="post-tag" title="show questions tagged 'swing'" rel="tag">swing</a> <a
href="/questions/tagged/outline" class="post-tag" title="show questions
tagged 'outline'" rel="tag">outline</a>
</div>
<div class="started">
<a
href="/questions/2841183/access-tree-object-in-netbeans-outline/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:58Z"
class="relativetime">8m ago</span></a>
<a href="/users/230513/trashgod" >trashgod</a> <span
class="reputation-score" title="reputation score">5,490</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844165">
<div
onclick="javascript:window.location.href='/questions/2844165/wpf-hwndhost-keyboard-focus'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844165/wpf-hwndhost-keyboard-focus"
class="question-hyperlink" title="The chart area in the screenshot is a
HwndHost control which hosts a native Win32 window (with it's own registered
WNDCLASS) implemented in C++/CLI and drawn with Direct2D. The HwndHost is
hosted in a … ">WPF HwndHost keyboard focus</a></h3>
<div class="tags t-wpf t-interop t-win32 t-hosted t-focus">
<a href="/questions/tagged/wpf" class="post-tag" title="show
questions tagged 'wpf'" rel="tag">wpf</a> <a href="/questions/tagged/interop"
class="post-tag" title="show questions tagged 'interop'"
rel="tag">interop</a> <a href="/questions/tagged/win32" class="post-tag"
title="show questions tagged 'win32'" rel="tag">win32</a> <a
href="/questions/tagged/hosted" class="post-tag" title="show questions tagged
'hosted'" rel="tag">hosted</a> <a href="/questions/tagged/focus"
class="post-tag" title="show questions tagged 'focus'" rel="tag">focus</a>
</div>
<div class="started">
<a
href="/questions/2844165/wpf-hwndhost-keyboard-focus/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:46Z"
class="relativetime">9m ago</span></a>
<a href="/users/212865/adal" >Adal</a> <span
class="reputation-score" title="reputation score">259</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2843053">
<div
onclick="javascript:window.location.href='/questions/2843053/go-through-a-number-of-functions-in-python'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">6</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">77</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2843053/go-through-a-number-of-functions-in-python"
class="question-hyperlink" title="I have an unknown number of functions in my
python script (well, it is known, but not constant) that start with site_...
I was wondering if there's a way to go through all of these functions in
some … ">Go through a number of functions in Python</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2843053/go-through-a-number-of-functions-in-python/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:33Z"
class="relativetime">9m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
}
來,if 成立跟不成立的兩段,幾乎都一樣,
但是有一個地方套用的 css 不同,完全就是你所舉的例子,
那你現在就是接手的那個人,
現在客戶有兩個要求:
1. 他 else 的地方要換一種 css,請把那個不同的找出來吧。
2. 不管 if 成立不成立,他在尾端倒數第二個 div 要換個字體。
靠北,嘴炮都很簡單,
if ( n % 2 ) {
/// 幾百行前半部
xxxx
/// 幾百行後半部
}
else {
/// 幾百行前半部
oooo
/// 幾百行後半部
}
這樣虛擬碼寫起來的確不一樣的地方一眼就可以看到,
請問他媽的真的幾百行展開的時候,你還會跟我說那叫做好 maintain 嗎?
你知道什麼叫做好 maintain 嗎?
if ( n % 2 ) {
幾百行前半部() ;
xxxx
幾百行後半部() ;
}
else {
幾百行前半部() ;
oooo
幾百行後半部() ;
}
你沒發現你舉的例子,
剛好就是在說明為什麼應該要抽函數嗎?
或是你要
幾百行前半部() ;
n % 2 ? xxxx : oooo ;
幾百行後半部() ;
也行,都比他媽的幾百行還要好好嗎?
用點腦,我不是說你沒用腦,我只是希望你多思考,
真的 code 擺在眼前的時候,你再說說看 duplicated code 好 maintain 阿?
說阿。
--
To iterate is human, to recurse, divine.
遞迴只應天上有, 凡人該當用迴圈. L. Peter Deutsch
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.116.174
→
05/17 01:08, , 1F
05/17 01:08, 1F
→
05/17 01:16, , 2F
05/17 01:16, 2F
→
05/17 01:17, , 3F
05/17 01:17, 3F
推
05/17 01:17, , 4F
05/17 01:17, 4F
→
05/17 01:18, , 5F
05/17 01:18, 5F
→
05/17 01:18, , 6F
05/17 01:18, 6F
→
05/17 01:19, , 7F
05/17 01:19, 7F
→
05/17 01:19, , 8F
05/17 01:19, 8F
→
05/17 01:19, , 9F
05/17 01:19, 9F
→
05/17 01:19, , 10F
05/17 01:19, 10F
→
05/17 01:19, , 11F
05/17 01:19, 11F
→
05/17 01:19, , 12F
05/17 01:19, 12F
→
05/17 01:20, , 13F
05/17 01:20, 13F
→
05/17 01:20, , 14F
05/17 01:20, 14F
→
05/17 01:20, , 15F
05/17 01:20, 15F
→
05/17 01:21, , 16F
05/17 01:21, 16F
→
05/17 01:21, , 17F
05/17 01:21, 17F
→
05/17 01:23, , 18F
05/17 01:23, 18F
→
05/17 01:23, , 19F
05/17 01:23, 19F
→
05/17 01:24, , 20F
05/17 01:24, 20F
→
05/17 01:27, , 21F
05/17 01:27, 21F
→
05/17 01:27, , 22F
05/17 01:27, 22F
→
05/17 01:28, , 23F
05/17 01:28, 23F
→
05/17 01:29, , 24F
05/17 01:29, 24F
→
05/17 01:29, , 25F
05/17 01:29, 25F
→
05/17 01:30, , 26F
05/17 01:30, 26F
→
05/17 02:02, , 27F
05/17 02:02, 27F
推
05/17 09:43, , 28F
05/17 09:43, 28F
→
05/17 12:03, , 29F
05/17 12:03, 29F
→
05/17 12:03, , 30F
05/17 12:03, 30F
推
05/17 12:05, , 31F
05/17 12:05, 31F
→
05/17 12:06, , 32F
05/17 12:06, 32F
→
05/17 12:11, , 33F
05/17 12:11, 33F
→
05/17 12:11, , 34F
05/17 12:11, 34F
→
05/17 12:12, , 35F
05/17 12:12, 35F
→
05/17 12:12, , 36F
05/17 12:12, 36F
推
05/17 12:17, , 37F
05/17 12:17, 37F
→
05/17 12:18, , 38F
05/17 12:18, 38F
→
05/17 12:18, , 39F
05/17 12:18, 39F
還有 23 則推文
→
05/17 23:02, , 63F
05/17 23:02, 63F
→
05/17 23:03, , 64F
05/17 23:03, 64F
→
05/17 23:33, , 65F
05/17 23:33, 65F
→
05/18 01:58, , 66F
05/18 01:58, 66F
推
05/18 02:13, , 67F
05/18 02:13, 67F
→
05/18 02:13, , 68F
05/18 02:13, 68F
→
05/18 02:14, , 69F
05/18 02:14, 69F
→
05/18 02:15, , 70F
05/18 02:15, 70F
推
05/18 02:32, , 71F
05/18 02:32, 71F
→
05/18 02:40, , 72F
05/18 02:40, 72F
→
05/18 02:41, , 73F
05/18 02:41, 73F
→
05/18 02:43, , 74F
05/18 02:43, 74F
→
05/18 02:44, , 75F
05/18 02:44, 75F
推
05/18 02:49, , 76F
05/18 02:49, 76F
→
05/18 02:53, , 77F
05/18 02:53, 77F
→
05/18 02:54, , 78F
05/18 02:54, 78F
推
05/18 05:36, , 79F
05/18 05:36, 79F
→
05/18 05:37, , 80F
05/18 05:37, 80F
→
05/18 08:03, , 81F
05/18 08:03, 81F
推
05/18 08:18, , 82F
05/18 08:18, 82F
→
05/18 08:22, , 83F
05/18 08:22, 83F
→
05/18 08:23, , 84F
05/18 08:23, 84F
→
05/18 08:26, , 85F
05/18 08:26, 85F
→
05/18 08:26, , 86F
05/18 08:26, 86F
→
05/18 08:27, , 87F
05/18 08:27, 87F
→
05/18 08:28, , 88F
05/18 08:28, 88F
→
05/18 08:29, , 89F
05/18 08:29, 89F
→
05/18 08:30, , 90F
05/18 08:30, 90F
→
05/18 08:30, , 91F
05/18 08:30, 91F
→
05/18 08:31, , 92F
05/18 08:31, 92F
→
05/18 08:34, , 93F
05/18 08:34, 93F
→
05/18 08:35, , 94F
05/18 08:35, 94F
→
05/18 08:36, , 95F
05/18 08:36, 95F
→
05/18 08:37, , 96F
05/18 08:37, 96F
→
05/18 08:37, , 97F
05/18 08:37, 97F
→
05/18 08:38, , 98F
05/18 08:38, 98F
→
05/18 23:00, , 99F
05/18 23:00, 99F
→
05/18 23:00, , 100F
05/18 23:00, 100F
→
05/18 23:00, , 101F
05/18 23:00, 101F
推
05/20 00:39, , 102F
05/20 00:39, 102F
討論串 (同標題文章)
完整討論串 (本文為第 22 之 31 篇):