« first day (1587 days earlier)      last day (3374 days later) » 

10:00 AM
frameworks are made of magic and fairy dust and made by grand wizards in ivory towers
 
@SergeyTelshevsky tbh I kinda understand this... I used to be like that too. It's only since recently (~1 year or something) that I look at the code of the framework I'm using.
 
and peons like you should stop saying bad things about frameworks because you could never be even half as smart as the wizards
 
@FlorianMargaine everyone was there at some point
 
Well, frameworks really are too much magic… a ton of components somehow coupled together…
 
10:02 AM
@tereško makes me want to answer "I put on my robe and wizard hat"
 
@bwoebi yeah, but they usually have good reasons to do so (whether or not we like them), and you can understand what it does when reading the code
 
Reminds me of trolling saruman
 
@Jimbo bloodninja quote :)
google the quote
 
@FlorianMargaine not really… it's just a weird mess of components… with some components being marked as components, but so tightly integrated…
 
@SergeyTelshevsky I can't believe I haven't seen these before...
 
10:14 AM
@Jimbo thank you for helping on github with auryn!
 
is there a standard solution (a linux tool) that watches changes in a directory, and runs a command after each change?
 
@SergeyTelshevsky No probs, with my set-up, I haven't had to do anything for any libraries or components I pull in for a long time. Add a string or so to my config file for any non-concretes, and I can plug and play anything anywhere I choose
@FlorianMargaine inotifywatch or inotify-run?
 
that reminds me: I need to charge my smartband
 
@FlorianMargaine I know there are some events fired by the FS, used by ides/editors like sublimetext to notify the user the file was changed
 
@Jimbo this kind of thing yes
 
10:17 AM
@FlorianMargaine inotify
 
@Jimbo inotifywatch gets statistics of changes though, I want to run a command after each change
 
@FlorianMargaine inofity does that
 
@PeeHaa googling
 
@FlorianMargaine Check out inotify-tools, there's plenty of stuff in there
 
I use it to scan on changes
 
10:18 AM
thanks
@PeeHaa how do you run it?
@Jimbo inotify-tools seems to have inotifywatch and inotifywait only :/
 
Hi,
 
@FlorianMargaine YOu can pass commands to be executed to inotifywait
 
@PeeHaa example?
 
16
Q: How to automatically run a script when the contents of a directory changes in Linux?

GeneQI want to automatically run a script whenever new files are copied into a particular directory. In other words, is there a way in Linux to "watch" a directory for changes and then run something in response to the change?

 
Get Facebook pages in PHP

Users can login through my website.
Once they login, I have to get all the user's page.
They can select which page have to use and they can remove the page tab through my website. For that I have to get strong access token for pages.
I can get my all facebook page through my app using Facebook SDK. But how can I get all users?
 
10:22 AM
@PeeHaa oh, ok
 
I think I used that with extra flags to wait until writing is done otherwise on ftp upload it would keep executing for every block uploaded
 
#!/bin/sh
while inotifywait -e modify -e create -e delete /home/me/code; do
    rsync [options] /home/me/code/ /media/nfs/code/
done
there's nothing easier?
 
Easier than those three lines? :P
 
I was hoping something like inotify folder command
 
@FlorianMargaine Put it in a shell script that accepts the arguments you need :D
 
10:24 AM
alias, too
 
@SergeyTelshevsky Thank you, figured it out
 
@Joseph great!
 
