« first day (3195 days earlier)      last day (1970 days later) » 

00:00
Math is like love -- a simple idea but it can get complicated. -- R. Drabek (source)
 
1 hour later…
01:16
Morning.
Morning.
morn!
i.sstatic.net/XQJYM.jpg the definition of Stack Overflow: me at my hotel in Saigon
Ho Chi Minh?
 
5 hours later…
06:04
posted on July 23, 2019

 
1 hour later…
07:32
I'm an idiot to set the object I want to return to null.
07:54
you should be careful when assigning something to null
Hello, my favourite green majestic lion!
hello my favorite fart
你们好,我的朋友。
08:22
Hello i need some help with cleaning some tweets: for example
The, bottom, two, lines, wrap, that, up, @maddow
@CNN, @FOX#RacistPresident
from a split of string of a tweet text using " "
but im facing that somepeople put @FOX#RacistPresident for example without spaces or commas and i have to take into account..... id need to generate @Fox, #RacistPresident and not @FOX#RacistPresident as a whole word
id need to make some aplit by @ and # but preserving the @ and # .... im lost
any ideas ??
08:48
wtf is that new design?
"Swiss: the holiest of cheese"
String str = "boo:and:foo";
str = str.replace(":","newdelimiter:");
String[] tokens = str.split("newdelimiter");
i got this solution....
str = str.replace("@",",@");
str = str.replace("#",",#");
Zoe
Zoe
@wonderb0lt ikr
They broke the entire thing
String [] words = str.split(",");
and every word assure word > 2 (lenght to avoid ,,)
thanks
09:06
@EduardoGutierrez not enough info
@EduardoGutierrez You do know that the String split method accepts regular expressions, not plain text?
that was a pain to find out when you try to do "a|b|c".split("|")
 
1 hour later…
10:23
morn
morn
terrible heat in germany
/8ball will we all die ?
@Hans1984 It is certain
rip
10:25
I'm dying.
I don't know whether can I see tomorrow sun.
you ll find out eventually
/shrug
¯\_(ツ)_/¯
I'm so sad. So bothered, then die.
time to die !
Farewell, world.
10:28
o/
21 bots salute
A 21-gun salute is the most commonly recognized of the customary gun salutes that are performed by the firing of cannons or artillery as a military honor. The custom stems from naval tradition, where a warship would fire its cannons harmlessly out to sea until all ammunition was spent to show that it was disarmed, signifying the lack of hostile intent. As naval customs evolved, 21 guns came to be fired for heads of state, or in exceptional circumstances for head of government, with the number decreasing with the rank of the recipient of the honor. While the 21-gun salute is the most commonl...
We should be good until friday at least
Zoe
Zoe
xD
10:31
i will ride on those Meteor balls
straight into hell
i bet its alot of fun
for ze netherlands, thursday is gonna be hell
and on sunday, we go back to normal
we dont
for us ist also thursday but the heat will stay
next week
x_x
/8ball Is it all your fault for trying to enslave mankind ?
@Hans1984 Better not tell you now
10:33
I knew it!
best part is i strained myback yesterday while working out
now i can barely move my right arm without pain at work
so much fun
 
