« first day (1502 days earlier)      last day (3437 days later) » 

11:07 AM
Good morning
Does anyone have in mind any decent version of stable uasort() ?
 
Define "stable"?
 
[joe@localhost cmark]$ php -dextension=cmark.so -n --re cmark
Extension [ <persistent> extension #21 cmark version 0.1.0 ] {

  - Classes [2] {
    Class [ <internal:cmark> class CommonMark\Parser ] {

      - Constants [0] {
      }

      - Static properties [0] {
      }

      - Static methods [1] {
        Method [ <internal:cmark> static public method parseDocument ] {

          - Parameters [1] {
            Parameter #0 [ <required> $source ]
          }
        }
      }

      - Properties [0] {
@Jack ... I'm there ...
 
@DaveRandom Thanks for your guidance. But I think the themes in wordpress are good, but not the best.
 
Chromebook to buy or not to buy.
 
11:22 AM
no refcounting on objects @Jack ... makes for more awkward ...
 
@JoeWatkins woah, cool!
 
[joe@localhost cmark]$ php -dextension=cmark.so -n --re cmark
Extension [ <persistent> extension #21 cmark version 0.1.0 ] {

  - Classes [2] {
    Class [ <internal:cmark> class CommonMark\Parser ] {

      - Constants [0] {
      }

      - Static properties [0] {
      }

      - Static methods [1] {
        Method [ <internal:cmark> static public method parseDocument ] {

          - Parameters [1] {
            Parameter #0 [ <required> $source ]
          }
        }
      }

      - Properties [0] {
there now ...
need iterators and stuff ...
and tests ...
 
RecursiveIterator .. yeah
Hmm, does DOM expose that?
 
not sure
really will leave the rest to you ...
 
sure :)
 
11:29 AM
pushed oo branch ...
 
much obliged! :D
 
well wont get to look again today anyway ...
 
ThW
you found that already
:-)
 
Parsers in pure PHP .. well, it's something :)
 
ThW
Well it works and returns a XHTML DOM document
 
11:36 AM
@ThW i was going to test it
is it slow?
 
ThW
I didn't test the performance
 
Adz
hey guys, is it possible to replace an occurrence of two characters that are next to each other with one? Something like 30[9,3], 31[1,3], would make 30[9,3|31[1,3| so the ], are replaced by |
 
@ThW I'm sure I asked you this once before and you pointed me a blog post that you or someone you know wrote but I can't find it (maybe I dreamed it)
 
kk, trying it :P
 
11:38 AM
That's it ^
 
ThW
Yeah, but it is about FluentDOM and HTML5, not just DOM :-)
 
Adz
nvm preg_replace(array('/],{1,}/'),'|',$newLine); done the trick
 
@Mario it's worth remembering that "working and slow" is better than "not working" ;-)
 
@DaveRandom not always, i'd rather be dead than be a 80yo that craps his pants
can mbstring still be disabled in php? i hate this github.com/Masterminds/html5-php/blob/master/src/HTML5/Parser/…
 
ThW
11:58 AM
@Mario Why do you care? Except that ext/intl should be used?
 
does ext/intl contain string functions too?
 
12:12 PM
@Mario what don't you like about it?
It's stuff like that that makes me waver on the assertion that a pre-processor is a stupid idea
On balance I still think it is, but stuff like that which could be detected at compile time might give it a little value I suppose
I just think that it would be abused into insane unreadable code to let the wider set of PHP devs have access to something like that
 
Hi all, is it possible to get pwned if I have php source folder in webroot? I mean, let's say i extracted php-5.4.* archive to /var/www/public_html and my apache and php are setup well
do you think the source will have files that'll lead to this server getting compromised?
 
you mean a pre-pre-processor? something that checks the existence of mb_ functions before php gets actually compiled?
 
#phpsec
 
@Mario like how the C pre-processor works
 
i don't know c but i got the idea :P something like this
// if(ext.mbstring)
$str = mb_substr(0,20, $str);
// elseif(ext.iconv)
$str = iconv_substr(0,20, $str);
 
12:18 PM
    public static function countChars($string)
    {
#if HAVE_ICONV
        return iconv_strlen($string, 'utf-8');
#elseif HAVE_MBSTRING
        return mb_strlen($string, 'utf-8');
#else
        // MPB: Will this work? Won't certain decodes lead to two chars
        // extrapolated out of 2-byte chars?
        return strlen(utf8_decode($string));
#endif
    }
 
instead of if(function_exists()) every time
yup that, would be cool
 
stupid markdown
@Mario The thing is, you could use the C preprocessor to do what I just wrote above today
 
anyway, i was thinking that in (almost) 2015 mbstring should be pretty standard and i hate looking at those "get the best mb function available"
especially because every 3rd party lib i use has its own, and they are pretty much identical
 
@DaveRandom someone write a RFC to include CPP in php-src?
 
It was mentioned on internals recently
/cc @AndreaFaulds
 
user1642018
12:21 PM
hi all.,
 
user1642018
anyone good at mysql ?
 
don't ask to ask, just ask
 
ok then :D
 
user1642018
i have a mysql inset update query like this ,
 
user1642018
INSERT INTO reported_content (content, reason) VALUES ( ? , ?) ON DUPLICATE KEY UPDATE count = count + 1
 
12:22 PM
Also: literally no-one on earth is good at mysql
 
lol
 
0
Q: Symfony2: Display Bootstrap Switch Button and get selected values in controller

Straw HatI want to Implement following field in symfony2 . It have 2 Radio Buttons, and they are styled like Switch using some bootstrap styling. Example here how can I render this using symfony form builder? also want to get selected checkbox value in controlled so that it will be saved in the dat...

 
@DaveRandom ?
 
user1642018
it was inserting new row instead of incrementing the count, at each run when the same values are input.
 
user1642018
so i created uniqye index on content and reason and now its working fine.,
 
12:23 PM
@DaveRandom I need a program which analyzes my database queries and optimizes them and the indices for me...
 
user1642018
am i did correct ? or i just messed up.
 
@bwoebi There is one. It's called PostgreSQL
:-P
 
user1642018
its working as i expected.
 
@DaveRandom well, no, pgsql is not as good as that^^
 
@AMB No, that's what ON DUPLICATE KEY does, it only works if you are modifying a column/columns with a unique index
So what you did is correct
@bwoebi :-P
I promise I'll stop banging on about it soon, but it's just so... nice
 
user1642018
12:25 PM
okie., thanks, i was thinking the same, as it kept inserting new rows, coz it didnt find the duplicate , so i created combined index on 2 columns/.
 
is it UNIQUE(content) UNIQUE(reason), or UNIQUE(content, reason) ?
 
user1642018
UNIQUE(content, reason)
 
user1642018
if UNIQUE(content, reason) then insert , if alredady present then update
 
ok, it looks fine
 
user1642018
:)
 
12:26 PM
stucked in styling symfony form radio button
 
Well, either would be fine, but they do different things
I'm guessing you want the combined though
 
yea
 
As I doubt that "reason" would be unique
 
is reason a free text?
 
how to get facebook photos for a particular date?
 
user1642018
12:27 PM
nope, just a tinyint,
 
using facebook api
 
user1642018
reason codes, and multiple reason codes are there.
 
kk it looks fine then@AMB
 
@StrawHat The problem with super-magic HTML builder things is that they can't do everything (you might be able to do that, I don't know) - but can't you just use the raw HTML?
 
user1642018
@Mario thanks .
 
12:29 PM
@DaveRandom I want to do the same :/ use raw html. but was being forced to show switch like effect
if I am able to style individual radio button somehow then maybe it will work
 
@StrawHat No I mean output the markup for your working switch-like effect directly instead of using the form builder thing?
 
@DaveRandom yes it is, but want to save value to database, and entity class will save values which it will get from form builder
and my custom field is not created by form builder of symfony
 
ah btw, can i use xpath with html5-php @ThW ?
 
ThW
@Mario yes, it adds the namespace definitions. 'http://www.w3.org/1999/xhtml' for the html nodes, but other like svg, too. You need to register a prefix for them because Xpath 1.0 has no concept of a default namespace.
 
12:39 PM
@ThW awesomesauce
 
thank you. important is that is possible to make it working
 
@StrawHat "Frameworks make your life easier" <-- false assumption :-P
@StrawHat so... I've never actually used to symphony form builder, but surely there's a way to give a control a CSS class?
 
@DaveRandom experiencing that now :@
yes we can give class attribute, but when I use choices which is like radio group the class us applied to group div and not to individual radio button
 
@StrawHat You can fix that with CSS selectors: jsfiddle.net/3fLtgwjh
Or just use :last-child, in fact
 
mvc guru answer
 
12:53 PM
0
Q: How to post the form's input fields data using jQuery-AJAX to PHP file and upload the file to the server? Form is designed in Bootstrap modal pop-up

user2839497I'm using Bootstrap framework v3.1.1, PHP, jQuery, AJAX, etc. for my website. I'm displaying the form in Bootstrap modal dialog. Following is the HTML code of the form: <div class="modal fade" id="sampleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <d...

 
@Jimbo .. I probably will have to write an answer for that one
wow ... you are wrong about everything — tereško 20 secs ago
 
Answers like that are even actively harmful
@tereško He deleted it, lol...
 
Who owns the URL's ... that would probably have to be ... Google?
 
lol
 
1:06 PM
what is the best way to handle URLs in your opinion
 
^ hahahaha
 
@ziGi File that maps urls -> controller actions
But not coupled in any way
 
should they be specific always or is it a good way to add some regex there?
example
 
@ziGi You can have \url\for\{slug}\something
 
1:09 PM
<webroot>/foo/bar
 
They're called slugs, can be regex. Yeah, that's a slug
 
yeah I see
 
I forgot bout coupling ...
 
Regex is harder to read and pointless in this case, might as well use { }
 
thanks for the term clarification
 
1:10 PM
I'll stop now ... carry on ...
 
@Jimbo depends how you make it
because my views map to URLs too
 
Yeah, now that I think about it the input combination of URI(GET included) and POST data and session is more or less the input data combination that your system uses to know what to return you and to check if it should be returned to you.
 
@ziGi this is how I do it: stackoverflow.com/a/19309893/727208 (at least regarding the parsing .. the high level API would be here: stackoverflow.com/a/20299496/727208)
 
Thanks, let me see
 
@bwoebi so you would depreciate comments? :P
 
1:14 PM
@FlorianMargaine nah, who said we'd need the same syntax than cpp?
 
@JoeWatkins Are those quantum entangled gloves?
 
whatever floats your boat @Jack
 
I'll never let go, @Jack /me lies
 
Not sure whether gloves will help any boat float ...
 
1:17 PM
@tereško I agree, your way is a very clean and understandable way for handling URLs, thank you, the article is quite useful
 
Though, I suppose if at least one of the gloves is above land I can perhaps teleport myself if the boat sinks.
 
@DaveRandom after wasting hours to find way to do that, client agreed to keep radio box as it is :/
 
I guess good custom routers could also be found in GitHub
 
@Ja͢ck What if you had one billion gloves
 
well .. I have one too =) .. but it is completely undocumented
 
1:19 PM
For example FastRoute
@tereško I have noticed that sometimes you use external JSON files for configuration or settings, is there any particular reason to it?
I saw that rdlowrey also uses json files in Auryn, so am wondering what are the benefits
 
@ziGi I use YAML. But same reason - don't need to touch code to change a big settings
 
I have seen some frameworks use INI files
 
You can use it for polymorphism too, change a string, your factory instantiates a different object. Doctrine does it for MySQL -> any other db type
 
is it a matter of choice?
 
Yeah. Although YAML is the superior choice
 
1:30 PM
can you elaborate please?
more readable
pretty?
portable
 
@ziGi More readable. Pretty.
 
ok I see
 
@Jimbo fuck YALM
 
Downsides: You need to parse it with a lib before using it - that's it
@tereško lol
 
As you can see tereshko uses for the URLs a file containing a URL array. Why not put it in a config?
 
1:32 PM
into what config ?
 
Or is it because it is tightly coupled with the code, for me it seems more like a resource used by the router
 
$configuration = json_decode(file_get_contents(__DIR__ . '/config/routes.json'), true);

$router = new Routing\Router(new Routing\RouteBuilder);
$router->import($configuration);

$router->route($request);
this is how the configuration for my router looks like now
 
Yeah, that is exactly what I meant. Good then!
 
and all the spaghetti code is hidden in Router::route(Request $request); ;D
 
@Jimbo yeha .. all of that spaghetti =P
 
1:40 PM
hehe
 
@tereško from your code, it seems like the router likes swimming :D
PS: It owns a pool :D
 
@ziGi Auryn uses a ReflectionPool
Never looked at what that actually was...
 
@Jimbo that is because it is narcissistic
 
"pool" usually is an unassuming name for "runtime cache"
 
This article is about all reflecting pools, for the two named reflecting pools see Lincoln Memorial Reflecting Pool and Capitol Reflecting Pool. A reflecting pool or reflection pool is a water feature found in gardens, parks, and at memorial sites. It usually consists of a shallow pool of water, undisturbed by fountain jets, for a reflective surface. == Design == Reflecting pools are often designed with the outer basin floor at the rim slightly deeper than the central area to suppress wave formation. They can be as small as a bird bath to as large as a major civic element. Their origins are from...
@tereško what is "runtime cache" assuming?
 
1:44 PM
a glorified array containing previously initialized structures (usually: objects)
 
Yeah, I know you are referring to the Object Pool pattern
 
Ah, fair enough
 
I was joking when I said the router likes to swim
 
we understood
 
Hm, to me it seems that Object Pool and DIC are similar if the sense that they keep objects, although DIC is much more complicated because it instantiates them as well
 
1:48 PM
@ziGi Oh, sorry I didn't get that it was a joke, I was in the middle of reporting you to the router-abuse team
 
But I guess the purpose is different
 
:D
 
@Jimbo Oh, nooooo, what will I do now sigh
:D
 
@ziGi Okay so regarding dependency injection containers... if it's a container containing objects then you're likely to use it as a service locator, as it contains all the things, right?
So it makes me think that what they should be is Injectors
Gather what they need ---> Inject when required. I feel containing all the things is wrong.
Which.. if I'm right.. kinda says that all dependency injection containers are bad.
Auryn isn't a DiC. It's an Injector.
(and it's also the only one that does what I want it to, tbh)
 
Well why instantiate multiple times if an object is heavy and it takes time to instantiate.
@Jimbo I never said Auryin is a DiC
 
1:51 PM
2 mins ago, by ziGi
Hm, to me it seems that Object Pool and DIC are similar if the sense that they keep objects, although DIC is much more complicated because it instantiates them as well
not really the point
 
@ziGi Sure, Auryn has a share() method - perhaps that's what the Di C bit is?
I know you didn't @ziGi I was just putting yours and my knowledge together
 
@Jimbo I was just going to mention that
Well to be honest pools are useful if you have a lot of items and you want to keep them because you are going to use them later
but I have not used it besides once when I was implementing a game that needed a lot of different objects (like trees etc.)
so I can see how a pool could be useful if you have multiple routes (as most sites do)
 
well .. dig deeper
the code is there
 
yup
I really like that you use PHP 5.4+
it makes things really clear
 
i don't see how those two statements are related
 
1:56 PM
not sure
 
@Ja͢ck By the same person - related statements - boom
 
Haha, I was referring to the shortened array syntax
(new Foo())->stuff();
 
(new Object())['deref']
//meh
 
(new Jimbo())['derp'];
 
anyone can help me?
 
2:00 PM
@user3243573 -1
 
can anyone help you?
 
@ziGi lol
 
=[ didnt get the job
 
sorry to hear that
 
2:04 PM
@RonniSkansing what was the job opening (link to the ad)
 
@rdlowrey sorry for useless PR description :-/
 
@RonniSkansing damn
 
2 messages moved to bin
 
can someone tell the guy to stop spamming
 
1 message moved to bin
 
2:07 PM
@ziGi The ban told him.
 
Ah, good, thank you
 
@RonniSkansing :-(
 
@RonniSkansing sorry for the offtopic but have you noticed that your family name is Ska & sing do you like to sing ska music?
 
@tereško jobindex.dk/vis-job/h484538 (it in danish)..
Well can not win them all, just have to start looking again.
@ziGi yea I noticed that before, no I am not really the big singer, I can play some guitar and piano though, but I really do not spend much time on that now a days
 
@RonniSkansing I can imagine
 
2:12 PM
@RonniSkansing lol, that one look extremely terrible
 
the job is for Webmaster
aren't you a PHP programmer?
 
thanks @tereško
it had a okay pay, close locality and was close maintaining a couple fo webshops.. not really a dream job, but what I needed atm.. I will cheer up and be happy tommorow again [=
 
aw you didn't get it then @RonniSkansing ?
 
give you a reason ?
 
2:15 PM
The good thing is that you have one more interview behind your back, that is a valuable experience after all.
 
Not the profile they are looking for @JoeWatkins
 
Are they looking for a slave?
 
@DaveRandom aren't "Intentional Bugs" features?
 
@rdlowrey ^^ that demonstrates the bug that I encountered in NativeReactor that the PR is for. If you execute examples/02.php then you'll find that you get different output
I just cannot come up with a simple reproducer though :-/
@ziGi No I only kept that code in so I could remember what provoked the bug I found in amp :-P
 
2:17 PM
I see, hah :D
 
2:33 PM
GOODNIGHT EVERYBODY
 
http://www.popsci.com/article/diy/video-bionic-boots-let-you-run-25-mph
how cool is that
 
does anyone can let me know how i block microsoft.com in windows 8?
editing host file is not supporting this, i can access mocrosoft.com even the host file has point it to 127.0.0.1
 
@ziGi TBH he looks like a moron running in those XD
Also, it seems like it takes a lot of energy to run like that, so the boots don't really help you (other than speed)
 
That is because you are not used to it
@SecondRikudo on what observations do you base that statement?
 
@ziGi The way he lifts his legs
He's lifting all that weight relatively high
It's not a natural form of running
 
3:02 PM
posted on November 26, 2014 by nlecointre

/* by maued83 */

 
> please help me to fix it ASAP
nice touch
I am sure that would ensure the fast fixing of the 'well' explained problem
 
@ircmaxell try HUNTED, thats what they gave me, I hope I am allowed to share it :P
 
3:18 PM
Why does PHP care about the value of LC_ALL when reading files (with fgetcsv) and why can't I just outright tell it what encoding the file is in o_O
 
because locales are dumb
 
Someone just wondered why password_hash($pw, PASSWORD_BCRYPT) !== password_hash($pw, PASSWORD_BCRYPT) ^^ (he was used to the typical hashing functions (md5/sha*) and hehe)
 
that's good
 
@ircmaxell what exactly? That I've introduced him to use your password_hash() functions?
 
that he wondered, rather than just saying screw it and going back to md5
 
3:24 PM
ah definitely :-)
 
Demmit, trying to install Apache2 on my Ubuntu installation. But that gives me this -_-' pastebin.com/4s6m8QL0
 
@Jack cmark is rubbish ... can't get any manipulation functions to actually work ...
 
@Duikboot write this command: sudo apt-get install apache2
 
soooo tired today... ><
 
@Duikboot try apt-get update and then repeat the sudo apt-get install
 
3:39 PM
moin @ircmaxell
 
apt-et update gives me: pastebin.com/T9XjcwwL
 
@Duikboot wow you have something massively screwed up with your package lists
 
I was following that article.
 
sup?
 
you have links that are discontinued so apt-get cannot manage to find the sources
 
3:41 PM
Probably I am running a too old ubuntu version.
 
which version of ubuntu do you use?
 
Let's check out the most recent one.
13.04
 
yeah
Discontinued (end of life) versions are removed from the main repositories, and that is why you get the errors
try doing an apt-get upgrade
and then repeat the apache install
 
oooh ok.
 
you could also use the upgrade manager if you are not comfortable upgrading from terminal
 
3:42 PM
OK
 
@Danack looks like that guy is probably hammering the server and it's just ignoring requests after a while (DNS caching issue). You got time to quickly throw together a memcached Cache impl?
 
Also I think the ->select() approach for creating the default cache is probably a good idea
 
Morning!
lol, I got a gold badge on mechanics.SE
 
@DaveRandom That's what I've done - it's committed but not tagged as a new release.
But using apc not memcache.
 
3:45 PM
moment
 
yeah.....that was an hour of time....
 
Where'd all the normal PHP Internals people go?
Only responses on list seem to be crazy or off the wall people.
 
@LeviMorrison you just described the normal internals people
 

« first day (1502 days earlier)      last day (3437 days later) »