« first day (2823 days earlier)      last day (2111 days later) » 

8:00 AM
ullage the amount by which the contents fall short of filling a container, as a cask or bottle.
 
@Gordon :P I'm just going to stick to saying fixit upon login
 
@DaveRandom it usually hits me in the evening
 
yeh that's what I'm hoping :-P
 
8:18 AM
morns
@Gordon nice :P
 
@Jeeves also docker
 
8:41 AM
Good afternoon :)
Hey, is anyone here?
 
no
 
Actually, I am bit confused about arrays. So, I just want to know whether I can create some arrays through a FOR loop in php?
@Gordon That was incredibly funny. :'(
 
that's how I roll
 
$array0 = array();
for($i = 1; $i <= 2; $i++) {
$array0.$i = array();
}
print_r($array01);
 
@Sanu_012 that is a very broad question.
 
8:46 AM
you are trying to concatenate a number to an array. that will obviously not work
 
@mega6382 can it be done by doing something like I gave in the code?
@Gordon So how can I make it work? any ideas? :\
 
well, what is "it". what do you want to do?
if you just want multiple arrays, do $array0[$i] = array(). that will give you a multidimensional array
 
I want to make some empty arrays all having different variable names so That I can use them later. Like $array1, $array2 . Like that.
but want to do that in a loop
 
!!rfcs
 
8:53 AM
@Gordon That creates arrays inside the main array. So, basically isn't doing what I want. :(
 
@NikiC, that's a reallllly short voting period for the constants rfc :P
 
@Sanu_012 why do you want that instead of a multidimensional array?
 
@Gordon actually, I was trying to solve an algorithm. but been failed till now terribly:'(
 
Hello all
 
but now I am getting the clue. I can do it your way as well. :*
 
9:01 AM
$name = "array" . $i;
$$name = array()
but I promise, you dont want that. it's cumbersome to use. use a multidimensional array instead.
 
@Gordon What does two $ sign signifies here bdw?
 
variable variables
can also write it like ${$name} to make it more clear
 
@Gordon Yeah seems so. Thanks @Gordon.
 