@SergeyTelshevsky feels like it had a good impact on performance tho :(
 
hi kids!
 
@PeeHaa needlessly complex...
 
10:27 AM
@Jimbo I'm stuck on 5.3 and some parts of auryn do not work, getClosureScopeClass for example, so I'm forced to skip stuff like factories :(
 
@SergeyTelshevsky Which part uses getClosureScopeClass()?
 
factory closure IIRC
 
ugh
 
I make my own factories and 'build' the object in a create() method... so you can still DI the factory
 
@FlorianMargaine Lazy French guy... :)
 
10:29 AM
 
@SergeyTelshevsky Got a simple code example for this? I've never used it
 
ah... another shot on scalar type hinting wiki.php.net/rfc/scalar_type_hints_v5 .. hope it finally gets a foothold ..
 
ffs, sitting on a 5.3 feels like being disabled
 
@PeeHaa Do you happen to know if safari pre-loads page when you type url but press tab instead of enter?
 
10:32 AM
@SergeyTelshevsky I think I tried doing that with all my doctrine repositories but I couldn't for some reason, I'll give it another try
Because as of right now, all my repositories are created and shared so I can type hint for them
 
@Naruto No idea sorry
 
@Jimbo I have that as well can't use doctrine here so I don't have these problems, I would like to use that, though
 
@PeeHaa dammit, my script gets executed 2ce because of that.. which shouldn't be happening :P
 
@SergeyTelshevsky you haven't had t use PHP 5.1 in part year
 
Ugh @DaveRandom?
 
10:34 AM
My company - on 5.3, I managed to convince migration planning to 5.4, then 5.5 :-)
(happening within next few weeks)
 
Nicely done @Jimbo
Why not 5.6?
 
@Fabor We'll probably go straight to 7 after that, it's a big jump
 
Furry muff
 
@Jimbo 5.6 or gtfo :P
 
Any bets on when PHP will start going by codenames instead?
 
10:36 AM
@Fabor I went for one pint last night and got home at 2am
 
PHP AlphaVixen or gtfo
@DaveRandom Went for one stayed for six? :P
 
presumably, it's a little hazy
 
On a school night too! tut tut
Celebrating?
 
user3949359
How do I connect via the cmd on Win7 to the XAMPP MySQL?
 
@nosille I wouldn't personally. Look in to virtual machines.
 
10:39 AM
Morning guys. Do you know any good applications for recording desktop + voice?
 
user3949359
@Fabor I do have a VirtualBox running
 
@nosille seascapewebdesign.com/blog/… Something like that
Virtualbox + Vagrant
 
user3949359
@Fabor Is Vagrant a must?
 
No but it's a recommend.
 
user3949359
Ok, I can see mySQL on the vm
 
user3949359
10:40 AM
I should add the execution path for it though
 
If you know how to setup a server then vagrant is fine. If you don't and have the time to learn then don't use vagrant.
If you don't have the time or don't want to learn how to setup a server then vagrant is fine.
 
@ircmaxell I would personally want to have integer and boolean aliases, because they are in use a lot. Even in your RFC (the behavior table you use them)
 
user3949359
@Fabor My objective here is to be able to manage DB through the shell. Which path on VM/mysql should I add to environment variables?
 
If you want to connect to your db through your host (windows) then look up Putty. Use Putty to SSH in to your VM which has MySQL on it
 
user3949359
@Fabor is "mysql" command going to work on putty?
 
10:43 AM
Putty is a terminal through to your VM
Think of it like remote desktop
 
user3949359
I do have putty
 
has anyone made use of the dropbox api?
 
Okay so learn how to setup SSH and ssh in to your VM through putty.
 
Also @ircmaxell in @Andrea's rfc most people voted to include them
 
user3949359
@Fabor I just tried to and got ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
 
10:47 AM
can I ask in using socket,is it necessary to use looping event ?just to listen incoming data stream ?
 
@nosille And so the learning/googling begins :P
 
Php people can I ask,I am still beginner in using socket,my question how would you handle to keep listening for the incoming client do you use while loope or for loop,is there other way not to use looping event?
 
@Jimbo I'm waiting to do that too. Pretty hard to convince when "50 devs don't see problems in using 5.3 and you do" is the argument
 
@SergeyTelshevsky Need to find somewhere you're taken seriously - luckily current company and boss believes that I'll do a better job than the previous guy who wrote our codebase in symfony 1 (procedural code everywhere) so I get to design the next codebase from scratch (it has like 5M loc) fml
 
10:59 AM
@Patrick did you tried this ?
 
@Jimbo yeah, I have almost convinced, will continue after launch
 
@Fabor Only the fact that it was wednesday
 
@Alexander pong
 
@DaveRandom heh. Good enough
 
