« first day (658 days earlier)      last day (4276 days later) » 

1:01 PM
and
Jul 20 at 13:59, by Truth
Please stop writing new code with the ancient mysql_* functions. They are no longer maintained and community has begun the deprecation process. Instead you should learn about prepared statements and use either PDO or MySQLi. If you care to learn, here is a quite good PDO-related tutorial.
 
@Lusitanian tnx for letting me install php5.4 :|
> You don't have permission to access / on this server.
:(
 
@MikeB @tomexans @Whisperity Thanks, but Im getting another error now: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 
@Blade There is something utter wrong with your SQL queries. Try to redesign the logic it flows.
 
@Blade mysql_query($query, $dbconnect) or die(mysql_error() . ' Query: ' . $query)
 
IIRC, this is the thing we are talking about:
$table_id = 'Forever';
$table_id2 = 'BenutzerFavoriten';

$name = mysql_real_escape_string("foobar");
$query = "SELECT Favoriten FROM $table_id2 WHERE Name = $name";

$favoritenstring = mysql_fetch_assoc(mysql_query($query));

$string = stripslashes($favoritenstring['Favoriten']);

$query = "SELECT Name,Beitrag,Bild,satzid FROM $table_id WHERE satzid in " .$string;


$dbresult = mysql_query($query, $dbconnect);
 
1:04 PM
@PeeHaa Apache get updated with the install?
 
@MikeB I had to update apache. Because windows php5.4 needs VC9 compiled apache
ow fuck
Apache uses different auth now right?
 
hmm not sure. I only know of the allow/deny directives
 
Order allow,deny
Allow from all
Is old I think
 
@PeeHaa There are some sorts of new directives but afaik Legacy stuff still works.
 
Let me just try to rewrite them and see what happens
 
@Whisperity Correct this is the stuff. I will try to rearrange it.
 
blub
bli
bla
 
nice
 
yes fucking woot yes!!!!!!
Require all granted all the things
@Whisperity Ah wait there is a compat module :P
Nevermind it is working now new style :)
 
@MikeB You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query: SELECT Name,Beitrag,Bild,satzid FROM Forever WHERE satzid in
 
1:12 PM
satzid in ...
 
@Blade You are missing the value of WHERE satzid IN .
 
@MikeB @Whisperity $query = "SELECT Name,Beitrag,Bild,satzid FROM $table_id WHERE ID in " .$string;
If enter a value for $favoritenstring manually it works
 
> Apache/2.4.2 (Win32) PHP/5.4.5
ow yeah
 
@Blade Can it fetch a value for $favoritenstring properly?
 
@Whisperity Yes.
brb
 
1:30 PM
Anyone use php.net/splfixedarray exclusively?
 
@MikeB Impossible to use exclusively
 
not exclusively, but I've used it
 
Well not impossible, but it makes your life harder :)
 
Because of the sizing stuff?
 
because it's not suited to all problems
 
1:44 PM
anyone can help me install imagick on heroku ?
 
I've just added a new a record in my dns settings, but I also see a reload button. Not sure whether I should click it...
Any idea?
 
bad translation :?
does the site have a 'native' language? or maybe just try changing it to any other language you understand :p
 
lemme check
nopez :(
 
haha
 
:P
 
1:47 PM
<input type="reset"> ?
 
@MikeB good call. Glad I didn't click it :)
<li class="header buttonRow">
				<div class="resetbutton"><button class="psmButton button" value="reset" name="zone[action]"><span>Reload</span></button></div>
				<!-- BEGIN rrHeaderCanEdit -->
				<div class="addrecordbutton"><button class="psmButton button" value="addrecord" name="zone[action]"><span>Voeg record toe</span></button></div>

				<div class="savebutton"><button class="psmButton button CTAButton" value="save" name="zone[action]"><span>Opslaan</span></button></div>
			</li>
Seems indeed to be a reset button :)
 
landmine
 
2:04 PM
@Whisperity Iam back. Lunch took longer than anticipated. So again, yes, when I enter a value manually it works and it can also fetch the value.
 
