« first day (1076 days earlier)      last day (4098 days later) » 

11:00
@DaveRandom Using the code, not the dependency management.
@Fabien we regularly advertise the entire series in here
Almost the same as using Composer definitely a good idea - relying on packagist, not quite as good.
@Danack You mean there is another way?
@Gordon Oh. Well always good to know I am not linking crappy content :)
@PeeHaa Yeah - the composer guys are nice enough to also give you the code that runs Packagist.
@PeeHaa This is badly written (was just playing around to see if it it was possible) wrapper around the Satis (aka the software that runs Packagist) that downloads all of the required dependencies directly from Github, modifies them to have the correct version information in their root composer.json, and then fires up the Satis server, ready to respond to requests.
@tereško how can i set submit typ in jQuery.ajax() for my php script jsfiddle.net/6RGuj
now i have type="button"
@Danack You have been busy the last couple of months I see :P
@PeeHaa Then once that's running - in your projects you can do:
@Danack fixed font!! :P
11:09
@PeeHaa And my big project isn't even visible on github...
"repositories": [
        {                "packagist": false             },
        {                 "type": "packagist",                 "url": "https://pacakges.peehaasserver.com"              } }
It's too early for formatting.
lol
@Danack Looks cool
But basically, once my own Satis repo has downloaded the zips from github, I can develop and deploy apps without being dependent on either Packagist or Github being up.
@Dave-88 you cannot. The type is actually not important. What is important is that you trigger submit for the form, that can be done either by input tag with type="submit" or type="image" OR by calling submit() method on the form element in JS.
Or that was not what you asked
Also, I don't use jQuery.
@PeeHaa I need to tidy that project up, but you may also be interested in my composer notes.
@Danack I did scroll through it the other day, but I'm not a slides guy :)
@PeeHaa hmm - perhaps I should make a youtube video of it......that's what all the cool kids are doing these days.
I just crossed 1.5K in CSS and my profile shows 2K, this is absurd
How to get local (LAN) IP address ??
11:16
:X
ifconfig
@Maulikpatel I hope you're joking lol
@Maulikpatel you got to a LAN provider and buy a LAN IP address
@Maulikpatel blah blah
@HamZa i need for login authentication
11:17
@Maulikpatel In general, you don't. If you really must, you need to query the OS for it using an API that PHP doesn't natively expose. On Windows you com/.net it, on *nix you usually do some exec() magic.
But also, you probably don't need it
@Maulikpatel There is literally no reason you would need the LAN IP of the server or the client for auth. If you are making a blacklist/whitelist, do it in the web server config.
@DaveRandom I use .
echo exec('/sbin/ifconfig | grep "addr:"', $IPS);
print_r($IPS);
wut?
for this I shared the code... I know it'll work, I just don't know, how write this two rows right... — cyber.panda 1 min ago
then it shows
inet6 addr: ::1/128 Scope:HostArray
(
[0] => inet addr:70.36.118.54 Bcast:70.36.118.255 Mask:255.255.255.0
[1] => inet6 addr: fe80::20c:29ff:fe2d:df16/64 Scope:Link
[2] => inet addr:127.0.0.1 Mask:255.0.0.0
[3] => inet6 addr: ::1/128 Scope:Host
)
but my LAN ip is 192.168.1.167
I hope you are aware of what you are doing, right?
@Maulikpatel that's for router
11:21
@Maulikpatel That is your LAN IP, there's no way PHP can get at that, the only thing it could get would be the IP addresses associated with the server's NICs, which is what you did there
I just need to enter users ip adrress who login in my project managment system
@tereško You don't need PHP to check if firefox doesn't work. I'll tell you now: it doesn't work.
@Maulikpatel You don't need their LAN IP, that information is useless.
@Maulikpatel $_SERVER['REMOTE_ADDR'] (php.net/manual/en/reserved.variables.server.php)
Just log $_SERVER['REMOTE_ADDR'] ^ that
11:23
Damn linking!
instastar
@Fabien codify it
stupid markdown
@DaveRandom then how to check login authentication? who logged in whose machine?
@tereško Miley Cyrus is everywhere
@Fabien it shows server ip address not LAN
@Maulikpatel You cannot do that from a remote machine (the server). You'd need a local proxy, or you'd need the server to be local.
Go learn about Network Address Translation and you'll understand why what you want cannot be done.
11:26
@DaveRandom ohh, my server isnt local
Can you give me another way how to check this
?
.. nevermind
You did better than me, annoying that you can't monospace it but I'll take that over nothing
1 min ago, by DaveRandom
Go learn about Network Address Translation and you'll understand why what you want cannot be done.
And I mean cannot be done. No way. Not possible. Not without a local proxy to log it.
any one else have idea " how to check login authentication? who logged in whose machine?"
@loko Did my example made sense?
11:32
fuck you too SO
hmmm...
Isn't he after the MAC ID?
That's not possible either
Yup
Not in PHP
11:33
That's actually quite hard to do even if you want the server's NIC, esp. if the server has more than one NIC, it's hard to know exactly which NIC will be used for what without inspecting the routing table
9
Q: How to get Client Machine's Mac Address in a Web application

