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

12:00 AM
"It wasn't raining when Noah built the ark...." -Howard Ruff (source)
 
why?
 
just USA in general
not specifically their timezones
I dont know if anything is wrong with their timezones actually
 
not afaik. Enormous country, it's reasonable that it spans over different time zones
but yeah, in general I agree
 
also, if you ever think of making a date/time library, look at this image
and then cry in a corner
 
Guys, I have a java midterm tomorrow and i really need some help
 
12:07 AM
@user2277747 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
 
midterm?
 
Yeah, like a test
 
ok
You can do it, you are amazing!
 
Thanks bro, But i really don't understand a lot of java concepts
 
ok, you need to calm yourself down
 
12:10 AM
Im freaking out man
 
I have been a Software Architect for several years and have been a Software Engineer for even longer before that, I have been writing Java for like... 15 years now?
and I still dont understand a lot of Java concepts
 
Java is that complex
 
Do you think you can help me?
 
but you dont really have to understand most of it
do you have anything that you are struggling with in particular?
 
12:12 AM
Yeah
You see here: (web.cse.ohio-state.edu/software/2221/web-sw1/readings/…) this is a sample exam
 
(pls dont say "Java")
 
If you scroll to "4.1"
it says to write a method to do whatever that is
I have no clue where to start
how to write an array
what the flip does i++ mean?!?!?!?
ahhhh
 
hmm...
do you understand what an array is?
 
isn't like a series of numbers
or something
 
not entirely, but that is exactly correct
in simple terms, it is a series of things
and in your case, they are numbers
so, its a collection of numbers
 
12:16 AM
oh ok
 
what does this method have to do?
 
and that too!
Whats private and public methods!?!
 
no, no, no, I ask the questions ;)
> what does this method have to do?
 
oh ok
it says
/**
* Returns the smallest value in a.
*
* @param a
* an array of ints
* @return smallest value in the array a
* @requires
* a.length >= 1
* @ensures
* minimum = [the smallest value in a]
*/
 
I can see what it says, but what does this method have to do in your words?
 
12:21 AM
Make a list of numbers and return the smallest number from the list
maybe?
 
you already have the list, that is the array
so, how would you find the smallest number?
 
wait..??
the * is the array??
 
*?
 
the stuff with the asterisks is the array?
 
no, that is a comment
 
12:23 AM
ohh
then where's the array
 
> int[] a
perhaps?
 
oh
thats how u make an array?
 
not entirely
do you know how a function works?
 
not really
 
a function is basically a list of instructions
when you call a function, the computer will run that list of instructions
sometimes, those instructions are based on some values
or it has to do something with a value
 
12:25 AM
oh ok
 
so, calling a function must allow you to pass values to it that it can use
for example, finding the smallest number in an array needs an array of numbers
 
ohh ok
 
without that array, the function wouldnt be of any use
in Java (and probably every other language), you can specify parameters
parameters specify what you pass into a function
in your case, you need an int[] (an int array)
in Java, you can specify parameters between the parentheses after the function name
you also give parameters a name
in your case "a"
the function can use the array using that identifier
"a" in this method is basically a variable
 
ohh ok
 
your job now is to write the instructions of that function
using the int array (in the variable "a")
 
12:30 AM
what does param
mean
 
parameter?
 
oh ok
so i guess
we make an array
int[] a
somehow thats an array
 
the brackets [] say that it is an array
 
does stuff go inside there?
 
a lot of languages naively use this syntax
but I disapprove of it
 
12:32 AM
yeah it sucks
 
but you dont make an array
you just ask someone else to provide an array
that is the meaning of a parameter
 
but they havent provided me one
 
you ask someone else to provide values, but you specify what that variable must look like (its type)
"someone else" here is another piece of code
not inside this function
 
shittt
 
its enough for you that you know its an int[]
you dont need to know the actual values, or who created it, or why it was created, or whatever
you just care that it is a correct int array
 
12:36 AM
but how i do pick the smallest one from that array
 
how would you do that in your mind?
imagine you have a big box of numbers
how do you find the smallest one?
 
you pick it?
 
do you just pick a number out of this box and assume its the smallest one?
 
ohh i guess ur right
u have to write the code to check whether its the smallest
 
so, how do you check if its the smallest one?
 
12:39 AM
idk
because i don't know how to make the array their asking for
 
how would you do that in real life?
@user2277747 remember, you dont make the array
it just exists
 
but then
 
but back to real life box with numbers :D
 
i would do like a if statement
 
would you do an if statement in real life?
 
12:42 AM
in real life i would just choose the smallest one because I know its the smallest one?
 
but how do you know its the smallest one?
what if there was a smaller one at the bottom of the box?
you cant just pick the smallest number
 
but..
why not
 
