f



can 'train' be used with 'newpnn'

Can we use the 'train' command of the NN toolbox to train a neural network obtained from a PNN model, similar to the way we would train a network obtained from using newff?

for example, let us say I have inputs and targets and I can use newpnn command to generate network parameters from the PNN model as follows
P = [1 2 3 4 5 6 7];
Tc = [1 2 3 2 2 3 1];
T = ind2vec(Tc)
net = newpnn(P,T);

can this 'net' obtained as an output from newpnn be trained using the train command like

net.trainFcn = 'trainbfg';
net.trainParam.epochs = 1000;
net.trainParam.goal = 0.0001;
net=train(net,P,T);

I know we can train the net obtained from newff but when I tried training the net obtained from newpnn I am getting the following error msg

??? Error using ==> feval
Invalid function name ''

Error in ==> calcgx at 90
gX_direct = feval(net.performFcn,'dx',E,Y,net,perf,net.performParam);

Error in ==> trainbfg at 320
    gX = -calcgx(net,X,trainV.Pd,Zb,Zi,Zl,N,Ac,El,perf,Q,TS);

Error in ==> network.train at 216
  [net,tr] = feval(net.trainFcn,net,tr,trainV,valV,testV);

Error in ==> 
net=train(net,P,T);

I appreciate any kind of suggestions
Thanks
Kadambari
0
Kadi
4/22/2010 4:47:08 PM
comp.soft-sys.matlab 211266 articles. 18 followers. lunamoonmoon (258) is leader. Post Follow

11 Replies
763 Views

Similar Articles

[PageSpeed] 51

On Apr 22, 12:47=A0pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> Can we use the 'train' command of the NN toolbox to train a neural
> network obtained from a PNN model, similar to the way we would
> train a network obtained from using newff?

No. Spreads have to be chosen by trial and error.

If you wish to have fewer nodes than training vectors,
use newrb.

However, spreads still have to be chosen by trial and error.

Search on

greg heath RBFNN


> for example, let oufrom the PNN model as follows
> P =3D [1 2 3 4 5 6 7];
> Tc =3D [1 2 3 2 2 3 1];
> T =3D ind2vec(Tc)
> net =3D newpnn(P,T);
>
> can this 'net' obtained as an output from newpnn be trained using the tra=
in command like
>
> net.trainFcn =3D 'trainbfg';
> net.trainParam.epochs =3D 1000;
> net.trainParam.goal =3D 0.0001;
> net=3Dtrain(net,P,T);
>
> I know we can train the net obtained from newff but when I tried training=
 the net obtained from newpnn I am getting the following error msg
>
> ??? Error using =3D=3D> feval
> Invalid function name ''
>
> Error in =3D=3D> calcgx at 90
> gX_direct =3D feval(net.performFcn,'dx',E,Y,net,perf,net.performParam);
>
> Error in =3D=3D> trainbfg at 320
> =A0 =A0 gX =3D -calcgx(net,X,trainV.Pd,Zb,Zi,Zl,N,Ac,El,perf,Q,TS);
>
> Error in =3D=3D> network.train at 216
> =A0 [net,tr] =3D feval(net.trainFcn,net,tr,trainV,valV,testV);
>
> Error in =3D=3D>
> net=3Dtrain(net,P,T);
>
> I appreciate any kind of suggestions

What, exactly, do you want the training agorithm to change?

Greg
0
Greg
4/22/2010 7:03:29 PM
Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. But I am 
not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn. 

Kadi
0
Kadi
4/23/2010 7:04:04 PM
On Apr 23, 3:04=A0pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> Well, what I am actually trying to do is, I have input data (P) and the t=
arget class information (T). I built a pnn model using newpnn command of NN=
 toolbox that uses the data and builds a neural network model. I used the e=
ntire data for validation and by trail and error found the spread value tha=
t gives the best classification. Then instead of using the entire data for =
training and validation I implemented crossvalidation. I am getting good re=
sults but when I used new unknown data that doesn't exactly match any of th=
e samples in the training data, for validation the results were not good at=
 all. And I told that the PNN is not really trained. The training set input=
 vectors simply become the first layer weights and the second layer weights=
 are set to the target vectors in the training set. So I tried to train the=
 network obtained from the newpnn command using the train function. But I a=
m
> not sure if we can use train command with newpnn because all of the examp=
les that I have seen used newff instead of newpnn.