2:15 PM
why do I need to declare static class member variables whereas there is no need for either public member variables as well as global variables?
class Funkytron {}
Funkytron::$staticOne = 'Hello';
 
@hakre Is this a rhetoric question?
 
it would be nice if one had to declare member variables too ;)
 
@PeeHaa Well, it's a "what do you think" sort of question. It's not that I want to propagate the use of static members, however, in the PHP sense I'd say this should be possible.
@NikiC Probably the person who introduced static members thought so, and therefore at least made it for static once's :)
 
@hakre And I think it's also related to the fact that we (thank god!) don't have stuff like __getStatic etc ^^
 
@NikiC wow, that is missing, too :D ^^
 
2:28 PM
we need to add it!
just imagine the possibilities!
 
So let's praise something as esoteric like the goddess of whitespace to not have that much magic in there :)
 
you could create a static registry
and wouldn't even have to define what is in it :)
 
Ah right, and I'd say that ArrayAccess from SPL needs to have as well StaticArrayAccess, you get the idea :)
And we need StaticIterator as well as StaticGenerator.
And the special interface SuperStaticArrayAccess should allow to overload superglobals.
And even create new ones!
 
@hakre yeeeeeesss
 
Did you guys get hit on the head??
 
2:32 PM
So $db can be superglobal
 
:-)
 
very useful
 
class Registry implements ArrayAccess { ... };
spl_register_superglobal('_REGISTRY', new Registry());
@NikiC killer feature actually.
 
@hakre pff, $_REGISTRY['db'] is far too much code (you could just as well write $GLOBALS['db'])
just do spl_register_superglobal('db')
which will mark the $db variable as superglobal ;)
 
@NikiC Yes, we need that spl_register_superglobal function
 
2:34 PM
runkit has it :P
 
oh no
 
@NikiC SPL needs to have it *gg*
 
though right now i don't see where in runkit you define superglobals
but I'm sure it has it...
ah, as an ini option!
 
Oh. The use of $GLOBALS... Yay... Why I didn't think about this before? At least I can clutter down my global $user, $template... lines.
 
runkit.superglobal=db,user :P
 
2:36 PM
What happens if I merge a local branch into another local branch but then I only push the "target" branch? I mean... how will the commit history be handled. (Obviously git.)
 
just like that
 
You can do a dry-run to see what merge-strategy(s) are chosen
 
what would be special about it?
 
but it would probably be easier just to try it and review the log
 
error: unkwown option dry-run And obviously I don't have man in mingw32.
 
2:41 PM
65
Q: Is there a git-merge --dry-run option?

OttoI'm merging in a remote branch that may have a lot of conflicts. How can I tell if it will have conflicts or not? I don't see anything like a --dry-run on git-merge.

 
@MikeB I like the +46 comment
The only thing that one should debug in production is jekyll :P
 
@NikiC I suggest next to the global keyword we should also have the superglobal keyword ^^
this will remove duplicate code in certain situations easily
 
@hakre Yes, this will clearly remove the duplication in my code
Also it will make PHP closer to Python
So people won't have to switch from PHP to Python
But it would be even better to just make superglobal the default
 
python has build in superglobal power override mode?
 
and have a local keyword
@hakre Well, in Python all functions close over the parent scope ;)
 
2:52 PM
and for those who lost orientation: the superlocal keyword should not be missing as well.
 
@Whisperity Again, yes, when I enter a value manually it works and it can also fetch the value. So do you maybe have another idea for me? :)
 
a superlocal variable is a local variable shared accross all local variable tables.
 
In Python all functions are basically closures, just like in JS :)
@hakre ooooh
that's really insidious
 
Oh and... why don't we make a linelocal so the variable only exists in the line we define it? And systemglobal... let's just share the variable across every single bit of code on the host machine.
 
@NikiC It's the hidden revenge of a bored language designer.
 
2:55 PM
@Blade You need to check the value what it fetches and the syntaxes. Does it properly concantenate the fetched value into the next query?
 
