last day (79 days later) » 
05:00 - 12:0012:00 - 14:00

5:21 AM
 
\o/ @Mochan
 
\o/ @AmithKK
 
 
4 hours later…
9:06 AM
@JourneymanGeek o/
Thanks ^^
Hi @jokerdino
 
ok, basically what you need to do is go through each value in the sequence and see if its true or false
then what you do, depends on your approach
 
hi
 
one would be to count the total length and the number of valid chars and compare them
like the accumilator example
 
I was doing the boolean approach, and I was going to do if [alphabet in upper case] or [alphabet in lowercase] in nucleotides: return False. else: return true
 
don't use return until the end
it'll break
ya
 
9:09 AM
Hm.
So...
 
instead of return, store the output of the test as a value
since your method WILL end if return is carried out
 
OMG I TOTALLY FORGOT
 
So what I did was fine but I replace return while a value-thing
A counter value
 
well thats one way
the other is to have a boolean result, and use an appropriate boolean operator
if you get true, and the current value is true, you want true. If any value is false, you get false, even if all the others are true
 
9:14 AM
Whats up @Mochan
 
This is where I get confused. If I have an if statement, I have to tell it to do something. But I don't know how to put the answer in a value.
Hi @AmithKK, thanks again for the room :3
 
np
What are your trying to do?
BBL :D
 
o/
 
ignore this silly ^
 
LOL
brb
im eatinng
 
9:26 AM
@Mochan: if value ==1
value = value + 1
elif value ==2
value = value - 1
 
value++
 
I know, trying to show an example ;p
this thing is chewing up my indents tho
 
eheh
 
If value is equal to one, then add +1 to value, but if value==2, take one off?
 
yep
 
9:29 AM
So if value is equal to ACGT, add one, but if value is equal to anything else, take one off value?
 
is that what you want to do?
 
Shrug. One sec.
@JourneymanGeek would I do something like what I did with Step 3?
 
leaving.
 
Alright, @jokerdino, see you soon~ ^^
 
9:47 AM
ya
you'd use for char in, and if char in
 
@JourneymanGeek Yeah? Can I use if char in x is?
I think I have a solution, though. I just need to translate it.
 
I believe you have to
er is?
 
@JourneymanGeek What does is do again...?
Like if char in apple is 'a':
 
I think it works like ==
 
That's what I was thinking for the char bit. However, my other idea would be like: how many times does x show up in x? If it is more than 0, store it in a variable. If it is 0, store it in another. Then, do something like if x > 0 return False... that's my thoughts but...
 
9:55 AM
lol
thats how I did it
 
I mean true... I mean false..
 
or just use num_valid==total_number
 
So.... like... if x == 0
The it would return True. And if not, false.
I'm going to try...
@JourneymanGeek is this the right spacing? I'm more concerned about that atm.
 
10:22 AM
see if you get an error.
also you don't need return true, you just return valid_num = 0
 
@JourneymanGeek Oh, I see. I don't get an error, it just returns True for everything.
@jokerdino psssssst...
 
hm
 
Thought it may be good to chat here rather than bothering others :S
 
okay then
 
Yeah. OK, so...
"ok, first check if they are upper case, then return bool switch

then check if they are one of the given four"
@jokerdino so I use something to check if they're captials. I only know how to do .isupper()
 
10:38 AM
that should be enough i guess
 
Not allowed~
 
what is not allowed?
 
Nvm
 
11:03 AM
hello
 
Hi @Mahesh @jokerdino
 
the if check is a bit iffy
 
@jokerdino LOL
This room needs a star ;A;
 
ok.
you want the assignment done or you want to learn?
 
neither.
i want to fix bugs in unity. :|
 
11:05 AM
@Mahesh ...I really need to get it done. I will learn. Soon.
I feel horrible >.<
 