ThW
11:15 AM
Morning
 
Morning
 
11:31 AM
@JoeWatkins I didn't see it clearly stated in the RFC, does the custom assertion for assert have to descend from AssertionException?
 
@SergeyTelshevsky trust me 5.2 is worse ^^
 
11:46 AM
@ShubhamNishad you could use Google/Facebook Authentication
 
@NikiC hello, we can start our discussion )
To anyone who interested in the Parser API RFC, here is a link wiki.php.net/rfc/parser-extension-api
 
2
Q: How to use array_filter() function recursively on a multi-dimensional array in order to remove the key-value pairs that contains null values?

user2839497There is one associative array titled $post_data. The actual array is very large. For your reference I'm just putting below two elements from it : Array ( [0] => Array ( [feed_id] => 1331 [app_id] => 0 [privacy] => 0 ...

I'm not able to get the answer posted for this question.
 
Hey @Alexander
@Alexander btw, I'm currently working on importing asts back into php. but still at the "assembling all the necessary metadata" point ^^
 
@NikiC great, what kind of metadata do you need?
 
@Alexander precise information about which node can contain which node at which position and which flags it can use in which combination :/
If nothing else, it will serve as good documentation for the AST structure ;)
 
11:52 AM
@NikiC yes, It's not so easy ) Because it require parse-level information about Grammar
 
exactly
so anyway, about the apis...
 
@NikiC I have a though about introducing interfaces for nodes. For example, ClassElementNode. And ClassNode will have a method add(ClassElementNode $node)
 
@Alexander it would be kind of nice to have individual node classes with names for the children (instead of indixes), but it makes the whole thing much more complicated, both from API and implementation perspective
 
@NikiC some languages provide single class for each type of node
 
it means instead of one or two classes you need two hundred
 
11:55 AM
yes
 
I think it may be hard to get two hundred new classes past dmitry ^^
 
Can this information be automatically generated from .y file? ))
 
nope, .y file is not really laid out to allow automatic extraction of info
 
It's pitty... However, what is your vision about node class? Should it be only one or one per each node kind?
 
If this should go into core I think it should be just one node class
well or maybe two, an extra one for declarations as they have a bit of extra info
 
11:59 AM
but then we will have an issue with AST validation, if we decide to implement NodeTransformers
 
validation at which point?
 
If PHP hook will change an AST and add "Statment Node" into the "Class node" directly.
Compiler can be very puzzled to see this node for class-level node.
 
separate node types won't help with validation when importing a userland ast - even with typehints and inheritance hierarchy you can't really trust what you're getting
it requires explicit validation (thus the metadata ^^)
 
Yeah... but maybe it's ok, just to throw CompilerException and finish execution?
 
@NikiC Is this something that can come later?
 
12:02 PM
<?php $email_attch=false; ?>
@if(condition)
    @foreach(condition)
        @if(!$email_attach)//I don't wy It's not working here
            do stuff
         @endif
     @endforeach
@endif
 
@Leigh it's probably something to be done in userland
 
Even better :)
 
@user2736704 Thanks for reminding me I hate template libraries
 
@user2736704 The PHP in that is fine. Problem is elsewhere.
 
@Leigh do you see any prob there?
@PeeHaa :/
 
12:04 PM
psst
"attach" has two "a"s in it
but the PHP is fine
 
@Alexander I think we had some disagreement about the use of functions ...
 
:/ :)
 
hey guys, does anyone here ver use dhtmlx scheduler? i´m havig trouble loading data from my database...i was wondering, is this possible:
$scheduler->render_sql("TipoQuarto","idTipoQuarto","Nome,Preco");
echo scheduler;
can i echo the variable scheduler to see if there is data inside it?
 
@Japa $scheduler ? (missing sigil), try var_dump($scheduler);
Glad to see the quality of SO has remained constant, last two issues in here have been typo's :D
 
@NikiC yes, this should be discussed. From my point of view, it's much easier to work with classes, because they provide logical unit, whereas functions is just mix of functionality. + class have good autocompletion for methods
 
12:07 PM
@Leigh instead of just doying the echo?
 
