« first day (1072 days earlier)      last day (3880 days later) » 

user652649
12:01 AM
@bwoebi does this work already? :o
 
@Wes yes, this works
 
user652649
that's fantastic :| :P
 
@bwoebi That's something completely different though
 
@NikiC yes, but it works?
 
@Joe's code creates actual methods, which can satisfy interface and inheritance constraints. Well, and it supports inheritance and interfaces in the first place
That's about the point of anonymous classes, being able to implement some interface without creating a real class for it ;)
@JoeWatkins :P
That's mainly a java thing though, because java sucks and doesn't have functions (=> callbacks)
 
12:06 AM
@NikiC then, just add a php.net/runkit_class_adopt fcall there…
 
They have lambdas only since very recently
So they needed anon classes to implement callback interfaces
@bwoebi yeah, sure, runkit...
but anon classes could be interesting in php too
 
@NikiC (well, yes; I wouldn't use that evil thing, I just wanted to say^^)
 
e.g. we already discussed scala-style traits like new Coffee() with Milk, Sugar; in here
anon classes offer the basis for that kind of stuff
 
@Levi that's a bugger, you can work around it ... but it's not so pretty ...
<?php
function node_factory($data, $next) {
    return new class{
        public $value;
        public $next;
        function __construct($data, $next) {
            $this->data = $data;
            $this->next = $next;
        }
    } ($data, $next);
}

class LinkedList {
    private function makeNode($data, $next) {
        return node_factory($data, $next);
    }
}
?>
yuk
 
Just give me proper private classes, please!
:)
 
user652649
12:09 AM
:P
 
But that's the only potential use-case I can think of for anon classes.
 
night
 
its too much effort to work around the compilers limitations here ... too much effort and too much disturbance ...
night @NikiC
 
user652649
gn
 
I still don't get why one should want to hide the classes?
 
12:10 AM
@bwoebi Because then you have to maintain a public API.
 
@NikiC night
 
I just noticed something ... you cannot use functions, like you cannot use "use" in a class decl to import a function ... I guess there's some technical reason for that ??
 
Say, uhm, I'm using anatcasesort() to sort files and folders. It actually works fine, except that things starting with an underscore are at the end of the alphabetical order, contrary to what happens in Windows Explorer, which places underscore high in the alphabetical order. Thing is, I'm used to using underscores to place something on top of a file list. Is there a way I can do that?
 
@LeviMorrison yes, for constructors, but from the moment on an object of anonymous class is returned, the API is public??
 
@bwoebi The inner class will never be allowed outside of the containing class. In my case, LinkedNode would never be visible from outside of LinkedList.
 
12:13 AM
Do that... rather, is there a way I can place underscores on top of my file array?
 
Except... I have to declare it outside and therefore I have a public API.
 
@LeviMorrison well, yes; but with converting to array, accessing the class via the stack of an Exception the concept just became superfluous…?
 
@bwoebi In my code that wouldn't happen :)
 
(which are just possibilities you don't have (?) in java)
@LeviMorrison but maybe in other's code?^^
 
user652649
@LeviMorrison pastebin.com/JTG7DFd6 how about a dependency on the constructor? i know it's not very practical sometimes
 
12:16 AM
Anyway, complex structures often require smaller structures that are never used outside of the class. It's a fairly common strategy.
 
user652649
... and you still have to make things public
 
user652649
private classes would be really cool
 
@LeviMorrison well, I never had problems with this… Still don't think this would be necessary (you always can use a backtrace check in methods if it's really so important that the class isn't accessed…)
 
For now I am planning on implementing these things in C so I don't have to expose the internal class, because simply, it won't exist :)
 
@LeviMorrison these things … more concretely?
 
12:23 AM
:) Ardent.
 
do you want to pollute SPL with them add them to SPL?
or just a separate extension, unrelated to php-src?
 
The idea is a separate extension that will one day replace the SPL.
 
@LeviMorrison sounds fine… we'll see when you've finished… ;-)
 
In my opinion the SPL is a horrible mess >.<
The only part that was done semi-well was Iterators.
 
