user
ambrus
<!-- location:latitude=47.31.00.0,longitude=19.07.00.0 --><!-- Hungary -->
<!-- birthday:1985/07/20 -->
<!-- email:ambrus@math.bme.hu -->
<!-- kw: Budapest, Hungary -->
<p>
<b>Image:</b> colorful houses in Stortorget, Gamla stan, Stockholm, Sweden, 2014.
<p>
<a href="http://www.math.bme.hu/~ambrus/sc/">My homepage</a> doesn't have anything interesting on it.
<P>To determine if a number is odd or even, the worst way is:
<code>
$odd=0;{local($SIG{__WARN__},$^W)=(sub{$odd++})x2;+{1..abs($n)}};
</code>
<P>
There are several completely different programming concepts called a <strong>select statement</strong>. They are
<ul>
<li>
The select system call in unix, which is the most common way a process can wait for events and give up the process's claim on CPU. Its prototype is <C>int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);</c>. It also has a perl interface: the select builtin function which has three or four arguments.
<li>
The one-argument select function of perl, which selects a filehandle to be the default filehandle, so that unqalified print operations and a few special variables would refer to it. This accidentally has the same name as the previously mentioned select function, and can only be distinguished by the number of arguments.
<li>
The select special command in bash-like shells, which is a loop construct that prints a simple text-based menu and reads user input.
<li>
The SELECT construct in the SQL language.
<li>
The SELECT special statement in newer dialects of BASIC, which is similar to pascal or scheme <em>case</em> statements. It dispatches between multiple choices comparing a single value to different constants for each branch. In earlier BASICs, the ON ... GOTO construct was used instead.
<li>
It is not a statement, but smalltalk and ruby have a select method which filter elements from a list, similarly to perl's builtin function grep. Also both maple and mathematica have functions called select and Select resp., and these serve the same purpose.
<li>
Also not a statement, but HTML has a select element that is a form control displaying a dropdown list. Related to this, the CGI perl module has a Select function and method, and the WWW::Mechanize module has a [id://701312|select] method. (One could say though that this has the same etimology as the select statement in shells.)
<li>
However, HTML DOM also has a select event (unrelated to the select element) and HTML has a corresponding onselect attribute, which is called when the user changes the selection in a text input field.
<li>
The Magma computer algebra system has [http://magma.maths.usyd.edu.au/magma/handbook/text/11#61|a select keyword] which it uses in the conditional expression. The select function in Eigen is an elementwise conditional.
<li>
In the INTERCAL esoteric language, the <c>~</c> binary operator, called select, which does a compress operation on bits.
</ul>
<P>
Ok, after all this rant, here's something that's actually useful to know. The formulae to solve the quadratic equation<br>
<i>a</i> <i>x</i>^2 + <i>b</i> <i>x</i> + <i>c</i> = 0<br>
are:<br>
<i>x</i>_1 = -(<i>b</i> + sgn(<i>b</i>) sqrt(<i>b</i>^2 - 4 <i>a</i> <i>c</i>))/(2 <i>a</i>)<br>
<i>x</i>_2 = <i>c</i>/(<i>a</i> <i>x</i>_1)
<p>
Perl Quiz of The Week #21 (20040805): Task scheduling. [http://article.gmane.org/gmane.comp.lang.perl.qotw.discuss/2005|my solution] [http://article.gmane.org/gmane.comp.lang.perl.qotw.quiz-of-the-week/102|discussion].
<p>
Perl Quiz of the Week Expert #22 (20040825): Word ladder. [http://article.gmane.org/gmane.comp.lang.perl.qotw.discuss/2118|my solution] [http://article.gmane.org/gmane.comp.lang.perl.qotw.quiz-of-the-week/109|discussion].
<p>
Favourite pentomino pattern:
<TABLE border=0 cellspacing=0><COLGROUP span=10 width=25><TR height=25><TD bgcolor=#80C rowspan=4><TD bgcolor=#80C><TD bgcolor=#FF8 colspan=5><TD bgcolor=#4F4 colspan=3><TR height=25><TD bgcolor=#8C0 colspan=3><TD bgcolor=#44F colspan=4><TD bgcolor=#08C><TD bgcolor=#4F4 rowspan=2><TR height=25><TD bgcolor=#0C8><TD bgcolor=#0C8 rowspan=3><TD bgcolor=#8C0 colspan=2><TD bgcolor=#44F><TD bgcolor=#08C colspan=3><TR height=25><TD bgcolor=#8FF><TD bgcolor=#0C8><TD bgcolor=#C08><TD bgcolor=#F44 rowspan=2><TD bgcolor=#08C><TD bgcolor=#F8F><TD bgcolor=#C80><TD bgcolor=#C80 rowspan=3><TR height=25><TD bgcolor=#8FF colspan=2 rowspan=2><TD bgcolor=#C08 colspan=2><TD bgcolor=#F8F colspan=3><TR height=25><TD bgcolor=#C08 colspan=2><TD bgcolor=#F44 colspan=3><TD bgcolor=#F8F><TD bgcolor=#C80></TABLE>
<!--
<TABLE border="5" cellspacing="0">
<COLGROUP span="10" width="25"></COLGROUP>
<TR height="25"><TD bgcolor="#8000c0" colspan="2"><TD bgcolor="#ffff81" colspan="5"><TD bgcolor="#40ff40" colspan="3">
<TR height="25"><TD bgcolor="#8000c0" colspan="1"><TD bgcolor="#80c000" colspan="3"><TD bgcolor="#4040ff" colspan="4"><TD bgcolor="#0080c0" colspan="1"><TD bgcolor="#40ff40" colspan="1">
<TR height="25"><TD bgcolor="#8000c0" colspan="1"><TD bgcolor="#00c080" colspan="2"><TD bgcolor="#80c000" colspan="2"><TD bgcolor="#4040ff" colspan="1"><TD bgcolor="#0080c0" colspan="3"><TD bgcolor="#40ff40" colspan="1">
<TR height="25"><TD bgcolor="#8000c0" colspan="1"><TD bgcolor="#81ffff" colspan="1"><TD bgcolor="#00c080" colspan="2"><TD bgcolor="#c00080" colspan="1"><TD bgcolor="#ff4040" colspan="1"><TD bgcolor="#0080c0" colspan="1"><TD bgcolor="#ff81ff" colspan="1"><TD bgcolor="#c08000" colspan="2">
<TR height="25"><TD bgcolor="#81ffff" colspan="2"><TD bgcolor="#00c080" colspan="1"><TD bgcolor="#c00080" colspan="2"><TD bgcolor="#ff4040" colspan="1"><TD bgcolor="#ff81ff" colspan="3"><TD bgcolor="#c08000" colspan="1">
<TR height="25"><TD bgcolor="#81ffff" colspan="2"><TD bgcolor="#c00080" colspan="2"><TD bgcolor="#ff4040" colspan="3"><TD bgcolor="#ff81ff" colspan="1"><TD bgcolor="#c08000" colspan="2">
</TABLE>
-->
2024-03-28 09:13:41
21002
358307
371752
2802
Budapest
Europe/Rome
on
on