« first day (1665 days earlier)      last day (3275 days later) » 

8:15 AM
hello programmers
we are developers or programmes
programmers ?
 
i dont know
someone in php room ask it
 
people nowadays don't even bother googling... (facepalm)
 
Hello Java!
Seems default DP has been changed on SO
 
fge
8:30 AM
Moo
 
@fge I'm going to start your comment, as it has been the most random one I've seen so far
 
fge
Actually it's my greeting
Too lazy to type "morning"
 
still, look at it in the highlighted comments
I love taking things our of context
 
fge
Eh, this happens pretty frequently on this room
 
yep
 
8:35 AM
but you did type more than that :P later @fge
 
fge
In reality I took that "meme" from the original Diablo
(and I know this game is older than a lot of people on this channel)
 
hey, I have an original copy of Warcraft
 
I'm always out of context :D
@fge I feel old when you say that XD
 
when games came in big boxes and were not called "collector's edition"
 
fge
Yeah well, you don't turn 40 on Monday, do you?
 
8:37 AM
no, I'll turn 35 on Monday
is your bday on the 18th as well?
 
fge
Yep
 
OMG!
 
I'm not going to say "what are the odds?" because we will end calculating it
 
fge
The odds are simple
 
but it's a surprising coincidence nevertheless
 
8:38 AM
So we gonna celebrate two birthdays this Monday?
 
fge
When you have a group of 25+ people the probability of having two people born on the same day of the year is already 0.5
 
yep
but it's normally around 10 here
 
fge
It's a thing I recall from my maths course, unfortunately I can't recall how to calculate that at all
 
unless we count the bots
 
fge
So I'm not surprised in the least :p
 
8:40 AM
oh well
 
May is a great month for birthing developers
 
still, I played Diablo when it was released
:D
 
fge
@Tavo and the later extension?
 
I was too poor to buy it and I doubt our computer could have handled it
 
unfortunately, no
 
fge
8:41 AM
Ah
The cow was in the extension
Well, you can buy it from gog.com I gather
 
yeah, I love gog
I recently got Dungeon Keeper II
 
fge
Bwaahahaa
I love Dungeon Keeper
"It is intolerable that those people can die from old age"
 
:D
you should try Overlord then
 
@Tavo you mean Dota?
 
@deadlydragon00 nope, Dungeon Keeper
@fge it's the closest to DK you'll find, and it's loads of fun as well
 
8:43 AM
for Warcraft I mean
 
fge
Well, I don't play anymore, really
 
@deadlydragon00 still Warcraft
 
@fge shame
@deadlydragon00 it was back in the 90s
mmos where called muds back then
played muds all through uni
 
If this will be a question in ACM for sure nobody can answere :P
 
8:56 AM
Bam Hello everyone
 
hi, is here someone familiar with securing the tomcat7? I want to disable RC4
 
@Tavo Hi I managed to find a good algorithm for my TSP, however it seems hard to implement. It's called the HelpKarp algo. I also found the nearest neighbour, which is very easy to implement, however it's not very good apparently
 
@Sabir might be the reason why I've never heard of it
 
@Tavo Nearest neighbour one?
 
no, jk
nearest neighbour is pretty bad
 
fge
8:58 AM
@Sabir why don' t you just do them all?
And then you decide
Make the algorithm pluggable, have a different set of data, compare
 
@fge I want to do the HelpKarp but it seems hard
 
fge
Well, do TDD then
 
much better then Sabir
you'll learn more
 
no tomcat expert here? :(
 
But I have only 7 hours to complete it
 
8:59 AM
ah, procrastination
 
I made my brute force in 3 hours tops. I used 2-opt in it without realizing.
 
the devil among developers
 
Indeed. But when it concerns my future I can't procrastinate :P
 
you had all day yesterday afaik
;)
 
