« first day (1727 days earlier)      last day (3225 days later) » 

12:19 AM
Ah, an interesting task… flattening an array while concatenating the keys :-)
$test = array(
    'abc' => 123,
    'def' => 456,
    'test' => array(
        123 => 'hip',
        'hop' => array(
            'tip' => 'top',
            'top' => null
        )
    )
);
should result in something similar to
array(5) {
  ["abc"]=>
  int(123)
  ["def"]=>
  int(456)
  ["test.123"]=>
  string(3) "hip"
  ["test.hop.tip"]=>
  string(3) "top"
  ["test.hop.top"]=>
  NULL
}
the twist here is that your code must not use recursion :-)
There's a PHP 7 only version and a version which works since PHP 4.
 
12:33 AM
Hello guys.
Anyone online?
 
But maybe 2 a.m. CEST isn't the right time for such puzzles ^^ (I'm sure @NikiC knows the answer to it :-D)
 
bwoebi what's up?
got some time to help me out with something?
one fast question
 
just ask…
 
how can a php script work locally and then not work when place on a server
it's an application i've developed to scrap websites
 
Numerous causes; cause #1 is not matching versions/extensions
 
12:37 AM
0
A: PHP script working locally but not when placed on webserver

Ene MihaiYeah, the problem here is your php.ini configuration. Make sure the server supports curl and fopen. If not start your own linux server.

here is the question
think you can figure it out?
:D
 
connection timed out?! curl?! nah… not going there.
 
hehe
anything wrong with curl?
 
not going to comment on that again^^
 
heh, okay :( the code runs well on local
but can't seem to make it work on webserver
i have no idea what the problem is
i fixed all errors from the logs
and now i'm getting bool false
or timeout
 
only option is trial and error for you. One won't really be able to help you on that I think.
 
12:44 AM
tired the code on multiple webservers
i don't even know what to try anymore
except starting my own linux based server
 
@EneMihai using a VM is enough to try usually
 
@bwoebi does it use some predefined array function?
 
@RonaldUlyssesSwanson no.
at least not the PHP7 only one
 
the php4+ one?
i'm guessing the php7 one uses generators? :D
 
heh… It's not a challenge anymore if I tell you :-P
 
12:47 AM
nah, ill boot up the old ssd linux stored in the attic :))
 
i haven't looked into generators at all, but i know how to do it the old way, i guess :P without recursion
 
recursion is a bliss
 
@RonaldUlyssesSwanson okay, tell me. my version is an 8 lines… should be simple for you to quickly draft it ;-)
 
easy implementation for hard stuff
 
@bwoebi ok will attempt to write it :P
 
12:49 AM
@EneMihai but it's overvalued too (sometimes^^)
@RonaldUlyssesSwanson Aren't ten minutes enough to try? :-D
 
@bwoebi heading to bed now :P i wouldn't succeed if i try now :D
don't spoil!
gn :)
 
@RonaldUlyssesSwanson okay, hehe
 
1:20 AM
Are you lot still doing the thing in this room?
 
user895378
If you post it and it's close-worthy it will be closed.
 
user895378
1:42 AM
Fucking HTTP/1.0 ...
 
user895378
This adequately describes my feelings.
 
The long version is:
HTTP/1 technically allows a compliant HTTP/1.0 client to have no way to figure when end of request is.
 
2:38 AM
Any regex experts around
I need help figuring out how to capture text from a string inside [open] some text [/close]
 
@Hybridwebdev regexr.com
 
@taco not quite the help I had in mind
 
Helping yourself is always an option
 
well i have no clue how to figure it out
 
I'm studying for a job myself. Good luck
 
2:50 AM
is there any oom for laravel
 
3:06 AM
@Hybridwebdev This kind of works. regexr.com/3bbr6 Not sure how to tell it to ignore the open close tags, but I don't have time for that. You could always strip them out some other way until you find out
 
3:31 AM
@taco dude this is exactly what i was looking for
 
4:02 AM
@Hybridwebdev np
 
hi can I include the image to parse php
 
4:30 AM
sure, go ahead
 
5:15 AM
0
Q: GROUP BY clause is not working when retrieving data from access table

