logs archiveIRC Archive / Freenode / #php / 2015 / August / 21 / 1
PigFlu
..where exactly is this root folder?
ghnubst
Pigflu: /var/www
FalsAlarm
i have 1 associative array that contains a key and a value
i have another array that contains just keys
i want to loop through and display a checkbox if the keys match?
otherwise i would just like the checkbox unchecked
PigFlu
alright! this was fairly easy actually
FalsAlarm
how would i do this?
ghnubst
Pigflu: have you tried winscp?
sorabji
FalsAlarm: array_intersect
NoiseEee
Gsham: https://3v4l.org/kJC37 cribbed from the "neighbors" function that seems to be similar to what you want from a user comment on http://php.net/manual/en/function.next.php
djam90
Is it possible to store user's data in database encrypted, and only they can unencrypt it again?
I want a form of secure storage for clients
         

jeffreylevesque
is pear site down?
when i try via puppet `command => 'pear channel-discover pear.drush.org && pear install drush/drush'` I'm getting: Discovery of channel "pear.drush.org" succeeded. THen, I get File http://pear.drush.org:80/rest/r/drush/allreleases.xml not valid (received: HTTP/1.1 404 Not Found)
but it is valid - https://pear.php.net/package/Console_Table/download/1.1.5
PigFlu
ghnubst, yes why?
ghnubst
PigFlu: you can use it with your virtualbox to edit files in the web dir, makes it easy
NoiseEee
djam90: how would 'only they' decrypt it?
PigFlu: that's the default installation for ubuntu, to that directory. but hosting usually goes beyond that, so that you have one directory per domain
PigFlu: i'd fool around with https://puphpet.com/ via windows after your fun in actual ubuntu
djam90
NoiseEee, well.. I'm not sure.. with their password
merkazu
does anyone know why attempting to use db2 prepared statements with merge statements in a transaction would succeed on all statements, return true for db2_commit yet not actually DO the updates/inserts?
checked against a sql client and it's not a SQL syntax error
NoiseEee
djam90: its really only secure if their password is kept out of the DB, ie: its something they manually type. Like the way OnePassword or LastPass work, for example
merkazu
can't find any logical reason why that'd work but not actually do the changes
NoiseEee
djam90: but i mean, what 'storage' are you offering? storage of some text fields?
djam90
NoiseEee, yes exactly
PigFlu
alright thanks for your help guys!
Chunk2
So, what makes a good pre-interview question for a PHP candidate?
NoiseEee
merkazu: obviously you're committing the transaction?
Chunk2
Just looking over some code and finiding bugs ok?
Majeh
Chunk2 you're asking the questions?
Chunk2
Yeah
NoiseEee
Chunk2: how have they been keeping up with new releases, can they name any new features and how they might use them
Majeh
finding out whether the guy is honest or full of sh*t
merkazu
yeah, Z-Ray is telling me that the transaction has been committed
Majeh
i like to ask an impossible question and receiving "i don't know but i'd google" type of answer
         

Sammitch
iphones are great... if you spend all day troubleshooting/administrating linux systems and don't want to spend your off hours administrating/troubleshooting the expensive rectangle in your pocket.
Majeh
then after that some debugging and basic syntaxt so you're sure he at least knows the tool to a point
Chunk2
I'm thinking about writing an elaborate piece of code to do something simple, and then asking "How would you do this differently?""
Sammitch
oop wrong channel
Chunk2
Like overly elaborate
NoiseEee
Chunk2: thats a good idea too...
Majeh
Chunk2 do you want to determine whether the person knows how to use PHP or if the person is the right kind of team mate?
delboy1978uk
give him a code kata to do
Majeh
or both of those?
NoiseEee
Chunk2: what their favorite way to debug is
Majeh
when under spotlight, people tend to underperform (stress etc.)
Chunk2
Majeh: At this point, he'll be the only programmer in the company so... I just need someone who understands code I already wrote. I'm helping my boss find my replacement.
delboy1978uk
sit them in front of a laptop with a puzzle on a piece of paper
Majeh
i see
delboy1978uk
and see what gets coded
Majeh
well, navigating through your code and upgrading it with minor functionality should be a good way to choose
delboy1978uk
give him one of these before the interview https://laracasts.com/series/code-katas-in-php
Chunk2
wow people think of everything
delboy1978uk
i was given on where i had to make a cli command that worked out whether the argument i gave it was a palindrome or not
another one i got was to build a ten pin bowling game
Chunk2
yeah thanks this gives me some ideas
delboy1978uk
another one i got was the roman numerals test
Majeh
what idiotic tests.. so someone decides to get a web developer, then they ask him about roma numerals, palindromes, bowling game but there's no question consisting of database manipulation, outputting the data, finding the errors etc.
you got asked about everything except the knowledge you're supposed to have. that's a bit useless IMO
Chunk2
When I was in school I did a roman numeral translator using recursion. People thought I was crazy.
delboy1978uk
these kind of tests see how you code, and if you use unit testing or not. its only the precursor to the interview
Majeh
a web dev should be able to issue a db query that's safe from sql injection, perform secure user auth and things like that - those show whether they're capable of moving from that point or not
delboy1978uk
thats true, but any coder can do those things, some better than others. this shows if they have good solid oo
Majeh
it just makes sense to ask questions that are close related to the work they will be doing
it's a bit pointless to ask a formula 1 race driver to solve rubik's cube
"it's an introduction to testing his reflexes"
delboy1978uk
ive seen horrendous user login systems that werent secure, but sure enough the db connection was there, and what he thought was safe filtering etc.
Majeh
well there you go, at least you know the dev. in question has some knowledge holes and you can determine whether he's the type that will learn the proper way or if he's indoctrinated moron who thinks he's all that
hence, questions relating to the work he does = the best
code puzzles are just pointless
NoiseEee
Chunk2: if you're finding your replacement, make sure they know about how you are querying your DB... do they need to know SQL too?
delboy1978uk
if theyre honest when it comes to stuff they DONT know youre off to a good start too
NoiseEee
i hate code puzzles too
Chunk2: give them some code using mysql_ and 'why is this not the way to do things in 2015?' for example
willbradley
has anyone ever serialized a DateTime and ended up with this? "DateTime":0:{}
cuz i can't figure out how a DateTime object could ever be a "zero length array" like that
Majeh
willbradley when it was constructed using bad arguments
willbradley
can you imagine what kind of bad arguments they might be?
i just tried 'blargh' and it threw an error
NoiseEee
willbradley: what's it like before its serialized, follow it
theocode
Howdy folks.
willbradley
my codebase is many thousands of lines and the serialized data is persisted 1% of the time to a database
i can't imagine a scenario where a "valid" datetime object gets created, serialized and persisted to a db without exploding, but here we are
or rather, invalid
Majeh
i do remember getting nulls instead of datetime object
theocode
Is there another name for serialized PHP?
NoiseEee
willbradley: find the place where it's bad, tell the debugger to stop there, and look through the backtrace
theocode
Is PHP data clear enough?
NoiseEee
theocode: don't quite follow the question
willbradley
this isn't reproducable, this is one instance of $newDbValue = serialize($object->setLastLoginAt(new \DateTime())); being completely blank in ten out of ten thousand logins
theocode
NoiseEee: Hey. Essentially, I'm trying to find a nicer way to say "serialized php".
Majeh
what is serialized php? :)
willbradley any chance you can just use "NOW()" SQL function?
theocode
Majeh: exactly.
NoiseEee
lol
who's on first
Majeh
feel free to go first :)
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 next »