« first day (557 days earlier)      last day (4406 days later) » 

5:01 PM
hmvc?
 
the controller can call other controllers hierarchical
in my tiny framework the template engine emulates that with xml tags, hmvc should be a cleaner way for such functionality
@Truth to give some examples think of page areas for latest articles, a login box or something similar that is not directly attached to the main content and how such parts are handled
 
I see
 
when i iterate over an array with object wihich has private properties. How can i get the value of thos properties? Do i need to each time instantiate a project?
 
@sanders I didn't understand the question.
 
when i iterate over an array with object wihich has private properties. How can i get the value of thos properties? Do i need to each time instantiate a object?
 
5:12 PM
well use __get or reflection depending on the use case of it
if i understood that question right :>
 
@sanders I still don't understand the question.
 
hello, you guys there?
 
Either get a dictionary or give us some code to work with!
 
@quinestor no we are hiding from you :D
 
:)
 
5:15 PM
 
I .. have a dumb question, how do I set my avatar? The page sends me to gravatar and there I already set a picture * also out of topic question
 
sorry for my bad english skills
are gravatar and stackoverflow using the same email adress for your account?
 
@quinestor Your email address on SO should match the one on Gravatar.
 
is your gravatar picture set for that email adress, too?
 
no
 
5:16 PM
both should match
 
hmm that's inconvenient
ok thanks I'll try that
 
 
one gravatar account can use many email adresses
so there should not be a problem at all
just attach your stackoverflow mail adress there
and make sure it uses a picture, too ;)
 
sure
btw are you having fun here? come to help or to sak for help ?
:)
 
@Truth "no we are hides from you" sounds strange i think or how was your suggestion meant?
 
5:19 PM
voila look at me
 
@quinestor @quinestor wat, that makes no sense what-so-ever
 
hmm what?
 
@quinestor Takes a while until it gets here to chat, but yeah
 
yes :)
 
having fun should break some law :P
 
5:20 PM
haha
 
 
so, you are skilled in PHP?
 
@quinestor I'd like to think so.
 
@quinestor, @Truth is a nub =P
 
i'm more skilled in counter strike global offensive
 
5:20 PM
<-- bf3 here
 
who knows you may be a killing machine there
 
TF2
 
I hate those games I get killed the same sec I spawn
 
its because you suck.
 
Bunch of 11 year old's here slamming 9gag all over the place. Pff.
 
5:21 PM
@Chris Sorry dad.
 
i'm nearly 28 cmon!
 
and "what next" in your programming skills? since php is becomming less popular
 
I'm nearly 40.
Nearly means nothing.
 
lol
 
Nearly is not a defined amount of time.
 
5:22 PM
we are all obviously adults
 
Speak for yourself.
I'm still a minor in some countries.
 
i consider myself a child in an adult body.
 
i'll stick with php for the rest of my life
 
countries you won't visit anyways
nice
 
how do you know that?
 
5:23 PM
In the huge and all mighty U.S an adult is who's 21. I'm 19.
 
for all we know @Chris has visited most countries on this spehere
 
I've only visited two. Latvia and Finland.
 
@quinestor I have Java in my arsenal. Also learning Node.js
 
I hate traveling.
 
you can go and kill in the middle east anyways
 
5:23 PM
and your home country
what the hell does that have to do with php?
 
Home country doesn't count, it's barely a country anyway.
 
@Truth so Java for the future?
 
again, refer to my troll meme above
 
Any country with less than 2 million of population should be nuked.
 
reputation ?
ah
 
5:25 PM
Because those countries are useless in the global scope.
 
@Chris Does that include the Gaza strip or not?
 
that's because you are so humain? only nuke small countries?
 
@Truth I have no idea what that is, but for save I'll say yes.
 
all good programming languages start with p IMHO ;)
 
human ^_^
 
5:25 PM
Small countries are leechers, they don't give shit back and therefore should be nuked.
 
does anybody else not understand a word @quinestor is saying lmfao
 
Think global, not local.
 
@Chris remind me how old are you? :o
 
15
 