nirav patelI have to get Mac Address of client's PC where my website is running. So How to get Mac Address of client's machine (not of the Server's Mac Address where website is hosted). I need script that is compatible with IE, Firefox,Safari and chrome. Please suggest way. Thanks....

Ugh, that is hateful
to get MAC address you have to gain access to the router which user is utilizing
.. i know, i worked on a small project for free wifi internet thing
This information is simply not relevant to a web application anyway, by definition. If you need info about the local network layout, you have a local application
since IP as a layer 3 proto and MAC is a layer 2 address - that's impossible :p
11:36
There are, I suppose, use cases for it with hosted private apps, in which case you want a local proxy and X-Forwarded-For
Sid
Sid
Hi all, I have a script which sorts an array of arrays so that arrays whose 'keywordid' value matches an element in the order array gets sorted to the top of the array. The problem I am experiencing is that not all of the arrays get sorted to the top. One always gets missed out. I can't for the life of me figure out why. See my code here pastebin.com/0ie1JUdc
Appreciate the help guys.
I have a foreach loop, how can i get number of results?
@MirkoSimic Show us your current code
@MirkoSimic count()
@Sid array_multisort(array_column($data, 'keywordid'), SORT_ASC, $data);
@Duikboot
<ul>
<?php
    $i = 1;
	foreach ($results as $entry) :
        if($i == 1) :
?>
    <li class="tooltipbox">
        First item
    </li>
<?php
        endif;
		if($i == 11) :
			echo "</ul><ul class=\"checkboxlist\">";
		endif;
?>
    <li>Title</li>
<?php
        $i++;
    endforeach;
?>
</ul>
11:41
@Sid that's because you're checking equality of indexes in search result, but due to logic that's not correct condition. Your $a will be less than $b if keyword not found from $a and found from $b (and no matter at which position)
i want to detect in the loop vere is middle, because i need to have two ul's
@MirkoSimic At the top $split = ceil(count($results) / 2);, in the loop replace $i == 11 with $i == $split (fixed)
Sid
Sid
@DaveRandom I want to sort according to the order array.
@Duikboot Yes I fixed it.
@Duikboot Not your exact solution.
11:44
@loko So you made it work without sessions? Because you don't need the to achieve your result.
@Sid Oh sorry, missed that
Sid
Sid
@AlmaDoMundo I had a feeling it was that, do you think it I should add if statements for when the keywordid is found from b and not found from a and vice versa?
@DaveRandom No problem.
I think your items are equal if they both not found or both found
@Duikboot & @DaveRandom many thanks, that works perfectly :)
Glad to help you.
11:47
@MirkoSimic Make sure you understand exactly what it does ;-)
Sid
Sid
@AlmaDoMundo so I should check if it explicitly returns false
and handle accordingly
I guess so
Sid
Sid
@AlmaDoMundo Thanks dude.
OMG
> Me: So just for clarification: Am I reading your last comment right when I read it as: "@samdark is against having a section called "Security Considerations" in PSR-4 because it is not important enough"?
@Sid or that: check if 1-st found and 2-nd found. If 1 is false and 2 is true, then 2>1. If 1 is true and 2 is false, then 1>2. Else 1==2
11:48
> Samdark: Yes, you're right. I'm against it.
@Sid What happens to things that aren't in the order array? (i.e. how should they be sorted)
QFT.
Sid
Sid
@DaveRandom Nothing. The things that are in the order array should be sorted so they appear before the ones that don't.
@hakre Not fair. It's too early to start drinking here.
@Sid Ahh OK, well then what @AlmaDoMundo is saying sounds right. One other thing I would say is that you should array_flip() the order array before the usort(), that way you can isset() instead of array search, which is much a much more efficient lookup routine (you'd use the values as $k1 and $k2 in that case)
Sid
Sid
11:52
@DaveRandom Cool, thanks dude.
@Sid It's getting broken on the fact that your first element in your ordering array is at position 0. It then does a compare of 0 == false.
How many time is needed to write import script? I have mysql database, as import format i have .csv, i founded this, but it's not very clear the part of php: blog.sqlauthority.com
And so return that the first thing you want ordered is equal to any thing you don't want ordered.
@Sid Change the ordering array to $order = array(-1, 100, 91, 95);
@Sid i think condition will be return $a ^ $b ? $a - $b : 0; (here $a and $b are results for search, both boolean)
The Ellsberg paradox is a paradox in decision theory in which people's choices violate the postulates of Subjective expected utility. It is generally taken to be evidence for ambiguity aversion. The paradox was popularized by Daniel Ellsberg, although a version of it was noted considerably earlier by John Maynard Keynes. Ellsberg actually proposed two separate thought experiments, the proposed choices in which contradict Subjective Expected Utility. The 2-color problem involves bets on two urns, both of which contain balls of two different colors. The 3-color problem, described below, in...
this is interesting
11:56
@Sid I think this is working - 3v4l.org/gPAZ0
safe to assume all mysql error codes the same as what PDOException::getCode() will return?
@Sid Also this is bit is a bit dodgy: return ($k1 > $k2) ? -1 : 1; - You're turning the sign of the sort around - which is not always valid (or at least can lead to weirdness). You are safer doing return ($k1 > $k2);
/he's gone hasn't he...
What music are u listening right now,...
@Duikboot GLAD YOU ASKED
Im looking for some new songs/albums to listen too.
12:00
Warning: A lot of bass.
whatahell
Warning: Video is mildly mature (blood, violence)
which? mine is not
The one I linked.
Sid
Sid
12:02
@Danack Thanks dude, haven't tried your solution out yet, so regardless of whats in the order array as long as its prefixed with '-0' it should work?
@Sid np.
@Duikboot If you prefer slightly less grimdark stuff... (warning: huge thumping bassline)
@DarkAshelin I love Monstercat :o
damn
horrible
:D
@Gordon emm .. I fail to see the paradox there, because on the second list the D gamble is the unambiguous one
12:04
except the jazz one
@Sid Prefixed with something that's not matched, and isn't == to false. Not sure if you meant to type '-0' but that probably wouldn't work.
@Duikboot I need thumping basslines to code. >_>
@Duikboot I don't know how someone could dislike jazz :p
I love jazz
played a long time sax :)
Sid
Sid
@Danack sorry, typo meant -1
12:05
wow
my bow then :)
haha
@Sid That's an ugly solution to the problem though
@DarkAshelin You'll probably like this:
@Duikboot damn on me ..i am listing wrecking ball :( tbh this is really better
Sid
Sid
12:07
@DaveRandom I don't like ugly solutions.
@Duikboot ah, nice sax sounds :p
http://stackoverflow.com/questions/19027555/i-want-that-if-a-particular-column-is-not-updated-in-update-query-it-should-retu
Miley cirus -_-
You hit me like a wrecking ball!
12:08
@tereško the paradox is in the decisions people make when they assume to know something. in this case, the distribution of balls in the urns. it's a matter of risk taking.
please, do not post videos too often (hide them in links)
Indeed
@DarkAshelin You have tastes. :D
12:12
Savant <3
I like good OST tracks
I heard yesterday an aawesome song in my car on spotify but I can't find it anymore ;(
argh
#FirstWorldProblems
I've got segfault in the middle of all those tracks that @DarkAshelin posted :p
12:16
@AlmaDoMundo I got a segfault too, let's blame @DarkAshelin
what did I do
as for segfault
@Sid I'm going to go with 3v4l.org/nlEOM as the best way I think.
which is the shortest PHP code that results in segfault? Which one you know? (whitespaces are irrelevant) :p
12:21
@AlmaDoMundo function f() { f(); } f();
segfault? no
fatal? yes
should do
Let's play some Freddie Mercury :P
@DaveRandom that will be a fatal (stack overflow)
guys why don't we make a music room plug.dj/creepy-pasta-2
12:21
not the segfault
@DaveRandom my approach is preg_match('%(.)*%', str_pad(1,1e9));
that'll hurt :p
[root@web01 ~]# php -r "function f() { f(); } f();"
Segmentation fault
@DaveRandom out of memory here: eval.in/50822
@Duikboot @Starsong join me plug.dj/creepy-pasta-2
@DaveRandom
php -r 'function f() { f(); } f();'

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65484 bytes) in Command line code on line 1
so as expected, PHP 5.5
5.5.3 that was. I may not have configured a memory limit though
12:24
$ php -r "function f() { f(); } f();" been running for 2 minutes on my box with no segfault :P
ups
and I mistyped
my is preg_match('%(.)*%', str_pad(1,1e4));
1e9 is too much for str_pad
@Starsong Maybe you're running a PHP version from the future with tail recursion optimisations
happy hannukkah
@AlmaDoMundo Just PHP_INT_MAX it, should work
12:26
@DaveRandom but PHP_INT_MAX is 11 symbols while 1e4 is only 3 :p
this one is nice: php -n -d memory_limit=-1 -r "function f() { f(); } f();"
@DarkAshelin Bit too chilled for writing asm :P
@hakre too long :p
but take care it will bring your computer down.
12:27
@Starsong it's Duikboot playing now
u can play songs too
my sample is 36 symbols without whitespaces
@JoeWatkins So, after doing some source code analysis I concluded that anon classes can only find significant application in testing
@ircmaxell how does photo sharing through glass work? Do you say: ok glass, take a picture and share it on twitter?
Tests are the only thing that use a non-negligible number of single-use classes that are not enumerative (i.e. excluding exceptions, nodes, compiler passes, types, ...)
I also know this: class A { function __destruct{ new A; } } new A;
12:29
@AlmaDoMundo str_pad certainly thinks it can handle PHP_INT_MAX
@Starsong do u see the chat in there?
@DaveRandom I know :p but program with PHP_INT_MAX will be longer than with 1e4 :p
since strlen("PHP_INT_MAX")=11
@AlmaDoMundo Oh I see what you mean. Just wondering why 1e9 wouldn't work
@DaveRandom ah.. no, that's not the question
I know, it was just an incidental
12:31
so my current length is 36 symbols for segfault
and I don't know shorter samples
but such thing as ini_set('pcre.backtrack_limit', 100000); will break a case :(
@DarkAshelin It stopped playing for me
@Starsong your song is playing now
@Duikboot come back
No sorry
@NikiC they don't have to be single use anymore ... that's the general advice, but they find their way into general development elsewhere there is no reason to think them unfit for the same application in php ...
next song is fun ;)
12:34
Ssorry nothing can beat this: youtube.com/watch?v=tDl3bdE3YQA
put it on in the room
This song gets good in a sec :P
still that's good info ...
That is, if you arent ahead of me :P
@JoeWatkins Almost weekend...
12:35
u gotta woop
think it'd be compelling to put that on the rfc, that they have an, identified, significant application in testing for PHP ?
@DaveRandom are you familiar with powershell?
do you see that pierre just asked for more use cases ?? do you see where I'm coming from that this is a bit confusing ??
@iroegbu I wouldn't claim to be good at it, but I have done a little, why?
@DarkAshelin Enough bass in this one? :P
12:36
not enough
I think we should keep the music-convo in the plug room
@Duikboot has been for a couple of days now :D
OK, I didnt see anyone chat there
I did :'(
@DaveRandom looking for a way set environment variables using it.
12:37
@iroegbu As in persistent ones?
I think we discussed use cases, what I meant to do just copy every case suggested from internals and github even if I don't agree with that pattern of design, that's stupid, this introduces a different pattern what you use it for is down to you ... grrrrr
BTW gratz and officially welcome to the group of circle jerks in here
@DaveRandom yes
@iroegbu You just need to stick them in the registry, you don't even need powershell, should be possible with reg.exe (never tried but I can't see why it wouldn't work)
No matter how hard you try, you will never be as cool as this duck http://t.co/nPckVCqf8D
12:39
@PeeHaa :)
@Gordon wow ...
Cool!
@NikiC I dunno if it's a good idea to mention testing anyway, everyone goes mad when you mention anything to do with testing and says it should be part of xdebug ...
@iroegbu What's the use case?
12:43
want to add ".php" to system variables
and path to php installation
@JoeWatkins huh, what do you mean? an anon class can be (by definition) only used in a single place, right?
-2
A: How to prevent direct access to php pages through URL