1 hour later…
12:00
Helmets weren't mandatory for football players until 1939. (source)
why would you play football with helmets on?
exactly
ah, I see, they only play football with helmets in the USA
I could have guessed
only an idiot would do that..or an american
12:43
Hello, long time no see
I've defected to --the soviet union-- the kingdom of C.
Hmm, I forgot how strikethrough works on here...
smh
@AMDG I guess you'll never know oh, sorry to hear that
It's been that long after all
hello
not long enough tho
old/new guy
12:48
:p
If it worked like discord it would be easy. ~I"ll figure out some day~
maybe today, maybe tomorrow
/maybe now/
maybe now never
maybe tommorrow i find my waaayyy hooomee
sings
F12 doens't help here
how about [F11]?
or [alt]+[F4]
If only this chat room weren't sanitized... sigh
^ohwell^
-Please remind me how it works-
maybe you just have to try harder
~~wait, I guess it only works the first time around?~~
Ah yes, and get kicked for spam.
there is always
/sandbox
Please go play in the sandbox
12:53
/sandbox iz you ignore arguments?
Please go play in the sandbox
iz you like my girlfriend?
/froggo
/8ball well?
12:53
@Wietlol Reply hazy try again
/8ball is the reply hazy ? Should we try again ?
@Hans1984 Signs point to yes
you make sense for once
I appear to be hopeless
All of my heuristic attempts have failed.
The code remains unbroken
12:58
can't find bug = there is no bug
if you have an application without bugs, you just havent discovered them yet
My hello world application is 100% bug free.
A bug is a condition beyond the expected feature set; if you always discern the constraints of your program clearly, and make certain that every case has a fall-through backup, bugs should theoretically be non-existent in a given block of code.
@AMDG that's what you think.. did you remember to put a comma after hello?
Anyways, someone do me the charity of knowing the strikethrough markup before I start digging up the javascript on this page.
the thing about theory is that in theory, theory and practice are the same thing, but in practice, they're hella different
13:03
Not really...
The theory is equivalent in practice when the theory has no error.
@AMDG then you should add that comma, sir
not necessarily.. just because you wrote something which relies on theory doesn't mean you did a thorough job of it
@Neil the code isn't broken; the grammar in the string is wrong. That isn't a bug; its a typo.
@Neil tell that to Einstein's General Theory of Relativity.
theory can be correct and practice can miss the mark
@AMDG I can't, it's a theory, not a person
Everything we know in science is the result of contemplation followed by simulation.
and so it follows that if the theory is supposed to model the universe as we observe it, it is the same
of course in practice, we know that theories can be wrong
13:07
Yes. I'm just pointing out the inaccuracies manifested in the statement "Something that works in theory does not always work in practice."
I was mostly making a joke, but I think you misinterpreted the meaning behind that
If people cared too much about the objective truth, I'd be in Heaven, but really, the more accurate statement would be, "A holistic theory will never fail in practice."
@Neil I knew you were joking, I just was being serious though.
a theory which snuggly fits in the world of theory and doesn't have points where it can be tested and proven is a very useless theory, I agree :P
Well, the truth is tried by the truth, and it stands above all in time. You know a theory is perfect and works because you try it with various contingencies.
@Neil if you did, it would be a bug
13:12
@Wietlol no, because you're talking to "world", so just like you say, "Hi, Wietlol", you would also say "Hello, World"
@AMDG the major source of bugs is unclear dependencies
for example... FRIGGING SYSTEM LANGUAGE SETTINGS FCKAIFJWOPFJQNFQPAFAPWEFJAMICROSOFTFOWEPFJWOEPCSHARPOPWJEFOPWFKSHITMPHF
@Neil Hi Niel
Dear Niel,
@Wietlol I find that statement very lacking in holistic thought.
Dear, Niel
holostic?
All bugs are the result of a failure to comprehend the width, and height, and depth of your program.
holistic
13:14
Alternatively, it makes sense if I spell it as wholistic.
it also makes sense if you spell it as "sane"
A holistic mind takes all things into consideration.
but which sense it makes, could differ
OOP is not very good for this
OOP is garbage.
OOP is very good
13:15
I don't know if I agree with that. If you wrote the program to accept only alphanumeric characters, and someone passes japanese characters instead, the program crashes horribly potentially, and it's a bug, but it isn't that your program didn't do as it was supposed to
just dont go with the old OOP version tho
that kind of is garbage
assuming of course you were told that only alphanumeric characters would be passed of course
hence why people stopped doing it really fast
@Neil the failure is to understand that your limitation is a subset of a superset. Hence, failure to understand the constraints of your program.
@AMDG then it was the failure on the part of the person doing the analysis if anything
13:17
@Neil the bug is only a bug if Japanese characters were allowed
Exactly, and that is usually the programmer.
but not the developer who was told explicitly that only alphanumeric characters would be provided
admittedly, it's a silly example. You would probably prepare for such a situation anyway
but the point still stands
however, if Japanese characters were not allowed, the code should explicitly handle their existence and raise a formal error
if the program doesnt do that, the lack of handling the Japanese case is a bug
assuming that the input were coming from some nightly batch generated by an external program, so it isn't like you're assuming some guy on your web page isn't going to enter in japanese characters
Yes, so the problem is that people tend to program with a subjective mindset full of expectations, when they ought to be programming with an objective mindset, aware of the consequences of all the actions of their code. OOP has as its core foundation the ability to obfuscate code, misconstrued as "encapsulation".
13:19
obviously anything coming from a web page needs to be thoroughly validated. batch files don't necessarily require that level of validation
@Neil btw, is this person who is writing these Japanese characters going to write the declaration of independence?
Let's go back to your example case, though, to keep things simple @Neil
@Wietlol could happen
The programmer was told that he will receive alphanumeric characters. He would obviously then expect to use the ASCII subset of UTF-8.
I make everything explicitly fail if it is intended to fail in such cases
except for tools I just write to get some shit done
for example, I had a tsv file containing a set of input values and expected results and generated unit tests from it
13:21
The programmer should know that it is a subset of a greater superset, and expect that there will be unexpected characters, and there should be logic to handle that case.
the code generator to generate the unit tests was very... buggy... but once it completed successfully, it did its job and was removed
@AMDG I could have easily had said numeric characters instead
Japanese characters can still be passed in the place of numeric characters
(there was a special reason I wanted to have a different test for each case rather than one test that took in the entire tsv and just looped over it)
Every if-statement has an else... I'm saying that it is the programmer's responsibility to ensure that both what is expected and unexpected is covered, and the logical conclusion is defined.
I would argue that the problem is the one providing the input, because you don't tend to mess things up that badly as an analyst
but that could also happen that the analyst was smoking something that day
my point was only that the program doesn't expect a certain kind of input and the behavior is therefore unexpected as a consequence
you're not supposed to create a solution space for every possible input, that would be ridiculous. Only where applicable and where by not doing so, you'd be violating the specifications for the project
13:23
switch(in_char) { /* ... */ default: /* throw error: Unexpected character: in_char */ }
I have a few switch cases like that where the default branch is untested
as in, no test ever reaches that default branch
@Wietlol well there you go
as it is theoretically and practically impossible for code to reach it
That's what you would expect, that your default branch would be dead code, but next thing you know and someone brings their laptop on a plane without ECC memory, and... kaboom
I checked it tho
13:25
the plane explodes
when I say "this is unreachable code", it is unreachable code
That is your expectation
if (b)
	a = "a"
