« first day (1012 days earlier)      last day (4162 days later) » 

08:00
i need to sleep
asking question is really badge whoring stackoverflow.com/users/45261/prashant
I have this code: codepad.viper-7.com/ouwCTb instead of dash in the calendar I want to show the dates form previous and next months. Can anyone please help me to fix the code so that it start showing dates instead of dashes.
Why do people keep using undocumented properties? :|
0
Q: PHP DateTime() date issue

Rajesh Vishwakarma$now = new DateTime(); print_r($now); print $now->date; // print the current date BUT if print_r($now); is comment it show error ? $now = new DateTime(); print $now->date; // Notice: Undefined property: DateTime::$date in

@NullPoiиteя not understand what you are saying, did I asked any wrong questions? I am not asking questions for badges or reputation.
08:04
@Prashant i mean ... i want that much badge ... :P
ROFL
how do you know that not destroyed? — Akam 28 secs ago
@NullPoiиteя Ohhh :)
@PeeHaa I think this is actually quite natural.
As you play with DateTime you want to know what's inside right? So you do print_r() and tada!
@Jack No not really. If I want to know how a built in class works I use the documentation
@PeeHaa Because everybody knows that print_r() is superior to the manual to determine what properties an object has.
08:07
And then it suddenly disappears .. oh gawd, there must be something wrong with php ... there is, it's just not this :)
@PeeHaa You use documentation, exactly right.
@Jack :-)
@salathe :P
@salathe In this case it really is superior hehe
@Jack Exactly! And we all know how useful it is for SimpleXML objects. :D
You don't print_r() SimpleXML, SimpleXML print_r()'s you!
Does anyone use git or more precisely github? I can't seem to find the find the issue tracker to create a issue for my repo
08:09
@Zigu Most of us do
@Zigu You have to enable it in the admin section of your repo
https://github.com/yournick/yourrepo/issues
@salathe Isn't it enabled by default?
it wasn't enabled by default in my repo. I kept typing /issues but got a 404 error
ah k
thank you very much. it works like a charm now
08:12
hi is any one there to help me, that how to get calendar events in php using RSS Feed or any other way?
@PeeHaa yes it is
Can anyone please help me in this questions: stackoverflow.com/questions/17828133/…
@Prashant Have you tried debugging it/
@PeeHaa what the hack is debugging ? ... its pretty bad thing to suggest ..it could kill a developer ... :P:P
@NullPoiиteя :D
08:16
monring
@PeeHaa Yes, I did and the cod eis working ok for current month dates, but how to fetch the exact dates of prev month?
@LeviMorrison If / when you are going to add the edit button on the php.net man pages could you also make it a bit more clear without being obstrusive?
morng @HamZa
how to get calendar events in php using RSS Feed or any other way?
08:19
@Crazy4Php By programming it
^ that
@PeeHaa: yes
Hey everyone!
@DaveRandom @salathe For what is <modifier> used in php docbook?
@PeeHaa visibility... public, private, protected
@PeeHaa Howdy! Appu != Apu
:P
@salathe Thought so. tnx. Let me burninate this:
-    <modifier>public</modifier> <type>int</type><methodname>IntlDateFormatter::parse</methodname>
-    <methodparam><type>string</type><parameter>value</parameter></methodparam>
-    <methodparam choice="opt"><type>int</type><parameter
-    role="reference">position</parameter></methodparam>
+   <type>int</type><methodname>IntlDateFormatter::parse</methodname>
+   <methodparam><type>string</type><parameter>value</parameter></methodparam>
+   <methodparam choice="opt"><type>int</type><parameter
:)
Why would the modifier be removed fgrom taht?
08:26
default public?
@PeeHaa If that's from the online editor, it's probably accidental
@HamZa m0rning .... :)
@salathe It is from the online editor. Define accidental. You mean OP removed it by accident?
How does one remove things like that by accident?
@PeeHaa sometimes the XML being edited in the editor is out of sync with the latest commits, so if someone added that modifier in at some point after the person started editing the file then it will show in the diff... I'm not saying that's definitely the case here.
08:30
@salathe kk will just burninate the edit and fix the thing. tnx
I sense that today is RTFM day !
mornings
@DaveRandom jo
@PeeHaa the modifier was only added to the docs around a month ago, for IntlDateFormatter::parse in r330543 :)
@salathe aaah kk
08:33
^ let me clean that up for you - dupe suggestions on a new and an older one.
One last question for today @salathe :) Can I just close this thing now: bugs.php.net/bug.php?id=64612&edit=2 ?
Top of the to you all
mon to ring yo @Jimbo
08:39
Hello
@Gordon Never heard of it / seen it :| Do I suck?
i want to ask about developing php with net bean, is it better or... ?
@SabilValdano ow yeh. Much better...
Am I doing something wrong here ? because for some reason it wont return anything
			// Result Query
			$this->result = mysqli_query($this->connection, sprintf("SELECT * FROM $this->table WHERE id = %s", mysqli_real_escape_string($this->connection, $id)));;

			if($this->result) {
				return mysqli_fetch_assoc($this->result);
			} else {
				return false;
			}

		}

	}
