« first day (1180 days earlier)      last day (3994 days later) » 

00:00
@DanLugg blah, I had volume up high
Ah, so it was all like BUFFALO BUFFALO BUFFALO...
@DanLugg loud noises!
I don't know what we're yelling about!
Well, I've had about enough. I'm going to buy a lot of oranges. Then go home and eat them.
Night room eleventeen.
Thanks for the explanations guys. Now it's a bit clearer.
00:16
0
Q: Is there a better way to transform this array?

Emilio GortThese arrays are the result of Store Procedure. They are to build a Google Chart, therefore I need transform the array to a specific format. I also want to remove the $col and $row elements that have a Null value. These arrays are dynamic to their length variable, but a $row element array alwa...

00:59
Dear room,
I would like some feedback on whether or not I should preserve key information in Collections.
Thank you.
CC: @ThoseWhoMightBeInterested @rdlowrey @Danack @hakre @DanLugg @crypticツ @ircmaxell @bwoebi
Unrelated: when the garbage truck pukes up your trash you know it is really, really bad.
01:36
@LeviMorrison yes, why not? I actually don't see any issues. user always can just apply array_values() if he needs to.
@LeviMorrison E_MASSIVE_MULTIPING
@LeviMorrison I agree with what I think you implied, that preserving keys should be on for default for Maps where the keys have meaning. I think it would also need to be preserved for other collections where the user is setting things via an index, so list + vector.
I've used those in the past to store results from an SQL query where i) the results cover a set number of days ii) the results are ordered by day. iii) the result set is sparse. Being able to iterate over the data set as foreach($results as $day => $infoForDay) is nice, but depends on the collection maintaining the index.
Key information shouldn't need to be kept for the other collections where the user isn't aware of the index.
user652649
02:13
morning
Morning
user652649
02:28
@LeviMorrison if $hashmap->slice(10,20) returns a new HashMap yes it should preserve keys, as opposed to $vector->slice(10,20)
user652649
but actually the slice method in theory shouldn't even exist on a map
user895378
@LeviMorrison I like the idea of only retaining keys for Map. The rest of the collections: meh. If you need a map structure then use a Map. That's not what the other collections are for IMO. Just because everything in native PHP is basically a map doesn't mean every data structure should act like a map too. But honestly I don't feel that strongly about it.
@Wes unless it's an ordered HashMap :O
user652649
do they exist? :P
@Wes anythings possible ^_^
user652649
02:40
i wonder how they are implemented internally in various languages :D
04:26
0
Q: Symfony2: How to access dataClass in a custom form type

ra_htialI have a custom FormType $form = $this->createFormBuilder($myClass) ->add('title', 'text') ->add('test',new TestType()) ... class TestType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) ...

how can i solve this ?
@ra_htial asked 27 mins ago … with patience?
05:02
@toscho no with Symfony2
user895378
awesome.
morning @rdlowrey
user895378
mornin'
awesome!?
05:13

Patience Is A Virtue

47 mins ago, 35 minutes total – 4 messages, 2 users, 0 stars

Bookmarked 5 mins ago by cryptic ツ

7
@crypticツ that's why all my pet projects are half done. Oh wait, that's called procrastination.
Hi all, I want to make a facebook app which will contain some videos. Videos can be share on facebook and twitter. I want to know how can i know the the records of sharing. that means i want to know the number of sharing
I wan to make the app like this :- facebook.com/…
@RakeshShetty with patience?
or maybe i should leave the answer for @toscho
@ra_htial I am new to this ,can you give me some idea how can i achieve this ?
@RakeshShetty first you need to break down the problem you are solving in to smaller problems. Then break down the smaller problems into smaller problems. This way you have 100s of smaller problems you need to solve. Then you can seek answers for 1 of those 100 problems if you still cannot figure out how to solve it
user652649
05:25
/me sends emails to customers at 6AM like a boss
hope they will not notice the hour, they may think i'm a vampire
@Wes "wow this guy get's up really early"
any one experienced sending mail with image and html code?
what wrong with this?
http://stackoverflow.com/questions/20978896/creating-mail-server-and-sending-html-content-with-image
05:43
@user3121782 try phpmailer.worxware.com
^ that
@user3121782 you need to send mime type header as text/html. The underlying mechanism of doing that, I do not know. Use a library
looking at it, does it allow to send image too?
everyday we are getting various mail with nice web page inside it. What do they use?
@user3121782 they use HTML. <img> tags are inside the html which links to images hosted somewhere on the internet
05:49
@andho yes i tries in similar way with image hosted on my server. I appreciate if you can check my code and tell me what's wrong with it
@user3121782 output (echo) your "html" and see if it is correct. Other then that I cannot help you
@andho Yes output is already working fine on my page
@user3121782 use one of the libraries mentioned above. I recommend SwiftMailer
06:44
0
Q: Is there a better way to transform this array?

