« first day (2162 days earlier)      last day (2783 days later) » 

4:04 AM
Morning Java!
@Hans1984 LOL meeeoowww!
@TheCoder Converter<String, Integer> means, you have an Interface, which has 2 type parameters
@TheCoder this doesn't sounds as perfect example to your grandma. So, grandma would probably think; alright, then that means, under the hood; there will be a implementation code generated with the name of T convert(F from){...}
Nope; this is just method references
Converter<String, Integer> converter = Integer::valueOf;
can be rewritten as follows:
Converter<String, Integer> converter = (String str)->{ return Integer.valueOf(str);};
if you closely look at the lambda exp here, it's representing an any method which takes a string as an input param and return an Integer as the output
so, you don't actually create an anonymous implementation for that lambda, instead; you map your lambda with the interface method
 
4:58 AM
@Tavo morn
it's been awhile i couldn't present here
 
5:53 AM
o/
 
 
1 hour later…
6:54 AM
@gem o/
 
Morning
 
Morning! :)
 
7:42 AM
morn
 
8:37 AM
@Tavo waves at you
 
8:51 AM
hey @gem
nice to see you're here more regularly
I enjoy your presence and/or snarkiness
 
9:11 AM
I am currently prepping for a senior software development position and one of the requirements of the role is:

Familiar with different types of infrastructure components, such as datastores and middleware, and be able to select and combine them appropriately.

I have never been involved in the design of an IT system from scratch but am interested in it. I want to learn why one would choose a technology over another one (hibernate over JDBC, rest over soap, JMS over SCP).

Can anyone tell me where I would start on getting this info?
 
@TheCoder Phew, sorry, but I would say experience. And talking to people who have that experience. Don't think you can learn anything but the theoretical pros and cons from a book
Rest over SOAP is easy though, the other choice is SOAP!
 
hibernate over jdbc?
 
Hibernate, unless you want to tightly control what's going to the database (which in most cases, is not necessary). If you just send Map<String, Field> or something like that around things tend to get messy and hard to understand (i.e. "okay, what are the input parameters for this method, it just gets a map?"). And if you put it into entity classes, you're just doing Hibernate's job
Please keep in mind that is, like, my opinion. They want you to have your own ;)
 
advantages of jms?
thanks btw
 
I'm not really familiar with either of these, sorry
 
9:18 AM
it's hard to get experience in system design for projects that have already started
and you ust accept the architect's choices
 
Well, if it's a good project they have documented the reason for their choices
If not, you can still reason about if it's a good fit
 
would you say the biggest factor in choosing middleware is scalability?
 
Middleware is such a broad term
 
try {

BufferedReader br = new BufferedReader(new FileReader(new File("C:\\usr\\patients.csv")));
List<String[]> elements = new ArrayList<String[]>();
String line = null;
while((line = br.readLine())!=null) {
String[] splitted = line.split(";");
elements.add(splitted);
}
br.close();

JTable table = new JTable();
String[] columNames = new String[] {
"ID", "Location", "Status", "Ambulance"
};

Object[][] content = new Object[elements.size()][4];

for(int i=0; i<elements.size(); i++) {
content[i][0] = elements.get(i)[0];
 
I think if I was designing a system that processes trades in a bank, for example, I'd be considering technologies based on, at some point in the year, there could be millions of people trading - can my system handle this load
 
9:28 AM
getting this error list is not generic it cannot be parametized with arguments <String>
not to sure whats wrong
List<String[]> elements = new ArrayList<String[]>(); on this line
 
@ross.c format your code and post it to a pastebin pl0x
 
yup will do sorry
 
@TheCoder Also keep in mind security and stability, seeing as this is critical and real money ;)
Off to lunch
 
enjoy
 
morn
 
pew pew pew
 
thats the code formatted :)
 
this cat is having alllooooot of fun
 
@ross.c what's the issue?
 
hey rookie
 
9:32 AM
I put a comment on the line im getting an error on
 
hows java coding going?@ross.c
 
this is the error List<String[]> elements = new ArrayList<String[]>(); on this line
hahah @Hans1984 you rememeber me ! thought you would have forgotten ;)
 
nope :)
oc i do
 
going good im working on a small project for my self haha
Just going through GUIs :) they seem interesting haha
@TheCoder I know I'm doing something silly but I cant get my head around it
 
good good
 
9:34 AM
Because what I'm trying to do is import my Csv file to my JTable
 
paste the exact error
 
list is not generic it cannot be parametized with arguments <String>
thats the error I get
 
