« first day (1964 days earlier)      last day (3210 days later) » 

20:00
@jbafford if you end up with more than before and you didn't need them before, doesn't that mean they are unnecessary? :)
@Patrick well, whether you did or didn't need them before would be a case-by-case basis
@NikiC would you hate it if I got someone to rfc with ?
there's forward compatibility to consider. A getter/setter is more forward compatible than a raw property
yes definitely. I was arguing a few days ago for not using public properties at all
so using getters/setters is better than that
And there's that debate on internals about public $foo vs. var $foo.
20:02
but using more sensible methods than just getters and setters is even better
Apparently some people like using var as a specific indication of a public property to be used with DI.
Wes
Wes
@PeeHaa sameAL() equalsAL() ?
personally, my argument for keeping it would be as an indicator of "this code originated in PHP 4 and has not been audited for proper public/protected/private status"
@Wes Really? Your first thought was not that of @jbafford? :(
Wes
Wes
@PeeHaa nope they are ok, i'm suggesting other names
20:06
@JoeWatkins Well, I'd definitely be against the feature and doubt that it would pass. But apart from that...
@Wes Oh... same/equals makes me think of ===/==
That might be phpunit talking here though
Wes
Wes
:P
@NikiC The feature of having a nicer way of setting properties in constructors as a whole?
@NikiC for good reason, or ?
:)
20:09
@PeeHaa although TBH, rather than comparing "access levels", I'd recommend actual access checks go against specific permissions (which could be dynamically inferred from an access level)
as in, the code might hasPermission('canDeleteUsers'), and the underlying implementation eventually turns 'canDeleteUsers' into (user->accessLevel >= 500) or whatever
Hmm not sure if such fine grained permissions are warranted for this.
well, they may not be warranted now, but, later, you might wish you had.
@PeeHaa No, the feature of with. Not the sugar for directly assigning params to properties
Basically what I am doing is people can type commands (similar to @Jeeves command) and I have 4 accesslevels, guest, user, mod, admin
@Patrick while technically true, enforcing that principle in practice is not practical in small-to-medium size projects. It's only worth the effort, if you have multiple teams working on an enterprise-scale project.
20:13
@PeeHaa well, what I'm suggesting is separating the permission storage and testing from the permission requests
@NikiC Good good. Because imo we really need / I really want easier property setting :)
that is, always use fine-grained permission requests, but the backend implementation of resolving those requests may just be a simple, take the request, turn it into an access level, and do an integer >= compare on the user
yeah the linked site has arguments for both sides
Just as an afterthought to the discussion earlier
if you need to actually have fine-grained permissions later, then you just change the backend that handles permission checks and storage, without having to also change the front-end, because the front-end is already emitting fine-grained requests.
Wes
Wes
@Patrick though, i was just saying that...
class Baz{
    private $stuff; // 1
    function __construct(int $stuff){ // 2 times
        $this->stuff = $stuff; // 4 times
    }
    function getStuff(): int{ // 5 times
        return $this->stuff; // 6 times
    }
    function setStuff(int $stuff): void{ // 8 times
        $this->stuff = $stuff; // 10 times
    }
}
... the word "stuff" appears 10 times just for a single property.
class Baz{ // 4 times only
    public int $stuff;
    function __construct(int $stuff){
20:16
@Patrick I like it in theory. But I have not seen a project where it would be beneficial to apply in real world.
and honestly, I'd much rather see in the code, $user->hasPermission('userDelete') than $user->hasAccessLevel(ADMIN_ACCESS_LEVEL). Because then you can also search the code for all instances of just userDelete.
@jbafford Hmmm I will give it some thought and most likely ignore the advice for now. Still not sure whether it is worth it.
fair enough :)
Dear @PeeHaa from the future You could have handled it now ^, but you were lazy
if you thought about it and need them, writing them should not make much difference. I am afraid that having a shorter syntax will encourage people to make accessors for things where they should not instead of considering the public api of their object
and now I have to look in two different places with a different syntax to find out what the public methods of my class are?
20:19
@jbafford it should be $accessControl->hasPermission($user, 'userDelete');
@tereško well, yes
Wes
Wes
@Patrick why php should care about that?
@Wes because adding things that will lead to worse code makes no sense?
but then it is php
@jbafford that's if you are implementing something like ACL or RBAC. If all you want is MAC, then user should just have the access level in the profile to match against an action, which has a minimum-expected access level to match against.
God hates MACs
20:23
@tereško I don't disagree; I was just leaving that detail off.
it wasn't important to the point I was trying to make.
@PeeHaa depends on the client and domain
in government-related project you will probably be better off with MAC
Wes
Wes
but why care now. one can write bad code with every programming language, even the strictest one @Patrick
I am talking of course about "mandatory access control"
20:25
but we are trying to make it a better language, right?
adding something just so we have to write a little less code but that makes code harder to read makes things worse imo
FWIW I am pretty sure once I upload this project it either was a nice time waster or I need to rewrite most from scratch either way
Wes
Wes
it's not writing actually, it's reading, maybe after months, huge walls of "function xxxx(){ }" repeated a million times
but it's making it harder to read because you have to look in two different places instead of one.
If you have too many functions, you should refactor, not hide the fact that you have too many functions. That is the same argument people use that want to use a service locator because they have too many dependencies
@JoeWatkins I don't think I like that too much. Still looks like a lot of code just to prevent typing $this->. I think I second what @Wes said that __construct($this->foo) is nice.
Wes
Wes
i knew you'd go there. ok let's move on...
20:29
It's mostly the setting of properties that annoy me and not so much the calling of methods
Wes
Wes
^
Also omg I agree with @Wes
Wes
Wes
i do say sensible things occasionally
You have your moments <3
setting the properties I'm +1. I'm just against magic accessors
Not that my vote counts for anything
Wes
Wes
20:33
note that what i'm suggesting right now is not magic accessors (even if i'm not against them), but just type declaration on fields
lol... Way to ask a question
-2
Q: Linux Signal not Received

