« first day (2076 days earlier)      last day (2886 days later) » 

2:11 AM
Hmm, I have largely rewritten [copied a few good parts, mostly rewritten from scratch] (only recursive watch handling (recursive creation/deletion) is missing (aka stubs)) watchpoints in two days … Not compiled yet … that's what I'll need day three for … but at least this time I haven't encountered unexpected challenges yet which made the old code a mess (and ultimately being built upon a few flawed assumptions…)
Let me hope I'll be able to finally properly finish it end of week…
 
3:08 AM
is it possible to convert a timestamp that is of format mY to M Y?
For example, 012016 -> January 2016
 
It's possible. Everythjng is possible.
 
3:28 AM
Moin
 
But how
 
3:42 AM
morning
 
'n
 
@DemCodeLines if u don't know java then it's not my problem
 
4:30 AM
Morning
 
Bloom filters in PHP - stuffing an elephant into a hat - http://phpden.info http://phpden.info/Bloom-filters-in-PHP #phpden
2
Been meaning to get this out for a while now
 
5:18 AM
posted on June 22, 2016

New Cyanide and Happiness Comic

 
@Sherif nice!
 
@littlepootis Thanks. Feedback is welcome and much appreciated.
 
5:42 AM
a2 tagged, better late than never ...
 
'nin
 
5:54 AM
hey, mornin @JoeWatkins
 
Guys i am creating database design in which i have 1 password field
so what length i should take for it??
password varchar(500) or password varchar(max)
??
which 1 is more preferable and why?
 
!!docs password_hash
 
[ password_hash() ] Creates a password hash
 
i guess right now we wont be storing any password hash
we will be directly storing password
 
Wes
\o hodor
 
5:58 AM
@Learning positively, absolutely do not do that
o/
 
@FélixGagnon-Grenier alright so what do you suggest then?
 
I suggest password_hash
 
so i will have 2 fields
 
I'm so bad at git ... I just had to delete 7.1.0 release branch and recreate it ...
 
1 is password and another 1 is passwordhash right??
 
6:00 AM
no. one field. containing the hash
 
@Wes I was amused when they finally revealed why Hodor, keeps saying "Hodor"
 
don't ever store any password plainly in a database.
@Sherif amused is one way of living it :p
 
What do you mean?
 
@FélixGagnon-Grenier can you please explain me a little bit on this password hash??
how does this works?
 
I was somewhat touched, sad and emotional
 
6:02 AM
Well, sure the situation surrounding it was sad, but... the irony was amusing.
 
I wonder what the books will tell. afaik the series are now farther then the books right?
 
@Learning it is explained how it works in the manual. you have to be more specific if you got any questions about it
 
Good morning your gorgeous nerds.
 
I got the answer on this question
258
Q: Best way to store password in database

Crash893I am working on a project that has to have authentication (user name/pass) It also connects to a database so i figured i would store the user name and password there but it seems like not such a good idea to have passwords as just a text field in a table sitting on the db I'm using C# and conn...

Thank you guys
 
6:13 AM
mornin' v2
 
