« first day (2105 days earlier)      last day (3069 days later) » 

00:08
@bwoebi 90% of software is shit... everywhere.
@Sara I still have that feeling that pipe operator is just marginally more useful than spaceship, which never should have landed either…
@Sara how much is it really used (as in appropriate usages) with Hack?
Wes
Wes
pipe operator ftw!
those that say "use a temp variable instead! it's more readable!" must write $a = $object->a(); $b = $a->b(); $b->c(); instead of $object->a()->b()->c(); all the time, because in my mind |> and -> are the same.
00:26
@Wes you usually shouldn't write ->a()->b()->c() either.
Wes
Wes
yeah that's what i was saying :P
if you need to write that, it's the consequence of bad design typically. [with a few exceptions]
Wes
Wes
how can you say that lol
@Wes ?
It's typically a consequence of catastrophic getter chaining
Wes
Wes
how can you guess bad design from just ->a->b->c
00:28
@Wes properties are fine.
Method getters always have that feeling of side effects.
Wes
Wes
perhaps you are thinking like a compiler here? :B
That's just a coincidence!
Wes
Wes
lol
->a()->b()->c() is imho totally fine unless it's fluent shit
@bwoebi [unrelated] how important you believe it is having stuff like infinite sets/sequences abstractions?
or even finite uncountable sets/sequences?
Gon
Gon
o/
Wes
Wes
@bwoebi stuff like
$set = new BigDecimalRange('0.0', '1.0');
$set->contains('0.4'); // true
$set->supersetOf(new BigDecimalRange('0.2', '0.3')); // true
yo @Gon \o
Gon
Gon
00:36
waddup!
Wes
Wes
bellaaaa! (rough italian equivalent)
Gon
Gon
yesterday I was watching this 3guys1hammer video, I couldnt even sleep well at the night...
@Wes I see what you did there
Wes
Wes
you see?
00:41
doesn't bella mean beautiful, for girls?
*also mean?
Hello
Wes
Wes
yes, also. in this case it's short for "nice answer" "bella risposta" but the usage changed over time
do you remember the wazaaaa scene from scary movie?
@FélixGagnon-Grenier youtu.be/CynbAXjAYyw?t=19
heh
actual lolz are had
Gon
Gon
gtg, school, see y'all
Wes
Wes
00:48
i thought you were from uk @Gon :|
 