@PeeHaa no idea. Haven't seen it either. But yes, you suck ;)
08:42
@Tredged why don't you use prepared statements o_O ?
@Gordon :-D <3
Because it has to be like this
@PeeHaa is there a code completion ? like vs does with its c# :P
@PeeHaa Yes!
Some people are just so stubborn to do the right way
08:43
@SabilValdano asking whether something is "better" requires you to put something you want to compare it to.
@SabilValdano also, ending a question with "or …" puts people's mind on the "or" and the likelihood of them deciding that it is indeed "or" is much higher.
sorry @salathe :( I need you :P
> ERROR:
The password you supplied was incorrect.
@Jack you forgot a + in the first \w :)
@Mr.Alien #select_a_boundary.dataset_select2 is not easier?
@HamZa Did I?
@PeeHaa Use the "Developer" tab
@Jack (\w):(\w+)
@Jack LOL I just credited you :p
@Gordon oh ya , i forgot to tell, i usually write PHP Code in Notepad ++ and later this week i do smoe research about other php editor, and found net bean quite interesting
0
Q: Turn on the link hover statusbar in Google Chrome

hakreI want to turn on the feature where whenever I hover over a hyperlink and in the bottom lefthand corner it shows a light blue hover tooltip about where that link goes. It looks like that since some days this earlier always-on feature is missing (Compare "Turn off the link hover statusbar in Goo...

@Jack technically you don't even need to select the class, id is unique, that is more than sufficient
@Jack A more hackish way is to use [^\W_] , note the uppercase. This will match a-zA-Z0-9 :)
08:48
@HamZa Well, his example only uses a single letter before colon.
@Jack ah lol, let's hope he won't have more chars :p
@HamZa That's not really hackish actually.
@Mr.Alien why did you edit away the // in the question?
@SabilValdano it depends on what you are looking for in an IDE. Netbeans is good. And it has more features than Notepad++ but if you don't use these featues, you don't need Netbeans. With that said, I like PHPStorm better than Netbeans, but that's just personal preference. The best way to find out if Netbeans is for you, is to try it. You don't have to use one. I know people who do all their coding in VIM.
@Jack well no, but I found it a smart solution :P
08:49
How did you turn it off in the first place? I didn't know that was possible. — Madara Uchiha 12 secs ago
@salathe Wanted to focus the code without the grey commented one
@Gordon i thought phpstorm is much interesting, i look some IDE for PHP like Visual Studio :p
@MadaraUchiha I have no ef c'k'ing clue.
@Mr.Alien But... it drastically changes the meaning of the XPath
@SabilValdano You can use Visual Studio for PHP if you really wanted to :)
@hakre It's surprising to see how many times you see someone struggling with a split when they need a match :)
08:52
@SabilValdano Zend Studio, PHPStorm and Netbeans are all quite good when it comes to IDEs. But like I said, you don't have to use an IDE. It depends on how you work.
s/Zend Studio// =P
@Jack there is no better IDE if you are using a Zend Stack
        $reflectHaxx = new ReflectionObject($this->attributes['file']['File']);
        $parsHaxx = $reflectHaxx->getProperties();

        foreach ($parsHaxx as $p)
        {
                $property = $reflectHaxx->getProperty($p->name);
                $property->setAccessible('true');
                ${$p->name} = $property->getValue($this->attributes['file']['File']);
        }