Wes
@FélixGagnon-Grenier or not living, as he died :(
 
Wes
poor hodor
 
maybe he actually saved the world
 
Wes
world is that place where everyone lives in except him? :B
i always forget that i shouldn't do stuff in the morning before coffee
 
6:17 AM
I am very grateful that you did not delete these.
 
Wes
i'm tired playing that game
@JoeWatkins are we blaming @Ocramius for typed props failure, right?
have we decided the medieval torture yet?
 
Looking for a fast new PHP 7 framework that doesn't bleed into your app's code? Try #Opulence #php #framework https://www.opulencephp.com
oh look… another php framework… just what the world needed
 
@JoeWatkins How is this getting so many nos?
 
Wes
@Sherif because:
 
This is retarded.
 
6:25 AM
Morning
What was the reason to that nos on typed props?
 
Wes
afaik there's people that don't want the feature at all, and others that aren't voting yes because it doesn't support &$variableReferences
 
i tried to read all that ranting on internals and reddit but can't get it
 
Wes
but i haven't actually followed the discussion
 
so you can't reference typed prop?
 
The hell with references.
Those need to go away.
Why would you need a reference when you have objects?
I see it's pretty much all the "white beards" that are voting no too.
Typical
 
6:28 AM
I guess it is more about consistency, if so, it really matters. Maybe RFC and PR itself needs to polished more.
 
Wes
¯\_(ツ)_/¯
 
We can't get the old stubborn men and women of PHP internals to change their ways...
I would have voted 10x yes if I could.
 
hello can't i load css/js files to codeigniter views as normal
like
<script src="js/jquery-2.2.1.min.js"></script>
 
Anonymous
Yes with absolute path only i think
 
@FélixGagnon-Grenier Oooh, haven't seen ou alive for some time :P
 
6:32 AM
ah, so it's a generation conflict… obviously. and what do these old folks know anyway… they must go away along with all these pesky references
 
@MadaraUchiha this is what I wanted to achieve using actions (the first example on the page): http://chat.stackoverflow.com/transcript/message/31279506#31279506

but anyway I have this same stuff in the project I'm working on for a year
and morning
 
moin
 
@samayo so for relative paths i have to use php echo
ali
 
@Gordon it's not necessary generation conflict, if it not good enough, no need to add more disappointment
but i would really love to see this feature in the core
 
hello friends i have some issue in cakephp project
any plz help me
 
Anonymous
6:33 AM
@Gordon I will release a framework also
 
there was some issue also with static props type
 
Anonymous
Just for sentimental reasons
 
@pinepain I was being sarcastic
@samayo horray!
 
@Gordon damn Poe's law
 
Well, I've been involved in plenty of internals discussions over the years where sometimes all I hear is "no, because we've never done that before", like adding finally or scalar typehints, which turned out to be incredibly useful to have.
I've just seen quite a bit of biased in those votes.
That's all.
 
6:37 AM
sometimes they may be, that's why there are about 40 (or more?) voters
I personally interested in reasons why it's not good, some short tl;dr
but it looks like i have to read whole internals thread
 
Sure, I'm all for dissent, but not consensus.
After all, "if everyone at the table is thinking the same thing, somebody's not thinking"
 
A bunch of people don't want new features added at all, because this makes barrier for newbies higher.
 
@nikita2206 It will, but it will also push them to do better than before.
I believe that to be an acceptable trade off to a certain extent.
 
if you write a language for newbies only more profane newbies will start using it
so yeah, that's not generally acceptable to use low/high entrance barrier as an argument
 
when image field is empty edit time than throw error your data not save
Column not found: 1054 Unknown column 'Array' in 'field list'

SQL Query: UPDATE `she`.`generic_pages` SET `id` = 2, `page_title` = 'TwitterE', `meta_description` = 'Twitter chat on diversity in Hiring & Women In Tech', `slug` = 'womenintech-twitter-chat-on-diversity-in-hiring-women-in-tech', `page_heading` = '#WomenInTech', `page_sub_heading` = '#WomenInTech - Twitter chat on diversity in Hiring & Women In Tech', `is_active` = '1', `image_url` = Array WHERE `she`.`generic_pages`.`id` = '2'
 
6:42 AM
I truly believe that our issue with PHP is that we've opened up the flood gates to all kinds of beginners into the realm of programming, but somewhere along the way we neglected to remind them that this shouldn't be the end of their journey.
 
any one plz help
 
If you think about it... no one is really trying to solve the "educate beginners" problem in PHP.
I mean, sure we've built awesome frameworks, lots of tools, a great community of support, but... we forgot to teach them how to think about the basics.
We simply made it easy for them to get started and then left them stranded in the middle of the road.
 
gd morning..
 
while it goes away from original question about what were the reasons to typed props to be so down-voted, teaching has nothing with particular language
it's more about thinking
 
Yes, that's what I'm saying. We didn't teach them how to think. We taught them what to think :)
 
6:45 AM
for me these typed props was a first step to have short getters/setters as some next RFC
 
@Sherif now you sound like a "white beard"
 
on the other hand there was a PR to optimize simple getters and setters, so Dmitry point is valid from that perspective
 
@Gordon Is that a bad thing in this context? I'm just speaking as someone that cares deeply about the direction of the community.
 
I just like the irony of it :)
 
