« first day (1761 days earlier)      last day (3412 days later) » 

17:01
Parameterized Queries and Prepared Statement are the same thing right?
Ah, thank you guys
I undertsand now
I will use prepared statements instead of the non prepared version
yep...they are the same.
in MySQL yes, not in general
user924016
Anyone using scala? a past colleague keeps recommending it
@ircmaxell is this in reference to my question?
17:05
Well, you can have a prepared statement without needing to bind parameters, and depending on the database library you're using, you can use bound parameters without creating a prepared statement...
(via emulation or client side stupidity)
@Orangepill yes
then what's the difference @ircmaxell
does it relate to when the query plan is compiled?
@rdlowrey agree
@RonniSkansing you pinged me about something but I lost the context, what blocked shizzle?
user924016
I cant remember at all =]
user924016
17:14
Must not have been important
@Orangepill yes
PS are a subset of parameterized queries
that makes sense. I'm assuming the parameterized queries that are not prepared statements don't precompile the query plan and just act as basically a sql safe version of sprintf
@Orangepill I don't know how other databases do it, but that's pretty much how the first implementation in mysql worked.
Bound params even broke the query cache.
It's also easier to imagine things twenty years ago, when prepared statements and stored procedures and ahead of time query planning and reusable statements and whatnot were amazingly powerful and useful tools due to the computing power of the day.
17:34
I think I was lucky to cut my teeth in sql on oracle in the 90 instead of mysql today... much steeper learning curve but at the end of the day I came away with a much better understanding of what's happening under the hood.
I wasn't even alive back then
@DaveRandom pastebin? I use gists :p
17:53
@Orangepill there is a problem (on duplicate key for votes table)
look, I send a +1, it is fine
I send a -1, it updates and replace new value, and it is fine too
but
if I send a +1 vote up, and send again +1 vote up (for taking back)
what happens ? Nothing !
:-(
I think as you said I should use of different dispatch
18:14
Hello RiggsFolly
user895378
18:26
#PHP7 FYI: code coverage with current phpunit and phpdbg without extensions thanks to @bwoebi and @markusstaab \o/ $ phpdbg -qrr phpunit
user895378
^ fyi
user895378
Also, given that this is the PHP room I feel obligated to point out that apparently today is #WorldElephantDay
3
Gratz elephpants!
@rdlowrey You got it fully working? What do I need?
user895378
just a current phpunit and a phpdbg built against php7
user895378
I'm pretty sure it's in the latest php7 beta
18:31
By current you mean master?
And yes I am being lazy here :-)
user895378
~4.8 will do it for your phpunit requirement in composer
user895378
This is what we're using in .travis.yml files right now for php7 test coverage:
user895378
script:
  - $(php -r 'if (PHP_MAJOR_VERSION >= 7) echo "phpdbg -qrr"; else echo "php";') vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
