« first day (1131 days earlier)      last day (4043 days later) » 

09:00
what? why did you use ^ in a PHP chat to signify power
I didn't realize it had a special meaning in php chat, but sure.
now my head hurts
I agree pow(0, 0) should be NaN
when is PHP gonna introduce that?
The NaN? Not sure.
its not PHP doesn't anything
It would be nice for situations such as 1 / 0.
09:02
lol
@Jack is fine, nothing to hide here, I'd leave it there ...
kay :)
I know that one
I personally felt awkward with the while (1) { } loop ... I probably would have used goto heehee
09:03
numberphile is great.. and makes my head hurt
@Robbert if you know it so well, thn why are you asking stupid questions ?
@Jack
:)
@tereško He thought we were talking about xor.
that's about "yes/no"
@tereško cause I'm the new kid
09:05
who are these people that write articles just to put on reddit ... there's an article about processing data from stdin, with a mistake in all of the first three paragraphs ... so I stopped reading ... who writes a whole article without either knowing that it is correct, or at least checking ...
perhaps he's making it a hobby to put out false info
@JoeWatkins what's the mistake in the first paragraph?
(I skimmed it last night, got bored and didn't pay it much attention)
*reads first paragraph* ... oh! :)
yeah ...
Good Morning
morning
09:11
good moanings
morning
I need a new job ...
what kinda job you thinking of?
@JoeWatkins welcome to our club :D
hi, @salathe
astronaut maybe ...
nah still programming, I'm totally addicted to that ...
just one where I actually get to program ...
I have been waiting nearly 15 months for my "employer" to get his act together ...
think I've had enough ...
09:15
why are you sticking around? every other company needs a programmer
also, you really love ellipsis
well, we worked together for a long time, used to be great, I love being everyone and nobody wants to let you do that anymore ... we spent a couple of years modernizing a set of comparison services that he acquired, he paid a vast amount of money for them ... they are finished with, he then bought isbn.com which is in the top ten domain sales of all time, and I really want to write it ...
I've been hanging on for that ...
0
Q: Facebook Graph API: Can't access the authorization token

Kamran AhmedWhat I want is to fetch data using of a public page. I tried the documentation, but wasn't able to find that information. Then I googled it and found this Can you get a public Facebook page's feed using Graph API without asking a user to allow? question here at stackoverflow and that perfectly e...