Jakub ProI have a problem the handler function does not receive SIGSUR2, the if statement for SIGALRM works. Regards This site sucks how the hell I can enter code?

Wes
Wes
lol
Maybe you should build your own site. With blackjack and hookers! — PeeHaa 2 mins ago
lol
Cultural reference are ok right? :P
@PeeHaa why I am not surprised that OP's username contains "pro"
20:39
Only thing missing to make it really legit is an avatar of some hot half naked chikc
I want to remove the first element of array when click on button
@SajjadKhan Where are you from?
A noble goal.
20:40
That's easy for you to say. You're not the one getting shifted out
Good Morning
i done the job with only click if i click again then it not work
out / off
@Shafizadeh form this world :(
Both are correct to me
20:41
@SajjadKhan :-) .. I meant was which country?
@Orangepill Yo
Wes
Wes
@Orangepill \o long time no see. all ok?
Pakistan
ah ok ;-)
@Shafizadeh ya know, you can see it in his profile info
o/ all has been good... be getting on late but no one is ever here then :(
20:42
Heya orange
o/
oh ... @Orangepill
where you in jail?
@tereško ah yes you are right ..
You know you could just move to a real timezone right? @Orangepill
Wes
Wes
can we have a flat earth with one timezone only
@PeeHaa if I maintained normal sleep hours then the problem would be resolved as well :)
20:44
:P
or we could all move to planet with 30h cycle ... 8 hours of work, 4h at home or on a commute, 8h having fun, 10h sleep
@Wes we haz flat earth but the sun keeps moving :(
Wes
Wes
at least would be consistent
$arr=array("the","Team","Won","The","Match");  <form action="#" method="get">
<input type="submit" name="sub" value="Lifo"/>
<input type="submit" name="sub2" value="Fifo"/>
</form>
if(isset($_REQUEST['sub'])){
echo "Remove the last elemnt and result is <br />";
{
	$l=$l-1;
		unset($arr[$l]);

	//echo $l;

		print_r($arr);

}
}
where $l denote the length of array
@bwoebi sure
20:49
You know you can just pop elements from the end right?
@sajjadkhan wouldn't array_pop work better
@Orangepill I know this can be done through built in function but my instructor told me not to use any typr of biult in function it is a school task
@Wes ??
Wes
Wes
@SajjadKhan that is bs
@Wes so why you share it with me?
20:53
@SajjadKhan what kind of school is that?
@Patrick an NGO and owner belong to USA This NGO works in many department of life like health e.t.c
and the one is to educate the youth
sounds like they could use better teachers...
do you have a list of things that you are allowed to use?
only use very basic things like isset, unset, loop and last but not least array
@SajjadKhan, to remove items from a stack on button click, you will have to either use pure JS or store the array in session
but no built in function
currently my topic is php so no more js @tereško I know it sounds very rude but what i can do
20:59
The "no built in functions" requirement only makes sense when you need to show you can come up with an algo
then use sessions
do you know how php sessions work are used?
@SajjadKhan pretty sure isset is a function?
@Patrick Technically an expression construct
it's listed under Variable handling Functions in the docs
@Patrick yeah, well, it's not. It's a language construct. In php isset is as much a function as require is one
21:02
so what is array_pop then?
yeah this is our previous topic and we do alot of task with session but @tereško they restricted us to be limited and directed us to only use what is current topic they allow us to use bsic function
@Patrick A function.
isset, unset, echo, include, require, etc., are not functions.
@SajjadKhan without session you won't be able to have persistence between clicks
@tereško You could share state by passing in back and forth
when you click a button or a link, the page will reload
@PeeHaa that would be retarded
21:03
@tereško you are 1105 right
sorry its 110%
Yeah added extra emphasis already @tereško :)
@SajjadKhan You can edit your comment
@Patrick Yep, I can show you a few other places where there's confusing terminology in the manual too (hint: everywhere)
i write a new
B/c I'm lazy :)
21:04
@Patrick Removing it would only confuse people more. There is a note though Note: Because this is a language construct and not a function, it cannot be called using variable functions.
@PeeHaa where do you see that?
algorithms should really be taught in C or maybe Rust
!!docs isset
[ isset ] Determine if a variable is set and is not NULL
ah on isset, I was looking at the list
!!docs Peehee
[ pg_delete ] Deletes records
!!docs Jeeves
Aw, robots don't have souls.
please stop playing with the bot
21:07
Can it slap users with a fish yet?
!!slap tereško
That kinda reminds me I have a half finished ban command I need to finish
btw, is @rdlowrey in jail or something?
The guy has an actual job now instead of pulling numbers out of his ass
At least that is what I think he did
21:11
yeah, well, it looks like he either behind an extremely restrictive network (think: government or corporate), buried in 12h+ workdays or in jail
didn't Anthony suck him into Grovo... last I heard of him he was talking about who awesome Go is.
Wes
Wes
let's rewrite php with Go! runs
@Wes ...
Wes
Wes
:P
@NorthbornDesign This website is a great idea in my opinion ... It creates a survey-system for everyone .. good idea ..
@PeeHaa 404
Seriously. Get the rep damnit!
> PHP is the language of existential crisis [on hold]
> PHP is a language built upon other languages.

