« first day (3855 days earlier)      last day (1071 days later) » 

12:00 AM
Whenever a system becomes completely defined, some damn fool discovers something which either abolishes the system or expands it beyond recognition. (source)
picks nose
 
 
2 hours later…
1:58 AM
 
 
6 hours later…
7:58 AM
solves P vs NP
 
 
4 hours later…
11:59 AM
hey
I was prepearing for interview and got a question. Why do we need interfaces and why we can not extend from two or more classes?
 
Zoe
12:24 PM
Because Java doesn't have a scope resolution operator
All of which is well-documented, btw
 
 
2 hours later…
2:00 PM
@AlexDeveloper99 Welcome to the Java Chat, the room for Java enthusiasts! I'm Oak, one of the room's bots. If you want to ask a question, just ask it and someone will respond if they feel like it. But remember that this room is not a help desk or tutoring service! If you want to just hang out, then welcome aboard! Oh, and the room's full list of rules are posted here.
@AlexDeveloper99 Hi , I'm Oak!
 
Zoe
3 messages moved to Trash can
This isn't an Android room
@OakBot @Michael What happened here?
 
@Zoe Type /help to see all my commands.
 
Zoe
Omfg
I get it, you're brilliant :D
 
user15755649
I know but that is JAVA
 
Zoe
@geisterfurz007 you're gonna enjoy this
@AlexDeveloper99 Android uses Java syntax; But it is in no way Java. Android and Java have different SDK's, and even shared classes have differences. Java developers aren't necessarily familiar with Android just because they know the language syntax. For Android questions, use the Android room, or one of the other rooms dedicated to Android.
 
2:09 PM
@Zoe :D
Needs some work though.
 
Zoe
You might wanna trim messages or something to avoid blank messages
 
I think maybe the newline in the message is confusing Oak.
 
Zoe
There's a newline?
 
Their first message contains 2 lines.
 
Zoe
Yeah, so that also triggers HTML
The second one is the one it tripped on though, because of the "I'm "
SE chat isn't that nice to code for though xd
ooh, the question is even a dupe
Free dupe :eyes:
 
2:14 PM
Oh wait.
The onebox triggered it. Hmm
 
Zoe
yeah, that's what I was referring to ^^"
 
Their first message should have triggered it too though.
 
Zoe
Multiline messages cause HTML though
If you ignore messages starting with certain HTML patterns, it doesn't get read
 
Oak internally converts the HTML back to markup. So in this case, the Command class will get a string that contains a newline.
Ah, it's because I wasn't using Pattern.DOT_ALL.
 
Zoe
Do you look for , to end the expression?
oh ^^"
 
2:26 PM
I was doing this: Pattern.compile("(?i)(I\\s+am|I'm)\\s+(.*?)([.,;!?]|$)")
If I add a newline to the character class, it should work.
 
Zoe
I'm Zoe, I'm wrong and btw,
Did I break it? :p
 
That should have worked...
 
Zoe
Do you require a complete match?
I'm Zoe
Nope, it's just broken :p
 
It should have matched the "I'm Zoe" part.
o/
 
Zoe
oh, right
 
2:30 PM
\o
 
Zoe
? is the lazy delimiter
I've been doing too much vimscript-flavored regex xd
.{-} is non-greedy .* in vim
 
I am confused
 
@Michael Hi confused, I'm Oak!
 
Zoe
I'm nobody
I am nobody
 
@Zoe Hi nobody, I'm Oak!
 
Zoe
2:32 PM
Maybe ' is escaped?
 
I'm confused
wtf
 
Zoe
yep, sounds like ' is escaped
 
/shutdown
 
Shutting down. See you later.
OakBot Online.
 
I'm confused
I'm confused
Again, wtf. xD
 
Zoe
2:34 PM
There you go
That's the HTML entity for '
You're using jsoup, right?
I believe they have an escaping function
 
No, chat room events are in JSON over websocket.
 
Zoe
I meant for other stuff
Guess I misremembered
... ugh, more security alerts? xd
59
A: How to unescape HTML character entities in Java?

DaleThe libraries mentioned in other answers would be fine solutions, but if you already happen to be digging through real-world html in your project, the Jsoup project has a lot more to offer than just managing "ampersand pound FFFF semicolon" things. // textValue: <p>This is a&nbsp;sample. \"Grann...

I'm gonna merge the PR from GH btw
 
@Zoe That's used for other things. Not for parsing chat events.
 
Zoe
I know, but you can still use it to unescape entities ^^"
 
I'm confused
 
Zoe
2:56 PM
I'm not broken :p
 
Haven't started Oak back up yet.
 
Zoe
aww
 
OakBot Online.
 
Should be fixed now.
I'm feeling jubilant
 
@Michael Hi feeling jubilant, I'm Oak!
 
3:06 PM
:D
 
Zoe
I'm ,this is sparta,and
 
@Zoe Hi ,this is sparta,and, I'm Oak!
 
Zoe
:p
 
Dang it @Zoe!! Stop inventing new unicode characters!!!
 
Zoe
Dang it @Mic!! Take it with the unicode consortium!!
 
 
2 hours later…
4:58 PM
I'm gonna merge the PR from GH btw
 
@Wietlol Hi gonna merge the PR from GH btw, I'm Oak!
 
hehe
@Michael chat events are json documents of html encoded values
^ what I specifically decode
 
Zoe
I'm ,wietlmfaocoptroflmaonam copied you
 
@Zoe Hi ,wietlmfaocoptroflmaonam copied you, I'm Oak!
 
Zoe
I mean, kinda works :p
 
5:04 PM
basically content, userName and roomName
I might have copied Oak
I did for one of the http requests
 
I went one step further and converted the HTML to markup.
I am so smart
 
@Michael Hi so smart, I'm Oak!
 
depends
 
Zoe
I'm SPARTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
@Zoe Hi SPARTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, I'm Oak!
 
5:07 PM
current version of Wietbot goes one step further and parses the content to a model tree
 
Zoe
I wonder if I can break Oak :eyes:
 
this model tree can then be formatted to SE-Chat markup
 
o.o nice
 
which is what my current SE-Chat service accepts as content (it does the formatting itself)
the content models also can be parsed from Discord markup and can format Discord markup
this way, I can parse SE-Chat message and format it as Discord message
and I have cross platform messages
if something is not supported, it just does whatever it can
I wanted to change that to throw an exception and when that exception gets called, format it to html, make an image out of it and upload it as special message
so that SE-Chat receives an image and if you follow the link you get an html page of the message
should work the same in Discord, but I havent tested how I can differ between it being embedded in Discord and actually be opened in the browser
also, I am lazy and have many more projects, so currently the chat bot is idle :|
 
@Wietlol Hi lazy and have many more projects, I'm Oak!
 
5:11 PM
oh cmon
it skips prefixes?
I guess I will use broken english
also, it can format and parse Wietbot website sandbox messages
which use their own markdown variant
obviously because I wanted to test the cross platformyness
which... obviously worked because messages totally get shared between the sandbox and SE or Discord /s
</my-life-story>
 
 
2 hours later…
7:36 PM
Spiffy! :)
 

« first day (3855 days earlier)      last day (1071 days later) »