« first day (1253 days earlier)      last day (3920 days later) » 
00:00 - 18:0018:00 - 23:00

00:05
Doing it wrong.
00:26
morning
01:07
@NikiC No, it's a full project. I have more digging to do
01:26
To add and remove methods on the fly you would need to override __call() and keep a map of closures.
HIi
any one can help me on js
jquery
var thisObj = $(this);
var type = thisObj.parent('td').attr('class');
var newData = thisObj.val();
var santanceId = thisObj.parent('td').parent('tr').attr('id');
santanceId = parseInt(santanceId.replace('tr', ''));
thisObj.parent('td').html('\'<img src="uploads/loading.gif">\'');
if (type === 'sentnc') {
$.ajax({
type: "POST",
url: "operations.php",
data: {santanceId: santanceId, sentnc: newData},
success: function() {
var newDom = '<span class="td-edit">' + newData + '</span>';
thisObj.parent('td').html(newDom);
after success i cant update my newdata to td
01:41
Hey @tereško, wb btw :-)
02:16
Ok, so now I'm speaking at a conference in like 3 weeks, that I never even submitted for, but somehow got selected... Hmm... Need to think of a new talk
@ircmaxell topics?
anything really. Just somewhat relateable to Drupal...
so yeah...
I wish I had a clue 'bout drupal, heh
Well, like I was thinking about an algorithms of functional talk, but those wouldn't be as practical... Though could be fun
02:32
@ircmaxell as long as it is fun for you - 3 weeks of advice for a conf is... mean? :P
yes, yes it is
LOLZ  for some reason your Development by the numbers session showed up in this year's batch and got scheduled.

Let me know if you want to present on something else- you own the node so can update the description if you like.
o___o
 
4 hours later…
06:24
@LeviMorrison looks sane enough to me
I think in the current atmosphere, the hinting for type or null should follow the hhvm way of doing things ... I don't actually like it, but think that's what everyone will want ...
 
3 hours later…
vs7
vs7
09:03
Hi i need help , I just integrate paypal to my site
All is working good
Add product , Payment , then back to success page
but the only problem is notify_URL not works
I add mail function to test response but didnt get any mail
echo '<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

			 <input type="hidden" name="business" value="[email protected]">

			 <input type="hidden" name="cmd" value="_cart">
			 <input type="hidden" name="add" value="1">

			 <input type="hidden" name="notify_url" value="http://go4qp.com/fbtest/s1.php" />
			 <input type="hidden" name="return" value="http://www.urbaniacs.com/hideout/inventory/" />

			 <input type="hidden" name="custom" value="'. $custom .'">
here is the form which i used for paypal
user924016
09:42
Moornings
mornin'
Peace be upon you guys (morning^^)
user924016
wb @tereško
user924016
how is your project going?
09:50
morning
@AhmedSabry and may His Noodly Appendages be with you
Cthulhu Ph'tagn!
.. I need to read more from Lovecraftian stories
Anyone wants a simple method to prevent SQL injection? Click the link. It's completely free. Currently only available to those who have 10K rep points.
I was using ajax in my Chating project but Now I want to use websocket. What php class or library do you advise for use ?
09:54
@tereško: I discovered this one: 100 Books To Read In A Lifetime today morning.
I've only read like 3 or 4 of them in total. :/
hi,
i m try to get directory/file list
i m use following code

$invisibleFileNames = array(".", "..", ".htaccess", ".htpasswd");
$dirContent = scandir("songs");
foreach($dirContent as $key => $content)
{
$path = $content;
if(!in_array($content, $invisibleFileNames))
{
if(is_file($path) && is_readable($path))
$urls[] = $path;
elseif(is_dir($path) && is_readable($path))
$urls = scanDirectories($path, $urls);
}
}

on localhost work but on server gives an error
Call to undefined function scanDirectories()
@Nilay: Where do you define the scanDirectories function?
@AmalMurali i m take whole code from php.net...
@AmalMurali i understood that "scanDirectories" is in-build function
@Nilay: You've got that wrong. scanDirectories is NOT a built-in function.
I assume you got it from comments. Add the function definition too.
@AmalMurali ok thanx for help ;)
10:01
@AmalMurali that actually is the "latest hype" list
only ~10 of those are genuine classics
@tereško I'd wager to say that there are quite a few classics in that list.
But seriously, how is The Hunger Games in that list?
I've read it, and it's not that great. Forget about being a classic
I have not read the book. Only watched the movie. Not bad.
10:23
@Gordon:May i know why this Question was down voted and why on hold...i found the concepts in wiki are not reliable cause i found association as also a oops concept but was not there on wiki.and i dont know what else it is missing!!!! — Vishnu 8 mins ago
what?
YCS on fire!
@AmalMurali Let me make it straight all in once. Please don't bother with expressing your disagreement with any of my statements. You opinion will never be taken into account as I value my own practical experience a bit higher. Yet I found already that is no use to explain your mistakes. So - just move on. Please address someone else in your remarks. — Your Common Sense 2 mins ago
@Gordon It deserves a "WHAAAAAAAAAT". What does that even mean? :O
I can hardly believe it ... that's code I wrote for work ... and am allowed to release !!!!!!!!!
10:40
"You opinion will never be taken into account as I value my own practical experience a bit higher." - ROFL
Experience is one thing. Learning to admit one's own mistakes is another :)
@JoeWatkins Crazy Serbs :D
> Compsing clases on the fly ...
inorite ... crazy, no one ever lets me release anything, not ever ...
@YourCommonSense Meta tags are fallbacks used in case the server does not send an equivalent header (hence http-equiv). See w3.org/wiki/HTML/Elements/meta and reference.sitepoint.com/html/meta/http-equiv. Amal is right here and your downvote on this answer has no merit. — Gordon ♦ 1 min ago
@JoeWatkins if you haven't deserved biggest raise in the company I don't know who has :P
10:49
בוקר טוב
בוקר מצויין
@Gordon: Do you think this rollback was correct? I felt like that was meta-information and removed it but he rolled back the edit and re-added it.
@AmalMurali It probably wasn't.
@AmalMurali rev 8 is okay. he de-emphasized his opinion and made it a side note.
> Excellent breakfast
You too mate!
10:54
But since he moved it to the bottom, he probably did realise that the rent is over the top (literally) and put it in the bottom.
בוקר
@webarto Haha, means "Excellent morning"
@user3123545 morning
;D
So, whatever is written on Hebrew, we're just going to reply "morning" :D
@webarto it says morning
10:56
Didn't know there are a lot of israel developers on SO
@Gordon you speak hebrew or translated it?
@user3123545 googled it
Are singletones bad practice?
@user3123545 Yes.
SELECT COUNT(*)
FROM
   Users
WHERE
   Location like N'%Israel%'
Singletons are bad practice.
11:01
2796
@user3123545 singletons or Singletons?
That's not much that much, because from my retarded country it say there are about 1100 folks, consider Israel is the bomb with technology, not much I would say.
capital 1
223
A: Is there a use-case for singletons with database access in PHP?

GordonSingletons have very little - if not to say no - use in PHP. In languages where objects live in shared memory, Singletons can be used to keep memory usage low. Instead of creating two objects, you reference an existing instance from the globally shared application memory. In PHP there is no such...

0
Q: Why do we have a c++-faq tag?

Second RikudoI know better than most the need for canonical questions asked daily by newbs and newcomers and the need to keep an organized list of these types of question, but is it really necessary to introduce a meta tag for it? c++-faq currently has 129 questions, out of which, 128 is also tagged c++. Th...

cc @Gordon ^
11:07
@SecondRikudo see the comments by BoltClock
Yeah XD Reading
11:49
0
Q: Gradient overlay on transparent png

DJDavid98On my website I have a PHP script that turns this image into a recolored version of the same image based on a $_GET query. An example with the query being 07a is available here. Here is the PHP script that does this: <?php if (isset($_GET['color']) && $_GET['color'] !== "") $color = preg_m...

12:04
@Gordon Singletons are not all bad. what about php 4.0? Every time you passed an object you php would copy the entire object. Say singletons are no longer necessary. Cause probably someone read an old book explaining their use. This makes more sense.
user895378
Singletons are all bad. Not using singletons is not the same as copying lots of objects.
user895378
PHP 4.0 is not relevant.
user895378
You can quite easily reuse the same object everywhere in your application without incurring the costs of singletons.
@mAsT3RpEE no
Anyone here get static shocks when they they off the laptop after being on it for a few hours? Lately every time I get up off the laptop and I touch something I get one of those static shocks
12:12
if i developed my own script for websocket chat without using a library like Ratchet. would it be good for big number of users or should i use a library ?
@Danack Sorry dannick. been to busy to maintain my site. 1st hackers got into it and i've never recovered.
@rdlowrey Singletons are actually very difficult to do in PHP4 anyway, it doesn't have static properties, and you can't assign references to static function variables - DI is actually mandatory if you want a half-way sane OO application in PHP4.
good morning
user895378
@DaveRandom lol I forget you've been working in PHP4 hell.
@DaveRandom the static props are not an issue. The lack of visibility is. you cannot enforce the singularity at all.
12:19
@rdlowrey You know, it's actually a little refreshing. The lack of visibility sucks, but the lack of type-hinting has made me remember that duck-typing can good. The GC without circular reference detection also sucks.
user895378
@DaveRandom I agree wholeheartedly with your typehint statement. I don't care one bit about the scalar typehints and generics everyone constantly clamors for. There are significant productivity gains to be had from duck-typing. Very significant. And good programmers can still achieve safety in these kinds of environments.
@Gordon No but you can create an API that behaves as a singleton as long as that API is used.
tbh "how to create a singleton in PHP4" is one of the most hateful and redundant discussions I've ever had in here :-P
user895378
lol
@rdlowrey The problem in PHP is the visual mess (and to a lesser extent performance overheads) of doing all the runtime checks - is this an object, does this method exist etc.
JS is good for the visual side, although performance-wise I guess would be implementation specific
user895378
JS seems like PHP4 to me in that everything everywhere is public :)
12:25
I much prefer obj.method !== undefined over method_exists(obj, method) for readability
user895378
Would be nice to not need the method_exists function call overhead.
@DaveRandom Don't worry. Some time in the future there will be a class for almost everything. They will be a part of SPL and people will laugh at the concept of writing a class the same way we think about programming in assembly. I wish i was born then.
@rdlowrey Yeh I mean I can live with that side of it, although I still have a tendency to abuse lexical scoping for private members in JS
On a related note, does anyone know if it's possible to tell PHP Storm to ignore a specific method for code completion?
@DaveRandom let me dig up my singleton registry
user895378
By using vim or notepad++? ;)
12:29
Like /** @noCodeCompletion */ or something
@rdlowrey Yeh but I love the refactoring tools. Maybe I should just turn code completion off
@Gordon Out of interest, when was the last time you wrote any PHP4?
1
A: File private variables in PHP