If I'm not mistaken, the high-level PHP that I've been writing class Stupid { static public $stupid = "stupid"; function stupid($stupid) { echo $stupid; } } stupid(Stupid::$stupid); is stupid and made up of many... complex sub-parts. Like, the C programming language and a whole open-source system that is... prone to error in MANY ways, and even when (("$thingsSeemFalsey"==FALSE)==FALSE)==TRUE, I don't know what's going on.

Uhh... So, what existential crisis does PHP (or your own language) bring out?
@PeeHaa wat
naming: ThingAugmentor or ThingAugmenter
@Andrea you should really write some rep magnet like @DaveRandom and @NikiC did with the how does foreach work question
@DaveRandom The latter?
21:26
Yeh that is now pretty close to +1000
@PeeHaa It's a short novel
@PeeHaa Somehow the former looks more natural to me, not sure why. The internet was inconclusive as well.
yeah tbh I am not 100% sure, but instinct said menter
@DaveRandom ThingAugmentor sounds somehow evil
I'd actually like a better word than "augment[oe]r" but I can't come up with one and that is what it's doing
And I don't like the idea of a class called ThingDecorator
@NikiC It does sound a bit Harry Potter baddie, I'll give you that
21:28
Well we have our resident lingistictististeror don't we? hint hint @Andrea
Augmentagator
@DaveRandom what are the public methods?
@PeeHaa my rep magnet atm is the constants containing arrays q
It's C#, and it's just adding some extra events to a ListView that should exist in the first place
let's ask google n-grams
augmenter it is, @DaveRandom
21:32
good enough for government work me
ty
make sure you add some deus ex inside joke somewhere in there
@Andrea So, what happened in 1890
@NikiC the AbstractSingletonProxyFactoryBeanpocalypse
in all seriousness though, no idea
let's search google books
Ah, seems to be something medical
"augmentor nerves"
yeah
21:35
@NikiC Hmm looks like @Patrick was on the money with his deusex comment
@Andrea That ngram thing looks really cool
@NikiC it is!
Time to start entering curse words :P
hehe
21:38
nvm, just off by a century
ooh
fuck and cunt are only printed since around 1960? I guess that's because of censorship etc.
@Andrea And before 1820, interestingly
Well that escalated quickly :P
@NikiC yeah, which I can't really explain, perhaps they had some other meaning
ohh, if you drag the start year back a bit, it's only dead through 1800-1960
@Andrea huh
So, fuck reached its peak around 1650
What does that tell us
21:43
probably that it used to mean something completely different
actually no, it's always meant what it means today, looks like
Fuck is an obscene English language word, which refers to the act of sexual intercourse and is also commonly used as an intensifier or to denote disdain. Its origin is obscure but is usually considered to be first attested to around 1475, although it may be considerably older. In modern usage, the term fuck and its derivatives (such as fucker and fucking) can be used as a noun, a verb, an adjective, an interjection, or an adverb. There are many common phrases that employ the word, as well as compounds that incorporate it, such as motherfucker and fuckwit. == Offensiveness == The word's us...
@PeeHaa A clear correlation causation
@Andrea The spelling changed queynte
21:51
posted on March 02, 2016 by r3wt