The only training that can be done on NEWPNN is to
change the spread. There is no special function for that.

Try NEWRB. It is better. However, it still has deficiencies.
Search on

greg heath RBFNN

Hope this helps.

Greg.
0
Greg
4/23/2010 7:30:24 PM
Thanks for the immediate response. Just one more question. Is newrb better than newff?

Thanks
Kadi

Greg Heath <heath@alumni.brown.edu> wrote in message <ac672c79-2db1-41ed-abf7-831246e9e9d3@g11g2000yqe.googlegroups.com>...
> On Apr 23, 3:04 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. But I 
am 
> > not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn.
> 
> The only training that can be done on NEWPNN is to
> change the spread. There is no special function for that.
> 
> Try NEWRB. It is better. However, it still has deficiencies.
> Search on
> 
> greg heath RBFNN
> 
> Hope this helps.
> 
> Greg.
0
Kadi
4/23/2010 7:51:09 PM
CORRECTED FOR THE HEINOUS SIN OF TOP POSTING

On Apr 23, 3:51=A0pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> Greg Heath <he...@alumni.brown.edu> wrote in message
<ac672c79-2db1-41ed-abf7-831246e9e...@g11g2000yqe.googlegroups.com>...
> > On Apr 23, 3:04=A0pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > > Well, what I am actually trying to do is, I have input data (P) and t=
he target class information (T). I built a pnn model using newpnn command o=
f NN toolbox that uses the data and builds a neural network model. I used t=
he entire data for validation and by trail and error found the spread value=
 that gives the best classification. Then instead of using the entire data =
for training and validation I implemented crossvalidation. I am getting goo=
d results but when I used new unknown data that doesn't exactly match any o=
f the samples in the training data, for validation the results were not goo=
d at all. And I told that the PNN is not really trained. The training set i=
nput vectors simply become the first layer weights and the second layer wei=
ghts are set to the target vectors in the training set. So I tried to train=
 the network obtained from the newpnn command using the train function. But=
 I
> am
> > > not sure if we can use train command with newpnn because all of the e=
xamples that I have seen used newff instead of newpnn.
>
> > The only training that can be done on NEWPNN is to
> > change the spread. There is no special function for that.
>
> > Try NEWRB. It is better. However, it still has deficiencies.
> > Search on
>
> > greg heath RBFNN

 > Thanks for the immediate response. Just one more question. Is
newrb
> better than newff?

The MLP and RBF are universal aprroximators. Which one is better
for a particular data set depends on the data. Typically, some
knowledge
of the data via prior information and visual displays leads the
designer
to favor one over the other. In general, trial and error is king.

The MATLAB versions of both NEWRB and NEWFF have annoying
limitations on which I have commented in previous posts. Most notably
is the inability to use cross-entropy performance functions and the
softmax activation function. In addition, NEWRB would be considerable
improved if a nonempty initial hidden node configuration could be
specified and hidden nodes were not constrained to have identical
spreads.

Hope this helps.

Greg.

0
Greg
4/24/2010 3:02:40 AM
Thanks for the info. That was helpful

Kadi

Greg Heath <heath@alumni.brown.edu> wrote in message <d44839e9-e66e-4504-a7cf-d7828758beba@g23g2000yqn.googlegroups.com>...
> CORRECTED FOR THE HEINOUS SIN OF TOP POSTING
> 
> On Apr 23, 3:51 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > Greg Heath <he...@alumni.brown.edu> wrote in message
> <ac672c79-2db1-41ed-abf7-831246e9e...@g11g2000yqe.googlegroups.com>...
> > > On Apr 23, 3:04 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > > > Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. 
But I 
> > am
> > > > not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn.
> >
> > > The only training that can be done on NEWPNN is to
> > > change the spread. There is no special function for that.
> >
> > > Try NEWRB. It is better. However, it still has deficiencies.
> > > Search on
> >
> > > greg heath RBFNN
> 
>  > Thanks for the immediate response. Just one more question. Is
> newrb
> > better than newff?
> 
> The MLP and RBF are universal aprroximators. Which one is better
> for a particular data set depends on the data. Typically, some
> knowledge
> of the data via prior information and visual displays leads the
> designer
> to favor one over the other. In general, trial and error is king.
> 
> The MATLAB versions of both NEWRB and NEWFF have annoying
> limitations on which I have commented in previous posts. Most notably
> is the inability to use cross-entropy performance functions and the
> softmax activation function. In addition, NEWRB would be considerable
> improved if a nonempty initial hidden node configuration could be
> specified and hidden nodes were not constrained to have identical
> spreads.
> 
> Hope this helps.
> 
> Greg.
0
Kadi
4/26/2010 2:20:27 PM
Hi

