« first day (2020 days earlier)      last day (2931 days later) » 

12:03 AM
For the first param in setlocale() can you add multiple values separated by a vertical pipe? Or do you have to choose just one from the documented list?
 
@crypticツ if the constants are powers of 2 they're probably bit flags you can | together.. check their values and give it a shot if so
 
hope =o( it's 0-5
Does that mean I can use multiple setlocale() calls one for each option?
I don't see any examples of that being done.
 
yes, you can use multiple calls to address the options individually
 
thanks!
 
@crypticツ you almost certainly don't want to use that....it's not safe.
 
12:12 AM
@Danack what do I use? I'm using gettext()
 
@crypticツ I think the Symfony translation module might not be too awful....
I actually really ought to got to sleep......setlocale breaks stuff serverphorums.com/read.php?7,1172968
 
I'm using Twig's i18n extension. I looked at the Symfony's and afaik it doesn't use po/mo files and I have to manually enter in the keys and translations into arrays. With poedit I can scan my files and extract the keys to update the catalog.
 
Ekn
12:31 AM
That'd be a boring work if you would have to enter many in arrays
 
it supports YAML files as well, but still you need to manually make them afaik.I'd rather scan my Twig files and have it generate a .po file with all keys and I need to just enter in the translation and compile to .mo
 
@Wes Isn't that the same issue. I'm manually having to enter in each key. I'd rather just write my templates and use the 'trans' filter at all user output, so xgettext can extract them all for me in one swoop.
 
Wes
ah. well, are you emotionally attached to po files? :B they are a strange format and slow
i don't often translate, but when i did, i used a mysql database
that was fast...
so, got a coffee
 
12:48 AM
the only translation I did personally was way back in the day for xaraya (cms nobody remembers), but we had a cool module that functioned kinda like a built-in poedit, but worked with our xml-based system
I translated it to en_BORK... the muppet's swedish chef had the first 100% complete translation of the cms and all available modules
something like 10k strings in the end, iirc
 
@Wes I had thought of db as well, but not sure how best to structure it. Also how do I efficiently fetch the data? I have no real way of telling what keys needs to be fetched for a given view so I would need to fetch all of them. Won't that be a performance impact, especially if there are large blocks of text that is being translated?
Let's assume 500keys from small strings to paragraphs.
 
Wes
the few sites i have with localization are super crazy now. basically the client customized many of the strings changing the meaning of the sentences entirely, in four languages... then they understood they should create new ones rather than modifying the existing entries.... but they forgot to delete unused ones... so it's a complete disaster now. i don't even want to look at it anymore. i think there are thousands of entries now... and the site in question is relatively small
why all of them?
you mean rather than doing a SELECT for each key?
 
@Wes yeah, I'm not sure how gettext does it, if it loads the .mo file into memory, if so might be as ineffcient as fetching all keys from db and storing it in variable.
I know template caching will speed it up at a lot, but for pages that are more dynamic the cache would need to be updated more often.
 
Wes
1:04 AM
do you use twig?
 
yeah
 
Wes
you could have a bundle for each view, rather than one for the whole site, and load only that
localization is hard
...................F........................................... 882 / 956 ( 92%)
.......................................F....................... 945 / 956 ( 98%)
what's your problem at 3:15AM?
 
1:22 AM
unit tests?
 
Wes
found a bug, i think
gawd
ah, no. just being stupid me
 
@Wes so a recurring regression =oP
 
Wes
indeed
Time: 2.61 seconds, Memory: 30.00Mb
OK (956 tests, 7173 assertions)
why you use twig? @crypticツ
 
1:42 AM
@Wes it keeps my templates organized? I dunno, also I use Symfony components so just use it.
 
Wes
i could never get template engines :\ organized how?
 
@Wes you might like mustache, nice and minimal
 
Wes
tried mustache. it's like 1000 times slower than plain php :B micro fractions of a second... but still 1000 times slower...
 
well, then you might like C. total pain in the dick to work with strings, but plenty fast.
 
Wes
i used ext/spidermonkey (mozilla js engine) once for templating. felt dirty
i would like a php sandbox to run within php though
with no functions in it, except those i register explicitly to be usable
> iterator_to_array() gained support for key types other than integer and string when the use_keys parameter is enabled.
 
Wes
2:46 AM
ever happened to you that you have an interface and you want to implement just a subset of it? for instance an interface from 3rd party code
interface Bar{
    function a(): int;
    function b(): float;
    function c(): string;
}

subinterface Baz of Bar{
    function a(): int;
    function b(): float;
}

function test(Baz $baz){}
test(new class() implements Bar{ /* ... */ }); // autoloads Baz and checks if Bar is a supertype
test(new class() implements Baz{ /* ... */ });
i know it's mad :B
 
Wes
it's not mad? :B
 
 
2 hours later…
4:38 AM
hello
 
5:03 AM
moin
 
moin
Off to work in a few min
hope you have a great day
 
mornin
 
hello guys
print <<<USER_PROFILE
<div class="row">
<div class="col-xs-12 col-sm-offset-3 col-sm-4">
$user->getName()
</div>
</div>
USER_PROFILE;
 
posted on April 27, 2016

New Cyanide and Happiness Comic

 
5:09 AM
What going wrong with this code
?
 
Wes
!!google heredoc php
 
Hi is there any free api or class with which we can get social detail of any email id ? i have a email id and i want to fetch its social detail from FB, LinkedIn, Instagram, Google Plus. all others social network also
i Google many time but did not get
 
> According to Time's translation of the Chinese newspaper People's Daily, the bots use "sensors that mimic the human brain, eyes and ears."
no, no it doesn't ...
 
5:33 AM
Hello!
 
@gtzinos {$user->getName()}
 
@littlepootis Thank you very much
 
Did that work?
 
Can somebody check the url
 
you are not sending a range ...
or requesting one from the video endpoint ..
 
5:39 AM
Yes exactly
that is the problem
 
good, then you already know what the problem is ...
I'm not sue why you asked the question :)
 
Because I dont know how to pass on the range through php
 
header?
 
Lol
I had stared learning PHP 4 months ago
But there is still yet to learn.
 
I haven't PHP in 4 years
 
5:43 AM
So I have no Idea what you are taking about
 
2, technically, but still
Or is it 1
 
?
Sorry for not understanding what you are saying
 
header("Content-Type: video/mp4");
header("Access-Control-Allow-Headers: If-Modified-Since,Range");
header("Access-Control-Expose-Headers:  Accept-Ranges,Content-Encoding,Content-Length,Content-Range");
header('Accept-Ranges: bytes');
header("Connection: close");
why did you remove these?
Content-Range is a HTTP header, like Content-Type, which you're apparently sending.
 
yes
ok
 
no no no
 
5:46 AM
Also you'll need to get Range
@JoeWatkins no?
uh
 
the client will send Range: bytes=start-end, you send same header to video endpoint, check for 206 in return and send Accept-Ranges, Length, and Content-Range
look up those headers ...
 
need to pass the range on to the curl
 
ormin
you ought to check that you can seek the original video file when played from the original server, not everyone supports ranges ...
moin ekin
 
thank you
very much
 
Ekn
5:58 AM
moin joe
 
I am searching the php.net manel for these functions
 
6:13 AM
Hey joe
 
C G D A E
 
Moin
!!rebecca
 
@Saitama Only 1 days, 17 hours and 36 minutes left until Rebeccaday, OMG!
 
\o/
 
\o/
 
@JoeWatkins check this out
https://whatsmag.com/test.php
Still has some errors
 
6:59 AM
hi all I am new to php and I just started out and am heading into errors
<?php

$heading = ‘hello world\’;



echo “<h1>$heading</h1>”; ?>
this is what I am trying to print but it keeps on giving me unexpected T-string error
can some one please explain to me why I am getting this error
 
Anonymous
<?php

$heading = 'Hello World';
echo "<h1> $heading </h1>";

?>
 
o/
 
Anonymous
o/
 
how was my code any different? :(
 
7:04 AM
hiorning
 
it lacks o/
 
o\
 
you're escaping the ' with a backslash and your apostrophes and speach marks are not ' and " but some different encoding
 
@FélixGagnon-Grenier it lacks the presence of rebecca
 
7:05 AM
@FélixGagnon-Grenier Only 1 days, 16 hours and 54 minutes left until Rebeccaday, OMG!
 
is it because m working in a textedit?
 
Anonymous
@shivangikulshrestha sublimetext.com/3
 
download notepad++, it has syntax highlighting and other useful stuff, but is still just as simple as notepad
or sublime is great too
 
has anyone tried passing parameters to a PdoStatement using both bindValue and optional execute() parameters?
 
7:07 AM
EMACS_MASTER_RACE or VIM_MASTER_RACE
 
they dont have notepad++ for mac :(
 
@nevernew notepad++ is an ancient piece of shit
 
@tereško no. has it got anything interesting?
 
okay m gonna try sublimetext
 
@FélixGagnon-Grenier I am just wondering what is the behaviour ... the docs are a bit ... emm ... stingy
 
Anonymous
7:08 AM
I used to like notepad++ but it started to crash a lot.
 
@shivangikulshrestha atom.io is a good alternative to sublime too
 
@tereško I... don't know if it's shameful, but I've never even used bindValue
 
^^ that's what I am using currently (with a lot of minimap extensions)
 
i've never had a problem with notepad++, sublime is more popular these days though
 
7:10 AM
@FélixGagnon-Grenier have you used bindParam()?
 
Hi Guys, I am looking for the solution for this problem, i have a large static text content. These text content how to send in webservices? Is HTTP will accept it
is there any another way to sending
 
@tereško neither. I essentially use :parameter thingy
 
bindParam and bindValue use :parameter thingy too
 
how is it any different from just passing them as an array to execute()?
 
Anonymous
@user3454479 Paraphrase.
 
Anonymous
No.
 
@FélixGagnon-Grenier execute() binds all values as \PDO::PARAM_STR (with no length restriction)
 
@samayo sorry i didn't understand
 
@Saitama I like good beer and wine ... php is just what I use it to ensure a steady supply
 
@tereško ohhh. are there any databases that actually require right types on inserts and updates?
 
7:13 AM
:P
 
the answer can be you suck nvm
 
Anonymous
I feel a lot better now that I'm using Python mostly. PHP is the most error-prone language I've ever seen. It sucks all the joys of life out of you.
 
you are error prone
 
Anonymous
I may try to give go a go soon.
 
go is awesome
 
7:17 AM
well, it took ircmaxwell away, so it must be something
 
@samayo you should try lisp :D
 
@FélixGagnon-Grenier it was not because of goodness of go
it was mostly related to drama
 
Anonymous
@Saitama Ahh no. I actually hate programming, I'm just doing this to build sites, monetize from them and probably use the profession to get a back-up job.
 
Anonymous
In any way, I don't see myself codding in 5 2 years.
 
Anonymous
:)
 
7:23 AM
@tereško so if we forget that other comment, it actually means that for code to be database agnostic, I'd need to bind values to the type they should be stored in.
 
@samayo that must be a very sad life
 
Anonymous
> sad is the new happy
 
what career do you pursue after programming?
 
!!urban sad happy
 
whatchoo talkin bout willis
 
7:26 AM
!!wotd
 
amanuensis: a person employed to write what another dictates; secretary.
 
!!urban orange new black ?
 
whatchoo talkin bout willis
 
:P
 
f*** you @Jeeves
 
7:26 AM
@FélixGagnon-Grenier I suspect, that binding as a specific type might be useful when working with real databases
basically all that can be described as "not mysql"
 
@Jeeves should respond with something when he gets pinged and has the f word in the message
 
Anonymous
@Gordon I've actually worked/excelled as a Freight Forwarding agent in Dubai. I'm mostly interested in Trading, Import/Export, Shipping.. that kind of thing.
 
@samayo what's stopping you from doing that now? why do you need to program instead?
 
Anonymous
@Gordon Not sure if you noticed, but you need a flying academic profile i.e. a degree (mostly masters in supply chain management + experience) to work as one in here. Which I don't have as I quit in high school.
 
Anonymous
It's a pipe dream.
 
7:30 AM
 
morning
 
o/
 
@samayo why did you leave Dubai again?
@Saitama there is even a wikipedia page for the merkel raute en.wikipedia.org/wiki/Merkel-Raute
 
Anonymous
@Gordon Horrible, abusive boss, + I wanted to start my own business. Things didn't work out.
 
@samayo hmm. I might have misunderstood something in your background then. I thought you was some sort of refugee. So, if you don't need a master degree in Dubai, why not go back there and find a non-abusive boss?
 
Anonymous
7:38 AM
Hmm, it's not that easy, and yes I'm a refugee.
 
Anonymous
but there's some hope into the future.
 
Anonymous
import happiness from future
 
now I am confused even more Oo
but nvm
 
heavy shit
 
Anonymous
7:54 AM
mornin
 
Ekn
|x
 
@Gordon I feel sad for people with autisme passing that... It's like a delibarate trigger :P
 
Have a google maps latLng object, which look like

'info_pos' => string '{"lat":51.032180000000004,"lng":7.208290000000034}' (length=50)

After doing:
var_dump(json_decode($r[0]['info_pos']));

out:

object(stdClass)[4]
  public 'lat' => float 51.03218
  public 'lng' => float 7.20829

 As you can see the floats are cutted. Can someone tell my why and i can avoid?
 
you do not want lat/long to be floats. you want them to be strings.
 
8:06 AM
do I? ^^
want to send it to the static api after
 
floats suffer from floating point precision. and if you really need them down to that …004 or …034 you'll get into trouble
 
Hm okay, but how do i get the complete string then. I don´t convert it, just parse it and it makes it to float
 
then again, 51.03218 looks good enough for me as a coordinate. do you really need the parts after that?
 
@Gordon arkanoid
 
hm good Q. I will look. Wasn´t so far yet :D
 
8:13 AM
I'd say you're fine with 51.03218
 
okay, thanks for the advice
 
Quick question, i need to change mysql user privilegies. Running first:
revoke all privileges on *.* from 'user'@'%';
and then the grant query. But question is, will 'user' keep the same password?
 
Monrignm
 
@PeeHaa \o
 
Ekn
o/
 
Del
8:28 AM
Hello programmers!
 
Ekn
no more coffee left... this must be a sign
 
Anonymous
I think nohup is giving me STDs.
 
Morning
 
Ekn
\o
 
o/
Started Elfen Lied \o/
 
8:36 AM
@Saitama :) where did you reach?
 
Just finished ep 1
 
@Saitama What do you think?
 
seems nice...
 
"nice" wouldn't be the first word I'd come up with to describe Elfen Lied
But I'm glad you like it :P
 
:D
does Lucy lose her memory?
 
8:38 AM
Sorta, keep watching :)
 