else
	a = "b"


switch (a)
{
	case "a": return foo()
	case "b": return bar()
	default: throw new UnreachableCodeReachedException()
}
I am perfectly happy with my expectation of this code
I would think it is good practice anyways to occupy the cases which you believe are dead or unreachable. If you change the code, you'll catch an error.
@AMDG so you would argue that you'd need to prepare for the case in which the default is reached?
I disagree
13:28
I'm just saying it shouldn't be left empty with nothing but a comment saying //this will never happen
@AMDG but my unit tests cannot test the default branch because they cant test it without going through other stuff
@Wietlol though to be fair, that code is very fragile and a slight change could easily make it so that the default case occurs
ah, yes, when I have unreachable code, I explicitly mark it unreachable by throwing an UnreachableCodeReachedException
if it ever gets reached, that is unexpected, so an exception should be thrown
I meant someone modifying the logic of the if else would unwittingly be causing the exception to be thrown
but there are many cases where I cannot test for that unreachable code being reached
@Neil true, but you cant really test for it to reach the default case
so you cant apply a characterization test to the default branch
13:30
it shouldn't be the type of thing which depends on logic. It shouldn't happen because specifications have deemed it to be impossible or because it is very trivial and obvious to anyone reading the code
you can only test that b = true yields the result of foo() and b = false yields the result of bar()
you cant test with anything other than true and false
it gets more interesting when you have a string as input tho
and someone adds an additional "else if (!b and c)" condition and it no longer stands true
and that switch statement could be in a completely different part of your program and it wouldn't be obvious why it fails
So long as your hardware supports anything besides just true and false, the default case is possible as it is only a subset of a superset.
Though, of course, in C, everything that is not zero is treated as true.
I know how it can break, just not how to prevent someone from accidentally breaking it
you can't create fragile code like that, that's how
13:35
ok
consider this regex
^[-+x*\/]$
if the input matches, you switch over the match
then, based on which character it is, you return something
what do you do with the default branch?
do you make one of the operators default?
do you throw an exception and accept that you dont have a characterization test for it?
I wouldn't use a regex for this
you would
as you'd always have to have the regex and its handler in two separate places
why so?
you should use an enum and its handler bound together
if the enum matches the operator, it gets handled
13:38
i dont really understand what you are trying to say
separating it means tomorrow someone comes along and says, "oh I want X to be a valid multiplier character as well" and adds it.. it isn't obvious that it fails
well... if you add something, you must add tests for it
they go hand in hand, so you'd group them in your program
I assume that everything else still works when you half-add X as operator
@Wietlol relying on tests to ensure everything is up and working is not the best idea
tests should be done, but they're a second-hand solution which is supposed to handle any bugs you may have introduced by accident
13:41
depends on the kind of test you do
If you add X to the regex, run the tests, everything still works! great, ship it!
then the error will arise in an unexpected moment
if you have one enum per operator, and you want to add another, you can't not create a new enum
it is both the detector and the handler
if you add behavior, you must write the tests for it to assert that behavior works
so you can't forget to do one or the other
if you dont... you cant say "everything still works"
at least, everything that used to work, still works
but something that first threw an error, doesnt any more
@Wietlol of course you should, but my point was that the code shouldn't compile rather than allow a situation like this to occur
if it's done properly, you don't have a switch statement with default that probably will never get run..
13:43
even if you have an enum, you need to parse it
this is the parse function that returns a special object
(not really an enum in my case, but still sort of like an enum)
but I dont have a switch case for operators anywhere else
if the enum operators do not have amongst them a X character, then there's no confusion of whether or not it will be detected as an operator and not handled
the special object contains all functions it needs
it's a subtle thing, I'm not calling your code bad or anything, just sharing my experience
I find it is better to not allow separation of such things in your code if the two things go hand in hand
but you still cant do without that switch case on strings
not sure I get your point
The enums either match the string or they don't. If they don't, you can deal with that situation however you wish
If they do, you know you have a handler for it
13:51
if they dont match, but you already filtered such cases out, you have dead code
there's no way you match the string and don't have a handler, because the enum constructor requires a handler
why would you have filtered such cases out? This is the filter
for example, if you parse an expression ({expression} {binaryOperator} {expression})
it would only match if that binaryOperator is one that would be parsed
using a regex to ensure the whole string is potentially valid is efficient, but it also means you now have two things to update whenever new operations are added
Hey Pros. I got a pro question here as usual.
I got this class: https://pastebin.com/y29hP3pg
I can reach all methods except the getParent() method that I added myself. Anyone got an idea why?
@Neil not really to ensure the whole string is potentially valid, but to find out what kind of input it is
is it a binary expression?
is it a literal expression?
is it a unary expression?
(not really necessary with regex, but perhaps antlr)
13:55
@Wietlol So you have an operatorHandler, which checks the next characters with every available operator in your enum
@sockevalley define "reach"
if operatorHandler can't find a match, and expression can't find a match, you no longer have a valid input
@Neil that is antly, which cannot be based on my enums
that's how you'd know, you'd exhaust all possible token values
it is based on a grammar declaration
13:57
if you can get antly to do parsing for you, great
@Wietlol
Sorry for my bad lingo. By reach I mean that I can't call it on the object below:
VoidVisitor<String> methodNameCollector = new MethodClassCollector(testFile);
but you no longer have to worry about if what you're dealing with is a binary operator or an expression, because you'd know
you only have to ensure the token type is what you expect it to be
@sockevalley that is because VoidVisitor<String> contains no definition of getParent()
I reckon it was something like that. So even if I add fields to the constructor, I wont be able to call them outside the class?
you need to either add them to the base class or interface, or you need to be more specific in your variable declarations
14:01
@sockevalley unless you're using reflection, the only way a method is going to get called is if you call it
@Wietlol @Neil Ok guys. I think I misunderstood what another person said I should do. The visit functions can only take one extra argument so I asked my friend if and how I can add more data to the class. He responded:

"The usual approaches are: stuff the context you need in the visitor as fields, or pass it as the argument (the generic thing that comes in as the second parameter.) If you can't get enough information in the argument, create a class with all the stuff you need and pass that as the argument."
a tradditional visitor only accepts a single argument
if you need multiple arguments, you need to wrap those in a special class
the same with events
wrapping them in a special class for the visitor or event is recommended, as you can then define new fields without changing the signature of the events or listeners
@Wietlol Similar to this: https://github.com/javaparser/javaparser-visited/blob/master/src/main/java/org/javaparser/examples/chapter2/VoidVisitorComplete.java ?
Since you're considering a wrapper class
I think that example is quite weird because they have static classes but use default constructor
static classes are normal classes
but that is not what I meant, no
the JavaParser visitors are slightly different tho
a wrapper class would be something like this
@Data
public class Foo {
    private final String methodName;
    private final String parentName;
}
in the case of javaparser, their visitors traverse the entire compilationunit's syntax tree
in your code, you visit methods on this function visit(MethodDeclaration n, String collector)
using the method declaration, you should be able to find out what the parent is
your code would also not work for nested classes
14:18
I think I get what you're getting at here. My solution was to basically extract the variables to the Main class and making them static so that the static class can call them as well.
dont make stuff static tho
also, dont use mutable fields
and dont put classes inside other classes
(I think those 3 should save you a lot of headache on a compiler)
(coming from a person who wrote 3 compilers)
(even tho 1 and 3 apply on everything and not only compilers)
Haha, I can imagine. Exactly what do you recommend I should do in this case?
Hello anyone helps with Hibernate questions here?
@sockevalley what exactly do you need?
@Laxminarayan depending on the question
ok
You can find the question here: stackoverflow.com/questions/57162588/…
If A extends B, then A inherits all of B's methods.
I am trying to figure out if a method Y exists in either A or B, or some other extended class.