Instead of using newpnn, I tried using newrb for creating the network parameters. By adjusting the goal, spread, MN and DF I was able to achieve good classification but I do have one question. Is the 'net' obtained from newrb a trained network? and can I use the train command to train this network?

Thanks
Kadi

"Kadi " <n_kadambari@yahoo.com> wrote in message <hr47fb$rs7$1@fred.mathworks.com>...
> Thanks for the info. That was helpful
> 
> Kadi
> 
> Greg Heath <heath@alumni.brown.edu> wrote in message <d44839e9-e66e-4504-a7cf-d7828758beba@g23g2000yqn.googlegroups.com>...
> > CORRECTED FOR THE HEINOUS SIN OF TOP POSTING
> > 
> > On Apr 23, 3:51 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > > Greg Heath <he...@alumni.brown.edu> wrote in message
> > <ac672c79-2db1-41ed-abf7-831246e9e...@g11g2000yqe.googlegroups.com>...
> > > > On Apr 23, 3:04 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > > > > Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. 

> But I 
> > > am
> > > > > not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn.
> > >
> > > > The only training that can be done on NEWPNN is to
> > > > change the spread. There is no special function for that.
> > >
> > > > Try NEWRB. It is better. However, it still has deficiencies.
> > > > Search on
> > >
> > > > greg heath RBFNN
> > 
> >  > Thanks for the immediate response. Just one more question. Is
> > newrb
> > > better than newff?
> > 
> > The MLP and RBF are universal aprroximators. Which one is better
> > for a particular data set depends on the data. Typically, some
> > knowledge
> > of the data via prior information and visual displays leads the
> > designer
> > to favor one over the other. In general, trial and error is king.
> > 
> > The MATLAB versions of both NEWRB and NEWFF have annoying
> > limitations on which I have commented in previous posts. Most notably
> > is the inability to use cross-entropy performance functions and the
> > softmax activation function. In addition, NEWRB would be considerable
> > improved if a nonempty initial hidden node configuration could be
> > specified and hidden nodes were not constrained to have identical
> > spreads.
> > 
> > Hope this helps.
> > 
> > Greg.
0
Kadi
4/27/2010 4:38:05 PM
PLEASE DO NOT TOP POST
POST YOUR REPLIES WITHIN AND/OR AFTER THE PREVIOUS POST.

On Apr 27, 12:38=A0pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> Hi
>
> Instead of using newpnn, I tried using newrb for creating the network par=
ameters. By adjusting the goal, spread, MN and DF I was able to achieve goo=
d classification but I >do have one question. Is the 'net' obtained from ne=
wrb a trained network?

Yes

> and can I use the train command to train this network?

No.

Hope this helps.

Greg
0
Greg
4/28/2010 1:41:19 AM
Greg Heath <heath@alumni.brown.edu> wrote in message <34b9e249-cac9-4183-a3a2-57820f6382e8@r9g2000vbk.googlegroups.com>...
> PLEASE DO NOT TOP POST
> POST YOUR REPLIES WITHIN AND/OR AFTER THE PREVIOUS POST.
> 
> On Apr 27, 12:38 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > Hi
> >
> > Instead of using newpnn, I tried using newrb for creating the network parameters. By adjusting the goal, spread, MN and DF I was able to achieve good classification but I do have one question. Is the 'net' obtained from newrb a trained network?
> 
> Yes
> 
> > and can I use the train command to train this network?
> 
> No.
> 
> Hope this helps.
> 
> Greg

Hi

I want to use 'softmax' transfer function instead of 'purelin' for the last layer of the radial basis network because I think, and correct me if I am wrong, that softmax would give out Bayes posterior probabilities. I would implement this as follows

net_rb = newrb(P,T,goal,spread,MN,DF);
net_rb.layers{2}.transferFcn = 'softmax';

Is this a right way of doing it? Can we force the transfer function of the second layer to be a softmax function. I was looking at some of your old posts and in one of them you said Matlab 2007 does not allow softmax to be used as the transfer function of the output layer. Does this hold true for 2009b version too?

