« first day (1380 days earlier)      last day (3571 days later) » 

12:00 AM
I'd forgotten how good Archer is
btw @Fabien is that on your TV radar? ^
 
Yeah. That and Bob's Burgers
Also waiting for more 'Rick & Morty'
 
@DaveRandom get a bike
 
I really really need to starting biking to work
 
As soon as the weather cools...
 
Ridiculously the only reason that I don't is that I don't own a helmet that fits, because apparently my head has grown a lot in the last 4 years
 
12:05 AM
I bought a cheapish bike, the quality is good enough. Payed about 140eur plus 20eur for the lock. One year and I just changed a wheel for 30eur because of a small accident. I guess < 200eur per year is quite a good deal. I use it for everything, going to school, work, shopping, training etc...
In the netherlands, no one uses a helmet :P
 
In the Netherlands helmets use you!
 
In the UK, helmet is a legal requirement
And the police actually do something about it
Plus I'm not a huge fan of being killed
Tried it once, wasn't my thing
 
hmmm I see... Well no big deal, except maybe for the sweat for long rides or ruining my hair with gel
hehe "being killed". Have you seen how they ride bikes here?
 
Actually you don't need a helmet any more Dave.
 
If I gel'd my hair I would use a tub a day
 
12:08 AM
I always assumed you did until a few months ago.
 
@HamZa Yeh cars are king here
My route to work is pretty dangerous on a bike as well
 
I know that feeling...
 
Yeah a few Room 11'ers have been in cycle accidents
 
Does anyone recommend this leanpub.com/… // Looking at @tereško
?
 
@HamZa I have not read it but I know that the author says things I like and seems competent
 
12:16 AM
I see, thanks for the headsup
 
@HamZa he posts a lot on reddit - reddit.com/user/pmjones/comments/?sort=top
And doesn't appear to be dumb.
 
lol certainly not
 
He was on the town hall with rdlowrey
 
That's where I got the title of the book
 
oic
 
12:19 AM
@HamZa He was on PHP Town Hall with Daniel.
 
I literally just said that :-P
 
@DaveRandom It's late, give him a break :P
 
lol I was making a coffee while you said it :p
Reading what's already been said sounds like a lot of effort.
@HamZa If it's any relation @tereško disliked his ADR.
 
@Fabien I had to google ADR :P
 
Yeah. It's not overly specific. If you use chat search you'll find some history also.
 
My power stations! Noooooo!
Didcot is 20 minute drive from where I grew up.
 
 
1 hour later…
1:47 AM
@ircmaxell awesome
I wonder if I have altitude phobia
 
noight @HamZa
 
@PeeHaa gnight
 
2:57 AM
@ircmaxell : do you have plans/ideas for any new blog posts any time soon
 
 
3 hours later…
6:08 AM
@Fabien because it is a pointless TLA for minor variation on "rails-pattern"
@HamZa I will review it, if you can find me a torrent (there is no free sample)
 
6:48 AM
morning!
I am am trying to deploy a laravel site online it is working fine on my localhost but on it is not showing me nothing?
this is my site viralamazingvideos.com/merapakistan and it is giving me 500 error!
 
7:18 AM
stackoverflow.com/a/24976351/3459110 <-- guys is the xss prevention technique this answer discusses completely fool proof?
 
morning
 
mrnigning
 
@AwalGarg no
 
@Ocramius then? what should I do? Any tutorial I found from googling is giving me the same function no matter what.
 
7:27 AM
you are asking for XSS prevention, @AwalGarg
escaping depends on context :P
 
@Ocramius ok. I will do more research then...
 
You can look at framework.zend.com/manual/2.3/en/modules/… - we put some basics in there
 
@Ocramius ummm. context as in? I am not putting the values in database. I use PDO for that... just for displaying it. Presently, trimming the user input, then sanitizing with built in php functions. but I am a bit skeptical if that is enough, cus its easy and I don't get how prevention to such things could be easy...
@Ocramius ok. will check that out right now.
I am not using Zend... is that for theoretical purposes? (still giving a read, thanks)
 