I am practicing php upload an image and insert it into mysql when I try this code hello world statement doesn't printed
if (isset($_POST['upload']))
 {
  echo 'hello world';
 
@Webdev did you just forgot to give a curly bracket? pun intended
 
9:04 AM
@Sanu_012 It's written !
 
You can try this.
if (($_POST['upload']) == true)
{
echo 'hello world';
}
 
@pmmaga lol
 
@Sanu_012 also It didn't work
 
@Webdev afaik, this should return a boolean true or false. but idk why it is not working.
 
@Sanu_012 my complete code here kopy.io/IYjRt
 
9:10 AM
@Webdev checking it. wait.
 
@Webdev @Sanu_012 From my point of view, neither of you know enough about php to help each other.
 
who killed bugsnet
 
@mega6382 yes. that is the point i see bdw. helping one amateur to another :'(
@Webdev Seems like you put the echo statement before the actual upload is done.
 
@Webdev Your code seems entirely invalid, the form tag is invalid as it doesn't have enctype="multipart/form-data" attribute, the button with the name 'upload' is outside the form etc and many more. Check some online tutorial on how to upload a file using php to get a better idea.
 
@Webdev my naive assumption is you are sending a get request instead of a post
 
9:18 AM
It's a request for an image and insert it into to mysql db
 
@mega6382 Sir, did you learn to code on your own or you itself are from IT background? Just curious
 
@Webdev also Store_Image seems to be a input field of type text, which doesn't make sense either.
 
hmmm
 
@Sanu_012 Somewhat both, I would say.
 
@mega6382 OH. You managed well. I must say
;P
 
Wes
9:25 AM
mornings 2
 
mornings
@mega6382 Store_Image seems to be a input field of type text What line?
 
22
Also, it seems that you are using angular, and I have almost no experience in that. So, that might be manipulation the DOM in ways that I am not understanding, or something, I don't know.
 
@mega6382 Angularjs
 
Yeah, that's what I said "angular".
 
but I don't think it affects
@mega6382 I corrected it to <input type= "file" any error else?
 
9:40 AM
I'm pulling my project on my server (ubuntu) .. it throws this:
Any idea?
 
free -h
seems likely your vm is oom, as it says in the error message
 
emm, TBH I don't know what's oom .. you mean pulling that repository on my server is not possible?
 
out of memory
 
ah
so I have to buy a server with stronger RAM ?
 
try restarting the server.
 
9:45 AM
seems likely, but you could also check, with free [-h], and possibly kill some other process ... me thinks a server that doesn't have enough ram to pull in a php repo doesn't have enough ram to execute it ...
 
ah .. yes probably it is involved with other processes .. noted that my server has 1GB RAM
Any no, there isn't any other process
 
get more ram
 
ok ..
 
for a git pull?
that sounds crazy
 
and fix bugsnet while you're at it
 
9:49 AM
@Shafizadeh What kind of server are you using? is it a managed server? or dedicated?
 
It is a VPS
@FlorianMargaine as you can see pulling doesn't happen
 
@Shafizadeh from which provider?
 
Hetzner
 
@FlorianMargaine has 290mb of free ram ...
 
@JoeWatkins I guess that number is used ram, not free space
 
9:51 AM
@Shafizadeh Try switching to AWS EC2. It is much more scalable..
 
oh yeah right, it's still a crappy amount of ram ...
 
@mega6382 I cannot do that until the next year .. I bought this server for 1 year
 
@Shafizadeh can't you get a refund or anything?
 
git doesn't use a fancy memory allocator, the only way it can report oom, is that the system is oom ...
 
@mega6382 Not sure .. since it needs a credit card and getting it is really hard in my country
@JoeWatkins yeah .. actually I'm trying this stackoverflow.com/a/41122974/2805376
 
9:53 AM
ah that may work ...
actually I'm not sure if that will help ...
 
Testing
 
that seems unrelated, the error message clearly says it tried to call malloc, not mmap ...
 
just one question, how can I restart the git after modifying its configuration?
 
I think you shouldn't need too ... if you do git config [whatever] and it reports the correct values (and it should) then just carry on ...
 
@JoeWatkins yes .. it didn't work
@JoeWatkins ah ok
 
9:58 AM
@Shafizadeh you need to restart the terminal, not git.
 
I think 1gb is just too small an amount of memory for any server that is going to be public facing, and do actual work ...
@mega6382 I'm not sure why you would need to restart the terminal
(each invocation of git is going to reload configuration anyway)
 
@JoeWatkins it was just stated on the answer he linked "If you are using git via CLI ensure you restart your shell/terminal after you changed this settings."
 
I read it, but it doesn't make sense ... sounds like paranoia ... or obligatory "turn it off and on again"
 
ok just for my information, how can I restart a terminal ?
 
@tereško @PeeHaa I don't wanna rat, but @DaveRandom is on ubuntu
 
10:01 AM
lol
 
open a new terminal ...
I'm certain it's not necessary ...
 
@JoeWatkins ah ok
@JoeWatkins yes it is not, I just wanted to know what's the meaning o "restarting the terminal"
 
@FlorianMargaine you must have me confused with my evil twin brother @CaveRandom. He was born first and our parents weren't very imaginative
He often pretends to be me but you can tell it's not me by the pressure marks from the fake glasses/nose/mustache he usually wears
also shut up
 
@FlorianMargaine don't kink shame
 
@DaveRandom <3
@PaulCrovella ha, fair
bugs.php.net is down?
 
10:12 AM
yeah, nobody cares
 
> I have programmed a website with shopping cart for a friend of mine. I am self taught through w3schools
your friendly reminder to never shop online
 
lol
 
10:30 AM
@PaulCrovella unfortunately, we need to :(
 
11:23 AM
!!rfcs
E_TOO_MANY_RFCS
 
Hi Guys! I'm getting a strange error in my custom error handler. I'm getting a E_WARNING where it must be E_COMPILE_ERROR. I'm getting this from 'require' command. Can anyone help?
//error handler function
function customError($errno, $errstr) {
echo "<b>Error:</b> [$errno] $errstr".PHP_EOL;
}

//set error handler
set_error_handler("customError");

//trigger error
require 'nofile.php';
<b>Error:</b> [2] require(nofile.php): failed to open stream: No such file or directory
 
@NikiC since bugs.php.net seems to be down, maybe I could ask my question here:
in our composer workflows we see php_strip_whitespace() on the hotpath while running "composer update".
in case time allows, it would be cool if someone could check the C implementation for possible low hanging fruits?

https://blackfire.io/profiles/04234c24-b8c4-43b0-b23a-0a836b8c766e/graph
 
11:56 AM
Good morning!
 
@staabm huh. what does composer use php_strip_whitespace for?
@staabm Currently it uses output buffering. Replacing that with a direct write to string would be the most obvious improvement
 
@NikiC it uses it for classmap generation
 
anyone aware that bugs.php.net is down? or is it just me?
 
12:05 PM
anyone here worked with nginx ?
 
@PaulCrovella wow that's ugly
 
is there a PSR for coding style of variable names? i.e. snake_case, or camelCase?
I'm finding PSRs for class names
 
@NikiC they used regex in the past, but this had other problems
 
@staabm I guess using token_get_all is too slow for this?
 
Wes
12:14 PM
@Tiffany no but everybody uses camel case
 
@Wes okay, thanks
 
yeah, it seems

https://github.com/composer/composer/commit/8e9678a5bacf998cb77a296b5fd6cbe08f4a9c97#diff-3b25216995cc00c0f45dd5d6fd2016f6
faster+less-memory (per commit message)
 
this is going to take some getting used to, so used to using snake_case
 
PSR-2 has this example:
$longArgs_noVars = function (
    $longArgument,
    $longerArgument,
    $muchLongerArgument
) {
so that would imply you can mix and match as you see fit
 
lol
if I want to output two arrays, and have a single value for each array show up on the same line, do I need to nest the foreach loops?
contents = not entire contents of array, a single element, I can't think of the word
 
12:29 PM
@NikiC sounds reasonable. atm php_strip_whitespace() is the hottest function when running "composer update". it takes 8.3 seconds of 57.3 seconds overall walltime
 
@Tiffany you're maybe looking for MultipleIterator? or possibly just for?
 
12:46 PM
@PaulCrovella possibly, will need to read more into it. But first, food since my stomach is demanding attention
 
1:06 PM
there aren't many good examples for MultipleIterator
 
Morgen people o/
 
I'm so confused.
I got nested foreach loops to work though.
 
then it's likely I've no idea what you were after
 
it looks like MultipleIterator would work for what I need, but I'm having trouble wrapping my brain on how to get it to work. it doesn't help that the arrays I'm working with are already multi-dimensional... and now that sparked an idea, but I'll have to mess with it later.
 
1:23 PM
@DaveRandom Who is the OP?
 
your mum?
 
@Tiffany can you provide sample input and sample output? maybe then we can figure out what you are trying to do
 
Wes
@Tiffany needed help with css?
 
@Gordon it's not that big of a deal, what I have works fine. If I ever get around to it, I'll try converting it.
@Wes no, I was joking earlier
 
1:52 PM
I'm launching my project .. but I hardly stuck on the using of converted-htaccess in Nginx configuration. Any idea how can I find the errors?
any log file?
 
@Shafizadeh I don't use nginx much, so, I can't help. But when are you releasing your project? and what is its name and the domain?
 
I'm actually releasing the beta version now
but since I don't have any clue why the webpage doesn't load correctly, then I don't know when exactly it will be released
 
gooood eftermiddaaaag
 
OH: "The human brain is amazing. It functions 24*7 from the day we are born and only stops when you’re taking a test or speaking to someone attractive."
 
2:15 PM
or Mondays/Fridays
 
> Boris Johnson has resigned as Foreign Secretary amid a growing political crisis over the UK's Brexit strategy. He is second senior cabinet minister to quit within hours following Brexit Secretary David Davis's exit.
 
@Tiffany lol, yeah, those too.
 
hahahahahaha
 
@Gordon UK having trouble?
 
well, they have ever since they announced their stupid brexit plans
but now even the instigators are jumping ship
 
2:18 PM
reading an article to get an idea of what's going on
 
it's brbrexitexit now
 
shit, how would you even pronounce that?
 
@Shafizadeh click on the next day
 
the "next page" link navigates me to somewhere else
 
2:27 PM
@Shafizadeh I'm guessing your conversation ends there, and starts later on in the next day, you'll have to go through the time slots and see where it starts back up.
 
ah .. yeah probably
 
thank you buddy
 
@Tiffany tl;dr: johnson doesnt agree with a soft brexit and thus resigned
 
@Gordon read a comment that it's a ploy to oust May so he can become prime minister and do a hard brexit
 
2:40 PM
I doubt that will happen
 
the reason for her soft brexit plan is so there isn't a hard border between Ireland, I guess
 
3:02 PM
I am well informed on the matter and have up-to-the-minute information, thus I am in an excellent position to confirm that it is indeed a shower of shit, orchestrated by a plethora of fucktards.
 
just to let you know. since bugs.php.net is up again, I reported the "performance problem" as a bug - so it wont be forgotten:
https://bugs.php.net/bug.php?id=76599
 
the UK is utter chaos right now
'tis why I gtfo'd
mind you all the chaos is in the political establishment for now

the real horrors come next year when decisions, or lack thereof, have consequences
 
I heard that everyone is going to get a free bail of cocaine?
 
@DaveRandom indeed! just sign here...
 
I was thinking about giving mine to the NHS
 
3:16 PM
well one of the ideas floated was not enforcing customs checks at all to avoid chaos in april 2019, would be useful for importing drugs I suppose
(dear tullverket, hmrc, polisen and UK police: that was a joke)
@DaveRandom “We send 350kg of cocaine/week to the EU. Let's spend it on the NHS instead.”
 
she's joking but I'm not, I'd like my bail hand-delivered by the queen please
and I want her to let me roll her up and do a line through her, doing it with pictures of her is old hat
 
lol
 
brexiters are trying to do something negative to the NHS?
 
“£350m/week goes to the EU, let's spend it on the NHS instead” was a slogan during the Brexit campaign

of course, the kind of people arguing for Brexit also hate the NHS
 
wasn't that changed to "lol j/k!" right after the vote?
 
3:21 PM
oh the NHS has been deliberately and systematically underfunded by successive governments for ~20 years in order to break it down enough that it can be sold off for parts to the highest bidder, and the highest bidder is still a pretty low bid because they are bidding for something shit.
 
While I got a good chuckle of out Johnson ministrexiting, it's somewhat scary to see so much turmoil all over europe. I wouldn't be surprised if all this was instigated by some secretive forces (koch/mercer; maybe putin) in an attempt to destroy the EU at large. Eventually we'll find out all the leading populists got a good chunk of money for creating this chaos.
 
going the way of the US and private healthcare? aren't you in for a load of fun...
 
It's not that no-one knew what they were voting for, it's that no-one knew what they wanted so it was irrelevant what they were voting for
the great irony being that hard-pro-EU is now the default position of the far left, which is historically the total opposite
anyway, on that cheerful note I have to go stop members of my family from being run over, so ttyl
 
o_o
 
(I just have to go pick my son up from school, if he did get run over it would be almost 100% his own fault)
 
3:25 PM
I was imagining a vehicle becoming unstable and rolling towards a child or something
 
4:10 PM
@Gordon oh koch & co definitely have their fingers in this mess
mind you I blame the european left mostly

not for being too left-wing, on the contrary, they accepted capitalism in the late 90's and since then there's been no counterpoint to right-wing talking points, which isn't good when you've just had the Great Recession
why did the UK vote for brexit? well, immigration is one thing

EU has free movement

Tories: Controls on immigration
Labour: Controls on immigration

nobody put forth a positive case, no wonder everyone thought it was the worst thing in the world
similar story in other countries
 
I'm trying to preg_replace backslashes in URLs from a file. In the file, URLs will have https:\/\/example.com\/, I tried preg_replace('/\\\(/)/', '${1}', $payload);, but the page still has \/\/ in URLs. I also tried '/\\\//' for pattern and '/' for replacement, same difference.
wait, do I need mg flags?, no dice
 
my best PHP internals emails begin with “I'm a terrible person for [this]”
'/\\\(/)/' is interpreted as #/\\(/)/# (where # is an imaginary string delimiter for a string with no escape sequences)
 
... and that's how I long time ago ended up with: github.com/fracture/routing/blob/master/src/Fracture/Routing/…
 
did you mean '/\\\\(/)/' maybe ? @Tiffany
$ cat bar.php
<?php

var_dump('/\\\(/)/');
$ php bar.php
string(7) "/\\(/)/"
 
4:25 PM
also, you might want to use different delimiters
like #
 
yeah
less confusing that way
I wish PHP had JS's regex literals, escapes upon escapes are painful
 
the fun begins if you need to run your regexp pattern via some string manipulations
 
@Tiffany Try to use preg_quote to escape the regex php.net/manual/en/function.preg-quote.php
 
sorry, coworker came in to talk. so instead of surrounding my pattern with / ... /, use # ... #?
 
yes
 
4:28 PM
yeah, that's a thing you can do if it helps readability
 
and improving readability for spawn of Perl is not a small change
 
!!rfcs
:( 4 rfcs is too much for jeeves to handle
 
you're welcome
 
it doesn't work on my server though
maybe I'm cached
I can't type
 
4:33 PM
of you are doing something else to that string at some point
 
preg_match_all('/"blocked-uri":"(.*?)",/m', $payload, $blockedURIs);
preg_match_all('/"violated-directive":"(.*?)"/m', $payload, $violatedDirectives);
 
@Tiffany same can be achieved like this, 3v4l.org/0krAp
 
probably you have already mentioned it before but, why not json_decode and then get what you want from it instead of regexing things out of a json?
 
0
Q: Getting type arguments of a type parameter

Levi MorrisonThis question is somewhat language agnostic. Setup: Let's assume we have a type called Iterator which has a type parameter Element: interface Iterator<Element> {} Then we have an interface Iterable which has one method which will return an Iterator. // T has an upper bound of Iterator interf...

 
@pmmaga wayt wat!? Is that what they are solving there?
 
4:37 PM
@mega6382 I don't wanna use preg_quote
@tereško it's a json file I'm parsing
 
why?
 
@pmmaga because I had limited success with json_decode, and was able to write something that worked with regex... plus I wanted to try out some of what I learned from a regex book
@tereško CSP log
 
@LeviMorrison I think that's not a good example as you'd just specify Iterator<T> as the return value in this case
 
@NikiC No, that is not true.
I need to be able to constrain Iterator to be a specific Iterator in some cases.
I'll update the quetion.
 
What's CSP? I am fairly sure it is not the new iteration of Kerbal Space Program
 
4:40 PM
Imho that would be bad design
 
@Tiffany mandatory. but I'd suggest you insist a bit more in the json_decode route
 
@Tiffany "Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems."
 
@tereško content security policy. I'm parsing the URIs that are blocked, and which directive they violated in a human readable format. I dump a log into a file on the dev server, and the script parses it onto a page for me.
@mega6382 I've quoted that in this room, I was told to get better at regex
 
just use json_decode
 
lmao close votes for "too broad" and "unclear what you are asking".
 
4:42 PM
@LeviMorrison my brain read it as "too bored"
(and, no, I did not vote on it ... I am to busy reading a manga)
 
@LeviMorrison code review might be a better place? Not because of those reasons, but because there is more than one possible answer, rather than a single 'correct' answer.
 
Bah, it's ridiculous that this is getting downvoted and closed. It shows a lot of effort and has clear questions, and there are correct answers.
This site is so fickle. Oh well.
@NikiC How else do you constrain certain Iterable to return only bidirectional iterators?
You could create a new interface that further constrains the type but then you have to implement that interface, which is unnecessary. Any bidirectional iterator would work, no new interface semantics are required.
 
Wes
that doesn't make sense
interface <Element> Iterable<T: Iterator<Element>> {
getIterator(): T
}
Iterable<T: Iterator<Element>>
why?
 
You didn't read it. Nor did anyone else, apparently.
> Certain functions which use Iterable also need to be able to constrain their parameters to accept Iterables which return only certain kinds of iterators, such as a bidirectional iterator, which is why the iterator returned is parameterized instead of just the element type.
Off to lunch; ttfn.
 
Wes
4:59 PM
> Iterables which return only certain kinds of iterators
it's the iterables that... return stuff?
or it's the functions?
how do iterables return stuff?
but why???? class Vec<Element> implements Iterable<VecIterator<Element>>
VecIterator<Element> : Iterable<Element>
 
!!should I go home for lunch or stay here
 
You should stay here.
 
Wes
i don't get why you want to do that
 
@LeviMorrison do you have another example? this is kinda hard to follow
 
Wes
5:18 PM
i'm not sure where the type you mention would be enforced
if it's in Vec, then just do getIterator(): VecIterator<T>{}
 
@JoeWatkins I realise that I might as well be asking you if you remember your own birth, or your wife's birthday, but do you happen to remember this, and more specifically do you happen to remember whether it caused the debian folks some sort of problem?
 
@DaveRandom scroll all the way down
 
5:33 PM
@PaulCrovella yeh but what they actually did is revert it
which now breaks the build, because there is more stuff that relies on php.h
I'm wondering if there was further discussion in irc or whatever
by "they" I mean debian, btw
 
@NikiC do you know if 7.3 alpha will be extended?
No conclusive discussion on the list.
 
@rtheunissen I don't know
The new RM is afraid of making decisions
 
All in on voting then.
 

« first day (2823 days earlier)      last day (2111 days later) »