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

4:00 PM
@Tavo Mine would be drumming and working out. But yeah.
 
hey, working out is sort of a sport
 
yeah fair, its kind of like a one versus none sport
 
Crossfit seems obnoxious enough to be a sport
 
^hah
 
@Dustiny won't make the joke
 
4:01 PM
ummm
 
I'd be happy if I could run without fainting
 
I take the stairs when I head out for lunch, does that count as sport?
 
Or have to be in agony for 4 days afterwards from inflammation in the shin membranes...
 
@Unihedron no if you go from the ground floor
 
XD
 
4:02 PM
@Tavo Lmao. Who knew you could work out infront of a computer screen..
 
:(
 
fge
JSR 203 rocks
memoryfilesystem in particular is a great way to test fs interactions
 
@Tavo I'm more referring to the fact that I eat and drink very unhealthily
if I didn't play hockey, I'd balloon, I'm sure
 
My daily routine: Wake up, realize it's a holiday, walk in front of mirror, brush my teeth and decide I'm too lazy to shave (haven't shaved in months for that reason), then turn on and use the computer all the way until I have to get a meal / sleep
 
@fge never heard of it. I'll take a look over the weekend
 
4:04 PM
@Kylar That's decently easy to change though, which you probably should unless you want to get cancer eventually.
 
fge
@Tavo I'm not surprised; for some reason people today still use File even though JSR 203 has been there for 4 full years
File sucks (#36)
 
@Dustiny I'm going to get cancer and die anyways :)
 
Yah with an attitude like that!
 
@fge agreed. File is awful and counterintuitive. I'll check it out properly. Any hints on where to start?
 
4:06 PM
Then I'm going to travel to alaska and push myself off into the bering strait on an ice flow and float off into eternity.
 
fge
@Tavo here; also, I have a room dedicated to jsr203
 
fge
In fact, I develop file systems over this API
 
thanks guys
 
@Kylar Sounds pleasant
 
4:08 PM
I'll have a proper read :)
 
I was upset that this website: download.oracle.com/otn_hosted_doc/jdeveloper/j2ee101302/… was giving me false information about JNLP syntax until I realized it was from 2004
Now I'm just upset there isnt anything recent floating around the internets
 
...]
 
@Dustiny eventually you get to the point where you realize that there's no one else that hits the same problems that you hit.
I found a problem with ApacheHttpClient this week
Like.. people should use that, right?
 
Oh man tell me about it. I had a similar thing happen with Hibernate/JPA
 
But... I found one thing that was a huge pain to deal with
and one answer that sorta helped in a roundabout way, but I still spent 3 hours in the debugger trying to figure out stuff
The more...esoteric parts of HTTP are not made easy to use with ApacheHTTPClient btw
 
4:12 PM
Ugh thats rough.
I remember digging through SO once and a solution to my problem was a -24 voted answer that was a line long..
 
Ahahaha, that's typical for me
 
I made this account just to upvote the guy and then realized I couldn't upvote with 0 rep
 
@fge I started with "Why File sucks". Already knew the reasons, not a good start :P
 
fge
Well, start with the API usage then
But as a systems engineer, File handling in Java is a wart which the language should get rid of
In fact, all File related methods should have been made @Deprecated as soon as JSR 203 was there
Methods or classes
Even @Dangerous, or @Braindead
 
@methodforidiots
 
fge
4:17 PM
I'll never rant enough about File so I'll just stop there
 
@fge maybe in java 9 or 10. They refurbished date and time with joda just in java 8
 
The third implementation of date and time in Java
 
third time lucky?
 
I remember talking with Josh Bloch about some of the mistakes in the JVM and JDK api's, and one thing he said about the date/calendar fuckups were "If you don't get it right the first time, make damn sure you get it right the second, because you won't get a third chance."
 
well, they had to bring in the big guns this time, in the form of Stephen Colebourne
 
fge
4:23 PM
@Tavo and they didn't make Date or Calendar @Deprecated
Why?
 
I wish I could answer that...
 
fge
File should have been made @Deprecated
It's a horror
 
Maybe they avoid deprecation because it's used everywhere. Clients would complain
 
fge
@kiheru well, let the clients complain
And teach them how to use the new API
 
I agree, but I don't get to decide it
 
fge
4:26 PM
Even questions on SO today with new code still use File
 
@kiheru deprecation is the way forward
 
fge
That's incomprehensible
 
it's a warning saying "move away from this. It might have been good once, but not anymore (if ever)"
 
Some of those are for android, and android still does not support jsr 203
 
fge
It's just as in a car forum people were still asking "how do I solve this or that problem with my Ford Model T"
@kiheru that's Android's fault, not Java's
 
4:28 PM
except that on a car forum, people would think "cool, you have a model T"
 
yeah, nobody will say "cool, you have a file system" :P
 
google's fault, but those who program for android must use what's available
 
fge
But then again why on Earth didn't Android devs implement JSR 203 in the first place?
The faults in File are glaringly obvious
On the other hand there's no lack of projects aiming at supporting the Java 8 language level for Android
 
Beats me. Google is even listed in the experts group for 203
 
fge
"Hey, guys, why don't you get your basics right first?" is what I want to yell at them
 
4:38 PM
I don't know if I should be happy or not. My problem fixed itself after trying to debug it for hours..I hate internet explorer.
 
IE...
 
Don't worry, it'll randomly appear again
 
hah
 
looking for advanced java library AI system which can be infused to learn 'information'
JMegaHal is dumb as a brick.
albeit entertaining to have made a brain infused with colonel sander's autobiography..
 
fge
@Woodrow define "AI"
From your description what I believe you really want is machine learning
 
4:44 PM
Yeah that is indeed my worry..god damn it.
 
Possibly.. I'm looking to develop different 'brains' that I can put into different entities
So one will be like a chef; another a politician
in a virtual multiplayer environment;
where players can interact with these 'AI intelligent' npc's via human-conversation
 
when you say 'brain' I instantly think of neuro-network. Do you know anything about them?
neaural network*
misspelled again but I think you get it
 
I'm fascinated by them.. idk anything about them, but that's the technology used by deeplearning4j?
 
In short they are essentially 'nodes' (of a tree) which simulate neurons in a brain by using matrices and weights. I'm not sure, but I'm going to guess that it is what they used
 
fge
<-- still trying to get work done
Grrr
 
4:50 PM
Sounds like fun.. AI is fun.
 
fge
I hate being like that :(
@Woodrow for some definition of "fun", certainly
 
Just have to be inspired by a really cool project :)
 
@Woodrow I am assuming you don't mean it will pass the Turing test though? lol
 
fge
Well, then define "cool"
A spam filter is a basic example of machine learning
 
cool is anything that inspires you; of course it's subjective for each person
 
fge
4:53 PM
The problem with spam is that you need to be able to perform semantic analysis on the fly
And that is a hard problem
Very hard
 
turing test.. will look up
lol; not indistinguishable; but able to ask a human question, and get an intelligent response (assuming you ask the 'baker' brain baker questions)
 
fge
@Woodrow my personal belief is that the Turing test is both overrated and underrated
 
so on average, it's ok
 
fge
Overrated in that it is perfectly possible to have a conversation with a total "idiot", and that "idiot" is a subjective definition
Underrated in that the Turing test fails to account for a critical aspect of human interactions: emotions
 
Ya; don't need perfection by any of those standards.. but I know there is some advanced conversation AI software like what I'm looking for - like this (I used the free trial); zabaware.com maybe I'll contact them to see if I can use it for my purposes..
 
fge
5:00 PM
Well, define your purpose first
In defining a project you have to be precise
Particularly about the expected interactions
 
My purpose would be to have different 'brain files' which can be loaded into NPC's (already have that with JMegaHal), and load in hundreds of pages of autobiographies in each brain for the role it's playing into a zabaware brain; then people would be able to converse pretty well with the bot & the role it's playing. Zabaware already has a smart brain that parses sentences well and gives a good response; incorporate that after teaching it a role, and it's good.
that's the conversation aspect;
For commands to the npc I'd write something up myself, and have that distinguished by a "." at the beginning of the sentence
 
user4718768
5:22 PM
Look at this topic: stackoverflow.com/questions/29312541/… you have an example of text-to-speech, speech-to-text and a bot who is able to think about a string and find an answer.
 
@Tavo Lmao.
Off topic: I've been sending people whom I haven't talked to in a while a text that says "made you look" and I think it's hilarious.
 
Heh
 
Would anyone be kind enough to help me out with a linked list implementation?
 
Try it out sometime, it's yours for the taking
 
fge
5:39 PM
OK, excellent
I've just had the approval of creating a project with examples of the language I have to parse
 
SO yeah we got a 2 hour power cut
F MY LUCK
Can anyone help me with my matrix
@fge when you said it would be easier, how?
 
fge
Easier what?
 
My Vertex implementation
this is how I did it
2 hours power cut I thought about it I have no idea how to make my adjacency Matrix I really need help :(
 
fge
Sorry, I can't really help there
 
@fge Can you atleast please explain the way of doing it
my vertices are like this [A, B, C , D]
my TreeMap is like this
{AB = 10, AC = 6, AD = 5, BC = 20, BD = 10, CD = 20}
Now based on these what is a way of making the adjacency matrix?
 
6:00 PM
posted on May 15, 2015 by CommitStrip

Today, CommitStrip welcomes Docker, the now famous containers platform! If you don’t know Docker yet, you can’t miss it, so check it out! Docker is organizing their annual DockerCon conference on June 22-23 in San Francisco. We’re happy to announce that we’ll be there as a Creative Partner! All attendees will receive CommitStrip posters and stickers, and we’re also

 
fge
@Sabir that shouldn't be AB but some POJO which differentiates A and B
 
So could it be 01 for example?
or (0, 1)
 
fge
Depends on whether you want your graph to be directed or not
But I guess TSP requires a non directed graph
 
It should find the shortest rout from a node to itself
example A->B->C->D->A
The thing is I can't get my adjacency matrix
I'm not even sure if that's the way to do it anymore
My bruteforce works with 10 nodes but not with 20, that's where the efficient algorithm comes in. What would you suggest as an efficient algorithm? and is the way of adjacency matrix the right way?
 
fge
Do you have a defined set of edges in the graph to go through?
And in a defined order?
 
6:08 PM
Yeah
My TreeSet has them
 
fge
Then just use what I said MUCH earlier
Djikstra's algorithm
 
{AB=10, AC=15, AD=20, BC=35, BD=25, DC=30}
 
fge
Apply it from A to B, then from B to C, then from C to D, then from D to A
 
Ahh no. I need to find the shortest path
It could be ACDBA
or anything
Dijkstra is not the way from what I read since I need to go back to the start and Djikstra just find the shortest between 2 points
 
Thanks for the link; will look in to.
Also wrote a letter to zabaware.. a chance that pans out.
 
fge
6:25 PM
@Woodrow do I take it that you want to make a game where NPCs are "smart"?
 
@fge hi. me needs your knowledge
why are unchecked exceptions children of checked ones in java?

catch(Exception amICheckedOrUnchecked){
    if(amICheckedOrUnchecked instanceof RuntimeException){
        throw amICheckedOrUnchecked; // sorry this can't be handled
    }
    // actual handling here -__-
}
 
fge
@Worf aah, that's an excellent question... And I agree that it is a pain somewhat
There is ONE THING that is crucial to understand
The fact that checked, and unchecked, exceptions exist is only defined because the JLS defines them
 
enlighten me
 
fge
At the JVM level it does not matter
Do you know of Lombok?
 
nope
 
fge
6:27 PM
OK, well, basically the thing is this
It is only at the compiler level that the distinction is enforced
And yes, for some reason, RuntimeException is a subtype of Exception
There is however a saving grace
Since the exception class hierarchy is well defined you can code your stuff like in this example:
(extracted from my throwing-lambdas package)
When you catch, the most specific exceptions will be caught first
So, if you catch RuntimeException before Exception you can just rethrow it
 
yeah i was thinking of something like that. i have no idea what that code does tho :P i'm not familiar with the syntax
you have interfaces for closures in java?
 
fge
Java doesn't really know about closures in the CS meaning of the term so no
 
but you use that to force a closure to have a specific signature?
 
fge
Define "closure"
There is no closure in the CS sense in what I'm doing here
 
a lambda
yes well i meant a lambda function
this.something(function(Bar a){

});
 
fge
6:37 PM
A lambda is not a closure; if you are talking about the package name, it is just a meme over what Java 8 calls "lambdas"
 
this?
 
fge
Maybe you'll understand more what this project is about
 
path -> {} this is a lambda, right?
 
fge
Hold on
Yes it is
Now, are you aware that Java has no native function type?
If you have done some CS, basically the thing is to not take lambdas "at face value" in Java
x -> x+1 looks like a bona fide lambda except that Java has constraints as to how such an expression can be used
 
@fge I'm trying to make a Vertex in the form of (A, B)
What should I learn to be able to make that? I Understand I have to create a class called Vertex
What is the next thing?
 
6:49 PM
Well, the Vertex class consists of two nodes, right?
 
W.B shotgun
Ya
 
Im still trying my adjacency matrix
Im freaking out we got a 2 hour power cut
 
now I have 2 hours to complete it
1 hour to write a report
 
6:50 PM
well, you got this
 
Basically I got an idea for the adjacency matrix
I could make a map of Vertex, Integer
My vertex would be a combination of 2 nodes
say A and B
then instead of it being A and B I'll check it with my list of nodes and assign a number for each letter say I have A and B
A will be 1 and B will be 2
 
That's an adjacency list, not an adjacency graph
 
Thus my Vertex will be (1,2)
 
Similar implementation but slightly different effects.
 
Ahh
I only heard of adjacency matrix and I'm trying to implement a matrix
lol
But then how would you use the list to find the shortest path from a node back to itself
 
6:53 PM
Adjacency graphs/matrices consist of a mapping of NxN integers, where N is the number of nodes.
 
I do have a SortedSet with my nodes
[A, B, C, D] for example
 
I can't use Dijkstra
Djikstra will simply find the shortest path from 2 points, making it a bad algorithm for TSP
I read it on Codereiview stack lol
 
fge
It doesn't mean that it is bad per se
 
Are you trying to find shortest distance or shortest path?
 
6:55 PM
Shortest path(route) from a point back to itself.
 
That's an algorithm called Minimum Directed Cycle (assuming you don't allow backtracking on vertices).
 
yeah no backtracking
You should go through each point only once and get back to start point. All point are connected
and weighted
 
Oh, that's TSP
 
I said TSP earlier lol
 
6:58 PM
3 mins ago, by Sabir
Djikstra will simply find the shortest path from 2 points, making it a bad algorithm for TSP
 
never mind me,
 
What would be a good way of solving the TSP?
 
Dynamic programming
There's also the Naive method
 
I did the naive(brute-force method) from scratch
Works with 10 nodes but it goes through all possibilities
 
Yeah, the dynamic programming solution is in O(n^2 * 2^n)
 
7:00 PM
So is the method of finding the adjacecny matrix the way to go?
 
An adjacency matrix is one structure that can be used as the backing store for the problem, but it needs to be extended a bit.
 
Let's say I have my adjacency matrix or list w.e how do I solve it then>
 
Well, you use that to build a cost function.
Say each vertex gets a number from 1 to n.
 
But I already have the cost
From Vertex A to B cost is 20 for example
 
That's the weight of each individual vertex, right?
 
7:03 PM
my file is like this:
A : B : 10
A : C : 5
 
@fge sorry got distracted, ttl, thanks for now, your help is gold :)
 
The cost isn't necessarily the weight of direct vertices; we need to use dynamic programming to build the actual ideal costs of each path from 1 to i.
 
@ShotgunNinja Exactly, that's the idea I had. let's say A = 1, B = 2 and so on. Then I could use this to build my adjacency matrix
 
fge
@ShotgunNinja beware about "dynamic programming", I believe you are taking it out of context here
What matters is the algorithm
 
Yeah, I'm sure I am.
 
fge
7:05 PM
It's not "dynamic programming" as AspectJ defines it
(and I hate AspectJ)
 
Dynamic programming wrt algorithms has a different contextual meaning than Dynamic programming wrt Aspect-Oriented Programming
 
pastebin.com/7idapiCv @ShotgunNinja
Here's an idea of what I did
I can't do the adjacency matrix though
 
fge
Well, in algorightmics, there is no such thing as "dynamic programming"
There are just algorithms
 
I believe if my Vertices were in the form of [1,2] instead of AB, for example it would be easier to make the adjacency matrix
 
In mathematics, computer science, economics, and bioinformatics, dynamic programming is a method for solving a complex problem by breaking it down into a collection of simpler subproblems. It is applicable to problems exhibiting the properties of overlapping subproblems and optimal substructure (described below). When applicable, the method takes far less time than other methods that don't take advantage of the subproblem overlap (like depth-first search). In order to solve a given problem, using a dynamic programming approach, we need to solve different parts of the problem (subproblems), then...
 
fge
7:08 PM
Meh
That's the classical "divide and conquer" principle
 
The "dynamic programming" approach as applied to AspectJ is actually Aspect-Oriented Programming.
 
fge
It's not worth a name by itself
 
@ShotgunNinja Wow
I'm not gonna say what that makes me think of XD
 
fge
In mathematics that would be called Markhov chains, but that's the same basic principle: divide and conquer
 
@fge Not necessarily; dynamic programming usually involves specific behaviors such as memoization.
It's a shitty name, I'll admit.
 
7:09 PM
I'm so stuck :(
 
But the point is to remember a list of stuff and replace it successively with better and better stuff until you have the answer.
 
fge
Sure, then what? A Turing machine can also do memoization ;) This is a case of stateless vs stateful here, and it is proven in CS that solving any NP complete problem cannot be done with stateless algorithms
 