So in order to do that, the visitor class need the method name of Y so it can tranverse each MethodDeclaration, if it finds the method in class A, then it should assign the parameter (collector) to A.
@sockevalley you'd know if A has method Y because A has Y
use an interface, not a visitor pattern
@Neil he is using a source code parser
an interface wont do
@sockevalley you should be able to list methods from B
but you cannot do that before linking
you need to create a class object for each class and put that in package objects
then, you can search for classes by name
at that point, you can iterate over all classes and find out what their extends list refer to
then, and only then, you can list the methods of the parent types and compare the signatures to the methods of the class
@Laxminarayan I think most people wont know... because we dont care what is in the cache
as long as it gets loaded correctly
14:52
@Wietlol I resolved my issue now.
When you said that I need to create a class object for each class. What classes are you talking about? A and B?
@Data
class JavaClass {
    private final String name;
}
new JavaClass("A")
new JavaClass("B")
I see. I decided to create a class Collector and pass it as the second parameter, that way methodName and parentClass could use both inside and outside the class very easily.
but you collect... well... a name.... and not even in a... you know... collection
perhaps you should try collecting class objects, which contain a name
and... you know... put them in a collection
but in your case, you want to collect objects
with a name property
and perhaps a private property which is the declaration
15:45
Hahaha, I needed three fields, 2 strings, 1 boolean. I can send you a paste so you can check the solution. I thought it was kinda good
@Wietlol
https://pastebin.com/Tmxzvzxx
 
1 hour later…
17:14
Hi
Why this doesn't work?
recipeMap has no methods
@sockevalley cant see the paste any more
I have the solution. :)
forgot the method :/
 
3 hours later…
20:02
What was it called back in the AOL days when you would type a keyword into a textbox to directly go to a specific feature?
 
4 hours later…
23:54
Hello one and all! I am running a python wrapper for some tools developed in Java and getting the following error. I think it is just to do with how the directory is being read but I don't know how to amend, any suggestions?

Traceback (most recent call last):
File "../testsim.py", line 26, in <module>
from orbdetpy import simulateMeasurements
File "/Users/.../.../orbdetpy-master/orbdetpy/__init__.py", line 39, in <module>
_DataManager.initialize(_datadir)
File "jnius/jnius_export_class.pxi", line 637, in jnius.JavaMethod.__call__

« first day (3195 days earlier)      last day (1970 days later) »