Don't go protecting properties unnecessarily -.-
@rdlowrey Poor. I know this without testing, @Danack, because the class model you are using in JS is even more of an anti pattern than the one I shall be implementing in a pull request you shall be receiving shortly :-P
@Gordon Perhaps, but I find that on too many occasions do I need to open the source file myself or copy-paste the method names, it's really irritating. Storm gets it right away.
@Jack which proves my point that it depends on how you work and what features you need in an IDE ;)
@Gordon I can't live without code assistance, I'm just too disorganized to remember everything lol :)
Otherwise I would stick with vim haha
08:57
@salathe yea, thanks for pointing that out, bolt explained me, I thought that the main code was commented
Thank you very much for down voting..... — Abdul Basit 2 mins ago
Is there a way to determine whether an array is indexed or associative without iterating it? (and by indexed I mean contiguous int keys staring from 0, anything else is associative)
if (isset($arr[0]) && isset($arr[1])) {
:D
@Jimbo lol
Very funny :-P
@Mr.Alien: I don't see why you see the need to explain yourself. The downvote is justified. The question is badly formatted, and lacks research effort. You should shape up, edit the question, and it would be nominated for reopening. — Madara Uchiha 34 secs ago
09:00
@DaveRandom found this:
function isAssoc($arr)
{
    return array_keys($arr) !== range(0, count($arr) - 1);
}
...The hell are you talking about? — Madara Uchiha 8 secs ago
Am I missing anything here?
Or did he just went full retard?
3
@Jack vim with the right plugins can do almost anything IDEs can do
@Jimbo That's iterating the array twice (three times? IIRC count does a full scan to check consistency as well), and creating another array of the same length and iterating that in full as well. Even I can think of a more efficient way than that, array_values($arr) === $arr
@MadaraUchiha just replied, will get back to u in a while, off to lunch.
Ahh, I thought count would do something like that
09:02
morning all
@MadaraUchiha It's not complete nonsense.
@Jack See my newest comment on the same thread. The way he phrased his answer wasn't clear.
lol
@DaveRandom then what is wrong with array_values ?
@HamZa That approach also does two full iterations of the input (one for the array_values() call and one for the compare op)
09:08
@Gordon got it. because i need something that could help me on debugging apps
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 742230985 bytes)
Memory limit is on 1024M
@SabilValdano have a look at xdebug then
why its still having troubles?
@DaveRandom not sure if that is then even possible ....
@Tredged epic
What the hell are you doing?
Ow wait, It's GD isn't it
09:09
^ that lol
@Tredged Because you tried to allocate 7GB of data?
Actually it's only ~700MB
Yes but where comes that data from
lol, only
@DaveRandom Yeah, missed an order of magnitude there.
09:10
@Tredged Are you doing image manipulation with image* functions?
Bleh i figured that already
No lol
Then what are you doing?
Running a backup
Right, well it sounds like you are buffering entire files in memory then
Which is a monumentally bad approach to that
@DaveRandom Hmm
@DaveRandom You know any good backup script or anyone?
PLB
PLB
09:12
@DaveRandom I guess you can't avoid iteration. The most optimal way I can think of is to search any key that violates your definition of indexed array.
@PLB Yes that's my favoured approach too. But for a large indexed array (or an array that doesn't fail until a long way through) that's still horrendously inefficient
@Tredged No, but take a look at stream_copy_to_stream()
:-(
Y U NO LINKIFY?
Thanks once again :) @DaveRandom
@Tredged The important thing to avoid (and I'm guessing what you're doing at the moment) is file_get_contents()
now it works
Yes I use file_get_contents
PLB
PLB
@DaveRandom Devide in chunks and check them asynchronously?
09:16
Right, well that reads the entire file into memory. stream_copy_to_stream() copies from one file pointer to another - so you open $src in read mode an $dst in write mode and just attach them to each other, it uses barely any memory and may actually be slightly faster as well (depends on your hardware and well ordered your HDD is though)
@PLB You wouldn't gain anything, none of those calls are blocking, it's just a mem check
but the file is maybe
1-2mb lol
@DaveRandom I wonder if it's optimize to use sendfile() =D
@Tredged Well it isn't. You tried to file_get_contents() a ~700MB file...
To the LXR machine!
Answer: nope!
lolz
@Jack you've done stuff with arrays inside zend haven't you? I'm sure I saw something you did with array_column()?
09:20
@DaveRandom Yup yup ... array_column() isn't mine though :)
I've written a patch for array_filter().
I was just wondering if there's any internal difference between an assoc and indexed array?
There are ... but not in performance if that's what you mean.
Ideally I'd like an O(1) (or at least less than O(n)) way to determine whether a given array is indexed or associative
Hmm, pondering ...
23 mins ago, by DaveRandom
Is there a way to determine whether an array is indexed or associative without iterating it? (and by indexed I mean contiguous int keys staring from 0, anything else is associative)
PLB
PLB
09:21
@DaveRandom If you have control how arrays are created. You may want to implement ArrayAccess and Iterator? So you can be sure it will be indexed and no check will be necessary.
^^ I'm assuming that's the zend engine definition of indexed?
Like a "proper" array in C
@DaveRandom Oh that; no, that's not possible.
@DaveRandom You can do approximations: end($arr); if (key($arr) == count($arr) - 1) { ... } maybe?
@PLB This is for analysis of arbitrary code, so while that's generally true it's not in this case
09:23
Alternatively, use ArrayObject to control items going in.
@Jack No I need something fool proof, unfortunately
@DaveRandom I'm guessing you don't want SplFixedArray either? :)
All nice, but not useful for arbitrary code
SQL errors are really unfriendly...
I'd never need this in the normal way of things, I'd just know what I wrote :-P
09:25
@Mr.Alien Misunderstood is what I would go for.
Right I need to go do some real work, ttfn
@Jack if you use the console, it will throw you have an error in ur sql syntax, come on, tell me the real thing that causes...
Queuing "Beethoven's Sonata 17" ... time to get some work done :)
Guys, in PHP 5.3's ternary, when you do ?:, does this mean if the condition is true do something, or if it's false?
Can't remember - which side?
@Mr.Alien Use Postgres.
09:27
@Jimbo the latter.
@Jack Cheers
@Jimbo COND ? TRUE : FALSE
@MadaraUchiha I'll try that ;) any diff in the syntax?
Yeah, in order for ?: to do true, I need !COND ?: TRUE
@Mr.Alien Not much, but some.
09:28
@Jimbo NO.
@Jimbo COND ? TRUE is enough.
@MadaraUchiha cool
Converting this: $msg = is_array($msg) ? print_r($msg) : $msg;
Would become...
$msg = !is_array($msg) ?: print_r($msg, true);
The two arg ternary $var = $var ?: 'default'; is like if (!$var) { $var = 'default'; }
@Jimbo if (is_array($msg)) { print_r($msg); }.
09:29
@Jimbo $msg = is_array($msg) ? print_r($msg)
@Jimbo No.
Just a note, print_r does not return, it echoes
So you may want to use something else.
@MadaraUchiha It does return ... 1
@MadaraUchiha Added true ;)
09:30
Yeah, well, not the formatted array...
@MadaraUchiha You better believe it :)
Hmm
You can use print_r's second parameters though
@Jimbo It still won't work. $msg will be false if the input isn't an array.
print_r($array, true) will cause it to return, rather than output.
PLB
PLB
09:31
@Jack AFAIK returns true not 1.
@Jimbo What is that supposed to do in the first place?
Hey guys I just started learning about reqrite rules and conditions.. I'm just confused about this (generated by a plugin):
RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/wp-admin
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/wp-login\.php
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/login
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/admin
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/register
RewriteCond %{QUERY_STRING} !^62cvp4t6bycl3qa23s0ui
RewriteCond %{QUERY_STRING} !^action=logout
RewriteCond %{QUERY_STRING} !^action=rp
RewriteCond %{QUERY_STRING} !^action=register
The long of the short of it is STOP USING GOD DAMNED TERNARIES FOR EVERYTHING
7
@DaveRandom only the god damned or all of them?
@PLB Right, I was confused with print :)
09:32
Shouldn't that code only rewrite if ALL those conditions are true?
$msg = array('OMG', 'AN', 'ARRAY', '...', 'WIZADRY');