Anandharaman BuvaneswaranHere i have mentioned the query which we need to run.. $dbname = 'demo'; $db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;"); $result = $db->query('SELECT Table1.id,Table2.name,Table2.email,Table3.desc,Table1.ORDNUM,Table4.cust,Table4.Startdate,Table4.CNCLDA...

Please help me anyone
 
ARA
5:34 AM
HI
anyone here
 
@ARA I'm here
 
ARA
@Mike i had a question
 
@ARA That's nice...
 
ARA
i am creating a website that users upload their image, and i don't know how to manage the folder structure.
i mean should i create folder for every user by their name
or there is any other solution
 
@ARA That's really up to you. How would you like it to work?
 
ARA
5:48 AM
i want to create folder for every user, but the problem is that if the drive got full then what will happen
??
@Mike
 
@ARA Why would the drive be more full if you separate the images into different folders?
 
ARA
i want that all the files and images of the user should be saved in one directory and in order to retrieve then when needed
 
@ARA I don't think it makes much of a difference how you store things. Just do it how you want.
 
ARA
6:05 AM
if the user directory got full then where should the user save their data
if you say that in a new folder then how should i merge these to directory
and how should the website recognize that where the specific image saved
 
G'morning gents and genties
 
6:21 AM
I use Codeigniter to send images as inline html img tag inside email content message. It works perfectly with HTTP protocol, however it does not work with HTTPS protocol. How can I fix it?
 
6:59 AM
@ARA Don't forget to ping people or they aren't notified of your reply
@ARA It is not likely that the directory will become "full". See stackoverflow.com/questions/7722130/…
 
7:22 AM
How to increase request timeout in IIS7.0 by php script
 
Hi guys :) any suggestions on this question :- stackoverflow.com/questions/31310214
 
@Jimbo I saw your tweet about testing, and I must say that the system I am working on was written in 4 years with maybe 1% coverage, and the bugs that occur are mainly minor front-end not working properly, or misunderstandings in the business logic between the CTO and the CEO. Which is kind of amazing, I am not sure how this works so well having in mind that there are more than 600-700K lines of code
 
7:38 AM
@ziGi currently on a project with ~200k LOC, and bamboo hasn't actually built the project in years. I just got tests working, and somehow managed to bump coverage up from 2% to 20% in a few days. The rest of the code depends entirely on the service locator and doesn't use dependency injection (ZF2)
 
@Amelia we were able to circumvent the service locator by injecting the stuff from the DIC to the Service Locator :D
 
@ziGi Oh, it's horrendous. Every class seems to look like this:
 
@Amelia there's no other way for the moment
All the new development is done via the DIC without a service locator
 
public function __construct() {
    $this->dep = $this->getServiceLocator()->get('dep');
}
 
but the old one still works using the DIC, it's just not really testable
@Amelia that's good we do stuff like this
public function getSomeRecords() {
    $service = App_ServiceFactory::getSomeService();
    return $service->getSomeRecords();
}
 
7:44 AM
lol, I think your no-longer-employed-there tech lead needs a slap
 
@Amelia actually he's no longer employed here
he went to a company that deals with preventing people on oil rigs from making mistakes
 
@ziGi read what I said again :p
 
which IMHO was not the best choice the company could do
@Amelia yes I did
but he quit voluntarily
 
Oh, you havent seen the guy posting source code for a nuclear power plant's emergency monitoring systems on stackoverflow, have you
 
@Amelia ugh
Link pls?
 
7:45 AM
It got around 50 downvotes in 20 minutes and was deleted shortly after; I'm not 10k :p
 
@Amelia I see, such a pity
 
Anonymous
monin o/
 
mon-ring
 
8:03 AM
And greetings all.
 
@ziGi //todo: nuke the need for inline-typehints from this miserable framework is pretty much my entire experience with stuff that doesn't use dependency injection :|
 
MONRING!1!
 
@Ocramius !!1111111
 
8:19 AM
Happy Turdsday!
 
We’re at it again! “Override the file:// stream wrapper, capture filename where the class is, then restore” /cc @asgrim @RoaveTeam #magic
because f*** non-magic code. MOAR MAGIC, MOAR!
 
