« first day (1506 days earlier)      last day (3654 days later) » 
00:00 - 14:0014:00 - 00:00

12:10 AM
Yea, you're using the mysqli API :-P srsly though, I dunno
@DanLugg I tried to do the same via direct using of the mysql protocol, no success either.
Do you have to bind null as a placeholder?
yes (in mysqli)
I tried insert statements, they're working.
Perhaps that's why? Is it possible its only supported in INSERT/UPDATE?
Well, that's my question.
I'm getting no error from mysql server, so wondering…
12:15 AM
And a damn good question no less :-P
12:32 AM
@NikiC I use OS X because, unlike Linux, it's usable for things which aren't compiling real programming languages.
This means I avoid dual-booting :)
12:47 AM
@AndreaFaulds same here.
I got fed up with Windows (why is compiling stuff written in C so hard on Windows) and with Linux (hardware support aaaaaa, software support aaaaaaaaaaaaaaaaaaaa)
@AndreaFaulds I have good driver support for my Unix system on a Mac ^^
@LeviMorrison yeah, but when you have a Mac, you also just can use OS X ;-)
Erm, OS X is my Unix system ^^
somehow read Linux there^^
12:56 AM
Does anyone have any idea of what changes have been done to smart_str in PHP in the native-tls branch? Or is the error: error: ‘smart_str’ has no member named ‘s’ just a case of me/the computer being confused?
@Danack native-tls? you mean in master?
native-tls branch is just on top of master…
I guess either? I'm trying to compile an extension against the tls branch just to see what breaks.
first try to make it compatible with master^^
the extension was prepared for php-ng a while ago.
because smart_str was changed two months ago in master.
@Danack then it might be not fitting most recent changes yet^^
12:58 AM
Ok, is that change documented anywhere?
smart_str was moved to Zend/zend_smart_str.h
with a few changes to it there. Just look at it.
I think I'm not going to like the answer - why does php_smart_string_public.h still exist if the contents have been moved elsewhere?
It would be better to have an "this include file no longer exists" error than "the smart_string struct has different members" error.
@ircmaxell Context?
@Danack can't tell you now…
You'd have to ask Nikita who did that change.
@NikiC Ought you have deleted standard/php_smart_string_public.h when you moved it to zend ?
 
1 hour later…
2:33 AM
@LeviMorrison stack programming languages like forth
Mornings
Assuming I have a zend_function * how can I call it?
Not sure what the name of the macro/function is that I'm looking for.
It looks like if I have a method I can use zend_call_method_with_2_params (or a friend).
@LeviMorrison it will call functions as well
just pass null as the object parameter
3:05 AM
Hey, why can't a parameter be optional without a default value?
In userland, I mean.
what value would it be if it wasn't provided?
Hmmm… I am looking to try to speed up a particular method/function call that is called a lot.
By "particular", I mean passed to a constructor and used many times over the course of the object's lifetime.
And to clarify, I'm talking in the context of PHP source.
(but the callable is from user-land)
Any ideas?
cache the fci (function call info)?
3:23 AM
And maybe the zend_fcall_info_cache.
3:40 AM
Looks like this might be what I need: zend_fcall_info_init.
@ircmaxell None.
@ircmaxell The value wouldn't be used, I'd call func_num_args()
@ircmaxell That or it wouldn't be set and could be isset()'d
@AndreaFaulds You know much about zend_fcall_info or zend_fcall_info_cache?
@LeviMorrison A little, actually! From my work on Closure::call().
Do you have some time at the moment to help me out?
@LeviMorrison I should really get to bed soon, but I might be able to help briefly
3:52 AM
Okay; given a callable how would I create an appropriate zend_fcall_info and zend_fcall_info_cache?
@LeviMorrison zend_is_callable IIRC
No, wait, gimme a sec... wrong function name.
You mean zend_is_callable_ex actually creates them?
I saw zend_make_callable but it uses a local var (not one I provide)
Basically, I am going to pass in a callable to a constructor and call it many times over the lifetime of the object.
zend_fcall_info_init() is what you wanted
But I'm not sure if zend_fcall_info is reusable
Actually, it probably is. You'd just need to copy it presumably
@LeviMorrison ^
Why do I need to copy? Can't I just clear it? Such as zend_fcall_info_args_clear?
probably
I don't think zend_call_function copies it
@LeviMorrison What if your function calls a function which calls your function?
4:02 AM
Hmm?
Also, what is this callable_name garbage?
@LeviMorrison Two stack frames would be pointing to the same zend_fcall_info...
I fail to see how this is different whether I cache the first call or not.
@LeviMorrison It can just be NULL
@LeviMorrison huh?
  typedef struct {
          int32_t size;
          int32_t capacity;
          zend_fcall_info fci;
          zend_fcall_info_cache fcc;
  } Vector;