Yeah. I spent it working on it till midnight
no luck
Today I woke up early read everything about the algorithms and decided to either use HelpKarp or nearest Neighbour(easier but not really good, it's very bad imo)
 
9:02 AM
what are you looking for? best solution or fast solution?
 
A good solution which is fast
I don't need the best
I could even make the nearest neighbour and write my report on it but I don't think it's worth it
 
user image
2
 
xD
 
how big is your problem? how many nodes?
can't be very big if you used brute force
 
Yeah. I made a test with 4 nodes
 
9:05 AM
lol
 
Ran in 1200 ms
 
try it against 20
 
Then I made 1 with 10
I got a NumberPointerError
I'm not sure why
 
what's a numberpointererror?
 
NumberPointerError?
 
9:06 AM
Yea
 
What is that? >_>
 
is that a custom-made exception?
 
I don't know maybe I read it wrong xD lemme test it again
 
fge
I wager this is some sort of external library
 
I'll put my money on "he read it wrong"
 
9:08 AM
NumberFormatException :P
ReadItWrongError <-- Cannot continue execution
 
NullPointerException?
@ItachiUchiha lol
 
Dafak
Now it's working :
I might have wrongly written my input file data yesterday :3
Enter the node(city) you want to start at:A
We have a total of 362880 possible paths.
The shortest path(s) is/are as follows:
A TSP tour in the graph is ABFEGDJCIHA. The cost of the TSP tour is 91.0
A TSP tour in the graph is AHICJDGEFBA. The cost of the TSP tour is 91.0
Program was executed in 10401 milliseconds
 
10 secs for 10 nodes...
try 20
 
I need to type it now lol
will take a few minutes lemme do it
 
10 secs is not bad for brute force
 
fge
9:14 AM
OutOfMemoryError: brain overload
(or OutOfSynapsesError)
 
maybe it was TooMuchBeerException last night
 
Time to run it
It's running and my fan is making a louder sound than normal
Will my laptop fry? :O
 
fans suck
 
(20-1) !
 
just cook a sunny side egg on it. its heat capacity will keep it cooled
 
9:24 AM
1.21e17 ms (assuming 1 ms per permutation)
 
yeah, good luck waiting for it to finish
 
=> 3,8 million years :'(
 
so now you know the problems of brute force
:)
 
Yeah :)
 
you have plenty to write about it
 
9:26 AM
Yeah. But the problem is the efficient algorithm
If I get the idea I can write it. But the problem is I don't get the idea
 
the idea of what?
 
Of how to implement it
My file contains lines like this
A : B : 10 where 10 is the cost
So my approach is an arraylist of arrays storing them like this ["A", B", "10"]
 
just write a program that opens the file, reads the line, parses it and takes the data you want
 
I have my arraylist with my vertices
I have my arraylist with my edges and associated cost
Apparently I have to make an adjacency matrix
I'm not sure how to do that
 
that is a matrix that has all the vertices as rows and columns, and the distances between them in each position
 
9:30 AM
So I do need that?
 
ie:
\ A B
A0 2
B2 0
 
In that case it will be a 20x20 matrix, won't that still take years to complete?
 
the matrix is just a visualisation (at least for me)
 
So I don't need to create the actual matrix then?
 
but I think you are being guided to a solution where you need a 2D array
and use it in your algorithm
 
9:32 AM
Here's my bruteforce
 
yet again, I'm not your professor, so I don't know how the problem is phrased. Understanding it is part of the assignment
 
I didn't use a matrix in this.
 
sorry, can't access pastebin from the office
 
Ah okay
Question goes like this
Propose a more efficient solution
and provide a performance evaluation of your solution
compared to the naïve implementation.
That's the most tricky part, the bruteforce was quite easy
 
well, just choose another algorithm. I don't see it asking for a specific one
doesn't have to be the best, just a different one
 
9:35 AM
So nearest neighbour could be good
 
it is a solution. Might not be better, but still a solution
 
Yeah.
How can it not be better than a bruteforce?
:P
 
always depends on the number of nodes
 
Aha
 
a lot of people tend to discredit brute force. It is a good solution in certain cases
 
9:37 AM
Can you please elaborate?
 
nope. That's part of your assignment. It's you who need to figure it out ;)
 