8:44 AM
@Amelia inline-typehints ara stigmata from the Framework
that's why I try to decouple the whole domain from the framework as much as possible
nonetheless you are still coupled to the language (PHP) so better write your own Date etc classes if you use them in the Domain
 
That's how I write everything. I write it as if there's no framework, then use controllers/repositories everywhere. But this is a monolithic mess from 2012ish
 
What is a monolithic mess?
 
Oh, the stuff I'm trying (and failing) to refactor
 
@ziGi when implementations are tied together
 
^ that too
 
Anonymous
8:47 AM
I have a form that get's it's values(variables) from a .txt document and on submit writes the values (variables) to that .txt document, any idea why it takes another refresh after submit for the new values to appear?
 
@nikita2206 ah, yes
 
Also, anyone got experience with making ZF2's Connection act like C#'s ReliableSqlConnection?
 
With retrying on transient errors
 
Anonymous
@jimbo o/
 
8:50 AM
@Amelia what's a ReliableSqlConnection?
oh, just retry on everything?
that seems very UN-reliable to me
@Amelia simply implement github.com/zendframework/zend-db/blob/… as a wrapper around your actual connection object
 
@Ocramius It's part of the Windows Azure SQL package, you give a policy along with the connection and it'll retry according to policy
 
yar, it's a "PolicyDrivenConnectionKindOfThing"
 
@Ocramius Yeah but swapping that out involves making a full adapter + driver + connection because they're all tightly coupled :<
also a platform, lol
 
@Amelia well, that's how it works :-)
 
@Ocramius *pouts*
 
8:53 AM
You simply wrap the real one and pass something like "maxRetries" or something to the wrapper
it's ZF2, just pass it an array of arrays, no?
 
^ this is the way to solve any problem in zf2 btw
 
9:15 AM
@bwoebi Nope, I don't know the answer (i.e. no PHP 7 only answer, I don't see how it helps for this)
 
Possible to get the href from the onclick with xpath?
<a rel="nofollow" class="dw xh-highlight" href="#" onclick="window.open('http://retrieve.me/please', '_blank')">Click</a>
 
Not without parsing the entire value yourself
xpath handles xml, javascript is not xml ;)
 
y u no magic xpath?
 
:P
 
@PeeHaa inb4 someone brings up XSLT transforms
 
9:19 AM
I think I will just ignore you from now on :P
 
@PeeHaa I have made XSLT output valid JSON before.
I am a monster.
 
Yes. Yes you are
Although JSON is not as bad as full blown aids javascript
 
@Fabor Is it always going to be like that or do you also want to track location etc?
 
Always like that.
 
9:22 AM
@Amelia lol how to make a file of a few bytes a 100k file :P
 
@PeeHaa for science.
 
:D
 
I also patched icecast to interpret .json as ".xsl"
so I could request https://stream.example.com/status.json
 
hehe
 
(I eventually did escaping for the JSON values in icecast too, but I forgot to memory manage since I'm a dumbass and it memory leaks. I just restart it every 4 months. :p)
Literally copy-pasted from a blog somewhere because why not.
 
9:26 AM
@Fabor I would totally just regex it and hope for the best
[#window\.open\('(.*)', '_blank'\)#](eval.in/395402)
 
Well fuck you too MD
> It is too late to edit this message
 
@PeeHaa Yeah, seems to be the case cheers
 
@PeeHaa who's MD?
 
9:31 AM
ah yes
markdown
well if you don't like it, contribute and make it better :D
I have to make an AI that can do my job, and take a sabatical
 
OIS
lo
how would I go about making a new reference post for ternary in PHP. basic, nested, etc ... to gather everything one place for duplicates ?
 
Ugggggh dat repwhoring stackoverflow.com/a/31313686/508666
 
OIS
should I just make one or is there a process?
 
@OIS usually go via meta or people will close the canonical post as a dupe :p
Heck, they'll do it anyway, so get people to actually help
 
@OIS Nested? What is the answer going to be? "Fucking don't"? :-)
 
OIS
9:44 AM
@PeeHaa both :) use if-elseif-else instead preferably, else wrap it in parentheses
 
@nikita2206 indeed.
 
@OIS Nooooooooooooooooooooooooooo.com
 