I think we should generalize this powerful concept
I.e. to have a general way to define variable boundaries
E.g. scope($thread_id % 2 == 0) $var would make $var available in all even threads!
 
@NikiC I still remember the variable scoping of Visual Basic 6... Dim.
[ <attributelist> ] [ accessmodifier ] [[ Shared ] [ Shadows ] | [ Static ]] [ ReadOnly ]
Dim [ WithEvents ] variablelist
 
I sense this is a good time to grab some lunch
 
@Whisperity As far as I can tell, yes.
 
And scope($active_symbol_table === $GLOBALS || 0 === strpos($function_name, 'db_handler_') $db To make it available only in global code and db handlers :P
 
2:57 PM
:-)
 
Damn, I really like the scope idea
You could write some really fucked up code with it
 
If global is that hated, why doesn't it reach the same fate safe_mode and magic_quotes did?
 
@Whisperity wordpress uses it
 
@NikiC Oh and about this idea:
20 hours ago, by Whisperity
@Event_Horizon I don't know but I don't want to see the face of the algorithm documentation guys if they want to model how the script works.
 
@NikiC Welcome to the SPL ScopedAccess interface ^^
Probably an addition to the reflection extension as well ^^
 
3:01 PM
dammit, we just need a foreign function interface for php
i mean so you can write inline C
 
inline C would be really cool
as well as inline assembler
 
inline C implies that ;)
 
We are really wanting to implement what other languages have into our beloved PHP. Occam's Razor but... wouldn't implementing the functionality PHP has into the languages we want to derive from be a bit less hard? (Okay fail sentence, pardon me.)
 
@hakre It's especially important to have the VirtualAlloc function available, so we can allocate executable memory and write code from database in there
for codepad
:P
binary codepad
damn, php is suck a terrible language
doesn't have all those awesome features
 
I want my PHP code to be executed on Vacuum tubes... or to wire my vacuum tubes into PHP.
2 mins ago, by NikiC
doesn't have all those awesome features
 
3:37 PM
It is a movement now.
ah, static class members are actually superglobals.
 
1 hour ago, by Whisperity
What happens if I merge a local branch into another local branch but then I only push the "target" branch? I mean... how will the commit history be handled. (Obviously git.)
Apparently, this does. My local chaos branch with all of its commits are treated as commits of the develop branch.
 
yes, each commit has a parent.
that's how git can do better merging later on if you have let's say a thousand branches all over the world spreading around - like with linux for example?
 
And local git branches are basically just commit pointers
 
Well, at least question's answered. I can live happily now :P
 
hm, I think I don't get how pcre handles optional capturing groups
aaaaahhhhhhh
I suck
I forgot the error_reporting(E_ALL) line
 
3:49 PM
:P
 
I really think that PHP should default to E_ALL when running from cli
 
/etc/php/cli/php.ini settings? There is some sort of php.ini defaulting for the CLI execution.
 
i usually run without ini
though in my ubuntu vm i recently created one
to get rid of that damn timezone warning
 
I don't need no singleton.
 
you're scaring me
 
3:55 PM
this reminds me of some discussion with a lead dev I had some years ago in a Zend Framework based project.
He told me: All classes we write, we write as Singltons.
I asked him why.
 
For me, singletons sound a bit strange... Why would I make an extra round of getting the already existing instance if I know that I only want one instance and so I only make one and use that?!
 
He said: Well, as each class only needs to exist once in a request in PHP due to it's shared nothing architecture, we can use singletons gg
 
@Whisperity good for you ;)
 
checkmate
@hakre was this project tested?
 
I don't say singletons are bad or pointless but as in the example of @hakre, they sound to be way too overused.
 
3:58 PM
@MikeB Öhm, naturally not. They told me when I started there, they wanted to make use of PHPUnit but have not done so far ;)
@Whisperity That's exactly what superglobals are for :)
 
