« first day (1823 days earlier)      last day (3118 days later) » 

Anonymous
11:00 AM
@Patrick Just curious, are you writing a book based on the no-framework-tutorial?
 
@samayo More theoretical, but I was not able to find any time the last few weeks for that
 
@Patrick Just out of curiosity, and since you say English isn't your first language, do you think it would help to use less words and more pictures to make your point? For example (and this is totally off the top of my head so forgive the crudeness and inaccuracy) a flow chart to more accurately make the point "should I use a framework or not" instead of a long-winded paragraph? i.imgur.com/2F1T3DS.png
 
someone a good reference how to implement MailChimp in a PHP application?
 
11:15 AM
@Duikboot "Implement it"? You mean you want to make a MailChimp clone?
 
I mean I have to add users to a mailchimp list.
 
I don't understand where PHP comes into play here?
 
@Sherif Convincing people to use a framework or not seems outside the scope of the tutorial.
 
@PaulCrovella Who said anything about convincing? You are providing useful information to help them make an informed decision.
 
however you want to dress it up, it's outside the scope
 
11:18 AM
huh?
 
there is a word: "abcmwgwerfabcgead"
in the above word, there is two "abc", one it the first of the word, and one in the middle of the word, Now I need to replace *just* first "abc" with "Q". is it possible ? (I think it is possible using REGEX)
 
Dress what up?
 
"useful information to help them decide" or "convince"
 
@Sajad /^abc/?
 
@MadaraUchiha wait ...
 
R.P
11:19 AM
preg_replace has 4th parameter: limit
 
How is that dressing anything up? Providing useful information that helps you make an informed decision would be dressing it down, because you are deconstructing a complex problem and providing a framework in which things can be made either true or false.
You seem deeply confused about how to help educate people in tech.
 
@MadaraUchiha yes, very thanks
 
Telling people "Here's a tutorial that teaches you how to not use a PHP framework..." would be the epitome of "dressing something up".
 
@Sherif Have you ever not been a dick to someone just because they disagreed with you?
is there anyone you don't feel entirely superior to?
 
@PaulCrovella LOL, how am I being a dick?
 
11:23 AM
@PaulCrovella @Sherif is always cowering beneath my greatness, he makes up for it by acting this way to everyone else. :)
 
oh good, at least there's one person
 
@R.P also yes, I think it is also good: preg_replace("/abc/","Q","abcmwgwerfabcgead",1);
 
R.P
@Sajad - it is useful, when abc is not at start of string. Otherwise Madara suggestion is better (no need for redundant variable in preg_replace call).
 
@R.P you are right
 
user1648409
Hi, when using PHP Slim, shouldn't i be able to access test.php/mygetrequest, when using something like
`$app->get('/mygetrequest', function () use ($app) {
echo "hello world";
});`

Or do i miss something here?
 
11:28 AM
Forget it. Trying to have a constructive discussion with some people in here is more painful than trying to stick a hot needle through my eyeball and pull it out of the back of my skull without suffering certain death.
 
@PeeHaa downvote that crap :P
 
morning's
 
11:42 AM
we need one more close-vote to start deleting
 
@tereško what do you mean of "turn it off/on" ?
 
@tereško ha ha ha ...
 
11:50 AM
what are these short form's stand for cv-pls, delv-pls?
 
@AnmolRaghuvanshi see the "meaning"
 
I have a question though I cant try it right now .. how much time it will take to zip a folder containing 63GB of images
 
yeah thnks PeeHaa, tereško
 
if anybody have any idea?
 
11:57 AM
@John just try it
and see how much time it takes also please let us know so next time we will answer similar question
 
and how can I delete such huge folder on Linux server?
 
rm -rf foldername
 