(:
 
Journeyman Geek gon' kill mee...
I must go in half an hour. I can't miss this assignment either. I'm willing to risk learning >o<
 
for char in string:
    if char is not "A" and char is not "T" and char is not "C" and char is not "G":
        print "I am doomed"
    else:
        print "I live"
thats valid python code in case you are wondering.
 
hey you can't use print.
 
use something else.
 
11:09 AM
you cant str
 
I used print only to demonstrate
oh. I get it.
:P
 
yeah but she doesn't know what else to do
 
@jokerdino ?!
@jokerdino Yeah. I think(?) I agree.
 
If you did think, you wouldn't agree.
 
@jokerdino Is that an insult or am I just to tired to think at all?
 
11:11 AM
You are not thinking enough. You are probably too stressed.
ok, you get back to coding
 
@jokerdino I am too stressed. But I have to do this. I had an exam yesterday - even though I did well - I am tired and sick of this. But I have to do this. Sorry for italics.
@jokerdino OK.
for char in string:
    if char is not "A" and char is not "T" and char is not "C" and char is not "G":
        print False
    else:
        print True
Yes/no?
 
okay good
 
@jokerdino I'll test, then.
SyntaxError: expected an indented block
 
def nucleotides(string):
    charcheck=0
    for char in string:
        if char is not "A" and char is not "T" and char is not "C" and char is not "G":
            charcheck=charcheck+1
    if charcheck != 1:
        print True
    else:
        print False


nucleotides("ACSC")
 
if char is not "AGTC" should work too
 
11:18 AM
@JourneymanGeek Hi
 
def nucleotides(string):
    charcheck=0
    for char in string:
        if char is not "A" and char is not "T" and char is not "C" and char is not "G":
            charcheck=charcheck+1
    if charcheck != 1:
        print "YES"
    else:
        print "NO"

nucleotides("ACSC")
nucleotides("ACTC")
python dna.py
NO
YES
there you go
 
inelegant ;p
 
lands with epic music
 
:P
 
@jokerdino Why not boolean
 
11:21 AM
Oh dear God.
 
@AmithKK you llike clippy?
 
is that is_valid_sequence?
 
@JourneymanGeek Yes. I have been working on it since 1:00PM, it's now 10:30PM
 
@jokerdino why not
 
@AmithKK then why do you want to move from SU?
 
11:21 AM
I'm hopeless ._.
 
I like the feel
 
is how I did it
 
@jour, you wasted my time
 
:6577425 But what if they typed 'FUSI7YEUIHFSKJ;'
 
11:23 AM
here
then valchar would be less than total length
which would result in False
but there's another way to do it
 
The way we have been trying?
 
    for char in dna:
        if char  in 'ATCG':
            isValid = isValid and True
        else:
            isValid = isValid and False

    return isValid
 
@JourneymanGeek nice
 
thats much more elegant
@Mochan: I don't get the logic behind what you're doing yet
What're we trying to do?
 
She's making a Gene Research Center to resurrect Dinosaurs. Isn't this obvious?
4
 
11:25 AM
@JourneymanGeek I have no F&*!ing idea what I'm doing.
 
:6577368
 
@JourneymanGeek The body of is_sequence_valid
 
@AmithKK i am going to have to say some very funny things but the half life of DNA is less than 600 years.
 
er there, don't use print. also print is print("thing")
Ok, so you have a sequence
You want to go through each charecter in the sequence to check if its valid
 
@jokerdino Yeah, taking the assumption that the dna has been cosnerved
 
11:26 AM
@JourneymanGeek They input the sequence by going is_valid_sequence(x) though.
 
so you use
x is a string. Don't think as code. think as a flow.
 
hey i am out of coursera. i'll learn the python way.
 
@JourneymanGeek When I think flow, I think of something else.
@jokerdino I was.
 
lol
Ok, lets start with your code ;p
for char in string:
    if char is not "A" and char is not "T" and char is not "C" and char is not "G":
        print False
    else:
        print True
 
@JourneymanGeek That's jokerdino's code.
 
11:28 AM
....
/me slaps @jokerdino upside the head.
 
 valid_num = 0
    for char in nucleotides:
	    if char == 'ACGT':
		    valid_num = valid_num
	    elif char != 'ACGT':
		    valid_num = valid_num + 1
    if valid_num == 0:
	    return True
^-- my code.
 
They corrected.
 
@Mochan what. How does that work?
 
11:29 AM
@JourneymanGeek yo
 
@AmithKK I've heard that before ;-;
 
Hello @jokerdino
 
@Mochan he only repeats what we say.
 
@JourneymanGeek 't was my codez
 
let me try that
 
11:29 AM
@jokerdino :|
 
@Mahesh Your code. Sorry. ;-;
 
Amith is like a parrot.
 
@JourneymanGeek It does nothing.
 
Aw screw you
 
I think Amith is cool...
 
11:30 AM
I didn't even read the transcript
 
You're fourteen, yes?
 
I can see him drooling now.
3
 
Yes
@jokerdino XD
 
Therefore, you have achieved much. People should see you as inspirational, imo.
 
Aww.. your too kind ^_^
 
11:31 AM
Amith, run for your life.
 
@AmithKK (^_^)/\(^o^)
Hive-five~
 
@jokerdino run --for life: location not specified
2
 
@AmithKK XD
 
@AmithKK well, your call then. don't come back looking for help :P
 
@jokerdino Which college were you in again?
 
11:32 AM
XDDD
 
Check FB.
 
Ah right
which dorm?
 
H4
 
@AmithKK ._.
 
noted
 
11:33 AM
@jokerdino That means I can now stalk you. Why did you do that?
 
@amith, OK, i won't disturb you with your moment. No need to plead on Gtalk.
 
Its not such a big secret
@jokerdino wat?
 
@AmithKK Still creepy. ._.
 
@Mochan You are going to stalk me? Is that a joke?
 
@JourneymanGeek tell us when you're done, O Holy One.
@jokerdino PSH. No. I don't live in Singapore.
 
11:34 AM
Yeah, stalking me is plain unproductive.
 
XD
Moo
 
@JourneymanGeek is in singapore
 
@AmithKK @JourneymanGeek can stalk @jokerdino ;3
 
One of my friends are coming to singapore this december
 
Yaaaayyyy yaoiii
 
11:35 AM
He has the same First name
 
@AmithKK More stalking. Fun fun.
 
@AmithKK So is Ash.
lol people really? You are so interested in stalking me?
 
@jokerdino Nu.
 
okay
 
I'd think any of your stalkers would go crazy before they get to you
Just my opinion
 
11:37 AM
:>
 
Did Journeyman disappear...?
 
@jokerdino yup that
 
def is_valid_sequence(dna):
    valid_num = 0
    for char in dna:
        if char in 'ATGC':
            valid_num = valid_num
        else:
            valid_num = valid_num + 1

    return valid_num == 0
 
@Mahesh <:
 
That works
 
11:37 AM
THANK YOU. HOLY GOD. THANK YOU.
 
If you put 'return true' it will always return true
 
@JourneymanGeek woah 40k!
 
@JourneymanGeek write pass instead of self-assigning
 
@AmithKK get your eyes checked. it's 46.5k
 
Everyone here, even though I'm pretty useless, I will help you to the best of my ability :>
@jokerdino +1
 
11:38 AM
@Mahesh: pass?
 
@Mochan ok enough making fun of Amith. He's a nice chap.
 
On a single site
dammit :D
 
^--- +2189472389572380656894735699595959595995959595
 
and?
just means I've been around longer ;p
 
11:39 AM
pass ia a valid python statement
 
@Mahesh Yeah. it's like {} in c right?
 
@AmithKK Yeah i really like Ash. Got problem?
 
I mean, I have no idea what that is ;p
 
@jokerdino Who's ash?
 
11:40 AM
you may say so
 
insert_sequence is easy.
Right?
 
@AmithKK say wha?
 
<- ash
 
your name is ash?
cool
 
@Mochan: the one I hated the most was get compliment
lol
no no no
Ash is the dog
 
11:41 AM
ROFL
 
(for which you DO have to use a return statement if a if/else loop)
of course, everyone thinks I'm a dog, so...
 
Wait. dogs know how to write good python code
They are taking over the world :O
 
import woof
 
The cats know java :P
We're safe
 
11:44 AM
It works well for confusing engineers and dogs
 
and yourselves
you're just good at hiding it.
 
:)
 