@AwalGarg yeah, the fact that you use ZF is not relevant. The article just tells you about contextual escaping
I also never apply this sort of filtering on user input
I always save data as the user gave it to me (unless the data format is specified) and then apply escaping to output
 
@Ocramius ok. read it. I get it now. the context is combined of all the listed contexts. NOTHING from the user should behave as any other thing than "text". is this possible? or could I only filter in accordance to one of the contexts?
as the doc you linked to says that nothing for css is available in the built in functions...
@Ocramius save where? DB?
 
7:42 AM
/var/root/phpdbg-internal-connection/sapi/phpdbg/phpdbg_rinit_hook.c:67:14: error: use of undeclared identifier 'E_FATAL'
 
8:30 AM
lxr.php.net/xref/phpng/build/genif.sh#27 why is /ext/ hardcoded here? :-(
 
9:28 AM
Hi all.
What's new?
 
10:01 AM
Morning.
From which version is ClassName::class supported? could not find in manual
 
wiki.php.net/rfc should tell you (5.5)
 
nvm.
 
Hi everybody!
 
@bwoebi Thanks. btw, this way was faster: 3v4l.org/fYV3Y
 
Can you help me with whoops lib? github.com/filp/whoops
 
user1804599
TIL ::class.
 
user1804599
That’s useful for setExpectedException in PHPUnit.
 
user1804599
Strings suck.
 
is it possible to filter out some html tags from user input and escape rest? this is for XSS prevention. I am presently thinking of regex but then, a crazy answer on SO says regex can't parse HTML etc... what should I do?
why can't I parse html with regex in PHP?
 
user1804599
 
10:14 AM
@AwalGarg You just want to prevent XSS attack from HTML?
 
@rightfold it doesn't help because it strips those tags.
 
user1804599
Give an example of the input you have and the output you want.
 
@VeeeneX right?
 
@rightfold Are you former suhosin? or am I messing things up?
 
@AwalGarg You can try useful lib for it HTMLpurifier
 
user1804599
10:15 AM
@Leri I don’t know what a suhosin is.
 
@rightfold Never mind. He's user who used to chat here and had similar avatar(s).
 
user1804599
Oh, I see.
 
user1804599
Then you are messing things up.
 
@Leri Is currently @AlulaErrorpone I think
His avatars are always mlp
 
user1804599
Mine were always MLP.
 
user1804599
10:19 AM
But it’s time to get my ass out of my bed and read the last chapter of SICP.
 
input(without quotes): "hello, this is super awesome. 1<2. <script src="badCode.js"></script>... <img src="myImage.ext">... bye!!"
output(without quotes): "hello, this is super awesome. 1&lt. &ltscript src="badCode.js"&gt&lt/script&gt... <img src="myImage.ext">...bye!!"
^this @rightfold
 
@AwalGarg HTMLPurifier can handle this
 
@VeeeneX ok. will try now. is it safe as well? I hope it doesn't have any security issues, because I need to be over paranoid with this.
 
Or you can try this gist.github.com/mbijon/1098477
@AwalGarg
 
@rightfold strip_tags shouldn't be used, ever
 
user1804599
10:29 AM
Document so and deprecate it.
 
I am doing complete real-world php project after a while and I really need scalar type-hint. I wasted most of my time in throwing exceptions if type does not match.
 
user1804599
@Leri I had functions like wantString($a, $b, $c).
 
Is call_user_func_array('array_merge', array_fill(0, $n, $array)); the best way to merge $n times the $array? Or did I miss something better?
 
@NikiC why not?
 
@rightfold Yeah, but that does not provide enough information to the person who messes things up unless you make hooks via debug_backtrace.
 
10:34 AM
is it because of the stated problem in it which causes loss of text input due to bad html?
 
user1804599
Use a statically-typed programming language. :P
 
@bwoebi As in, repeat an array n times?
 
@rightfold :D :D :D Well, this is a project for interview. So I don't have choice.
 
@NikiC yes
 
@bwoebi seems fine
assuming you need an array and not an iterator
 
10:38 AM
yeah, I need an array. for an iterator a for loop nested with foreach would be the way to go I think.
 
10:54 AM
Can you help me with whoops lib? github.com/filp/whoops
 