### changelog 1. adds ability to pass any class name as string as config option for `locale`. before it was restricted to only classess stored in the `RedBeanFVM/RedBeanFVM/Locale` directory. now its more flexible, which is a win for other compose...

English - basically one huge set of double-entendres for several millennia
@NikiC definitely
someday, someday I will finish list() keys
22:30
@PeeHaa you're the Jeeves maintainer right?
Yes
posted on March 02, 2016 by r3wt

because im dumb and released 1.0.2 without testing... jesus **tldr;** this one is tested and works.

@PeeHaa did you see the feature request I opened? Possibility?
Yes. I've seen it. Still need to comment on it. And yes it is certainly possible.
ah ok, you did. Just saw you added tags.
Yay!
22:33
Yeah. Added tags and got distracted :)
can some one help me on pagination?
anyone?
> Support group for those afflicted with PHP. Don't ask to ask, just ask
3
$db = mysqli_connect('localhost', 'username', 'password', 'dbname');


$num_rec_per_page=10;


if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * $num_rec_per_page;
$sql = "SELECT * FROM barki_schedule LIMIT $start_from, $num_rec_per_page";
$rs_result = mysqli_query ($db, $sql); //run the query

	echo '
		<table>
		<tr>
			<th>Day</th>
			<th>Start Time</th>
			<th>End Time</th>
			<th>Show</th>
		</tr>';
    	$sql = "SELECT * FROM barki_schedule";