@JourneymanGeek thats a talent I must say
 
yanno, I have THREE different implimentations of is_valid_ sequence now ;p
 
@JourneymanGeek :PPP
So we are allowed to swear on here?
 
11:47 AM
what swearing?
 
@Mochan Nope, not really
@JourneymanGeek Good Move :P
 
@Mochan didn't you already do that?
 
-.-
 
@jokerdino I bleeped ...most... of it.
 
11:47 AM
Well, just make sure not to annoy Amith.
 
I find it harder to fix indentations on copypastaed codes... rather than coding
 
Else, he'll pang all the mods.
 
I has a sad ;p
 
And you said for me to stop picking on him! >O<
 
23 mins ago, by Mochan
@JourneymanGeek I have no F&*!ing idea what I'm doing.
@jokerdino :| I wont
 
11:48 AM
@AmithKK It's bleeped!
 
@AmithKK lol jk
 
Ok, I'll stop taking wisecracks on you.
:P
This is fun. :P
 
@AmithKK I found that joke a bit funny. Keep it coming.
 
@jokerdino which one?
 
you taking wisecracks. It cracks me up.
 
11:51 AM
@JourneymanGeek WHY
Traceback (most recent call last):
  File "<pyshell#43>", line 1, in <module>
    insert_sequence(CAT, AT, 2)
NameError: name 'CAT' is not defined
 
@amith, @mahesh. let's get back to hacking Unity?
 
Amith KK has made a change to the feeds posted into this room
 
@jokerdino Ok
 
you may need to put it as 'CAT' ?
 
@JourneymanGeek May I kick myself?
 
11:53 AM
If you wish ;p
 
Eugh. My code didn't work.
I thought it sounded too simple!
sequence[index]+nucleotides
ASAJKFSAGJDGSAK
 
index what?
 
@JourneymanGeek Oh, right. Here is the function.
def insert_sequence(sequence, nucleotides, index):
    '''(str, str, int) -> str

    Inserts nucleotides into sequence at the specified index (index).

    >>> insert_sequence(CCT, AT, 2)
    CCATT
    >>> insert_sequence(AGG, TC, 4)
    AGGTC
    >>> insert_sequence(AAAA, GGGG, 3)
    AAAGGGGA
    '''
    return sequence[index]+nucleotides
 
I like my examples. I think they're funny :3
 
11:56 AM
You are totally off ;p
 
//dies
 
now, what you need to do is insert right?
 
Yes
I thought adding would be the same thing. Sigh.
 
so its sequence_before + inserted_sequence + sequence_after
so you need 3 elements
lol, adding is correct here
how would you slice the sequence from the first location to index?
 
@JourneymanGeek Are they variables?
 
11:58 AM
not really, Its sort of written like that to make em one word ;p
 
@JourneymanGeek Get the length of nucleotides, then make it [index:x] x = number of letters in the one to be inserted.
 
@JourneymanGeek OK
 
not quite
 
//drops into hell
 
11:59 AM
lol
 
05:00 - 12:0012:00 - 14:00

  last day (79 days later) »