Emilio GortThese arrays are the result of Store Procedure. They are to build a Google Chart, therefore I need transform the array to a specific format. I also want to remove the $col and $row elements that have a Null value. These arrays are dynamic to their length variable, but a $row element array alwa...

the current solution is awful
How ccn I do something better...what way?
Morning.
morning
How work RecursiveFilterIterator? How can apply to this case?
07:01
@EmilioGort it is really complicated to get what you need - the arrays are huge to understand it in a reasonanble time
Ok..I agree...just looking to do in a better way...as you say is awful tthecurrent solution
@EmilioGort do you have any particular question?
now it looks like: I have a screw driver and a hammer how to build a rocket
split the task into smaller chunks and solve them one after another
The main question I have is how to build the if stament whitout eval()
Just wondering, if I post a link to my Github repo on Code Review and ask for people to review it to see if anything can be done better, is that on-topic? =oP
07:08
morning
if ()
Code review is for that
this is how you "build" if statement without eval
Yes... :) but the comparison is dynamic...is proportional to the elements in the array
$ifScript .= 'empty($rows[' . $b . '][' . $a . '])';
how this is dynamic?
if (empty($rows[$b][$a]))
what is the difference with your code?
07:10
The array length can be variable
so?
what is the difference in these 2 pieces of code?
I don't see any
and what is it?
Can I do that?
:-S
do what?
07:13
let me test one thing
0
A: Object variable lose context in PHP pthreads

Joe WatkinsIt's normal: https://gist.github.com/krakjoe/6437782 There is no point in me writing the relevant parts out again; you will benefit from reading the whole article. TL;DR Resources are officially unsupported, coupled with how pthreads objects work, this leads to the behaviour you are experiencing.