@LeviMorrison well, I rarely use anything of SPL (exceptions are when I find a snippet to do something in very few code)
 
12:29 AM
I admit that many users never will need the SPL :)
Hello, Jack.
 
@LeviMorrison the only things are when I find it ugly to do all the open* and close* fcalls in a loop and can instead use a recursivedirectoryiterator (or something similar).
Good night.
 
Good night.
 
Hello there
 
nite boyz, gonna try sleeping now ...
see you in a few hours ...
 
Good night.
 
12:57 AM
morning
I heard someone say bad things about spl :) it's probably true
@igorw I've checked out the config service provider; doing it that way helped me realize where my initial approach was lacking ... I would initialize Application with the parsed structure of my configuration file, but that would be problematic with other providers that are loaded later on :)
It also means that the config provider must be the last one registered.
 
So I have mobile site and I am using GET varribles in the url. For some reason on mobile the variable doesn't pass though the url unless you open the link in a new tab. Any ideas?
Edit: I'm using <a href="?postKey=5">
 
user652649
you are probably using some script that intercepts regular links and manipulates them somehow
 
That is correct I am using jquery mobile but it works on desktop(still using jquery mobile)
 
#php: want anonymous classes ?? https://github.com/php/php-src/pull/470
:O
 
@NoahHuppert I don't think "?postKey=5" is a valid url...w3schools.com/tags/att_a_href.asp
Possible values:

An absolute URL - points to another web site (like href="http://www.example.com/default.htm")
A relative URL - points to a file within a web site (like href="default.htm")
An anchor URL - points to an anchor within a page (like href="#top")
@Ocramius it no work.
 
1:10 AM
@Danack :(
 
Scroll up a page or two - people cleverer than me were discussing it.
 
Yep, I see some messup
 
Still a fun idea though.
 
the idea was neato though =D
yup, indeed....
 
@Danack Im not going to trust ws3 schools.
 
1:14 AM
@NoahHuppert m'kay. But even without that - how do you expect a server to interpret a request for "?postKey=5" ?
 
completely unrelated:
 
@Danack Navigate to the same page but with ?postKey=5 appended to it.
Just like how <form action="" ... works.
And it's client side, not server side, in terms of the resolving of the final url.
 
@Jack How would it know what the 'same page' is? Forms are different - they post to the same url by default.
 
It would end up being www.example.com?postKey=5 because just adding a link works like that
 
@Danack If you're on a page, then not mentioning the name should assume it's that page.
I would honestly not do that, but intuitively that's how it should work for me.
 
1:17 AM
k - well, I'm not the one that's a got a problem with passing variables to a server....
 
Me neither :)
 
@Jack Empty action is invalid html
 
I think I just have to add ajax load off
 
Who says?
 
the spec
 
1:17 AM
which one?
 
5
 
@Ocramius btw what's with github.com/zendframework/Component_ZendFilter/blob/master/… - shurely exception or stfu?
 
bah
HTML V for Vendetta
 
:P
 
@Danack hm?
 
1:19 AM
@Ocramius seems odd to be using trigger_error when an exception makes more sense.
aka - can be caught.
 
hmm, right
 
> when the content attribute is missing or its value is the empty string, the document's address must be returned instead.
@PeeHaa ^^
 
@Danack bring it up in an issue - I'm sure someone who knows the philosophy behind that class will reply you
but IIRC, filters should not break the input chain
 
hmmm wut
 
that's up to validators
 
1:20 AM
Strange
 
@LeviMorrison decided to take your advice and use objects for the tree , though I have this nagging feeling that there was some reason why I originally implemented it as array (also, sorry for sound more like an asshole then intended)
 
@Jack
> he action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces.
 
"if specified"
 
^^ that
 
Yeah?
<form action="" <- specified?
 
1:24 AM
yeah - but <form></form> also valid
 
Yeah, but in that case th attr is not specified
 
Well, my quote comes later than yours, so therefore overrides =p
 
Stupid unreadable specs...
no wonder IE has so much trouble making a decent browser
 
