« first day (1149 days earlier)      last day (4022 days later) » 
01:00 - 19:0019:00 - 00:00

19:00
If you never used new, then about is null and can't be used for much
Have much experience with OO in Java? I recognize that it's not especially intuitive
Not very. :|
Try putting about = new About() just above the setVisible line. It might work, although I can't be sure without seeing the full code
Keep in mind NetBeans automattically named these variable and such... I cannot modify of them directly
@kevin, I tried that, and it didnt work
19:09
I have used the full extent of my two semester's worth of Java knowledge
So, what do you mean when you say "it didn't work"? It didn't compile? It threw the same exception as before? It ran but didn't show the window you wanted?
Threw same exception as before
What is the appropritate way to get the lenght of a list
@JebediahKerman, len(my_list)
19:15
weird that seems so easy, yet the assignment I am doing notes
@Bugboy1028, the problem is beyond my abilities, in that case. Can't imagine why there would be a NullPointerException under those circumstances
Add the appropriate method(s) so that len(s) returns the number of elements in s.

Hint: look through the Python docs to figure out what you'll need to solve this problem.
why would they make this note ^^
What is the type of s?
s is of type list
What does "number of elements in s" mean?
19:17
Kevin
x = [1,2, 3] should be 3
Maybe they mean "the number of distinct elements"
its like a set, no duplicates in a list
ex. [4,4,8,8,8,15] has length 3
@Kevin correcy
19:18
ok, then you would do len(set(s))
throw new UnsupportedOperationException("Not supported yet.")
This is blocking my About.java from running
I think I am not suppoed to use the data-type set. But you have helped me, thanks
@Bugboy1028, that error usually occurs when a person only wrote part of the class and hasn't completed coding it yet
Maybe your instructor expects you to fill in the missing portions yourself
Incidentally, are you sure you need the about.pack() line? I notice that you don't do pack on your main screen, and I'm guessing that gets displayed fine without it
19:24
Patched
It is now working
:-)
Woo hoo - hang man and hiding letters with an asterisk is back!
Now to create next JDialog and get it to work
-.-
The first two dialogs are always the hardest ;-)
I will need to do FileIO
19:35
File operations suck in every language except Python
I don't want a BufferedStreamWriter, I want a file
Is there any way to plug in Python into Java?
@Bugboy1028 standard RJ45 should do it
?
Explain further?
Jython can be embedded, I think
Maybe I should have put a load of smileys on that message :)
19:38
Haha, RJ45 is a kind of phone jack. I get it.
Looks like my friends want me to brave icy conditions so I can hang out with them... My time here is limited
dont be
We want you D:
Join the dark side... we have awesome death ray.
Is it orbital and/or lunar-based?
orbital
@Kevin what if you slipped and had an accident
Let's talk about world domination - it's safer and far more fun than interacting with "real people" :)
Sounds like something my mother would say.
19:46
Your mother is into world domination too? Awesome
Are you on her payroll? I'll double whatever it is if you become a counter-agent
Just tell your friends you're busy talking about taking over the world with a Python programming puppy and ridding it of the non-believers in "The Cabbage". You may find they're less enthusiastic about inviting you out...
Don't forget to mention that it's not too late, and their souls can be saved if they choose to become of the chosen by the great Cabbage.
I don't suppose you've heard of Omnicorp Global Enterprises? That's her shell company. It's an anagram for "Obey my will unquestioningly". Or, at least, that's what the creative director claimed. Probably should have double-checked.
Ahhh... is that related to: "Because I Said So, Inc." ?
You know... one person said that End of the World is coming....
on Dec 3rd
19:50
Mm hmm, yep. NBC, British Petroleum, Maytag, Monsanto... It's all connected
@kevin Wow - have you seen the answer given for stackoverflow.com/questions/20457995/… ?
What the - a class inside a function?
How very... Java
with leading dunder :)
"added 2 characters in body"
-.-
Who decided to add 2 characters to get points =.-
@Bugboy1028 ?
@Bugboy1028 you don't get the 2 points for editing after you reach 2k and get edit privs
And you're only allowed a total of 1000 of your rep to be of those 2 point edits anyway
19:54
Edit privs are the best. I love making changes without requiring any oversight or approval :-)
Yes... The power flows through me
Oh.
Oh, If I lose points, will I lost permissions?
I don't think so
Pretty sure that, once you've got it, you've got it
Seems to bwe
I still can talk after I lost 4 points to bad question
@Kevin you don't lose badges once gained, but you can lose rep based abilities
Huh, I can still chat after I lose rep , Jon
19:57
If you went below 20 you couldn't
Thanks goodness I took down that question after that happen
You'd have to lose 48 rep
I am very careful for answering the questions
ooh, there's a robin in my yard. Never seen one of those in December before
Do you know that English Sparrow is pest?
...
Meant to said Pest
20:03
Interesting
Nope - just a strange lack of text
Ah
I thought I updated my photo
heh, nice almost-swastika identicon
@ThiefMaster haha.... I hadn't noticed till you pointed that out.... :)
20:15
@Bugboy1028: i don't care much but some more uptight people might feel offended by it. consider using a real avatar instead
I just did
Waiting for it to update -.-
I think you need to leave the room and enter again for it to update
i just refreshed your profile
should be updated now
Much better
@ThiefMaster you seen this yet?
20:17
yeah
Thanks a lot, @ThiefMaster .
@ThiefMaster sheesh.... you're in the middle with everyone else as well.... da fuq?
the data seems to be somewhat old. at least if the number is supposed to be the reputation
(43k.. really?)
That's a "normalised" score apparently
It's meant to be July 2013... I don't think you were 43k rep in July :)
ah.. that's why jon skeet has 100
20:20
I want to know why I'm right down the bottom and not with the "in crowd"
Derp
My email address is still bounded to old email
It's kinda sad that it's actually bugging me... but I'm trying to find some reason
Hi @Mittchel
Hi!
Is there someone here with some java/c# experience who can explain me some python with a c#/java example?
I'm having trouble with something..
Yeah, I know C#
How can I see this in C#: values = [[0 for x in xrange(n)] for x in xrange(n)]
20:23
It's related to this question I guess :)
That creates an NxN 2d array of integers
Yes it is.. I'm doing a performance test with C# and python
So I need to translate the code exactly, but I'm not really familiar. The answer on my question doesn't output the same result
List<List<int>> matrix = new List<List<int>>();
for (int j = 0; j < n; j++){
    matrix[j] = new List<int>();
    for (int i = 0; i < n; i++){
        matrix[j][i] = 0;
    }
}
What's the performance test supposed to prove ?
I suspect there's a shorter way to do it with Linq
20:26
Basically it's an algorithm which formats large amount of text
Thanks @Kevin I'm going to give that a try haha
But what I mean is, you're comparing apples and pears, you know that right?
Yea I know
But I'm in the process of understanding python more, so I'm trying to port it haha
And then check performance; which I know is comparing apples and pears.
Or, just use IronPython instead? :)
I'm not even convinced your starting function is that good :)
Never heard of it, now I do.. haha
Apples and pears are easy to compare. They are both fruit. I can hold either one in my hand. They can be purchased at the grocery store.
I never understood that saying.
20:29
haha
It would be better to say, that's like comparing a fish and a bicycle
Although even then, both are made of matter and can be purchased on Amazon.com... You can compare pretty much anything, really
Never thought of it that way to be honest
A fish has no legs. A bicycle has no legs. Ergo, fish are bicycles?
In Holland we've got waterbicycles
They swim
Haha, I love the comment on that hangman question
thanks for the edit doork — user3077551 41 mins ago
20:33
Yeah... just missing the "nob" :)
dork nob... Not the friendliest nickname
@JonClements, I hope it is now clear why the class was encapsulated by a function. This is to get around python's lack of private members. — Smac89 19 mins ago
Is "no, not really"... a valid response?
I don't get it. What members is he trying to keep private?
Furthermore, who cares? We're all adults here, if you want something private, just leave a please don't access this comment ;-)
We need a canonical resource for arguing that privacy is for babies
Our users don't need the interpreter to keep us from licking the flagpole or putting a fork in the electrical outlet.
Ooo... why what happens when you do? One sec...
What type of fork? The ones I've got in the kitchen drawer don't fit right...
@Kevin didn't work, Index out of bounds :-P sadly
20:41
Oops
List<List<int>> matrix = new List<List<int>>();
for (int j = 0; j < n; j++){
    List<int> row = new List<int>();
    for (int i = 0; i < n; i++){
        row.Add(0);
    }
    matrix.Add(row);
}
hmm ofcourse
You need to use Add
Looks good
Any idea why this code isn't converting the letters like it's supposed to ? :
num = input("Number is:")
for digit in num:
if (digit in ["a","b","c"]):
digit = "2"
elif (digit in[ "d","e","f"]):
digit = "3"
elif (digit in[ "g","h","i"]):
digit = "4"
elif (digit in[ "j","k","l"]):
digit = "5"
elif (digit in[ "m","n","o"]):
digit = "6"
elif (digit in[ "p","q","r","s"]):
digit = "7"
elif (digit in[ "t","u","v"]):
digit = "8"
elif (digit in[ "w","x","y","z"]):
digit = "9"
numlist = []
for digit in num:
Assigning a new value to digit within the for loop will not change the values within num
I've actually done such things before and it worked _
Here is another example.
>>> foo = [1,2,3]
>>> for x in foo:
...     x = 10
...
>>> print foo
[1, 2, 3]
Here, we try to modify foo by setting all elements to 10. It does not work.
20:53
or i can just add an "append" after each conversion ?
right ?
append to a new list
Yes, then the new list would have all your converted digits.
yeap thanks
Gotta go, have a nice weekend everybody
Use a dict instead?
@Kevin see ya tomorrow I guess then
@Kevin i've just added it at the end of the for loop instead of adding it in each if loop. It now looks like this:
num = input("Number is:")
numlist = []
for digit in num:
if (digit in ["a","b","c"]):
digit = "2"
elif (digit in[ "d","e","f"]):
digit = "3"
elif (digit in[ "g","h","i"]):
digit = "4"
elif (digit in[ "j","k","l"]):
digit = "5"
elif (digit in[ "m","n","o"]):
digit = "6"
elif (digit in[ "p","q","r","s"]):
digit = "7"
elif (digit in[ "t","u","v"]):
digit = "8"
elif (digit in[ "w","x","y","z"]):
21:00
keys = 'abcdefghijklmnopqrstuvwxyz'
vals = '22233344455566677778889999'