The Gaza Strip ( , ) lies on the Eastern coast of the Mediterranean Sea, within the Middle East (at 31 25 N, 34 20 E). The Strip borders Egypt on the southwest, 11km long, and Israel on the east and north, 51km long. It is about long, and between 6 and 12 kilometres (4–7.5 mi) wide, with a total area of . It has a 40 km coastline onto the Mediterranean Sea, but has no maritime claims due to Israeli administration. The territory takes its name from Gaza-city, its main city and administrative center. The Gaza Strip has a temperate climate, with mild winters, and dry and hot su...
 
5:26 PM
@Mike it's my dialect
you said you're 19
 
2+2+2+2+2+2+2+2+1
 
what you did there, i see it.
 
@Truth to get back to topic here: strip is marked as deprecated since php 5.3
 
XDDDDDDDDDDDDDDDD
 
I think I missed one 2
 
5:27 PM
while(count<16) do {count++}
 
From now on, that's my prime argument against Gaza :D
 
:(
 
I hate math.
 
math reciprocally hates you ^_^
ok thanks for the tips !
 
@Truth was just a joke ;)
 
5:27 PM
thanks @Chris for turning me onto 9gag.com
you have officially began the company paid time wasting
2
 
No problem, hope you enjoy losing brain cells.
 
@mUnk3y , you just lost quite a lot point in this channel
 
"Windows 8 will check to see if your computer can run Windows 8" - Bitch please.
 
what do you see when looking thru 8 windows? 7 other ones nested?
 
Windows jokes are not funny anymore, just letting you know that you need new material.
 
5:31 PM
let valve bring steam to linux as they announced it yesterday and i stop using it quite soon ;)
 
@Chris , in windows mod community that translates as "who first can make win8 run on i486 ?"
 
Also, according to microsoft's windows 8 tester, I have a processor of 1ghz .. which is false.
@tereško lol
Everything?
 
@Christian hmm?
 
@Christian , full moon ?
 
My last two answers fixed all of the OPs' issues yet I don't get half a point, let alone selected as the right answer.
 
5:34 PM
As a said, Everything.
 
Other guys either copy my answer or only cover one of the major issues in the OP's code.
Fuck it, I'm off walking my dog. At least he doesn't complain when I feed him. W.T.F
 
we need a stack copyright act here
 
lol
ok ... this one is just sad :
1
A: the right post variable

powtacMuch better for debugging and finding the correct variable would be to use <?php echo '<pre>'; var_dump($_REQUEST); echo '</pre>'; to see which variables arrive at your script. Spoiler: this will be the answer: echo $_POST['action'];

 
Why <pre> var_dump()? Is he an idiot?
 
his next question might be "the left post variable"
 
5:37 PM
1 message moved to bin
 
Next answer he gives is probably that the correct mysql query is mysql_query("INSET INTO who_cares ('thing') VALUES (".$_GET['thing'].")");
 
why not $_REQUEST['thing'] ? has more possibilites "open"
 
he's using Joomla...
 
@ircmaxell you seem to really like joomla :)
 
5:40 PM
@Chris So that what you are outputting is properly formatted and easier to read
 
@Hajo I do?
 
But, doesn't it have obvious SQL injection?
 
@ircmaxell do i get kicked from the channel if i say yes?
 
No
@GlitchMr yes
 
Also, INSET?
 
5:44 PM
whatd i miss
 
But I guess it's just mistake while typing
 
inset = incest?
 
insert
 
Not PHP, but relevant anyway
user image
2
 
who cares about sql injection, php got magic quotes :>
 
5:45 PM
@BoltClocksaUnicorn that is awesome.
 
Magic quotes were removed in PHP 5.4
 
ZING!
 
@BoltClocksaUnicorn I miss the "How to represent God in code" post. That was epic. Unfortunately we can't search deleted posts
 
i thought there was an app to show you deleted posts
 
@GlitchMr you're ruining even my unfunniest jokes
 
user895378
5:46 PM
I need to repwhore up so I can view deleted posts
 
I can see deleted posts (20k+ users can), I just can't search them
 
YES!!!
 
oh i wish i could see that lol
 
@ircmaxell Are you able to use the deleted:1 search option? Not sure if that's available to 10k users or only mods
 
5:48 PM
@Mike Me and you both
 
@ircmaxell post a screenshot of that answer
im dieing to know lol
 
@BoltClocksaUnicorn Lol awesome! link?
 