@hakre Probably getting tripped up on all those singletons floating everywhere
Pretty common abuse of Zend Framework :(
 
@MikeB I need to convert the negativity into some artistic energy, yes!
@MikeB Oh I hope it's not common.
 
hi guys, is there any functions to strip onclick, onmouseover in the html tags?
 
@VinodkumarSaravana what for?
 
@NikiC He needs less jquery.
 
4:08 PM
<a href="test.html" onclick="javascript:alert('tet');" onmouseover="hide();">test</a> -- here i need to remove onclick and onmouseover
 
@VinodkumarSaravana I think you can find a regex somewhere which might do the trick.
 
@Whisperity "less jquery" is an oxymoron
 
$('a').removeAttr('onclick');
 
@VinodkumarSaravana Yes, but what for?
Is it because you want to embed user submitted HTML?
 
@Whisperity stackoverflow.com/a/1732454/477127 You can't parse HTML with regex!
 
4:10 PM
Oh. Good day, @webarto. :)
 
I think I will put that emblem onto a bullet
to visualize the power it has to go through everything
 
@GordonM I know. For long-time and production usage (like for sanitizing input on a website) it's not a way to do. But if he wanted to make it a one-shot run, he might use.
 
@hakre want to run amok, maybe?
You can die a martyr death! Just walk into a room full of Singletonians and blow the bomb ;)
 
The pony... it comes
 
Oh yeah, and you'll get 72 unicorns in paradise ;)
 
4:14 PM
> Even Jon Skeet cannot parse HTML using regular expressions.
 
@Nikic - we've given permission users to allow few html tags in the post...and we store as it is in the database. when some users post like onclick="javascript:alert('test');" it will show alert when loading the page...we need to avoid this type of code in the database
 
@VinodkumarSaravana I think Tidy is what you're looking for
 
 <img alt="" src="doesnotexist.jpg" onerror="alert(1)" />
HTMLPurifier
 
@VinodkumarSaravana Either use the tidylib or htmlpurifier.org
 
4:15 PM
@Whisperity good day :)
 
ah yeah, htmlpurifier was the other one
 
Ars technica keeps posting SO questions. I wonder who you have to bribe to get yours mentioned.
 
thanks PeeHaa and Nikic
 
Sorry, I do not offer support here for proprietary solutions. If you have vendor lock-in, you have vendor-lock-in. That's the way it goes, one of the bad sides of "optimizing" with zend. — hakre 24 secs ago
@NikiC Well, I will then create such a bandoleer and place it on the hips of an elephant
 
OK, need exactly 10 rep. Then I'll have 8888
 
user895378
4:25 PM
@Lusitanian I've figured out why the switch to sockets broke the http client for you -- there are a few things about the HTTP protocol you have to do manually when using sockets vs. the native http stream wrapper or even fsockopen that I wasn't doing properly. Specifically, I wasn't correctly handling chunked responses (Transfer-Encoding: chunked). It shouldn't be too long before things are running smoothly with the socket transfers if you need to use it in the future.
 
When this baby hits 8888 rep, you're gonna see some serious shit.
 
@GordonM fixed
 
@NikiC
 
Have I declared this correctly? Im trying to echo out the variable and it wont work. I am passing the "advertiser_name" in the URL from a previous form.
$query="SELECT * FROM tbl_tags WHERE advertiser_name='".$advertiser_name."'";
 
@GordonM You might wish to fix your Git so commits won't be orphan-authored.
 
4:28 PM
Please, don't use mysql_* functions to write new code. They are no longer maintained and the community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial.
6
 
user895378
OK, need exactly 3,584 rep. Then I'll have 10,000. Go to work, guys :)
 
Ok Thanks you
 
@rdlowrey Or 2585 rep to be OVER NINE THOUSAND
 
@tereško He didn't even say what sort of API he is using. But I guess it's way too unescaped and unprepared concantenated, query.
 
@Whisperity We have advanced heuristics to determined the used database API even without seeing it :P
 
4:30 PM
@Whisperity , you really will not want to bet on this with your own money
 
