« first day (1734 days earlier)      last day (3207 days later) » 

12:00 AM
Hope the people at PHPSouthcoast like it....
 
I hope so
I started a funny project
@Danack that's in England this Saturday, bollocks
@Danack you are Dan Ackroyd, right?
 
I'm a Dan Ackroyd.
But not the other Dan Aykroyd.
 
you are the one that had a beard
 
@ziGi it is fairly possible that both of them have had a beard at some point in time
 
@KevinMGranger he knows what I am talking about
 
12:11 AM
It's going to be recorded....unless something happens to the video camera.
 
@Danack do you know, by any chance, what the closest airport to the city is?
 
Technically Portsmouth has an airport, but Gatwick is the closest large airport.
 
Ok, let me check
 
actually southampton also.
 
ugh, it's like 2 hours using Public transport
I was wondering btw, isn't delegating actually deferring since it adds delay to the instantiation
 
12:19 AM
Yes, the function only gets called if some other object actually needs the thing that is being created by the delegate function.
 
true, but why is it named delegate
 
It delegates the creation of an object to the function.
Or rather callable.
 
I understand
ok, sounds fair
One last thing and I'll call it a night, where do you usually put the config which states the einvironment (dev, prod)
 
18
A: Using variables in Nginx location rules

DanackYou can't. Nginx doesn't really support variables in config files, and its developers mock everyone who ask for this feature to be added: "[Variables] are rather costly compared to plain static configuration. [A] macro expansion and "include" directives should be used [with] e.g. sed + make o...

I need to update the library that does that....as it's been changed slightly since then. But basically, I put that info anywhere, and then when the application is deployed/initialised in a dev environment, write the appropriate settings for the current environment to the env variables for the application.
And then they're just read from the environment.
 
If I'm building a recipe search engine, how should the database structure be?
 
12:28 AM
@Danack yeah, I see
 
One table for all the steps with the resulting ID and another table that has the name for that unique ID?
 
12:49 AM
@NikiC - committed a first-pass at a graphviz dumper for php-cfg. Needs a bunch of refactoring, but generates pretty visuals :-D
 
1:06 AM
Anyone here
 
1:39 AM
@Danack @ziGi I like to have everything in environment variables, you can abuse stuff like json encode/base64 to put arrays/objects in them
 
haha, that sounds perverted
:D
I did what Danack told me
return [
	ConfigurationVariables::DATABASE => function () {
		$host     = getEnvironmentVar(EnvironmentVariables::DEVELOPMENT_HOST);
		$dbName   = getEnvironmentVar(EnvironmentVariables::DEVELOPMENT_DBNAME);
		$username = getEnvironmentVar(EnvironmentVariables::DEVELOPMENT_USERNAME);
		$password = getEnvironmentVar(EnvironmentVariables::DEVELOPMENT_PASSWORD);
		return new DBConfig($host, $dbName, $username, $password);
	}
];
where DBConfig is just a Value Object
 
Yup, my suggestion is to put related variables in the same one, encoded with something
 
bleah
 
oh, you mean
 
Also avoids issues where too many env variables cause issues
 
1:41 AM
put the whole config in an env var?
 
@ziGi yes
 
I can't think today for some reason :/
 
do you find my code readable?
/**
 * @param $envVar string The required configuration option
 * @return string The configuration option value
 * @throws Exception When the option is not found in the environment
 */
function getEnvironmentVar($envVar) {
	if(!getenv($envVar)) {
		throw new Exception("Oops! Config: It looks like your variable '$envVar' is not yet added to the environment variables.");
	}
	return getenv($envVar);
}
so basically, when the admin doesn't do their job it explodes
 
What if my $envVar = 0?
or false
or null
or array()
 
1:45 AM
yeah, that's a good point, but I think it's too much overengineering for something that would be stupid from the programmers side to pass an array
 
Oh yea wait putenv only takes a string
heh
 
but in general you have a valid point
validation is needed
but this is for the configuration phase
I mean the configs/dev.php and configs/prod.php are there and you don't touch them, just the env vars
I guess, you touch them
hm, I have to think
 
You should change that to if (($v = getevn($envVar)) !== false) and just return $v
 
but it's already 4 in the morning so I am going to bed
@Sherif good point 2
 