Thanks
Kadi
0
Kadi
4/28/2010 3:18:05 PM
"Kadi " <n_kadambari@yahoo.com> wrote in message <hr9jjd$3ej$1@fred.mathworks.com>...
> Greg Heath <heath@alumni.brown.edu> wrote in message <34b9e249-cac9-4183-a3a2-57820f6382e8@r9g2000vbk.googlegroups.com>...
> > PLEASE DO NOT TOP POST
> > POST YOUR REPLIES WITHIN AND/OR AFTER THE PREVIOUS POST.
> > 
> > On Apr 27, 12:38 pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > > Hi
> > >
> > > Instead of using newpnn, I tried using newrb for creating the network parameters. By adjusting the goal, spread, MN and DF I was able to achieve good classification but I do have one question. Is the 'net' obtained from newrb a trained network?
> > 
> > Yes
> > 
> > > and can I use the train command to train this network?
> > 
> > No.
> > 
> > Hope this helps.
> > 
> > Greg
> 
> Hi
> 
> I want to use 'softmax' transfer function instead of 'purelin' for the last layer of the radial basis network because I think, and correct me if I am wrong, that softmax would give out Bayes posterior probabilities. I would implement this as follows
> 
> net_rb = newrb(P,T,goal,spread,MN,DF);
> net_rb.layers{2}.transferFcn = 'softmax';
> 
> Is this a right way of doing it? Can we force the transfer function of the second layer to be a softmax function. I was looking at some of your old posts and in one of them you said Matlab 2007 does not allow softmax to be used as the transfer function of the output layer. Does this hold true for 2009b version too?
> 
> Thanks
> Kadi

I have been reading more into this and I think I now understand what you meant when you said that Matlab does not allow the use of 'softmax' as the transfer function for output layer of pnn or rbf models. Looks like the output layer transfer function for rbf is always fixed as purelin and can be changed to softmax only post training. 

I looked at the net parameter generated by the newrb command and I see that under functions
functions:

          adaptFcn: (none)
         divideFcn: (none)
       gradientFcn: (none)
           initFcn: (none)
        performFcn: 'mse'
          plotFcns: {}
          trainFcn: (none)

the trainFcn is listed as 'none' and this is the reason why I was wondering if the network obtained from newrb is trained or if I have to train it separately using the train command.

Thanks
Kadi
0
Kadi
4/28/2010 8:49:04 PM
On Apr 28, 11:18=A0am, "Kadi " <n_kadamb...@yahoo.com> wrote:
> Greg Heath <he...@alumni.brown.edu> wrote in message <34b9e249-cac9-4183-=
a3a2-57820f638...@r9g2000vbk.googlegroups.com>...
> > PLEASE DO NOT TOP POST
> > POST YOUR REPLIES WITHIN AND/OR AFTER THE PREVIOUS POST.
>
> > On Apr 27, 12:38=A0pm, "Kadi " <n_kadamb...@yahoo.com> wrote:
> > > Hi
>
> > > Instead of using newpnn, I tried using newrb for creating the network=
 parameters. By adjusting the goal, spread, MN and DF I was able to achieve=
 good classification but I do have one question. Is the 'net' obtained from=
 newrb a trained network?
>
> > Yes
>
> > > and can I use the train command to train this network?
>
> > No.
>
> > Hope this helps.
>
> > Greg
>
> Hi
>
> I want to use 'softmax' transfer function instead of 'purelin' for the la=
st layer of the radial basis network because I think, and correct me if I a=
m wrong, that softmax would give out Bayes posterior probabilities.

As long as the tatgets are {0,1}, purelin, logsig and softmax
would all yield estimates of the class probabilities conditonal
on the input.

However, purelin does not yield  0<=3Dy<=3D1 and logsig
does not satisfy  sum(y) =3D 1.

>I would implement this as follows
>
> net_rb =3D newrb(P,T,goal,spread,MN,DF);
> net_rb.layers{2}.transferFcn =3D 'softmax';
>
> Is this a right way of doing it? Can we force the transfer function of th=
e second layer to be a softmax function. I was looking at some of your old =
posts and in one of them you said Matlab 2007 does not allow softmax to be =
used as the transfer function of the output layer. Does this hold true for =
2009b version too?