user895378
Travis's php version is built against nightlies so I'm not 100% sure (and haven't tested) to see if it's available in whatever the latest beta release was
@user3779493 Did you call
18:37
@rdlowrey Thanks that was my actual question :-)
Is there some rule which says you can't have an assignment in for() condition? Netbeans thinks I have something wrong, but maybe it's a protection from swapping condition and assignment part of for()...
You mean besides the "eeeewww why do you do that?" rule? :-)
@PeeHaa Because I can do $data = dbarray($query); and it will return false after last row.
@albru123 Perhaps you have a valid use case, but I'm not seeing it :-)
anyone here have experience with amazon ses and php?
@albru123 what does dbarray() do? Please don't tell me it is querying the db :-)
I want to check votes table for checking that current user gave a vote to this post or not, should I use of with one ?
SELECT EXISTS(SELECT 1 FROM table1 WHERE ...)
or
SELECT COUNT(*) ...
19:11
@PeeHaa It's fetching one row as array.
Why don't you just loop through the recordset instead?
foreach ($stmt->fetchAll() as $record) {}
@PeeHaa I was trying to achieve something like that, but I'm not sure if it's possible through the CMS functions (PHP-Fusion is old as fu*k). I have to use it for a temporary website.
@PeeHaa I think it still uses mysql functions
while($row = mysql_fetch_array($result) ){
Also I feel bad for you :P
@PeeHaa It is quite enjoyable when you don't have to care about security, because it is already vulnerable to everything
hehehe
user895378
19:21
That's like saying, "I already have the common cold. Might as well get AIDS while I'm at it."
4
lol :D
@rdlowrey lol! Insta-star to be flagged in a month by some random idiot
user895378
Why wait? I'm sure someone can take offense now ... I like my flags fresh ;)
19:24
@rdlowrey It'll be use (hopefully) for a short amount of time, so I really don't care about it and use security functions only included in the CMS itself (at least it do have string escaping)... Rewriting it will be worthless
user895378
Hey, it's not my liability. Do what you want. But it's not safe (and probably negligent).
Man, here I was all these years under the misled understanding that the best way to fix security problems was to allow for independent security audits. When really the answer was just fire your security engineers, hire a bunch of attorneys, and sue anyone that tries to reverse engineer your code for vulnerabilities.
5
I have so much to learn from Oracle.
hahaha...:)
Oracle's modus operandi of suing everyone is just beyond ridiculous at this point. That company needs to die and be forgotten.
It's not like I don't want to fix it, but fixing it basically means almost writing a new CMS, and I don't really want to do that, or migrating to another one, which will take a lot of time I really don't have.
Anonymous
20:05
Is PHP7 still for mid-october?
20:18
Damn that is one impressive explosion youtube.com/watch?v=MHQPX2TJPQc
@samaYo IIRC it's about a month behind all of the milestones.
I'm just waiting for xdebug. Sigh.
Anonymous
@Charles Is there is difference b/n xdeubg and phpdbg? I tried xdebug once but not phpdbg I am also waiting for 7 to check them both ..
@samaYo Honestly the only thing I really use from xdebug is the hijack of var_dump
Anonymous
I love me some pretty var_dump.
Anonymous
20:27
pretty + var_dump() === debug_backtrace()
No, I mean pretty as in colors.
20:40
@samaYo I think most people on the project accepted November a long time ago ^^
hi all, i have a really stupid question...
After i fetch data from mysql, I end up with an array that contains both the col names, and a duplicate of the data indexed by number.
...how can I avoid the number indexed duplicate data?
Anonymous
@LeviMorrison I did too. But heard it was to be sooner than expected i.e. mid-october .. but it's all the same. I wander how manu years it'll take for shared hosting providers to adapt php7 though. Most are in 5.3/5.4 right now. :/
Anonymous
@RozzA if you are using PDO check the flags/options from here php.net/manual/en/pdostatement.fetchall.php
thanks sama, got me on the right track :)
my phpfu is weak today
21:01
So @github released GH Desktop on Mac and Win only. No Linux. I find this … surprising. Given that it's aimed at developers.
Anonymous
maybe it's because they know real developers don't need a GUI :) . I'm not a developer, but I only use the terminal when using Linux. I don't even know how to install a gui for linux. @Gordon
^ yeah, that probably.
@samaYo Exactly
@Gordon Linux is available on the desktop? :P
21:19
@PeeHaa Yes, when you're too poor to buy Windows or too greedy (or wise) to give your money to Micro$oft
@albru123 Money is no argument. I could have Windows Pro for free, but I don't want it on my system.
21:37
just 2 votes needed to delete, anyone can help? meta.stackoverflow.com/questions/302371/…
Anonymous
what? u need downvotes?
22:11
Is it worth to set VARCHAR column as index if I'm using ORDER on it? I think there won't be more than 50 rows in total in the future to order.
@albru123 probably
who would die?
The apple
@samaYo you can give down vote, but I need the delete request actually.
 
1 hour later…
user924016
23:40
Hmm is there a recommended way to cache Auryns definitions after processing them all (alias, delegate, prepare ..)?
@RonniSkansing For vague values of 'cache', stick 'em in a file and then just bind them? github.com/Danack/Imagick-demos/blob/master/src/Tier/…
Or, what problem are you trying to solve?
user924016
I considered a costly setup where each module has its own bindings, which means there might be alot of inital files load, function calls, which i would like to skip and just move to the a fresh instance fully cached, abit ala a serialized object.. and with redis ofc
user924016
So I would like to cache to object after the calls to prepare and etc
user924016
> where each module has its own bindings, which means there might be alot of inital files load
This shouldn't happen. Because only the objects that are needed are created, only the modules that are actually needed to process that request will be loaded.
Which means that:
> serialized object.. and with redis ofc
is almost certainly going to be slower than just creating the objects needed each time.
You might still want to cache some stuff e.g. config values which needs to be read from file/DB - but those can be cached individually in a delegate function e.g.:
user924016
23:48
yea
$injector->delegate(SomeDomainService::class, 'createSomeDomainService');
function createSomeDomainService(Redis $redis) {
    $domainServiceRules = $redis->get('DomainServiceRules');

    if ($domainServiceRules == null) {
        $domainServiceRules = readFromFileOrOtherSlowThing();
        $redis->put('DomainServiceRules', $domainServiceRules);
    }

    return new DomainService::fromRules(domainServiceRules);
}
user924016
Thanks man =]
np.
ow wait - it's the perseid meteor show tonight.
....and it's completely overcast.
user895378
E_ENGLAND

« first day (1761 days earlier)      last day (3412 days later) »