@Gordon Which irony is that?
 
6:48 AM
btw, does anyone made any benchmarks of real-word apps running on latest php and on hhvm?
 
@Sherif nvm :)
 
Wes
@kelunik @bwoebi i.imgur.com/O4MKgTY.png eyes' shape is ok to you?
 
My earlier statement was to point out that saying no by default is bad. Though I'm not disillusioned that there needs to be some form of constraints to keep the integrity of things.
Perhaps you read too much into my words there.
 
on an unrelated side note: this is sooo useful and nice:
git config --global commit.verbose = true #veryConvenient #git29
 
Hi we can edit woocommerce templates via Theme docs.woothemes.com/document/template-structure in this same how can edit admin views from theme
 
6:53 AM
@Gordon have never used verbose before
what is it useful for?
 
@pinepain it shows you the changes you are about to commit on the commit dialogue
I always use it, because it let's me verify the changes I am about to commit before I commit them
you had to do git commit -v for it. with Git 2.9 you can make it the default
 
Ah, that is useful.
 
i addicted to use git status and when I like what I see i do git commit -m '<commit message>'
but -v is of nice =)
 
Morning
 
I never use git commit -m. Can't provide a useful commit message with that.
 
7:02 AM
why? git commit -m '<title>' -m '<optional description>'
 
I prefere -m as well. But if u want to make sure every file got her own commit message with changes it might not be the best solution
 
@pinepain I like my vim for editing commit messages
also, it helps me keep the git message format constraints
 
I like my vim too =)
that's valid point. I always have to make sure that title is short enough, will give a try to -v option today
 
i want to make php app that remind me every month..like i add one record today and remind me after 1 month..how i can do this?
 
@km8295 try about a crown job ;)
 
7:07 AM
@tra
@Traxstar i have basic idea about crownjob....but any other way?
 
@pinepain make sure you have color enabled though
 
guys, I have a question here, code feedback, any response is appreciated: codereview.stackexchange.com/questions/132705/…
 
maybe u can use time() and a function that got executet by a parameter from a database ? but i think crown job is better solution
 
@Gordon yes, it's enabled, I'm a vim addict when in shell
 
what is a crown job? does it have to do with brexit?
 
7:09 AM
crown job is a somethink like a function that got executet by server on a special point of time :)
 
oh, you mean a cron job
 
yup
 
oh... my mistake :D im sorry ;D to early :D
 
no-no, go on
it was brilliant
 
wut ?
 
7:12 AM
$errorData = [];
$canRun = call_user_func( [ $instance, 'canRun' ], $dataObject, $errorData );
Parameter 2 to WsServer\EventHandler::canRun() expected to be a reference, value given in /devel/juristnet/bin/ws/EventDelegationManager.php on line 122
and the definition of the method is
public abstract function canRun( $data = null, array &$errorData );
why am I getting this?
 
@SergeyTelshevsky Yeah, well, you could have done that
callable takes an arbitrary amount of arguments
But then, how do you pass query params?
POST? Cookies? Files?
 
@pinepain oh, just realized it should be git config --global commit.verbose true - without the =
 
please, anyone?
it's frustrating and I don't get it
 
@Victor because references
 
@Gordon ...?
 
7:18 AM
@Victor Pass &$erroData
 
that has been removed in php 5.3
 
Or better yet, create $errorData inside and return it
 
@MadaraUchiha but I would really like to get this one work with references
 
I don't understand why people like references so much...
It's such a bad thing to have.... an explicitly mutating variable...
 
because that function already returns things
but still. this should theoretically work and it doesn't
 
7:24 AM
@MadaraUchiha I don't, I use $this->getRequest()->getParam('foo');
as it's being set after instantiating
 
@SergeyTelshevsky So...
$router->get("/welcome/:name", function (string $name) {
    return "Welcome to Opulence, {$this->getRequest()->getParam('foo')}";
});
Like so?
 
@Victor no, it shouldnt. quoting manual: " Note that the parameters for call_user_func() are not passed by reference. "
 
