Home > Archive > Prolog > April 2004 > Re: problem with open command
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: problem with open command
|
|
| Benjamin Johnston 2004-03-27, 12:10 am |
|
Have you got permissions to write to 'asd'? Try using, for example, a full
pathname.
Also, you'll probably want to do write(OS,hai) instead of just write(hai).
-Benjamin Johnston
"aneel" <anilpavankumar@yahoo.com> wrote in message
news:05b5c8ed5f941c08438873bf37f3b8a8@lo
calhost.talkaboutprogramming.com...
> here is the code i am using for open..
>
>
> open(asd,write,OS),
> write(hai),
> close(OS).
> it replies with no
> what is wrong in it how do i make this to work.....plz help me......
>
| |
| aneel 2004-03-27, 12:10 am |
| I AM USING THE LINUX MACHINE HOW TO CHECK UP THE PERMISSIONS THAT U HAVE SIAD....I DO NOT KNOW MUCH ABOUT PROGOL....SO PLZ DO TELL ME...ABOUT IT...
| |
| Benjamin Johnston 2004-03-27, 12:10 am |
|
this'll probably work:
open('~/asd',write,OS),
write(hai),
close(OS).
"aneel" <anilpavankumar@yahoo.com> wrote in message
news:c1d1f16ad50d42567ea5c10d19ef27bb@lo
calhost.talkaboutprogramming.com...
> I AM USING THE LINUX MACHINE HOW TO CHECK UP THE PERMISSIONS THAT U HAVE
SIAD....I DO NOT KNOW MUCH ABOUT PROGOL....SO PLZ DO TELL ME...ABOUT IT...
>
| |
| aneel 2004-03-27, 12:10 am |
| thq a lot........for ur answer so kind of u...i too have one more problem the sample is given below..
I have seen u progrmming in progol..u
really good at it.i have started to learning the
Cprogol.i have almost finshed the code but i too have
some problem sir.because totally i have statred on my
own and no one i has even thought me a single point on
it .i am ina reserch insitute in india in course this
particular time i have come acroos some problem look
the code below....
:-set(posonly)?
%declaration
:-modeh(1,s1(+seqlist,+seqlist))?
:-modeb(*,s2(+seqlist,-seqlist))?
%types
seqlist([]).
seqlist([co],[ss]):-codon(co),sequencelist(ss).
seqlist1([]).
codon(a). codon(r). codon(n). codon(d). codon(c).
codon(q). codon(e). codon(g). codon(h). codon(i).
codon(l). codon(k). codon(m). codon(f). codon(p).
codon(s). codon(t). codon(w). codon(v). codon(y).
%background_knowledge
np(s1,s2)
:- rule1(s1,s2),rule2(s2,s3),write(s1),writ
e(this).
phos_pho(tar(X), agen(Proteins) ):-
findall(agen(Protein),phos(tar(X),agen(P
rotein)),Proteins).
%positive_examples
phos(tar(h,l,d,r,l,v,s,a,r,s,v,s),agen(p
kc)).
phos(tar(e,g,d,h,s,t,p,p,s,a,y,a),agen(p
kc)).
phos(tar(e,g,d,h,s,t,p,p,s,a,y,a),agen(p
ka)).
phos(tar(d,a,p,v,s,w,t,e,t,k,k,q),agen(e
gfr)).
phos(tar(d,a,p,v,s,w,t,e,t,k,k,s),agen(e
gfr)).
phos(tar(n,q,g,q,n,i,h,r,k,t,t,a),agen(i
nsr)).
phos(tar(t,g,i,l,d,s,l,g,r,f,f,g),agen(e
gfr)).
here i would like to get the output for eg if i pose
the query
|- phos(tar(d,a,p,v,s,w,t,e,t,k,k,X),agen(e
gfr))?
X=[a,q]
i would like to get the answer like this i have used
this find all but not yet working...
and also i would like to take in from user only the
|-d a p v s w t e t k k X?
and i would like to replay
X=[a,q]
agen=egfr
this how i would like to my output to be...
sir i would be thankfull if u help with these things..
waiting for ur replay with thousands of eyes waiting
for ur mail.
| |
| Benjamin Johnston 2004-03-27, 12:10 am |
|
The people who contribute to this newsgroup do so out of fun, so please
don't attempt to use manipulative language to try to get us to do your
work - it takes away our enjoyment and makes you sound rude and demanding.
Also, I appreciate the difficulty in communicating in a language other than
your native tongue, however your abbreviations (such as "u" and "thq") make
it very difficult to understand you, and give your emails the tone of a
quickly written demand as opposed to a well thought out request.
As to your first question,
I would define a predicate:
solve_phos(TarExpr,AgenExpr) :-
free_variables([TarExpr,AgenExpr],[FreeVar]),
findall(FreeVar,phos(TarExpr,AgenExpr),F
reeVar).
then submit the query:
solve_phos(tar(d,a,p,v,s,w,t,e,t,k,k,X),
agen(egfr)).
(this will only work for one free variable - I'll let you work out how to do
it with more than one).
For your second question,
There could be quite a bit of work involved in solving your second problem.
The easiest way would be to preprocess your input using a language like
Perl. Using just Prolog, the easiest ("hack-iest") way would be to read the
line as raw text, convert all the spaces into commas and wrap it in tar(),
and then parse the line as a Prolog term.
Under SWI-Prolog, this would be done by calling
read_line/2
next, converting the spaces to commas manually, and then:
atom_to_term/3
and then finally, calling something like solve_phos that I presented above.
Or, under SWI-Prolog, you could really cheat by using char_conversion and
read_term directly.
But, the best way would probably be to write a DCG and parse it yourself. I
recommend looking at sites like these:
http://lml.ls.fi.upm.es/manuales/Ci...ml/ciao_45.html
http://www.cs.sfu.ca/~cameron/Teaching/383/DCG.html
http://www-users.itlabs.umn.edu/cla...prolog/dcg.html
http://www.cs.sunysb.edu/~warren/xsbbook/node10.html
What is the name of your research institute, and what course are you
studying?
-Benjamin Johnston
> thq a lot........for ur answer so kind of u...i too have one more problem
the sample is given below..
>
>
> I have seen u progrmming in progol..u
> really good at it.i have started to learning the
> Cprogol.i have almost finshed the code but i too have
> some problem sir.because totally i have statred on my
> own and no one i has even thought me a single point on
> it .i am ina reserch insitute in india in course this
> particular time i have come acroos some problem look
> the code below....
>
>
> :-set(posonly)?
> %declaration
> :-modeh(1,s1(+seqlist,+seqlist))?
> :-modeb(*,s2(+seqlist,-seqlist))?
>
> %types
> seqlist([]).
> seqlist([co],[ss]):-codon(co),sequencelist(ss).
>
> seqlist1([]).
>
> codon(a). codon(r). codon(n). codon(d). codon(c).
> codon(q). codon(e). codon(g). codon(h). codon(i).
> codon(l). codon(k). codon(m). codon(f). codon(p).
> codon(s). codon(t). codon(w). codon(v). codon(y).
>
>
>
> %background_knowledge
> np(s1,s2)
> :- rule1(s1,s2),rule2(s2,s3),write(s1),writ
e(this).
>
> phos_pho(tar(X), agen(Proteins) ):-
> findall(agen(Protein),phos(tar(X),agen(P
rotein)),Proteins).
>
>
>
> %positive_examples
>
> phos(tar(h,l,d,r,l,v,s,a,r,s,v,s),agen(p
kc)).
> phos(tar(e,g,d,h,s,t,p,p,s,a,y,a),agen(p
kc)).
> phos(tar(e,g,d,h,s,t,p,p,s,a,y,a),agen(p
ka)).
> phos(tar(d,a,p,v,s,w,t,e,t,k,k,q),agen(e
gfr)).
> phos(tar(d,a,p,v,s,w,t,e,t,k,k,s),agen(e
gfr)).
> phos(tar(n,q,g,q,n,i,h,r,k,t,t,a),agen(i
nsr)).
> phos(tar(t,g,i,l,d,s,l,g,r,f,f,g),agen(e
gfr)).
>
>
> here i would like to get the output for eg if i pose
> the query
> |- phos(tar(d,a,p,v,s,w,t,e,t,k,k,X),agen(e
gfr))?
> X=[a,q]
>
> i would like to get the answer like this i have used
> this find all but not yet working...
>
>
> and also i would like to take in from user only the
> |-d a p v s w t e t k k X?
> and i would like to replay
> X=[a,q]
> agen=egfr
>
>
> this how i would like to my output to be...
> sir i would be thankfull if u help with these things..
> waiting for ur replay with thousands of eyes waiting
> for ur mail.
>
| |
| aneel 2004-03-27, 12:11 am |
| Respected sir,
First of all i would like to say thanks for your help and
also i am saying sorry for using such language its all because of my
health problem anyways that excuse also should not be given this will be
my first and last mistake form next time onwards i will surely make
everything perfect and then only mail, and also sorry for the late mail
becuase i was ill.
My name is M.Anil Pavan Kumar,
Qulification B.tech(bioinformatics)
currently working in a project in india in Au-kbc
research centre chennai.
If u can give me your emailid i can mail you all my deatils.
my emailid is anilpavankumar@yahoo.com.
| |
| Benjamin Johnston 2004-03-27, 12:11 am |
|
You do not need to be perfect - perfection is impossible; I only asked that
when you post a question that you put similar levels of attention and care
into your message as you might expect to find in a response. Things like
typing "you" instead of "u", and using capital letters at the appropriate
places make a huge improvement to the clarity of writing.
I'm really interested in what you're using Prolog for, and why you decided
to use Prolog?...
Thanks,
-Benjamin Johnston
"aneel" <anilpavankumar@yahoo.com> wrote in message
news:ca1d0b44e28cf1a036699be25082176b@lo
calhost.talkaboutprogramming.com...
> Respected sir,
> First of all i would like to say thanks for your help and
> also i am saying sorry for using such language its all because of my
> health problem anyways that excuse also should not be given this will be
> my first and last mistake form next time onwards i will surely make
> everything perfect and then only mail, and also sorry for the late mail
> becuase i was ill.
> My name is M.Anil Pavan Kumar,
> Qulification B.tech(bioinformatics)
> currently working in a project in india in Au-kbc
> research centre chennai.
>
> If u can give me your emailid i can mail you all my deatils.
> my emailid is anilpavankumar@yahoo.com.
>
| |
|
| Respected sir,
I am using Cprogol4.4 for the prediction of phosprylation
sites of proteins.I have choosen the progol becuase it very beautiful and
logical language where u we make the machine to learn about the examples
and much more in progol one can do it. Also i like working on machine
learning languages this is one reason why i choose progol and since it was
also unknow language to most of the people so i like learning the things
on my own and putting them to work with real world examples i like it.
I found progol really very intersting language a lot to
learn and many things can be done using progol. I have completed my
undergreadution in bioinformatics and also i am planning to do MS by
research work also using progol. This is very interesting i am searching
for a university that will offer MS by research work. Sir if you know the
universities that offer MS by research in bioinformatics please do let me
know i would be very happy.
yours truely,
anil pavan.
| |
|
| Respected sir,
I am using Cprogol4.4 for the prediction of phosprylation
sites of proteins.I have choosen the progol becuase it very beautiful and
logical language where u we make the machine to learn about the examples
and much more in progol one can do it. Also i like working on machine
learning languages this is one reason why i choose progol and since it was
also unknow language to most of the people so i like learning the things
on my own and putting them to work with real world examples i like it.
I found progol really very intersting language a lot to
learn and many things can be done using progol. I have completed my
undergreadution in bioinformatics and also i am planning to do MS by
research work also using progol. This is very interesting i am searching
for a university that will offer MS by research work. Sir if you know the
universities that offer MS by research in bioinformatics please do let me
know i would be very happy.
yours truely,
anil pavan.
| |
| aneel 2004-04-08, 10:55 am |
| Respected sir,
I am using Cprogol4.4 for the prediction of phosprylation
sites of proteins.I have choosen the progol becuase it very beautiful and
logical language where u we make the machine to learn about the examples
and much more in progol one can do it. Also i like working on machine
learning languages this is one reason why i choose progol and since it was
also unknow language to most of the people so i like learning the things
on my own and putting them to work with real world examples i like it.
I found progol really very intersting language a lot to
learn and many things can be done using progol. I have completed my
undergreadution in bioinformatics and also i am planning to do MS by
research work also using progol. This is very interesting i am searching
for a university that will offer MS by research work. Sir if you know the
universities that offer MS by research in bioinformatics please do let me
know i would be very happy.
yours truely,
anil pavan.
| |
| aneel 2004-04-08, 10:55 am |
| Respected sir,
I am using Cprogol4.4 for the prediction of phosprylation
sites of proteins.I have choosen the progol becuase it very beautiful and
logical language where u we make the machine to learn about the examples
and much more in progol one can do it. Also i like working on machine
learning languages this is one reason why i choose progol and since it was
also unknow language to most of the people so i like learning the things
on my own and putting them to work with real world examples i like it.
I found progol really very intersting language a lot to
learn and many things can be done using progol. I have completed my
undergreadution in bioinformatics and also i am planning to do MS by
research work also using progol. This is very interesting i am searching
for a university that will offer MS by research work. Sir if you know the
universities that offer MS by research in bioinformatics please do let me
know i would be very happy.
yours truely,
anil pavan.
| |
| aneel 2004-04-08, 10:55 am |
| Respected sir,
I am using Cprogol4.4 for the prediction of phosprylation
sites of proteins.I have choosen the progol becuase it very beautiful and
logical language where u we make the machine to learn about the examples
and much more in progol one can do it. Also i like working on machine
learning languages this is one reason why i choose progol and since it was
also unknow language to most of the people so i like learning the things
on my own and putting them to work with real world examples i like it.
I found progol really very intersting language a lot to
learn and many things can be done using progol. I have completed my
undergreadution in bioinformatics and also i am planning to do MS by
research work also using progol. This is very interesting i am searching
for a university that will offer MS by research work. Sir if you know the
universities that offer MS by research in bioinformatics please do let me
know i would be very happy.
yours truely,
anil pavan.
| |
| aneel 2004-04-09, 11:33 pm |
| Respected sir,
I am using Cprogol4.4 for the prediction of phosprylation
sites of proteins.I have choosen the progol becuase it very beautiful and
logical language where u we make the machine to learn about the examples
and much more in progol one can do it. Also i like working on machine
learning languages this is one reason why i choose progol and since it was
also unknow language to most of the people so i like learning the things
on my own and putting them to work with real world examples i like it.
I found progol really very intersting language a lot to
learn and many things can be done using progol. I have completed my
undergreadution in bioinformatics and also i am planning to do MS by
research work also using progol. This is very interesting i am searching
for a university that will offer MS by research work. Sir if you know the
universities that offer MS by research in bioinformatics please do let me
know i would be very happy.
yours truely,
anil pavan.
|
|
|
|
|