Hehe. Yeah I agree :)
 
I will give you advice. I will not write your essay for you ^_^
 
:P I can write the essay if I get my program to work :D
Just 1 more question before I start coding
 
your program works, you've seen it
 
9:38 AM
Efficient one I mean
Just 1 more question. Do I have to compute and store the adjacent matrix?
 
I don't think you need to, but go with what you think is best
 
Okay.
 
I should follow that sentence with "young padawan"
 
Star wars (y) :D
Sabir you must have, young padawan :D
Sabir means Patience in Arabic :3
 
now, go coding
 
9:41 AM
yep. Be back in a few hours :)
maybe 2
 
10:08 AM
best part of the job: waiting for the system to fire an event that will use the new logging so I can see what is causing the error...
of course, no events in the last 20 mins...
 
Haha
 
fge
@Tavo you did unit test your stuff, right?
 
yeah, but I fixed the issue
 
@fge speaking about unit test, ho do you actually make a good unit test?
 
@Tavo i had few situations like those but i have put the loggers some other place :P
 
10:11 AM
now I need to see if the system keeps throwing the message log or not
@Sabir, that's a very good question
there's a lot written about that
 
I read a bit, but I never get it right
 
@Sabir by making the test obvious
 
I'm trying to make my adjacency matrix based on my nodes but it's not working
All I have is an nxn array and I'm not sure how to input the values in there
 
fge
@Sabir by testing the behavior of your code; this is what unit testing is about
 
I have a list of vertices that goes like this <"A", "B", "C", "D">
 
10:14 AM
ok, so here goes my (humble) opinion
 
Then I have a list that goes like this <["A", "B", "10"], ["A", "C", "5"], etc>
Now I am making a String matrix[][];
I use the size() of vertices and make it
now I want to use my list of arrays to input the values of 10 in my matrix array at AB
and 5 at AC etc
ofc in this case my 5 and 10 are strings but I can always convert them back to int when I need to use them
 
first thing, name. Name it so it explains what it should do. Don't worry about making it very long. Something like thisMethodShouldDoThisThing is my favourite style, but that's a personal choice.
Second thing, test one thing and just one thing. Avoid having 10 different assertions in the same test.
Third, mock anything that is not related to what you are testing i.e: if you have a dependency from a different class, mock its behaviour. If you can't, that's usually a code smell
there's plenty more, but that should be the very basics (as far as I can remember right now)
 
Aha. I'll try to make it for my TSP later today :D
But I can't solve my adjacency matrix
 
@Sabir I'm sure you will
 
10:37 AM
@Tavo What's a good algorithm to make the adjacency matrix? All I see on google is using a boolean for the matrix instead of string I'm not sure why
Since I already have my data,
 
if two nodes are connected, they are adjacent. If you just want to know if they are adjacent, then your matrix will be boolean. If you also want to know the distance, then it should be numeric (i.e. Integer)
 
okay makes sense. But would an int matrix be better?
I know for sure they will be connected
 
"better" doesn't really apply here
 
okay
 
it's what works for you
 
10:47 AM
alright
 
@Sabir If you want to talk about optimization, you should pay Code Review a visit
 
but normally, if I'm inserting into a large matrix will it take years as well?
 
@Gemtastic I read a bit there, but I still need to write my code
 
@Sabir You can discuss in their chat you know
 
10:48 AM
Ah. Okay
 
@Gemtastic he likes us better me thinks :P
 
well, running Test Cases by me -_- .... So, that's agile
 
This community is great so yeah @Tavo :p
 
@Tavo Well, we're here and easily available on a non beta site. :P
Sorry to burst your bubble but I think we're only a convenience :P
 
just saying...
 
10:49 AM
A nice convenience
 
exactly why I'm ignoring
 
Okay my logic is fried, I need help otherwise I'll stay stuck till midnight
 
c'mon @Unihedron we were all clueless once
 
no question there
 
and wanting to cut corners
 
10:51 AM
no way
 