PeeHaaYou can not. What you want is simply not possible. For the server side there is no way to know whether an URL is typed or clicked.

Bitch please I'm trying to repwhore here
@JoeWatkins please don't forget that nobody actually reads the internals dicussions
if use cases are mentioned there, but are not in the rfc, it is likely that people will not be aware of them ;)
if you don't agree with an application, don't put it in. But if you do, it's good to have it in the rfc and not just the discussion ;)
Has anyone here worked with a MySQL database with > 1,000,000 rows in?
Or is that a bad idea itself
@JoelKidd Yes
12:49
@MadaraUchiha When you query, is it much slower than a db with 1,000 rows?
user895378
@JoelKidd I'm sure lots of people have. Is that your only question?
@JoelKidd Define "much"
Welllll let's say there's a DB with 2mill rows
And I need to get a single row by its ID
Can you give a rough time as to how long that will take?
I could still complete simple SELECT queries on a 7mill based on the unique index in under 0.01s
You just made my day
Thank you so much :3
12:51
Cheers
and I just got an email with a job interview omgmsdafaomsdfmasdf
:DDDDDDDDDDDD
thank you for your time :)
if anyone remembers this guy from the other day (yesterday?)
Congrats @JoelKidd
@rlemon just report him for spamming. dont talk to him
@rlemon LOL
12:53
lol his thought process is interesting
tl;dr
@rlemon block him
@rlemon lololololol
Did he just mention the number of followers he has?
yup :P
12:54
I am tempted to create a twatter account just for this :D
he can't be for real can he? xD
Robert "The Troll God Hater' It sounds like" Lemon
me2 @PeeHaa
lol
He has a valid point about Canada though :D
12:55
:( He has moar followers than me
for good reason, he cracks me up ahaha
Well that and I only poast about ponies :P
And sometimes barge into discussions about American politics
Hello
anybody that know uploadify
?
Don't ask whether someone is here to help you. If someone is around and wants to help they will.
Just ask the question.
12:59
@MuneemHabib The serverside of uploadify?
i want to know the method how to upload folders through uploadify?
I once put my name as "Fab The Great" on a history paper. I got a bad grade and the teacher wrote:
"Fab The Great"
        ^
     Not So
@PeeHaa is there any way to upload folder to server through uploadify?

« first day (1076 days earlier)      last day (4098 days later) »