So is it good to make my Vertex in the form of [1,2] instead of AB?
 
@Sabir Yeah, that would be more helpful, I think.
 
fge
@Sabir no it isn't, since this is only ever a bijection between your edges and indices
 
7:11 PM
But how do I make an adjacency matrix out of this?
 
fge
I believe you didn't really understand what I meant earlier
 
You know what, I think @fge is way more conceptually familiar with this than I am.
 
Any help would help me at this point
 
I'm gonna shut up before I confuse more people.
 
So it's fine. you can talk
 
fge
7:12 PM
Why do you think I asked you to store your edges in a SortedSet and vertices in a specific data structure?
 
Using a sorted set allows you to have your data structure select the optimal edge for you, when using edge-based selection.
 
fge
Well, that is not really the point here
You have a file as an input
 
@fge so that I could use them to make the matrix?
 
fge
You have vertices in that file, and associated weights
 
I think we need to forget using the matrix
 
7:14 PM
Okay
I have the vertices and weight
 
fge
Which means that unless you have read THE FULL FILE, you cannot know 1. how many edges there are, and 2. what are the weight associated to those vertices
If we go the full way, what you should do is use the builder pattern
 
Also, doesn't that file give you the EDGES, not the vertices?
 
fge
Add the vertices as you go; create the edges when necessary; and the adjacency matrix is generated on build
 
