« first day (1255 days earlier)      last day (3918 days later) » 

00:08
Morning
 
2 hours later…
user652649
01:53
@PeeHaa did you move somewhere else in the world? :P
user652649
@DaveRandom do you remember the merovingian's thought about french? xD
user895378
@bwoebi Just keep telling yourself you live in the best of all possible worlds ;)
 
1 hour later…
user924016
06:33
Mornings
mornin'
user924016
The weekend is over. =/ Time to get back to business
06:51
I have a string containing special character i.e abcé . I get different md5 result if i harcode the string and if i send the string via http request(i.e via input box).
If i apply utf8_decode function to the string i received from the browser and get md5 of it then it gives me same result as i received from md5 of hard code string .
The content type of the HTML page is set to "iso-8859-1"
I am not getting it why i am getting different result , why i need to apply utf8_decode
first of all, why would you set content type for a page to iso-8859-1 ?!
I did not do it. I am debugging the already built project.
it probably is caused by some pre-set defaults
when you are testing the "hardcoded values", are you using iso-8859-1 everywhere ?
No , iso-8859-1 is not used anywhere in the code
was your file saved as iso-8858-1? what is the fallback encoding used in php.ini and webserver's config
the point is, that you probably yourself are using utf-8 at some point of toolchain
07:06
;default_charset = "iso-8859-1" , commented in php.ini . In httpd.conf i am having following setting "AddDefaultCharset UTF-8"
07:19
good moaning
user924016
Moaning
Morning
There's no "use regular expression to convert html" answer like an xslt answer :)
lol
07:23
@RonniSkansing I did not have one. My job is getting really annoying after new manager.
user924016
Sounds horrible Leri
user924016
Mondays needs to be ease-in...
@Tarun probably means that your hard-coded string is in iso-8859-1.
and what's sent via http request is utf-8
@RonniSkansing Well, it's.. I was working 6 days (and Saturday was shorter working day). But 7 working days in week?! LOL
If I add this my low salary.. /me needs to find new job
user924016
I read somewhere most job changing considerations are done on mondays
07:28
Seems logical. ^
Job change in our business happens when either salary is low, or your job tries to burn you out.
user924016
Burnout is the worst
@RonniSkansing because Monday morning is that moment, when you're looking to started week and think: "What the f*ck? Do this sh*t 5 days again? No, that's enough for me!"
user924016
=]
@AlmaDo Exactly. Also this is perfect example how bad management can ruin everything. I am the only programmer since my old boss and co-founder moved. If I leave the company they'll be in quite bad situation.
I read somewhere, people wont leave companies, they leave managers :P
user924016
07:35
hehe
user924016
@Leri are you looking for a new job now then?
@RonniSkansing I've decided it this morning. So, yes, I am looking for a new job. Updating my CV on careers.
One year is left until I get my B.S. degree here but I'll be open to any relocation offer if there'll be any.
@JoeWatkins i agree
user924016
sounds like a great idea. Imo it has been easier for me to find a job when I already had one..
Good morning!
07:41
Oo.. why?
it's more like Friday morning, not Monday
@RonniSkansing Yes, companies are interested in you. You have real experience with working in office, in a team, you've worked on real-world projects, etc. The thing is that I don't want to move to new company as Junior, because I am pretty sure I am better than that.
morning :(
Dunno sleep a lot this night
so you're trolling us (:
MON RING
07:42
@Duikboot Look likes mother Russia. :)
hahah :D
@AlmaDo This is why working 80% (mo-th) is so much better :)
lol. I'm working 8 hours each month
nevermind then :D
and doing nothing during the rest 152 (:
07:45
When you receive a new project. And they ask 'how much time will it take.' How do you start then? Is there a specific way you start indicating your time?
@Duikboot freelancing or as an employee?
well ... you looks at the project's description and write down how much you think that the project will take
and then multiply it by 3
yes, there are some techniques. And I'll never give answer in the moment when they've asked. Also I'll never answer certain time. I'll answer [from...till]
and also you'll need some coefficient (depends of your experience in time estimation)
The answer is usually: 6 to 8 weeks
07:48
@AlmaDo I almost forgot to thank you. I've published my first app. :)
As an employee. Teresko do you always it *3?
For example I have to create now something that I can indicate well but 2 parts of it not.. I never made something like that so it will probably take longer but I have no idea how long it will take.
@Leri then why thank me? save your gratitude to yourself (: it's you who've done all the work
@Duikboot teresko will do it in x0.5 and will get to Hawaii for the left x2.5
@AlmaDo If not you slightly pushing me to publish I would not publish. :)
@Duikboot nope ... in practice it's not possible
07:56
But it happens. ^ :)
@Leri oh that.. It's just good lesson that I've learned well. It's not only about programming. General life principle (:
08:08
good morings
Hi @iroegbu
Is there a specific place you hold your snippets?
This is overkill for me: snippets.me/#
@Duikboot I keep my snippets in stackoverflow.com
Is it a good pracice holding them in a Gist?
08:42
@Duikboot care to learn Python
That's why you either make millions until you "grow up"; or just deal with it.
08:57
@AbrahamJewowich That's the most Jewish name I've ever seen :o
> I don't want to look like I'm married with 2.5 kids ...
haha
2.5?
A newborn.
it's like the average nr of kids i suppose.
I though that is an integer-type function
08:58
or, one on the way heh
@tereško Thanks for that, anyways...
@salathe Guid mornin!
is it an antipattern to interact with a factory class through another class? i.e. through a convenience method?
you could as well asked it "is it an antipattern to do a thing?"
it would have made as much sense and contained about the equal amount of information
@hohner Example?
@tereško Ahhh, gotta love having you here :D
ThW
ThW
Morning
@SecondRikudo don't start it (:
hi, @ThW
09:28
Mo'nin
@tereško thanks for the meta-response
well ... you asked a meta-question
@SecondRikudo I have a Schema class which relies on a Validator class. When validating, the Validator needs to run through an array of Constraint objects and call a validate method on each. I'm wondering about the best way to create these Constraint objects and then add them to the Validator
Good morning.
I need to add these Constraints to the Validator from the Schema class. But I don't know whether the Schema should interact directly with the factory, or use a convenience method (in Validator) to do all the work
09:32
Validators should be passed as dependency, imho.
it's a dependency of Schema, yes
with direct interacting you're binding your schema class to some pre-defined validators, making whole architecture non-scalable (and non-flexible).
// use a convenience method
$constraint = $validator->createConstraint('Foo');
$validator->addConstraint($constraint);

