« first day (2889 days earlier)      last day (2054 days later) » 
00:00 - 13:0013:00 - 00:00

1:02 PM
Hi guys I have a question!
 
/no
 
:ahahah
 
hello
what was the name again, of that "thing" where you can past your code in order to not paste it in the chat
for some reason I can't seem to remember the right words, therefore i'm not finding it lol
I dont even wanna run it, just paste it
 
pastie.org?
 
1:12 PM
wow for some reason they seem to have blocked all of them here
at my company
thank you!!
 
try gist.github.com
 
I will see if I can find the one I ued last time I asked something here
 
paste.ofcode.org is the one recommended by some chat bot
 
this one Works just fine @ItachiUchiha Thank you!!
 
@ItachiUchiha hahahaha ... XD XD
 
1:20 PM
Guys sorry I have a question
 
/no
 
In my employeeRestOperation I have create all rest methods (GET,POST,PUT,DELETE)
In details I create two GET
1)GET /employee #return all employees
2) GET /employees/id #return employee with id =id
Now I need implement a search operation. For example I need to gell all employees that have salary >1000
 
I hope you typoed in the paths
 
so I do GET /employees?salary=1000
but it gives me a endpoint problem
because I have in the same path two GET
 
1:24 PM
why do you have ?salary but /id then?
 
my qyestion is there a method that I can use to put two GET in the same path or for the last GET I need to change my endpoint?
GET /employees/search?salary=1000
 
@Doflamingo19 Not according to what you just wrote, which would differ in employees and employee
 
sorry I forgot s
 
mkay
 
1) GET /employees
 
1:26 PM
otherwise, you could do employees to get all and employee to get a specific one
 
know the unknown
lol the wietlol
 
fire the cold fire
get out
 
geis the ghost
 
So i need to change endpoint for search?
 
@Doflamingo19 I have no clue of what exactly you're dealing with, but I would probably have one GET /employees where I could add filters using ?id=...&salary=...&...
 
1:30 PM
mmm ok and how I build this filter?
 
As I said, I have no clue of what you're dealing with, but you did something similar with salary, so I guess you just have to copy some code?
 
I need to do a search operation
 
cool
This is Java not Google
 