that is my code
now i am trying to do pagination
but...
it is not limiting them
and my link tags do not work
it shows all results
$sql = "SELECT * FROM barki_schedule";
You have two queries for some reasom. This first paginated the second not. And you are looping through the recordset of the second
22:43
Too slow old man.
@Danack yes i have fixed that
Wes
Wes
@TheBeast enter key is not an alternative to punctuation. you always enter here and dump huge walls of code and monopolize the chat
@Wes well
maybe?
@Danack That hurts coming from you :P
sometimes.
22:43
now it limits it
SurprisedFace.jpg
but now it shows the same content on every page
you aren't setting $start_from to something sane
@Orangepill what do you mean
what is the value of the $page variable when you hit the next button
22:46
and my arrow buttons just go to the first and the last
$page-1
@Orangepill
how may records are there?
about 44
you mean in the database right?
user5020521
if I have a numeric like 00185 can anybody tell me why this number is returned only as 5 when it comes to json_encode?
@Orangepill
if so yes
user5020521
I've been googling around the docs for hours
22:57
@Riccardo990 post a code example on 3v4l.org
@TheBeast how may pages is your pagination showing? I would echo out the sql with the limit clause to help try to debug what is going on.
4
@Orangepill
if there is 44 records at 10 per page you should have a total of 5 pages
user5020521
@Danack here I am 3v4l.org/bL4D1
@Riccardo990 sscce.org
You're the one asking for help - you should do the work of making the question understandable, rather than expecting people to parse your wall of code.
23:01
@Riccardo990 it's actually turning it to 1 not 5
sorry there is actually 39 i miss counted @Orangepill
user5020521
something strange is happening anyway
user5020521
I've tried JSON_NUMERIC_CHECk and JSON_PRESERVE_ZERO
user5020521
@Danack I thought that way would have been clear enough
> Minimise bandwidth for the example, do not bore the audience.
In this case - I would expect the example to be like 2-3 lines long.
user5020521
23:05
well let me resend the code then
user5020521
I do apologize
in case you ever wondered how to pass the stripe fee onto your end user when creating a charge with stripe sdk: 3v4l.org/IbCiR
@Riccardo990 a leading 0 in a literal integer means that the number should be treated as octal.... 8 is not a valid digit in octal
user5020521
wait guys this is a shorter version 3v4l.org/qqgmu
user5020521
I hope this way is easier and clearer
23:07
@Orangepill some times.....getting people to write out a clear example leads them to finding the problem themselves.
user5020521
I'm sorry for the wall of code
Output for 7.0.0 - 7.0.4
Parse error: Invalid numeric literal in /in/qqgmu on line 20
user5020521
in php7
I wonder what could be possibly be causing that.
user5020521
my version is 5.5.9
user5020521
23:09
that's why I couldn't see that!
@Riccardo990 Do you think there is a line of code in there, that is going to be 'correct' in PHP 5.x that is invalid in 7, or is there just an error detection missing in 5.
user5020521
the latter statement man
@Danack Sorry ... didn't realize this was a teaching moment :)
user5020521
error detection in the earlier version
user5020521
and since mine is earlier than the current that's why I can't detect the error properly
23:11
For the record - this is the minimal example needed:
echo 00185;
//output is 1
Which is interesting.
user5020521
that's really strange
user5020521
it seems that the only number which is read is the third one
leading zero says ... hey this is octal... then it reads until the 8 which isn't valid octal
@Orangepill It's almost always more important to teach juniors how to ask questions than it is to answer their questions...and yeah, that analysis sounds correct.
user5020521
forgive me my ignorance @Orangepill but what is leading zero?
user5020521
23:14
can I found any reference on the docs?
damn whipper snappers
@Danack Too slow old man :)
user5020521
that's the point
Going to blame the rum tonight...
@Riccardo990 scroll down to 'octal'.
user5020521
23:15
if a number starts with 0 ang goes to 7 is octal
user5020521
8 isn't a valid octal
user5020521
$a = 0123; // octal number (equivalent to 83 decimal)
user5020521
from 0 to 7
user5020521
thank you guys
23:16
so the simple fix is kill the leading 0 for numbers
and for the record phone numbers should never be interpreted as numbers.
user5020521
any docs on how to kill the leading 0 number?
Use the delete key on your keyboard?
user5020521
let this be clear I don't ever want you to do the job for me
Or write it as a string.
user5020521
I'm not a vampire helper
23:17
@Riccardo990 just erase it from the source..... if the number comes in from user input as a string then it is interpreted as decimal
It's only when you're writing it in code as a numeric literal that it gets interpreted as octal.
user5020521
so if I simply delete the leading zero that works perfectly
user5020521
and what about street number?
yup... and I would put quotes around any numbers that you don't want to do math to.
like phone numbers and street numbers...
user5020521
for quotes you don't definitely mean single ones
23:22
Either or
single or double.... only difference is if you have a variable you want to interpolate in the assignment
that only works for double quoted strings
user5020521
just let me tell you this
user5020521
what if I needed a zip code to geolocalize some shop in a google map?
It's still a string... but a lat and long are numbers
user5020521
you mean I could give a fuck about the zip code as long as I have lat and lon my friend?
no, he means if you're not doing math to it it's not a number, it's just a string that happens to be made of digits
23:25
I mean a zip code is a string... it just happens to contain numeric data.... lat and long are numbers.
it would make sense to do math to lat and long.
user5020521
well the first way to go is to remove the leading zeros
user5020521
from zip codes
user5020521
is there any harder way to go?
Zip codes are strings
a lot of countries don't have numeric only postal codes
and for some that do, 123 and 0123 are different post codes
23:28
best solution for zip codes is to put them is quotes, double or single
user5020521
so long as I have lat and lon that are required to geolocalize something
user5020521
am I right?
user5020521
or am I wrong?
you're certainly missing the point
user5020521
but I'm trying not to miss it believe me
user5020521
23:31
I'm single/double quoting the zip codes and street numbers so that json_encode function do not throw any error
user5020521
this is the original purpose since I had returned a numerical error
Ken
Ken
Hey guys, this is a Java related question but that chat is kind of dead so I'm just putting it here as it might be a general question. If I have a Hashmap, and for example it doesn't contain the key 3, does that mean that for key 3 the value of the Hashmap is null? Or does null imply a different thing
@Riccardo990 No, you're quoting them because they are strings, not numbers. That is a fundamental thing you need to understand. If you don't it'll continue to bite you in the ass down the line, be it from numeric literals or using incorrect types in your database (for example).
user895378
lol at the "where do you think rdlowrey" is poll
the manual seems clear: "V get(Object key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key."
It lives....
@rdlowrey How's it Going @rdlowrey ?
Ken
Ken
23:36
Okay thanks @Danack
user5020521
@PaulCrovella so they are string because I'm quoting them else they wouldn't be strings
I give up.
user5020521
what you said is right
user5020521
I did understand that I'm just trying to reinterprete it
user5020521
I'm quoting them becasue they are strings
user5020521
23:39
is this statement right?
user895378
@Danack Things are going well, thanks. Just working all the time.
user5020521
I might ask myself why not to double quote them
anyone know a quick an easy drop in framework for forms?

« first day (1964 days earlier)      last day (3210 days later) »