imagine if you had this box in front of you and you were tasked to find the smallest number
what is your first step?
 
look through them
and choose the smallest one
 
okay
so you look through them one by one right?
 
12:45 AM
yea
 
and how do you choose the smallest one?
 
i compare it against the other ones
 
do you lay them out in a line, and sort them?
 
yea
 
do you lay the smallest one apart and if you find a smaller one, you remove the old one and place the new smallest one apart?
you see, there are many approaches
 
12:46 AM
yea
 
lets take the second approach
you basically take out one number
and assume that is the smallest
then, you pick another one
now you have two numbers
the largest one, you can throw away
now you have one number again
and less numbers in the box
then you can repeat that process until the box is empty
right?
 
yea
 
now that you have a strategy, you can program it
 
oh ok
thx
 
I'm using LinkedList. hides.
Quite conveniently, LinkedList is perfectly optimized for Parsers. It's like they were built for parsing.
 
12:55 AM
I am using my own programming language. Proudly stands in the spotlight.
 
lol
Which is that
 
Wietlang :D
(I am open to other names)
 
wietlang.org doesn't exist. You must be lying.
what's really funny is there is the scent of fresh baked cookies over here in this kitchen and today is a day of fast and partial abstinence, and I'm not bothered.
 
I havent published it yet
I try to have a fiddle up at the end of this year
 
A what? jsfiddle.net?
 
1:08 AM
a fiddler
jsfiddle is a fiddler for js
dotnetfiddle is a fiddler for C#
etc
 
 
4 hours later…
5:21 AM
Guten Morning
 
Zoe
Morn
 
user8622974
Morn
 
morn
 
6:09 AM
Good Morning
 
user8622974
Good Morning
 
Good morning.
 
7:08 AM
Is there a tool that converts a JSON file to its relevant Pojos?
 
you want to generate Java classes from Json file ?
 
Maybe?
The checkboxes can add/remove a lot of stuff :D
Generally the first three results for "json to java" seem like stuff you might be looking for @TheCoder
 
I saw many sites but my json structure is very deep
relies on many pojos
Not flat
 
7:23 AM
Do they fail?
At least two I tried out generated additional classes if needed.
 
But my json schema is consisted on many files
I'm newish to json but I'm comparing it to a deep xml schema
 
Then maybe you want to put it in one file :P Or write such a tool for your needs.
 
good morning guys
I have a question for yo
USppose in my REST OPEration class that I have two GET:
1) GET /operations #return all element
2) GET /operations/1 #return element with id 1
now I want implement a search operations
so I want use something like this GET /operations?id=3 #impements search
but the program give me A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces"
 
Why do you want to add another endpoint that takes an id in?
Where is the difference between 2 and the one you are trying to do now?
 
7:39 AM
@geisterfurz007 my purpose is implemented a search operation, but in my class I have just two GET operation
the first GET return the list of my users (GET /operations)
the secondo GET retun the single user ( GET /operations/1 )
 
morn
 
user8622974
morn
 
morn
 
Then what is GET /operations?id=3 for?
 
it my seach operation
I don't know how I must implemented it
 
7:42 AM
What do you search there?
An operation by id?
 
@geisterfurz007 I wrong example!
 
Then what does GET /operations/1 do?
Search an operation by id?
 
suppose my search is this : GET /operations?salary=1000
to take all user that has a salary>1000
 
Now we are talking.
Implement a check if there are any query parameters in your list endpoint.
If there are none, return the full list.
You can also loop over the query parameters and filter your full list accordingly. Without query params, the full list is automatically returned.
 
yep
@geisterfurz007 how can I implemented this GET? I need to change end-point?
 
7:50 AM
Just add some more code to your endpoint you mentioned under 1)
 
morning
 
user8622974
morning
 
Morning.
 
8:13 AM
mkyong already posted 1717 stuff on his website...
That is a founder who actually works for his website :D
 
cucumber.io <- explain this to me. It's not food?
I understand from the repo that it's java.. github.com/cucumber/cucumber-jvm
that's all I understand.
 
@MisterGeeky It is not food.
 
8:28 AM
@geisterfurz007 ? how implement GET?
 
Zoe
@geisterfurz007 it's also rare to see, unfortunately
 
morn
 
user8622974
morn
 
morn
 
8:43 AM
@Doflamingo19 I will not provide you with full code, I have my own work to do. I already gave you hints: HttpServletRequest, query parameters, loop, filter.
Good luck.
/http 203
 
@geisterfurz007 HTTP 203 (Non-Authoritative Information): The 203 (Non-Authoritative Information) status code indicates that the request was successful but the enclosed payload has been modified from that of the origin server's 200 (OK) response by a transforming proxy (Section 5.7.2 of RFC7230). This status code allows the proxy to notify recipients when a transformation has been applied, ...
since that knowledge might impact later decisions regarding the content. For example, future cache validation requests for the content might only be applicable along the same request path (through the same proxies). (1/3)
 