/*
 
@Doflamingo19 That would be insufficient information even in an SQL chat room.
 
1:37 PM
@Doflamingo19 you need to have separate end-point, if you have to search specific salary.
and your endpoint have to be distinct, I guess that is causing issue for endpoint level.
like employee/{id} already there, so employee/{salary} have same characteristic, probably change in variable type fix your issue.
 
in this search i need to put different field like( salary,dob,nations) etc
so it is bettere solution create another end point?
 
Zoe
Boop
 
no, I assume you are using int for {id}, so just use double/float for salary, instead of int
probably having same kind of request confuses the routing.
@Zoe hiii XD
 
maybe I can modify the second GET that returns all employee in GET /employees?salary=1000
 
yup, try with that
 
1:50 PM
ok @Simmant thanks for you support
 
is that work??
 
@Zoe Boops back
 
I'm tring
but I think your solution is good
 
Zoe
@Simmant Haiii
@unknown owo
 
Hooooooooo
 
2:09 PM
Hating life ♪♫
Hating work ♪♫
Hating everything ♪♫
2
 
For some reason this song sounds apt for @ballBreaker
 
@ItachiUchiha Definitely the wrong music for my current mood, yeah.
Thanks from my coworker as well btw @ItachiUchiha :) She will have a meeting with one of our managers in a few weeks regarding that issue and appreciated the extra help.
 
@geisterfurz007 Anytime. If you or your colleague have any other question, feel free to ping me.
 
2:24 PM
<3
 
>3
 
Haha, I am happy to uplift your mood ;)
 
No! Wait! NOOO! What have you done >.>
 
xD
 
Zoe
2:39 PM
xd
 
3:05 PM
does someone use JERSEY?
 
Zoe
No, I prefer hoodies and/or tops
 
4:05 PM
@geisterfurz007 can I copyright this song?
 
No, das mine.
 
but it was made for me right?
;)
that song could definitely be quoted from me
 
Third day in a row that I didn't make a decent progress on my project...
 
ah
 
2.5 hours creating certificates and profiles and other shit to get my app into a state where it can be installed on a device of my company and not only on my dev device.
 
4:09 PM
time issues? distraction? or just failing to get stuff working?
 
Ending with 20-30 times entering my password during the signing process.
Mainly last one.
 
30 passwords is for security
call it a feature and ship it
 
It is retarded
 
it is safe
 
It was in xCode while signing the app!
 
4:10 PM
safety is retarded
 
Apple calls it a feature and shipped it!
 
Zoe
waffles
 
In my app I only have the feature that it crashes if there is no connection to the server.
 
too bad for u Zoe
 
bacon > waffles
 
4:11 PM
App opens, shows the login screen, dies.
Good user experience btw.
 
why did you implement this feature?
I think that is really hard to implement
 
Inevitable!
 
do you use runtime.exec("shutdown -s -t 0");?
 
lol
 
Just use -i and code a keysimulator to automatically use that GUI to shutdown.
 
4:12 PM
Just use -p!
 
i have no idea what it does
I just googled it
76
A: Shutting down a computer

David McGrawCreate your own function to execute an OS command through the command line? For the sake of an example. But know where and why you'd want to use this as others note. public static void main(String arg[]) throws IOException{ Runtime runtime = Runtime.getRuntime(); Process proc = runtime....

 
Me and a coworker wanted to test the per app VPN of iPhones (we didn't know I had to sign it with other stuff (no, not pencils...)). So if an error happens while connecting I wanted to show an alert, so I implemented that. Now whenever an error occurs in that part of the app, it crashes :)
 
@geisterfurz007 you above everyone else should know that I have no clue what I am doing
 
NSA prolly knows better but yeah, I get the idea.
 
Byeee gotta go :3
 
4:15 PM
I'm Wietlol
 
/yds
 
Cya unknown.
 
I found the identity of @unknown, he is out
 
I found the identity of @Wietlol, he is unfunny.
 
4:34 PM
Keep getting Exception in thread "main" java.lang.NullPointerException
Not sure why
 
Which line?
Oh line 8 in the paste.
You don't have Students.
For Objects (except for String) the default value is null. So in your array you have a lot of null values.
 
I get error on stu[i].firstName = input.next(); fyi
@geisterfurz007 wdym?
 
Instead, in the first line of your loop, create a new Student, set all properties on that object and in the end put that object in the array.
 
@geisterfurz007 Can you give example?
 
Where is the fun in that? :P
 
4:38 PM
And I am required to use "Student[] stu = new Student [input.nextInt()];"
@geisterfurz007 Just a bit confused
 
You can comment out your loop and put a System.out.println(Arrays.toString(stu));
That will tell you why you will get a NPE in your loop :)
 
@geisterfurz007 Ah. As you said all nulls.
 
Aye,
So you need a Student object first on which you can set firstname and that stuff, right?
 
ok
I'm confused. Again. We need to use Student[] stu = new Student [input.nextInt()]
 
That is perfectly fine! Leave it where it is.
 
4:43 PM
ok
 
That only creates an empty array though!
No students.
So to fill it, you have to create on student per place in the array.
 
ah
I get it.
So then whats the point of using that. And why does my IDE allow me to do stu[i]?
 
Because the compiler lets you do it. And what is the point of using what exactly?
 
@geisterfurz007 gothcta thanks!
 
lol
 
4:56 PM
If you have questions, feel free to ping me. I will be around for around 2 more hours.
 
sounds like around 8:00 pm
 
relative is easier because timezones :)
 
5:18 PM
Yeah i was just trying to guess the time there
i guess i was near to correct?
 
An hour off
 
i blame DST
dammit DST
 
Zoe
5:53 PM
I blame you
 
Zoeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
looks good now :D
 
@ItachiUchiha DOUBLE LOL?
 
6:10 PM
@geisterfurz007 hehe
@ItachiUchiha fabulous
 
6:25 PM
Guys, I have a doubt . Today I have found one performance issue .. I was calling a method with this keyword and it was taking around 70 ms to complete that call. It is taking only 4 ms if I call it directly..actually my object is heavy..what is causing this delay? What I studied, there is no difference.
 
Zoe
7:01 PM
//mcve Vishnu
 
user8622974
Please create an MCVE @Vishnu
 
7:18 PM
It might be caching
 
Zoe
Does System.exit stop threads that are sleeping with Thread.sleep?
 
7:35 PM
no i guess
try it i guess
 
8:45 PM
Hi all, I'm new to java land and have what I think is a fairly basic question. Essentially one of my devs wrote a quick class to create a sign based on some fields, class has main and two other methods. I essentially want to absorb this into my test project so I can call it from within. I'm trying to convert it over but seem to be screwing it up - anyone able to help me out?
 
9:24 PM
@shicky That's a very broad question. We don't typically give tutoring sessions here. But, if you need something quick and dirty, you might be able to just copy the entire class into your test project and run it from here.
 
 
2 hours later…
11:11 PM
is there an equivalent to the JS map() function?
var array1 = [1, 4, 9, 16];

// pass a function to map
const map1 = array1.map(x => x * 2);

console.log(map1);
// expected output: Array [2, 8, 18, 32]
 
11:50 PM
@JBis I have an answer!
 
@forresthopkinsa Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
@forresthopkinsa yippee
:)
 
list.stream().map(it -> it * 2)
 
Cool and thanks. what about an array?
prob not cause arrays suck
 
hmmm
Arrays.stream(array)
 
11:55 PM
Arrays.stream(array).map(it -> it * 2)?
 
yeah
you'll need to collect it back though
 
wdym?
int[] new = Arrays.stream(old).map(it -> it * 2)?
 
you'll still have a stream there
 
?
 
.map() returns a stream
so that you can do function chaining
 
11:57 PM
Eek. If you could explain that would be great. Don't know what streams are (maybe I know the basics) or "function chaining"
 
sure no problem
 
:}
 
for the sake of simplicity, I'll talk about this in the context of Lists, because arrays make things more complicated
you have a List<Integer> of numbers
the List class does not have a map() method, nor do its parents
all those functional programming operations are outside the scope of Collections classes
so Java 8 introduced Streams
you can convert a collection, e.g. a List, to a Stream, and the Stream does have all those functional operators, like maps, flatmaps, etc.
 
00:00 - 13:0013:00 - 00:00

« first day (2889 days earlier)      last day (2054 days later) »