lookup = dict(zip(keys, vals))
numlist = map(lookup.get, 'hello')
# ['4', '3', '5', '5', '6']
There you go, much nicer
21:21
@mgilson howdy
Hey
how goes it?
Good... I'm in the south pole of SO it appears - however, on the plus side, you're closer to me than the rest of the crowd in the middle :)
?
where is the rest of the crowd?
Interesting.
I'm guessing the size of the building is rep
?
21:26
Yup that's normalised, but I'm struggling to work out the clustering
Is the location determined geographically?
A graph layout algorithm arranges users in 2D space based on their similarity. Cosine similarity is computed based on the users' network (Friendfeed), collaborate, watch, fork and follow relationships (Github), or based on the tags of posts contributed by users (StackOverflow). The height of each user represents the normalized value of the user's Pagerank (Github, Friendfeed) or their reputation points (StackOverflow).
Oh, and on the blog:

The 2D position of users in Ekisto is determined using a graph layout algorithm which highlights clusters of similar nodes (OpenOrd[5]). Similarity between a pair of users is computed as the cosine similarity, a very simple and efficient way to measure how analogous two entities are.

In the 3D space, each user’s volume represents reputation points (Stackoverflow), or the network influence of the user computed using the PageRank algorithm (Github, Friendfeed).
Yeah, I was just reading that.
found the "about" button :)
22:02
How can write to file a multiple variables such as myFile.write(varible1,varible2,varible3)
for var in (v1, v2, v3): myFile.write(var)
Or, maybe, myFile.writelines((var1, var2, var3))
Not working :/
"not working" is a little too ambiguous. what isn't working? Is there an error?
What types are you trying to write to the file?
are they all strings?
Yeah sorry I'll try and write a better explanation then one sec ! thanks
I need to write a line of information to a file. This line is for example ( name, age, grade)
each for name age and grade they can 'got' using a method from another class
Here's a pick of the actual work
may be a little more helpfull i.imgur.com/Na2aEZP.png
I was just testing a
I used w normally
Code - http://i.imgur.com/YqHPmYr.png
Error - http://i.imgur.com/4OOijxG.png
I guess I could do it line by line :/
22:18
Hello, Python!
That code doesn't make a lot of sense to me... It doesn't look like you're using the var loop. .. just doing the same thing with x over and over again
But, that aside, the error is pretty clear.
you're passing 2 arguments to write. . .It is only supposed to take one.
22:31
is there a way to turn all of the arguments there into one string maybe?
sure. + ...
I tried using +, still didn't work. DW about it now I manage to find a work around thanks for the help
rhubarb! If anyone is interested, my project with latest modifications - t.co/PBRvWzZUV2
hi I need some help
I have a function that deletes an element of a list
the function should return that element it deleted
but here is the problem
lst.remove(lst[0]) # removes the 1st element of the list
return lst[0] #this will not work item[0] will now be somethign different
_
_
def remove(lst):
    lst.remove(lst[0]) # removes the 1st element of the list
    return lst[0]  #this will not work item[0] will now be somethign different