1 hour later…
01:52
@Wes not very. for custom sequences you have generators … and for sets … uh… nothing an userland impl couldn't solve?
Wes
Wes
i'm talking of userland stuff yeah. does it make sense to put effort into that? i'm making a collections library and was wondering if Set should support that stuff too
Avoid writing things which don't make your own life easier/you really need them…
Does having the sets help you? If yes, implement it. If not, don't and perhaps do if other people suggest its addition
Wes
Wes
with such basic things maybe it's not a bad idea trying to generalize
@Wes Just my opinion. If you feel it necessary, add it … your choice…
Wes
Wes
i can't tell i have a lot of programming experience @bwoebi i mostly do simple stuff. maybe it's not needed for me, but it would be for others
01:59
@Wes Well, I haven't either … I just do moderately complicated things… and I don't need it either.
Perhaps the OO fanatics who think everything shall be an object need it… but uh …
Wes
Wes
scala has a stream interface though, it's basically something between an iterator and List
i wish i could read scala's code though :P
@Wes just read it … can't be harder than C"++"
Wes
Wes
it's way easier reading c and c++ imo. or actually they resemble the languages i know more
@Wes There's C++ and there's C++…
Wes
Wes
btw, i'm surprisingly getting better with reading C code :D my biggest barrier were macros, but now i get them
now i just need to understand what the asterisks are :B
02:10
@Wes just a short way to write [0] (*foo == foo[0])
Wes
Wes
wow, lol
so **foo is foo[0][0] ?
yea
Wes
Wes
C is less scary than i thought it was though. another thing blocking me is the complete lack of tools. like i have no idea how to view a backtrace, dump a variable
i will probably need a debugger too, right?
@Wes you do.
@Wes to dump, printf() is fine … sometimes.
Wes
Wes
never used one in php, var_dump & co are sufficient
i wish it existed a C guide for programmers that already know what a variable is... every time i tried to read a guide i got all my will killed by things i already know... so i gave up
02:25
what are you, 13?
c'mon son, don't give up just yet
Wes
Wes
i just don't have the same free time to learn new things i had when i was 13 @FélixGagnon-Grenier
if i could pay bills by learning new things i would be the happiest person in the world :B
:) that would truly be marvelous
Wes
Wes
indeed
15' spent today trying to fit a sentence overflowing of just one word in one row only #OCD
Wes
Wes
02:58
Steps in mastery of a programming skill: 1 Can I do this? 2 Can I do this more easily? 3 Can I do this more elegantly? 4 Can I not do this?
@bwoebi Nice.
@bwoebi Yes... I haven't gotten a chance to see if that's an issue with amp or the loop.
@bwoebi I'm pretty short on time myself, so it will probably have to wait for a little while.
@bwoebi Looking at amphp/socket, I might be able to combine some of the features of icicleio/stream and icicleio/socket and create a v2 compatible lib from scratch faster than trying to adapt what's there.
03:31
@Wes I've been developing php-ds with only printf. I don't know why I've never taught myself how to use a debugger properly. I know I should be.
Joe tried to show me but I fell back to printf straight afterwards.
Wes
Wes
eheh, so there's hope for me :P
@rtheunissen asked before but you didn't answer! :P chat.stackoverflow.com/transcript/message/31819466#31819466
3 hours ago, by Wes
@bwoebi stuff like
$set = new BigDecimalRange('0.0', '1.0');
$set->contains('0.4'); // true
$set->supersetOf(new BigDecimalRange('0.2', '0.3')); // true
On the upside, I believe my ability to debug just by reading has increased a lot.
Wes
Wes
does it make sense to have stuff like that in your opinion?
@Wes you asked bwoebi, I think.
Didn't get a notification. Reading now.
Right, so.. range?
Wes
Wes
Jul 12 at 1:04, by Wes
@rtheunissen ever encountered the need of stuff like non finite and/or non countable set abstractions?
03:35
Oh shit, well there you go.
Could you please explain to me exactly what they are / when you might use them?
Wes
Wes
imagine a Sequence that has no end for instance. you can iterate over it forever, unless you break; and you will have no count() as it's infinite
Interesting.
Wes
Wes
interface Finite{ function count(); }
interface Countable extends IteratorAggregate{}
Could do that with a for loop though, right?
Wes
Wes
?
03:39
(of course, it would go beyond that example)
for ($i = 0;; $i += 0.1) {} or whatever.
Wes
Wes
the point is that you will never traverse it entirely as it's infinite
Feels like it would just be a wrapper around some ints, because you wouldn't need to store any actual values.
That for loop is infinite as well.
Wes
Wes
also foreach($iterator ... ){} would never end though (will always be valid()). i don't get why you mentioned for :B
some instead aren't even traversable, but could be for instance finite
for instance imagine the finite range of BigDecimal(0.0) to BigDecimal(1.0)
where do you even start traversing it? 0.0000000000000000000000001? or 0.0000000000000000000000000000000000000000000001?
you can always add a zero
that is said "uncountable" i believe in math, even if it's finite
so i was wondering if it makes sense to have this kind of things
use cases could be math stuff, or infinite datetime sequences/sets
there aren't many though, maybe i'm overengineering the thing
04:02
I'm not convinced that there's a clear enough use case / demand for this to warrant a dedicated implementation. On an unrelated note, I'm considering a matrix structure.
Would be a good excuse to brush up on my linear algebra too.
Wes
Wes
dunno what that is :B
Wes
Wes
how is different from arrays?
It's basically a 2D array, yes.
Structurally.
But they are fixed in size, so you don't need a linked hashtable for each row, just a basic C array. And you can significantly improve on the performance of matrix multiplication, reduction, inversion, rotation etc etc if done natively.
So that's an angle towards maths and science, but could also be used for grid-based stuff generally.
If you want to walk across the entire grid, or sum etc..
Would be a fun structure to design.
Wes
Wes
i think we should collaborate. i suck with math and implementations but i can help with the api. there are things in ds i don't like much. nothing too bad but improvable. i would love if at some point our projects converged into one :P
04:09
Talk to me about ds. :)
API.
Wes
Wes
you sure? i can get pretty pedantic :D
Bring it.
Feel free to open issues if you like, I'll add the API label.
Wes
Wes
i think that would classify more as "complete rewrite of the api" :P
i know i'm very pedantic so i don't want to go there :D
If you can back that up with good reasoning, go there.
Wes
Wes
for a start i'd have both interfaces and classes, Set should be HashSet and Set an interface
04:14
First things first, I will need to know why
And not "because that's how it should be done". :p
Wes
Wes
writing
:y:
I have to go soon but I'll respond asap.
Wes
Wes
for instance because not necessarily they "contain" concrete objects. contents can be dynamically created. imagine the silly example "new ZeroToHundredSet()" implementing Set. would be stupid if i made an hashset of 100 entries containing all the integers. what i can do instead:
class ZeroToHundredSet implement Set{
    function contains($object){
        return is_integer($object) && $object >= 0 && $object <= 100;
    }
}
@rtheunissen does that sound reasonable enough? :D
That makes sense for contains(), perfectly reasonable. How would something like add and remove work on a ZeroToHundredSet?
Wes
Wes
that's immutable, yeah
was just an example.
Morning @anmol
Wes
Wes
for instance recently i've implemented a set using a map of contiguous ranges
$map[$intRangeStart] = $intRangeEnd; and it's of course faster than
$map[$int] = null;
Immutable?
Wes
Wes
mutable
Trying to remove with that implementation would be difficult, no?
r[a] = d; r[f] = q. remove 'h'. Would you create a new entry and update r[f] to only be to g and start the new one at i -> q?
Wes
Wes
04:26
yes (assuming that i actually understood what you wrote :P)
i simply update the previous entry to end at the removed - 1 offset, and create a new entry starting at remove + 1 and ending at previous entry ending offset
i do need to iterate over the map to locate the range, but since i have few ranges it works
05:15
Hello guys , is PHP more secure than ASP.net in web server ?
@Wes come back to ds for a minute. Docs are almost done so the first proper release is coming up. API changes should happen now rather than later.
@DavidJawphan depends entirely on how you handle either. They can both be secure, they can both be insecure. Not sure which would be considered more secure.
Wes
Wes
mornin joe \o
morn
I have a table which has the column named as 'external'
but when I try to write simple select query, it says invalid syntax for word external
how can i avoid it and write a select query
anyone can provide some help?
05:37
Hi guys... Good mrng
I have a tiny query in php.
`105/100` returning `1.05` in float format. is there any way to get it in simplified fractional format? like `21/20`?
@CJRamki yes, math
@Gordon I'm bit confused... Can you pls suggest some way to do that...?
85
Q: How to convert floats to human-readable fractions?