@Alexander well, functions have just as good autocomplete ;)
 
@Japa why don't you try it and find out
 
@Leigh lol you´re right, but it´s not working
i keep getting the same response: { "data":[]}
 
@NikiC but they can be imported by different names: use function Php\Ast\parse as foobar; foobar('Hello, WTF');
 
the reason I want to have functions that can work just on kinds (without instantiated node) is introspection/metadata. E.g. I'd like to do something like var_dump(array_map('php\ast\get_kind_name', ast\get_kinds())) to get a full list of kinds in human-readable format
@Alexander You can import classes by nonsentical names as well ^^ Ability to import is actually advantage of functions ;)
 
12:10 PM
@NikiC why do you need to call get_kind_name on integers?
 
@Alexander Not sure what you mean?
 
@NikiC this information is useless without node kind
 
@Alexander why? This just gives me an overview of all available kinds
if the extension exports the metadata I'm currently assembling, you could print not just the available kinds, but also what the subnodes are allowed to use etc
 
@NikiC this information can be stored as list of constants in the Php\Parser\Node class: var_dump((new ReflectionClass(Node::class))->getConstants()
@NikiC
 
@JoeWatkins I answered my own question. I see instanceof comparison with the AssertionException CE in the patch. I was hinging between yes and yes+custom, but with this restriction, I think custom is fine.
 
12:12 PM
@NikiC or just empty enumeration interface, like Php\Parser\KindList { const AST_XXX= 'AST_XXX'; }
 
so instead of having a simple array of available kinds we now need to use reflection?
 
@NikiC $kindName = KindList::AST_XXX; or (new ReflectionClass(KindList::class))->getConstants() to fetch all available names of all kinds
@NikiC I'm thinks about usage from userland. array is not friendly tool to work with such information, so I want to put this into classes. This keep a way for class extension for future needs
thinking
 
@Alexander Okay, so that gives you the names. What about other metadata?
Actually, arrays are the most friendly tool in PHP ^^
 
@NikiC @NikiC not sure )
@NikiC flags can be enumerated as constants too. Only the question with use_flags
 
@Alexander yes. use_flags and other things that may be added
like num_children or allowed_children etc
 
12:18 PM
@NikiC could you provide more examples?
@NikiC this information should be stored in the concrete node class for better design...
 
@Alexander in which case you will only be able to access it if you already have a syntax tree
 
Jay
hey
ping pong
Can anyone answer me why I am getting an error with this code.
db_update('file_managed')
            ->fields(array(
              'uri' => $new_file
            ))
            ->condition('filename', $image_id, '=')
            ->execute();
 
@NikiC no this is not needed. Create (or take existing) parent node, ask for max children and add several children nodes.
 
Jay
Its Drupal
 
1. eww drupal
2. what is the error?
3. method chaining does not exactly make debugging easier...
 
Jay
12:23 PM
just says: The website encountered an unexpected error. Please try again later.
 
@Alexander sounds like very roundabout way, just to avoid exposing functions ;)
 
@NikiC this information is only relevant for concrete node, I can't imagine the situation, when I want to ask how many children can have a node with kind=123
 
Jay
Even when I tried this as a test it still gives that error
db_query("UPDATE file_managed SET uri = '".$new_file."' WHERE filename = '".$image_id."'");
 
@Alexander Can you think of a situation when you need a list of all token types PHP supports?
 
@NikiC can you give an examples with functions how this metadata will be accessed&
 
12:25 PM
@Jay why don't you configure your error reporting properly?
 
Jay
@Patrick please advise how this is done
@p
I got it mate thanks
 
@NikiC yes, (new ReflectionClass(KindList::class))->getConstants()
 
@Alexander I'm just asking whether there's a situation where that would be useful (and referring to token types here, not ast kinds)
 
@NikiC not sure that I understand correctly what you are referring to
 