$msg = !is_array($msg) ?: 'its an array';

var_dump($msg);
That prints "it's an array" - just tested, is what I want :P
@Gordon All of them are god damned.
^^ that
@DaveRandom What's wrong with ternaries?
@BillyMathews doesn't make sense what you say ...
09:32
@Jimbo Yes but it's it's not an array it will be false.
@DaveRandom OHHHHH
@DaveRandom nah. only the nested
@DaveRandom Riiight, I get you now!
@Jimbo Well, then if (is_array($msg)) { $msg = "it's an array"; }.
@BillyMathews Readability, and in PHP complete counter-intuitiveness.
Yes it's a word.
It is.
It is.
Shut up.
09:33
@BillyMathews I'm a big hypocrite: stackoverflow.com/questions/1080247/…
@DaveRandom You have issues ;-)
@HamZa I'm sure it doesn't as I'm not sure I totally understand it yet. The rewrite rule at the bottom will only be applied if all the above conditions are true?
@Jack What? Who said that?
@DaveRandom $src = fopen('...', 'r'); how would this be all the files before the map
@Gordon I do occasionally use them, but it's very rare that they look acceptable.
PLB
PLB
09:34
@Jimbo btw, you change variable type too often. ;)
@PLB eh?
return $foo > $bar ? TRUE : FALSE;
@Tredged wud?
@Tredged You don't open all the pointers at once, you open a pointer, copy it to the new dest and move on to the next file, one file at a time ;-)
@Jack I took out the answer the bidi one..
09:35
^
Thanks xd
@webarto Yeh I love those when I see them
@Mr.Alien It's a weird one ... I'm still not sure whether OP wants to really have Arabic support or not lol
@DaveRandom I think ternaries are more readable, but I suppose if you didn't know what they were they wouldn't be.
PLB
PLB
@DaveRandom $var = condition ? expression1 : expression2; is perfectly fine and readable, is not it?
@PLB When used like that yes.
09:37
@Jack haha, I hate when they ask a question and they don't really respond to it later
@BillyMathews As Uncle @Gordon said, the problems come when people start to nest them
Also people tend to end up with lines that are way too long because of them
@PLB one liners i think are good.
@marabutt Be careful with such open ended opinions :)
PLB
PLB
@Jack Personally, I think: condition ? statement1 : statement2 should be arising: E_ERROR
@PLB Why?
09:39
@PLB $longVarName = (($someBool && some_random_func() == 'val') || $stuff) ? 'A random string ' . some_other_func() : $thing->getStuff();
^^ that's what tends to happen very quickly
@DaveRandom Yeah I tend to only use them when it looks nice. e.g echo $loggedin ? $editbutton : '';
echo join(',', array_map(function($chunk) {
    return sprintf('(%d,%d)', $chunk[0], isset($chunk[1]) ? $chunk[1] : '0');
}, array_chunk(explode(',', $array), 2)));
Most of the times it helps to read the manual:
>>>
The order of rules in the ruleset is important because the rewrite engine processes them in a particular (not always obvious) order, as follows: The rewrite engine loops through the rulesets (each ruleset being made up of RewriteRule directives, with or without RewriteConds), rule by rule. When a particular rule is matched, mod_rewrite also checks the corresponding conditions (RewriteCond directives). For historical reasons the conditions are given first, making the control flow a little bit long-winded. See Figure 1 for more details.
@BillyMathews Yeh that kind of thing is OK
See? One-liner ... good =D
09:40
^ bad example, as that's pointlessly echoing nothing if it's false
@Jack Ugh :-(
but you get the point
PLB
PLB
@Jack Because debugging function calls in ternary operator hurts eyes.
@Jack yes that was a dumb comment on many levels
PLB
PLB
Only expressions that evaluates to value should be allowed.
09:41
@DaveRandom Admit it, it looks delicious :)
PLB
PLB
And if anybody puts function calls with string concatenation it's his/her problem.
@HamZa Yeah I did.. Am I right in saying that if the rewrite rule is matched, and all of the rewrite conditions are matched, then the rewrite rule is applied?
@PLB Who said anything about function calls in ternary operators? What does that even mean?
because the code I posted, it's not possible for all of the conditions to be true..
RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/wp-admin
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/wp-login\.php
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/login
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/admin
RewriteCond %{HTTP_REFERER} !^(.*)anticom.tv/~shapes/register
RewriteCond %{QUERY_STRING} !^62cvp4t6bycl3qa23s0ui
RewriteCond %{QUERY_STRING} !^action=logout
RewriteCond %{QUERY_STRING} !^action=rp
RewriteCond %{QUERY_STRING} !^action=register
@BillyMathews don't spam the room pls.
09:43
@Jack Boom! Spam, spam, spam the room! Tick, tick, tick, tick, tick, boom!
So, anticom.tv uses Wordpress huh? :)
PLB
PLB
@Jack 3v4l.org/IJYnq Simplified example.
@Jack I'm spamming? :s
@Gordon You have been listening to some old-skool music lol
boom boom shake shake the room?
09:45
@BillyMathews not yet. one could argue though that the second posting of that rewrite rules was superfluous ;)
@BillyMathews That's the second time I see your rewrite rules float by => spam.
I have low thresholds :)
@BillyMathews You're using a negative check. so they will be all true
@BillyMathews Try your conditions here htaccess.madewithlove.be
@HamZa Ohhhh! facepalm
@Jack I'll try to avoid it, but it's just an inconvenience to scroll all the way back up to find them again :/
@BillyMathews pastebins :)
I was pleasantly surprised to see that CSS3 selectors are mostly as powerful as XPath 1 :)
+1 What @HamZa said :)
09:49
@HamZa True.
I have a fever, and the only prescription is more cowbell pastebin!
if( some condition ) echo 'Hello'; else echo ' world'; how do I get Hello World in php
@marabutt some condition = die("Hello World")
Sounds like one of those odd interview questions lol
@jack yep
Am I hired, then?
Indeed
Congrats Jack!
i went pcntl_fork()
Does anyone feel like giving me a little bit more in depth help? I've been locked out of my site because I've changed the url and this pesky security plugin has loads or rewrite rules that I'm struggling to decipher
maybe setup a private chat
@marabutt That's another way I guess, but mine works on Windows :D

« first day (1012 days earlier)      last day (4162 days later) »