I want to, but have to run to a meeting
brb
 
@Truth You mean to that question?
 
yeah :D
 
5:49 PM
The last delete vote was from Eric Lippert... not sure if I should feel honored or something
 
is that a famous person here?
 
@Hajo Not here. Famous among the Microsoft people, though, he is.
(I linked to an ASP.NET question)
 
@BoltClocksaUnicorn Heh, I would be impressed if it were Jon Skeet
But that's awesome :D
 
Shame 75% of my daily rep came from that post alone and was taken away so quickly
 
vote to reopen it ;)
 
5:52 PM
15 votes up?
And deleted?
 
@GlitchMr And deleted.
 
so if i offer a bounty up for a question and i dont get an answer that helps..
what happens to the pts
 
Points disappear in void
 
they should go back to you after those 7 days
but i'm not sure
 
@Hajo No they won't.
 
5:54 PM
they fade away
into the nether
 
115
Q: How does the bounty system work?

A. Rex What is a bounty? What is the "Featured" tab on the homepage? How can I search for questions that have a bounty attached? How do I start a bounty? When can I start a bounty? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? What happens if there's no ...

 
like some sort of reputation absorbing black-hole
so pts go to someone essentially
or to the nether
 
but never back to the giver.
 
Stack Overflow has more black-holes
 
5:56 PM
what about opening a bad bank for bounty points ^^
 
@Mike Not automatically at least... mods can give it back if a bountied question needs to be closed or for whatever special reason
and the bounty hasn't been awarded yet
 
@BoltClocksaUnicorn Is it ok to close a question as a dupe of a closed question (when there is a great answer for OP in there)? I tried searching on meta, but couldn't find it (I'm pretty sure it must be there somewhere)
 
For example if you are downvoting answers (but not questions).
Everybody loses reputation.
 
@RepWhoringPeeHaa Should be fine.
 
5:59 PM
hey @BoltClocksaUnicorn can you divide by zero?
 
@Truth you dont need a webserver
 
@Mike That ability is reserved to Chuck Norris and Jon Skeet.
@RepWhoringPeeHaa Of course you do! To run PHP scripts?
 
php from command line?
php gtk?
 
@Truth no you dont
cli e.g.
:)
 
updated my answer.
You're right.
 
6:02 PM
tnx
 
@Mike: I think it was making E_WARNING last time I checked.
 
you repwhore ;)
 
This is why I like JavaScript and Perl 6.
 
@Truth Exactly.
 
:)
 
6:04 PM
why is bolts nick colored blue?
 
@Hajo ♦
 
@Hajo Moderator
 
@Hajo He's a smurf?
 
user895378
I'm going with smurf
 
6:05 PM
@Hajo It's like ircmaxwell's name is italics, because he's the channel owner.
 
huh his name is?
 
thanks for the answers
 
yup it is :D
 
It's in the chat FAQ somewhere...
> [Wondering who is who? Moderators are displayed in color, room owners in italics. ](chat.stackoverflow.com/faq#room-users)
.. formatting
 
@BoltClocksaUnicorn they told me blue = smurf, that's not in the faq
 
6:08 PM
@Hajo Unicorns are not smurfs
 
unismurf?
2
 
the faq mentions xmpp support for this chat, would be a nice feature
 
@hakre can you upload the cv plugin somewhere on your server so I can test automatic updates?
 
@RepWhoringPeeHaa smurfcorn sounds even nicer i think ;)
 
smurfcorn it is :)
 
6:24 PM
Hiya - I'm so stuck it's sad. I want an 'else' echo "email not in the database" after the while here... pastebin.com/3qav6Gh7 (I'm not sure how to add the 'if' before the while or if it's necessary)
 
huh? @Commandrea
 
should I show more code?
 
else comes after if. not after while which is a loop structure
 
I'm going to update the code.. brb
 
anyone knows some nice things on how to reduce php memory usage? does it e.g. help to turn off some more extensions?
 
6:28 PM
@Hajo why do you want to do it?
if you have issues try to find the bottleneck instead if just removing stuff
 
ok- so I've got a select and update query going on-- if the user doesn't enter an email that's in the system, I'd like an error 'email not in system'... if it is then it echoes their data on the next page
I'm not sure where to add the if statement as I'm not sure what I'm checking to see is affected
whether it's the select or the update...
 
