@NikiC @rtheunissen what if instead of using a zend_object_iterator, we ask the object a foreach handler, which we use in a while loop. This handler moves the pos itself and return the current value.
I'm trying to wrap my head around mysql connections.
So with an average low performance server. Let's just say 1GB RAM Lamp with average processor speed. How many mysql connections can be open concurrently?
@NikiC general question: what do you think about requiring the & on caller as well as on callee side for pass-by-ref? from a language standpoint (technical advantages aside ;-))
First off, ^ itself isn't what's special here. If you XOR anything with zero, or OR anything with zero, you just get back the original answer. What you're seeing here is not part of the operation itself, but rather what happens before the operation: the bitwise operators take integers, so PHP con...
in general: a large part of your app is uninteresting boilerplate (routing, request and response handling, library abstractions, etc). Frameworks implement that boilerplate for you so you can focus on writing the code that makes your app actually interesting.
In theory, it'll be higher quality code than you could ever write yourself, because many other people have worked on/tested/improved it.
You'll also take a hit in fine-grained control and runtime efficiency (each framework will impose a certain way of doing things; and being as generic as they are imposes an efficiency burden), but make it up in programmer efficiency (you won't waste time writing that crap).
I would highly recommend using a framework to start with, and then if your application has performance problem, then work around or remove the framework selectively.
Probably your application will not actually get to the point that the framework is a performance burden.
If it does, you need to weigh the costs of how you want to proceed: do you just throw more hardware at it (which shouldn't be too difficult, if you at least design your app to assume that that will happen, which you should, because that's the only way you're going to get redundancy anyway)? Do you replace parts of the framework? All? Refactor part of the application out and onto separate hardware/with a lighter framework/etc?
It's not at all bad. Core PHP helps you write the code and understand the code. when the developer at begin stage, we strongly recommended to learn Core PHP, cause we don't want to see you as a bad developer. According to World theory, easy always gives best result with strong base. As per the world theory, if you know core PHP, you would reach your goal by using framework PHP
I got this msg on twitter today "@skansing, Hi, thanks for discovering those problems fixed in WordPress v4.4.2. However, cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2222 … still needs filling in." ... so the cve-2016-2222 is the ssrf vuln I reported to wp.. but do I need to do something regarding the CVE?
SELECT t1.teamid, t1.teamname, GROUP_CONCAT(t2.name SEPARATOR ' / ') as teammembers, SUM(t3.score) as overallscore FROM teams AS t1 INNER JOIN team_members AS t2 ON t1.teamid = t2.teamid GROUP BY t1.teamid, t1.teamname INNER JOIN stage_responses AS t3 ON t1.teamid = t3.teamid GROUP BY t1.teamid
^ What is wrong with this code?
For information, the stage_reponses table is empty
I don't think you can have two separate group bys. feel free to prove me wrong
SELECT
t1.teamid,
t1.teamname,
GROUP_CONCAT(t2.name SEPARATOR ' / ') as teammembers,
SUM(t3.score) as overallscore
FROM teams AS t1
INNER JOIN team_members AS t2 ON (t1.teamid = t2.teamid)
INNER JOIN stage_responses AS t3 ON (t1.teamid = t3.teamid)
GROUP BY
t1.teamid,
t1.teamname
the sum was giving double value. so I modified the query
SELECT
t1.teamid,
t1.teamname,
GROUP_CONCAT(t2.name SEPARATOR ' / ') as teammembers
FROM teams AS t1
INNER JOIN team_members AS t2 ON (t1.teamid = t2.teamid)
LEFT JOIN (SELECT SUM(score) as overallscore FROM stage_responses AS t3 GROUP BY t3.teamid) AS t3 ON (t1.teamid = t3.teamid)
GROUP BY
t1.teamid,
t1.teamname
SELECT
t1.teamid,
t1.teamname,
GROUP_CONCAT(t2.name SEPARATOR ' / ') as teammembers
FROM teams AS t1
INNER JOIN team_members AS t2 ON (t1.teamid = t2.teamid)
LEFT JOIN (SELECT SUM(t3.score) as overallscore FROM stage_responses) AS t3 ON (t1.teamid = t3.teamid)
GROUP BY
t1.teamid,
t1.teamname
SELECT
t1.teamid,
t1.teamname,
GROUP_CONCAT(t2.name SEPARATOR ' / ') as teammembers,
t3.overallscore
FROM teams AS t1
INNER JOIN team_members AS t2 ON (t1.teamid = t2.teamid)
LEFT JOIN (
SELECT
SUM(score) as overallscore,
teamid
FROM stage_responses
) AS t3 ON (t1.teamid = t3.teamid)
GROUP BY
t1.teamid,
t1.teamname
few things @Mr_Green. You have to select the field on which you want to join the subquery. you also have to select the field from the resulting subquery like any normal field
I just did a small test modifying the "Comment:" line of my private RSA key and it appears to be fixed at creation of the key.
It is a RSA key generated with Putty, and after modifying the comment in the key, the passwd did not work, i have to reverse the edit to the same original comment for i...
that's the kind of setup I have. While tightly coupling the container internals via type hints (in specific "macro-factories") can bring some advantages in compiled languages, in PHP that is just a useless complication, and increases maintenance load by a lot from my experience.
I'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.
Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL and...
@Andrew note that anemic domain is perfectly ok for CRUD-only apps, but you must be 100% sure that what you'll have in the future is also staying CRUD-only
@Ocramius Hmm, to be fair I __construct(Injector $injector), although tbf I can do away with service location in my factory and even just directly inject some of the specific objects needed to help with the complex object creation. I do tend to be more explicit in my factories - even if it means a few more classes
@Ocramius I find them useful for things I don't have a compile time, like request parameters. But still, I don't get how two lifecycles may be different (in fact to be completely honest, I've never seen this - could you give me an example ELI5?)
anyway, if you re-use the same factory to retrieve a service between two different request lifecycles, assuming any of your services may retain state (this happens, sadly), you have a problem
because now your factory has this retained state by transitivity
@Ocramius Are we talking things to do with websockets and servers, for example, because in PHP the typical request -> response -> dead means that I'd never need to keep something between two request lifecycles
Login with facebook doesn't work on my server but it worked on localhost check out error on My site
My login.php
<?php
ob_start();
include 'init.php';
require_once 'config.php';
//initalize user class
$user_obj = new Cl_User();
/*********Facebook Login **********/
require_once('Facebook/Face...
Building PHP docker containers! My image was 4GB!!!! I just reduced it to 1.8GB, still too big, but a big saving. Has anyone else got any experience with keeping their images nice and small ?
@PaulDragoonis btw, you can't really make docker images "smaller". Due to the immutable FS structure, they will always eat up more space as you add layers
How you guys would approach the classic problem when you pass some parameters via HTTP and you need to distinct types for them? It will arrive as a string obviously, but let's say you need to distinct stuff like "42" (as a string) and 42 (as an integer)
easiest way I'm thinking of: packing to something that supports it (json, for example)
@Leigh in ideal world :) But there are things like "attributes" which are things like "cpu_frequency" / "weight" (those are ints) or "brand name" / "manufacturer name" (those are strings) and those attributes are dynamic - I don't know even their names, the comparison type can be only determined by value
@Leigh I have 25 of these commands, trying to keep line numbers down to a minimum
It's looking like this.
if [ -z ${SYMFONY__DATABASE_HOST} ]; then echo "env[SYMFONY__DATABASE_HOST] = ${SYMFONY__DATABASE_HOST}" >> /usr/local/etc/php-fpm.conf fi if [ -z ${SYMFONY__DATABASE_USER} ]; then echo "env[SYMFONY__DATABASE_USER] = ${SYMFONY__DATABASE_USER}" >> /usr/local/etc/php-fpm.conf fi
acceptable, but my OCD says that "fi" is looking lonely and needs to be up there with its friends :)
@PaulDragoonis It doesn't have to be on it's own line. You can easily do if [ something ]; then echo Wowzers; fi, but it's not really legible that way when you have long commands like yours.
I got an email from letsencrypt about renewal hence I started looking at it again. Was planning to work on it this weekend, but I am waiting for your work to be done. So I can properly test it and contribute when needed without having two people working on the same bugs/things :-)
ive just decided i want to learn how to encrypt data on my site
so far ive been looking at base64 for my ajax, and then sha256 for database.
but now im wondering about my post method.
how should i encrypt my data.
by doing one encrpytion on the entire string
data: "type=" + window.btoa(escape(...