OR

// direct interaction with factory
$factory = new ConstraintFactory();
$constraint = $factory->create('Foo');
$validator->addConstraint($constraint);
@AlmaDo when you say "direct interaction", do you mean with the factory? or with the validator dependency?
well ... it would seem to violate Law of Demeter
^ and, even more, encapsulation principle
09:36
also, it makes no sense that a thing makes something only to later add it to itself
mornings
@tereško I completely agree. But it's more verbose. I also need to inject an object ($validator->errorHandler) into each constraint object, so it made sense to have the validator call the factory since it has direct access
Overall, there are 26 Schema methods which need some form of validation. Which is why I didn't want to have to manually instantiate a factory every time, it duplicates code
@hohner I generally have validators as callbacks, that get attached to (usually form) objects. I tends to make things a lot simpler.
a factory should produce a fully functional instance
09:40
if your "constraint" instance requires an error handler, then factory should be responsible for injecting it
@tereško sure, but the Schema doesn't have direct access to the handler. It would need to return it from the validator first and then hand it over to the Factory. Which is why I thought having a convenience method in Validator would reduce the code footprint
Mornings
@hohner Why would the Validator be responsible of how you handle errors?
also , there seems to be something deeply wrong with fact, that your validator AND it's dependency both have the same dependency
@DaveRandom mo'
09:41
yo chriscross
failing constraint should emit an exception
Morning
which then is caught by your validator and handled
mornin'
@tereško I take it you're happy at your new job.
09:44
@Achrome I am content ... I wouldn't go as far as to say that I am happy
How's Fracture coming along?
@tereško You're making it really hard for me not to throw a meme at you right now, you know that? :P
@SecondRikudo that's a great point, it shouldn't be. The error handler which is injected into the constraint (a Symfony event subscriber that listens for emitted errors), shouldn't have anything to do with the Validator. The Schema should pass it directly in
@tereško thanks!
@tereško Should validator throw exception(s)? Invalid data is not exceptional, imho. It's just invalid...
@Leri I'm exceptional and I find this offensive.
09:47
@Leri I kinda agree with that sentiment
@Leri I'd think that the fail loudly principle would mandate throwing an exception
error handling should accommodate different error strategies. one could throw exceptions, another could buffer them, log them to filesystem, etc.
@hohner I attach callbacks.
each is encapsulated in a different class that implement the same ErrorHandlerInterface
@SecondRikudo that's cool for simple validation
not for validation that requires more configuration and/or state
In my Form object for example, every Field is associated with an array of callbacks which return an boolean. If one of them returns false, it's invalid.
09:48
@Achrome Validation is not meant to fail in most cases (speaking of web). It's meant to provide useful error [code] so user can see what went wrong and fix it. :)
However, in case of a service like a validator, the consumer of the service should throw an exception.
@SecondRikudo but doesn't that result in a massive data structure that maps each field to a nested array of callbacks? also, how to you handle individual errors?
@hohner Nested array? No it's a 1d array if you only want "valid or invalid", a 2d array (where an error message is supplied for each callback) if you want errors for each validation.
It's a rather crude system that can be improved greatly, I just didn't have the time to put on it.
@SecondRikudo The alternative could be to error out on the first failure. It's simple to implement and covers most validation scenarios
09:53
@Achrome That's what it does.
I haven't seen ternary abuse like that before.
It iterates over the validations array, and when one of them fails, it will break out of the loop and provide an error message to the FormResult object.
Ah yes, I didn't see your previous message
@Leri true, but his setup seems to so messed up, that exception would be the cleanest way
I would have something like $constraint->match( $param );
i am finding something to be pretty unusual.. when i am writing javascript code within php code blocks, the php page is not responding at all.. it is not executing.. has anyone come across this issue? and by the way.. the php page itself is fetched as an ajax response..
@tereško I usually prefer $rule->validate($param) // returns result code that can later mapped to user-friendly error
@AmalMurali That's rather typo than dupe.
i have a problem debuging my virtualmachine webproject from my host system. xdebug is able to connect to my host but it does not stop at breakpoints. heres my xdebug log output: sebsauvage.net/paste/…
10:17
still stuck doing things I shouldn't ...
/* implementing serializable on the fly */
uopz_function(C::class, "serialize", function(){
	echo "serializing\n";
	return "hello world";
});

