« first day (808 days earlier)      last day (4145 days later) » 

6:00 PM
Sure. It's just weird in the context of an RDBMS.
Traditional table constructs don't really describe that kind of role...
 
Yeah, but that's because i need to store statistics for multiple clients
 
/*
 * Chapter 12.21.2 Close Mysql Connection
 *
 * From the Ebook "A thousand things you might want but never need to know about PDO and Mysql"
 */

$pdo_mysql_close = function (PDO $connection) {

    $query = 'SHOW PROCESSLIST -- ' . uniqid('mysqlpdo_close ', 1);
    $list  = $connection->query($query)->fetchAll(PDO::FETCH_ASSOC);
    foreach ($list as $thread) {
        if ($thread['Info'] === $query) {
            return $connection->query('KILL ' . $thread['Id']);
        }
    }
    return false;
 
Usually, though, these are aggregate tables following OLAP consumption of underlying data.
 
normally you can just update your useragent data and hits per request. But i need something in between to relate it to the client
I really feel like a n00b at the moment :D
 
What I'm describing is an information table, not a data table. So you'd be cross-tabulating as you store and the cross-tab is what you keep.
The "brain cramp" you're having is that the problem is three dimensional. It's not two dimensional, and thus easily subsumed into a data table construct.
 
6:05 PM
yes, that's what is the problem. So i should stick with just a hitcounter for now?
 
0
A: Is there a function for closing the mysql query with PDO?

hakrePDO does not offer such a function, as outline in the existing answer, regardless of the database driver, the connection is managed via the refcount. However you can close the Mysql connection with PDO: /* * Chapter 12.21.2 Close Mysql Connection * * From the Ebook "A thousand things you mig...

 
What??!? There is no retreat in the fugue of brain drain. He he.
Do you see why I suggested a rolling log?
 
is mysql_real_escape_string() sufficient to prevent header injections
 
@avck what headers?
 
I don't necessarily need this kind of statistics, but i thought it would be fun to see wether i could make it, to get better insights
 
6:07 PM
Where you just toss in everything that's possible relevant, by role, and work out how to consume it over time?
"it would be fun" is not a business need.
:)
 
Nope :D no business need.
 
mysql_real_escape_string($string) before querying database for user inputted $string
 
However, you could be missing a real opportunity. Talk to your clients, asl them what they need.
 
1 min ago, by PeeHaa
@avck what headers?
 
@PeeHaa sql injections
 
6:10 PM
Your theme is part of their identity; you need to demonstrate it's value, they need to see how it brings them more business, or more valuable relationships.
 
@avck Last time I try it :) What headers?
 
Yes, what i wanted to achieve is to see which useragents are used the most, so i can create better themes, lets say most visitors use mobile user agents, then it could be a trigger to create mobile only themes for instance
but i don't want to ask my clients about that stuff, because they couldn't care less. So that's why i came up with the stats idea
 
@CKDT - There's reciprocity to be had in your role as brand -identity artist.
 
@PeeHaa that was a typing mistake
is mysql_real_escape_string() sufficient to prevent sql injections
 
6:12 PM
Oh ok, so obviously forget about the third dimension and just track hits per UA.
 
well that might actually do the trick! :D
 
Your clients do care.
 
it's just to see my overall consumption
 
They want it to work for their clients. That's why they pay you.
It's quality control.
 
6:14 PM
yes they do care, but i don't think they want to fill a survey about it, so statistics is a nice alternative.
 
Just make sure the cost in time, effort and control doesn't overwhelm the benefit.
 
yeah, well there you go. So the solution is to just log hits on user agents, and don't connect the clientID
 
Oh god no. They wouldn't have any reliable way of know anyways, escept through their own Google data or whatnot.
But I would bet dollars to donuts they expect you to be on top of that concern, so their "online face" isn't scaring the children.
 
haha, ok so what would you suggest?
 
@PeeHaa ty:)
 
6:17 PM
np
 
I'm not sure how tumblr works. Is it possible for you to manage all 600 themes centrally, so you can make modifications over time?
 
@avck Basically: just use pdo with prepared statements. Because you don't have to think about escaping anymore and besides that ext/mysql is deprecated
 
if i dont use a framework for logging system what are the possiblities of vulnerabilities
 
Of is it like a traditional theme where it's disconnected from you?
In other words, can you modify them to log in a table you own data about your themes? Or would you have to update their individual theme setup and/or store it in their table (and get it from them)?
 
@PeeHaa which PHP frameworks do you prefer
 
6:21 PM
I use the good old fashioned image tracker. So i make a request to a php file that's hosted on my own server / and return an 1x1 image.
 
@avck none
 
so the database and code is stored on my own server
all assets, like js / img /etc are stored on an s3 server
 
Best-case, you've got it being added to your tables, either directly (possibly problematic due to sheer size and frequency), or threre's a method for it to be sent ot your system in the background on a periodic basis.
Oh right. Nice.
You ad people are so sneaky.
 
hehe yes sir
 
so is it worth learning anything like cake or ..?
 
6:23 PM
well i'm not into ads, but i just want to know my clients a little, so i can improve my themes :)
 
@avck no!
Whatever you do don't look at Cake. It's the worst one out there
If anything look into Symfony/Zend
Both v2
 
Keep the table construct I talked about earlier in the back of your mind.
 
i already started at it
 
but it's really easy to hack, because a tumblr theme consists out of just 1 html page, so if they delete the tracker code, or whatever, things wont work :D
 
MVC something like that
 
6:25 PM
It's a little weird to get, but you could easily implement it. You just have to let it soak in.
 
django? how about it
 
@avck It has nothing to do with MVC
@avck Didn't do enough with django to tell you wether it is somewhat good or FUBAR
 
yes, thanks! Well i am about to have some diner. Thanks for the help. I am going for the "overall ,user agent, approach"
 
@PeeHaa, everything is MVC. Don't you know that?
 
@PeeHaa its based on MVC
 
6:27 PM
@avck That's the same as saying a plane is based on a bike
 
Great. Remember, it's a business decision.
 
@JaredFarrish :)
 
BTW, to all, laravel.com is looking really nice #justsaying
 
@JaredFarrish everything is MVC.enlighten
 
@JaredFarrish Yup, Cheers!
 
6:28 PM
@avck, not just MVC. Double rainbow!!!MVC! YEAH!!.
 
so laravel is another cake
 
Good luck.
 
@PeeHaa so best way to develop is from scratch
 
@avck - As in, wife doesn't know what you're up to down ithe basement" good? Or just *sports section in the baathroom ho hum good?
 
@avck Depends... Some "frameworks" are more setup like libraries so that you can easily use separate parts from it
 
6:31 PM
I've been looking at Symfony 2, which is as PeeHaa describes.
At least thaat's how I understand it. 8]
 
@JaredFarrish first one
 
Hey, it's an MVC for your man cave.
 
@PeeHaa do they provide more security?
 
@avck - What kind of security do you have in mind?
Operational, long term support, ninjas in the back yard?
 
@avck In my experience an application is as secure as the last person who touched it is knowing what he is doing
Aka it is not a silverbullet no
 
6:35 PM
not able to hack sessions or fool around with db
 
@PeeHaa - Or it's controlled by a company like At lassian who just wholesale rejiggers everything and throws your implementation into disarray.
 
:(
WTF there is a [best-fit] tag!?
 
@JaredFarrish operational
 
Sorry for the fuzz, but now placed the answer over here:
http://stackoverflow.com/a/14113114/367456
 
@avck - That's a low level problem. Code review is critical. But it happens really infrequently in the grand scheme.
 
@hakre nice, maybe you should clarify that it is mysql-only.
 
i recently read about header injections but cud not make much out of it do they affect only through emails
 
@igorw The question is about Mysql, isn't it? But I'll make that more bold, good idea.
 
6:41 PM
@avck - Those risks are inverted from their true risks, almost to wear it's movie plot scenario.
 
@PeeHaa Going over the cv-backlog?
 
@MadaraUchiha Nopez. Burninated
 
Ahh, nice
 
20 mins ago, by avck
so is it worth learning anything like cake or ..?
lol
 
@igorw I also now removed the funny comment as well.
 
6:43 PM
There's a crap-ton of inherent risk we always face. You're micromanaging the low likelihoold, maybe high impact risk that keeps you up at night, while your secretary is stealing you broke and planning to move to the bahamas as soon as the house your company's profits built has that swank casino room finished out.
 
@avck , stay away from Cake
 
The Cake is a lie!
4
 
which occurs more frequently?
 
@CKDT it is not even a framework. Just a collection of functions, that are wrapped in a namespace. Only difference that the namespace for some reason looks like a class.
 
@tereško - Are you talking about Cake?
 
6:46 PM
@JaredFarrish Laravel
 
@JaredFarrish , have you noticed that some of the comments have these small arrows beside them ?
 
Oh right. They're not very dark on this screen.
 
@JaredFarrish They aren't dark at all :P
 
the main problem with laravel is that it uses static variables all over the place
 
6:48 PM
@JaredFarrish
isnt there pleasure in doing it, more than the crap-ton of money he will steal
@tereško really
 
@igorw it has static-everything
 
and next up, static methods everywhere. :)
 
The cake is a lie! i knew it. but just to hear the voice...
 
@avck - Pleasure in what?
 
@avck Don't make lemonade.
 
6:50 PM
@avck , it is one of two worst frameworks in php. It is painful for professionals, and harmful for the beginners.
 
@JaredFarrish staying up at night and protecting ur app
 
Uhh yeah. Sure.
The stink of sweaty fear - coming to a parfum counter near you.
 
@MadaraUchiha For such a "basic question", the answers are ... interesting.
 
@tereško which is other
 
codeigniter
 
6:53 PM
@MadaraUchiha lemonade?
 
@avck You aren't a true Portal gamer if you don't know what I'm talking about :)
 
here is a general rule of thumb: framework's code quality is an inverse function of its popularity on /r/PHP
(this, of course applies only for serious frameworks, not the "look at me, look at me, i wrote a framework" posts)
3
 
@MadaraUchiha played only first one dont remember lemonade
 
@avck second.
 
@tereško which is the least popular one
 
6:56 PM
@tereško - I wrote a framework,want to see it?
 
@JaredFarrish MVC?
 
lol
 
BETTER.
 
@tereško I'd take that as a challenge if I were you :P
 
The best php framework: twitto.org
 
6:57 PM
You want to see it?
 
Nice teeth.
Well, here it is.
I hope you're ready. Maybe sitting down.
Tt's great.
 
it has 7 legs
 
IT'S AWESOME.
Oh damn.
 
7:01 PM
@JaredFarrish How much do you value it for?
 
@JaredFarrish 233.95$ perhaps?
 
@avck "microframeworks" like lemonade imo aren't really frameworks, rather they are router libraries. laravel also goes in that direction. if you use it wisely, you can make your code mostly not depend on it.
 
Trolling at its finest.
 
@MadaraUchiha - Umm... $233.95?
 
7:03 PM
=)
You're slow.
 
It took hours to forget that leg. That's a feature. You worry less, not more.
`@MadaraUchiha, I was busy traveling into the future to answer your question. You must be a powerful predictor of the future.
 
@JaredFarrish Ocular powers of @MadaraUchiha are unknown, but you may be right
 
@dev-null-dweller Actually, my powers are pretty much known, though I have much up my sleeve
Future sight isn't one, but I don't need it, you can't kill me either way :)
in Anime and Manga on The Stack Exchange Network Chat, Dec 24 '12 at 18:45, by Krazer
@MadaraUchiha Then you win! ALL hail the mighty Madara-sama! Conquerer of all universes!
 
@dev-null-dweller, that is at least half of the whole truth a quarter of time, on Mondays, Wednesdays and alternating Fridays. All hail the shaman, the shaman will see you now.
 
@JaredFarrish But... it's Tuesday.
Besides, once my eye in the moon plan is completed, your shaman will be worth as much as BrainFuck.
 
7:17 PM
^ for the previous question. who said one can not close them.
 
Brace yourselves, a noob is coming.
 
@MadaraUchiha Yesterdey you admited they were unknown anime.stackexchange.com/questions/846/… ;)
 
We don't let @MadaraUchiha The Shaman drive, bath undder a whole moon, or bother with days and names. HE IS ALL POWERFUL. These trifles mean nothing.
 
Well played, well played
 
@MadaraUchiha, get it wrong it 's Shaman FuckBrain.
 
7:21 PM
@dev-null-dweller Corrected.
 
That wasn't nice.
Anyhow, anybody got any questions about PHP? Anybody?
 
7:35 PM
Do any of ya'll use or have an opinion on using a tool like Vagrant in development?
 
7:55 PM
@JaredFarrish should routing mechanism be part of the domain model, since in some implementation the router might be using some persistent storage to compute the routes ?
 
I take it that's a criticism?
I'm not that familiar with it. I just got one setup last night.
 
it is a programming question
... or are you unable to see the arrows again ?
 
I can barely see them. Theoretical or practical?
 
both
 
In theoretical terms, isn't routing inhibited on the agent side, so the transliteration along a topographical course is prescribed by the system? In a practical situation, the route may be inferred through indirection but corrected by the agent. So the answer is yes, the King of Spain.
 
8:09 PM
Good evening
 
Good evening, sir.
 
Evening @ircmaxell
 
When a PHP script is bound to a client-side EventSource, is the PHP script supposed to keep the connection alive (e.g. via a loop with a sleep();)?
 
@NikiC: I like the changes...
 
If the PHP script just exits, the client (web-browser) will automatically establish a new connections after 3 seconds, and re-run the PHP script, but I'm not sure that's the way it's supposed to be used.
 
@ŠimeVidas, is that in regards to long polling?
 
@JaredFarrish Server-sent events (a.k.a. EventSource) is a push technology. Long polling is another push technology (AFAIK)
(I'm not sure how it's all related to be honest)
 
user1125394
@ŠimeVidas of course there should be server listening
 
@cyril Hm, what does that mean? Doesn't the server always listen? :)
 
user1125394
wait
 
I have no idea if that's right or not.
 
@cyril I think that tutorial is doing it wrong. The PHP script sends a message, and then exits. The client will then re-establish a connection after 3 seconds, and re-run the script. I don't think that's how we're supposed to use EventSource...
@JaredFarrish That code uses a for-loop with a sleep(1);. So, I guess, as long as the PHP script is running/sleeping, the connection is kept alive, which is how I think EventSource is supposed to be used.
 
user1125394
        var source = new EventSource('/sse.php');
source.onmessage = function(e) {
      console.log(e.data );
    };

server time: 09:26:03
server time: 09:26:06
server time: 09:26:09
server time: 09:26:12
server time: 09:26:15
server time: 09:26:18
 
user1125394
just tested it
 
user1125394
no the server doe'snt close the connection
 
8:28 PM
@cyril Yes, as I said, the server exits immediately, and the client re-establishes the connection after 3 sec.
@cyril That's how EventSource works. The server closes the connection, and the client opens it again after 3 seconds.
 
user1125394
of course
 
user1125394
the idea is not have asynchronous events
 
That makes sense to me, and it 's nearly identical in the MDN example and Remy Sharp's [Polyfill Shim(github.com/remy/polyfills/blob/master/EventSource.js).
 
user1125394
not just a clock
 
@JaredFarrish I'm not sure, though, if having a loop with a sleep(); is a good practice...
(but then I'm not a PHP developer)
 
user1125394
8:31 PM
I don't know also how it's done in PHP
 
@cyril From what I understand, the idea is to have the server send a stream of messages over the same connection.
 
user1125394
in nodejs, I made one where I keep track of all clients
 
A for loop would give you granularity of control; if it ran 60 times, exit. Depends on the details of the other sissues. i like the elegance of the while loop. But whatever.
 
wow finally a user thanked for linking the error reference.
 
@JaredFarrish why is there error suppression all over the place
also , on a related note .. why do people keep on concatinating the string just before echo'ing it ?
 
8:35 PM
Because they're out to get me. I didn't tell you that.
On the latther, they slept in the T intersect and their chi is disturbed.
 
user1125394
@ŠimeVidas that's exactly the point of SSE, to recrerate a http response when needed, but in PHP I don't know if it's as rich as other languages where you could broadcast it to all registered listeners
 
user1125394
and that's not the client that re-establish the connection, the server emulates it I think
 
Is EventSource modeled for pub/sub?
 
user1125394
yes, it is
 
user1125394
wait a sec, I've a running example
 
@JaredFarrish I know that a department on campus uses it. All of their development and production machines were running different versions of things and they got sick of dependency hell.
 
You work for a university?
 
user1125394
@JaredFarrish it's just a observers pattern
 
To me, it sounds great. The "where do we workbench" problem is one of my greatest annoyances. But where there's harvest there's bitter soil.
@cyril - And?
 
@ŠimeVidas @cyril the intended use of SSE is not to close and re-connect after every event. if that were the case, you could use normal long polling.
it is a supported use case, but the reason is different. it's intended to be used on phones with shitty connections, so when that connection goes down you can re-connect and re-sync any events you may have missed.
and yes, it is a uni-directional pub/sub protocol over HTTP.
the Yaffle/EventSource approach kinda works. in practice you would do some sort of server-side polling inside that loop. something like checking a database for updates.
the evolution of that would be to use a message queue. the scripts will do a blocking call on the queue and wait for changes.
 
8:52 PM
@JaredFarrish Yes, I work for the supercomputing department.
 
(can also be zmq or redis blpop)
 
user1125394
@igorw doesn't work on android though
 
user1125394
@ŠimeVidas can you test this
 
user1125394
you should see you IP
 
@cyril yeah caniuse.com/eventsource what about the Yaffle polyfill though? I haven't tried it, so I don't know if it works
 
user1125394
8:54 PM
and the ones of other who click
 
The question is perfectly fine, but not for this website here. Whoever told you that you might ask it here, maybe has another idea where to post such a question. — hakre 8 secs ago
 
@LeviMorrison - Cool. I work for a university here in Texas.
 
^ new strategy gg
 
user1125394
@igorw ah I mean doesn't work on Android native browsers
 
@JaredFarrish Which?
 
8:56 PM
North Texsas.
 
user1125394
you have to install chrome or so
 
The best damn Jazz studies the world's ever seen! :P
 

« first day (808 days earlier)      last day (4145 days later) »