GordonWell, I'm probably getting flailed for this, but you if you are totally desperate you could use a Registry for that. I've whipped up a small one that does without classes (since I assume from And no OOP is used here so I'm not searching for private class members. means you don't want to do it wit...

@DaveRandom not that long ago. I think somewhere last year when I finally upgraded a customer's server to PHP 5.3. The Cake Legacy project I mention from time to time.
If anyone thinks they can compile PHP5 for this particular system (I'd even take 5.2) I will pay them real money. I have root access but it has no compiler and no build headers, and I just generally have No Idea What I'm Doing when it comes to cross-compiling anyway.
@Gordon How long did it take you to port the codebase?
@DaveRandom I didnt
Rewrite or upgrade and pray?
The latter. Actually, I had to do some rewriting but that was because I also upgraded the Cake version
12:39
error_reporting(0); // ftfy
Can someone please tell me how I can get the journey value into the sub query where the '?????'s are
@jskidd3 Er, use a temp table.
Ooo what's that then
user652649
@jskidd3 respect for being able to handle that color scheme, nearly killed me xD
XD
Temp tables are something to do with '#' right?
This is all just to do with scope
But I have no idea how that works in SQL
12:50
@Gordon I don't understand the registry as a programming concept. When is it actually used? The only use I've seen so far is for registering services that are configured during initialization and used by various parts of an application. But i dont code that way.
Do you have any real world uses for it? That improved or made your code better?
@jskidd3 Basically they're temporary (obviously) tables that are created as part of a query to avoid having to write massive sub-selects. I can't see a really good tutorial but this appears to be a basic introduction.
Though having said that, it may not be appropriate for your query....
@mAsT3RpEE Registry in a nutshell: instead of using $_GLOBALS throughout your code, you are using new Registry($_GLOBALS) and then litter your code with static calls to it
Is there any reason why you need to do it as one massive query?
user652649
@Gordon registry has necessarily to be globally accessible?
@mAsT3RpEE Registry will never make you code better. It may make it shorter, but it will make it a lot harder to maintain
12:54
@jskidd3 Where does vehicle_journey come from (I'm probably just being blind).
@Wes it doesnt, but its often used that way. It's basically a less global global. Also, it also doesnt help if you inject it everywhere and pull data out of it because then all your code depends on the Registry and still hides what it takes from it.
@jskidd3 That query looks to me like you are trying to force multiple data dimensions into one flat set, it looks like you should probably break it up a bit...
Thank you.
It also looks like it will probably take a thousand years to run
@Danack Thanks for the link. vehicle_journey is a join in the subqs
It takes just under 0.2s so yes
12:56
so in other words, Registry is pretty much useless. And let's not forget it sucks for TDD.
31
A: How is testing the registry pattern or singleton hard in PHP?

GordonWhile it's true that "you can write and run tests aside of the actual program execution so that you are free to affect the global state of the program and run some tear downs and initialization per each test function to get it to the same state for each test.", it is tedious to do so. You want to...

@jskidd3 Yeh but how much data is in there?
In what?
The database
There are 3k rows in journey_pattern_timing_link
Really the question is: is there a lot more data going to end up in there
12:57
400k rows in stop
So to be clear, when you ask "how I can get the journey value into the sub query where the '?????'s are" do you mean you want to pass in a value, or are you trying to match in from somewhere else in the query?
Yes for journey_pattern_timing_link, no for stop
@Danack I'm trying to pass in the value that was selected
Like based on the current selection
That make sense? Hard to explain
You can bind the parameter twice. Are you using pdo/mysqli ?
@jskidd3 Then over time that will probably get a lot slower
13:00
So maybe two queries, one to get the journey and then the second one i just pass it in?
That was always an option I just tried to stick it all in one query for tidiness
I'm not sure how to do it with named params, but with ordered params you can just bind it twice:
$sth->bindParam(1, $journeyCode, PDO::PARAM_INT);
$sth->bindParam(2, $journeyCode, PDO::PARAM_INT);
user652649
@Danack needs:
$sth->bindParam(':val1', $journeyCode, PDO::PARAM_INT);
$sth->bindParam(':val2', $journeyCode, PDO::PARAM_INT);
user652649
for consistency (not all drivers accept multiple placeholders with the same name)
@Wes I bet you're right - but that gives me the heeby jeebies. Giving the same param two different names.
user652649
there's a discussion about on bugs.php.net iirc they want to throw an exception if the sql contains the same placeholder 2+ times
user652649
13:05
for security implications, parameters count must be equal to bound values
@Danack It's the same with named params, you just use two names. You can't bind the same name twice (actually you can with emulated prepares but they should be turned off)
@jskidd3 which table does the journey field come from?
@JoeWatkins github.com/krakjoe/uopz … Runkit v2.0?!?!?
well, sorta
@JoeWatkins why did you create a new extension instead of updating runkit here?
because he can?
13:18
didn't intend it to usurp runkit, that just happened in the course of being useful, I actually started on test_helpers ... we use them both to run test suites and with opcache they both of them make tests fail all the time ... so this fixes that ... I don't know runkit and have never used it ... easier to write clean code ...
hmh...
sebastian says he might deprecate test_helpers in favour of this ... we already deleted runkit from servers ;)
btw. I'd eventually add the _compose function to the php standard library maybe
(but only and only that one)
user652649
@SecondRikudo guess who did that? xD
user652649
13:23
> I don't know how to star messages properly. I should be banned from the PHP room and Stack Overflow chat in general. I am a disgrace to myself, and my fellow PHP programmers.
7
haha lol
13:34
@JoeWatkins You mean use ? to indicate something that can be null?
I would be slightly more restrictive with what they offer and only provide it for T_STRING; ?array and ?callable wouldn't be allowed.
user895378
@LeviMorrison Why not ?callable?
user895378
?array is probably pointless because you can pass [], but I can see valid scenarios for ?callable
An empty callable is much easier to provide than an empty object.
And the nullable object is only there because basically everyone uses null to represent a missing or empty object.
13:39
@rdlowrey Like what? When a callable is supposed to be returned but you get nothing, I expect it to behave like a noop for example.
In that case, you want to return function() {}
morning
function (abc $abc = null) { } is absolutely fine and finitum :'-(
user895378
Oh, you guys are talking about return typehinting. I was thinking of input hints like function doSomething(?callable $callableOrNull) :)
user895378
For some reason. Don't mind me.
13:42
Well given that @LeviMorrison has an RFC draft on return type hinting, I was guessing it's that.
@bwoebi You have more control with what you return than what you are passed.
My preference is to defer the nullable decision until later.
If we are restrictive on launch that opens possibilities for later, but if we are permissive on launch it's harder to restrict.
user895378
@SecondRikudo Yeah my brain was just triggering E_WEEKEND ...
13:58
@rdlowrey oh me too… okay^^
traits are such a mess ...
I like the java solution better ... I'd have voted bodies on interfaces over traits ...
14:18
Morning.
/me starts hating his job
14:39
@JoeWatkins What do you think the best way to expose type-hints for return types via Reflection would be?
@Levi ReflectionFunctionAbstract
9 messages moved to Trash can
After mass pinging everyone and their sister twice? No, I don't think you'll get much help here, thank you very much.
$tinyAvatars++.
14:53
Well, that escalated quickly. Read that message again, @Rahul. Do you think it was a mature thing to do?
Wow, an actually valid flag.
@RahulMandaliya I lack the dexterity.
user652649
@Gordon bahahahah
I like outright hostile people. They make decisions easy. Suspended for two hours.
@Gordon Right?
14:58
@Gordon: Can you access chat while being on a suspension?
@AmalMurali yes, but they cannot talk
Rainbao Daaaaaash!!!!1eleven
Kind of +q on IRC :D
@Gordon Haha, now I wonder what'll happen if I do that XD
@SecondRikudo I am so tempted to try it out on my friends, but I fear my mum will fall for and then I have to explain how to change her pw ;)
@Gordon Temporarily unfriend her :D
15:03
@SecondRikudo hehe
@SecondRikudo: A page did this recently and a lot of people exposed their passwords. The amount of stupid people on the internet is E_TOO_DAMN_HIGH. xD
@AmalMurali People tend to trust the tech savvy too much. I'm pretty sure at least 5-6 of my friends will fall for it if I do it.
Same here. But I'm not going to do it anyway. I'm nice, you know :P
@AmalMurali Even if it will be removed, you can still user PDO to access mysql_ functions, this shouldn't affect existing code. But you are correct, for new code MySQLI/PDO should be used. — Aziz Saleh 56 secs ago
What's that supposed to mean?
@krakjoe oops, I accidentally a extension? Only you… :P /cc @phperror @saramg
perhaps ... what's your point ?
Hey, PHP community! Let's find this thing and paint it blue: http://www.boredpanda.com/elephant-paper-origami-sipho-mabona/ #elephpant #mascot
15:17
haha, this one's pure gold: boredpanda.com/funny-facebook-fails-ever/…. some more good ones here: boredpanda.com/funny-facebook-fails-ever
@tereško what's wrong with that article?
article is just fine
it's the title which i find sad
Anyone have any clue why this ini check is there? github.com/symfony/symfony/blob/master/src/Symfony/Component/…
@ircmaxell the author gave the explanation why the ini is check there in the exception message ;)
15:28
hey guys i am updating my website code and there are new css added... but it's not getting updated on my website... it's been 2 hours.. my server is nginx. what can be wrong here?
@nick Clear your browser cache.
@ComFreek did it.. not working still
@nick: Ctrl + Shift + R (hard refresh)
yo @tereško ... hope you're well ...
morning @ircmaxell, all ...
@AmalMurali : not working still... and i forgot to mention that I am using cloudflare(CDN) ..
15:34
Did you manually purge the cache? (not browser cache)
You can use the development mode IIRC.
@AmalMurali : how to do that.. no idea at all.. :/
2
A: INSERT INTO with php