@PeeHaa The answer is "If you're into lisp, you're weird and I don't like the amount of parens you just put around that. Otherwise, just no."
 
No matter how many parentheses you are going to throw at it it's always going to horribly suck
@Amelia lol cc @FlorianMargaine
 
@Amelia fu
 
9:46 AM
@FlorianMargaine <3
 
I <3 lisp
 
@FlorianMargaine You mean you ((((((((((love)))))))))))]) lisp
 
> If this really is the answer (which it doesn't look like it) I am sure it is a dupe so perhaps instead of dumping crap answers (just code not even a explanation or anything) close it as a dupe. Staph the farming. It's counter productive – PeeHaa 5 mins ago
> @PeeHaa WHy do you think it is dupe? – Praveen Kumar 1 min ago
 
@Amelia that's not valid lisp
 
9:47 AM
Now you are just being an asswipe
^ not directed at you @FlorianMargaine ^ :P
dat timing
 
@FlorianMargaine Intentional :p
 
@Amelia even ((love)) is not valid lisp
 
Was that youtube video the parenthesis song?
 
land of lisp song
 
Yes, lol
 
9:50 AM
Urrrrrrrrrrrrrrrgh moin
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarrrrrrrrrr‌​rrrrrrrrrrgggggggggggghhhhhhhhhhhhh mogguh
 
OIS
10:03 AM
someone is going around upvoting all the questions I put a close vote on ...
 
@OIS ultimate troll
 
@OIS hehehe
 
ugh, guy put his repo inside of /usr/share/nginx/ -_-
 
haha why not
 
Is there a non-web chat application for SO chat?
 
10:11 AM
nice likeness
 
haha :D
 
@Jimbo Many have been proposed by various rooms, afaik none have come to anything so far
 
I am not really good with drawing anymore but I like to make people look fun
 
@DaveRandom Is there an API for the data, or would it be one mahoosive web-scrape?
 
@Jimbo you can do with the websocket
 
10:13 AM
The latter, there's nothing for chat, everything that works with it does it by crawling the backlog
There is a websocket interface but SE won't specify and stabilise it
 
24
Q: Will chat be accessible through the API?

MicTechWill chat be accessible through the Stack Overflow/Stack Exchange API?

 
@Jimbo there's some mumbo ju(i)mbo to get the correct websocket url, but afterwards it's pretty straightforward
 
^
The only issue is that it may one day break with no warning
 
yup
that said, it's been stable for years
because SE doesn't care about chat
 
dicks
 
10:15 AM
Well there was a change reasonably recently to plug the info leak about who was starring/flagging messages
(iirc)
 
@ziGi lol
 
@DaveRandom yeah, was thinking about this one too
but meh, not much of a change, really
 
@Jimbo what do you want to do? There's a reasonable chance someone has done at least a bit of the work already
 
@DaveRandom Starring is still available
 
@DaveRandom Nah I was just thinking it'd be nice if there was a native app to chat through
I'm on OS X
 
10:17 AM
lol osx
I mean durrr durrr durrrr
:P
 
@Jimbo Package the site in a cocoa webview
 
You could just build one of those standalone Chrome things and point it at chat.stackoverflow.com
 
@Amelia Native, not 'fake native' :P
 
You'd be surprised how many "native" chat apps do that
 
10:28 AM
Hi, which is better way to insert rows into mysql.
One by one in a loop or as 1 multiple row insert query?
After searching for a bit and trying with 10k rows, multiple row insert query seems faster. but is there a limit ? or some kinda pitfall? i cant seem to find any
 
don't you know, Mac is the best machine you could use for development ;) ;)
Said the mac users
PHPStorm 9 has partial PHP 7 support
and inline debugging for PHP which is great
 
OIS
afaik phpstorm9 just doesn't freak out on php7 return types, thats all the support there is so far?
 
no idea
but I am amazed that they add Remote Development just now....
 
@OIS They just made it recognise php7 return syntax but ignore it.
@ziGi It's like linux, but stable and with working video card drivers
:3c
 
@NikiC was that for me?
 
10:40 AM
@Ocramius Maybe. If you recently wrote something like ...array_merge($a, $b) then yes
 
hello guys
anyone here could help me with a quick php problem i am getting?
 
@NikiC what did you mean by multiple unpacking then?
 
@Ocramius ...$a, ...$b
 
my problem is regarding curl i think
the php script i made runs perfectly on local
but stops working on server
webserver
 
@EneMihai I sense an XY problem
 
10:45 AM
i have more details posted in there
 
@NikiC oooh, right, didn't think about it :D
thx
 
11:04 AM
@Amelia haha that's total BS
Linux is stable (check fedora)
 
@ziGi the latter still applies.
 
^
 
I haven't seen @marcio in a while
 
11:21 AM
Fuck Adobe ImageReady
That's precisely what I wanted, a more retarded version of Photoshop
 
good evening guys.....I'm gettting an error message like this ...Warning: implode(): Invalid arguments passed...my implode statement is ..$images="'" . implode("','", $places) . "'";any 1 know whats wrong with the code
 
if places is an array(), use join() that should work either way if it's an array
 
@pokeybit no.
 
okay why?
 
@pokeybit huh?
 
11:30 AM
@pokeybit join() is an alias of implode(). Saying to use the same function is not going to change anything.
 
it's 3 less chars
duh
 
...
 
and i stated it would work either way
 
@pokeybit ...Their issue is that it doesn't work, likely because $places isn't an array.
 
i pointed this out
"if places is an array()"
twice
"way if it's an array"
so please don't tell me, tell the guy who has the problem :)
@user12688 try print_r($places); in the line before that statement
 
11:39 AM
lol at fedora being stable
 
@FlorianMargaine old news is old
Been around since the 70's
80's rather
 
@ircmaxell I love stuff like that
Always wanted to get one of those laser things you point at a window and can hear in on conversations because of the vibrations on the glass... just for the science and 'wow'
 
11:55 AM
@Jimbo you can even do it from a video recording of a plant, analyzing the subtle vibrations of the leaves newsoffice.mit.edu/2014/…
 
Cool time piece. Get it!?
It arrived a few minutes ago
 
Anonymous
@Fabor so cool
 
Anonymous
I'm jealous ...
 
@Fabor woa
 
@JoeriSebrechts That's fascinating... such clever use of technology
 
12:02 PM
Now looking at the time dries my tears when realizing there's several hours left in the working day.
 
@Fabor link? :P
 
To buy it or see it?
 
Anonymous
:/
 
@Fabor Buy
 
12:05 PM
@Fabor I see some of the best protein bars there :)
 