@LeviMorrison zend_fcall_info is info about a function call. Things will probably break if two stack frames point to the same one.
4:04 AM
@AndreaFaulds Right, but how would the second one be pointing at the first?
@LeviMorrison Because you re-used the zend_fcall_info rather than making a copy, and the function you called called your function again
Right, but the function I called would create a new zend_fcall_info, yes?
@LeviMorrison When it calls you, yes. When you call that function, you're reusing the zend_fcall_info.
Er, something like this:
unique_fci_for_your_function_1 -> cached_fcall_info -> unique_fci_for_your_function_2 -> cached_fcall_info
Now
What happens when the 4th call down the line returns?
It cleans out its parameters
When the 2nd call down the line returns? Probably a segfault.
I guess I don't understand the interaction between fci and fcc.
fcc is fci with less elements
dunno why it exists
4:08 AM
From what I looked at both are needed to make function calls.
Yes.
It tends to actually use the values in fcc over the ones in fci
Closure::call relies on that ^^
Lemme explain the problem slightly better, hmm.
$x = new Vector();
$x->callback = function () { $x->run(); };
$x->run();
This is the problem case ^
I don't get it ^^
Give me a moment.
You cache a zend_fcall_info for some user-provided callback (let's call it Bob) and you have a function which will call that callback (let's call it Alice).

1. Alice is called.
callstack: [A]
2. In order to call Bob, Alice gives zend_call_function a pointer to the cached zend_fcall_info. zend_call_function modifies the struct to contain the parameters being passed.
callstack: [A, B]
3. Bob calls Alice.
callstack: [A, B, A]
4. In order to call Bob, Alice gives zend_call_function a pointer to the same cached zend_fcall_info. zend_call_function modifies the struct to contain the parameters be
Every time you edit I have to start over ^^
Sorry ^^ no more edits
4:21 AM
I think I see.
However… I'm okay with that ^^
@LeviMorrison Why are you okay with a segfault?
Firstly, because using the vector inside the callback is a logical error.
Secondly, because I don't mind segfaults when the user does something stupid.
@LeviMorrison No, you should mind, killing the PHP process is horrid for shared hosts
Fine with me.
You've just introduced a DoS attack. Bad. No.
Also, re-use will probably break for other reasons. Just make a copy on the stack.
4:27 AM
You act like this code will someday make it out of my hands and into someone else's use ^^
@LeviMorrison It might. Still. Do the right thing ;)
Anyway, it's 04:28... goodnight.
The whole point of this little exercise is to not do the normal thing.
^^
5:06 AM
Hi souls!
Is it safer approach to set_include_path to custom than using default one(?), provided by my hoster (thus the thing he gave me is complately weird ".:/usr/share/php:/usr/share/pear" dot and column? I can't reach that via ftp ... unusable..) I bet everything is ok, but i lack some key understanding here.
help?
5:22 AM
^^ Hi-larious.
:) isn't it!?
relax muscles for a bit .. ill try out some snip linuxprograms.wordpress.com/2012/01/30/php-set_include_path
5:42 AM
@animaacija , use absolute paths.
@sectus how to? $_SERVER["DOCUMENT_ROOT"] gives me just /hosting/www/xxxxx.xx/web
@animaacija , why do you nead to use include_path?
they are powered by ispconfig.org/page/home.html are u familiar..
because through ftp i can see folders: [log] [web] [ssl] [cgi-bin] [temp]
What is your original problem?
i can write all but log folder, and from none of these i can't include eather by relative or absolute(maybe) (-using- dirname($_SERVER["DOCUMENT_ROOT"]))
contents of web folder will be the index.php
but i want to place sensitive php files folder above ..
u know common practice for safety
5:51 AM
It could be symlinks: log, web, ssl and other.
this returns as default includes folder [.:/usr/share/php:/usr/share/pear] but i want my default includes to be there where i can access it by ftp
might =/
so how to get absolute path
You could move your applicationn down to web/app for example using htaccess
there is no file htaccess
mh.. sec
well php.ini has no reference of htaccess
no file in my ftp.
Nice provider i say
create .htaccess file inside web.
also, it could be hidden for your ftp client
or, you could just move sensible files inside some folder (web/folder) and lock with htaccess
that will give me safety? Or might i be also able to redefine www.yyyyy.xx index to some subdirectory of [web] and put sendata in parent.. ?
well if you say it's pretty safe to protect directory like that with .htaccess
Thanx!
6:03 AM
You could go deeper. Remove handler for all php files, except index.php :^ )
what do you mean by handler ?
Got it ..
that was my next question.
but that would not be user friendly
so htaccess just needs to be aside with index.php and all other that are controlled but if user accesses a page in some folder where htaccess file is not present he would reach that -targeted page inspire of .htaccess file in main dir right?
--but logically thinking, .htaccess would give rules to govern protocol used by client. This fails - hacker would not use protocols. So.. I'm not satisfied yet. Nicer is to grand access to sensitive files only on server side and by application itself..
6:42 AM
is it possible to create a domxpath object from a nodelist object?
@ray9209 what should it represent?
some HTML
no, the resulted domxpath
Let me rephrase the question:

suppose I convert html data that has two table elements in it into a domxpath object ($xpath). then $xpath->query('//table') will return a nodelist of length 2, correct? if I want to traverse each item of that nodelist using xpath, I would need to convert each item of the nodelist (each table element & its sub elements) to a new xpath object - is that possible? Or is there another way to accomplish that?
"I convert html data that has two table elements in it into a domxpath object" --- what does it mean?
domxpath represents an object that you use when you query a DOM object
it does not carry any data
6:57 AM
@zerkms by HTML data, I mean a DOMDocument
okay. have you read my 3 lines?
ok, let me ask the question again, this time with some code:

$response = curl_multi_getcontent($ch);
$dom = new DOMDocument;
$dom->loadHTML($response);
$xpath = new DOMXpath($dom);

// $xpath->query('//table')->length = 2 (2 tables in DOM)

Can I convert each table element into 2 separate DOM objects, so I can use domxpath to query each table separately?
When you query you can specify a scope
$xpath->query('//table[1]') -- like that? Tried that, didn't work
Check the second argument of query()
7:21 AM
@FlorianMargaine is the fix for getallheaders() in fpm going to be merged for next 5.6 release?
so suppose the tables look something like this:

<table>
<tr><td>test1</td></tr>
</table>

<table>
<tr><td>test2</td></tr>
</table>

and I want to access the <td> element of the second table. Would this work:

$table2 = $xpath->query('//table')->item(1);

