A function with 'and' , 'not' , 'null' , 'car' and 'cdr'What's this ?
(defun enigma (x)
(and (not (null x))
(or (null (car x))
(enigma (cdr x)))))
"I suppose I should learn Lisp, but it seems so foreign."
- Paul Graham, Nov 1983
On Wed, Oct 07 2015, CAI GENGYANG wrote:
> What's this ?
>
>
> (defun enigma (x)
> (and (not (null x))
> (or (null (car x))
> (enigma (cdr x)))))
Bad taste? It returns T if the list X contains nil as an element. It
would be clearer to write (some #'null x).
Helmut
CAI GENGYANG ...
'is not' or '!='A newbie question to you; what is the difference between statements
like:
if x is not None:
and
if x != None:
Without any context, which one should be preferred?
IMHO, the latter is more readable.
On 2014-08-18 21:35, ElChino wrote:
> A newbie question to you; what is the difference between statements
> like:
> if x is not None:
> and
> if x != None:
>
> Without any context, which one should be preferred?
> IMHO, the latter is more readable.
>
"x == y" tells you whether x and y refer to objects that are equal.
"x is y&qu...
'^=' and '~='?Hello,
What is the difference between '^=' and '~='?
Thanks,
Duckhye
...
Difference between 'function' and 'method'Howdy everyone,
This is a big problem puzzles me for a long time. The core question is:
How to dynamically create methods on a class or an instance?
Let me state it step by step.
1.
def gunc(self):
pass
class A(object):
def func(self):
pass
a = A()
a.func # gives "bound method", type is "instancemethod"
A.func # gives "unbound method", type is "instancemethod"
gunc # gives "function", type if "function"
# ?? Does this line attach a method to instance? ... I don't think so.
a.gunc = gunc
I found star...
difference between ',' and 'a,'Small question. In gforth is there a difference between the words ',' and 'a,'?
I'm thinking not, so perhaps another question, why have both ',' and 'a,'?
Thanks
Should be the same, in gforth:
see ,
: ,
here cell allot ! ; ok
see a,
: ,
here cell allot ! ; ok
On Friday, January 9, 2015 at 5:46:04 AM UTC-8, beeflo wrote:
> Small question. In gforth is there a difference between the words ',' and 'a,'?
>
> I'm thinking not, so perhaps another question, why have both ',' and 'a,'...
Difference between 'is' and '=='Hey guys, this maybe a stupid question, but I can't seem to find the
result anywhere online. When is the right time to use 'is' and when
should we use '=='?
Thanks alot~
mwql:
>Hey guys, this maybe a stupid question, but I can't seem to find the
>result anywhere online. When is the right time to use 'is' and when
>should we use '=='?
http://docs.python.org/ref/comparisons.html
--
Ren� Pijlman
mwql wrote:
> Hey guys, this maybe a stupid question, but I can't seem to find the
> result anywhere online. When is the right time to ...
'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''Hello fellow programmers,
I am trying to run an append/update query from code, a command button
on a form initiates the queries.
the format i am using is;
_____________________________________________________
SELECT "criteria"
FROM "criteria"
WHERE "criteria"
UPDATE/APPEND "field selections"
RecordSource "qryExample" = above text strings"
_______________________________________________________________________
When i am running a SELECT query in this manner it works fine with no
problems, and accepts the values of specified linked for...
calling '!' or 'system' in matlab different than same functions from shellHi everyone,
When I am in the shell (tcsh) on my Mac (outside Matlab), I am able to
use the command line utility ncdump to read netcdf format files
(http://www.unidata.ucar.edu/software/netcdf/):
ncdump -h testfile.nc
However, in Matlab, the same command preceded by the '!' (or using
'system') generates an error:
>> !ncdump -h test.nc
dyld: Library not loaded: /opt/local/lib/libnetcdf.7.dylib
Referenced from: /opt/local/bin/ncdump
Reason: Incompatible library version: ncdump requires version 10.0.0
or later, but libnetcdf.7.dylib provides version ...
'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2Hi,
Thanks for ur help there HJ.
I know how to do the tasks you specified there.
I would like for the update query to use field values from some of the
fields on the form (frmInvoices) such as InvoiceNumber, DateFrom,
DateTo. My problem is that an append/update query can't find the
values in the open Form (frmInvoices) when I specify them as;
[Forms]![frmInvoices]![InvoiceNumber]
a select query has no problem finding the field values on a form.
please help.
Aaron
Hi Aaron,
Could you post the entire code that you are having trouble with? Now it is
not possible to see what goes wron...
if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?Hi, there.
=20
I'm just curious if it ever dawned on anybody how to abbreviate this
line :
if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in
('','.')=20
=20
Igor Kurbeko
Clinical Programmer Analyst
678 336 4328
ikurbeko@atherogenics.com
=20
no brain no pain
=20
how about:
if not (str_mo in ('','.') or str_da in ('','.') or str_yy in
('','.'))
OR
if not (missing(str_mo) or missing(str_da) or missing(str_yy))
Eric
On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...
difference between 'start' and 'preview' functionwhat is the difference between 'start function' and 'preview function' in image aquitition toolbox?
eg. start(vid); and preview(vid);
Thank you.
...
Error while obtaining sizes from MEX S-function 'forward' in block 'dummy/Dynamic_Model/S-Function'. MATLAB error message:.Hi to everybody,
I created the file forward.dll using the command:
mex -DWIN32 -output forward model_d.c model_s.c sdlib.c assigns.c contact.c
derivs.c gmc.c impact.c inits.c invert.c lcp_solver.c lmdif_c.c mathtools.c
object.c output.c pipetools.c readmuscles.c readtools.c sdfor.c
spring_based.c wrapping.c gcvspl.c user_def.lib forward.lib acpp.lib
qhull.lib solid.lib wrap.lib
I need to run the command:
set_param([subsystemname,'/','S-Function'],'function
name','forward','parameters','[0],[0],[0],[0],[0],[0],[1 0 0 0 20],[0]');
...
What's the difference between 'upfirdn' and 'conv' ?Hello to everyone,
I try to figure out what's the difference between upfirdn and conv regarding the convolution operation.
I pass a signal through a bank filter 32-channel filter bank. I have two method for computing the output signal at the analysis filter bank.
I can use the upfirdn command like this :
yout=upfirdn(input,H_analysis,1,32);
H_analysis is my analysis filter bank.
Otherwise I can compute the output signal like this :
for k=1:32
yout(k,:)=downsample(conv(H_analysis(k,:),input),32);
end
It should be the same operation, but why do I have different le...
What's the difference between 'close' and 'delete'?Dear all
As you know, close(h) and delete(h) both methods can close figure
window, when h is a handle of a figure. What's the difference between
the two methods?
Regards
Mayi DA
2007-11-26
"Damayi" <damayi@gmail.com> wrote in message
news:3208c5ed-fbde-4f87-9342-36e6fffd98bb@s36g2000prg.googlegroups.com...
> Dear all
>
> As you know, close(h) and delete(h) both methods can close figure
> window, when h is a handle of a figure. What's the difference between
> the two methods?
CLOSE calls the function specified in the CloseRequestFcn property of the
...