Here is the output of my current code
4
[A, B, C, D]
{AB=10, AC=15, AD=20, BC=35, BD=25, DC=30}
 
fge
@ShotgunNinja it gives both
 
7:16 PM
ah
 
fge
A to B has cost 10
 
Yep
 
fge
Which means that B to A also has cost 10
 
Exactly
 
fge
This is a non directed graph, to complicate matters :p
 
7:16 PM
exactly
 
fge
But then in Java you should precisely use a builder because of that
 
What's a builder?
 
fge
In Java 8 pseudo code this would give something like this:
final AdjMatrixBuilder builder = AdjMatrix.newBuilder();
try (
    final Stream<String> lines = Files.lines(pathToFile);
) {
    lines.forEach(builder::addVertex);
}
final AdjMatrix matrix = builder.build();
In fact, you could even devise a Collector
A builder is a powerful concept; it allows you to cumulate values into a container and produce what you need as a result of building
 
it's a bit difficult for me to learn about the builder design pattern
Is there a way I could just use what I have and get the shortest route
?
 
fge
Well, if you want to use an adjacency matrix, going through a builder is the shortest route
The intelligence of building the matrix is within the builder itself
Which means you only have to concentrate on the algorithm itself
 
7:25 PM
Where do I learn this?
 
fge
OK, can you paste an example input file?
 
okay
it's quite long though
 
fge
Nevermind that
 
okay
My code generates this(if that helps):
10
[A, B, C, D, E, F, G, H, I, J]
{AB=10, AC=15, AD=15, AE=20, AF=17, AG=10, AH=5, AI=12, AJ=20, BC=15, BD=15, BE=20, BF=17, BG=14, BH=8, BI=21, BJ=20, CD=15, CE=20, CF=17, CG=13, CH=15, CI=5, CJ=10, DE=20, DF=17, DG=10, DH=12, DI=23, DJ=6, EF=17, EG=6, EH=12, EI=8, EJ=12, FG=34, FH=12, FI=15, FJ=40, GH=12, GI=17, GJ=10, HI=5, HJ=8, IJ=21}
Program was executed in 28 milliseconds
 
7:39 PM
@fge More or less; it's actually a bukkit plugin for MC. The goal is to have each NPC a designated 'brain' for the role it's playing... so when a player asks that NPC about it's role, it can provide a semi-coherent response. Example of an NPC with JMegaHal uploaded with the autobiography of Colonel Sanders: i.imgur.com/643RMga.png
(aka the kernal from KFC)
It's going to end up mixing with this vision; minecraftfrontiers.com/?page_id=37
 
@fge any luck?
 

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