Oof, yeh nah.
 
@MisterGeeky Cucumber is a tool for BDD (Behaviour Driven Development), which is a way of formulating automated acceptance tests in a quasi natural language.
 
TIL! Is it really that effective? I guess it has to be with that list of companies using it but I cannot imagine how.
 
We were trying to use it in a former company. Didn't work out to well because junit4 only had one runner, junit 5 can have multiple extensions so that roadblock is gone
It doesn't replace unit tests or integration tests but if you can train your client to provide expectations using a whitelisted set of idioms, it's effective and if you like TDD than BDD is just fun
 
8:56 AM
Oh true, you can just let your client write the tests for you. I guess that's neat!
 
partly... You need to write the code that's triggered by the idoms but then the rest is up to your client...
 
Interesting concept!
Wouldn't work here. We don't even get a specification :)
 
who just can supply stuff like "When I log in with 'username' and 'password' then I get to the 'dashboard'." and "WHen I log in with 'username' and 'wrongpassword' then I get to the 'errorpage'"
 
Oh well true. There is a little too much language to be parsed and understood.
 
It can work even without the client supplying these... You can come up with the expactations yourself and have a pretty standardized way of telling the client, what the software can do
Cucumber does most of the parsing for you
 
9:02 AM
Yeah I just had in my mind that cucumber would provide a full implementation of all stuff that can be tested because I am a little dumb.
At least I just found out that I can upload images to a location in my network now, yey!
 
9:21 AM
Hello. Does anybody know if it is possible to make Android Studio (i. e. IntelliJ IDEA, that's why I ask here) make a column selection when I hold Alt+Shift and click? So far it seems like I have to make a regular selection with Shift and then afterwards switch to column selection mode with Alt+Shift+Ins. Any experience how to make that selection immediately as column selection?
 
Change the shortcut I guess? stackoverflow.com/a/26386163/6707985
 
To what?
Alt+Shift+Ins is a toggle
Alt+Shift+Mouse Button 1 is a mouse command
 
Oh! Now I understand what you mean! I have no idea, sorry :)
 
But interesting idea, let me test what happens if I set "Switch to column selection mode" to "Alt+Shift+Mouse Button 1". It's kind-of a mess in my brain but maybe it works?
Awww :( No it doesn't... After click it is in column selection mode but it just places the cursor to the new position without selection... Well, I guess I have to accept that it's two strokes instead of one. :/
meh.
 
if (group != null) {
group = null;
list.add(group);
}

And I'm wondering why I'm getting NullPointers everywhere
 
9:32 AM
Yeah cannot imagine.
@LWChris You can use the middle mouse button to do column selection tho (if you have a middle mouse button)
 
Hi,
Does GC may to warn about heap unreferenced objects? For example, in stdout or log?
 
@Mikhail 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
 
@unknown You should add a comment: // Make sure to introduce NPEs
 
Zoe
xd
/facepalm
 
@Mikhail I don't understand that questions. An object(-graph) should end up in GC if and only if it's unreferenced. Why would you want a warning about that?
 
@LWChris , Sorry. I asked about such objects as InputStream, Outputsream, that were open but not closed.
 
The compiler may show a warning about unclosed resources I think
 
@geisterfurz007, It may be very difficult for compiler
 
@geisterfurz007 Thanks a lot!
Instead of middle mouse button, you can also hold Alt and drag. Those alternatives are not 100% what I was looking for, because now I still need to drag the cursor instead of just click, but I guess it's close enough.
 
raise your hand, who did it with javadocs XD
\o
 
user8622974
9:49 AM
o/
 
o/
 
I never feel alone here XD
 
10:01 AM
I am iterating through a list in order to find and select certain items, and I want those items to be ignored in the following searches ( = picked out of the list)
Now what do you think is more performant, removing them from the list, or setting them to null and skipping the search if null
(ArrayList)
 
I think removing in one way will fine, rather setting those value to null and then mark as not required, also it will be unnecessary rework you will do with list.
but don't remove while you iterating, keep removal element in separate list.
 
yeah or I could decrease the index when removing
 
10:18 AM
I m not sure with decreasing index.
becz, you might miss data in between indexes.
 
Collect the values to remove in another list and call removeAll :D
 
@geisterfurz007 lolzzzzzzzzz
 
Looks like your z-key is stuck
 
noo, I type z that many times.
 
what ???
 
I give up
/http 406
 
@geisterfurz007 HTTP 406 (Not Acceptable): The 406 (Not Acceptable) status code indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request (Section 5.3), and the server is unwilling to supply a default representation. (1/2)
 
lmao
 
@unknown stream + filter?
 
10:57 AM
@unknown Removing from a list while iterating over it is dangerous as long as you don't use the iterator's remove function or an index-based while-loop. Therefore I would iterate once over all elements e and wrap each in a simple container class SearchItem<T> that has two public fields T Item = e; boolean Include = determine(e); then you can iterate over the result list and check the boolean. Best thing is you can always reset that boolean respectively re-evaluate the condition.
or, if you really need to strip the items from the list, you can call removeAll and use the boolean as predicate
Or was it retainAll with inverse boolean? Well, something like that.
But to be fair, in 99% of the cases the time you spend wondering what is faster takes more time than the amount of time saved over all searches your program will ever perform summarized.
 
Yeah I quit wondering after like a minute and decided to do it with null and ignorance.
 
I remember debating for hours with a colleague who thought dynamic determination of object properties in .NET/LINQ would take too long and built a cache around that information. Turns out building, maintaining, and invalidating a cache was about 1000 times slower than calculating the information for a billion randomly created objects.
 
11:30 AM
Hey guys, a help vampire is in the hood :-D
0
Q: Regular expression does not match all using lookahead

rekireI'm working with a string which contains xml under some conditions I need to remove all tags with a given name in my case VO. Here is my code: val input = "Hallo <VO>magic </VO><foo/><VO>World</VO><bar/>" val output = input.replace("<VO>(.+?(?=</VO>))</VO>".toRegex(), "") I expect that the ou...

any idea on that? If you like i can translate those two lines into plain java too
@ItachiUchiha @geisterfurz007 @ColdFire ping ;-)
 