@Commandrea 1 sec
 
But otherwise, PHP doesn't really use so much RAM
 
@Hajo do less stuff ;)
 
6:31 PM
@zombor or just don't buffer everything ;)
 
Well, DOM extension abuses RAM, but I guess that's because of circular references. And gc_enable() helps with it.
But otherwise, for me PHP was using 2MB of RAM max.
 
hehe its just that apache bench hits the memory limit on the machine in some configurations in php 5.3, with 5.4 it looks a bit better
just trying to optimize it a bit
the php scripts should be fine
with 750 KiB each
 
That's perfectly normal
 
it's a completely generic and unanswerable question
 
@Commandrea after (trying to do / ) doing the update do:
$num = $stmt->rowCount();
 
6:33 PM
[glitchmr@empire ~]# php54
<?php
echo memory_get_usage();
^Z
123640
Other programming languages are way worse in RAM usage.
 
if $num is greater then 0 the mailaddress exists in table
 
:) thank you-- trying now
 
(also, it returned 322992 for me in PHP 5.3, so try to update PHP if you can)
 
@GlitchMr i just speak about peak usage or which memory value would you prefer for measurements?
 
optimizing for optimizing's sake isn't useful
 
6:35 PM
If your scripts use 2MB it's not bad. Trust me.
 
umm ok
 
yeah, 2mb is really tiny
 
Even 10MB is not that bad with modern devices (please note that your PHP script usually runs for short time).
 
sure it does, but everything is always loaded and thrown away
 
@zombor +1 to that. I would call it rather harmful
 
6:36 PM
if your server has 4GB ram, each script takes 10mb, thats a crap tons of room before you run out of memory
 
you know whats funny, php servers which have their limit cranked up to 1.5gb, and still reaching it
 
Trust me, nearly everything else (except of C and C++) uses more memory.
[glitchmr@empire ~]# node
> process.memoryUsage()
{ rss: 10076160,
  heapTotal: 6114816,
  heapUsed: 2124556 }
>
 
my fail i've found and read kegel.com/c10k.html maybe
 
@zombor except PHP is not the only thing that runs on the server
 
@Commandrea yw
 
6:40 PM
add in 30+ mb per script if you're using mod_php
 
30MB... why?
 
@RepWhoring I'm using mysqli-- finding that rowcount is for PDO, I should use num_rows
 
the apache child
 
That's a lot
 
@Commandrea sorry I'm getting blind on my age ;)
 
6:41 PM
@ircmaxell whats with nginx + fcgi?
 
and that's one reason I don't use Apche
 
That's insane.
 
whatever! I wouldn't have known that--
 
@ircmaxell have you tried 2.4?
 
@RepWhoringPeeHaa Nope... I have no need for it
 
6:43 PM
@RepWhoringPeeHaa Okay- I'm getting the echo "Email not in system" when it is in the system.... (updated pastebin) pastebin.com/3qav6Gh7
 
@irc nginx / iis?
 
checking to see if it still updated in the db
 
30MB for module which practically only calls PHP.
Do they think that you have 1TB of RAM to waste?
 
how to avoid those 30mb per child?
 
@Hajo: Use other server
 
6:45 PM
well my testing servers contain nginx, iis, apache and lighttpd, but online i have to stick to apache with any mpm
currently prefork
 
@Commandrea I think it is $num = $stmt->mysqli_affected_rows();for mysqli
Not sure though. Maybe @ircmaxell can confirm?
 
@GlitchMr which server do you prefer?
 
Some server which wastes less memory.
 
@ircmaxell of course. just a simple example
 
6:50 PM
@GlitchMr well that comes at a price :/
 
my point is pre-optimization is bad ;) is there an actual problem going on?
 
nice penalty by c. ronaldo
 
I would try either lighttpd or nginx.
 
@RepWhoringPeeHaa NginX
 
@GlitchMr thanks again but turned out that gc enable had nearly no effect. disabling some more php stuff helped a little bit. i should quit searching for improvements on that area :)
nice goal again by c. ronaldo
 
7:00 PM
Do you need to optimize stuff?
And by need I mean 300MB of RAM usage?
Longer scripts will use more memory, that's obvious.
 