I didn't know $this was dynamically bound like that
 
@Victor References of arrays are even trickier than references of variables, because they carry 3 levels of indirection there. 3v4l.org/84v2o
The array itself is just a value. So you have to provide the array with a reference to a variable and then hope that the parameter reference remains.
The issue is... you can easily bite yourself doing this in more ways than one.
 
@Danack i have some issues to compile imagick with php 7.1 (during packaging it for brew), it looks like imagick not compatible with 7.1. Are there a roadmap to make it works with 7.1?
 
7:27 AM
@Sherif this works so fine in C++
 
@Victor You're not programming in C++ though
 
@Victor Yea, well this isn't C++. A reference isn't a pointer.
 
@MadaraUchiha not now, yeah
 
What's wrong with returning the array of error data?
From $instance->canRun()
 
@Sherif it seems just stupid. I should return true if it can run, right?
 
7:28 AM
A reference is actually an indirection of indirection, which means that if you try to use it like a pointer, you are blind to what it is you are derferencing.
 
and an array of errors if it can't
 
@Victor Alternatively
An empty array if there's no errors, and a filled array if there are.
 
@MadaraUchiha yeah that could be an option too
 
@Victor This is why I advice people not to use references in PHP :) They almost always have a false conception of what it is.
 
or you just dont have a canRun but just tell the thing to run and make it raise exceptions if it cant
 
7:29 AM
Then, you can use array_merge() to add it to a higher-level array of errors, if you need to.
 
It's better to use objects in PHP than references for this kind of indirection.
 
@Gordon maybe
 
morning
 
@Gordon That's possible, but it's not always ideal
 
@Victor Yea, that method of error handling in PHP is pretty antiquated. Exceptions can carry previous exceptions now if you want to stack them.
 
7:31 AM
... this day will be a chaos
 
Especially if you have state changes in the run() function
 
@MadaraUchiha in case of my implementation, yes, I've done it so you may use one of: \My\Class\->method(), \My\Class that is being __invoke()'d and anonymous function, which is being $callable->bindTo($object, $object) the predefined object, so $this is available too
 
@SergeyTelshevsky So you have a magic $this where it's not obvious from the example where it comes from and what it represents
 
@MadaraUchiha generally applicable truth about programming is generally applicable
 
but that's not my example :P and does not have anything to do with my codez
 
7:34 AM
is it possible to perform an UPDATE query with multiple columns and values ?
ie: UPDATE client_enrollment SET fname, lname, email, phone
 
@KristianHareland it helps if you mention which DBMS you use
 
MySQL, InnoDB
 
@Wes There's a minor issue, at least on my screen. It looks a little cornered at the center of the red circle.
 
40
Q: mysql update multiple columns

Radu MarisI need to update 2 datetime columns, and I need them to be exactly the same, using mysql version 4.1.20. I'm using this query: mysql> update table set last_update=now(), last_monitor=now() where id=1; It is safe or there is a chance that the columns are update with different time, beacause of ...

 
morning
 
7:43 AM
This question is more about styling in general but since I'm coding in php, I ask here; I have a soap server that throws exceptions to my php client. Should I have one exception class per exception that can be thrown to the client. It feels necessary but also a bit redundant for some reason.
 
@SergeyTelshevsky How would a snippet in your case look like?
From the consumer's perspective?
 
@Victor Why are you using call_user_func there?
$instance->execute($dataObject) would do the same exact thing only faster.
 
Uhm, any of you guys knows what the correct wording for changing the way permissions are displayed in ubuntu? currently they are showed as rw-r etc etc, but I want them as octal, but all I get is guides on chmod or / stat.
 
8:00 AM
@Epodax Yea, you would have to use stat to do that.
stat -c "%a %n" basically
You could pipe in ls if you prefer, but essentially you can't get the octal values directly from ls.
At least, not that I know of.
Why do you want the octal values in your terminal anyway?
 
@Sherif Perhaps poor choice of wording, I'm looking for a permanent way, as when I connect with filezilla, I want it show with octal instead of the chars.
 