which List class do you import?
 
when you run or when you compile
it's working ok for me
have you this at the top?
import java.util.List;
 
oh what the..
hold on let me check
 
9:37 AM
you need these:
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
 
let me guess... java.awk.List?
 
wrong
 
@TheCoder not talking to you... you don't see the error
so your imports are most likely corrent
 
Okay I think that fixed it I'm getting another error which says java.io.FileNotFoundException: C:\usr\patients.csv (The system cannot find the path specified) So I think I'm imprting it incorrectly right ?
 
yep
obviously you didnt provide the right path ;)
 
9:40 AM
Hmm if its on my desktop can i jsut say patients.csv? instead of doing this C:\\usr\\patients.csv"
or do i go on the folder its in on the desktop click properties and copy and paste the source?
 
put the file in the directory that your program is. then no need for a path
 
Yep i did and i wrote the code like this
BufferedReader br = new BufferedReader(new FileReader(new File("patients.csv")));
its in my directory
but getting this error for some reason java.lang.ArrayIndexOutOfBoundsException: 1
at PatientClass.<init>(PatientClass.java:100)
at PatientClass$1.run(PatientClass.java:41)
 
then it looks like that has at least read the file
can you put breakpoints in your code and step through
 
Hold on I think i know what I have done :P ill be back in 5-10 mins with confirmation haha thanks for the help so far !!
 
that error means that you're trying to access an element of an array that doesn't exist
 
9:46 AM
@wonderb0lt yo yo
sorry, busy day
 
you access element 4, but the array only has 3
 
Well, techically me being here means I'm healthy, but bored XD
 
@ColdFire cat!
 
@TheCoder so I take out elemnet 4?
java.io.FileNotFoundException: patients.csv (The system cannot find the file specified)
 
no, it just means you think there is an element in an array when there isnt
 
9:52 AM
getting this error again I have dragged it onto my project on eclipse not sure what ive done wrong
 
ok let me check
 
ohhh i see
 
did you put the csv in the root dir of the project?
and put the path as "patients.csv" only?
 
I put it in the src
On my code its just "patients.csv"
 
and you still get the java.io.FileNotFoundException?
 
9:57 AM
yeah haha I'm so confused
 
print the path of the file here please
 
so like click on properties and get the path ?
 
yes
 
C:\Users\ross\Desktop\Ambulance Project
 
hears sirens
 
10:04 AM
you have this?
BufferedReader br = new BufferedReader(new FileReader(new File("patients.csv")));
 
yup :)
 
i put a windows on your windows
lol
installing a windows 10 on a windows 10 pc
 
and the file is sitting in Ambulance Project?
is there a src folder in Ambulance Project?
 
yeah its sitting on there
 
put a debug point at br.close();
 
10:05 AM
okay I just tried something else I got a different error i think it might be progress haha
I put the patient file on my desktop
BufferedReader br = new BufferedReader(new FileReader(new File("C:\\Users\\ross\\Desktop.")));
I did this and got this error java.io.FileNotFoundException: C:\Users\Rahul\Desktop. (Access is denied)
this time it says access denied what in gods name does that mean haha
 
dont put it on your desktop, put it in Ambulance Project?
and do this
BufferedReader br = new BufferedReader(new FileReader(new File("patients.csv")));
I have done this and it workd
 
all of a sudden your name is rahul?
;)
 
maybe the file's permissions are set wrong. I'd create a simple text file, call it test.csv, put it in Ambulance Project, and add BufferedReader br = new BufferedReader(new FileReader(new File("test.csv")));
i noticed that too ;)
 
hold on ill try it i hope it works -.-
ross is my nickname hahaha its from a memory long story haha
still getting this java.io.FileNotFoundException: patients.csv (The system cannot find the file specified)
what im doing BufferedReader br = new BufferedReader(new FileReader(new File("patients.csv")));
 
you didn't try my suggestion
you;re still trying to read patients.csv
i said test.csv
 
10:16 AM
oh jokes jokes so just a random sample file
 
yes, so we can isolate the issue - is it the file, or is it the way you;re getting the file
 
ahh smart smart doing it now
 
@Tavo Whaddup, T-Dog?
 
still getting same error
you know how i was getting access dined before ?
should i try doing something like this ? stackoverflow.com/questions/4281143/…
 
so you were unable to read test.csv?
 
10:22 AM
yeah
 
paste the bufferedreader code here
BufferedReader br = new BufferedReader line
 