I'm guessing that "" is considered not specifying.
Any browser making company has that issue I think :)
They have to hire teams of people pouring over the specs, surely.
Or it could be just a single developer in the basement.
My kid just said "i know dutch" ... it could also mean "look at my cool truck", or something, I dunno.
 
@tereško What kind of tree is it, by the way?
 
@LeviMorrison namespace-directory tree for autoloader , with many-to-many relation
started to fix the damned mess that I wrote few month ago
 
Not sure I understand what many to many means in that context.
 
classes from one namespace can be in multiple location and classes from different namespaces can be in one location
the latter is actually just a sideeffect and not requirement
 
1:49 AM
Namespace soup :)
 
@teresko not hating but just curious... what directory structure does this auto loader serve? By application layer?
 
the original version inherits confusing crap .. I opened it after having not looked at it for 8 month and got the kill it with fire urge
and it is supposed to load all parts of project (including tests)
 
anyone out there could you please advise me
I have worked on SQL server for few years but im more interested in front-end development, thinking of learning PHP could you please advise me where to start and if there is online material available anywhere ???
 
@MuhammedAli My suggestion would be to start reading about frontend vs backend
 
this what I am doing right now, basicly learning how web server operates and how a web application functions
any specific topics I should pay more attention to ??? please
 
1:57 AM
you could start by getting (buy, steal it .. who cares) this books
 
@muhammedAli To learn php best place to start is at php.net.... but as for front/backend php resides more towards the front of the back end.... traditionally html/js/flash etc are considered the front end.
 
if you need to learn html/css, then visit htmldog.com/guides
also , stay the hell away from w3schools
 
I have some basic understanding of HTML/CSS and JS
w3school lol actually its not that bad :)
 
it actually is worse
 
looking at ur profile with ur experience I guess I have to agree with you :)
 
2:01 AM
@muhammedali w3fools.com
 
@Orangepill Everyone should bookmark that site...
 
I know a lot of newbies who actually find it quite helpful that website but i guess pro like you lot has a different opinion about that website :)
 
and newbies they will forever be
 
once you get past making the basic 2000's looking sites ws3 schools in bad
 
2:03 AM
lol
 
So about 1 hour ago I was having problems with passing GET variables on mobile using jquery mobile but it will work on desktop viewing the mobile site. I thought that b/c I was using jquery mobile the links were getting messed up b/c of ajax. So I set data-ajax="false" but that didn't fix the problem. Any Ideas?
 
I still think you should request a valid URL.
 
please i want your take on it, to understand better web applications I was looking into, webservices and I cam across WSDL , XSLT WDDI and stuff like that Im studying about all this right now trying to have a better understanding how a web application actually work
do you reckon it is the right approach ???
 
@NoahHuppert Cache Maybe?
 
@Orangepill I don't know... The site is my site www.noahhuppert.com
 
2:08 AM
@MuhammedAli ignore those for now. To make a website you do not need to understand what webservices are and how to implement them.
webservices are usually used to communicate between two or more independent systems (for example: a portal for selling plane tickets interacting with banks and different airlines)
 
so you reckon im better off just focusing on PHP syntax ??
 
start by making something small .. making a blog is usually a good choice, because everyone has used one and you will have clear understanding of "what's the next step"
 
@tereško I really appreciate your advice :)
 
make basic html, add ability to view articles, ability to add articles , ability to add anonymous comments , ability to register account , ability comment using that account .. and so on
 
2:13 AM
@tereško I agree, start with a project you realy want to do and break it down to the most basic functions and try and step up from there.
 
the approach is: make something and see what you need next
 
As long as you understand what PHP is.
 
@NoahHuppert Not sure what I should be seeing but things look good on this end. Try clearing the cache on the mobile broswer to see if it will show you any love.
 
One of my first PHP questions was "how do I show a banner in PHP?"
 
@tereško , @Fabien and @NoahHuppert thank you very much for advice guys, I'll get my head down now and start building something. bring it on PHP :)
 
2:16 AM
@Orangepill Welll I tried it on 3 other mobile phones(not connected in any way) so I duno.
@Fabien <?php include header.php ?> put that at the top
 