I reckon you could reprogram the LED to be something else.
@SergeyTelshevsky Yeah, after a few boxes not so much. Better than a chocolate bar though
 
posted on July 09, 2015 by nlecointre

/* by spongebob */

 
yeah, after trying about 10-15 of them these are by far the best ones on the market (imo)
 
@Fabor Nice, managed to find it for less than 6 quid with free delivery (Y)
 
@Jimbo I'm lazy + I got prime so next day delivery
 
12:08 PM
Me too, but not that lazy :P
 
Any Laravel users able to give me a hand?
 
@BrockB. just ask, dont ask to ask
 
@Jay.s There would be a max number you could insert at once based on the max data size sendable. And although the multiple row insert query may be faster, it would probably have poor interaction with other queries that might be happening at the same time, as index would be locked for inserting during the whole of the insert.
 
I'm using an adldap package in Laravel for authentication. I'm able to authenticate fine, but I cannot access the ldap properties of the logged in user.
 
12:14 PM
foken embedding
 
@SergeyTelshevsky all praise the onebox
 
12:51 PM
Hi all ! I'm running xampp on windows 8 and developing with php without any framework. I just installed composer in C:\xampp\php folder. I created a composer.json file where I required the package I want to install (algolia.com/doc/php#Setup). But when I run 'php composer.phar install' in C:\xampp\php it installs the vendor in that directory ; and this is a problem since my project is in another directory (out of xampp directory).
I am a bit newbie. What should I do ? Manually move the vendor directory in my project ? Or specify to composer the path to install the package ? It's my first time I use composer
 
@SuperKiwi add the path to composer in your environment variables, and then run it in the project's directory.
or in the project directory, just call Composer with the full path to where it is.
 

« first day (1727 days earlier)      last day (3225 days later) »