that is not working... :(
 
sudo rm -rf foldername ?
 
saying that large no of files kinda error
 
11:58 AM
sudo rm -rf --no-preserve-root
 
@PeeHaa are you sure it will work. 100% ?
 
42
Q: Efficiently delete large directory containing thousands of files

TobyWe have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something like: find /path/to/folder -name "filenamestart*" -type f -exec rm -f{} \; This works but is ve...

 
1 min ago, by John
that is not working... :(
what exactly is the error message?
 
@tereško saying that large no of files kinda error
 
@John can you show us exact error?
 
12:01 PM
@John that is definitely not the error message because it's not even in english
 
@NullPoiиteя Right now I don't have that one.Let me find it..
@tereško ohh common this is not about good english or bad english..
 
it is about having the real error message
 
No it is about
> Questions seeking debugging help ("<b>why isn't this code working?</b>") must include the desired behavior, a <i>specific problem or error</i> and <i>the shortest code necessary</i> to reproduce it <b>in the question itself</b>. Questions without <b>a clear problem statement</b> are not useful to other readers. See: <a href="http://stackoverflow.com/help/mcve" target="_blank">How to create a Minimal, Complete, and Verifiable example</a>.
 
@PeeHaa (y)
yes find it... "argument list too large" error.
 
And that's why people told you to get the actual error message
How the fuck are you deleting the directory?
(also missing info)
 
12:08 PM
I have also tried .. find -name "*.jpeg" -size +1024k -delete
 
Let me try again:
1 min ago, by PeeHaa
How the fuck are you deleting the directory?
 
@PaulCrovella @Sherif I think I'll leave the convincing people out of the tutorial. It should be a how not a why. Personally I am biased against frameworks, but I would like to leave my personal biases out of the tutorial as much as possible. I think it has value for people who use a framework too
 
@Patrick Don't worry, you're doing great with that, keep it up, no need to change anything
 
@John what command exactly were you running when you saw that error message?
 
12:20 PM
@John just keep staring at terminal after a while terminal will get scared and delete that folder.. simple
 
 
haha chuck noris can do that
 
@Patrick I think you'll find that you're putting far more of your biases in than you're leaving out. What I'm suggesting has nothing to do with convincing people one way or another. To suggest that I convince you of something, is to say that my goal serves reaching a single outcome (which is a biased). Instead my suggestion is targeted to create multiple outcomes that do not derail from topic (which is completely unbiased).
There is a way to help people make smarter choices about software design and it's not in the how, because there is always more than one how and people will never agree completely on a silver bullet. However, there is a way to reason about which how makes sense and why, but without that why it's impossible to reason.
 
so .. how is that book of your's coming, @Patrick, which teaches people to make the "smart choices" ?
 
12:40 PM
@AnmolRaghuvanshi noop its too easy task for the chuck noris :P
 
:P haha
 
@Sherif It's a tutorial about how to do something. I am not trying to convince anyone to drop their framework. All I am doing is showing how you can make things work without one
 
@Patrick Right, I get all that. Again, what I'm suggesting only helps further your cause not hinder it.
 
12:55 PM
@Patrick Top-tip - if you ever want to "win friends and influence people"‌​, do the exact opposite of what Sherif says.
> Carnegie says you can make someone want to do what you want them to by seeing the situation from the other person's point of view and "arousing in the other person an eager want." You learn how to make people like you, win people over to your way of thinking, and change people without causing offence or arousing resentment.
 
hi plz help me

RecordRTC for safari
audio video recording through webcam using php
 
@Satyam I doubt anyone here has experience of that. There appear to be lots of results from google - e.g. github.com/aojsamurai/…
 
@Danack Hey that reminds me
/me searches github
ha! github.com/PeeHaa/ScreenCast I felt sooo leet doing that :P
 
yeah, no way in hell I trust that demo
 
@Danack not for safari
supported
 
1:08 PM
> If you want to build a ship, don't drum up people to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea. - Antoine de Saint-Exupery
works for getting your fence whitewashed too
 
inb4 claims of racism.
 
it was a different time
 
1:26 PM
@tereško rm -rf *
@NullPoiиteя haha okay..
 
@John Go into the folder and do a ls -la because rm -rf doesn't grab hidden files (i.e. .htaccess) by default
 
@JoeWatkins actually, yes. But only as long as you don't have to be highly concentrated for a particularly difficult problem.
 
@bwoebi it's possible... there's always time for peanut butter sandwiches
 
Abe
 
1:42 PM
@John that command don't return such error
 
R.P
stackoverflow.com/questions/2776107/… - anyone got better solution that accepted answer?
 
hey, can i sort by 2 values? i have this function
usort($doppelt, function($a, $b) {
return $a[$a['descript']] > $b[$b['descript']] ;
}
And want also sort after $a[$a['hash']] within the range of the first sort. any ideas?
 
@tereško it can (or rather something very similar) - a good explanation is at stackoverflow.com/a/18647755/3942918
 
@R.P choosing a better data structure than you're currently using.
 
I've hit it before and used find and xargs to work around it
 
And no, I don't know one. Asking on programmers.stackexchange.com for good storage structures for that type of data would be appropriate.
 
@PaulCrovella You only get that when adding a filter to rm right? Instead of just deleting a directory?
 
@Danack What does this need more than a map?
 
@NikiC I don't know the askers requirements. Presumably there is some logic behind having the sub-arrays there....so presumably they also want to be able to search for picture ?
 
@PeeHaa You get that with a glob that expands to a way too big a list of arguments - it's not confined to rm or any particular command
 
1:52 PM
And I suspect that there's no restrictions on duplicates within the sub-array.
 
will zend help you find work?
or because it's 2015 no
 
any of you got a hhvm installed and can give me a sample output of hhvm --version? cannot be bothered to install one right now
 
$ hhvm --version
HipHop VM 3.9.1 (rel)
Compiler: 1441809762_N
Repo schema: 79bd392a8bb184343911b46fdcb46fd76e5de4cb
 
thanks!
 
No problem.
 
1:57 PM
hhvm needs a sugar hill gang easter egg
 
@PaulCrovella Yeah so OP just need to do rm -Rf /dir rite?
 
R.P
@Danack -> imagine that there are incoming documents that always come with same prefix. Now I need to know they're type without looking into them (because document type information is not received). I could make a config array that these prefixes are PDF, these DOC etc. Therefore $types = array('PDF' => array('pdf_document_', 'signed_file_')) instead of having 2 if or conditions [ if ($a || $b).
I also could create separate array for PDF and DOC, but in that case readability worsens. Any suggestions other than they sending us information about filetype?
 
posted on October 13, 2015 by nlecointre

/* by enig */

 
@PeeHaa that would avoid the arg list error, yes. there are some tricky ways to delete large numbers of files much faster than what that'll do, but I won't advise them for random folk who would run them (or slightly wrong versions of them) without appropriate care.
 
any problems with this answer? stackoverflow.com/a/27356329/998328
 
2:07 PM
good morning
 
about to throw a bounty on it since it seems exemplary
morning :)
 
@R.P Either I've have a stroke, or just not enough coffee, but I can't even. As I said, I recommend asking on programmers.stackexchange.com
 
@CarrieKendall LGTM
 
@PeeHaa sweet, thanks for looking it over :)
 
np
 
Abe
2:18 PM
guys, do you know if < > <= >= == comparison operators are reliable when used on DateTime instances? using php 5.6
 
@abe they are
 
I would not like to place money on that bet. I mean, it would be reasonable that they would be.....on the other hand I can't see how that would work.
 
@Danack internal operator overloading?
@Danack in particular wiki.php.net/rfc/operator_overloading_gmp no that's unrelated.
 
Abe
@shadowhand seems working. since php 5.5
 
2:28 PM
cool, fair enough.
 
@Sajad We are back to this... if you need to do something conditionally then use if statements... performance is not the reason to eliminate if statements and the techniques used to eliminate the if's can actually have a negative impact on performance.
 
Good morning
 
2:43 PM
@ScottArciszewski github.com/paragonie/random_compat/issues/5 This seems somewhat ridiculous
I especially liked how Tom declared rdrand to be universally insecure because a hypervisor could feed it rigged data
 
where did he say that?
 
@ircmaxell The referenced Yii issue: github.com/yiisoft/yii2/issues/9879
 
Anonymous
@ircmaxell o/
 
If I have a method that doesn't access any properties of the object, but only uses other public methods of the object, does it make more sense for that method to just be a function in the namespace? For example, I have a Stream::pipe(Stream $stream) method that could easily be Stream\pipe(Stream $from, Stream $to).
 
@trowski seems like a sane approach if you can eliminate any autoloading issues (like sidecar it in with the Stream definition)
 
2:52 PM
0
A: What is the correct way to perform lock file (for having critical section purpose) cleanup

Joe WatkinsThe question is tagged with multithreading, so I'm going to answer the question in the context of multi-threading with pthreads. First, a little bit about file locking. The PHP manual fails to fully explain what an advisory lock is. Taken from the man page for flock flock() places advisory ...

me, saying things ...
morning new peepz
 
@Orangepill Composer takes care of the autoload issues.
 
@Trowski I think in PHP it is preferable to keep it as a static method rather than a free function
 
@Trowski true
 
@JoeWatkins New? You mean between 7:00 AM and 2:52 PM :)
Morning joe
 