AFAIK neither softmax nor crossentropy can be used in any
MATLAB training algorithm without modifying source code.
Although I have posted  instructions on how to define dsoftmax
for use with gradient training, it obviously doesn't apply to newrb.

greg heath dsoftmax
greg heath softmax

Hope this helps.

Greg
0
Greg
4/29/2010 1:03:53 AM
Reply:

Similar Artilces:

'''''''''''''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...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, 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 wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > 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 First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

'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" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

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...

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 ...

Why use '==' instead of '==='?
I have noticed that there are some on the news group here who prefer the use of '==' when it is known [by the coder] that both sides of the equation are strings. Example from one of David Mark's recent posts: >>if ( typeof selector === "string" ) { > > One equal sign too many, requiring the reader to pause and ponder what > the author's intentions were. Are they ignorant of the fact that the > resultof a typeof operation is a string (as is a string literal). I find it it just the reverse. I know exactly what the authors intent was ...

In replies, using 'To:' as 'From:'
Hi, all. I have two email accounts: a personal one and a university-issued one. My university gives me the option of forwarding its incoming mail to my personal email account. I would like to do this to avoid having two separate Mutt configurations and checking two accounts, but the problem is that I want replies to appear from the correct account. That is, if I get an email to my university account and decide to reply, the From: header should show my university email address. Same for emails to my personal account. Ideally I can also choose the From: header of newly-composed messages without manually editing the header, but that's not necessary. Is this scenario possible with Mutt? Thank you. -- PGP key: http://www.qnan.org/~pmw/pgp/public.asc Philip M. White <pmw+news@qnan.org> wrote: > I have two email accounts: a personal one and a university-issued > one. {...} That is, if I get an email to my university account and > decide to reply, the From: header should show my university email > address. Same for emails to my personal account. See wiki-faq. > Ideally I can also choose the From: header of newly-composed > messages without manually editing the header, but that's not > necessary. See wiki, maybe in ConfigTricks. -- � Rado S. -- You must provide YOUR effort for your goal! EVERY effort counts: at least to show your attitude. You're responsible for ALL you do: you get what...

Placement of 'use', 'my'?
I've been placing 'use' statements as close as possible to the actual invocation of the module's subroutines, sometimes even placing them in a loop: #Hypothetical code... while (<>) { if (/^new_student\t(.*)$/) { use Student; my $student = new Student($1); } } The goal is to ensure that if I someday take that code out, the use statement is taken out as well. Is this a safe, efficient thing to do? As far as I can tell, the use statement is processed only once, at compile time. I haven't been following this placement philosophy with 'my' thus fa...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
OR you could use ARRAY data new; set old; array igor $ (*) str_mo str_da str_yr; do over igor; if igor ~in (' ','.') then do; end; run; Prasad Ravi Igor Kurbeko <ikurbeko@ATHEROGENIC To: SAS-L@LISTSERV.UGA.EDU S.COM> cc: Sent by: "SAS(r) Subject: if str_mo not in ('','.') and str_da not in ('','.') and str_yy ...