I basically thought PHP was HTML
 
@Fabien Well it ends up as HTML on the user end
 
@NoahHuppert Not always ;)
 
@PeeHaa User end
 
lol @Fabien
 
2:18 AM
I was young and dumb, now I am just older :(
 
hahahha
 
@NoahHuppert Again :P Not always :)
 
I can never relate to thing like this .. . At the point, when I begun learning PHP, I already had had experience with pascal, basic, asm, c++, java and c# (in that order)
 
@PeeHaa ok ;)
 
2:19 AM
@NoahHuppert at 15 you have a better understanding of how the request cycle of a php based web app works then half the people asking questions on stack overflow
 
I have experience of Sql server , ssrs , ssis and a little bit of C#
 
Yeah but you had to make your own games back then @teresko
 
@tereško For me c++ and java. In my defense I was forced to do java in school
 
but this PHP is something new in a way it deals with web applications
 
@Orangepill lol. been programing since I was 9. Its a second language.
 
2:20 AM
@MuhammedAli here is your first php code: <strong><?php echo time(); ?></strong>
save it as index.php and open in browser
 
So anyone else have any ideas why GET variables are not passing on mobile?
 
@NoahHuppert That's about when I started... Basic on my Commodore 64 :)
 
i think it will out put current datetime
 
@NoahHuppert it always working for me
 
@NoahHuppert Have you tried with a full URL?
 
2:21 AM
:)
 
@NoahHuppert have you tried full URL and disable caching ?
 
@tereško Make sure to use a local server or else it wont work!
@PeeHaa @johnwright have you tried it on mobile. It works on desktop
 
@NoahHuppert it will return unix timestamp .. even if it works, you wont be able to automatically say it is showing you the correct time
 
could anyone tell which framework should i learn between Zend/Symphony .. or have more positive point ?
 
@johnwright symfony
 
2:23 AM
@johnwright how long have you learned PHP ?
 
@tereško yupp i think i know a little PHP :)
 
Any of you guys in NY NY? I'm exhibiting at the Maker Faire if u r in ny ny.
 
@tereško btw that stackoverflow.com/questions/5863870/… is awesome answer
 
@tereško howdy.. i just checked the chat and this classic question came up. XP
 
well ... you can never know. We oftern see people who migrate from ASP.NET and the question goes "Hi. I want to learn PHP. Which framework should I use?"
 
2:26 AM
lol
 
... at that point the pitchforks and torches come out
 
Cheers guys you guys have been really helpful, Hope all of you have a great weekend :) Ciao
 
@tereško because they should be learning the language before a framework?
 
@NoahHuppert Try sending a "Cache-Control: private" header from your page.
 
Good luck Muhammad
 
2:27 AM
@tereško LOL i understands ...but i used to write application in php but now my company asked me to choose a framework between Zend/Symphony within 2 days ..
 
in that case Sf2.0 is the better choice
 
@johnwright is that zend 2 vs symfony 2? or 1?
 
but that's like having to choose the smartest kid in remedial class
 
@johnwright try them both out.... you have two days... that should be enough to get a simple hello world app running in each.
ZF 1 is shit... don't use it.
 
Zend Framework 2 /Symfony2
@Orangepill tow days inst much to understand working process and internal code of framework :(
 
2:31 AM
@Johnwright Note too that a lot of ZF2's improvements where "inspired" by Symphony 2
 
night all
 
night
 
more like, "they felt embarrassed"
 
@PeeHaa night
 
@Orangepill What will that do>
 
2:34 AM
you could always try to use pretty URLs instead
 
Thankyou guys .... for your suggestion i really appreciate it :)
 
@NoahHuppert Makes it where intermediate proxies won't cache a copy of the request for you and serve it up. Cellular providers sometimes cache (compress) and serve cached get requests to more easily sell 4G speeds.
@NoahHuppert if you are accessing via wifi this is probably not the issue.
 
@tereško The problem with that is I'm using mysql so pretty urls wouldn't work(If that response want for me please ignore)
@Orangepill were would you put it?
 