Please don't ping people, especially when you're knowlingly help-vamping
 
xD
@rekire i couldn't see a issue maybe ita can help
 
@Gemtastic I know those guys that was fun
 
@rekire I'm not familiar with regexp behaviour in Java, but doesn't a simple non-greedy regex do the trick? "<VO>(.*?)</VO>"
 
@LWChris very likly I cannot remember why I used that complex form. However it turned out that I the string was containing a line break
 
11:42 AM
@unknown you should definitely use stream+filter
 
help vampire out, if I can help someone ping me^^
 
@rekire dont use regex
 
@Wietlol actual parsing is more painful... but why? just because the that nesting tags will blow up everything?
 
actual parsing is less painful, and someone else probably has already done it for you
also, your regex wont work for other valid xml nodes
 
@rekire Why would you delete it so soon? :P
 
11:46 AM
would you add a lib just for replacing one tag?
 
I think you are thinking the wrong way around
 
btw, hi o/
 
@ItachiUchiha because @Wietlol pointed out very quickly my stupidness
 
would you write your own xml parser if someone else already made one?
if you are me, then yes, obviously
but everyone else should just use the existing library
there is no reason to write your own half-broken, naive, unmaintainable, obscure code to do stuff like that
what is the downside of adding a library?
 
11:48 AM
@Wietlol maybe, it depends hard on the actual usecase. I mean I wrote recently a json generator, because I found nothing helpful to generate a 10GB json file.
@Wietlol not much tbh just the jar get bigger
 
if your issues is with a big jar, then try jigsaw, your jars wouldnt get the size of a standard Java application
assuming you dont add resource files (images, etc)
 
@ItachiUchiha haha nice one :-D
@Wietlol nope it's a spring application
 
I think Jackson has a json writer that can write large files (larger than internal memory)
 
@Wietlol That libs I tried always tried to keep everything in the memory. I ended with streaming the file that worked fine for me
Am I the only person who needs to send every message twice?
 
Excuse me what did you say?
 
12:00 PM
Scottish sailor Alexander Selkirk was marooned for about four years on Chile's Islas Juan Fern'ndez, located 364 miles (587 km) west of Valparaiso. After being rescued, he published his story of survival and was said to be the inspiration for Daniel Defoe's classic novel Robinson Crusoe. (source)
 
@rekire It happens if you internet is slow
 
@ItachiUchiha +1
 
Well 108mbit :/
 
sP_
12:22 PM
Anyone has experience with scala+spark? I'm trying to package my project but it gives error on executing the .jar file. It works fine on IDE. 'Exception in thread "main" java.lang.IllegalArgumentException' is the error on a line that is written correctly as it works in IDE.
 
@sP_ 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
 
sP_
I checked JDK version is the same on system and IDE
 
Haha just recognized oak still knows me he did not welcome me :-D
@sP_ I have no idea about that. (I just don't want that you feel ignored by me)
 
sP_
@rekire Haha thanks. Much needed reply, pleases the insecure personality in me :P
 
;-)
 
sP_
12:57 PM
NVM.. I found out the issue, I was using different version of spark in IDE. What a pain..
 
00:00 - 13:0013:00 - 00:00

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