how can you have 0 if the answer is accepted ?
@zerkms the if and the unset inside the if whitout eval()
@JoeWatkins acceptance does not mean an upvote
acceptance is 15pts and upvote is 10pts
oh doesn't it ... I never saw that before ...
there's your upvote =o)
07:23
:)
@EmilioGort ?
@EmilioGort I don't know the context but eval can be avoided [almost] always.
@Leri any quick example when it cannot be avoided?
yes I know...but I can't see a way to build the if statement whituot it ideone.com/Po0wEh
@zerkms Symfony and Silex both use it for Twig templates. =o(
07:28
@crypticツ does twig use eval?
there is a really nice templates parser there
hmmmmmm
I installed github.com/krakjoe/uneval?source=cc to disable eval on server and soon found out that my app failed because Twig needs eval() github.com/fabpot/Twig/search?q=eval&ref=cmdform
@EmilioGort I already asked you what is the difference for the expression in if with and without eval
@zerkms When you actually want to evaluate user input.
@crypticツ However, it can be avoided I believe. :)
07:30
look at this ideone.com/uVP2pR
there a single line in twig that uses eval
eval('?>'.$this->compileSource($this->getLoader()->getSource($name), $name));
@Leri please make a PR if so. I would love to just disable eval
@EmilioGort I'm there. So?
so twig uses it as an optimization
lol
yo said make the if in the normal way?
err: when it's not possible to write compiled file
@EmilioGort yes I have
07:32
@EmilioGort I have no idea what you are trying to do but it seems that you have chosen bad design for data-validation. :) What do you want to achieve?
$compositeConditionValue = true; then in a loop $composite... = $composite && empty($rows[$b][$a]);
m?
then after a loop check if the variable true
@Leri here is the complete code and the explanation
@EmilioGort have you seen my message above?
and?
07:35
I'm making a test
and while that you decided to make even more noise with that question?
please post 2 more times
dont be rude...
i'm here to learn
no fight
don't be obtrusive
we can understand from the first time
really
you might thinking that cats need something to be posted at least twice here. But be sure - I'm not a cat
no was for you was for leri he ask me the link
ohhhhhhhh
07:38
1 message moved to Trash can
@EmilioGort is posting your link post it with some additional text in the message or add a newline so it will not be on-boxed
I think newlines work to do it, not sure...
nope, just add some additional text with message like this message codereview.stackexchange.com/questions/38787/…
well...@zerkms compositeConditionValue = true; then in a loop $composite... = $composite && empty($rows[$b][$a]); didnt undestand well this...could you pls elaborate a little more
got it @crypticツ thanks
@EmilioGort what actually you didn't get?
you create a variable\
that is initially true
then you iterate over your data
and perform something like $f = $f && <cond>
if $f is finally true - then all the cond were true as well
trying
empty($rows[0][1]) && empty($rows[1][1]) && empty($rows[2][1]) && empty($rows[3][1]) && empty($rows[4][1] this is the part i cant get
omg
THE SAME
create a variable $flag = true;
07:50
then in the loop body $flag = $flag && empty($rows[$i][1]);
?
then out of the loop check the $flag value
@EmilioGort Sample
thanks....I'll show you in a moment my attempt
ohhhhhhhh
it will be a long evening
here are 3am
... for me
07:54
very cold with 50 grades
not a justification anyway :-D
I think I got it
ta-dah
-1
Q: MySQL autoincrement starting from particular number after data entry

jahajee.comI imported a very large file from CSV which did not have any primary key into a MySQL table. In PHPMyadmin I added another column to my table now, to create a primary key with autoincrement. The problem is that it is starting from 1. I checked this question and found ALTER TABLE column AUTO_INC...

please explain me how such people write a code that finally works? :-)
it's over me
@EmilioGort go sleep then
08:00
check it pls
please answer me honestly
are you serious now?
it's not an online prank show where one pretends they don't understand something trivial?
10 mins ago, by zerkms
then out of the loop check the $flag value
if you have issues with such a trivial code I suggest you to try to evaluate it on the paper
seriously, you need to understand what your code does
to not continue putting random stuff and expecting it to work
but how can make the unset out the loop
anyone got hhvm setup ?
08:02
to get the array index element
@EmilioGort WITH LOOP
with ANOTHER LOOP
another loop? no way
okay
go with eval
ok...I'll continue tomorrow...your time was not waste...I got your idea...thanks
08:15
@crypticツ it's amazing isn't it?
@zerkms indeed, some people just should not be allowed to code.
I mean ffs, doesn't know how to change a number. =o(
08:34
early morning musings ...
I was reading that reddit post about using C in PHP ... I found that to be fucking crazy, however, HHVM is not the only thing that can do very heavy lifting very fast ... hhvm likely still kicks the ass out of it, but still ... there's my thoughts on the matter ...
A friend of mine purchased and installed vbulletin
out of curiosity I opened chrome dev tools and found heaps of debug info
Securitytoken updated footer-rollup-505.js:96
vBulletin.loadingIndicator.show ajax indicator suppressed footer-rollup-505.js:96
vBulletin.contentEntryBox.init start ckeditor-rollup-505.js:9
vBulletin.contentEntryBox.init finish ckeditor-rollup-505.js:9
Ckeditor: initEditor(vb-cke-instance-1) footer-rollup-505.js:96
etc
Good morning.
so a friend of mine asked their support about that
here is the gem:
> You wouldn't, those are always broadcasted, even without debug mode. Most people are not going to be using firebug, or have the console open.
@zerkms Console is all about children being forced. You better call the cyber police:
It's similar to what I'm experiencing atm
08:49
@JoeWatkins it takes 50 seconds to run fib 40 :O?
@BenjaminGruenbaum with recursion
it's O(n ^ 2)
@zerkms I'm reading it wrong (I hope)
@zerkms lol troll.
Morning
@zerkms fib 40 takes 4.8 seconds in JavaScript... in internet explorer.
JS in latest IEs actually surprisingly fast
08:53
No it's not... chrome is at 1.2 seconds.
Are there any good forum scripts out there? I always liked the feel of IPB stuff.
yep
@BenjaminGruenbaum for me the difference is about 10%
latest chrome vs ie11
2s vs 2.2s
What code did you use?
08:57
I did:
console.time("f")
function fib(n){ return n<2 ? 1 : fib(n-1)+fib(n-2);}
fib(40);
console.timeEnd("f")
lol $n
Very similar. What CPU do you have?
f: 5987.9148ms in IE
That's not 2s vs 2.2s ?
1.5 chrome
it's not. here are numbers for your script run directly in console
and mine were for jsfiddle
and it's some 2yo mobile i5
i5-2540M
08:59
@DaveRandom I think I've turned the cv-pls JS file you made into a clusterfuck =o\
may be IE has some issues with evaluating scripts from console
09:13
morning
@hakre ?
^ edited, dunno why it didn't too the link from the answer, fixed.
http://stackoverflow.com/questions/20991496/how-to-create-an-array-w‌​ith-updated-value
09:33
@AlmaDo I love the mix of answers
09:46
guys
0
Q: Calculate several number ranges from numbers in an array