@NoahHuppert you can do the routing in PHP side
 
@NoahHuppert in the index.php before you output anything. header("Cache-Control: private");
 
2:37 AM
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [L]
something like this
 
@tereško I feel that is kinda of a messy way of doing it.
 
ok
 
@Orangepill I'm assuming in the php section?
@tereško Also I need this to be working tomorrow and I already have the GET variables working
 
i personally think its messier doing the routes on the htaccess side (based from a project i inherited)
 
it's 5AM going on 6 .. I'm fresh out of fucks to give
 
2:42 AM
@NoahHuppert in a php block before any html is sent.
 
its all really opinion. Both work. I just feel like the GET variables are neater(personal opinion)
@Orangepill Ok. Makes sence.
 
@NoahHuppert From the technical aspect they are a horse a piece... when you start writing for someone else (or you want urls that users can remember) then going the pretty urls/routing method is a must. Plus once your project hits a certain level of complexity it is useful just for controlling that complexity.
 
@Orangepill True, true. you just changed my mind. Neat url's it is!
 
/me has hist the point where watching jpop seems like appropriate thing to do
I should better got to sleep soon before I get permanently damaged
 
@tereško You need to take a break man...
 
2:48 AM
@Noahhuppert teresko's htaccess snippet up there is probably the simplests and most flexible...
 
I'm assuming @Developer is a site bot that eats up negative votes?
 
damned , I forgot to spend my close-votes again
 
@teresko I have no idea what's going on there but I'm all for a bunch of cute wet asian chicks
 
@Orangepill I don't just want to copy and paste it. Would you mind explaining that snipit?
 
@Orangepill that basically sums up my opinion too
 
2:50 AM
@Orangepill lol
 
@NoahHuppert It takes all request that don't map to a real file or directory and rewrite them to a request to index.php?url=
 
@Orangepill I got that part, What would it do with the url=
 
@NoahHuppert so http://www.example.com/not/a/real/file.html becomes http://www.example.com/index.php?url=/not/a/real/file.html
 
it turns http://who.cares/about/this into http://who.cares/?url=about/this
 
Alright. So I could make the first / the tag of a post and the second / the post title. That works!
 
2:54 AM
@NoahHuppert You got it
 
Yay! But I'll still figure out a way to mis-type something and not notice and then drive myself crazy until 2:00
 
@Orangepill though in general find japanese music videos somewhat confusing
I suspect you will understand what might be confusing
 
@tereško Silence...
@tereško Silence...
 
ummm..yeah.... I can't even pin a genre to that...
 
3:00 AM
anybody missing google reader? I had forgotten it was gone
 
@Orangepill here is a hint: there is 1 chick in that band
 
@teresko do I get a cookie if I can figure out which one it is?
 
@marabutt I missed it for about 4 hours. Then I started using pulse
 
naah .. too easy
 
Any good tools out their for making you own rss feed for a blog or something?
 