@Whisperity I'd love to, I've tried everything with git-config but it's stubbornly logging them all to @10.0.0.200. Set username, email, etc to be the same on both machines and still no joy
 
@tereško Agreed. I'm also pretty sure that it's mysql_*˙... if not only .
 
@MichaelKing , btw , why are you using tbl_ prefix for your tables ?
 
@tereško How would you otherwise know it is a table you silly :)
 
4:33 PM
[user]
	name = Yourname
	email = youremail@example.com
@GordonM Basically this is all you need in your ~/.gitconfig and it works.
 
@Whisperity Already have that in there.
Annoying. :/
 
@MichaelKing If you get $advertiser_name from the HTTP request and you don't do any work in it, $advertiser_name is most likely undefined. You need $_GET['advertiser_name'] or $_POST... for it to work, depending on the method attribute of your <form>.
 
@GordonM And does it match your github account settings? Beacuse it seems like it does not.
 
Though on one machine the order is [user] [github] and it's the other way around on the other machine. Would that make a difference? I can't imagine it would, but...
 
@GordonM You seem to be committing with the name gordonmcve while your account name is gordiansolutions.
 
That's weird. The [github] section is set as user = gordiansolutions
 
@hakre Is this even PHP?
 
@GordonM [github] section? I don't think we need a [github] section.
 
4:42 PM
I ended up with one after following their config tutorial.
 
@Whisperity This is a not so well formulated request to get some code ported to PHP I'd say.
 
@GordonM This and that's it. There are some nice stuff here also.
 
OK, tried tweaking the config file, but don't think it's helped. Just did a commit and still getting weird stuff.
 
Make a backup and start from scratch.
 
OK, there's a dropdown in Netbeans to let you set the user when you commit. I hadn't spotted that before. Trying to figure out where that additional user came from.
 
4:56 PM
Hallo folks.
 
github.com/equus12 Is this a bot?
 
@Bracketworks hallo!
 
Hello @Bracket.
 
Long time no chat.
 
@Bracketworks Howdy
 
4:57 PM
@Whisperity Either that or somebody who is really really bored
 
@PeeHaa Or researchers?
 
So.
Jul 6 at 20:49, by Bracketworks
Well, I just finished a "candidate evaluation assignment" for a job. Did not go the way I intended. Not one bit.
I got the job :P
 
hehe gratz
 
w00t
I just saw the github 500 page for the first time
 
As based on my "ingenuity and resourceful approach", actual quote.
I lawl'd
 
5:00 PM
nevermind .. read the chat history
 
Gotcha. Funny enough, the person who evaluated my assignment resigned shortly before my start.
 
lol
it might be sign of rats fleeing the ship
 
lol, no, it's a casino; it's not going anywhere.
My colleague resources now consist of a pair of graphic designers who were cross-trained for a day and a half.
 
Achey-breaky-network :P
 
@Bracketworks , that does not sound so good
 
5:05 PM
It sorta isn't; alot of fumbling in the dark, especially with the organizational paradigm and naming conventions used (rather, not used)
But, alas, it's pretty kick ass </bragging>
 
Hey can anyone help me with this. How do I prefix a chunk_split() string with spaces
like if I wanted to do
textextextext
note the spa
ces before th
e string
Grr it took out the spaces I added.
its the bottom answer on this
 
I had an interesting thought; would it seem like a good idea for documentation generators/parsers and IDE lexers to interpret proxy-class meta-information? Such as that a class declaring __call could be documented with @proxy Type, to assist with bridging the details in documentation and autocomplete?
 
I think I've fixed the github committing problem though!
Now I just need to figure out how to reassign all the previous commits to me.
 
@NikiC Would be super nice.
Just because something is a map doesn't mean it only has scalar keys.
    Right now my program is crashing on this:

    function getValue() {
        return $this->value;
    }
It's called from proper context, and $this->value does exist.
I'm getting no warnings, notices or errors.
And it works in other places of the code.
How on earth do you debug something like that?
 