When CANNOT use 'first'/'rest' in place of 'car'/'cdr'?
If I'm not mistaken, 'first' and 'rest' seem like modern user friendly replacements for 'car' and 'cdr'. Is it true that car and cdr are only in Common LISP to be able to run ancient LISP code? Is there any time I cannot use 'first' and 'rest' instead?/ Chris seberino@spawar.navy.mil wrote: > If I'm not mistaken, 'first' and 'rest' seem like modern user friendly > replacements for 'car' and 'cdr'. > > Is it true that car and cdr are only in Common LISP to be able > to run ancient LISP code? I use first and rest whenever those are the only ones I care about (or if I'm actually going to use second, third, etc). However, car and cdr won't be disappearing anytime soon simply because of their combinatory (?) abilities: cadr cddar .... I can just very quickly look at it and know what is going on. Jeff M. -- http://www.retrobyte.org mailto:massung@gmail.com seberino@spawar.navy.mil wrote: > If I'm not mistaken, 'first' and 'rest' seem like modern user friendly > replacements for 'car' and 'cdr'. > > Is it true that car and cdr are only in Common LISP to be able > to run ancient LISP code? > > Is there any time I cannot use 'first' and 'rest' instead?/ > > Chris > There shouldn't be anywhere that you _cannot_ use FIRST rather than CAR or REST rather than CDR. It's m...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ##...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ####################...

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 ...

replacing '/' with '\\'
I have a MKS ksh shell script running on a Windows box. In some scripts I have to convert a UNIX filename into a DOS filename, that is replace the '/' with '\\'. For example, replace /opt/siips/archive/text.dat with \\opt\\siips\\archive\\text.dat. I've tried using sed like $FILE='echo $FILE|sed "s/\//\\\/g"' which got me \opt\siips\archive\text.dat. It's close but I still need the second \. Does anyone have any suggestion? Or tell me where I've gone wrong? Thanks -- Steffen On 9 Dec 2004 20:14:21 -0800, sajohn52@yahoo.com <sajohn52@yahoo....

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

replacement for '{' and '}' ?
I am still playing around with what kind of syntax I would like to mark up my documents. Are there equivalent long substitutes for { and } when they are not used to describe arguments to functions? Something like \begin{group} and \end{group}. In other words, if I could force myself to write, say, \begin{group} \it ... \end{group} instead of {\it ... }, then I believe I could identify from the markup context what is an argument that belongs to a just invoked macro and what is text. {Of course, in this context, \textit{...} would be better.} No more ambiguity whether a in \myfunction{a} i...

Replacing ',' with '.'
Hello, I have a huge amount of numbers in a .txt file. The numbers are in the form 2,43252e+1. I need to replace the , with . How should I do this? I'd prefer some import method that does this during the import procedure. -Janne Hi, I guess you import the data as text and convert it then to numbers. Try 'strrep' before you convert the text to numbers. Tobias Jake the Snake schrieb: > Hello, > > I have a huge amount of numbers in a .txt file. The numbers are in the form 2,43252e+1. I need to replace the , with . How should I do this? I'd prefer some import method...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB ...

logical to 'on' / 'off'
Hi, is there a function implemented doing this conversion? my Problem is, that I want to use the following code: set(handles.edit_curr_trq_sl,'Enable',get(hObject,'Value')) where get(hObject,'Value') gives the state of a checkbox thank you! function [str]=tf2oo(logic) switch logic case 0 str='off'; case 1 str='on'; end%switch end%function tf2oo() while i do not know a built in function, I use my own:) meisterbartsch wrote: > > > function [str]=tf2oo(logic) > switch logic > case 0 > str='off'; &g...

Meaning of ':' and '{}'
Hi, Please, can anyone tell me what is meaning of predicates ':' and '{}' ? ---------------- yours Advait Advait wrote: > Hi, > Please, can anyone tell me what is meaning of predicates ':' and '{}' > ? It depends on the context. : is used for module qualification of predicates. Like lists:member(X,L) The curly brackets are used in Definite Clauses Grammars: find the section on DCGs in the manual or google for it and you will find out easily. There are uses of {} as a functor in datastructures also. Cheers Bart Demoen Hello everyone,...

Does '!=' equivelent to 'is not'
I'm a bit confusing about whether "is not" equivelent to "!=" if a != b: ... if a is not b: ... What's the difference between "is not" and "!=" or they are the same thing? pirata wrote: > I'm a bit confusing about whether "is not" equivelent to "!=" > > if a != b: > ... > > if a is not b: > ... > > > What's the difference between "is not" and "!=" or they are the same thing? No, they are not the same thing. == and != test to see if the *value* of two variables are the same. Like so: >>> a = 'hello world' >>> b = 'hello world' >>> a == b True a and b both have the value of 'hello world', so they are equal is and is not, however, do not test for value equivalence, they test for object identity. In other words, they test to see if the object the two variables reference are the same object in memory, like so: >>> a is b False a and b are assigned to two different objects that happen to have the same value, but nevertheless there are two separate 'hello world' objects in memory, and therefore you cannot say that a *is* b Now look at this: >>> c = d = 'hello world' >>> c == d True >>> c is d True In this case, they are again the same value, but now the is test also shows that they are the same *object* as well, because...

Override 'and' and 'or'
Is it possible to override 'and' and/or 'or'? I cannot find a special method for it... __and__ and __rand__ and __or__ and __ror__ are for binary manipulation... any proposals? Have marvelous sunday, Marco Dekker <m.aschwanden@gmail.com> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero__ " __nonzero__( self) Call...

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,'...

Web resources about - can 'train' be used with 'newpnn' - comp.soft-sys.matlab

Resources last updated: 3/2/2016 12:27:31 AM