Since the only thing that getenv could return that's falsey other than false is an empty string.
 
1:50 AM
true true
 
Hey
Guys
Does anyone know about crossdomain policy
 
 
2 hours later…
4:05 AM
@NikiC refactored the dumper into a pair of printers. One for text and one for images (you call ->export($format, $filename) on the image result).
 
user4920811
4:40 AM
how can I in initialize three variable in this condition:
is_int($uriMethod) ? $var1='foo'; $var2='bar' : $var3 = 'anything';
 
Hi frndz ..
 
user4920811
@alwaysLearn hey
 
I need one suggestion
I have one site to work on with parallex design
it has blogs and some categories with topics in each categories
Ohh ... !! I am unable to upload the design image here :(
 
5:32 AM
@stack use a standard if/else block.
 
5:43 AM
moin
 
morning
 
user4920811
@Orangepill ok thanks. but onething: using of if is bad ? Always afraid to use it. I think use of of is not optimized. is it right ?
 
@stack By using brackets php.net/manual/en/control-structures.if.php and don't worry about optimiztion....worry about writing easy to read code.
 
Why would you think it's not optimized... all it saves is a few keystrokes but it sacrifices clarity
 
user4920811
for example, If I use of 10 if statement in the my script, what happens ? The performance will decline?
 
user4920811
5:53 AM
@Danack honestly, easy to read code is not important for me ...
 
That is a stupid thing to say.
 
@stack code clarity is probably the most important thing
 
user4920811
@Danack really ? maybe, I'm novice a bit
 
user4920811
@Orangepill ok, anyway thanks
 
@stack i would strongly recommend reading this book:
by pirating it if necessary.
 
user4920811
5:57 AM
@Danack OK ! I will. really thanks.
 
Brad Larson♦ banned me
now he is not replying my text back
what should i do?
 
user4920811
@ujwaldhakal are you ban now ? :-)
 
banned on asking question
 
user4920811
@ujwaldhakal ah, so waiting for some days !
 
there is now aiting
waiting in terms
i think m banned for ever
 
user4920811
6:04 AM
@ujwaldhakal ok, then you need to create a new account ...!
 
damn
my all reputation would go waste
 
user4920811
@ujwaldhakal 124 ? :-)
 
user4920811
why he banned you ?
 
he thinks i spammed my reputation
my reputation was 500+
 
user4920811
@ujwaldhakal ah I see
 
6:08 AM
i hate brad
misusing power
damn
i hate brad moderator misusing his power
 
Hi Everyone! I'm new to PHP. i have problem with setting an attribute and getting it from another php page.
I have set my array like this > $_REQUEST["yourResult"] = $bigGuy;
and i tried to retrieve it in another php like this >
if($_REQUEST["yourResult"] != null && $_REQUEST["yourResult"] != ""){...
But i'm getting ' Notice: Undefined index: yourResult in..'
 
user4920811
@ujwaldhakal relax ...! nothing happens !
 
cant i complain him?
 
user4920811
@ujwaldhakal I don't know
 
damn
 
user4920811
6:10 AM
but you can create a new account, and I will give you +1 voteup for all your questions and answers
 
how m gonna make this 500 +
:(
 
user4920811
and also you can try to be a moderator, and then ban him
 
user4920811
you need +100k reputation :-) , just try ...
 
hhaha
thats the spirit man
 
user4920811
6:14 AM
@ujwaldhakal exactly ;-)
 
thanks bro for ur hope :p
 
@ujwaldhakal You can try making your case to a different moderator... or just re-earn the rep the old fashioned way, by providing useful content to the site.
 
@ujwaldhakal He didn't ban you
 
user4920811
@ujwaldhakal your welcome, Unfortunately I don't know english very well, Otherwise, I chat with him (Brad ) for solving your problem !
 
The system banned you presumably because your questions are low quality or off topic or whatever
 
6:21 AM
how can i chat with him?
 
If he banned you you wouldn't be here right now
 
no brad banned me'
he send me message
 
He sent you a message
 
he banned me from asking the questions
 
user4920811
@BoltClock you are a moderator ?
 
6:21 AM
JamesZ has approved 863 edit suggestions and rejected 4 edit suggestions
Jayesh Goyani has approved 1064 edit suggestions and rejected 1 edit suggestion
Eat Å Peach has approved 2186 edit suggestions and rejected 3 edit suggestions
 