I figured out a solution. I make an int matrix of nxn. I then then the diagonal of the matrix to 000 since I won't use the diagonal. Then the part where I'm stuck is filling the rest of it
because my file is in the for of A : B : 10
 
@Sabir well, you only need to fill the top or the bottom part, as the other half is redundant
 
yep. @Tavo
 
that should save you some time
 
That's the problem how do I send the information from my list <["A", "B", "10"] , ...> to my array
I know AB will be [0][1] in my array. Then I have to put 10 in that spot
 
10:54 AM
go through your list element by element, and put it in the right place
 
^This is the tricky part. Will it takes years to do that?
 
if "A" is 0 and "B" is one, you know exactly where to put it
no, the cost of that should be linear
 
because I need to do some checkings within the lists and the array and then input
 
the distance is always static, isn't it?
 
yep
it doesn't change
 
10:55 AM
The issue I have in my current project is that I'm with a bunch of people who knows all the frameworks I don't, and when they use them they just look up a tutorial but have no idea how it actually works, I'm digging deep and read about what it is java is interacting with, not just the process in the JVM. Which leads to that the other people are kinda "done" and I haven't done jack but learned a bunch of things :/
 
@Gemtastic at least you've learned :)
 
They like games, I like databases, it was little bit of a bad match of competence for the project :/
 
@Gemtastic That's me for the past day lol
I like making code from scratch, I struggle on reading others codes
 
@Tavo I learned A LOT. It's been wonderful but when we look at our agile work environment... I haven't done shit.
 
@Gemtastic patience. Next project you will do a bit more
because now you have the knowledge
the more you know...
 