uopz_function(C::class, "unserialize", function($data){
	echo "unserializing\n";
	var_dump($data);
});

uopz_implement(C::class, Serializable::class);
@AmalMurali Binding value before it's defined. :)
@Leri: That's what I thought too, but take a look at the manual documentation.
@AmalMurali Huh.. That code sucks in so many ways that it should be burnt. :)
what is the recommendable ecommerce plugin for cakephp? VaM Cart seems to be the only solution in bakery (demo links not working) & zuha on github with no activity
user924016
10:22
Maybe it is not recommended or suitable =]
@Leri: php.net/manual/en/mysqli-stmt.bind-param.php#example-1721 — The parameters are passed by reference so it doesn't matter
@JoeWatkins Wut is that?
Creating Constructing class in an obfuscated manner? :D
0
Q: Make large numbers to numbers with decimal point

Nir TzezanaI have an issue with large numbers when I try to make them small numbers with decimal points. I want to make a number like 58,123,456 to a number like 58.12. Is there a way for me to achieve this?

Whaat?
@JoeWatkins mhm.. not useful unless you do something so weird that I can't even think of...
@rdlowrey oh… no. no. If the theory of parallel universes is true, I'm sure, there are better worlds (for me).
@Leri unit testing stuff mostly ...
@JoeWatkins… put your tests in a namespace and override the internal funcs that way?
Oh.. /me needs more unit tests
@bwoebi that doesn't help, nobodies code is calling namespaced unit testing stubs, you have to be able to override stuff like imap_open or curl_init or session_start or whatever ....
10:31
@Leri yeah , well , he called them "constraints" ... constraints are not "validated" but "applied"
and I would opt for boolean response, because otherwise you would need something like getReason()
@JoeWatkins well… there's a fallback to the global namespace if the functions don't exist?
And for classes etc. you can just manipulate your autoloader to have a look in the global namespace.
Voilà, fully transparently namespaced.
not that simple ... obviously ;)
.. queue the boromir-meme
@tereško This is basically what I do.
I'd like to hear your opinion.
Rule::validate should have argument, just a typo.
@JoeWatkins no? What are you doing wrong?
10:44
busy, work it out ...
oh. You add serializable functions to a class…?
@tereško Any chance you could integrate some form of secure authentication with your fw? Once done - that's pretty much all we need for a baseline for any application (don't really want to open the can of worms that is symfony security)
Genuinely think all frameworks should have auth out of the box for ease of use
@Jimbo Morning.
I am kinda disassembling my framework to make it work with composer
@Jimbo I disagree. It could be a separate package but it's not essential/required and needs differ
10:48
I could add the authentication/authorization bit .. but not this month
@tereško Cool
@Patrick When someone chooses a framework for rapid development, they shouldn't have to choose between shit code (wordpress, fast) and good code (no auth, but best practice), necessarily anyway. It'd be great to have a middle-ground that "just works"
I've set up a Silex repository with inbuilt mysql auth that "just works", and for all projects I can just start with this blank slate with stuff already working for auth. But it was a nightmare to set up
@Jimbo It could be a separate package. What if I need a framework for a site without auth or a different auth solution than the inbuilt one? I think teresko is doing the right thing by splitting everything up, then you can use what suits your needs.
@Patrick Like what symfony does, I guess, with separate components.
Maybe I'm just disgruntled because of how complex the firewall setup is for symfony-security
Powerful, but complex
Morning
hi, @Jimbo @Fabien
11:02
What's up guys
@Leri Mongrins
@Jimbo why a wrapper for casperJS? Why not Behat\Mink?
@Gordon I have not seen this option, looking at the main site now. Are there any docs / github stuff?
i have a problem debuging my virtualmachine webproject from my host system. xdebug is able to connect to my host but it does not stop at breakpoints. I asked derick on irc about my logfile. he thinks that my path mapping isnt valid. i've mapped this: z:/bla/ => /var/www/bla which should be fine. heres my xdebug log output: sebsauvage.net/paste/…
@Gordon and... have you use this personally?
@ycelik Are you using PHPStorm?
11:12
@Danack hi danack. yes iam using phpstorm.
@ycelik It should prompt you about setting up the path mapping when you're debugging, however you can also do it manually. It's in the 'server' setting for the debug config.
I think if you enable xdebug.remote_autostart = 1 it will hit a breakpoint immediately.
Which should bring up the dialogue box for setting up the paths.
@Danack i did it manually. i mounted my project virtual machine to z:/ on my host system to be able to edit source files under windows with phpstorm. i mapped z:/bla => /var/www/bla in my path mapping settings. iam requesting the webpage on my host system with chrome and xdebug helper. the connection is ok but i dont know why phpstorm isnt reacting.
Ok, so do xdebug.remote_autostart = 1 and see if PHPStorm picks it up.
btw have you 'picked up the phone' ?
@Danack i try it like that. I'll add xdebug.remote_autostart = 1 and delete path mapping settings. hopefully phpstorm pops a box.
(not a euphemism).
11:21
yea sure ;) thanks for reminding
@Danack phpstorm isnt responding. same log output. added xdebug.remote_autostart = 1 to my xdebug.ini, restarted apache but same :'(
Does the webpage fail to load? I.e. is it waiting for the debugger, or does it just load fine?
@Danack no it loads successfully. it waits a sec and loads it fine.
@ycelik Can you show all of your xdebug settings?
@Danack sure. should i also show my vm settings?
11:27
They shouldn't be an issue.
@ycelik though if you have forwarded the xdebug port, that could be an issue:
...
For those wondering why it started working for Nadav when he stopped forwarding port 9000, it's because Xdebug actually works the other way around. Instead of your computer connecting to your Vagrant box on port 9000, Xdebug actually works in reverse—your Vagrant box will connect to your Xdebug client on your (host) computer. James Walker has a nice explanation of that here. — Jonathan May 23 '13 at 16:19
has anybody used prophecy/phpspec before?
@Jimbo github.com/Behat/Mink and no, I haven't
11:36
@ycelik Well let me know if that fixes it - before I start looking at the xdebug stuff.
@Danack no it doesn't fix it. same issue. connection is ok as it was before. xdebug log gives me the smiley but no answer from phpstorm.
can sombody please help me ??
@webarto I looked at codeception actually, but from what I found it doesn't support touching JS and jQuery stuff, waiting for elements to appear, clicking on them via JS etc
Ah, well, probably...
11:45
@Jimbo big question is whether you need a JS environment (e.g. scripts on page need to be evaluated) or are happy with static DOM parsing
@Gordon Definitely need JS env; our code has a lot of JS for things like fileuploads and translations within js files
@Jimbo then Mink might not be the solution you are looking for. nvm then. but I really dont know.
We have JS animations in there too, our current stuff is Java + Selenium + Webdriver so I'm looking for something to replace the mess that I can write with PHP
Or CasperJS as a backup
Hence the wrapper for casperjs in php
hello i need help .. i asked my question twice but didnt get solution
@user3292058 you're not supposed to ask your questions again if you didnt get a reponse
11:48
@Gordon Hmm? I thought Mink does Javascript just fine with the selenium browser driver?
@user3292058 and asking for "Fatal error: Call to a member function bind_param() on a non-object" is nothing you should have to ask aNYWAY because it has been asked and answered a hundred times before.
@Danack Problem is if I'm using Selenium don't I have to update the bloody chrome driver that's always behind when a chrome update comes in? I was kinda hoping for some way around this
@Danack tbh, that I dont know.
thanks for your replies ...
but i am not getting ... what is wrong in my code
??
My first answer on workplace went down well :-)
46
A: Could asking questions online damage my professional reputation?