He did not ban you
 
Jeez
@stack That's why I'm here
 
he sent me message
 
user4920811
6:21 AM
@BoltClock good for you!
 
user4920811
@BoltClock can you tell me how can I be a moderator ?
 
he stole my all reputation :/
boltclock please check my id
 
@stack you are disqualified by asking that question :D
 
@boltclock
 
user4920811
@MarcelBurkhard ha ha ha
 
6:23 AM
chat.stackoverflow.com/transcript/message/24480536#24480536 can anyone kindly answer this please? :)
 
@ujwaldhakal Re your question ban, stackoverflow.com/help/question-bans Re reputation, you know very well what you did
 
@boltclock
please check my id
 
@BoltClock I guess you didn't mean to ping me but ujwal dhakal, right?
 
@MarcelBurkhard LOL
 
thx :)
 
6:27 AM
Was wondering why he was pinging me again after I answered him
 
i havent done that
dnt knw who did
 
user4920811
@BoltClock I have a question which is banned here. why ?
 
i am here to ask question and answer the question if i knw them
so i want my asking question power back to me :) plz
 
user4920811
@ujwaldhakal remove 'plz', that is his duty
 
@stack Is that your alt account?
 
6:30 AM
-_-
@bol
@BoltClock either delete my this account or give me back my power
i dont wana live this way
 
user4920811
@Danack what is mean of "alt" ?
 
alternate
 
Can't do anything on my end. You want to ask questions, prove that you can ask good questions
Otherwise, we don't want your questions
 
how to ask good questions
if m banned?
 
You edit your existing ones into shape
 
user4920811
6:32 AM
@Danack ah, no that was my previous account.
 
if no one viewed then?
 
@ujwaldhakal Pray for views :)
 
oh and btw, none of your answers did get any upvotes, so edit them too :D
@ujwaldhakal and pls stop wasting @BoltClock 's time, it will be missing elsewhere thus reducing the quality of stackoverflow, kkthxbye
 
@MarcelBurkhard This doesn't feel like the real PHP room. I am scared
 
@BoltClock too early in the morning ^^
 
user4920811
6:34 AM
@BoltClock you don't want his questions ?!?! that's ridiculous ..!! his questions is not for you.
 
Is it always like this before 7am utc?
 
@Danack I bet
 
/goes back to bed...
 
@stack StackOverflow (we) is about good quality Q&A so we don't want his (low quality, as of now) questions
 
