« first day (1770 days earlier)      last day (3406 days later) » 

10:00
sigh
What a stupid thing...
it's build into phpmyadmin
What's with the stackoverflooooooow logo on the main site?
@PeeHaa just dump and migrate it to postgres
but still stupid, yeah
10:00
@DaveRandom 10kk crappy questions
@Amelia lol
this sounds like the safest way
just for the record, for big data this takes a lot of disk space an IO, so you can do on the fly with: mysqldump old_database -p | mysql -D new_database -p or similar (you need to create an empty database first create database new_database) — Pablo Marin-Garcia Sep 29 '10 at 15:49
@PeeHaa job done
10:01
@FlorianMargaine no; rename the tables is the safest way
@FlorianMargaine Yeah was about to do that. Was just hoping mysql becaome less retarded suddenly
you can move them while renaming
@Sjon I'm pretty certain that not using MySQL is the safest way
lol ^
10:01
RENAME TABLE current_db.tbl_name TO other_db.tbl_name
ah, I see
indeed, pretty quick with a small script.
hands up if your git fu is really strong ?
@JoeWatkins unknown question cannot be answered because unknown
I need to move some stuff ... I'm scared ...
Define "move"...
I wanna move master to five branch and use seven as master
(there is no five branch, I wanna rename it)
I'm so bad at git ...
10:12
On your local clone?
no I want it like that on github, and locally, but on github
OK well "rename" a branch is as simple as check out master head and git checkout -b 'new-branch-name'
Step 1 is don't do that.
@JoeWatkins git branch -m, push it and then change the default branch on GitHub?
(which is effectively just copying it)
@salathe also this
10:14
@salathe ok, why not ?
Because having differing main branch configurations in forks does very little except increase cognitive overhead when merging upstream
@kelunik I dunno what you just said, you underestimate how bad I am with git ... one time, I deleted a whole branch of php on git.php.net ...
11
oh bugger
but but .... about 4 people have done that ... ever ...
@JoeWatkins X/Y check: what is the actual high-level goal here?
@JoeWatkins you need the git-fuck-everyone plugin to rename master :p
i.e. why do you want to do that?
@Amelia Yeh I believe that the -f option is short for --fuck-you
5
git halp
10:18
well first, because master php-src is 7, so I wanted it the same, and also because ... this might be a bit silly ... I'm allowed to work on whatever, as you know, but, the graph on github doesn't show contributions from anything other than master, so for the last few months I been working my ass off on github but you only know that if you go clicking around, if you're someone really high up who doesn't know how github works but looks at my profile page I look lazy and I get in trouble ...
@JoeWatkins stackoverflow.com/a/6591218/2373138 is what I'd use, after you renamed both, you can push it and change the default branch setting on GitHub.
@DaveRandom in most cases I would say, -f is a shortcut for --fuck-all
@Joe if it's really only 4 people, and you're happy that they'll be clever enough to deal with the branch changes, go ahead. :)
Anyways, unless you want to force push, rename the branch branch to a new one.
@JoeWatkins I'd imagine it shows the default branch rather than master, just change that. Nice and simple meta-change that's easily revertible and uncomplicated
At least it's worth a try since it's not dangerous
10:19
I tried the default branch thing on apcu
Fucking markdown.
I had a simplify branch and every single pr got fucked up and I broke it so many times because of that ...
but I guess it might be premature anyway
> Changing your default branch can have unintended consequences that can affect new pull requests and clones.
how is that better though ?
(github shows you this when you try to change def branch)
Well I just suspect it would solve the github UI issues
I'm not certain it would
But anything that avoids fucking with the history has to be better
The issue is that forks will not have their default changed, so when they pull request, they will instead assume their default is your default
you would just need to manually specify branch instead of letting github do it for you
@Amelia Yeh if you aren't checking that anyway then I don't want your PR
10:23
yeah, that'll do
thnx every1
Also since nothing in php-src is merged via the github UI it doesn't actually matter, people change the target branch at merge time all the time
@JoeWatkins Give it a day or two to let github UI update (probably has a bunch of cached stuffz) and if it doesn't work then change it back
it'll start counting now ...
I think the PHP constant 'INF' is not really intuitive ;)
But that said, the upstream master will presumably be changed pretty soon
I think it'll start now, that's okay, I already explained what had happened and told them to go digging ...
10:30
I need to store all event in the database (like SO: +5 rep for question up vote, -2 rep for question down vote, +10 rep for answer up vote and ...)
there is any recommended structure for that table ? (named Log)
@Sjon Yeap works fine.
@PeeHaa top!
@Sajad post_id, user_id, score
You then calculate overall score by aggregating over Sum(score)
@DaveRandom do you know what I want ? a table for storing all happens ...
Achievement Unlocked: The Drunkening
I need a sign with this on to take to parties
Abe
Abe
10:35
@chozilla ?
@Sajad What you want, presumably, is something that will let you do:
SELECT post.*, Sum(post_events.score) AS score
FROM post
INNER JOIN post_events ON post_events.post_id = post.id
WHERE post.id = ?
GROUP BY post_events.post_id
Apache Solr Attachments Java executable not found Could not execute a java command. You may need to set the path of the correct java executable as the variable 'apachesolr_attachments_java' in settings.php
(That's pseudo-code btw, most RDBMS won't let you do that directly, although MySQL will)
can any one help me with above issue?
@MedojuNarendar I do not have that problem in my code...
@Abe did you understand it?
10:41
so what's going on with pecl and php7 ?
cc @salathe ?
@DaveRandom aha, I got it, but actually I need to tell to the user each +5/-5/+10 are for what ...
I neet to tell him the reason of each reputation
that moment when google analytics breaks your stylesheet
guys , can any one help me with below isssue.
Apache Solr Attachments Java executable not found Could not execute a java command. You may need to set the path of the correct java executable as the variable 'apachesolr_attachments_java' in settings.php
I solved the Gruntfile.js problem: forever! watch -n make
You couuld also add an event_type_id to post_votes which relates to a post_event_types table (which has events like upvote, downvote, accept etc)
post_votes is a purely relational table though, it only holds references to other tables, the only "true data" it holds is the score change cause by the event
10:55
@JoeWatkins E_NOT_UNDERSTAND_THE_QUESTION
don't keep a tally of the current post score in the DB (at least, not at first), you just keep a history of the events and calculate the overall score when you need it
Eventually you'd probably want to keep the result of this cached, but for initial simplicity don't worry about it
@salathe I guess it depends on pear, but there is no way to package php7 pecl extensions ?
@JoeWatkins, You are the author of pthread?
Do you know laruence?
(pthreads) yes and yes
admire you!
11:03
function add_nu(){
$one='';
$one.=$this->num1;
$two='';
$two.=$this->num1;

$res=$one+$two;
echo $res;
}
Anonymous
unbelivable
why it is necessary to declear variable $one as empty..
otheriwise it shows undeclear variable one as undefine
@DaveRandom very - very - very thanks :-)
@JasonYoung /me blushes :)
@SajjadKhan Because the language wouldn't know such a variable exists..
You can just do $one = $this->num1;
11:07
@SajjadKhan where are you from ?
@Sajad sqlfiddle.com/#!9/0ff1bc/2 might be a bit closer to what you want - not as over-simplified - note that in that example the ORDER BY doesn't actually come out quite right because they were all inserted at the same time, but you get the idea
but why it is declear $output as empty as what i learn upto now it is not necessary to declear variable first then use in php @HassanAlthaf
@DaveRandom yees ! this new fiddle is much better, But I did not get your point about ORDER BY, should I add it in the query ?
@SajjadKhan I don't know. Probably you're trying to add two strings.
@Sajad you're Question make's me little bit scare.. well from PAKISTAN..
11:09
Hey. can someone help me with a PostgreSQL array? I need an array with the following scheme: db_konzerne = array[all entries from DB]; (nr = pk, knr, name)
@SajjadKhan which question ?
@HassanAlthaf yeah but when i add two numbers i didn't declear the $res variable first
wher you from @Sajad
@SajjadKhan :-) your name is the same with mine !
I thought you are Iranian !
@Sajad No I'm just saying that because the timestamps in the post_votes table were auto-generated by the DEFAULT CURRENT_TIMESTAMP clause they are all the same, which means that ORDER BY clause on the second query doesn't have the expected result. With real-life data (where the timestamps would be different) it would work properly, it's just that the demo data doesn't quite do the job.
11:11
Good night gusy.
Variable ko initialise karne ki koi zarurat nahi
I assume that when inspecting the event history you'd usually show them in chronological order
Dekh, thera function aise bhi chalega: @SajjadKhan
yeah it also surprise me when i first saw you name.. Feeling happy :) @Sajad
@DaveRandom aha ... got it, tnx
11:12
function add_nu() {
    $one = $this->num1;
    $two = $this->num1;

    $res=$one+$two;
    echo $res;
}
@SajjadKhan ;-)
@SajjadKhan Thera function aise bhi chalega.
Par mujhe tere variable $this->num1 par shak horaha hain. Agar $res variable not defined araha hain tho phir mujhe lagtha hain ki $this->num1 undefined hain.
@HassanAlthaf While we absolutely have no problems at all with you speaking your own language, please keep this room in English to ensure it's accessible to as many people as possible :-)
@DaveRandom Alright. :P
If you want to chat in another language, feel free to create another room for it :-)
11:14
Yeah, sure. I thought no one is active here.
Damn, the HTML room is being raped by game chat.
-__-
@HassanAlthaf yeah its works and feel happy when talking to local person.. well create a room where we chat in local language.. Kyun Hassan sahb.. :P
@SajjadKhan I'm not Pakistani. I just know Hindi.
Is there none who can help me with this simple array?
@sguetsch Sure, tell your problem.
need a PostgreSQL array with the following scheme: db_konzerne = array[all entries from DB]; table konzern =(nr(pk), knr, name)
11:17
@HassanAlthaf then English is best communcation bridge..
I'm from Sri Lanka. :P
But I'm kinda confused as i only slept 2 hours and can't think clearly anymore
@HassanAlthaf what does this mean $one.=$this->num1;
you remove the . sign
@SajjadKhan In other terms, it means, $one = $one . $this->num1;
and sounds good what about the score
11:18
What do you mean?
What score?
@sguetsch "Postgre array" is kind of ambiguous. Do you mean would want a vector data structure within postgres, or are you just talking about how to construct the result set you want?
so why we concatenate $one with this
Because you did it.
You don't need to concatenate $one with the other variable.
Because $one initially doesn't have any value. You can directly assign the value of the other variable.
In other words: I need an array, that contains all entries from the table and have to use Postgre functions
So I can use it as a index for the next functions
@sguetsch You don't make sense
11:21
@HassanAlthaf thanks alot
@SajjadKhan No problem.
@sguetsch I'm really not sure what you mean. Sort of sounds like you are talking about doing WHERE field NOT IN (SELECT id FROM ...) ?
(which is usually a horrible thing to do, btw)
@Sherif Wow, creating a php.net link is true commitment to the cause, I don't think even @salathe has gone that far before
@DaveRandom I want to remove post_vote_types table and add a new column in post_vote table named type, is it fine ?
@Sajad Yeh no issues, you need to set the schema up how you want it, that was just intended as a demo of some of the basic principles, obviously it will need adjusting to fit your needs
@DaveRandom alright :-)
@DaveRandom I have a question, its answer is just one word:
11:37
onions
Is that the right word?
:-) wait ..
Is it better to I add a new column in the Post table named total_votes and update it via TRIGGER OR I use SUM() for calculating the number of total votes for each post, TRIGGER or SUM() ?
I wouldn't worry about this for now. As a general rule triggers are not the right answer to any question (not absolute rule but there's usually a better way), and doing the Sum() is not going to be too expensive until you have a lot of traffic
In other words: don't optimise something before you know it needs to be optimised
TL;DR just use Sum()
Can anyone help me with MySQL UUID()
Concentrate on getting the indices right before you worry about caching
@RajithaBandara Not until you ask the actual question ;-)
@DaveRandom Ok :-)
11:45
@DaveRandom yes. Just want to know how much unique that mysql function. Can i use it for a ecommerce app frontend?
@DaveRandom To identify products & related. I hope to use external field as uuid instead of auto increment primary key considering security.
Exposing the primary key to the user is NOT a security problem!!
I really don't get why people think that it is
it's just a fucking number
Sorry, this really pisses me off
UUIDs are almost always a pointless over-complication
@RajithaBandara Security: you are doing it wrong
You don't need 128 bits of entropy
it is a security problem if you're not checking permissions
e.g. user deleting his article by ID and there's no check if it's actually his article
I seriously doubt you need 3.4e38 records
(yes I did have to google that)
11:51
@DaveRandom in the most applications you can send a person a "deep-urls" that change stuff around. That is why you usually obfuscate IDs for every user individually. an other way is to add checksums per user.
@DaveRandom they are actually a very good simplification
@DaveRandom Possibly comes from attempting to prevent id-increment attacks
auto_increment introduces a lot of problems that are non-performance-related
yes. of course I have implemented proper auth & privilege checking.
such as people starting to rely on auto_increment for other stuff
11:51
@Ocramius such as?
or the fact that you can't build referential integrity until the data is actually stored in the DB
sorting. People sort by identifier and give the identifier a meaning it shouldn't have
@Ocramius this is the only solid argument I've ever heard
but overall, being able to assign an identifier before the DB record exists is a HUUUUUUUUUUGE advantage
@Ocramius I get that you like defensive programming, but at some point you have to chalk some things up to idiocy and start firing people
11:52
and I agree, nothing to do with security
@DaveRandom no, because people are the hardest thing to find. You will need also the idiots
Anyway, in general, $this->id = UUID::uuidv4() is much better than $this->id = last_insert_id()
it also doesn't make a mess in your transactional scope
so yeah, use them, use them a lot. They are actually MUCH simpler than auto_increment.
@Ocramius I'm still waiting for a real example about how this is an issue
@FlorianMargaine it is not an issue, it is a domain misconception
people attribute a domain meaning to something that is a technical implementation detail
the fact that a UUID is random prevents you from doing that
and it prevents stupid people from writing stupid tests that make assumptions on sequence behavior
(those tests break if you have something as simple/stupid as parallel behat test runners)
so yeah, UUIDs :P
.. that still doesn't give me a reason. Stupid tests are always stupid anyway...
11:56
What is a UUID?
note that QAs usually don't have a strong technical background: they will write such shitty tests.
@Ocramius I'd still be more comfortable with something that fits inside a single CPU register though, otherwise you'll end up with a lot of stringly-typed comparisons of things which are essentially numbers
What is a Test?
@chozilla It's something other people do
@DaveRandom when they love each other? or was that an other thing?
11:57
@FlorianMargaine stupid code spawns from stupid decisions. auto_increment is a stupid mysql decision upfront. My production environment may have a different increment than your local machine and you'd end up breaking things anyway
@chozilla No, usually when they hate themselves
@DaveRandom meh, this is over-optimisation for no good reason. If you don't end up having that many records anyway, this is not a problem
you are not going to die for a 4 byte identifier
@Ocramius I'd like to have another argument than "it's stupid"
sorry, but I still don't see a valid reason in your rant
@DaveRandom string comparisons are fast enough so long as the strings don't have long prefixes that are the same, surely.
Actually, i don't mean to use uuid as primary key, yet another field. Internally, uuid maps to auto-incremented primary key.
11:58
@FlorianMargaine the argument is that you CANNOT make predictions on a generated identifier, whereas you can do them on auto incremental identifiers
@Ocramius why is that an argument?
@RajithaBandara Don't give things two identifiers, that's not going to end well for anyone
and that you can handle identifiers pre-db-transaction-existence
@FlorianMargaine Having to do a round trip to the database means that your objects exist in an invalid state in your code, until that round trip is done. By using an on CPU ID it means you can create your objects in a valid state.
No invalid state possible == no bugs from invalid state.
@FlorianMargaine oh god, I just explained why: you prevent any assumptions
assumptions are not stupid. Assumptions are something that actually comes from intelligent deduction/observation/reasoning
assumptions are a bad thing tho, because they break in edge cases
but yeah, the strongest point is being able to build referential integrity pre-db
or pre-allocate identifiers before creating records (example)
like "oh, you wanted that? yeah, I'll create it for you. Meanwhile, here's an ID to use later on"
12:02
I get the argument... I just can't see any use case. I may be biased because I've used auto_increment/serial since forever and never had any issue with it :/
@FlorianMargaine pleased to hear that.
@FlorianMargaine do you design your domain with or without the DB?
I design without the DB in mind, and many things simply cannot be done with auto_increment
or not with an intelligent way
@Ocramius I design the db first tbh..
yeah, I stopped doing that ages ago
12:08
Why do you guys always discuss personal preferences?
posted on August 21, 2015 by kbironneau