I was doing work
 
2:53 PM
@NikiC Right now I have it in a trait that is used by any class implementing the stream interface.
 
@Trowski Okay, that's getting weird
 
I was around, cv'd some questions and what not ...
 
It's not really a class specific method so much as a interface specific method, if that makes sense.
 
@JoeWatkins Ah good good :)
 
In that case, I'd prefer a free function over a trait method
 
But that's just because I hate traits, probably :P
 
I'm not a big fan of traits either.
 
@Trowski I know. That's a prerequisite for being allowed into this room...
 
@Orangepill yeah I know what is your point, but now I know how IF() statement works. look this: $var='abcdefghi'; if($var == 'abcdefghi'){//do stuff}. So, first of all it checks "a" with "a" and then "b" with "b" and ...!! so it need a lot of time! for this reason I tell I hate IF()
 
@NikiC So your vote would be a free function over adding pipe() with the trait?
 
2:57 PM
@NikiC eih, I agree in principle. It's not entirely clear if there isn't a problem in openssl even without that bug
 
@Trowski I'm okay with traits in principle… just not ours :D
 
@LeviMorrison I try to use PHP's traits in a responsible way, where the trait declares the methods it depends on as abstract methods. For example, github.com/icicleio/stream/blob/master/src/PipeTrait.php
 
@LeviMorrison agree
 
me too ... where's the Scala paper you showed me a while back @ircmaxell ?
I'd like that ...
 
@Trowski Yes, I'd go with free function, as it's the same for all streams. Doesn't make sense to c&p the same implementation into all stream implementations
 
3:03 PM
But my general distaste for traits has left me looking for better answers.
 
(Alternatively: Use an abstract class instead of an interface)
 
@JoeWatkins I don't remember which, the original academic paper? or the scala docs?
 
I think the original paper, I could remember wrong ...
 
@sajad Your argument is invalid
 
3:05 PM
@NikiC Could work, but I dislike the requirement that all streams extend some abstract class.
 
@Sajad This will do a pointer comparison only, not compare characters ;)
 