Okay, let me give you a simple example ... I want to export the AST into XML and want to create an DTD schema that specifies how the result should look like and validates that it is correct. If I have the metadata available I can simply generate the DTD file. Well, "simple" as far as anything involving XML is simple ;)
And very generally, this is a design concern. Basically you are saying that in order to get information about the TYPE you require an instance of that type. This is classic violation of object oriented principles, as you are asking for things that you do not actually depend on.
It's like passing in a service locator because you need something that's stored in it
Of course here, much less of an issue ;)
 
12:32 PM
@NikiC I'm affraid, that without concrete classes for each node type this will be impossible ( Or DTD just will check that Node can have som attrs and node can have nested nodes.
 
@Alexander Storing it in one class in PHP does not prevent you to generate different XML node types based on the kind name
 
@NikiC so we are here to find the best way ) discussion is a good way to choose best decision
 
@Alexander Of course you are totally right in saying "Who the f* wants to use XML?" and dismiss the use case :)
 
/**
* @notauthor Marcel Burkhard
*/
I just found that in some ugly legacy code that I had previously touched ^^ like a year ago or so
 
@NikiC what If we extract all this metadata (meat-data :) ) into the one class? Maybe with public static properties or even array constants
 
12:36 PM
lol
 
laravel.io/bin/yGKRm when tried to echo the statement prints 1 inside foreach
 
@NikiC yes )) But validation of XML with DTD is a very clever thing, Symfony uses XML a lot for services definition.
 
ouch laravel is really ugly: laravel-recipes.com/recipes/256/…
 
@Alexander Yeah ... not a fan personally ^^
 
12:40 PM
@MarcelBurkhard it's scope issue or may be something else..
 
@NikiC I like the last sentence in this post: "But it’s just a thought ;) Maybe I got it all wrong." ))
 
@Alexander :D
@Alexander One part I certainly don't have wrong is that anything that contains the word "static" is a code smell. That's conventional wisdom around these parts :P
I've been slowly migrating away from static methods and properties
 
@NikiC Static methods almost equal to functions ) You should like them
 
So, this is it
2
 
@Alexander Depends. Either they are like functions (in which case they should be functions, not static methods) or they are an artifact of class-oriented design (in which case they should be eradicated)
@AlmaDo Crap, I got an error downloading the internet
 
12:49 PM
@NikiC class is just a good entry point for concrete API. I chose a static methods, because parser doesn't have a state to store between consequent parses , so no instances. Etensions are per single instance too, so static methods and properties IMO good way to represent this behavior. What should I do to convince you to choose Php\Parser\Engine class instead of list of functions?
 
@AlmaDo @NikiC strongly suggest you to watch this episode of IT Crowd about the internet
 
Good morning
 
@Alexander I don't think you can convince me of that. If it has state, I'd totally approve of using a class for it. However if you're just using static methods as means of namespacing, I don't see the point. The only thing it does is hurt importability. For the extensions I'd probably go with instances.
 
@ircmaxell Good morning
 
Is it even possible to put static methods in an interface?
 
12:53 PM
@NikiC what about future use of extensions? It's a state
 
hi
 
@NikiC yes, sure
 
anybody know how to make a curl request using command line
for posting json data as well as a file
?
 
@sharath google knows
 
@Patrick i tried a lot
 
12:54 PM
 
i am not sure weather its my requests problem
 
@sharath what have you tried? what errors did you get?
 
Literally the first result has your answer when I searched "how to make a curl request using command line"
 
@ircmaxell morning
@Alexander k
@Alexander not sure what you mean there
 
@Patrick curl -X POST -H "X-Parse-Application-Id: sdgfsdfgsdfgsdfgsdfgsdg" -H "X-Parse-REST-API-Key: sdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfgsdg" -d '{"username":"aaaaaaaa","email":"aaaaaaaaa@gmail.com","password":"123"}' --data "image:@/home/user/Pictures/gravatar.jpg" api.parse.com/1/functions/signUpUser
@Fabor this is my curl request
 
12:57 PM
Hi is anyone here familiar with zend in particular the zend 2 blog tutorial ?
 
@NikiC Parser::registerExtension($myExtension1); Parser::registerExtension($myExtension2); Parser::parse(file_get_contents(_FILE_));
 

« first day (1587 days earlier)      last day (3374 days later) »