just wondered where the ram was gone, script execution times are below 0.1 sec after cache is full set up
 
21
Q: PHP memory profiling

JW.What's a good way to profile a PHP page's memory usage? For example, to see how much memory my data is using, and/or which function calls are allocating the most memory. xdebug doesn't seem to provide memory information in its profiling feature. xdebug does provide it in its tracing feature. Th...

 
thanks but i think the problem lies in apache
i'm still student at university, its about hobby and opensource projects. just don't want to rearrange all the servers. nginx on top with apache and tomcat instances below work fine for now, but a slashdot effect would probably kill everything
 
@RepWhoringPeeHaa I'm currently working from a remote location let me see what I can figure out.
 
7:28 PM
@hakre great
@hakre lemme fix the version
 
hey guys, has someone example code how to implement a restful api with oauth and how to register a user to use this api?
 
i cant find a solution :(
 
@viperneo sorry don't have that much experience in doing it, but I'm pretty sure there is an answer somewhere in that search :)
 
@rep
 
7:42 PM
?
 
@RepWhoringPeeHaa still at it over here. Trying different methods- no luck w/ the affected rows thing...here's where I'm at: pastebin.com/3qav6Gh7
WHY can't I just do if ( while { else {echo "no email, you suck"}
without row counts and all that hoo hah
 
@Commandrea because that's a syntax error
 
@Commandrea if you don't know why you can't do that then I suggest you stop trying things that are over your head and start with more basic exercises. Then come back to it when you grasp why
 
I just meant the order of ops on that
 
@Commandrea Your if() statement is likely always true because the $db-prepare() call is successfully preparing your statement.
 
7:50 PM
@Commandrea why can't you do something like:
<?php
$db = new mysqli(" ", " ", " ", " ");

if ($db->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}

$stmt = $db->prepare('UPDATE volConfirm SET confirmed = "YES" WHERE email = ?')
$stmt->bind_param('s', $_POST['email']);
$stmt->execute();

if ($db->affected_rows > 0) {
    while ($stmt->fetch()) {
        // construct your output here using $row to access database record
        echo "<h2>" . $agreeName . "</h2>";
        echo "<p> You have been assigned as a volunteer for:" . $position . "</p>";
 
PDO! PDO! PDO!
 
no i'm not <.<
 
If any of you rock php's curl functions, please check out my question at
http://stackoverflow.com/questions/10322646/how-does-one-post-a-binary-file-stored-locally-using-php-curl

Thanks!
 
@rlemon huh? what?
 
shouldn't one use try / catch while creating a db connection to hide its details?
 
7:52 PM
@joadha looks like you a;ready got an answer on that
 
@Hajo What if the API you're using to connect to the database doesn't throw exceptions?
 
@RepWhoringPeeHaa i just like chanting PDO!!!
 
@CharlesSprayberry poor api, pdo pdo pdo! ;)
 
That's not chanting, that's shouting ;)
 
no.. it's chanting.
<shout>PDO</shout> <- that is shouting.
 
7:54 PM
they should at least deprecate the old mysql extension in 5.5 or so
 
I know now that I should focus on learning PDO vs MySQLI (too late for this particular project) --
 
@Hajo You know PHP and BC
 
@Commandrea I'm not saying you're wrong but why do you think that?
 
@RepWhoringPeeHaa checking this out...brb-- And the answer is (Because I don't know wthI'm doing obviously :) )
 
7:55 PM
@Commandrea no need to focus on pdo (unless you are going to access multilpe different database drivers) when mysqli works for you
 
@RepWhoringPeeHaa 5.4 breaks BC for some bad stuff already and thanks for the mysql ext note, didn't know it is already planned
 
@RepWhoringPeeHaa because over the last 56 hours that seems to be what everyone is saying... that's it's easier that mysqli, that it makes more sense/cleaner, etc
 
if you don't KNOW why you should be using it, i'd suggest using mysqli
 
The thing is I am the girl friday around here- I tend to do a lot of learning on the fly and not ABC...which would be luxurious
 
no need to make excuses to me :] i am just trying to give you pointers on how to be more effective.
 
7:58 PM
Thanks everyone!
 

« first day (557 days earlier)      last day (4406 days later) »