user1804599
function concat_iterators() {
    foreach (func_get_args() as $iterator)
        foreach ($iterator as $x)
            yield $x;
}
 
user1804599
Oh cool generators have a send method. That’s pretty neat.
 
user1804599
Woot an AST.
 
Morning
 
11:19 AM
@NikiC how complete is that ?
moin @Fabien
 
Hi all, anyone know of a way to create short youtube urls?
 
@DavidSmith There are many ways
 
I've had a look at various posts and they all seem to use extremely large db numbers. But when using short numbers such as 1 or 2, result ends up as a or b
 
Hey @Joe, Any idea about what may be wrong with that php install?
 
So you want to save it to db?
@DavidSmith
 
11:22 AM
@Fabien where's the question ?? I saw it, but fell asleep ...
 
veeenex I have on screen about 6 different pages for various different methods, but they all yeild the same result for short ids
 
configure: error: libXpm.(a|so) not found. but libxpm-dev is installed, I tried --with-xpm-dir=/usr/lib/x86_64-linux-gnu too and --with-libdir=*same*
 
no not saving to db, the other way around
 
php 5.4
 
so I already have an id, example 1, I then want to convert that into a short url example Y23bA and be able to decode it back into 1
 
11:23 AM
Oh ok
 
try --with-xpm-dir=/usr or omit path, you don't need to provide full path like that, that's for linker to detect
 
btw the the ID's are already unique to database
 
@JoeWatkins Have done with same error. I tried all variations between direct and the default.
 
maybe out of date linker cache, sudo ldconfig ?
 
Just SSH'ing in now.
 
11:24 AM
I've read to use base64, and for long db numbers such as 123456789, the urls look ok, but for short id's such as 1, it ends up a
 
What's sudo ldconfig do? return is blank
 
try build again ...
updates caches
 
I was hoping to use short url's as a way of hiding the db id, give it a short youtube style url, also whilst making it hard for someone to guess what 2 would be, so random too. These methods Ive come acorss, 1 is a, 2 is b. so not exactly random
 
@DavidSmith You can use shortcuts like Y23bA, but you need to save it somewhere
 
Trying. Reverted the lib-dir default to /usr
 
11:28 AM
@DavidSmith Take a look on this johnboy.me/index.php?code=1
 
are you on 64bit ??
 
Same issue configure: WARNING: unrecognized options: --enable-opcache
configure: error: libXpm.(a|so) not found.
 
is this a work machine ?
 
Linux Ubuntu 14.04 x86_64 x86_64 x86_64 GNU/Linux
 
So there is no easy of doing it without saving it to the db? Saving it to the db would mean I would need to run extra checks to see if id exists in db
 
11:29 AM
It is.
 
I was liking this very much kvz.io/blog/2009/06/10/…
 
do you need xpm ?
 
What's it do?
 
for manipulation of certain images ... if you don't know you ned it, then remove it from php.defaults, that should get you going ...
 
but the problem was that when specifying minimum 5 characters, id such as 1 or 2 were appearing as BaaaB, 2 was appearing as BaaaC. Those letters in the middle were always same and end letter was always an increment so not random
does that link help make sense what I was looking for?
 
11:31 AM
GD stuff?
 
@DavidSmith I will take a look
 
just remove --with-xpm
 
Is there a comment out char in php.defaults?
 
yeah
 
dnl ?
 
11:32 AM
yes
 
Trying again.
FTR 5.5 and 5.6 were fine.
 
Thanks Veenex, I really can't find anywhere on the net an example how to create youtube like url's for even short id's whilst keeping one number to the next very random
 
/me wonders if the config option changed names ... doubt it ...
 
Et moi. This is my first time using multi on Ubuntu 14.04
 
