« first day (1525 days earlier)      last day (3409 days later) » 

MGE
12:07 AM
Hello
How is this possible?
if (strpos($_SERVER['HTTP_USER_AGENT'],'Dalvik') !== false) {
echo exit;
}
else {
echo $_SERVER['HTTP_USER_AGENT'];
}
it returns Dalvik/1.6.0 (Linux; U; Android 4.2.2; QMV7A Build/JDQ39)
 
@MGE
php > var_dump(strpos('Dalvik/1.6.0 (Linux; U; Android 4.2.2; QMV7A Build/JDQ39)','Dalvik') !== false);
bool(true)
 
MGE
so How can be it possible?
 
dunno. What did you expect echo exit should do?
 
@MGE Either there are non-visible characters at the start of the string, or you're running the wrong code - 3v4l.org/PRR2l
 
@MGE What is "echo exit;" supposed to do, even?
 
12:14 AM
and for the record, yes I do hate double-negative boolean statements.
apparently it exits....
 
Hum, changed something completely unrelated and a unit test started failing
And the diff in the failure is different order in an array - even though I'm using assertEquals and not assertSame
 
12:35 AM
Unicode escapes was accepted
echo "Release the \u{1F389}s!"
 
🎉🎉🎉
 
Hey, anyone know why using mod rewrite in an .htaccess file in a subdomain isn't playing nice? OR maybe I'm doing something wrong.. this seems correct..
RewriteEngine on
RewriteRule ^.+$ / [L]
Just getting 500 error
 
@NikiC Hey, for a single commit merge, is there a point in a deliberate merge commit?
Screw it, I'm making one.
 
@AndreaFaulds I usually rebase instead of merge
as I don't see the point in that extra commit ^^
 
12:45 AM
@NikiC Oh, I 'rebased' it (actually I used git reset) into one commit
But I kinda like having the merge commit there so you can see ah, yes, we merged this branch in here
Undefined symbols for architecture x86_64:
  "_tsrm_get_ls_cache", referenced from:
      _zm_activate_phpdbg_webhelper in phpdbg_rinit_hook.o
      _phpdbg_webdata_compress in phpdbg_webdata_transfer.o
      _sapi_globals_ctor in SAPI.o
      _php_output_init_globals in output.o
      _alloc_globals_ctor in zend_alloc.o
      _zend_startup in zend.o
      _executor_globals_ctor in zend.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
uhhhh
...
Aw shit I forgot the NEWS/UPGRADING. Gotta do that then.
@NikiC Does new syntax go in NEWS, or only UPGRADING?
Well, I added it only to UPGRADING.
 
@AndreaFaulds A short mention in NEWS, more detailed in UPGRADING
 
@NikiC Welp, ?? wasn't mentioned there... I'll update NEWS in yet another commit.
@NikiC By the way, I only mentioned \u under Backwards-Incompatible Changes. Should it be in New Features, too?
adding it to both
 
1:13 AM
@salathe now someone needs to implement an adapter for mongodb to migrate transparently
 
 
1 hour later…
2:17 AM
@Danack finally added some examples
 
2:52 AM
@NikiC Damnit, I'm addicted to git rebase now thanks to you
 
3:42 AM
I wrote a language spec patch for Scalar Type Hints 2: github.com/TazeTSchnitzel/php-langspec/compare/… :o
3
 
4:41 AM
I'm creating a “contact user support” form. The idea is to prompt the user for specific pieces of information. Then format it into an e-mail and sent it to support@example.com . So far so good. I have figure out how to send a simple e-mail.
I'd like to have file attachments too. I have figured out how to upload a file to a fixed directory, and I have figured out how to send a file as an attachment.
The interesting part begins when several users compose e-mails at the same time. I can't pile attachments from different users into the same fixed folder, because of possible file name collisions. I could create an individual folder for each user. Perhaps, I could use GUID to make unique folder names.
Surely, I'm not the first person with this question, and I'm trying to avoid reinventing the wheel.
 
5:21 AM
@AndreaFaulds Nice! It isn't clear, though, that NULL is only accepted if a parameter is explicitly given a default value of NULL.
 
need help
I have this table
mytree

pid   mem

0        1

1        5

1        6

5        7

5        8


7        9