John CondeYou're missing quotes around your string valaues in your query: $query='INSERT INTO order (phone, poinA, pointB) VALUES (43532, hye, moe)'; should be $query="INSERT INTO order (phone, poinA, pointB) VALUES (43532, 'hye', 'moe')";

I think that could use a @tereško comment :P
I don't have the comment saved for this computer
Aww :(
@Gordon well, not really. What functionality or bug does that prevent? It prevents extensions from overriding the upload handling parts of the request. I prevents all sorts of things
but I'm not aware of a single bug or vulnerability it would protect against
15:43
@ircmaxell you asked why, not what for ;)
you know what I meant
@ircmaxell true, but still :)
@AmalMurali : thanks man.. it worked! :)
@nick: Great :D
15:52
Is that supposed to be a joke? Because I don't get it -_-
@JoeWatkins are you here?
perhaps ... what's up ?
Trying to use pthreads :)
Not used to low levels of abstraction. Want my good concurrency back. Anyway, is there any good resource you can recommend?
I can't get a one sided answer even things like creating a daemon thread :P Stack Overflow is very messy in pthreads questions apparently.
@ircmaxell lol
I am, I am proud of myself.
Srsly though, I still haven't beaten it :-|
@BenjaminGruenbaum oh, urm .... it's probably a case of just reading the available docs on pubs.opengroup.org/onlinepubs/7908799/xsh/pthread.h.html or manpages ...
@DanLugg I finally did yesterday, and now I can beat it about 50% of the time
@ircmaxell Really? Any particular strategy?
yeah, try to keep it diagonally symetric
Yeop; that's what I've been doing; I always get effed somewhere along the way though.
Guess I have to keep at it :-P
Just keep the highest piece in a corner. And never press the down arrow.
16:02
I play into the bottom right left, so I think I need to hit the down arrow once in awhile ;-)
@DanLugg Then make it up arrow. The point is you should only use 3 arrows mostly :P
Also, to get upto 512 you can use the following combination: left-up-right-up
^^ Doesn't work particularly often, not in my experience.
Well most of the times.
I've tried every 3-5 arrow repeated combination, and while you might get up to around 128/256 particularly fast, the rest of the board can end up noodled
@AmalMurali I just do left-down back and forth until it blocks, then I think about a strategy to get unblocked
16:05
I created this to get off to a good start:
function a(e){var t=document.createEvent("Events");t.initEvent("keydown",true,true);t.which=e;document.dispatchEvent(t)}document.onkeypress=function(e){e=e||window.event;if(e.charCode=122){for(y=0;y<=100;y++){a(39);a(38);a(37);a(38)}}};var el=document.createElement("div");el.innerHTML="Press 'Z'";el.style.position="fixed";el.style.padding="12px";el.style.top="12px";el.style.left="12px";document.body.appendChild(el)
^^ My losing board about 8 seconds ago
16:30
I give up.
^ slackers :D
@AlmaDo: You solved it?
My highest is 17076 :/
writing CSS: I like abusing ::before and ::after with hover states.
16:45
@AmalMurali solved many times. In fact, I'm trying to solve 8192. And almost each time I'm getting 2048 there
There is a 8192 game?
ugh.. let me search
Your strategy for 2048?
it's same as 2048 - but you need to achieve 8192 to win
Maybe I'm moving too fast. I make one mistake -> game over.
I feel dumb now. Even my 11 year old brother solved this. :/
Which one? The accepted answer?
17:05
@AlmaDo ^
not only. there's only description. but I've tried that bot and checked it's strategy
17:21
@AmalMurali lol, I removed the #game-over-message node :-P
I prefer 2046 over 2048
I prefer 2042.
@DanLugg: I should do that too. It's annoying!
I prefer 42 then
17:36
YCS downvote mania again.
17:51
@AmalMurali mania?
@Danack I woudn't call it a mania though. FWIW, @AmalMurali handed out quite a number of dvs against the colonel, too. So if that is a mania, then they are both manic.
He's a colonel?
00:00 - 18:0018:00 - 23:00

« first day (1253 days earlier)      last day (3920 days later) »