/* by MonsieurLeMarquis */

2
@chozilla not a personal preference, but actual design issues
The more I work close to complex business domains, the less I see DB-first being effective
Funny how with more experience I finally took the opposite path
@chozilla Because some people think their personal preference is the one truth
But clearly it's hard to prove
12:11
Well, I'm in the DDD mindset
it is very hard to express domain knowledge in data, since domain knowledge is usually about interactions
@Ocramius one year form now you will notice that DDD is not only one view on an application and that you have to change your view many times to find out what is best.
Then you understood it wrong already
"is only one view on an application"
that's exactly what DDD should NOT be
@Ocramius the data is what ends up being the real thing tho. What if you assign an uuid, then the transaction to create it fails? e.g. you've started sending the uuid to other things depending on it...
> What if you assign an uuid, then the transaction to create it fails?
@Ocramius I added a "not" there
12:21
like any other transaction
the rules about two-phase-commits don't change just because you use UUIDs
then the data is still your reference
so what's in the db is your reference
Since everyone here talks like a Guru who has seen the truth, I might as well start sounding self confident, and tell you that "Entity-System constructs are the best!".
@chozilla In other words, you've started using Laravel and tried the Koolaid
@Ocramius what I mean is that an object is invalid as long as it's not stored in the db anyway
@Machavity no never used a framework.
@FlorianMargaine that's a massive fuckup
that is a basic OOP violation, tbh
@Ocramius why?
the data in the database is the reference
no matter what you say about OOP, this holds true
No, the database is just storage. The only thing it guarantees is persistence of whatever you're working with
what you are working with is not the database, but a transaction
and the transaction contains different datasets that are invalid until persisted? meh.
@Ocramius that's the point of a transaction, yes
anyway, the impedence that I see in the discussion is that the interactions in your logic are at db level
and no, a transaction simply guarantees storage of valid data, not of invalid data
12:30
some logic has to be at the db level, yes, the one about data integrity
that's not logic, that's just integrity
integrity is a non functional requirement
You can code the same logic on a series of CSV files with obvious non-functional-requirement violations
but the app would still work.
@AlmaDo Isn't that a rooster?
It's a cock...
(never been sure if there's actually a difference)
12:35
@Ocramius we have a fundamental difference, I think. Your reference is the application. My reference is the database.
@salathe \o/
E_NEEDS_"7"
Yeah totally
@FlorianMargaine yeah, I can't really synthesize why "DB first is wrong" in a single day, I think
Would probably require me to go back to the past 20 projects over the last years
12:39
@DaveRandom Hens can have combs too
@FlorianMargaine data-driven development leads to very tight coupling between data across multiple datasets
how stackoverflow know a notification is new for me ? and when I read it, then It hide ?
it's the same as the Demeter law. Any time you cross more than one table in an operation, you are building a potentially impossible-to-disentangle operation
@FlorianMargaine "tables", if that helps
In some projects we even got to a point where the DB is just a transactional-safe cache
and we just exploit it to make serialized transactions
Transactional-safe cache?
12:45
Yes. We can scrap and recreate the DB any time. The DB is disposable and mostly used for some reporting operations.
Where do you store your data?
a log
basically the same thing as event sourcing
just not so formalized (yet)
that doesn't sound very relevant to the current discussion...
@salathe I have been throwing money at the screen, but nothing is happning?
2
@salathe want :(
12:47
Is it broken?
@FlorianMargaine it is, since the entire app uses the DB just to check if things exist rather than doing any business logic with it
@PeeHaa I don't know, keep throwing money.
Will do
You cock
The point is that building such an app DB-first would have been our grave from a domain perspective: impossible to change anything in the domain, ever
also incredibly difficult to provide a data structure that fits all needs
is terminal in php strom working fine with windows 10, mine is loading too slow even take forever
12:49
whereas we simply duplicate data into multiple tables to fit whatever we need for reporting
@Ocramius sounds like you're preaching for mongodb ;-)
Not really, but I'm saying that the storage is little relevant as long as it is reliable
so yeah, I'm absolutely not preaching MongoDB :P
I promise that's not a Blackroll
@Andrea Needs more cowbell
@Machavity heh

« first day (1770 days earlier)      last day (3406 days later) »