7         10
public function display_children($parent,$level, $rec = array()){
    try {
        $cmd = $this->connection->prepare('SELECT mem,pid from mytree where pid = ?');

        $cmd->execute(array($parent));

        while ( $row =  $cmd->fetch(PDO::FETCH_ASSOC)) {

            $rec[] = [['v' => $row['mem'], 'f' => $row['mem']], (string)$row['pid'], $row['mem']];

            $rec = $this->display_children($row['mem'], $level + 1, $rec);
        }
    }
    catch(PDOException $ex){
        return $ex->getMessage();
this is my first call echo json_encode(display_children(5, 0));
how can I include parent id 1 and memberid 5 ?
something like this
parentid  memid

1           5

5           7

5           8

7           9

7           10
 
5:36 AM
Hello anyone there
 
I am here
 
$match=['user'=>'anotheruser'];
$ch=Role::where($match)->first();
var_dump($ch->toArray()) ;
$check=Hash::check('test',$ch->password);
return var_dump($check);
@JRizzly It always return false
while $ch returns a row
 
I hope someone could help me
 
6:37 AM
Morning
 
indeed
 
Well, .net might be a good platform but it sucks so much for web development... Mostly caused by IIS...
 
7:12 AM
morning
 
7:22 AM
morning
 
hmmmm
 
pretty well. We had christmas staff party yesterday. I'm proud that I didn't drink too much.
what about you?
 
OHoO sry just edited in a hurry cn't chnge it back...!!
AhOOO It's been going well till now in winter....!!! :)
 
Hi 0/
 
Yes @Leri. That's why I don't like .net :P
 
7:27 AM
Is this query heavy?
SELECT tmp.id from (select users.id FROM friends join users on friends.user2 = users.id WHERE friends.user1=:user_id
UNION DISTINCT
SELECT users.id FROM friends JOIN users ON friends.user1 = users.id WHERE friends.user2=:user_id)
AS tmp JOIN friends ON tmp.id = friends.user1 WHERE friends.user2 = :my_id

UNION DISTINCT

SELECT tmp.id from (select users.id FROM friends join users on friends.user2 = users.id WHERE friends.user1=:user_id
UNION DISTINCT
SELECT users.id FROM friends JOIN users ON friends.user1 = users.id WHERE friends.user2=:user_id)
 
I have simple question about laravel guys
 
pastie and pastebin not opening sorry.
 
Well I have prob with Hash::check as for default User model it's working great but when I make my own It always return false even giving the correct one
here's the code
$data=Role::create([
'user'=>'hello',
'password'=>Hash::make('test')
]);
$data->save();
$match=['user'=>'hello'];
$ch=Role::where($match)->first();
$check=Hash::check('test',$ch->password);
return var_dump($check);
 
looks correct to me at first glance. Do you have the Role Model in $ch?
have you tried dumping that?
 
well am able to get the record back when I dump the $ch but when I try to check for the password with hash it always return false...
 
7:32 AM
try echo $ch->password
 
everything is fine with $ch that echo password aswell
 
posted on December 19, 2014 by kbironneau

/* by Capim */

 
I don't why does it work for the default model but not for a custom model??
 
I've no idea dude. On which framework you are doing this?
Otherwise, just try: if( Hash::make('test') === $ch->password )
it isn't proper solution though
 
7:38 AM
hey guys, whats the best way to check if today is the first day of the month? anyone that has a quick answer etc
 
well am using laravel 4.2
 
I actually need to check if today is the first day of the month and if it is then reset the rate.
 
Day of month on current date maybe
 
@user2736704 what's the output of strlen($ch->password)?
 
@E.H.B.
try,

if( date('j',time())==1 ){
echo "Yes, its first day of month";
}else{
echo "No, it isn't";
}
 
7:42 AM
god 2 received two secret hats and an answer at the same time, must be my lucky hour lol, thanks trying now
 
lol. gud luck
 
@user2736704 your field that you store your password in needs to have 60 chars
 
@ThomasDavidPlat that's returning 8
 
cool, yep worked well thanks @RaviDhoriyaツ
 
while password is 4 char
 
7:45 AM
don't star random messages please ...
 
Welcome @E.H.B! :D
You could mark it as star.. lol
 
Well then, that's the issue. Hash::make('something') returns a hash with a length of 60 characters
make sure that your database is designed properly so that you can store it
 
just a little correction,
make it as--> date('j',time()) === '1'
ok @JoeWatkins. Sorry!
 
Oopps sorry I was using 40 length for that @ThomasDavidPlat Thanks
 
you're welcome
 
8:05 AM
Good friday roomies
 
moin PeeHaa
 
o/
 
if a book has several attributes like e-book-price, comes-with-cd-price, should they all be stored in the book table? or should they be stored in another table as multiple rows - one row for e-book-price, one row for cd-price etc
 
8:20 AM
if you certainly know that there are only going to be these two price categories I would store them in one table
if you know that you will need multiple price categories in the future you'd like to probably create a price_categories and a book_prices table
 
@ThomasDavidPlat nobody knows anything certainly... if one or two prices do get added, more columns can be added too, right? there will be a lot of nulls if I keep them in the same table, which should not be too bad, right?
 
Good morning
 
@user3692125, if there will be lot of different prices and it varies per product I'l go for storing in serrate table as individual rows.
 
currently there are 5-7 prices already, lol
so a lot of null's definitely are there
 
then go for it. Store in second table.
At-least one price must be compulsory, that you can keep in same table.
 
8:27 AM
yeah, one price is there
 
ok. (y)
i'm first time on chat. Emoji won't work? :/
 
lol Ravi
 
Good furdays
 
indeed
 
8:31 AM
Yeah, this Friday and then rest till 4-th
 
@user3692125 @RaviDhoriyaツ that's still no good database design. Why don't you do it right and go with seperate tables?
 
Yes! But keeping one price field on product table, and other prices on separate table won't hurt much though.
 
Put yourself into the position of a developer that joins the project later. He finds books in the database where prices are stored in that seperate table and thinks all the prices for all books are there. But for one Book that has a price of X there is no entry in that table, because it's set in the books table.
 
Ok, Understood ! Correct.

Thanks :)
 
first cv-pls tag on this friday: no rebecca black \o/
 
Hi,is that any moderator here?I have a question
 
@ThomasDavidPlat :D
@Hbirjand No mods in here are awake atm
 
OK thanks
 
Hello All
 
9:16 AM
Hi
 
Hi Thomas Can you help me on website tracking
how to trace website users with php
I mean can I get browser info and machine info of user accesssing my website
 
@androidBeckhamania of course u can
it`s called pixel tracking
of course u can use logs from your web server
 
zan
@PeeHaa everyone is down voted in that question lol
 
@Hbirjand what question
 
Hi @kirugan pixel tracking do I need any external software of code for that
 
9:20 AM
@PeeHaa haha, danger question - all answers are downvoted
@androidBeckhamania nope
 
@androidBeckhamania php.net/manual/de/reserved.variables.server.php - That's all you'll find out about the user. And it's not even reliable.
 
well there is many subtleties in tracking pixel
p3p header, cache headers
and so on
 
@ThomasDavidPlat unacceptable!!1 rebecca.blackfriday
4
 
depends on which user information is needed.
 
lol WTF. uhhhhhm no. There is no sane way to correctly sanitize a complete query... If you think that is possible you are doing something horribly wrong. — PeeHaa 9 secs ago
 
9:22 AM
pixel tracking is just a 1x1 pixel image loaded from the client like this <img src="//yourmegadomain.com/pixel.php">
 
@Gordon \o/
 
@kirugan I still dont get you
I mean the above link was for php $_SERVER
 
especially HTTP_USER_AGENT @androidBeckhamania
 
I want user details accessing my site
 
such as?
 
9:24 AM
such as Machine name ,Location
 
@kirugan why are you so obsessed with pixel tracking? There's nothing to it that cannot be tracked anyways by parsing header information.
 
You can get some information from $_SERVER
like, IP, referer, User'agent (browser)
 
So is there anything with google analytics with that
 
@ThomasDavidPlat because you can get a lot of information about resolution, type of network, java installed, flash installed and so on from client
 
Allright christmas present for my father = Check!
 
9:26 AM
of course if you need only user_agent access logs is just fine
 
nope I need as much as I can get location , machine name and anything what we can have
 
^ OP doesn't listen and critique on his answer is trolling
 
@androidBeckhamania take a look at stackoverflow.com/questions/13079666/…
 
Just realised that I've mailed a stuffed toy to a guy named "Krak Joe". Hope it gets there in one piece @krakjoe #NotADrugDealer
 
heheheheh
 
9:32 AM
posted on December 19, 2014 by kbironneau

/* by Cyrus McDugan */

 
hahaha @PeeHaa
 
whatup
 
@Fabor Yo fapore
 
morning
 
9:43 AM
@Fabor Did you see my ping yesterday?
 
Negative
 
@PeeHaa hahaha
> Do you know where $sqlInsert is going? Maybe it's getting prepared soon! Again, the questioner didn't asked for security
 
@FlorianMargaine lol somebody actually went for it :)
@Fabor Was it audiolock you were working for?
 
made me laugh so hard it knocked my clothes backwards like kriss kross
 
@ThomasDavidPlat Yeah OP is fucking retarded :P
 
9:44 AM
So how's your career as a security-audit seller going? :D
 
@PeeHaa It's who I currently work for too :P
 
@Fabor I hate you! Let me grab something
@Fabor asshole
;-)
 
lol. Buy your damn music. It's not that expensive.
 
:D
Funny that I may have helped with the request against my own proxy :P
 
9:49 AM
@Fabor Ow wow somebody took the first place from bpi
You people also have been more busy then before I think?
 
The stats are largely about what content you have to work with.
 
@Fabor Meaning music has the most issues or people are stricter about music?>
 
We protect (fictitious number) 20 tracks. BPI may protect 2000. They have a LOT more content to search and take down for.
A lot of this business is winning the right to protect peoples stuff.
 
Ah yes
 
Ratio wise we pwn a lot of those (if not all) guys.
And we do solely music (atm)
Some of them are protecting software, porn, videos etc.
 
9:52 AM
I want to protect porn. It's super important the artists get paid what they deserve :)
 
lol
 
10:04 AM
What I have always wondered is how the payment structure works for companies like yours @Fabor. Do you get paid by url? successful takedown? fixed fee?
 
Companies ask us to protect their music.
 
range of how many tracks you protect?
 
Unsure if I am allowed to say tbh. :-/
 
@Fabor Holy shit £6
 
10:14 AM
£5 high priority or £1 back catalogue.
 
oh I see
 
pcm
 
Now I want to start my own takedown company :)
Although I assume the market is pretty much filled already
 
It's not filled but still entering the market is difficult. And expensive server wise.
 
10:28 AM
@Jimbo monring
 
There's a reason why some of the top takedown companies are also the content owners.
 
yeah
 
If you want to do it though you can move to Southampton and we'll hire you ;)
 
mornfriringsday
 
@Fabor do you hire remotes?
 
10:35 AM
@Fabor :D
@DaveRandom Afternoon...
 
I'll Rebeccaroll you, don't think I won't
 
@FlorianMargaine used to but not anymore unfortunately.
 
Not since The Incident
 
"lol am lulsec" -- i laughed so hard, when somebody told me that and threatened me on an irc. :->
 
@DaveRandom :) YW for take downs :P
 
10:36 AM
LOL
 
@DaveRandom blog post to document the git rebase reorder + squash feature :)
2
 
dammit
I knew that was coming as well
 
you like my writing? :>
 
10:39 AM
I particularly like how you stress the dilemma of where you need to locate your posterior during the process
Also I agree with you on the importance of a good breakfast
 
that's very important.
 
Bet those badboys keep your feet warm.
 
Going boarding?
 
GODDAMN. I fall for it every single time. FK it I'm out :D
 
hey guys when trying to log out at first attempt it fails and when the same page is reloaded again then log out works and take me to the Login page
I get this error at first
Column not found: 1054 Unknown column 'remember_token' in 'field list' (SQL: update `login` set `remember_token` = ZyA54O9ERW09aie4PuxqydUCKja4FfWd6Cf2hhMhdOUoy2tj5kzY5UoUSLSj where `id` = 27
Using Laravel 4.2
 
10:52 AM
@user2736704 The error is pretty clear me thinks?
 
what's unclear about the error message? :)
 
The questions is then why It get log out in second attempt??
 
take a look at the source
clearUserDataFromStorage() is called. Which removes session & cookie data.
 
@DaveRandom Going up Mt Elbrus. Those are mountaineering boots.
Cost half a grand too.
 
Wtf
 
11:02 AM
but the object in the $user property is still untouched (and contains the current user)
 
You could've bought a car instead
 
@Jimbo I'm renting them :P
 
@Gordon heh. Good for slippers. My feet tend to overheat when walking.
 
because it's not null it will call refreshRememberToken(). Since you don't have the remember_token in your database it will fail. But cookies and sessions have been cleared before. So when the method is called the next time. $this->user() is called and refreshes the user instance. Since there are no cookie and session information available now $this->user will be null thus refreshRememberToken() is not called again @user2736704
 
11:04 AM
It'd be good to give them as a gift but don't tell the person about the heated part. Just turn it on randomly.
 
http://laravel.com/docs/4.2/upgrade#upgrade-4.1.26 But it says that I have to make remember_token in my database which I don't want that's why I am going for an alternate solution
let em dig in your log out function @ThomasDavidPlat
 
that's not mine. I copied that out from the L4 source
and yes, you have to create a remember_token field if you want to use Laravels Guard. It's as easy as that :)
and if you want to do minor changes make use of inheritance, inherit from Guard and override the methods that make use of the remember token
however I wouldn't really recommend doing that, because that remember_token adds a power level of over ninethousand to your security.
 
@ThomasDavidPlat drop a link of log out function of laravel web
 
I think I gave you a few good shots :) Further research has to be done by yourself, young padawan
 
11:14 AM
OK thNAKS @ThomasDavidPlat
 
11:42 AM
:-P
 
=] @webarto congrats
 
Just stumbled upon this question on zend-php.appspot.com (not sure if they have actual zend cert questions though) : "What is the best way to ensure that a user-defined function is always passed an object as its single parameter?"
And the right answer for some reason is this: function myfunction(stdClass $a)
 
@webarto well done ...
 
Thanks @RonniSkansing @JoeWatkins ... 5.5 questions are much better (harder, many gotchas), shout out to @ircmaxell.
 
@nikita2206 Bad question is bad.
 
11:51 AM
@JoeWatkins Sorry for not saying hi the other day, I somehow short circuited 'puter while putting it in briefcase and thought it was kaput, it "came to its senses" the next morning.
 
Could I still be of service to you?
 
@webarto Which truck did you buy that off the back of? And by "buy" I of course mean heist.
 
@nikita2206 Fake and gay.
@Fabor I don't always take exams, but when I do :-P
 
@nikita2206 lolwut
@webarto I think you had a bunch of practice ZCE questions didn't you?
 
11:55 AM
@DaveRandom No, zero practice for this one (5.5).
Aaaaand shut the fuck up :-)
 
:-P
 
Like I was a hacker or something.
 
I have an exam voucher, need to comprehend generators before I try and take it though
Other than that I would hope I could pass it
There's probably a bunch of questions about extensions I've never used though...
 
No generators mate, just traits, password_hash, PDO, opcache is mentioned, etc.
 
@webarto Congrats! For everyone else... ZCE 5.5 exam coupon 50% off!
 
11:58 AM
Dude... I had zero dedicated practice for it... me... you're much better than me.
@salathe HAHAHA
 
Oh yeh, I would need to memorise the stupid traits syntax for choosing a member when there are conflicts
You know, that thing that literally no-one ever has used in a sane piece of code
Or possibly just ever
 
@DaveRandom or just answer with "F*** traits, man!"
 
curl --head -kiL bit.ly/zend-cert-room11-coupon
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Fri, 19 Dec 2014 11:59:30 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 119
Connection: keep-alive
Cache-Control: private; max-age=90
Location: rebecca.blackfriday
Mime-Version: 1.0
Set-Cookie: _bit=54941322-00031-042db-451cf10a;domain=.bit.ly;expires=Wed Jun 17 11:59:30 2015;path=/; HttpOnly

HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Fri, 19 Dec 2014 11:59:30 GMT
Content-Type: text/html; charset=utf-8
 
@webarto :)
 

« first day (1525 days earlier)      last day (3409 days later) »