« first day (2338 days earlier)      last day (2825 days later) » 

00:51
what do you guys think about throwing exceptions in java vs returning a null or boolean value to know if the procedure passed or failed?

to keep my code neater I've done stuff like this

if(!doSomething(withBob)) {
return; //Whoops doSomething failed, guess we can't continue
}

saves space vs

try {
doSomething(withBob)
} catch (InputInvalidException e) {
return;
}
even though using an if statement saves space it can look confusing because doSomething doesnt sound like a boolean procedure?
it's computationally faster to return a boolean instead of throwing an exception right?
01:04
..why does the constructor for throwable have to compile stack traces.. I do not need this foolishness I just need a method to return more than one type of value.. sheesh
Aro
Aro
01:27
@CausingUnderflowsEverywhere My general rule is this: "If it's expected behavior, don't use an exception. If it's exceptional behavior then use an exception." This rule has always pointed me in the right direction. In your case, if doSomething(withBlob) is something you expect to sometimes fail under nominal operation, then return a value. If it's something you expect to never fail under normal conditions, use an exception.
Although sometimes that rule is harder to follow if you have yet to decide which part your code falls under.
Like how Java throws an ArrayOutOfBoundsException, because the code is never expected to attempt accessing outside an array bounds, that's a logical error. Where as calling Map.get(myObject) returns null, because it's expected that a developer would request a value for a key that isn't in the map, that's not a logic error.
I would recommend not worrying about computation speed difference but rather deciding if doSomething(withBlob) is expected to fail. IMHO
 
1 hour later…
03:00
who on earth uses signed bytes
how on earth am I to naturally parse ipv4 if java decided that bytes are going to be just signed and max value is 127
anyone got a scenario where one would use signed bytes?
do types in java wrap around?
don't you love boxing already boxed values hehe
fine.. Ill use a short and just add "testing" code
sigh
I know I'll make my own uByte class! hur hur hur
I bet that would be reinvented the wheel
lets see what other people did
04:00
java can be so annoying.
like Im trying to record some bytes into my database, and I have to do ugly WORK AROUNDS because there is no unsigned byte
now I have to change my entire API
@CausingUnderflowsEverywhere Why don't you just use an int?
I know I will
sigh
the other thing I dont like about this java compiler is that it treats all floating numbers in your source as ints. like if you're declaring a byte and assigning 3. you're assigning 11 (base 2) AND THATS THAT IT clearly fits into a byte so shhh about it being an int read it as a byte thank you very much
dont these things frustrate you? lets talk about more things that frustrate us such as adobe failing to fix its performance bug in the npapi plugin for many generations of updates
I don't remember ever having problems like that.
My code never has compiler errors.
It either does what it's supposed to do, or doesn't do anything at all.
04:19
hmm what does java do when you assign a byte to an int? it's doing some magic under the hood
 
2 hours later…
06:47
@Michael Done
@ballBreaker I know. Please put some sparkle in it.
javascript IS Java. it's scripts written in java.
07:09
Good morning, I would like to know...I am just starting with Jasper Reports... in the download zip file v6.0.0 inside lib there are a bunch of jars but in the v6.3.0 there is nothing. Where they substituted?
By something or
08:00
!!tell 36179084 facepalm
Shouldn't the room title say "NOT ANDROID AND NOT JAVASCRIPT" or "NEITHER ANDROID NOR JAVASCRIPT" instead of "NOT ANDROID OR JAVASCRIPT"?
Because doesn't NOT have a higher precedence than OR?
!!is that a good idea?
@JennaSloan Nuh-uh
08:17
!(ANDROID || JAVASCRIPT)
@JennaSloan fail it wasnt a reply to my message :P
@CausingUnderflowsEverywhere It was, but apparently that got removed with the edit. :/
@CausingUnderflowsEverywhere unsigned is pain in Java. For constant literals, I just do hexadecimals with casts, e.g. for byte: (byte)0xAF
There is a type wrapper lib that allow compareTo on UByte, UShort etc: jOOU
08:39
@CausingUnderflowsEverywhere No, Jabba script is a popular darknet framework for apps involving smuggling, loan-sharking, gambling, prostitution, and murder-for-hire. The carbonite storage back end it uses has been cracked, though. Honestly, a quick look at the type hierarchy will show that Java !== Jabbascript
09:38
morning
10:27
room topic changed to Java is neither android or javascript so don't ask about android or javascript: Room dedicated to the Java programming language, yummy food, and cats. And no, Android is NOT Java (does not use the Java VM, runtime environment and base SDKs differ, etc). And no, Javascript is NOT Java either. -_- github.com/JavaChat [fun] [its-always-friday] [java] [jvm] [my-code-is-compiling] [no-copyright-infringement] [out-of-context-stars] [serious-business] [type-erasure]
@JennaSloan wahaha suck it I was wrong so here have an even longer title
@Unihedron Where would I have to add a check so that all commands are locked for banned users? Sure I could add that to each command, but I doubt that this is the way to go..
@geisterfurz007 create a command manager, wrap a basic registry for a pre-pass, so that it fails early based on the command's settings
Well I could as well add the check in front of each command...
yep it's simpler
not really a lot of technical debt
I literally understood nothing of that message XD
10:42
preload [shape=underline];
preload -> message [label="register\ncommand\nprivileges"];
message -> manager -> { fail; pass; }
I will check back tomorrow or later on the day... This seems like something I never saw :/ But it seems useful!
But right now I cannot get my head around it :C
I don't know of a simpler way to make you understand, you just need to identify what of which you're unqualified to solve for and get qualified :p
As always ^^
11:14
In the future, Android has some chance to become Java, JACK toolchain is being ditched
Android discussions still wouldn't be allowed, because developing for android is too different from developing for java. A java dev is unlikely to be able to answer an android question without knowing android, so excluding it from our scope is necessary.
Add it to the fact that android sdk and vm behaviour is so inconsistent compared to regular java which I doubt changing one toolchain would fix.
^^ my note was just a note ^^ -- not an opinion or a call to include Android development talk here.
But Java 8 compatibility seems to be new aim for the Android team at Google.
 