hmm... :P
!!google madara
 
seems jeeves is sleeping :p
 
How about you @Ekn? Did you make any progress?
Or are you still wondering in Waterfall?
 
or, maybe Pieter hasn't deployed the new commit yet ... ?
 
Yes the latter. QA is working on it :-)
 
8:42 AM
@MadaraUchiha isn't that the serie with the girl with MPD?
 
@Naruto Maybe, are you going to spoil it for him?
 
Ekn
I've been on two other things (including my own game) the last 20something hours... still there yeah but gonna have chance today :)
I got to play don't starve a bit though
 
@MadaraUchiha Monstrous Phase Dependend? ^^
 
Never managed to enjoy that game, I'll be honest
 
Ekn
it goes pretty monotone
 
8:45 AM
@MadaraUchiha there is also a Kurama in the serie ^^
 
Ekn
8:56 AM
How about you, @MadaraUchiha , playing anything nowadays?
 
@Ekn Stardew Valley and Team Fortress, mainly
I have a few anime in my backlog I need to burn though
Berserk and Kill la Kill mainly
 
KILL LA KILL is awesome
 
Ekn
Kill la Kill is on my list too... Berserk was a great one
 
Ryūko Matoi is ----------------------------
 

« first day (2020 days earlier)      last day (2931 days later) »