Any recommendation for what platform should I use for a fast portfolio-blog website? Currently thinking of Ghostium ..
 
@Orangepill I don't know what should I say. just maybe the server of 3v4l.org is very high, because actually my server has just [512mb ram, 1cpu. 2gb ssd] and I think your code in the my server needs more than 5 sec
 
I can't remember which it was now ...
 
@Trowski You're not using finally because it errors if early destructed?
 
3:08 PM
> Traits - Composable Units of Behavior
 
@NikiC do you mean using IF() is not bad ?
 
@NikiC Right, because I would be using yield in finally.
 
@sajad if you script is taking that long it's not because of the if statements...it's more likely database or file system access
 
@Orangepill well, just one question: using IF() is not opptimized ? it is not opptimized, right?
 
@Sajad If that takes 5s to run, you can sell that server for a lot of money, because it's a relic from 1950
 
3:11 PM
+= interfaces, then it's useful ... and the same concise description applies ... that's a good description, much better than any I've seen for PHP traits ... awkward copypasta is what we have now ...
 
@NikiC ha ha ha
 
@sajad that's entirely contextual.... maybe... maybe not.
 
@Sajad Generally, if you're not programming in a low-level language, if()s are practically irrelevant from a performance perspective.
 
even if you are, ifs are normally irrelevant from a performance perspective (except in hot corners)
 
@Orangepill ok. for example, should I use an IF() for detecting the cookie of user is the same with what is in the database, so I need to IF ? or using IF in this case is not opptimized ?
@ircmaxell I hope to be like that.
 
3:14 PM
Screw that, I just tried it and it took me 19 seconds to cover only a billion iterations. I'm done with you, if. We're through.
 
@sajad if you want to compare two things then if is what you want to use....
 
@Andrea please don't reserve more type names
pretty please
 
@ircmaxell okay, why not?
 
3:16 PM
ah! well, ok! thanks @Orangepill @ircmaxell @NikiC @Andrea ! Then I will use IF() if I need to it ;)
 
@Andrea there's no reason to.
make the error messages better, and this problem goes away
 
@ircmaxell not entirely
 
@PaulCrovella your sarcasm will be lost on him... that is what started this.
 
@Andrea how do you figure?
 
well, for one, you won't spot the problem until the function is called
that's a nitpick, though
 
3:19 PM
@Orangepill Nah, progress has been made: he's getting better at recognizing sarcasm and not listening to me.
 
I'm not sure if I'm okay with people being able to name classes like existing PHP type names
 
@Andrea yes, because integer is a valid type (a class)
 
should it be, though?
 
why shouldn't it be?
integer is not a valid type name
 
@PaulCrovella Yeah... I am the one guilty of sarcastically posting the "if's are evil" link
 
3:22 PM
fwiw, I kinda like a variation on derick's suggestion Return value of foo() must be an instance of class boolean, scalar bool returned
 
^^ that
 
That might be confusing for some when an interface name is used.
 
well, more like 'instance of class/interface boolean, scalar bool returned'
@ircmaxell only because we arbitrarily decided it wasn't one come PHP 7
 
