« first day (2098 days earlier)      last day (3076 days later) » 

Wes
Wes
20:01
@staabm nice
Two CSS properties walk into a bar. A barstool in a completely different bar falls over.
Wes
Wes
20:24
lol
50%+ americans voted this guy liveleak.com/view?i=648_1468351940 dancing at a funeral
@Wes he's got senile dementia/cocaine brain damage.
Oh, convenient timing: psypost.org/2016/07/…
Wes
Wes
can we rollback everything and start over on a new planet
@Wes "over" means "again" in this context?
what are the ways to send array from php to android
except json
@Wes there are a few 4x games out there that might do the trick
Wes
Wes
20:29
@Shafizadeh nobody knows (i don't know). english people use to add stuff like on off over out in randomly
hahaha interesting :-)
How would you model this within a class structure: there are two types of the same thing, lets say A and B, but type A has a lot more data than B. Naturally i would think i can make base class and A,B extend it. But it feels wrong because A will have a lot more properties/methods than B, i guess it violates LSP
Wes
Wes
how is that related to lsp?
because you know, sus=bstituting types
@DenissKozlovs it should be the other way around
@DenissKozlovs "extend it" - almost certainly not. This would be easier to answer with concrete examples.
20:31
well, because A have methods that B doesn't have, and if somewhere accidentaly A gets swapped with B, well, fatal error
Wes
Wes
also needs concrete examples, and inheritance is bad
the class with less data is the parent, and the one with more data extends the other one
lol
@Sarah why not use JSON?
7 different viewpoints in five seconds from three people
get trouble with json @Danack
20:32
@PeeHaa That's interesting... maybe Yasuo messed with that behavior.
Then you'll probably have trouble with anything else as well...
concrete example is - the thing that gets modelled is the events. There is a Performance event, that has, description, duration, ticket data, and lots, and a simple internal Event, that has only title
@Danack i used this in php and the friends said that the json is wrong
echo(json_encode(array("result"=>$result)));
seems a fine opportunity to create an Event interface @DenissKozlovs
and create result like this
function selectAll($cnn)
{
$query="SELECT * FROM chatroom";
$stmt=$cnn->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll ();

//for debug
//var_dump($rowcount);
return $result;

}
20:34
@Sarah what does jsonlint.com say?
@FélixGagnon-Grenier should i split the data in multiple tables or keep them in one?
@Trowski That is kinda my guess. It doesn't seem intentional
@Danack nice tools says yes
it is valid
"tables"? I thought we were talking class design?
20:35
yeah, the second part is that should be stored in tables
database, i mean
yes, that is logical
Wes
Wes
@DenissKozlovs you should check again what lsp is tho
You think it's worth opening a bug @Trowski?
but at some point, database (persistence) and classes should not be related
{
"result": [{
"id": "5",
"0": "5",
"name": "apple",
"1": "apple",
"chatdesc": "ssaaa",
"2": "ssaaa",
"image": "imgRoom.jpg",
"3": "imgRoom.jpg",
"chatdate": "20160714011530",
"4": "20160714011530"
}]
}
but what is 0:5!!!
20:36
@PeeHaa Possibly, since that does seem unintentional.
like, the way you model the domain, does not need to respect a strict one for one relation sith database persistence
Will dump a report and see what happened
@Danack
"there are two types of the same thing," - those two things aren't the same. I'd almost certainly just implement them as two separate classes, possibly implementing some interfaces that expose the common methods.....
20:37
@Sarah
@sarah
@Sarah
@Danack yeah, looks like the interface seems a way to go
Wes
Wes
@Sarah
one ping more
20:38
wow
i like ping
more ping plz
@Wes :p
to my defense, I spoke for interfaces shut up felix, he's right. or are you @wes?
Wes
Wes
:P
when you think you tested everything and you start relaxing... that's the time shit finds you
every time
exactly. That's why I just don't test anymore
Wes
Wes
lol
Is this a correct definition of wordpress? "it is a admin panel for website's owners which is based on PHP".
Wes
Wes
20:48
it's kinda english. but the definition is wrong. it's a content management system written in php
ah - glad to hear it's written rightly in English ;-)
hm .. another latvian
greetings @DenissKozlovs
Wes
Wes
i find awesome that despite i'm very punctilious (yay learned and used a new word) with testing, there is always something that passes unnoticed, even for months sometimes
brw, @FélixGagnon-Grenier what was your impression of Draconian?
@Shafizadeh *correctly
"rightly" your imply that something is "by law" or "destined to"
20:51
@tereško I think "rightly" and "correctly" are synonyms, aren't they?
@tereško oh .. good to know
the expression would be "this land is rightly yours"
@tereško pretty positive. reminds me of some group I can't put a name on. Not sure that I find it "oppressive" yet but it definitely falls into my field of liking
got it
@tereško čau
20:52
It does have a grounding atmosphere to it
or well... like atmospherical pression. no cue how to express that
@tereško What's the meaning of "cau" ? and how did you understand it?
@Shafizadeh "čau" is a latvian bastardization of en.wikipedia.org/wiki/Ciao
@tereško ah .. so you and @DenissKozlovs are in the same country?
yes, we are
good for you
Wes
Wes
20:58
@tereško will you attempt a project using event sourcing?
I will, but I am not sure when I will get the chance
I have been looking at this approach for some time now :/
Wes
Wes
i like the concept a lot but i'm unsure about the implementations. seen a talk from verraes, that stuff looks hella heavy
not really
the primitive implementation would be to write as per usually, but all the DB writes to be also keep a backlog of JSON data that is being put in
Wes
Wes
why is that needed / convenient?
because "universal data format"
it gets a bit dicey, if you try to also add file uploads, but that can actually be handled using ZFS
21:02
One question, the whole of SQL language is only 4 statements? SELECT, INSERT, UPDATE, DELETE .. Seems SQL is a really small language :-)
@Shafizadeh lol. You have just scratched the surface.
@tereško I don't get how the file system influences on managing file uploads. character set collisions?
Wes
Wes
because json is text only, no binary data, i suppose?
mongodb uses bson apparently
@tereško I don't know what's your point of "scratched the surface", but anyway doing that gives me a really bad feeling.
Wes
Wes
21:05
anyway it's a completely new world
meh nvm misread that
@Shafizadeh try looking at these slides: slideshare.net/MarkusWinand/modern-sql (there is also this lecture that comes with it youtube.com/watch?v=nFfS1HmiWCM ... but I remember you having EXTREMELY LIMITED bandwidth)
Wes
Wes
while i already have write only model, it's still basically the same thing i wrote for years. ES requires a complete class design change
@tereško true .. youtube is filter in my country. Plus the internet speed is pretty slow in here. your first link is still loading :-(
Wes
Wes
it's quite scary :B
21:13
is this the correct room to ask about design patterns?
> Don't ask to ask, just ask.
Having trouble organizing my architecture I suppose. What pattern is used to execute SQL statements? Right now I'm using something called a Gateway, but I've seen other patterns which may or may not integrate with this (Repository, DAO, DAL)
I think you mean "table gateway"
I'm writing an email (in google), I want to know, can I create a link in my email? I want to write a name for my link (I want to hide the path)
well, my recommendation would be to use data mappers
21:17
Could be so, I've called it an OracleGateway as I'm connecting to Oracle
@Shafizadeh in gmail (if you are using web interface) there is that "chain" icon at the bottom
Can I use a repository alongside a data mapper?
@tereško thxx .. that's exactly what I was looking fot
for *
Wes
Wes
iirc dao is just an array or an anon object, an associative collection, used to transfer records' data
21:22
@Steel If you'r writing ORM, you will probably need a query builder also
Wes
Wes
value object contains logic though, while dao is just key content pairs
not really .. it was complicated
@tereško I've read a lot of those by martin fowler (albeit a while ago). What happens when the queries are more complex? I can't simply find a record by it's ID all the time. Not to mention in Oracle I'm using a sequence to generate my primary key and I can't know the sequence number ahead of time.
22
A: Who should handle the conditions in complex queries, the data mapper or the service layer?

tereško The data mapper pattern only tells you, what it is supposed to do, not how it should be implemented. Therefore all the answers in this topic should be treated as subjective, because they reflect each authors personal preferences. I usually try to keep mapper's interface as simple as possi...

.. because I am lazy
Wes
Wes
looking for info about dao and what i got so far is 3 different definitions interpretations
21:30
total cognitive dissonance. fetch actually seems to bring an already existing object into the mapper? whereas fetch as I use it now is more like $user = $userMapper->fetchFromId($id)
@tereško nice slides ..
so like... the view asking the model for an instance would be picking in those already built entities?
well, I have a specific stile for writing mappers
I dont like them mizing with factory pattern
@tereško You know, one of my dreams is sending a link (which is my answer on SO) for somebody when he has asked a question :-)
besides @FélixGagnon-Grenier, if you use $user = $userMapper->fetchFromId($id), then you loos the ability to have an entity mapped from multiple data sources
Wes
Wes
21:33
and how do you create the domain object @tereško?
without a factory i mean
@Wes I do use factories (usually), but at the service layer's level ... though, ideally you would let the DI container to deal with creating them for the service
@Shafizadeh that sounds like a really mundane dream to have (I assume you are talking about day-dreaming)
Wes
Wes
so wait what you get back from the mappers is raw data? :\
@Wes nothing (well, sometime I get back true or false). The mappers just affect the domain objects that are passed to them.
@tereško Do you mean my dream is small?
Wes
Wes
i see. would never do that :B and how you do with collections? clone or something?
21:38
@Shafizadeh "mundane" means more like "ordinary"
@Wes collection have an ability to create a blank instance (I have not found a workaround for that)
@tereško Ah .. well that's a normal thing for you .. not me ..! I guess that dreams will come true for me in 5 years (I mean 5 next years)
if you keep learning - definitely
I hope so :-)
Wes
Wes
what's wrong with factories though?
@Wes nothing
you seem to have misunderstood what I wrote
Wes
Wes
21:42
probably, i mean why not passing factories to DM and create instances within DM ?
brb 2 min
An English question: "in 5 years" contains the concept of "next"? I mean should I surly use "next years" or no need to the word of "next" ?
@Shafizadeh yes, "in five years" by default implies "in next five years"
if you want to refer to timespan, that has already passed, you have to add "in past five years" or "in previous fire years"
ah ok :-)
@Wes it's an option, but it seems to really complicate the call graph
Wes
Wes
you mean reconstituting the objects in the aggregates?
doesn't "in the next 5 years" mean "every day in the upcoming 5 years"? while i'd interpret "in 5 years" "once reached 5 years from now"
21:55
well
fuck
it's tricky
Wes
Wes
english is complicated :B
if the sentence is in "future tense", then yes
Wes
Wes
it looks simple but there are plenty of subtle rules that can't really be understood without experience
*without practice
@tereško emm, your native language is "latino", or "lative", or what? (I cannot remember it correctly)
my native language is "latvian"
and, FYI, it's more complicated than english
22:00
ah .. ok
@tereško no I don't want to learn it ;-) I'm just talking about you with my friend and he asked about your native language :-)
Wes
Wes
suddenly martin fowler got blurry
@tereško do they suggest to save only changes or complete snapshots?
both are fine, i'm guessing
@Shafizadeh if you want a language sample, here is an MP3 file with a folk-style song: maiss.02.lv/faili/acis/Acis%20veras%2C%20aizveras.mp3
(you need to click "Pagrābt" to download it ... 2.3MB)
@tereško yeah that's obvious ;-) .. I'm downloading 20%
why this chat script has no ajax to get new messages ? how it comes new messages then here ?
@ScooterDaraf websockets
22:11
hmm thanks
i have to learn this
i guess its better then ajax
it depends
at least you dont check every 5 seconds with ajax , and you dont see request going
@tereško have you some good tutorial in websockets ?
the ajax is better, in some cases
nope
@tereško wtf .. how did you learn it?!
22:14
!!? websocket
Search for "websocket" (https://www.google.com/search?q=websocket&lr=lang_en)
• WebSocket - Wikipedia, the free encyclopedia - WebSocket is a protocol providing full-duplex communication channels over a single TCP connection.… (https://en.wikipedia.org/wiki/WebSocket)
• WebSockets | MDN - 31 mei 2013 … WebSockets is een geavanceerde techniek die het mogelijk maakt om een interactieve v… (https://developer.mozilla.org/nl/docs/WebSockets)
• websocket.org - Powered by Kaazing - websocket.org - WebSocket technology, demos, articles, and products. (https://www.websocket.org/)
@Shafizadeh wtf
it is mother tongue of him
@AdilIlhan edited, thx
@AdilIlhan yes I know ..
you mean the language? same was as you learned yours
:D
which is fast ? ajax or websockets ?
22:16
@tereško Mine is pretty simpler ..
no answer , ok which is safe ajax or websockets ?
@ScooterDaraf there is a website. it has answer for all of questions
we call it as google
@ScooterDaraf websocket fucks the server :-) All your website's users are online on the server all the time ..
ohhh you are right , thats why when i close stackoverflow website and open it a few days later i find myself ONLINE :)
^ no, that's not what he meant
22:20
no ^^
maybe...
:p
is there a french here?
@AdilIlhan you had to say "no" either .. (not maybe) .. never break the sequence
@AdilIlhan I talk french but i hate french hahaha
i like break the rules
@AdilIlhan be careful .. that's dangerous
22:23
@Shafizadeh don't you break the rules?
@tereško but its true what i said , i find my self online after when i closed the tab
user924016
what
it is different concept, sir
no, SO just recovers your session and the chat is persistent
it is not related to websocket.
22:24
anyway, it's late and I need to work tomorrow
user924016
laters
'nite all
English only no talking in mathematics
ok @ScooterDaraf
user924016
mornings
@AdilIlhan a few times.
@Shafizadeh be careful .. it's boring
well that's something good at least: bbc.co.uk/news/technology-36800334
@AdilIlhan :)
22:43
can someone please explain why you can't do OOP with functions, globals and returns?
because you can't write object oriented code with functions and globals.
Well, you can. It's just really hard.
@AdilIlhan way to repeat thw question
seems easier to me to do it that way
@Danack how do you extend something?
Who says you can't mix paradigms in a program?
22:46
functions call each other
how do you do 4 oop principles with only functions and globals?
Look at WordPress as an example of how to mix them. Now, no one says that's necessarily a good idea, but definitely not impossible.
Probably also highly discouraged given the turd that is WordPress.
functions encapsulate by default
do you think wordpress is an oop based software?
function fooBar() {...}
function fooZot() {...}
function fooQuux() {...}
$fooFunctions = [
    'barFunc' => 'fooBar',
    'zotFunc' => 'fooZot'
};
$fotOverload = [
    'zotFunc' => 'fooQuux'
];
$fotFunctions = array_merge($fooFunctions, $fotOverload)
22:48
really?
@AdilIlhan function tables...aka implementing a shitty OOP in userland.
@AdilIlhan Nobody said that. I'm just saying you can mix the two paradigms. Don't conflate that with a functional paradigm is the same thing as an object oriented paradigm.
inheritance is when a function calls another function
@acoder That's a stretch.
not really
22:50
inheritance involves a lot more than just calling another function
like what?
Like inheriting the parent object's members, for a start.
call forwarding isn't the same principle as object inheritance.
call forwarding isn't when you forward data to another function?
guys, i wish all of you success..
i'd better sleep..
@acoder The notion that you would even want to implement objects in userland PHP is pretty absurd to me.
22:54
k
If you're saying you want to mix OOP and functional paradigms in one program, sure. That's not necessarily a horrible idea, but to say you would want actually implement OOP in PHP just by using functions, that's pretty silly.
i want to back end development since all of the front end stuff is written already
I have no idea what that means, but the two paradigms are just different ways of thinking about the same stuff.
It doesn't really matter which one you use as anything you can write in an object oriented paradigm you can also write in a functional paradigm.
It's just a matter of which style you find easier to write code in.
i'm still confused why classes are so important even after watching the turland speech:
https://www.youtube.com/watch?v=oAaNHGK1kNk
But to try to reinvent the wheel here is definitely a turn for disaster.
Who says they're important?
They're just one of many ways to do things.
ONE of many.
If you prefer to code in a functional paradigm, go ahead.
Just don't try to reinvent wheels here.
That's an exercise in futility.
22:58
they reinvented the wheel when classes were invented
@acoder Yes, but why are you trying to reinvent what was already reinvented?
If you wanted OOP, why not just use OOP?
Why try to reinvent OOP?
That just makes no sense at all.
i'm not, i'm just trying to understand why everyone says classes are that important
Who is everyone?
OOP was originally without classes
I certainly never said any such thing and I'm pretty sure I'm included in everyone.
22:59
recruiters i talk to
What the heck does a recruiter know about programming?
That's like asking your postman for accounting advice.
when I tell them how bad classes are they stop an interview right there
Why on earth would a recruiter be conducting a technical interview?
And why would you think classes are bad?
ask american recruiters
I deal with recruiters all the time. I've never once had one try to conduct a technical interview.
23:01
classes require a macro
A recruiters job is to find talent, not to conduct technical interviews.
That's what engineers are for.
Seems like perhaps you've just been talking to the wrong people.
first question i get asked at an interview normally is about classes
By who? By an engineer or a recruiter?
i just can't seem to get past interviews
And what is the question specifically?
23:03
a recruiter
not sure what type
What is the question they asked you, exactly about classes?
it was what I know about classes
i tell them how they slow down data processing slightly
Wes
Wes
function wordpressize_php(){
    $all_the_functions = get_defined_functions()['internal'];
    foreach($all_the_functions as $the_function){
        eval('function the_' . $the_function . '(...$arguments){
            echo ' . $the_function . '(...$arguments);
        }');
    }
}
^ killer feature. bookmark it
@acoder I've got news for you. CPU time is cheap. Human time is very expensive :)
I'd sacrifice some CPU time for code that's easier to understand and maintain.
2
It will cost me a few extra pennies and save me millions.
Pretty worthy tradeoff
23:12
it is cheap but the more data processed per user will increase load times
classes are harder to understand
Maybe for you.
Classes allow us to group related behaviors. Which makes focusing on the abstraction simpler for the human.
isn't that what folders are for?
or passing data to it
user924016
god dang mr robot is a great serie imo
@Sherif A class is merely a convenience feature to organize functions together in a structured way making it easier for beginners as they don't need to learn first how to structure properly.
[note that I'm not talking about structs in general, but only classes combining structs and methods; structs are pretty much necessary or I could just go ahead an write asm…]
Wes
Wes
considering how the series escalated so far, that's inevitable
i just noticed you liked my tweet already :B
23:27
@Sherif But you can write perfectly structured C code which ends up very legible and maintainable. It's just fewer people having that skill as there's no easy predefined structures to fit things together in C.
@bwoebi Are you telling me what I already know?
@Sherif yes.
:-)
Wes
Wes
bob is a compiler that got reincarnated in a human
yeah, but with assembler so that nearly nobody understand me.
Wes
Wes
23:29
:P
@Sherif Sometimes I just say things to see whether my worldview needs shattering… As it is obvious that there is nobody able to survive on the internet when somebody says something wrong. Thus this is an immediate feedback loop for me :-)
@bwoebi Good point.
Wes
Wes
@bwoebi is there a way to get in userland the next numeric id of arrays?
nope that is not even needed. is there a way to get the capacity, somehow? just for testing, not needed to be fast
23:44
@Wes copy the array and watch memory usage increase
Wes
Wes
was trying to do something like that
can i guess the actual capacity by looking at memory_get_usage?
yes
$a = $array; $mem = memory_get_usage(); $a[key($a)] = null; $capacity = (memory_get_usage() - $mem - 56) / 36;
(64 bit only)
56 and 36 are sizeof() HashTable and Bucket+uint32_t respectively.
(in PHP 7)
Wes
Wes
uuu, nice :D
Hello guys
@Wes expect to see it break from one minor to the next though.
23:54
How to Can I join into programming and become a sysadmin? I know a few JS and Python, I'm on Linux but I'm not so good. What I could study? I would into world Informatics world etc. What I could study?
Wes
Wes
@bwoebi hum?
@Wes internal semantics of array management, copying etc. changes possibly in future. Like we'd eventually shrink capacity upon copying of arrays.
user924016
@Wes yea I lol'ed hard at that
Wes
Wes
@bwoebi you are already focused on fixing that thing, i'm guessing :P
@RonniSkansing it's totally plausible :B

« first day (2098 days earlier)      last day (3076 days later) »