"connect with filezilla"?
Can you elaborate?
I mean could alias ls in bash with something like for f in $(ls -a); do stat -c "%a %n" $f; done;, I suppose, but why? Seems weird.
 
Connect to a ubuntu server with filezila (a (s)ftp client, when you view files / folders you can see the name / filesize / type / permissions and so on, in the permissions "tab/column" I want permissions displayed as octal instead of chars.
 
I just don't understand what filezilla has to do with your terminal. I don't use it so I have no idea how it works.
 
o/
 
8:06 AM
I never mentioned a terminal?
I just connected to a clients server and saw that his permissions where displayed differently than mine, so I wondered how it was achieved.
 
mornin
 
@Epodax Oh, OK. I just assumed you were trying to look at it from the terminal, I guess. My bad. Sounds specific to filezilla then.
 
@Gordon I found that too, but I figured that the change couldn't be made in Filezilla but that I could change it on the server :)
 
8:11 AM
Isn't that specific to the way the FTP server is sending the data to the client?
 
@SergeyTelshevsky So yeah, like I said
I have no idea what $this refers to from the code alone
 
@Epodax yes, the server sends the permissions that way. apparently via that MLSD command
 
And neither will my IDE know
 
@MadaraUchiha yes, a bit of magic, but I'm quite forcing a dedicated class for each of the actions
@MadaraUchiha I'm thinking about how to make the IDE understand binding anonymous functions
 
@Sherif changed it
 
Anonymous
8:14 AM
user image
2
 
@Epodax hmm, on second thought. it says client in that post, so its likely not a server setting. what do I know about ftp…
why are you still using ftp anyway? :D
 
@Gordon I'm not, i'm using sftp :D
 
@Epodax which is only a tiny bit better when you can use ssh, scp or rsync or is it?
 
@Gordon Sftp = SSH?
 
@Epodax ssh is to sftp as tcp/ip is to http
 
8:22 AM
@samayo lolwut?
 
@Sherif oh.
 
Anonymous
@Saitama Apple fan probably
 
:P
 
@MadaraUchiha pastebin.com/vPCWaTAh
only way I found to do it
 
@SergeyTelshevsky Yes, but you can't force your consumer to do that :)
 
8:25 AM
gotta look if PHPStorm already supports some annotation to indicate function is being bound to
 
@samayo I call BS
 
anyway, @MadaraUchiha, in case of using Auryn, you can always inject $request right in that method
@MadaraUchiha pastebin.com/wx38KJsC
 
Doesn't htat break your contract though?
 
which? :)
 
That the parameters always match the URL parameters
 
8:29 AM
@Epodax oh wait, sftp… not ftps… go ahead
 
Why would it? It's the other way around, if you use a URL parameter (like in this case {foo}), it should be in the arguments list, the other stuff you may inject as you wish
this is a bit of magic, yes, but keeps you from writing boilerplate code
@MadaraUchiha the dispatching process is dead simple which is deciding on how to execute the $callable Route argument: pastebin.com/ruSvVNDK
 
@SergeyTelshevsky I don't want to have to read your source code to use your library
How many libraries' source codes do you read?
The process might be simple, but is it intuitive?
Imagine the consumer, reading the docs, seeing a few examples
"Params map to URL params, simple enough"
But then you see a Request object out of nowhere
Or a $this that wasn't explicitly defined anywhere
that's what you think about
As a library author, your API must be approachable
 
I understand what you mean, have you seen any project not having any magic, except for, probably, ZF? :D
 
Otherwise, people won't use it.
@SergeyTelshevsky Yeah, it's not that hard
Also, don't compare your framework to crap and say "well, look at all this other crap, I'm going to write mine to conform with the crap"
 
well, it's not always the case, but generally speaking, you're right
 
8:38 AM
@SergeyTelshevsky Why do you think people use PHP?
 
because all the cool kids do
 
@SergeyTelshevsky Hardly
 
because it has this cute elephant mascot
 
Do you think any language feature later than 5.3 contributes to people choosing to use PHP in production?
Generators?
Type hints?
No, people use PHP because it's dead simple, and they can be productive in it in a few hours
People use PHP because you can install a WordPress website in 3 minutes
You want to be approachable, you want people to just install your lib and get productive
And this means that your API must be as predictable and as approachable as possible.
 
