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.
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
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
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
@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.
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.
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..
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
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
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;
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
@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.
Let'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 ...
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.
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.
@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 :)
I 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\...
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
@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'
This 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