Hello, I was wondering if this (pastebin.com/TufSTYQE#) would be the right way to setup a login
 
6:36 AM
@Poteito I think for an amnesia login you're off to a good start
 
lol
 
user4920811
@MarcelBurkhard ah ok
 
I don't know anyone that likes to login for the sake of logging in but yeah ...
 
drop the session_destroy... that should only be done if you want to log out.
 
also, calling session_destroy without true is pretty silly...
ahh, no I'm thinking of session_regenerate_id aren't I
heh
 
6:39 AM
@Sherif why is that? You seem to know more than php documentation: php.net/manual/en/function.session-destroy.php
ah ok
 
@stack That is basically why the question block is in place and the site provides tons of guidance on how to ask good questions. We generally expect users to respond by trying to improve their questions first, rather than making new accounts
 
So sending back a user to the login page (after he tried to enter the url of an useronly page) should be enough ?
 
2 in the morning... brain is responding with 503 Service unavailable
 
user4920811
@BoltClock you right, but you can give him votedown instead banning
 
@stack The ban is a result of too many downvoted questions
 
user4920811
6:41 AM
@BoltClock ah, I did not know that, alright
 
user4920811
@BoltClock are you create stackoverflow ? or you are just a moredator ?
 
Just a mod
 
user4920811
@BoltClock can you change the structure of the site ?
 
user4920811
e.g. add a new option
 
No. I'm not a developer and I don't work for Stack Exchange (much as I'd love to)
 
user4920811
6:43 AM
@BoltClock ah I see
 
user4920811
and the last question, it is your job ?
 
Yes, he gets paid in bits at the end of the month.
1 octet for every moderation effort.
 
@Sherif ಠ_ಠ
 
user4920811
@Sherif so what is the income of stackoverflow ?
 
pow(2, 31) - 1 bits per yoctosecond except on days that end in y.
 
6:47 AM
Sounds about right
 
For every 300K undecillion bits you collect you can trade them in for 0.01 bit coins.
So it's a great deal really.
 
user4920811
@Sherif I did not undrestand your mean (I dont know english very well), anyway thanks.
 
English? Never heard of it. I'm speaking French.
You didn't know that SO chat translates everything you type in here into English if it's not already?
 
what's the best free mail service for recieving messages from godaddy?
 
Let's talk about zend2. How to create module inside vendor namespace?
 
6:51 AM
moin
 
Now it's a planet again apparently
 
boltclock?
@bolt
@BoltClock
 
@JoeWatkins Hey, when you have a few minutes, any feedback on this would be appreciated phpden.info/why-do-i-need-to-know-how-to-reverse-an-array thanks :)
 
do you really want feedback ? you've pretty much layed out your argument for why it is appropriate to ask such questions in an interview, if I say it's not, I know what you'll say ...
I can't argue with the reasoning behind the need to answer the question if it's asked, but I don't necessarily think it should be asked in the first place ...
I couldn't come up with that stuff on a whiteboard, moreover, I'm the most nervous person, you can ask me basic questions and listen to me stutter in real life ... all your going to find out by asking me that sort of thing is how awkward I can become ...
 
7:07 AM
@JoeWatkins I'm open to everything.
@JoeWatkins What would be a better technical assessment in your opinion?
 
in general I don't know, I'm not a serial interviewee or interviewer, I don't need to know ...
I don't go chasing after jobs, nor companies, they find me, and they find me because I make myself visible. I've written more lines of code, and published them as open source, than I have written for proprietary software, at least for the last 5 years. It speaks louder than I am able. There is a sense in which you are wasting my time by asking me questions like that when there are thousands of lines of code you can read and judge for yourself.
If you ask me questions about code I wrote, I'm going to feel comfortable, and you're going to extract good answers, much better than the whiteboard stuff I think ...
but that's only me ...
it depends who and what you are interviewing for ... that would be my position, it's sometimes necessary to ask that kind of question, but the times when it's not necessary it can have a negative impact on the interview for sure ...
 
7:23 AM
some people in this world
 
7:34 AM
@Sherif that's amusing :>
 
@Sherif imo that's a great read for any level developer, holds an important message of going in depth with the problem. Though I would add a couple of paragraphs explaining that first of all you should understand which problem you are trying to solve, that is, is it worth it. e.g. if it's a cronjob that runs weekly on a small dataset, simplicity and readability take over any performance improvements.
like sometimes it's much better to write code understandable for a junior (which he can fix/modify easily) than to write ultra performant code.
 
@Jimbo morning
 
@Sherif is there a catalog of articles available on phpden?
 
@SergeyTelshevsky I don't really see those as two things that can't co-exist. For example, the generator implementation of arrayReverse there is easier to read and maintain and remains the most performant option, at least to me anyway.
@SergeyTelshevsky none that I'm linking to right now, no
 
7:48 AM
hello
 
@Sherif if we're talking about this array problem - yes, if we take problem solving in interveiws in general, there are situations where these are the questions the interviewer wants to hear from you first
 
anyone know about cloacker ?
 
Damn Windows Y U SO SUCK AT GETTING A TIMESTAMP WITH HIGH PRECISION!?
 
coz windobe
 
Hey everyone, why is !1 === null is equal to 1===null? Am I missing something here?
 
7:59 AM
Yep :)
 
oh right right... its strict type comparison - false != null
 
Indeed.
 
agh = ] Mornings
@Ivan0x32 !1 is FALSE .. which means FALSE === null .. that is FALSE ... 1 === null .. well that is FALSE .. so they are both FALSE (false === false)
 
You know what's also false false ?? false ? false : false || false === !false
 
false ===! false =]
 
8:07 AM
We need an ==== operator to strictly stricken the type.
0 ==== false
If you add a 5th equal you win a free Miley Cyrus poster.
 
God damn shitty pirates.
 
LOL. Working with shitty sites again? :)
 
@PeeHaa yours
 
mornging
 
Yeah I'm on it whenever I find some time :(
And thanks :P
@Gordon mdskjfshfsdfjsgfjksydhfksehfdk
 