okay i did some experimenting
so I put the test file next to the folders src etc
and i got this error
java.lang.ArrayIndexOutOfBoundsException: 1
 
at what line
 
but when i put it inside the src folder i got this error java.io.FileNotFoundException: test.csv (The system cannot find the file specified)
 
did you ut sample text in the test.csv
dont put it in the src folder
 
10:27 AM
this folder
*line
content[i][1] = elements.get(i)[1];
yep
 
ok, so the file is being read now
 
booooya!
but how is the index out of bounds that doesnt seem right
 
paste the first line of the sample file
 
id x.location y.location status ambulance
 
put a break point at
for(int i=0; i<elements.size(); i++) {
and debug it. see what is in elementt
elements
your code is expecting there to be 4 elements
it looks like there isnt, hence the error
the deugger is your friend now
I'll only be guessing
 
10:33 AM
theres 5 elements
can I post the file on here is there a way ?
 
pass
pastebin
 
okay ill do it now quickly
thats it has my file and what my table should look like
to do breakpoints can i just type System.out.print("test");
 
the issue is String[] splitted = line.split(";");
this means take each line, and where you find the ; character, split the line into an arry
in your sample file, there are no ;
the lines are split via tabs (or just spaces)
 
so instead of ";" i use just " " ?
 
it depends
for each spaces, is it a fixed lenght?
if so,then yes, add the spaces to the split method
 
10:47 AM
what it looks like snag.gy/mfxQAq.jpg
I think its a fixed length its on excel so not to sure
String[] splitted = line.split(""); I did this
 
use this:
String[] splitted = line.split("\\s+");
 
and it just cam e up with a blank frame
okay ill try that
nah that doesnt work
still same error
 
it works for me
paste your code
 
snag.gy/cCLYId.jpg I get this output when I do this String[] splitted = line.split("");
 
@wonderb0lt working like a T-dawg mate. But being productive. Going to Belgrade next week. Yourself?
 
10:51 AM
in paste bim
 
okay hold on
 
but i told you not to do that
I said
String[] splitted = line.split("\\s+");
 
yeah i know I tried that as well but it didn't work
 
your code works for me
it parses fine
what error are you getting
 
java.lang.ArrayIndexOutOfBoundsException: 1 this one
thats so strange
 
10:56 AM
what line
 
this bad boy content[i][1] = elements.get(i)[1];
 
debug it
 
so just System.out.print("test")? right after the for loop?
 
are you using eclipse or intellij?
 
eclispe
 
10:59 AM
have you debugged bfore?
 
nope only in python
I used to debug using print statements
 
try this
you NEED to know this
otherwise give up
 
haha okay this is all totally new
doesnt seem right haha
 
paste the file content
 
oh, I've just realised. It's Friday! Wohoooooo!
♪┏(・o・)┛♪┗ ( ・o・) ┓♪┏ ( ) ┛♪┗ (・o・ ) ┓♪┏(・o・)┛♪
 
11:11 AM
whats in the test.csv?
 
just realized?
 
no, paste the contexts of test.csv
 
i ve been waiting for friday since sunday
 
is this in it: ^What my file has test.csv?
 
lol
 
11:14 AM
yep
oh no no it doesnt
this is literally everything in it
I was just showing a comparison trying to make it clear :P sorry
 
try that, exacrly as it is
 
still same error
time to go kill myself hahah
@TheCoder its alright ill keep trying I've wasted enough time haha :) thank you so much for the help !
*enough of your time
 
no worrries man
just keep using the debugger
 
haha yeah will do might have a 5 min break and then get back to it I think java needs a slap tonight
 
 
1 hour later…
12:41 PM
dead cat chat
 
1:10 PM
Happy Friday, Java!
 
Hey @Michael
good oak boy has fallen asleep again ;(
 
1:22 PM
Dang it @hans! Stop putting OakBot to sleep!
 
haha knocked him out cold
bam!
;)
no it wasnt me! :(
now give us oak
give give
 
 
2 hours later…
3:37 PM
almost time to go home ^_^
yay!
 
\o/
 
4:20 PM
o/
@Diaz hi
 
 
1 hour later…
5:41 PM
http://www.commitstrip.com/en/2016/09/23/outsmarted/
CommitStrip
Outsmarted
CommitStrip
1474652348
 
@Feeds that was one hell of a CommitStrip
 
fge
6:30 PM
sigh End of my holiday this Sunday
 
 
5 hours later…
11:05 PM
@Feeds lul
@Hans1984 Can't do it from work.
 

« first day (2162 days earlier)      last day (2783 days later) »