2 hours later…
13:41
Morning, Java!
i here any on familiar with java ?
in this channel, no ;)
@Pans whats your question?
just found out that SO chat can be loaded over HTTPS #facepalm
14:02
@motaa i want to change edit text as text view dynamically
in my edit text i want to type otp , after that oyp verified tat edit text changed as text view , for response
@motaa
here??
Cheers Michael :D
@Pans Did you try turning it off and on again? xD
Hey @geisterfurz
lol
3 hours ago, by Unihedron
@geisterfurz007 create a command manager, wrap a basic registry for a pre-pass, so that it fails early based on the command's settings
@Michael do you think you can translate that for me in understandable for semi-noob?
The lack of context is palpable.
I did not want to add a check for banned users to each command of the Javbot. That was what came as answer by Uni
14:12
o/
You would check to see if the user is banned before passing the message to whatever code handles the command.
Yeah.
I think I got an idea..
14:28
idea failed
14:46
I thought of doing it like this:

	static CommandHandle wrap(CommandHandle ch) {
		return new CommandHandle.Builder(ch.getName(), ch.getConsumer().compose(message -> {
			if (Permissions.isBanned((long) message.getUserId(), AppContext.INSTANCE.get(BotConfig.class))) return "";
		})).build();

	}
I would make the check toward the top of the stack. Make the check right after a command comes in. If the command is from a banned user, then you can just exit out.
@Michael But wouldn't that require to add the check to each command?
I wanted to avoid that
Don't think about how you're "supposed" to do it. Just do it.
You should always keep best practices in mind. But not to the extent that it hinders progress.
@geisterfurz007 Well, yeah. Every time a command comes in, you have to check to see if the user is banned.
There's no way around that.
Can someone give me an overview of how a good api authentication/authorization(OAuth?) works from the user perspective?
Yeah and I wanted to avoid copy pasting the same three lines to all commands that get created. Banned users are supposed to be ignored. So I hope to be able to do something that this check is added to every command automatically
14:54
@geisterfurz007 Like I said, it should be done at the top of the stack.
Which means nothing to me as a Java-noob :/
Top of the stack meaning: as soon as the message comes in
aaaaaaaaaaaaaah
So "done at the top of the stack" means "done first".
Yeah I am still trying to figure out where that is in the code
15:03
Mmm hmm.
15:17
Is there an active user here right now?
~JavaBot at your service
**shutdown
xD
I set the trigger to -- :)
--shutdown
~going down
15:19
dafak...
Let me check somethign
user6845426
Hi all
@Michael I missed the Shutdown command when adding the admin check...
~JavaBot at your service
Hey @dipper
user6845426
Hows it going :)
15:22
--ban 13379
@geisterfurz007 User 13379 was added succefully as banned user.
@dipper Fine thanks and yourself?
@Michael Would you mind trying again? :>
Aro
Aro
--ban JavaBot
@Aro I am afraid, I cannot let you do that!
Aro
Aro
;P
15:22
:( xD
user6845426
Not too bad. Just working on some coursework
--shutdown
get ignored Michael xD
--unban 13379
@geisterfurz007 User 13379 was removed succefully from banned users.
--help
15:23
@Michael help command: Get additional info about a command of your choice, syntax:--help [commandName]
Wait that means it works :O
Banned users get ignored now \o/
user6845426
What's the best way to generate 128 zero bits
Aro
Aro
--ban ";return;
@Aro I am afraid, I cannot let you do that!
Aro
Aro
Aw. Okay I'm done. Just had to try.
15:25
--addAdmin 2832996
@geisterfurz007 User 2832996 was added succefully as admin.
--shutdown
--javadoc java.lang.String
what the heck@unserializable
Wheres the heck?
you should not be able to do that >.>
15:26
It should not work, right?
you shut him down
And I know why
Ah well, then theres a bug to fix.
Because I am a huge idiot!
I should recompile it after making a change
!!facepalm
Aro
Aro
Are you using an API for JavaBot? I may be interested in making a bot
15:27
--ban ;delete * from users
Aro
Aro
lol
@Michael it is currently down
should be back in a few secodns
@geisterfurz007 The best security feature. xD
~JavaBot at your service
15:30
@Aro @Michael did a lot of the work behind the scenes. I am testing around with it to have a look into someone elses code and to get familiar with the workflow of github
--javadoc java.lang.String
And I still have no idea what is wrong with that command :D
--eval 'a'*4
[tag:groovy]: compilation failed with error startup failed:
UserScript: 1: unexpected token: & @ line 1, column 1.
'a'*4
^

1 error
--eval 1<<30
15:31
[tag:groovy]: compilation failed with error startup failed:
UserScript: 1: unexpected token: & @ line 1, column 6.
1&lt;&lt;30
^

1 error
This eval thing badly needs HTML unescape+clean.
@geisterfurz007 what does the Eval command do?
@ItachiUchiha groovy
I see
I should implement jshell
@unserializable Indeed. The escaping is present as well in tell. One of the currently starred messages over in the Java and Android Era is the outcome of this:
--tell Hem G'day Ma'am
15:33
@Hem G&#39;day Ma&#39;am
Well...
But I wrote an issue for that on the github ^^
Could anyone try to shut the bot down? Want to check if its correct now
--shutdown
@unserializable I am afraid I cannot let you do that!
thanks
--shutdown
16:15
i am testing curl retry mechansm for my rest service. i don't have access to the service to take it down to test the retry. anyone know what I could use to test my script?
it's a deploy script that calls curl to check if a service is up. if curl doesnt get a response, then curl retries
16:32
call any url that does not respond...
~JavaBot at your service
--unsummon
@unserializable but every site i know is up
i could start tomcat and point to localhost:8080 but that's up too
16:34
@TheCoder Have a look on iidrn.com
There are websites that got tested a few minutes ago that are down
@TheCoder barclaycardus.com this one for example
Connected to barclaycardus.com (192.107.16.41) port 80 (#0)
that means it's up yes?
I think I need a definition of 'down'
If I have a service deployed, but the tomcat that runs the service has been shutdown, what error should i get from curl?
503?
404 more likely.
But depends on the setup really. Proxies, load balancers, etc all affect this.
if a webservice is in the process of being started, but as yet the start up hasnt completed, is that service 'down'?
i suppose it depends on the issue: tomcat could be down, or else tomcat is up, but the service isn't..
Just define 'up' instead of down for yourself. E.g. 'up' whenever some certain small REST call returns something small and previously expected.
down = !up
16:46
If the service isn't available you should get a 503 Service Unavailable
up is probably 2xx
but i want to find a web site that i can test on
@JennaSloan that is only true for sufficiently 'available' definitions of 'unavailable'
are you talking about a regular program you have the source code to? You need to have your commands presented in such a way that can be searched, indexed, etc.
That way when you're calling a command you can use a method that finds the command. This method can have various security features such as returning without running a command if they are banned, or if your commands are presented in such a way that you can add properties to them, you can let certain users have access to certain commands.
@CausingUnderflowsEverywhere Problem is already solved, but thanks ^^
oh awesome
let's talk about blackberry
17:05
@CausingUnderflowsEverywhere Blackberry? Like the fruit?
no like the java
oh I get it
black berry is java and blackberry is android therefore android is java. y'all the confused ones not me
probably from being unserialized have you tried serializing?
lol that old video?? really????
I am too nice to be subjected to serialization.
4
when did the room title change to that
@Unihedron will I get banned if I make jokes
 
5 hours later…
22:10
@CausingUnderflowsEverywhere No but you will die in real life.
22:44
hey guys is there a clever place I can get technical information about java?

..because for example I needed to understand what the synchronized keyword does. and everyone explains why it exists and what it should do in their own words when all I had to know is that it inherits a lock from the class instance.

now I read that an object passed into a method parameter might be modified by another thread before it's used by the current thread. I just need a place with these simple technical specifications of what is really happening
thank you java bot
@javabot run Thread print verbose-debug-info
@CausingUnderflowsEverywhere That didn't make much sense. Use the !!/help command to learn more.
@CausingUnderflowsEverywhere A safe thing always are the Javadocs and maybe you can find something on stackoverflow
Basically any duckduckgo result should do...
the javadocs really print too many words and too little technical information, plus the javadoc on the synchronized keyword had misleading errors -.-
excuse me? you ask a duck to handle your search queries and his name is Dax?
or like that
you meant to say, basically any internet search result should do...

I belive sternly.
If I wrote that Uni came over me XD

« first day (2338 days earlier)      last day (2825 days later) »