It seems to be crashing on return $this->value because I can step into getValue() but then stepping out, over or into fails.
 
It's the actual return that it fails on.
 
And it works if I return a scalar value, but not an object.
 
5:28 PM
@hakre did you see Chris's answer?
Frustratingly close. Anyone know how to add a fixed number of spaces before each line of a chunk_split() string? If so please see (and edit or post answer) to my question
 
@ChrisMirno Do you know about sprintf?
Or you could use str_repeat.
I'm not exactly sure what you are trying to do, but my guess is one of those will work for you.
There's also str_pad.
 
And now to something completely different, the silver bullet in PHP:
user image
4
 
you made that with php?
 
5:43 PM
Pure GD even
 
thats nice. i made a gd class a while ago.
wheres the code?
 
Sounds quiet on here. I need some help with 'sibling' classes. stackoverflow.com/questions/11810574/…
If that doesn't spark some responses...
 
@Nile nah, that has not been made with GD. It's just some vector image.
 
oh ok
 
@J-Law Question!
 
5:46 PM
:D
 
You are trying to measure how long something takes to run?
correct?
 
No.
 
@J-Law You need to inject the timer instance into the other class if you want access to it
 
So you're saying, I just need one big instance...see, that's what I wanted to know?
 
@J-Law wut?
 
5:47 PM
Excuse me...
Maybe I said that wrong.
 
i think he's saying it needs to be in the other class through arguments or by actually making an instance of one class inside theother
 
I want a timer class, a database class, etc., but I need them to interact.
 
(is that right @J-Law)
 
@J-Law Why?
 
Correct, @Nile
 
5:48 PM
@J-Law That I do not know. I just don't get how you go from "hey I need to inject that variable" to "I need a big class"
 
Remember, this is only pseudo-code of what I actually have running.
 
Why do you need them to interact?
 
@J-Law Your pseudo code looks more like real code gone wrong :)
 
Because I want to be able to have a class function that I can call, and that class function would need to access the database and run a timer, for simplicity sake :)
@PeeHaa Bahaha...
 
@J-Law you need to pass it in an argument, preferably in the construct
 
5:51 PM
@J-Law Does it always run the timer?
 
Not necessarily.
I'm being very broad here. Let me put it to you another way...
 
can you pass it the __construct?
 
@Nile To be honest, I've never tried.
 
that may look better then you're current solution, why dont you try that?
 
class SomeClassThatUsesDatabase {
    function doIt();
}

class TimedSomeClassThatUsesDatabase extends SomeClassThatUsesDatabase {
    protected $timer;
    function __construct(Timer $timer) {
        $this->timer = $timer;
    }

    function doIt() {
        $this->timer->start();
        parent::doIt();
        $this->timer->stop();
    }
}
 
5:53 PM
@Nile So you're saying, under __construct, I would be (re-)creating the other classes?
 
0
A: PHP 'sibling' classes? How does it work?

PeeHaaclass Database {} class Timer {} class Foo { protected $database; protected $timer; public function __construct(Database $database, Timer $timer) { $this->database = $database; $this->timer = $timer; } public function doSomething() { ...

?
 
you could do it as @PeeHaa does it also
 
@J-Law The code I just posted is the polymorphic way to do it. I'm not saying it's a good approach (it might be, I don't know enough about what you are doing), but you seemed to want to use inheritance and this is one way of doing it.
 
Specifically, I have a database class that handles all of my database procedures. If I have a query setup in one class, I expect it to show up in the same instance in another class.
@LeviMorrison Thanks guys...I'm reading through it all right now.
 
@J-Law The principle is that whenever you have a class that needs another object in order to do its job, it asks for the dependency in the constructor. It's called Dependency Injection.
 
5:57 PM
@LeviMorrison Obviously I was going about this all wrong...my original thoughts (until I determined that it doesn't work this way) was to Extend my classes out, and then interact with sibling classes. Apparently it doesn't work this way :(
@PeeHaa I think I like your idea.
 

« first day (658 days earlier)      last day (4276 days later) »