Swaroop C HLet's say we have 0.33, we need to output "1/3". If we have "0.4", we need to output "2/5". The idea is to make it human-readable to make the user understand "x parts out of y" as a better way of understanding data. I know that percentages is a good substitute but I was wondering if there was ...

<?php
function answer($a, $b) {
        $gcd = gmp_gcd($a, $b);

        return sprintf("%d/%d", $a / $gcd, $b / $gcd);
}

var_dump(answer(105,100));
?>
do error checking yourself ...
05:52
!!docs gmp_gcd
[ gmp_gcd() ] Calculate GCD
heh, php has functions for everything
it really does
getting Call to undefined function gmp_gcd(). don't know why this occurred in latest php version too!!
because you don't have GMP installed or enabled
06:00
that
yes... checking phpinfo
check the comments to the manual page I linked. there is non-gmp versions in there to get the GCD
can't get out words fast enough to be useful, ^that also
yes... it did...
06:15
sigh reading the news lately is very depressing. The world has become a madhouse and people are forsaking their humanity. It feels like I must do something against it, but I don't know what or how.
06:27
it is an increasingly strange place
this was pretty funny though @Gordon
Anonymous
Moin
@JoeWatkins indeed
morning
06:42
morning Sjon
moin
It's 28 degrees here and the day hasn't even started...
@Sjon stay away from corners then
@Gordon :D
06:52
seven of nine?
it's the borg edition!
Anonymous
07:10
yeah baby
!!rebecca
@Epodax Happy Prebeccaday!
Good morning peeps
stackoverflow.com/questions/38497240/… is the OP looking to render angular js app using PHP ?
07:19
m,ormgtrogmrtsxdcxzjhcgsd
@PeeHaa mmfidsojhfoiadshfisadf to you as well, sir
@PeeHaa it's speled mooosdjdghjsggfhjmtt though
07:32
Hrm, perhaps a slightly noobish question but none the less, Backtrace functions / etc, can you use that with uh, "simple" php or do is it only available if you write a error handling function that includes the backtrace?
Because so far I've only found evidence for the error handling part.
!!docs debug_backtrace
[ debug_backtrace() ] Generates a backtrace
with dynamic calculated value % showing different OP, and with static values % showing different OP.
Don't really use it directly, but the framework I use might be using it to show some useful stuff
can anyone pls explain why this is happened?
07:35
@Sjon Also what I found, which is why I believe you need a error handling function for it, but I've been googling wrong before so I figured I'd ask to be safe :)
@Epodax You don't need an error-handling function to call that method. What is it you want to achieve?
@Epodax You can just call the function from anywhere and it will give you the trace
@CJRamki not sure what you asking but google floating point precision php
@Gordon did you seen my code at pastebin?
Something like that.
07:40
@CJRamki yes, and it has floats, so I am pretty sure whatever you are asking is due to floating point precision
@Gordon sorry... check this new link pastebin.com/ppGgkeQz
@Epodax Yes that's an error so you indeed need a custom error handler
@Epodax you can generate that whenever you want; but if you want to run it if an error occurs... you need an error-handler indeed
Wes
Wes
\o
o⅃
07:47
mornings :)
morgen
Goedemorgen!
Wes
Wes
 \o