8:16 AM
if only php had a less noisy syntax for anonymous functions sigh
 
As I have said before. I don't like functional programming. And yes this has more to do with my inability to properly "get it" than anything else
 
@Gordon some/every might end up in php thanks to @Ja͢ck
 
@FlorianMargaine nice
 
:)
The comments on internals were kind of expected so far; allowing something other than array in array_ functions will be ammunition for the critics, as some can accept while others can't.
I can't really disagree with that ... it's kind of sad I suppose.
 
8:30 AM
Actually, not sure which function would not be able to work with traversable ... besides sorting, of course.
 
Anonymous
monin o/
 
Stuff like array_diff() is kind of painful to do with iterators.
 
@Ja͢ck if they fuss about that, write a separate extension for it
 
With blackjack?
 
8:37 AM
Hey guys ! I know this isnt really the right place but can I ask you a fast question about VBA ? Im dying since yesterday to fill my program and my company is requiring it for a bit later
I feel that Im sooooo close
:(
 
ah, the joy of being setup to fail
 
@EraaNova Write it in php -> bamcompile it -> call the exe from your vba script :P
 
hahahah
Man Im new to the world of programming, learning alone since 3 days :p
 
@PeeHaa bamcompile?
 
@FlorianMargaine I had to google that, too ;)
 
8:40 AM
@FlorianMargaine bambalam.se/bamcompile
 
I know nothing about php yet ahah
@PeeHaa
 
I reeeeally loved that project
Would be nice if something like that would still be easily possible
 
@EraaNova well, state your problem. maybe someone wants to help then.
 
I suspect it's a hard thing to do though
 
Does anyone have the number for the frog protection society - explainxkcd.com/wiki/index.php/1530 ?
 
8:43 AM
@PeeHaa is it similar to php.net/manual/en/ref.bcompiler.php?
 
@PeeHaa my current side project is a debian packager, i.e. creating debian packages. I'm thinking about a way to embed a php project and have it easily installable, similarly to python packages. So it'd require the php package, and put its sources somewhere, then you'd just basically use the program as a normal program.
 
I have different Income statement on an excel workbook. I want to select the income statement with "E2016" at the end of their name and then sum them in another sheet called consolidated. The income statement criteria to be summed range from B2 to B152 in each sheet and I want them to be added in cells with same range in my Consolidated sheet
Private Sub Consolidated_Income_Statement()
Dim Sheet As Worksheet
Dim Consolidated As Worksheet
Dim Consolidation As Long
For Each Sheet In Sheets
If Right(Sheet.Name, 50) = "E2016" Then
Consolidation = Application.WorksheetFunction.Sum(Sheet.Range("B2:B152"))
End If
Next
Do While Cells(B2, B152) <> ""
Loop
Set Consolidated = Result


End Sub
thats the code Im trying to do
 
@Gordon Yes
 
@PeeHaa
 
@FlorianMargaine Nice
 
8:45 AM
damn no 50, 5*
 
@EraaNova I think this can be done with regular excel functions, you dont need vba for that
 
Yes I know, but the company wants to vba it
so everytime they add a sheet
it will go automatically to the consolidated
...
 
i see
fair enough
 
Yep
 
@PeeHaa yup. Currently I can create the debian package with most features, without any help from devscripts and the likes. Just writing the .deb file from bytes. github.com/ralt/deb-packager
 
8:47 AM
Trying to learn vba didnt take it yet at school just finished my first year
Im doing an internship
 
@EraaNova consider asking a question on the main site
 
So Im forcing myself to learn it
haha
yes I did but the pb is that there are maaaaany questions every second/minute
and no one is answering aha
I believe its my last step which isnt working
like when it has to display the results ion my consolidated sheet
 
@Gordon Yeah, I'm more concerned with laying the internals groundwork so that other extensions can make use of it :)
 
@Ja͢ck for me its not as important to have the array_* functions do these things as long as I can do these things somehow. if that means a separate extension, be it so.
 
@PeeHaa At least they have some kind of filter ;-)
 
8:56 AM
@kelunik Well yes it does a search and replace on the hardcoded <script> string
Still who needs a script tag when I can do e.g. an iframe
 
Doesn't seem like iframes are allowed there.
 

« first day (1734 days earlier)      last day (3207 days later) »