« first day (2739 days earlier)      last day (2209 days later) » 
00:00 - 17:0017:00 - 00:00

Wes
5:00 PM
self::tagname means current namespace's tagname... or?
 
ThW
nope
here is no such thing as a current or default namespace in Xpath
 
Wes
/*[self::h1] means then?
i might need a guide. any link?
 
ThW
the same as /h1
self:: is an axis that contains the current node
 
Wes
ah so ./[self::h1] self === .
 
ThW
it is useful if you want to do something like /*[self::h1 or self::h2]
no
 
Wes
5:03 PM
*[self::h1] self === *
 
ThW
/* is actually short for /child::* (child is the default axis)
/ at the start of the location path says document root (not current context) so /child::*selects any document element node
[] are conditions so the list from the previous location path is filtered by it
 
Wes
hm
need to read more about it. looks complicated
let x = document.evaluate("../../../*[self::thead or self::tbody or self::tfoot]/tr/*[self::td or self::th]", $0, null, XPathResult.ANY_TYPE, null);
 
ThW
so [self::h1] filters the nodes from the location path by looking if here is element node h1 on the self axis
 
Wes
this successfully selects all td and ths in a table
$0 is a td
how do i select all the first columns in that table?
i tried
../../../*[self::thead or self::tbody or self::tfoot]/tr/*[self::td or self::th][0]
but didn't work
 
ThW
no because of two reasons
positions in Xpath start with 1 not 0
you look for the position in your result node list
../../../*[self::thead or self::tbody or self::tfoot]/tr/*[(self::td or self::th) and position() = 1]
 
ThW
:-)
 
Wes
tyvm :D
that worked :P
 
ThW
@Wes sorry no, didn't need one for some time
 
Wes
xpath is one of those things that i always refused to learn
and you can totally see that in my php code that is full of nodelists, item() getElementsByTagName() and stuff :B
that because in my head i was convinced that css selectors would take over
that was before i learned that libxml is not actually developed anymore :B
 
5:26 PM
@Wes somehow, I feel less of a problem with actual "physical objects" being numbered from 1 than with arrays starting at 1.
if you take a handful of berries, the first one is... one
if you put them all individually in a 10x10 cell box, the first one is 0.
makes sense, yes?
 
@FélixGagnon-Grenier but a physical item and its index don't really have any relation
 
so starting your index at 1 still doesn't make sense
unless I'm just not understanding your point
 
I wouldn't say that my point is coherent
 
@FélixGagnon-Grenier i.redd.it/cec1901d99s01.jpg .
2
 
5:31 PM
lolwat
 
xD
 
I just observe that I'm not irked that much about certain counts beginning at one, and array beginning at 0 ;)
 
but an array index isn't a count
.length is
and that reports fine.
think about a sparse array
then it all makes more sense (imo)
 
@JayIsTooCommon avoiding creating objects that may be invalid is a good thing to do:
 
what is "sparse array"?
 
5:32 PM
list($strategyListParam, $validationErrors) = validateAndCreateStrategyListParam($input);

if ($validationErrors) {
   // strategyListParam is null...
   return new UserErrorResponse($validationErrors);
}

$strategyListParam is created and ready to use
 
@FélixGagnon-Grenier uhh, for my point, arrays with holes in them
 
@FélixGagnon-Grenier $foo = [1, 2, 1000 => 3]
 
yea not sure how to create one in php :P
 
so indexes 2 through 999 don't exist
contrast to Perl where my @foo; $foo[1000] = 1; will implicitly create the preceding 1,000 elements before offset 1000
 
5:34 PM
:O
I have no idea what I'm talking about
 
not uncommon. we're programmers afterall
 
Idea occurs to me. Think about it a little. Begin professing it as fact. Rinse, Repeat
 
that sounds healthy
 
Incompetence and Hubris, two great tastes that taste great together!
 
5:36 PM
Does anyone in here have a doctorate of computer science?
 
they don't give those out for JS, so sorry, no I dont'.
 
imagine that. a doctorate on JS. "Of the multiple personalities of this"
 
Just curious. It doesn't seem that it would have the reward as a doctorate in another field... maybe I'm wrong. Is there any position that would require it?
 
probably
not web development tho :P
 
wow... computerscience.org/degrees/phd not sure of the source.
"With the rising need for technical expertise, Ph.D.s are becoming a far more common prerequisite to employment. In fact, the Bureau of Labor Statistics projects a 15.3% jump in the number of jobs in CS requiring a doctorate degree by 2022."
 
5:45 PM
well you see, the amount of people that start in programming and learn all kind of shit on the internet is seriously rising
 
@BruceBanEm a phd did the study
he wanted more job opportunities
 
If doctorate degrees ever become "common" I wonder what other next-level education tier they would come up with. Grandmaster, Champion,
 
experience
 
Champion of Computer Science. Maybe if they came up with specific titles for the field more people would go for them. Computer Science could be "Dungeon Master of Computer Science."
 
I wanna make us look even geekier to the outsiders.
we should have levels.
> I'm a level 55 DBA
 
5:49 PM
Exactly! It works in video games.
I like that.
 
:puts on wizards hat and robe:
 
But...
 
bash.org/?104383 so many good fun
 
then employers would say "we're not going to give you a raise this year but we are going to give you an extra 25,000 XP!"
 
I like where this is going
 
6:08 PM
technical awareness guys bought pragprog.com/book/rwdata/seven-databases-in-seven-weeks. Pretty interesting read about different types of database. so far, I'm mostly surprised by how much I'm surprised / unsettled by the idea that column-based databases exist
 
Ok, play this shit at 2X youtube.com/watch?v=2hY17VIpoeg
 
Wes
@ThW need to store a xpath string in a custom css property:
body{
--my-property: xpath(./div[0]);
}
that property is then read with dom and processed with js. need an advice on the format to use:
xpath("...")
xpath(...)
any idea?
 
6:23 PM
!!should I try out J or read a book about fractals
 
You should read a book about fractals.
 
fu. I'll try writing a fractal in J
 
6:34 PM
@Danack I had job related questions, but will have to wait until I'm off work
@FélixGagnon-Grenier what is J?
 
@Tiffany jsoftware.com some programming language
... it's a slow monday
figured I might as well try and learn something
 
I had to clean up my notes from sessions at a conference because I chose not to focus on fixing typos while taking notes, it would have slowed me down. My notes also included mental commentary... some of it I find pretty funny now
 
@FélixGagnon-Grenier gist.github.com/tktaylor/7e21c02410d8e5182d2f6116a3d63138 I ended up leaving the session early and going into another one... which was also was kind of useless to me
 
I like the safsfadffdasfda
 
6:46 PM
I did that a lot. Also, "blah blah blah" ... I shared notes from one session with supervisor, she was like, "what's 'blah blah blah'?"
"blah blah blah... mental commentary..."
any time I missed something and couldn't type it... either fingers mashing on keyboard, or blahs
 
what conference is that?
internal thing?
 
hopefully you caught it before edit
 
you know he can just see the history of the message
 
only room owners can
 
Everybody can
 
6:50 PM
:P
 
Deleted messages it what is gone for normal users
 
oh
 
:)
 
there lol
 
Doesn't matter, already saw it :P
 
6:51 PM
Félix can't read version 101273
 
I'm more concerned about it being cached by a spider :P
 
Everybody can, even the non-registered users
 
btw @Tiffany I started FMA:B as you suggested
I'm quite happy they cut all the fillers
but damn, people die quickly
 
yup :(
 
I wasn't ready for hughes. iirc it was much, much later in the other series
 
6:53 PM
yeah, I never even got to it when I was watching the first series
so when it happened... my feels
... I had a similar reaction to Carson Beckett in Stargate Atlantis...
 
I find it pretty cool. I love how some of the shots are more manga like
like when they depart from Liore, with Roze on the stairs on the cathedral
epic scenes
 
yeah
the colors/animation captivated me... but the style is typical of anime that's newer-ish, compared to the '03 version
 
yesterday, by mega6382
freaking animes :P
 
;)
well, you might as well just accept it. some animes are really good :)
 
have you watched Psycho-Pass, @FélixGagnon-Grenier?
 
6:58 PM
no.
 
:O
add it to your list
 
ok :)
it's unfair, there's cyberpunk in the description
 
@FélixGagnon-Grenier Yeah, I know. I used to watch "The Legend of Zorro", oh was that amazing.
 
leaves work
 
@FélixGagnon-Grenier it is kind of cyberpunk, but not overwhelmingly so
 
7:01 PM
I really like cyberpunk
shadowrun returns, on steam, is by far the wettest dream of them all as far as I am concerned
I wish there was some open world game like that. shadowrun.
> There is in J no rule such as multiplication before addition.
:O
3*2+1 === 9 // true
 
I wanted to get into Shadowrun, but how closely it was tied to D&D rules and having to play a party... I just couldn't get into it.
@FélixGagnon-Grenier so it doesn't follow order of operations? wat
 
I hear you. Do try on steam if you still have a bit of hope for the genre
 
why would you write a programming language that's gear towards math related stuff and not follow order of operations
 
@Tiffany well, they say that the order of operations was more an ease of writing rule to limit the number of parenthesis
well, I'm not really a Math savvy person, I will blindly accept their higher wisdom to that regard
 
but how would you know if multiplication is done first, or addition is done first? why go against the accepted standard?
 
7:04 PM
the order in which it's written
afaiu
 
3 * 2 + 1 is 7 then
2 + 1 * 3 would be 9
(in their example)
 
scratch that
seems they use "rightmost first"
> This "rightmost first" rule is different from, but plays the same role as, the common convention of "multiplication before addition". It is merely a convenience: you can ignore it and write parentheses instead. Its advantage is that there are, in J, many (something like 100) functions for computation with numbers and it would be out of the question to try to remember which function should be applied before which.
 
that makes sense
I dunno... I think I would rather have them follow order of operations, but if functions are used that return a number, then follow rightmost as first... but then how do you calculate multiple numbers and multiple functions in one line...
I guess their way is simpler
how they do division and remainders is weird to me
 
it's hard, but worthwhile in my opinion, to withhold opinion / assessments in this situation
it leaves mental room for being amazed by stuff
please don't take that harshly on yourself, it's merely an idea :)
 
I dunno, when I start reading something new, I immediately critique it if I have an opinion on it. Just what my brain does. Maybe related to ADHD.
because I also have a tendency to interrupt people that I have to force myself not to
 
7:48 PM
posted on April 16, 2018

New Cyanide and Happiness Comic

 
Anonymous
8:17 PM
@Ikari @mega6382 @MadaraUchiha have you guys tried fortnite?
 
Anonymous
Started playing it last week, and I think it is really good, like OW.
 
@samayo Some friends at work have been telling me about that game.
 
Anonymous
You should try it, I have the free version and we can play squad
 
Not tried it yet.
Last game I was on was They Are Billions but haven't played in a bit.
 
Anonymous
@BruceBanEm I heard the hype around it, and like all hyped things I tried to shun it, but it's kinda fun
 
Anonymous
8:19 PM
I haven't played games since 10 year ago, but I started with overwatch recently and now I have added fortnite to the list, both are fun
 
@samayo I came by to ask @tereško a question but not sure if he has been active in a few hours. However you edited this question so maybe you could help me understand. This question: stackoverflow.com/questions/11369360/…
 
Anonymous
@BruceBanEm They Are Billions, looks cool
 
They are billions is really awesome- definitely try
Is this missing a function for creating the queries? Is the query passed to the create method?
 
Anonymous
What is the question?
 
Anonymous
I'm kinda a PHP noob
 
8:22 PM
ah ok- no worries.
Yeah I was playing They Are Billions every night for a few weeks.
I even finally broke down and bought a tv and mounted it on the wall in our bedroom because my wife wanted me to come to bed rather than stay in my office. So I hooked my PC up in the bedroom when she went to sleep and played until time to go to work the next morning... not on purpose. It is very addictive.
@samayo
 
Anonymous
I'm watching the gameplay: youtube.com/watch?v=DmVx_OMojSY it seems very cool game, my fav game was actually command and conquer so I've been looking for something similar since then
 
Anonymous
something b/n C&C and AoE
 
A guy named AznElite123 pretty much dominates TAB on youTube. I learned a lot from watching him.
 
Anonymous
I will save this game for later
 
Anonymous
@BruceBanEm what was your question? Just to see if I can help
 
8:27 PM
Oh I posted above- one sec
Is this missing a function for creating the queries? Is the query passed to the create method?
I'm trying to create a database class but the wording on that linked question is different than many of the other ones I have seen.
 
Anonymous
Still don't get it. Do you want to establish a PDO connection or you want create a single instance?
 
Establish a single PDO connection and then make queries using that database class in my code.
I understand how to do dependency injection into other classes in order to use the database object to connect to the database... but having a hard time figuring out how this code works.
 
Anonymous
Which code? b/c the question in the link seems pretty archaic
 
@samayo wait... which C&C?
 
By this code I mean the specific link using an anonymous function and the factory pattern.
It's the first answer in this link which you edited a few years ago stackoverflow.com/questions/11369360/…
 
Anonymous
8:33 PM
Singletons are anti-patterns, if you don't care for this technical BS, i think you can find examples on SO on how to use one
 
Anonymous
@Dereleased PS1 version :)
 
I definitely don't want a singleton.
 
C&C95 then?
GDI & Nod?
 
Anonymous
Red alert
 
@BruceBanEm There is no reason to create a database class
 
8:35 PM
PDO is its own class?
 
well, there is a single use case of extending PDO so that you can log something on each queries, but really, a database class is a mistake most of us do, and we should not
yes, it is
 
@samayo dang, so close
 
Anonymous
@BruceBanEm Yes, you can also extend it if you want
 
when dependency injecting PDO in a class, you directly type it
__construct (\PDO $pdo) {}
pdo has all of the functions you need to access your database efficiently and securely.
 
Anonymous
@FélixGagnon-Grenier we can use pimple for lazy loading right? as an alternative to singleton ... if I am not mistaken
 
8:37 PM
@FélixGagnon-Grenier ok that makes sense.
 
@samayo yes, pimple can be an introduction to full fledged DIC
 
Anonymous
@Dereleased I played another one two, but don't remember it. I actually had the CDs in germany language like 15 years ago, so I can't remember
 
15 years ago... was it really new at the time?
well, not super new. Tiberian Sun came out in 99, Red Alert 2 was a couple years later
 
Anonymous
Funny enough, all the games and movies I had access to at the time and thought were new were actually a decade older...
 
Anonymous
Someone was buying me bootleg cds and dvds I guess
 
Anonymous
8:41 PM
or maybe I though everthing I got then was brand new, anyway I feel fortunate growing up playing those games
 
@FélixGagnon-Grenier What is the purpose of putting the new PDO object inside of an anonymous function as it is in the answer to this question. stackoverflow.com/questions/11369360/…
 
@BruceBanEm that is a rather home made way to create a single entity of PDO so that it can be reused through your app.
 
@BruceBanEm wat
 
A more modern approach, is the use of Dependency Injection Containers, such as Auryn (rdlowrey/auryn on github)
 
Is it still valid code or is there a better method for ensuring you only have one active instance of the connection?
 
8:45 PM
there are two things
 
@samayo question is old, solution is still valid (if you are not using DI container)
 
@tereško gotcha! ty
@FélixGagnon-Grenier thank you
 
I feel like the best way is to not make two instances. Don't make "smart" code that autoconnects if it has an invalid handle, and then don't create more than one handle
 
one of these two things, is that dependency injection consists of type hinting needed types in the constructor
 
8:46 PM
fail early, fail often
 
@FélixGagnon-Grenier bullshit - that only applies if you have reflection based DIC
 
at this level, there is no concept of reusing a single entity. classes ask for a pdo connection
then, the other level is actually sending these entities in these classes. this is where the dic is used
@tereško sure
 
and reflection based DIC falters, as soon as you start using interfaces at your application boundaries
 
oh, that's what all these yml configuration files are for in blank
 
/firstChild(List)[
  /lastChild(Item)[
    /children(^BlockQuote)
  ]
]
current status ...
 
8:48 PM
(there are workarounds, of course, but those are usually ad-hoc solutions)
 
yeah, honestly I rarely consider dic in a not reflection-based context
how does it work in other languages?
 
that the primary context I consider in
since it's what you do in both highly SOLID projects and legacy projects
 
I mean, at some point, if we don't want the programmer to define injection manually for all classes in a system, there must be reflection?
 
reflection-based DIC is more of a "syntax sugar" level feature, which isn't actually all that useful outside small projects (or self-contained modules)
 
ThW
@FélixGagnon-Grenier callback, profile/builder objects
 
8:53 PM
You mean that all this time, I've been spoiled by how easily Auryn allows me to type stuff, and stop thinking about building objects? People actually need to manually wire all this?
 
... and now that I have red-pilled @FélixGagnon-Grenier about DICs, I can fo back to my beer
 
;) happy beer, thanks for the reflection material
 
^ pun intended
 
and, to answer your question: not all has to be manually wired, but just the important parts
the boring shit will be tightly coupled to specific class names on the boundaries
those parts you can do by-reflections
but the actual service layer will often be (in larger projects) separated by interfaces
also, things like logging (especially if you start hitting things like A/B testing and related concepts) will need manual setup
 
9:01 PM
yes? I was thinking that this sounds like what delegate is used for
 
so ... anyone followed the "BullyHunters" scam?
 
delegating specific interfaces to callbacks
@tereško I've only seen some tweets about it being shit?
 
@FélixGagnon-Grenier IIRC, that setup is extremely annoying (think: having to do it for 40 different interfaces)
that's why proper hybrid-DICs are the way to go
 
@FélixGagnon-Grenier In Java - lots of XML.
and shit like that.
 
gods.
please tell me this can be automatically generated somehow
 
9:06 PM
@FélixGagnon-Grenier you really don't want to look into "professional java development"
 
ThW
its funny how afraid people are of XML :-)
 
... actually, that example is not overwhelmingly verbose
@ThW I have nightmares ;)
 
btw, @Danack, maybe you know - has Java acquired proper package management tools, or does not still need to download and setups Maven manually
?
 
ThW
@FélixGagnon-Grenier so you still do not understand namespaces and xpath :->
 
My short use of xpath in jeeves a few months ago was scary, yes
 
9:10 PM
@ThW and xsd and xslt and and
 
But I think I understand namespaces.
 
ThW
@Christian not really needed for the "data format" level
 
This place always reminds me how little I know...
 
@ThW they're part of the package though.
 
unless you meant namespaces in xpath, which I indeed do not know about, if they're combinately different than each one separately
 
ThW
9:11 PM
@Christian more like addons
 
kinda... xpath is also a kind of addon, you can also completely skip it
 
ThW
@FélixGagnon-Grenier slightly - Xpath 1.0 has no default namespace, you always register your own prefix.
@Christian sure, but it makes a big difference using XML as a dataformat
 
although you have to hand it to these people, other than xpath everything else seems to be branching off xml somehow
 
walk-to-the-bar-o-clock. laters
 
guess it's one of those things where the heavily modified spec ended up containing any feature that might have come up, for better or for worse.
 
9:16 PM
thanks for the insights
 
@FélixGagnon-Grenier 45 mins to midnight? O.o
 
hmmm ... this actually looks quite awesome PC chassis design: youtube.com/watch?v=OH0fyooKmns //cc @Shafizadeh
 
ThW
@tereško I had several Lian Li cases, they are nice.
 
@ThW not all
 
I'm actually quite surprised. After half an hour toying around with different ways of producing a backtrace, I went with PHP's native zend_fetch_debug_backtrace(). It actually compiled and ran without a hitch.
 
9:19 PM
I have seen a lot of shitty LianLi cases, but this particular is a really good one
 
Speaking of builds, anyone got an i9 cpu yet?
 
ThW
@tereško I like that they build really niche cases as well
 
I have been mostly sticking with Fractal cases, since LianLi only recently discovered that dust filters are a thing :P
 
@BruceBanEm that's why I stay in here... I learn a lot
 
Anonymous
@BruceBanEm If you hangout here for a year, you will learn 6 years worth
 
9:24 PM
I need to start forcing myself to work on something programming related for an hour each day.
 
I have... still dumbfounded daily. =)
 
google the things you don't understand, or ask questions
most people are willing to explain if it's not something easily googleable
 
Oh I do- just always something new to learn. =)
 
ThW
@Tiffany not "or" but "and" :-)
 
Anonymous
I kinda miss not seeing some of the gurus that used to be regulars in this room like ircmaxell, hakre, ... rdlowery and some others
 
9:26 PM
@ThW most of the time I try to google a concept I'm unfamiliar with so as to not ask redundant questions. Sometimes I'm lazy, or have no idea how to form the concept into something I can google
...and then other times there are questions I've asked more than once, and forgot the answer the first time... in those cases, I write the answer down the second time in a secret gist I keep
 
@samayo hakre was in here yesterday
Goodnight all.
 
Anonymous
gn
 
nite
 
9:55 PM
TIL you can undo force push rebase ...
 
10:09 PM
@JoeWatkins via reflog you mean?
 
yeah
I'm just hearing about this now ...
 
10:41 PM
Is writing the answer in two languages allowed in SO??
 
11:05 PM
not really
then again, most pf the users cant even write a question in one language
3
 
11:17 PM
@Christian it was 5:15 pm here ;)
 
00:00 - 17:0017:00 - 00:00

« first day (2739 days earlier)      last day (2209 days later) »