@Jack sorry I got busy and wasn't able to get back. I have updated the question with the curl error, will you please have a look.
he had difficulties a year ago, his mother became very sick (cancer), so we took a break, and now every few months he says he needs another few months ...
@KamranAhmed Download a ca bundle from here.
and yes, I love ...
09:20
So what would isbn.com do? :)
I think it's in top 50 actually, it was in top ten when he bought it ... nearly 2 years ago ...
@Jack I've downloaded that. What's next?
@JoeWatkins if the isbn.com thing is really that awesome, then there's no hurry and you should stick around and be a pal for the guy with the sick mom
he's cut himself quite a nice little niche from books, ebooks and electronic media ... basically, amazon without the stock ...
isbn.com would be a book store, or at least a book database, right?
09:21
@KamranAhmed Then you set the CURLOPT_CAINFO option using curl_setopt() to point to that file (it must be absolute path).
I've lost several tens of thousands of pounds now in order to wait for him ...
Morning
I do consider him a friend, but his life has been taken over ... mine hasn't ...
hi, @Fabien
@JoeWatkins You're not doing any free-lance work in the meantime?
09:22
well I guess its kinda like changing schools then. you know its best for you but you don't wanna leave your buddies just yet
I'm not allowed
I'm still under contract
@Jack Sorry but I am really a newbie here. Would you please explain me exactly what I have to do, if you don't mind?
I'm not allowed to work for anyone
@KamranAhmed Nope. Figure it out yourself.
stand up for yourself though, have a good convo with the guy, tell him what you're thinking of the whole situation
09:23
@JoeWatkins Same for me, but it didn't stop me hehe
@Jack OK no problem.
yeah well he lives in a different world altogether ... he doesn't understand the problem it's causing me, I've tried to explain it to him .... when you say to someone like that that you're running out of resources, he thinks you mean you've got less than you would like to have in the particular bank account you are thinking of at the time, he doesn't get that running out of resources actually does mean running out of resources ...
he has been compensating me, but I've still had to draw heavily on savings ... and I can continue to do so for a while longer ... I'm just a bit tired of it ...
hmm
I think you already know what's best for you
and if he's a real pal he'll understand
if not, then I'm not too sure you'd want to build a top 10 or top 50 site with him anyway
@JoeWatkins That certainly explains why you have so much time writing cool php-src stuff =D
yep
I don't want to work in closed source software anymore ....
for anyone ...
but we all have reality to deal with, we have to earn money ...
09:31
yep, only money buys you hoes.
and they grow accustomed to a certain lifestyle
well I've decided absolutely nothing ...
I think this is a problem a lot of programmers deal with
@Jack you are the hero :)
*kisses.. <3 :P
we all have our dreams and awesome opportunities
09:33
blegh
but at the same time we have to do the shitty jobs too to keep the money flowing
well I'm a bit annoyed, about a year ago I had the resources to start something on my own .... I don't anymore ...
it's up to you whether you're gonna stick around to see if this project of yours is gonna land.. or get back to making money
that sucks
I know what that's like, timing is everything
Hello, I have a question. I have one form (with select boxes and many other fields) which I submit with clear php. But in the other page I have to add the same form in modal window and I have to submit the form using ajax. What is the best practice in this situation. If I use the same method I will have to add many if-s. Another opition maybe is Iframe. Do you now another decision for this situation. I don`t want to have dublication of code.
@zerkms I saw that you answered in this question, so I used your deleted answer as part of mine =D
09:37
@Jack me? where? :-S
Hello everyone
@zerkms Duh, wrong cat haha
how to setup new PHP apps to a shared server?
lol
I'm planning to use symfony framework
09:38
I sometimes wonder how my mind works in these kinds of situations heh
@nayoso that's a good choice
@Anton_Sh either rethink your website structure, or make a separate php file with the form and load it (via require or whatever) in both locations
Ugh, got another task to do an using a framework is optional
@zerkms thank you, I'm want to try another framework beside zend
/me goes back to writing code ...
09:39
but I never try to setup a php apps from zero and now I want to setup it on shared server on hostgator
I already downloaded the symfony and then?
@JoeWatkins good luck with the isbn thing and the job, hope it works out well for you
@nayoso what do you mean by "to setup a php app" ?
oooh php.net in beta by default now ...
and then you open your IDE and start doing some magic
yes after I download the symfony
I've to copy the symfony to the shared server?
to the root folder?
09:40
$url = sprintf('http://domain.com?key=%s&domain=%s', $key, $_GET['domain']);
$result = file_get_contents($url);
@nayoso I'm not too sure if you can setup a php framework on a shared server.. don't you need a VPS for that?
Any security concerns with file_get_contents in this manner?
anyone to write something on clojure?
@Shea Yep
@nayoso for what?
09:41
@Robbert I read from here we can use symfony stackoverflow.com/questions/13552878/…
or is it already installed there?
$url = 'http://domain.com?' . http_build_query(['key' => $key, 'domain' => $_GET['domain']]); @Shea
@nayoso good one, I didn't know that. I stand corrected
@Jack Thanks
@nayoso do you have SSH access?
same with me but I didn't know how to implement it because this is my first time using it
now I'm requesting it
09:42
Why is everyone out of work at the moment?!
out of work?
I have too much to do..
@salathe I dunno :(
@salathe by chose ... I still have enough money
@Duikboot I guess you don't count as "everyone" :P
I imagine someone could get my server files the way it was, but I'm not sure how with the string beginning with the http
09:43
@nayoso do you know how SSH works? i.e. running commands on your server
I'm not sure if I have whole idea of it
@Duikboot I also have lots of work, and even got a salary increase coming :)
but I know it's being used if I want to use shell access
he mentioned "shared hosting" ... those usually do not have ssh access
I usually used it via putty
09:44
So I have a task which is to create some logging guestbook style thing. I can use a framework but I am not versed in any and prefer not to. Which means the task is much longer. It's mainly a good DB abstraction layer that concerns me.
@nayoso You can use it, yes, but that doesn't mean it's installed.
@nayoso yes, putty is fine :) just connect to your new server via putty
@tereško in this case they're offered it
they ?
hostgator
09:45
Morning all
seems like he got a package with shared hosting and ssh
like the question he sent
@salathe Nice! :)
please don't tell me that you are thinking of using symfony for new project .. picking a framework with which you have no previous experience is one of the best ways to kill a project
morning styphon
Would anyone know the syntax for filter_input with FILTER_SANITIZE_STRING when using both a flag and an option?
09:46
Potential employers and no I don't want to use a framework but my personal pdo abstraction layer is le poop.
ah now I can connect!
and every public one uses static methods
@tereško are there any "better" options?
and then how to check if I have symfony installed?
@nayoso <:D yay
09:47
something like ruby -v
installed ?
or rails -v
@nayoso if you're asking such a questions - there is a chance it's too early for you to use SF2
download, extract, done
it does require some knowledge
09:47
ah I see, yes I'm very beginner of SF2
but I've got enough knowledge of zend and basic PHP
and MVC
@nayoso I think you'll figure it out
but I never setup any environment yet :)
You need a Composer to write for your Symfony, otherwise it won't play :D
what does "setup any environment" mean?
@Robbert thank you robbert
09:48
it means he never set up the actual server but he did work with existing servers
@Styphon there's an example on the filter_var() man page.
yes exactly like what robbert said
@Jack bullshit
what is composer?
@Styphon ['options' => xyz, 'flags' => 'abc']
09:49
@salathe Aha!!! I knew there had to be one somewhere.
[03:56] <@bjori> us1.php.net now has it
[04:15] * Kalle hands bjori a beer \o/
[04:21] <cjones> yay!
@JoeWatkins beta, yes
OK, so I have my syntax right
You were sleeping :)
@Styphon If it's right, then why are you asking? :)
@JoeWatkins that means isn't not beta any more :P
09:50
This is correct then, yes?
$textOpts = filter_input(INPUT_POST, "text", FILTER_SANITIZE_STRING, array("options" => FILTER_FORCE_ARRAY, "flags" => !FILTER_FLAG_ENCODE_LOW));
@nayoso did you follow any tutorials so far on Symfony commands? for example try akinas.com/pages/en/blog/symfony_install
@Jack because it returns FALSE
@Robbert do you realize the difference between SF1 and SF2?
@Styphon why the ! before the flag?
@Robbert thank you for the links! I've been googled it before but I didn't hit that link I'll take a look at it now
09:51
@nayoso don't. It's about ancient SF1
@salathe to stop it stripping line breaks
ah OK
@nayoso sorry, its SF1, I didn't notice that quickly
@nayoso what you need is all on the official site
I'll have another look
09:51
nothing is required additionally
@Robbert maybe you should stop trying to help
when I say nothing I literally mean nothing
@Styphon You can't just use a ! there and expect it to work. Use the correct combination of flags instead.
@tereško I'll decide for myself, thank you teresko
@salathe That works with filter_input_array
09:52
@zerkms hm, maybe nettuts+, that's a great site, especially premium
@webarto for what in particular?
@Robbert you are assuming that OP is so stupid that he cannot use google
@salathe and what combination of flags would work then to tell it to not encode lower characters?
according to the documentation, there isn't one
@tereško I'm just assuming I have a little more experience setting up servers than him and am trying to help him. what's your problem?
09:54
@nayoso exactly :) symfony2 tutorials
@zerkms j/k, people don't like to read docs even tho everything is there :)
OK thank you everyone!
I'll try to read about it first
@nayoso good luck! I'm sure you'll get far with the tutorial
09:54
it's A LOT to read
Perhaps this is an xy situation then. What I'm trying to do is take a textarea input and filter_input it without stripping the line breaks
yes
@Styphon Then you might as well use FILTER_UNSAFE_RAW :)
@jack but then anyone could enter any HTML in
@Styphon you want to encode or strip lower characters?
09:57
@salathe No, I want to stop it from stripping line breaks, which are in the lower characters.
@Styphon Ehm yeah, but the low pass filter doesn't help much there afaict
@salate If I run $textOpts = filter_input(INPUT_POST, "text", FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY); then it strips the line breaks.
@Styphon So you want it to encode line breaks?
@Styphon Have you tried ~FILTER_FLAG_STRIP_LOW ... =D
@salathe I want them left alone, not touched.
@Jack, No. will try that now
10:00
@Styphon What do you want to happen to other "lower" characters?
@salathe I want them to be left alone. However if I don't specify !FILTER_FLAG_STRIP_LOW then it seems they are stripped
Right, you want sanitize_string but without strip_low.
@salathe I don't understand why, but line break is in the lower characters, and if you specify no flag at all, they are stripped
Perhaps they should add FILTER_SANITIZE_TEXT :)
@jack yes
10:04
Hmm, if I just do filter_var("hello\nworld", FILTER_SANITIZE_STRING); it retains the newlines.
two secs and I'll post the input and output
Hi guys.
How can I check for a specific string inside variable?
strpos ?
/me researches
stripos for case insensitive
@Jack This is the input:
text[0][id]:30
text[0][container]:16
text[0][val]:TEST

TEST
text[1][id]:27
text[1][container]:17
text[1][val]:TEST

TEST
Response Headersview source
10:07
i'm trying to search for 'http://'
inside a variable
@jack ... OK now I have line breaks...
So read docs... strpos($var', 'http://');
lol
Shoots self
@Purify Why are you searching for that?
thanks guys (Y)
@Styphon okaaayy, so text is an array, of arrays!
@AlmaDo oh gawd
@salathe I don't know what I was doing before but it's giving me line break now
And yes, hence the FORCE_ARRAY option
@DamienOvereem Actually, he should use boyermoore_indexof() :)
10:11
Hello
@Styphon Let me guess, you were dumping them on your page and the browser removed the newlines .. hehe
@Jack I really don't know
omomeomeng
But it's working now :)
God knows what was happening
10:11
@Jack Ohsome
Who the hell was repsonsible for the star rampage this morning @DanLugg
@PeeHaa morningzjtuz
@Jack i wonder what the definition of a "larger haystack" for the boyermoore thing.. not going to bother figuring it out though ;p
@jack couldn't have been, it's an ajax call, I'm looking at it in console
@Styphon So, if you find out, that would logically mean You = God =D
10:12
@jack Yes :D I must find out now lol
@DamienOvereem Something like 1MB+
I have a question, it might be less related to web developmenet, but I need to get this answer, therefore ill do it in PHP cause it's the same.

I have a square out of coordinates.

bottomX, upperX, bottomY, upperY.

this makes a square, example:


(3048,3582) (3065,3582)
(3048,3565) (3065,3565)

now, I want to generate a random coordinate, INSIDE the square between these coords.
How can I do this without looping a lot of times inside the coord numbers & then checking if its inside?
Why do we need the tag on SO?
I want to generate random X, Y that will be inside that square
10:15
maybe for physics engines? :)
do they matter when answering or finding questions?
@JonyKale that will be [mt_rand(leftX, rightX), mt_rand(topY, bottomY)]
@toscho It might ... but with 1k+ questions tagged I wouldn't ask such questions =p
mt_rand is the random class right? rand(min, max) ?
random class?
10:16
@JonyKale use mt_rand() cause it reinitialize random seed every time
@Jack the number of tagged questions doesn’t say anything about the quality of a tag. example :D
@AlmaDo iirc it's only once.
@Jack btw mt_rand() is crappy in php..
@toscho Pff, you're talking about Wordpress ... nuf said.
@JonyKale Do you have the co-ords held in variables?
10:18
@AlmaDo Is there an implementation that's not crappy?
@Jack no, not it's implementation
So why do you say it's crappy in php?
@Jack because of this
Though, I'm not sure how long the basic globals live :)
why the hell do such weird thing.. (I know 'why', it's in comments, but it spoils implementation)
10:20
haha, what the what.
@Styphon Yes I have, but the system is annonymous, means you can't really know the coords, it should automatically generate the coords.
$challenge = new ChallengeFactory();
$challenge = $challenge->create();

$coord = $challenge->getMap()->getCoordinateSystem();
$bottomX = $coord->getBottomX();
$bottomY = $coord->getBottomY();
$upperX = $coord->getUpperX();
$upperY = $coord->getUpperY();
Example of how it looks
we don't know what map we have atm, the system must automatically generate coords in the current selected map
@AlmaDo Not sure how to quantify the crappiness of that design decision though.
@JonyKale That's fine, as long as you have them you can do this:
@Jack by this >> 1 it will return castrate 'half-long' (always unsigned and till half-length)
$randomX = mt_rand($bottomX, $upperX);
$randomY = mt_rand($bottomY, $upperY);
10:22
well, yeah, it returns a positive only signed integer.
@Jack which quantity? It forces result to be 0...2^31 -1
oh okay cool
Thanks alot.
@JonyKale np
@AlmaDo If you don't want that, then openssl_random_pseudo_bytes() =]
@Jack I don't care, actually, for common purposes it's ok. But that smells
10:24
I wonder if it could just work with 32 bits ... perhaps that would be more work, not sure.
it would be ok if that be normal unsigned (i.e. 0..2^32-1), but noooo
Or you would get into the whole floating point mess.
@AlmaDo Doesn't that just limit it to an unsigned number of 2147483648?
@Jack I really can't understand what prevents it from returning normal int (signed)
in comments I can see that it's "compatibility" reason.. but that sucks..
@AlmaDo Have you seen what kind of mayhem crc32() causes due to that? :)
All of a sudden you need sprintf('%u', crc32('bla')); .. like eww :)
10:26
@Styphon unsigned is 32 bit, i.e. 0..2^32-1, while 2147483648 = 2^31
@Jack there's no way to restore original value after it was shifted
For sure, that bit is a goner.
@AlmaDo Right, so if the right shift it you lose the sign, so you're just limited to 31 bits, so 2147483648.
yes.. so that's why I'm saying that it's crap. We're forcing our good function to be only half
and with no good reason
Of course on 32-bit systems there is no unsigned long (in php world), which is part of the problem I suppose.
For larger numbers, yes. But for most people it'll do
And just out of interest, is there a 64 bit version of mt_rand?
10:29
mt_rand64() =O
j/k
@Jack but ok, let it be signed long. What's the problem? let it be full -(2^31) .. 2^31 -1 range.. and those who want 'unsigned' result - let them use sprintf('%u', $x)
@AlmaDo Wouldn't that mess with the given range?
(__n) = (__min) + (long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0))) ... right :)
@Jack yes, it will - but if we'll say in manual page that 'ok, we're working with signed long' - then it will be ok (function's users will know that). And, besides, currently there's no way to overcome that too
Hmm? Isn't it guaranteed to be a positive int?
As in, the returned value is never a double? Hmm ..
that's a part of it
10:36
how did you find out about that anyway?
I mean, I can read the source code, but I wouldn't have stumbled upon it unless I either had a very curious mind or if there was a bug :)
@Jack because of bug in php documentation
Ehm. Where?
@Jack here it's said: 'The mt_rand() function is a drop-in replacement for this. It uses a random number generator with known characteristics using the » Mersenne Twister, ...'
but that's crap - if you'll test, for example, Java's implementation (which uses native calls too) - you'll see the difference when using seeded random sequence
You mean Java's implementation of MT?
.. Since when can the scalar type be type hinted ?
Netbeans insert code for setters/getters created:
public function setIdentifier(scalar $identifier) {
$this->_identifier = $identifier;
return $this;
}
10:49
I think that was added and then later removed from php-src iirc
The documentation states that mt_rand() a drop-in replacement of libc rand() ... it doesn't necessarily say that it complies with the actual MT code heh .. that's so php =D
Is there anyway to get the query with parameters when any query(INSERT,DELETE,UPDATE) AFFECTED successfully to the database using php ? I heard some proxy class stuff using php @Jack
Well this is what my parser is saying:
[message:protected] => Argument 1 passed to Wizard_Cart_Item::setIdentifier() must be an instance of scalar, string given, called in .....\application\classes\Wizard\Cart.php on line 47 and defined
Naughty Netbeans :)
Guess I'll bug report to netbeans
Ah yes, at one point Derick committed Ilia's scalar type hint code and then after a heated debate reverted it :)
Hmm wait, that doesn't sound right .. that covers float, int, etc.

« first day (1131 days earlier)      last day (4043 days later) »