22:47
look at list.pop instead
:)
but if I do the return statment 1st it will not removie the element becuase return break out of the currnet thing
wow .pop is exactly what I wanted
thanks
Sure.
No problem.
so now I have a 1 liner
return self.queue.pop(0)
this both deletes the first element and shows it to the user
pop returns though right?
how come I am returning twice it seems, and that works??
Not sure what you mean. Anyway, I gotta go for a bit.
maybe someone else can jump in here?
first = lst[0]
lst.remove(lst[0])
return first
@JebediahKerman can you make a gist that illustrates what you mean?
23:00
yes, expect me to know how to use gist in 1 year
I am a n00b
@Code-Guru thanks I am aware of doing this with a temp variable but that seems a little too much
return self.queue.pop(0)
that the function
so its actually
def remove_first_element():
    return self.queue.pop(0)
why does this work?
most likely that's how pop is implemented
pop returns and then the function returns asw ell
DSM
DSM
something.pop() modifies pop and then returns a value to the caller. It doesn't force the caller to return.
For example:

def remove_first_element():
self.queue.pop()
print "did not return!"
return 17
return self.queue.pop(0) is the same as
temp = self.queue.pop(0)
return temp
23:04
I see
kinda
what a coincidence
9 upvotes?
9 comments
9 answers
9 favotires?
DSM
DSM
There's nothing special about pop. If you do x = math.sin(0.4) in a function, you don't automatically return, even though math.sin returns a value.
that would be a coincidence
@JebediahKerman that would be sweet
23:06
@DSM so the .pop will return if .pop is not already in a return statement? but if .pop is alone it not will not reutrn?
@JebediahKerman what does "it" refer to?
pop is a method/function/procedure
so when pop finishes, it returns to whomever called it
now in your original example, remove_first_element() takes the value from pop and then returns as well.
if pop is alone as you say, it (pop) still returns...but the function which calls pop doesn't return unless there is an explicit return statement
DSM
DSM
Jebediah: say someone asks you to get a book. You're too busy, so you ask me. I get the book, and give it back to you. That doesn't mean you have to instantly give the book to whoever asked.
@DSM I see thanks
DSM
DSM
23:10
Asking for the book is calling a function. Giving the book to the asker is returning a value.
yes but in my case returning is part of the function, where does that leave me?
@JebediahKerman Every function returns eventually
DSM
DSM
In a place where you can return whenever you want. As CodeGuru said, it's exactly the same as breaking it into two lines, first assigning to tmp and then return tmp.
Okay I see now
thanks both of you have been very helpfull
no prob
23:17
all right I gtg
you guys have a nice day
bye
01:00 - 19:0019:00 - 00:00

« first day (1149 days earlier)      last day (4022 days later) »