$column2 = $xpath->query('//table/tr/td', $table2); ?
@ray9209 how about you check it first and ask when you have a real problem?
I did check it and it wasn't working, that's why I'm asking you; I do have a real problem, I'm just using an example here
what is "wasn't working"?
when I specify a second argument for query(), it still uses the root scope rather that the DomNode specified
7:28 AM
Does $table2 equal to what you expect it to be?
yes, just checked again
@ray9209 $column2 = $xpath->query('.//td', $table2);
context specifies the current node
When you select by //table/tr/td you revert it back to root
@zerkms Thank You!
\o/ I finally fixed my lower_bound() implementation.
user924016
8:16 AM
morning
moinz
@RonniSkansing has new picture ...
user924016
yea.. abit dark, but you can hint my face =]
user924016
Hope you enjoyed the weekend... cause it is almost over.
there was a 10th birthday party at my house last night, I still have two extra 10 year olds, they didn't stop until 3am ...
user924016
oh lol... Sounds like a party =]
user924016
8:31 AM
Sometimes I get reassured not wanting kids is "the right thing for me" .. actually almost anytime kids are in the conversation =
they are extremely unreasonable ...
user924016
hehe is it boys or girls?
they are also a reason to exist ... the only real reason possibly ...
girls ...
user924016
=] Well respect. I could not do it. I bet they are more reasonable in 4-5 years... wink
user924016
Another reason to exists is extreme fear of dying.. /=
8:36 AM
doesn't explain why you are here, the only thing that explains both why you are here, and what drives you to stay is probably because kids ...
it's not for everyone ... I'd quite like a new kid already, I super enjoy being a dad ... but we're not in a position to do that right now ... so I'll wait ... I'd like to do it one more time though ...
I'd like to do it, and be in a position to do it ... we decided to have kids really young, I don't regret it a bit, but it's tough if you can't actually afford it, and we couldn't ... when we've got a bit of a bank balance and savings, I think we'll have another ...
user924016
Sounds great with another kid. [=
well by then, our eldest will be able to actually help out ... the only really hard bits were caused by a lack of funds ... once money is out of the equation, it's only sleep you loose out on ...
user924016
Coming from a quite poor and miserable family I never belived money was the factor for a quality life though I can understand the need.. It must be really expensive..(!) Talking about kids my sister gave birth to a boy only 2-3 weeks ago
as a child you don't notice when things are difficult for the parent ... I have 6 brothers and sisters, money didn't seem to be a problem for my mum, but in actual fact she was on her own and it had to be a problem ...
awwwww
you should spend as much time as possible watching, they are amazing to watch, not really at a few weeks old, but soon as they can get about, they have incurable curiosity ...
user924016
I will try [= yea I need to find a job, so I can afford the travelling. Hopefully I found something before 2015... I am abit afraid of babies..
8:45 AM
I think I'll write some code today when my house is back to normal ... looking at my github contributions chart, I've been slacking the last few months ...
I'm totally afraid of handling babies, I wouldn't bath mine, and was scared of feeding them really young, they feel very fragile, don't blame you for being scared ... I tried to bath our eldest at a few weeks old and she kinda flippered out of my hand because I wasn't holding her tight enough ...
still not having much luck with the job hunt then ?
user924016
Not yet, sending out job applications, but not much luck so far or still waiting for the deadline for requests.. If nothiing comes in, I will have to get a "shit" job until I find something, but I can live with that. Actually I can live with doing must stuff as long as I can come home and spend time with a computer..
user924016
I better get started on todays rutine (coffee, food, bath, job search, send applications .. ) .. ttyl and hope you have a productive sunday coder. Thanks for the talk
lata :)
9:02 AM
Hola guys, just need a quick suggestion. I am trying to resize my images but it would be great if they get compressed too. I am using imagecopyresized . Any suggestion what should I use instead for compression too?
can someone tell me do i need to have python and/or perl installed to run php in thee server? i can run php site in local without perl or python, but i am not sure if some package require perl and/or python to run server properly
9:27 AM
Hello all have anyone used
sproutvideo, composer, guzzle
hi @JavaFan
can you help me
sorry I didn's use sproutvied
9:45 AM
Morning
@user3027531 compression == most of the times less quality
@JanakaRRajapaksha nope, you don't need python or perl to run php
@HamZa yes I am talking about lessen the size in terms of compression
@androidBeckhamania it seems they have code examples at their github repo github.com/SproutVideo/sproutvideo-php/tree/master/examples
compress the size. Like www.jpegmini.com does
morning
@user3027531 php.net/manual/en/function.imagejpeg.php see the third parameter "quality"
9:48 AM
@HamZa so if i completely removed python and perl, will teh server break? it doesnt have any thing setup and in future i will run only php base sites
> quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default is the default IJG quality value (about 75).
@HamZa thaks
@JanakaRRajapaksha I can't guarantee anything. I've seen some programs require python.
Also python is cool. I would definitely not uninstall it :P
@user3027531 welcome
@JanakaRRajapaksha Basically if you have pure python installed without any python powered webserver, let it alone and move on. If you're serving a website with python, then see if you can disable or remove it.
Al right, I'm too active this morning :O
9:54 AM
@HamZa ok
@JavaFan yo
I have a question not in php but in web design and development generally
Can I get a link from a webpage that can lead me to a specific part of it?
10:05 AM
@JavaFan Can you be more precise?
Or do you actually mean id="bottom" and then somewhere there's a link to it like href="#bottom"?
for example in the following webpage saudisale.com/SS_e_mpg.aspx I want to get the link of the cheepest car
Or in any page how I can access to the link of the cheapest prize of a specific good eg. car, computers, ..........etc
You have 2 options:
- Official way: some big websites provide an API to interact with it to get for example a list of cars with prices. Some would allow you to order(sort) it, apply filters etc... So you would be able to get the "cheapest car" in some standard format, think about json/xml
- Creepy: you will need to crawl and parse the website. Now each website has it's own html, url structure. This is going to be tough depending on the complexity. Now of course this might even be against the terms of use...
10:29 AM
@HamZa Is the second option is possible for example how I can get the cheapest car prize of the former site?
even It's against the term of use?
I don't want to help you with that because:
- I'm too busy with other things
- It's not interesting
- I don't want to even check if it's legal or not
I might give you a hint: use an html parser
html parser?
983
Q: How do you parse and process HTML/XML in PHP?

RobertPittHow can one parse HTML/XML and extract information from it? This is a General Reference question for the php tag

11:09 AM
hi
@Danack Maybe ... or maybe I wanted to keep that for BC? Unlikely, probably should drop it.
12:14 PM
Hey guys.
Is anyone online?
12:29 PM
I seriously need help, can anyone help me?
user924016
@HassanAlthaf ask your question, maybe someone will help
I'm trying to get errors back as an array.
user924016
Well you should put your code in a pastebin.. bbiab
Yeah, okay sorry.
user924016
also your password stuff is unacceptable =]
user924016
12:32 PM
brb going to shop some candy
user924016
use password_hash , password_verify instead
Aye, I will.
That is how I call that function and try to get my errors.
I get this error: Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/Projects/AccountingSystem/changePassword.p‌​hp:236) in /Applications/XAMPP/xamppfiles/htdocs/Projects/AccountingSystem/changePassword.p‌​hp on line 383
12:56 PM
@HassanAlthaf What a mess. Please don't put your application logic inside your template files...
I know, how would I clear the mess?
Trust me, I have been trying my best to remove a lot of code.
It would be much appreciated if you can show me some example code.
user1804599
Guten Tag.
To clear that mess.
@HassanAlthaf You need to take a different approach. Don't use a lot of php files that have both html and php code mixed. Instead use a a front controller and separate the templates. This might help even though it's still a work in progress. Here is some sample code.
user924016
back =]
user924016
1:01 PM
@HassanAlthaf are you familiar with the " headers already sent by " error ?
@RonniSkansing
user924016
@HassanAlthaf
@RonniSkansing not really, but I managed to fix it.
user924016
Okay, so you got the help you needed? [=
@Patrick I don't understand how exactly man. :(
@RonniSkansing the exact help I needed was a better way to do it.
1:03 PM
@HassanAlthaf Work through the tutorial... Then you'll learn a better way to design applications
@Patrick which tutorial?
@HassanAlthaf The one in the link I posted... -.-"
@Patrick oh, it was a GitHub.
user924016
From part 1 to 9
Ok.
Oh, it's a decent tutorial. i am going to redo my project.
Guys, I am creating a System, and I really need tips.
Thanks alot @Patrick it is a very good resource.
1:20 PM
Mornings
user924016
Monings @salathe
Well, that tutorial didn't make much sense to me. -.-
user924016
Did you take a look at the example as well?
Yes.
From the composer part, it didnt make sense to me
user924016
Have you used composer before?
user924016
1:30 PM
I guess not, try and see if you can get it installed. Which part did you find did not make sense / hard to undestand?
Mornings @salathe - do you know if [email protected] usually hangs around in php.pecl?
Well @RonniSkansing I like to code everything from scratch instead of using other resources available online.
I'm not doing anything commercial, I am a young learner and programming is my hobby, I wanna learn how to code, not use stuff on the internet.
Like, I don't want all those tools in Composer, I wanna learn how to code them.
I just want to learn how to write and maintain quality code in PHP.
user924016
@HassanAlthaf, okay. A part of quality code is using other peoples code, because it is impossible to write all the best code. But I do understand what you mean, and if you want to spend time trying to build everything from scratch, that is okay, just watch out it does not become a obsession.
Can you tell me ways to maintain modules for different tasks, and maintain large projects?
Like having tiny modules for different tasks,
And then some method to maintain huge projects.
@HassanAlthaf You are far away from writing quality code (judging by the code you posted earlier). Your time would be better spent learning instead of writing more shitty code
1:36 PM
@Patrick I know, it's all a mess. You can see some classes I wrote.
The biggest problem I am facing is that I'm not good in English.
user924016
@HassanAlthaf nope I can not give any advice on those subjects.
@RonniSkansing okay.
@HassanAlthaf Learn how to use composer, once you understand how it works you can write your own packages. I use a mix of 3rd party and my own packages. But most of the time it's 3rd party because I have to get stuff done and no time to reinvent the wheel
@Patrick I would be more than happy to learn Composer, but my project is due by February.
This is actually a project I am doing for School.
I'm taking part in the Science Exhibition, and this is what my teacher recommended me to do.
@HassanAlthaf you can "learn composer" in less than an hour
and then you can use 3rd party packages to massively increase your development time vs writing everything from scratch.
It would be very, very stupid not to
1:40 PM
@Patrick I'll take your advice, but how I install Composer on OS X?
*do I
I miss windows.
@HassanAlthaf go to the website and follow the instructions? ...
@Danack I don't think so
k, thanks.
00:00 - 14:0014:00 - 00:00

« first day (1506 days earlier)      last day (3654 days later) »