(it didn't)
 
11:34 AM
A lot of my packages changed from -devel to -dev
 
probably the case that ubuntu have packaged xpm poorly, maybe it's missing multilib ...
 
Seems to be compiling now.
 
Cheers
It's weird because I can find that lib on my machine.
 
np, sorry didn't reply yesterday, I saw it, but was dosed up with codine ...
 
11:35 AM
No worries. Not in any rush to do work stuff on a Sunday anyhoo :P
 
well multilib systems are strange, bet one of the libraries are missing, you probably have x64 and are missing x86 and linker doesn't know what to do ... but that's a stab in the dark ...
 
When do you think you'll hear from the agency? :)
 
hopefully tomorrow
 
Kids get a month to run around the Island before school starts too.
 
yeah, we have to get them into a school also ... shouldn't be a problem if we move soonish ...
 
11:38 AM
Bah build failed and log is empty. Last lines from cli are.

make: *** [/home/cdd/multi/php-build/5.4/no-zts/no-debug/Zend/zend_language_parser.c] Error 1
make: *** Waiting for unfinished jobs....
 
odd
got bison ?
which bison
 
yeah 2.7
Had to manually install it too.
 
cd php-build/5.4/no-zts/no-debug
make
show output
 
/home/cdd/multi/php-build/5.4/no-zts/no-debug/Zend/zend_language_parser.y:50.1-5: invalid directive: `%code'
/home/cdd/multi/php-build/5.4/no-zts/no-debug/Zend/zend_language_parser.y:50.7-14: syntax error, unexpected identifier
make: *** [/home/cdd/multi/php-build/5.4/no-zts/no-debug/Zend/zend_language_parser.c] Error 1
 
there's something wrong with generation, must be bad bison/yacc ...
 
11:44 AM
Potentially seeing as I had to do it manually. There was no apt-get for that version.
 
I got nothin ...
show me how you configured bison ?
 
Care to gTalk it for less spam? :)
 
@DavidSmith and what about pastie.org/9424546
 
Someone just told me he tried to use (function () {})() and thought it already was implemented as the vote passed :-D
 
@bwoebi cast your eyes upwards at mine and fab's last messages
any ideas ?
@Fab signed into gtalk in gmail now
 
11:47 AM
I locally have bison 2.3... with this version it works. maybe 2.7 is too new?
 
thanks let me take a look at it, is it the full code or a certain section of the code altered?
 
@Joe Sent a message to pthreads.
 
@Fabien go with what bob is saying, he's probably right ...
 
@DavidSmith it is selection and I've used var_dump(Routes::alphaID('1', false, 3));
 
yeah I have 2.3 sorry. I had 2.7 originally then downgraded again when it didn't work.
 
11:49 AM
cool lets have a look
 
ah well ... how did you downgrade ?
 
removed it then followed this
 
@DavidSmith Here is full code but it can only convert nums to that short code pastie.org/9424555
 
@Fabien you removed everything installed or just binary ?
 
Unsure. I'd have done apt-get remove
 
11:51 AM
you copied those instructions exactly ?
--prefix=/usr/local/bison cannot be right on any system
 
I did.
bison -V works and returns bison (GNU Bison) 2.3
 
what's in /usr/local/bison ?
 
bin info lib man share
 
remove /usr/local/bison
reconfigure --prefix=/usr
make distclean first
 
So remove, clean, reconfigure
 
11:54 AM
yeah then make install, then try building again
I got notification on my phone but nothing on laptop for gtalk ...
 
yeah gtalk is weird about double logged in things
 
also it disappeared
 
lol.
Okay, going to run configure again but set prefix to /usr
not /usr/bison ?
 
@DavidSmith But if you want to validate it is little bit harder
 
not /usr/bison ... that's really weird ...
 
11:56 AM
What about the libiconv-prefix ?
 
cool that looks to work with short or long. When you say only with nums, my checks here will almost 100% be against a database id so will always be a num. My final question would before I go start analysing your code, is this method efficient and quick and should be unique at all times right?
 
how was iconv installed ?
 
./configure --prefix=/usr/local/bison --with-libiconv-prefix=/usr/local/libiconv/
part of bisons
 
so iconv wasn't apt-get installed ?
those paths are wrong, they are wrong on any normal system, unless you configured iconv strangely at /usr/local/libiconv then that prefix is also wrong ... probably --with-libiconv-prefix=/usr is correct
 
when you validate, all i will be doing is $_GET the url, decode it to a rowid number to check the database for other details
 
11:59 AM
@JoeWatkins Don't believe so.
As in it wasn't apt-got
 
@DavidSmith This is better pastie.org/9424564
 
so you installed it ?
 
Nope.
 
iconv --version
 
@DavidSmith I'm not sure about it's unique style but maybe it should works :D
 
12:00 PM
iconv (Ubuntu EGLIBC 2.19-0ubuntu6) 2.19
Installed.
 
okay use normal prefix --with-libiconv-prefix=/usr
 
configuring now.
 
afk 10 minutes, I'll be back ...
 
Cheers Joe :)
 
@DavidSmith But maybe it's unique :D
 
12:03 PM
how can I check to make sure that at any given moment that the short code will always equate to one id
btw thanks I can see what you've done by appending extra values
 
@DavidSmith Sorry I didn't understand your question
@DavidSmith Yeah, I just appended extra values because if input is 1 the code will output bac but you want something random like JmWd
 
That's fine, was asking about uniqueness between database_id & encoded_id
but as far as I can see the code is set to be unique
by appending the extra values, is it not decreasing the number of available possible encoded_id
 
I feel really awkward every time I register type in my DI, because I have to type $dic. :D
 
looking to understand based on the appended values, what is the total number of id's I can obtain
 
@DavidSmith I think it is unique but maybe you should add detection for '589556' and append another number to it
 
12:14 PM
@Joe Same error on php build
 
How can i done something like this ? $app->get('/hello/:name', function ($name) {
echo "Hello, $name";
});
I mean function ($name) { echo "Hello, $name"; });
 
@Fabien well crap
got u on gtalk
 
user1642018
12:32 PM
hi all
 
user1642018
i have a quick query
 
user1642018
do i have to do htmlentities on user input search term before using it in db ?
 
Yeah
or use pdo
 
user1642018
@VeeeneX thanks,
 
@AMB You are welcome
 
user1642018
12:44 PM
@VeeeneX but my data in db isnt htmlentities , so if user is searching with query < htmlentities will make it &lt and it will try to search for it in db.
 
user1642018
i am already escaping the user inputed data.
 
@AMB you want to prevent SQL injection right?
 
@rdlowrey you mentioned before that sometime the Artax client may keep the reactor open because of a connection being kept alive (or something similar). Is there something I need to do to tell either Artax or a native reactor that if they don't have anything left to do themselves, to shut down any held resources and let the reactor->run() finish?
Basically I'm seeing the reactor->run() just sit there apparently forever with nothing to process.
 
user1642018
@VeeeneX yes, thats why iam using real escape string with some other extra chars escaping.
 
user1642018
but i dont see the point of using htmlentities while searching in db , i may be wrong.
 
12:55 PM
So, hotel boat, cool or lame?
 
@AMB Ok so then you don't have to use it
 
mornign
 
Yohaa
 
1:36 PM
It looks like I threw in some random words, but I assure you, I have not.
 
@Fabien ping
 
someone help me please,, see this : stackoverflow.com/questions/24981153/…
and mark it as not duplicated question please. Im really stuck with that problem. Someone here could help me there..
 
1:52 PM
@AldryWijaya This isn't a code writing service. Even if that question isn't an exact duplicate, it's a suitable question for stackoverflow.
 
lolwat
why can't you set an object as default argument?
 
0
Q: How to use the URL ignoring controller's default behavior in codeignitor?

OM The EternityI have a CI codebase in my localhost whose URL is http://localhost/mydomain/site/ here "site" is a folder NOT controller I have DB table data field where locations of certain areas are stored. Ideally when the above URL is hit, the default "home" controller is called. But I Want if user hit t...

 
@Danack : I know right, this isnt a code writing service. All I need is an idea to help me to find that algorithm.
 
@Jefffrey You can't set runtime things as default.
 
@SecondRikudo Everything is runtime in PHP...
 
1:56 PM
@Jefffrey Nope
String literals are compile time.
 
You don't compile PHP with mod_php
 
Literals, in general, are compile time (numbers, arrays, etc).
 
What do you mean by "compile time"?
 
@Jefffrey "Things that don't need to run the program to determine what value they are"
 
Any suggestions guys!!! in my question above
 
1:59 PM
Variables are runtime, objects are runtime, while literal values are compile time.
 

« first day (1380 days earlier)      last day (3571 days later) »