3:08 AM
i switched to this.. theoldreader.com (but there's some drama about selling it to a new owner and stuff)
 
@reikyoushin I'll try it out.
Night all
 
this one is cool too.. inoreader.com
 
3:43 AM
composer users ... from cli how do i add another package
??
 
Is it necessary to sanitize inputs for SQL injection when they are done as MySQL prepared statements?
 
The prepared statement will take care of the sql injection but there are other injections to consider.
 
@red6 prepared statements are a means of sanitizing user input just make sure you are using the placeholder syntax
 
@marabutt @orangepill examples?
 
$pdo->prepare("select * from tablename where user='$input'") will do absolutely nothing for you
 
3:56 AM
oh you mean the ? instead?
 
$stmt = $pdo->prepare("select * from tablename where user='?'");
$stmt->execute(array($input));
 
ok, I gotcha.
I just got this sample to work fine, but how do you iterate over multiple results? The examples all seem to give a single example -- how do I access the results?
 
@Orangepill how do i add a package in composer from cli
require
 
@marabutt I'm a composer noob.... I think you just edit the composer.json (and the package to the require section) and call composer update
while ($row = $stmt->fetch()){
    // do something with each row
}
@red6 ^^
 
im on the mysqli prepared statements page on php.net
and they are saying to use something like this:
if (!($res = $stmt->get_result())) {
echo "Getting result set failed: (" . $stmt->errno . ") " . $stmt->error;
var_dump($res->fetch_all());
 
4:06 AM
That will work for mysqli
 
so for bind result and fetch in combo, its only if I had to bind params to the statement?
a general query like "SELECT * FROM ..." seems like it wouldnt need that
 
No need to prepare a query without any parameters.
 
well .. there is this thing called: second order sql injection
but it's currently only theoretical vulnerability and applies only if you are doing stupid things on the DB server itself
 
will preparing statements guard against that?
 
theoretically - no
but there are no known cases where this type of injection has been used in wild
it's something you should be aware off, but nothing to loose sleep over
 
5:08 AM
posted on September 22, 2013 by Christopher Jones

Come and Join us in San Francisco this Week It's the week of the huge Oracle OpenWorld, JavaOne and MySQL Connect conferences in San Francisco. The week will be a blast with so many things happening. The easiest way to find sessions is to browse the Content Catalog Followers of this blog might want to think about these sessions: Perl: A DBA’s and Developer’s Best (Forgotten) Friend [

 
5:44 AM
Guys i know this is not the appropriate room for this question but everyone had use sql.. My question is it good idea to to make Gender new table and then use gender id to find person gender or its better to put the gender in person table? I want to have better performance and save space in database.
 
6:41 AM
does json string parsing and processing is not supported by php/server older versions?
 
moin
 
user652649
mornings
 
aaaaah yes ....
 
mornign
 
6:57 AM
moin @NullPoiиteя
 
7:15 AM
installing newer version of xamp will overwrite older xampp/phpmyadmin?
@JoeWatkins did you replied me or Wes :P
 
@user2500861 was talking to wes ... json has been supported since PHP5.2, so forever ...
@user2500861 FYI version information is almost always included in function manual pages, uk1.php.net/json_decode under function name will say when the function was introduced ...
 
7:31 AM
yey just 50rep away from 20k :)
 
@JoeWatkins thanks, do you have any answer for this : stackoverflow.com/questions/18931870/…
 
mysqli_connect host is wrong format
 
yes, on ec2 instance it's like
$mysqli =mysqli_connect('127.0.0.1', 'root', 'root', 'test');
on localhost everything goes nicely
 
Congratulations @NullPoiиteя! Wielder of the 20k rep!!
13
 
@MadaraUchiha Thankyou :)
 
user652649
7:44 AM
20,001
 
@user2500861 in your code you also write the port for mysqli_connect, I think its wrong try to remove it
 
8:32 AM
Question, is it worth signing every commit I make? (And not just, say, tags?)
 
@MadaraUchiha Aren't they signed automatically?
 
@vascowhite Not that I know of, you need to supply -S if you want to cryptographically sign them
with your GPG key
 
Oh, I see what you mean, I was thinking of the name/email automatically attached to each commit.
I would say no, it isn't worth doing on every commit.
But that is just MHO :)
 
9:11 AM
@vascowhite Why? What's the downside?
 
@MadaraUchiha None that I'm aware of. As I said, it's just my opinion. I'm a lone dev, so it isn't important to me. It may be important if you are in a team.
 
0
Q: What are the advantages and disadvantages of cryptographically signing commits and tags in Git?

Madara UchihaSo someone peer reviewed my work, and he told me that I should always sign my commits and tags cryptographically. When asked why, he didn't know to explain it to me, and said "It's just a good thing to do". Trying to avoid an obvious chimpanzee scenario, why should I really? Are there really so ...

If anyone feeling for some easy programmer rep ^ :)
 
user652649
9:34 AM
 
user652649
( o)_( o)
 
user652649
(o )_(o )
 
user652649
( o)_( o)
 
9:55 AM
Good morning
 

« first day (1072 days earlier)      last day (3880 days later) »