JimboPersonally, I think it shows career growth. You say you have done good research, shown your efforts (as sites like StackOverflow require), and learned from your mistakes. This is more valuable than being someone who doesn't know how to ask questions - which is an important skill in itself. First...

11:51
@Gordon Pretty sure it does - davidwinter.me/articles/2012/01/14/…
@Jimbo I have good comment to the question. But I'm too lazy to create an account there :p
@Jimbo I think turning off the auto-updates would be the simplest way to solve that.
@AlmaDo I felt sorry for the guy - he's worried that him trying to learn could be seen as a negative - so I was trying to make him more confident in his ability to learn
@Danack Hello everyone. My name is James, and I'm a apt-get upgrade addict.
I'm asking questions on SO not because "I am newbie and I don't know what to do". In fact, I almost always have my own solution. But community will always do better than that. And it's a way to learn and to improve my knowledge
@Danack then don't mind me :) rambling
11:53
@AlmaDo Exactly, you can't just go around thinking you know the best solution when it's likely others can provide better ones - and you should want to know how what you have come up with can be made better
Hence when I gave my talk at PHPNW I prefaced it with "if anyone wants to throw bottles or stuff at me, please feel free as I'd like to learn how it can be done better" - nobody threw anything, but still
/noteToSelf bring bottles to PHPUCEU
lol
@Gordon Are you giving a talk?
@Jenny yeah, better
11:55
thanks
@Jimbo maybe
@ycelik tbh - I don't know what the issue is. I guess that you've double-checked all the settings and that you've changed what port PHPstorm is listening on, to be 9005 etc. However if remote_autostart doesn't make phpstorm popup with a debug session, it means that xdebug isn't communicating with PHPstorm, rather than it being a paths issue.
<<< afk
@Gordon You're talkative today :P if you have any ideas you want to bounce around with a more junior person, feel free - ah okay, no worries
@Danack the problem is: on irc channel they say the opposit. they say the connection from xdebug is working fine, phpstorm is misconfigured and i should especially check path mappings.
11:59
@Jimbo Meh. Testing environments should be stable imho. Having the test environment (rather than the tests themselves) break because software was upgraded casually would lead me to: youtube.com/watch?v=Xy3MtznDeqg
@ycelik Derick also says it's better to give a warning rather than default to UTC.
Who starred my msg - it's not important to the room
@Danack Yeah I know, overzealous on my local environment with updates I guess
@Danack i dont understand this :/
@ycelik Me neither. You may have more luck trying the following. 1) Remove all the xdebug config. 2) Add the config:
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
With the correct port.
morning
Yo @NikiC
12:04
3) Initiate the xdebug session from inside PHPstorm by setting up a PHP web application and hitting debug.
hi, @Danack @NikiC
@Danack ok sir i try that
@Danack same problem. connection is ok no answer from phpstorm
Well, I still stand by my, "it's the connection" that's the problem.
^ I'm working on a WP site and here's what I found in a page ...
@HamZa Yay for adding JS via TinyMCE
12:13
@Danack any ideas how i can check if its about the connection? should i try to debug with netbeans or something?
@ycelik How about trying to debug something outside of the VM?
Hi developers, Do anyone have an idea of uploading a file to another server2(PHP script don't work here) and Server1 have the executable php script. So if i run the php script in Server1, the file must be uploaded to server2?
Guys, how do you correctly benchmark a piece of code?
As in, the timing mechanism?
microtime() gives huge variance, especially between compiles :/
@Danack i'll try that
This is really annoying. Effectively I don't have any way to know whether a change has a performance impact, unless the impact happens to be huge (like things got 50% slower)
12:26
@NikiC You can do time php somescript.php and it will give the time take.
@NikiC time <exe> <args> is what I generally use, can't vouch for that being "correct" though
However....benchmarking is hard imo.
@Jenny Gray text on white background => hard to read.
ok
12:27
@Jenny looks good except that black background on list when Hovered on Java
@Jenny Don't like the right sidebar, feels too cluttered and doesn't seem to contain any info that the page actually needs
And I personally prefer more text per line - 70 characters means that there's just far too much scrolling.
Also underlined headings are horrible
ok
12:29
@Danack tada! i tried to debug one of my projects located on the host. i was able to debug that project before but right now phpstorm doesnt react to the debugger.
So....that narrows it down to it being borken. But definitely not a file mapping thing. tbh I'd suggest going back to port 9000.
@Ramaraju.d where?
@Jenny That hover effect, i mean when you put your mouse on Java a list appearing on hover.
ahh
gotcha
12:36
@Danack i tried that. iam just gonna reboot and check why phpstorm tryin to make me crazy. brb and thank you so much !!!
np.
This is weird
If I add a piece of (totally unnecessary) code, it is 50% faster than if I remove that (totally unncessary) code
More is always better!
You surpassed the totally unnecessary code threshold and triggered totally unnecessary code optimizer.
Totally unnecessarily.
12:54
@NikiC show me
?
@JoeWatkins The additional code is:
p = ht->arBuckets[nIndex];
if (p != NULL && (p->nKeyLength == 0) && (p->h == h)) {
    return FAILURE;
}
(Note: The branch is never actually taken)
I figure this has something to do with the memory access to ht->arBuckets[nIndex] being done earlier so maybe it somehow interleaves better with following memory reads/writes
though really, I'm at a total loss here ^^ doesn't make any sense

« first day (1255 days earlier)      last day (3918 days later) »