haaha, 3 minutes for a wp installation… dude… you suck ;)
 
8:40 AM
Your most basic public API cannot have magic in it.
 
sure, but working as a mover is even more simple and intuitive
 
@MadaraUchiha yes
 
@SergeyTelshevsky Shifting responsibility to the consumer/user isn't a healthy approach to writing software :D
 
Neither is assuming any and every usecase they might have
 
@Gordon I'm not assuming any usecase here
Magical $this is a problem I've been dealing with in JS for years now
It's not fun.
Broken contracts are not fun
 
8:44 AM
@MadaraUchiha I'd argue having to deal with JavaScript is a problem of itself ;)
 
@Gordon And I'd argue the same for PHP vOv
 
this in JS is the most mysterious thing for me...
 
@Saitama The trick is remembering that this is determined by how the function is called, not written
Which is totally bad design, but that's how it is.
 
hmm...
 
whatever.fn() -> whatever is this inside of fn()
whatever.fn.call(somethingElse) -> somethingElse is this inside of fn().
But I digress
 
8:46 AM
...
 
@SergeyTelshevsky something like this would make more sense to me:
(new Route('GET', '/baz/{foo}', $action->handler(function ($foo) {
    /** @var $this \Rig\Control\ClosureController */
    return 'Hello '.$foo.' : '.$this->getRequest()->get('bar');
})))
(Ugly I know)
But at least it's more obvious to what $this is now ($action)
 
@MadaraUchiha actually, this is only a "feature", I never use any anonymous functions inside the routing, I think it's simply not the right place to do. Though it has it's use cases, like making a redirect
 
lunchtime, bbl
 
lata'
 
Anonymous
@MadaraUchiha or this.
 
Anonymous
8:51 AM
$app->get('/bar/{:foo}', function() use ($app){
    echo 'Hello '. $app['request']->get('bar')
});
 
You may always do a new (new Route('GET', '/doge', ['\App\Controller\Test', 'dogeTest'])) and rewrite it there, but about your suggestions, would new \ClosureController(function () { $this->getRequest('doge'); }); be understandable/
@MadaraUchiha
@samayo ServiceLocator detected
as I mentioned earlier it's possible to inject request as the parameter straight away
25 mins ago, by Sergey Telshevsky
@MadaraUchiha http://pastebin.com/wx38KJsC
 
Anonymous
It's optional. You can inject the dependencies via use(App\Request $request)
 
how to implement priority for items in database while retrieving
 
@astrosixer priority? do you mean ordering? SELECT foo from table ORDER BY some_column
 
why do people still use asp.net when php is so much easier to understand
 
9:00 AM
@Gordon its okay but how do we do when same priorty comes?
 
9
Q: How mysql order the rows with same values

atikingIn my database I have some records where I am sorting by what happens to be the same value: | col1 | timestamp | | row1 | 2011-07-01 00:00:00 | | row2 | 2011-07-01 00:00:00 | | row3 | 2011-07-01 00:00:00 | SELECT ... ORDER BY timestamp It looks like the result is in a ra...

 
9:14 AM
@C.oast I am still waiting for the punchline
hmm, none coming apparently.
!!dad
 
Dad, can you put my shoes on? I don't think they'll fit me
 
hahaha
 
!!dad
 
Why did the scarecrow win an award? Because he was outstanding in his field
 
huehuehue
 
9:33 AM
hyuck hyuck hyuck
 
!!chuck
 
Chuck Norris can taste lies.
 
hey
can someone here handle twig ?
 
jeeves can
 
@Jeeves
are u here ?
 
9:51 AM
Are any of us really "here"?
 
Wes
maybe. or maybe not
 
:D
 
@Fabor lol
 
Morning.
 
can i use 3 fields at a time along order by
in mysql
?
 
9:53 AM
Have you tried to do so?
 
Yeah, case of TIAS ;-)
 
mornigns
 

« first day (2076 days earlier)      last day (2886 days later) »