Return value of foo() must be an instance of boolean, scalar bool returned
@Andrea it wasn't one in php 5
 
^ That could work.
 
3:25 PM
@ircmaxell it wasn't reserved as a class name, but it definitely was a type name
 
I like the giving of the types better in the error
 
@Andrea no it wasn't. It was an alias
 
I take it we can't specify instance of interface boolean when it's an interface rather than a class?
 
@ircmaxell so was int
 
@PaulCrovella it may or may not be loaded yet
 
3:25 PM
so was long
 
@Andrea it's documented that int was the root type
 
I asked a question on SO, and someone told me a note, I can not understand his mean, can someone tell me what is his point?
Note: You are using limit without an order by, so the results may not be consistent from one execution of the query to the next. You should be using order by, which probably makes it irrelevant which version you use (because the order by needs to read and write the data anyway).
 
ah, yeah. that and "instance of interface" sounds weird
 
@ircmaxell where?
 
the fact that every signature in php.net docs uses int is another
 
3:27 PM
@ircmaxell the manual lied until PHP 7
 
@Sajad it means that if you run this code multiple times your are not guaranteed to get the same results...
 
(it was an alias of is_long but the manual didn't say that)
 
@Orangepill oh really .?? yes he is right, so what is the solutin?
 
@sajad Add an order by clause...
 
I really don't want 15 aliases for the same root types
 
3:28 PM
@Orangepill I can not, because he told: which probably makes it irrelevant which version you use (because the order by needs to read and write the data anyway)
I got it right?
 
@ircmaxell this wouldn't be 15 aliases
 
and reserving classes arbitrarily is not a good idea
 
in fact they wouldn't even be aliases
it's not an arbitrary decision
 
sure it is
rather than simply fixing the error message, and being firm in the documentaiton, we make it muddier
 
they have been understood to be type names for a long time, they shouldn't be usable as class names
@ircmaxell the docs aren't firm anyway
maybe for integer, but not for boolean
 
3:30 PM
"Why can't I name my class Integer?" "because it might be confusing." "So there's a type integer?" "No, but you might confuse it with int, so don't do it"
WTF
@Andrea They have been usable as class names for decades
 
What would be a good way to start implementing some search logic like negative searching and exact matching on a products array? It was a code test on a job app. However my solution was not accepted :c
 
@ircmaxell there is a type integer
that's what the manual and error messages call the type
 
@Sajad you can... if you should or not is another matter. If you run the query 10 times are you expecting to see the same data each time or just any records that match your criteria?
 
but in source code, it's usually just 'int', and unusually we're enforcing that
 
@Andrea link?
 
tyep type is called integer, because that's the name, the token when used in code is int, because that's the symbol
we don't call ?: the question-colon operator. We call it ternary
 
@Orangepill I see the same data each time, but their sort is not identical for ever
 
well, it's also (integer) or (long)
 
@JohnSvensson An individual filter function for each bit of logic, combined together in a single callback function, and then use array_filter to do the actual filtering of the array Did they not tell you what they were looking for in the interview? And just left you there wondering what they were after?
 
3:41 PM
ok?
 
I still don't know why (unset) was added in PHP 5, and still don't know why it isn't (null).
 
@LeviMorrison My guess? Because someone shouted louder.
 
@LeviMorrison because that'd break some_function(null)
but as to why it was added, no idea
 
@Andrea uh, can we just please deprecate the other casts?
 
@LeviMorrison You're not alone
 
3:51 PM
@Andrea Wait what?
How?
Isn't the cast syntax (null)$var?
How is that too similar to a function call?
 
Moornings
 
@MadaraUchiha (null) would be lexed as one token
 
why will someone ever want to cast something to null?
 
please remove (binary) and the string prefix of the same
 
@iroegbu That's the mystery
 
3:56 PM
@iroegbu uh… to have an excuse to not add a line break because all part of one stmt… :-<
 
Sep 25 at 15:54, by Paul Crovella
@RonniSkansing it's for when you want to inline some function call that has wanted side-effects but returns something that isn't null when you want null right there... I guess
 
@PaulCrovella yea I think Bob actually wrote a mini example of it later that day
 
The real reason it's there is so people can show off their knowledge of PHP trivia
 
@RonniSkansing eih, just call me Bob instead of trying to misspell my name here ^^
 
lol yea sorry bout that
 
3:58 PM
@RonniSkansing was it remotely defensible?
 
no =]
 
@NikiC there are much more excentric topics… like static variable behavior of traits.
 
Damn. I'm still trying to figure out a way to use it that isn't just completely wrong.
 

« first day (1823 days earlier)      last day (3118 days later) »