(=)===
  |\     guitar windmill
!!wotd
megillah: a lengthy and tediously complicated situation or matter.
07:52
Like 80% of our meetings ^
@Fabor You should shout out "This shit is megillah" in your next meeting. ;-)
:P
@CJRamki !!docs fmod
!!docs fmod
[ fmod() ] Returns the floating point remainder (modulo) of the division of the arguments
@PeeHaa @Sjon Righto, ah well, I'll have to include it in my next project.
Thanks for the help :D
07:57
any time
|\
| * ffc5ef8 Performance Refactoring
* | 84393a0 Merge pull request
|\ \
| * | 5512621 document new ini settings
| |/
| * b307a73 Update to and implement logging.
|/

Git Windmill
Wes
Wes
lol
@PeeHaa Never used that site TBH, so not really going to miss it.
\o
@Fabor That dough in a can stuff seems magical, never seen it before until those gifs started popping up
Yeah, American I guess.
@Jimbo o/
Anonymous
\o
08:18
mornin
08:31
helo , I'm trying to figure out how to perform a time consuming task in ratchet , any help ?
1
Q: Ratchet php and Long Running task

harvey_slashI am using ratchet php. I am starting it like this: $loop = \React\EventLoop\Factory::create(); $webSock = new \React\Socket\Server($loop); $webSock->listen($this->port, $this->host); $webServer = new \Ratchet\Server\IoServer( new \Ratchet\Http\HttpServer( new \Ratchet\WebSocket\...

I want to send push notification to several devices from inside onMessage().
How may I do that without blocking onMessage() ?
thanks in advance
Hi guys I moved a mysql database from /var/lib/mysql/db to local so I can export it as a sql file but I got the following error when I try to select fom a table ERROR 1146 (42S02): Table 'db.clients' doesn't exist
can someone give me a help
You should just run the export on live instead of manually copying the data files
@PeeHaa mysql doesnt work on live
What does that even mean?
You have a database somewhere. mysqldump it
08:38
@undefined , have you taken a look at this ?
http://stackoverflow.com/questions/7759170/mysql-table-doesnt-exist-but-it-does-or-it-should
sounds similar to your problem
I mean when I try to connect to mysql on a a remote server its gives me that error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
@harvey_slash I'm pretty sure he hasn't. Good find though :)
@undefined hire a sysadmin
@harvey_slash ill take a look at this
@tereško im a very beginner sysadmin
lol
> I moved a mysql database from /var/lib/mysql/db to local so I can export it as a sql file
that's not how that works
08:41
anybody free to help with ratchet web socket and a long running task? :/
@Sjon how can i make it work please
@undefined That's already answered. I see you still can't read. chat.stackoverflow.com/transcript/message/31824289#31824289
BOOM
@harvey_slash Responded. Already had the same problem
0
A: Ratchet php and Long Running task

JimboThis is exactly the problem that you have to avoid when doing anything within your event loop: it can't be blocking, because anyone else then trying to subscribe, or call message, or have anything else event-driven happening can't happen until this is finished. This is more of an architecture pr...

@Oldskool phpmyadmin and connecting through terminal is not working ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
thats why I moved the database tables with .frm .... extensions to local so I can export the database
@Jimbo, thanks a lot. Ill comment there
08:46
hey peeps, how can I rename a file on upload? pastebin.com/rASk2J3t
@KerrialBeckettNewham by not using $_FILES['file']['name'] but something else?
pce
pce
Goog Morning!
Anonymous
Wtf is up with Fox News - their presenters are literally walking Botox overdose adverts
@undefined that's like transplanting you heart to your your hand so you can give it to someone else
08:48
hahaha
hmmm, something like this?
$newfilename = round(microtime(true)) . '.' . end($temp);
move_uploaded_file($_FILES["file"]["tmp_name"], "../Directory/" . $newfilename);
@JayIsTooCommon here is a better question: why do you even own a TV?
@undefined have a look at /var/log/mysqld something to see why the server doesn't start. But first move those files back
Anonymous
@tereško Good point
@Sjon ok thank you a lot
08:50
@KerrialBeckettNewham yes.
@Sjon Awesome, thanks.
Do people not like php memcache? -_- It always seem slow to get pushed to packages.
Damn memcached class.
memcached > memcache
we had some awful bugs in memcache that just kept reoccuring after being fixed

« first day (2105 days earlier)      last day (3069 days later) »