10:58 AM
The most annoying part was that I had to beg for something to do, and when they gave it to me, I started reading, went to bed, got up the next day to go to work, come home to start coding and.. someone else already did it. I feel terrible. I don't do anything but comment on what they've done wrong... Like branching out on 16 different things :( I feel like a partypooper not contributing to anything.
 
blindly copying tutorials; what a wonderful way to end up with an unmaintainable mess
 
I'm annoyed with my own performance, I never knew I was that bad to work with :(
 
look at what @kiheru is saying
 
Quick question I might have forgotten how to insert into an array
 
I'm learning a framework now with no API so that I can restructure the code my group member does to that I can add my module to it :/
 
10:59 AM
adjacencyMatrix[i][j]
 
@kiheru Still, in agile development, results matter, and I have nothing to show :(
 
how to i insert 0 0 in i and j
?
 
@Sabir That's a 2D array
 
@Gemtastic agile is not about that
 
@Gemtastic ya
 
11:00 AM
@Tavo It's a lot more, but building something fast matters a lot
 
learning curve, everyone undestands that
 
And they've been working all day and night :/ I work during the day
 
.
omg
 
@Sabir stop that
 
Sorry. That was a mess
~I was stupid~
There we go
 
11:01 AM
@Gemtastic relax. Nobody is meant to work all day and night
 
And well, it looks worse that I've been studying something for days and they whip up something that works in one day. They're not terrible developers, I don't mean to pull them in a bad light here, I am unhappy with my own performance, which is in code; nothing,
 
not understanding how the code works basically makes proper refactoring impossible. quick results are quick only in the beginning, but if the code can't be refactored the progress will hit a wall a bit later
 
@Tavo They have, they don't work so they have the time, and prior knowledge. Only games I've done are command line Black Jack and a simple simon says...
They've only done games
@kiheru That's why I have to rewrite this entire module
 
@Gemtastic there is your task ;)
 
Not to mention we do have the issue with that all the branches have conflicts
I wish I could have been there to tutor them in git
 
11:04 AM
hah. You have to love that
 
hehe. the real problem will be explaining the others why it needs a rewriting
 
But hey, now they know why you can't work like that ;)
 
I would recommend you to use Perforce's merge tool
 
@kiheru That's easy since I already know that
 
Perforce is rubbish, but their merge tool is fantastic
 
11:04 AM
But I don't know the frameworks, so I have to learn them and that takes time
time they use to just follow a tutorial or use prior knowledge. They've had 8 months to learn some of those frameworks
I still feel like I fail this course. I would have been done now too if I did my own thing and I kinda want to; what I wanna do is easily managable in 2 weeks (course ends the last of may) but that's a failure in learning to work in a group :(
This is my first group work and I did nothing :(
I'd probably make an excellent project manager though
 
@Tavo
static List<String[]> edges = new ArrayList<String[]>(); //List of edges and associated costs.
static int[][] adjacencyMatrix;
static List<String> allVertices = new ArrayList<String>(); //List of all vertices.
adjacencyMatrix = new int[vertices.size()][vertices.size()];
//Fill Diagonal with 0, meaning unused.
for(int i=0; i<adjacencyMatrix.length; i++){
	for(int j=0; j<adjacencyMatrix.length; j++){
		if(i == j){
			adjacencyMatrix[i][j] = 0;
		}
	}
}

for(int i=0; i<adjacencyMatrix.length; i++){
	for(int j=0; j<adjacencyMatrix.length; j++){

	}
}
I filled my diagonal with 0s
But now for the next fill part, when I'm going to check each and every permutation in my edges list, won't that be too long?
It looks like you might need a break - take a breather and come back soon!

You've asked 2 questions recently, some of which have not been received very well by the community. Everyone learns at their own pace, and it’s okay to make some mistakes. However, the reception your questions have received thus far might ultimately block your account from asking questions entirely.
-_-
 
11:25 AM
question ban
 
Meh. I need to finish my thing today and I get a ban now I can't ask questions.
except for here
I'm totally lost can anyone help?
 
@Sabir for filling the diagonal you need only one index. You can simply do adjacencyMatrix[i][i] = 0
 
@kiheru I solved this problem
My problem is
I want to fill the rest
my file is like this
A : B : 10
A : D : 5
A : C : 10
etc
i have my list of vertices ["A", "B", "C", "D", ...]
So I need to go through all of them
Then if it's A : B I put 10 on adjacentMatrix[0][1]
 
linear search of the list won't take long - you're unlikely have large matrices for travelling salesman. the actual problem solving will dominate the running time anyways
(List has indexOf(), that you can use)
 
11:40 AM
I have 3 lists:
 
For sorted lists you could use Collections.binarySearch(), but I'd start simple
 
then 1 like this:
<["A", "B", "10"], ...> This one has the 2 vertex that are connected and it's cost
basically I have to check the order ABCDEF...Z
so for example ["A","B","10"] should go to adjacentMatrix[0][1] and adjacentMatrix[1][0]
 
fge
Meh, why don't you just insert the edge names into a SortedSet and be done with that part?
 
I have no idea on how to do this check for each line in my file that I stored as <["A", "B", "10"], ...>
 
Cool, IntelliJ adds scratch files!
 
11:42 AM
@fge meaning?
 
fge
THe problem is that your storage is badly designed to begin with
 
Yeah
 
fge
@Unihedron that's old news to me :p
 
yes I need to cut on my side tasks
<- time horribly mismanaged
 
11:44 AM
 
fge
@Sabir here's a tip: create a simple Vertex structure with two elements (first, second); create a SortedSet<String> to store the vertex edges as you see them; create a Map<Vertex, Integer> to put the weights in
 
I never used sortedSet and Map
Let me read about it and try to make it
 
I congratulate you in advance for learning the ways of a proper learning programmer today.
Always look up everything new instead of asking them.
 
Good time to learn :-) Map is one of the interfaces that gets used all the time.
 
:)
 
fge
11:46 AM
@kiheru to the point of being very often abused/misused/overused
 
Okay I'll be back a bit later after I read about all of these
and try to implement
 
@fge true. Easy to use & flexible => easy to abuse
 
Okay... can somebody please explain to me again why the crap Arrays don't implement Collection?
 
@Vogel612 because they aren't collections
they aren't Iterable, either
 
Arrays born far far long time ago..
 

« first day (1665 days earlier)      last day (3275 days later) »