user3172501I'd like to calculate specific number rangers with a few numbers in an array. In my array I do have the following numbers: array(3500,3600,3700,3800,5000,5100); Now I need the number range and the output would be: 1: 3500-3800 2: 5000-5100 Anyone an idea what's the best way to achieve this?

from imperative point of view - it's a trivial task
but any ideas how the solution #2 from stackoverflow.com/a/20991807/251311 can be improved if following functional style
?
@JoeWatkins How was the call last night?
@zerkms why do that?
@AlmaDo just a challenge
@crypticツ I don't like stupid questions :(
a paradigm shift
10:00
Any of you guys use any automatic sync backup products like GoogleDrive?
Morning Alma and Hakre
I use syncback
@Fabien I'm wary of uploading my stuff to Google. I have a bash script which runs on cron and backs up to network drive.
yep, the same here. + external hdd
This would be just for keeping work files both at home and at work
if only you work in google
10:09
@zerkms always solve these with PHP latest features so that at the time the question is getting closed only some impractical answer is left over for the OP albeit it is correctly answered. That reduces the help-vampire training factor.
:)
Our company architect who wrote our PHP framework just asked me what Dependency Injection is.
And did you educate him? :>
:)
Scary !
10:10
He might know about it and still not know what the word means.
@Jimbo Well, perhaps he did that already but just doesn't know the name?
Monrings
@hakre if only I had a version that could support "latest features" installed
@zerkms some online codepad has ^^
@hakre No. Our framework is entirely statics. I tried to explain DI and DiC's and he was just like, "why" (and didn't understand why passing stuff into the construct was better)
@DaveRandom Hey man, sorry I had to run off last night
10:11
There is so much good framework now, why creating a new specific one ?
@Jimbo sure, if you have Super::$tatic, you do not need to inject - muhahah ;:D
lol
Everything is super static here
res::$database, res::$logger
It's all good, you can help living in the middle of f*cking nowhere and having to get the train and then ride a bike and it all being very complicated
:-P
If he like, he can apply for CPSE.
But perhaps we should also offer CPSA.
@DaveRandom Yeah, the gate was locked when I got to work, had to get the last train home instead :( didn't get in until 1 lol
10:12
Certified PHP Statics Architect.
@Jimbo #fail
@Jimbo The benefit here is, that it's not a global variable but actually a superglobal one.
So these places are easily to spot and turn into DI with refactoring.
Most likely the code has not tests as well, right?
@hakre it's tricky to explain that for a person who used to using it for years
@hakre No tests, just regression tests using Java
Okay, that's at least something to work with I'd say.
If that Super::$tatic principle has been followed consistently, you could start with introducing unit-tests for sub-components that take parameters instead of userland super-globals.
If there is need for re-usable components at all.
10:15
@DaveRandom gist.github.com/KyraD/9e2b74152b5a759db561#file-foo-js-L26-L45 that code block and line 330 is all I have added. The refresh time selection menu is not being saved to localstorage and it's not following time selected, instead using the default 60 secs =o( I tried to understand your code, I really did, but failed
If there is no need to actually maintain stuff over time with changes, all this super-global stuff is pretty effective btw.
@crypticツ Let me refresh myself on it, it's a long time since I wrote that
oh there is even a repository
with a vector stamp
<3
@hakre Stuff DEFINITELY needs to be maintained. The codebase is horrible, hard to understand. Super::$tatic is just awful
Besides, there's no SOLID here. We can't test things, everything has the new keyword all over the place
No design patterns, no OOP
@Jimbo just accept it
10:22
@zerkms Already have man :-) I've been here 16 months
so it is you who implemented it!
gotcha
Well, then double cross fingers that the code so far is more or less straight forward and does not use much magic, just new and Super::$tatic then you should consider a way to consistently change that for the new code you introduce.
@zerkms Haha, hell no. I'm having to add to this nightmare, albeit much nicer ;)
I always ignored lead-devs "guidelines" when they seemed stupid and just produced clean classes.
@hakre Magic? Most classes use __get and __set
10:24
@Jimbo oh that's borked.
We have multiple "models"
yes I can imagine. Lovely, lovely.
In fact, no abstraction. Anyway, no more complaining, I've learned what not to do :P
@hakre Saw Chris last night and he was telling me that, honestly, most places you go to work involve you working with horrible, legacy codebases. Have you seen this?
@zerkms someone ought to create an actual service based on that... check code standards and what not...
@Jimbo I'm right now in the position to actually create a dev-team around such code.
But you can make progress, it's just what you want and to understand why code has written in that way.
So it requires that you have the old devs at hand and can find out about their motivation and limits.
It's just that we all only produce the code that was best for us at that place in time at that place of work.
10:28
@Jimbo Isn't that fairly normal? -_-
@Fabien I don't know, I was really hoping I could go somewhere where they go "Oh yes, we write SOLID code. When we ask for OOP and MVC, we actually mean it because we know what we're doing"
Good luck.
Mostly people are concerned with pushing a project out the door with minimal dev time for most profit.
@Fabien Well, it's cant be that hard can it? There's loads of people like us concerned with good code
Find a place where money isn't an issue and you may find it.
@Fabien So the only place I'm really going to be able to use these principles I've been learning, and best practice etc, is within my own side-projects?
10:36
@ji
@Jimbo No, also when you start a new project from scratch
Oh I so hate when some newbie morons downvote me stackoverflow.com/questions/5827435/…
@Jimbo Bingo. But I am just a lowly dev. So maybe I am wrong?
@zerkms Here's a +1 to counter that ass
@Fabien lovely dev?
10:40
Maybe if you also get in a position of authority at a work place and a fresh project.
@zerkms lovely lowly dev :P
actually seen "lowly" for the first time. Thought it's a derivative from "low"
Mildly is. Low status.
@crypticツ OK I see what you're trying to do here, and there's a better way to do it, I'm just going through teh codez and docblocking it properly first though
@DaveRandom documentation! *throws confetti and sets off fireworks*
10:56
moin
morning again =oP
@Fabien no call last night, going to Southampton tomorrow ...
Oooh...
Town quay?

« first day (1180 days earlier)      last day (3994 days later) »