« first day (3170 days earlier)      last day (2004 days later) » 
00:00 - 22:0022:00 - 23:00

00:57
i had a question how can you like use a texfile or or flatfile as MySQL database well i know you guys know but can you give me the easiest way to doing that thank you
@NiloStick I'd suggest looking at sqlite with it storing it's data in a single file, rather than writing something yourself.
e.g. the example on this page: php.net/manual/en/sqlite3.open.php
yes men but we have a task where we can only use text files as databases :(
01:12
@NiloStick change the extension to .txt?
Is this some homework that you're meant to be learning how to implement a DB yourself?
01:32
i think so
/^[a-z]+$/ can be match "\n" – #78191
problem if you try to read a loop well at least form it is impossible
depending on how much you need to do youself
i would just put everything through json and store it in a text file
yeah but the task says just plaint text files and pure php code it is sad becuase this really just the last part of this task
and i have been making this project soully on text files and now im screwed
 
1 hour later…
02:50
@NiloStick Why are you screwed?
becuase i am not really good at doing loops and reading text files
@St
You said this is for a class?
Have you not been following along in the textbook?
well no beucase the university gave us a big task
*becuase
02:53
What is the big task?
Creating a quiz that users can answer and create themselves
And so the last thing is just to create a place they can sign up
So being able to sign up is all that you have left?
@NiloStick So you need to create a form, provide the fields for collecting the relative information. If this isn't something for production code then you just have the form action go to a processing page. Create local variables from your $_POST variables that were passed from form.
Do you have to validate the data submitted?
// Open File for Appending and Write//
@ $fp = fopen("$DOCUMENT_ROOT/../signuplist.txt", 'ab');
yes i have to validate them if they are correct
flock($fp, LOCK_EX);

if (!$fp){
echo "<p><strong> Signup could not be completed. </strong></p></body></html>";
exit;
}
fwrite($fp, $outputstring, strlen($outputstring));
flock($fp, LOCK_UN);
fclose($fp);

echo "<p>Signup List Written</p>";
damm these codes look dope
03:03
You need to define outputstring with what you're saving.
It's not really. It's ugly. But trying to give you some ideas. You'll need to research fopen, fwrite, flock, and fclose on Stack Overflow and get some more ideas on how to use in order to complete.
yeah i know bro i am bad at making ideas i just can do them but i will try no matter what
Why are you taking this class?
because i love computers
and programming
Are you sure you love programming?
You said you're bad at making ideas.
yes why you think i dont love it i programmed all night tonight
well is becuase it is my first year in maths and computers
03:08
Ok- Just curious if you're sure this is what you want to do. It doesn't get easier.
i know and that is why i love it
file_put_contents will keep you from having to do fopen, fwrite, fclose, etc. Read that instead.
I store everything in databases so it's been awhile since I stored in a text file.
Should be able to conjure something together from those. Good luck.
Is there a way in SQL to find the maximum value a column supports? For example a TINYINT maximum value can be 127, whereas unsigned column can have max 255.
yeah thank u men you are such a good person hope u succeeed in your missions
@Trowski o/
Are you guys finally warming up, up there?
03:24
@StatikStasis This wouldn't give the maximum value the said column can hold though
@StatikStasis It's June :-P It's been pretty warm for a couple months.
@Trowski I figured you guys could/have got snow this late before.
I know our latest in the southeast was... May... maybe. As cold as it gets there- I wasn't sure. =p
@StatikStasis Of course it can be freakishly cold some years, but this year has actually been very nice so far.
Wow- really? We had one of our coldest winters this past season.
03:46
@StatikStasis Don't you live in MN as well?
Ah, nevermind then.
It got really cold here for a couple days this winter, otherwise it was pretty mild. We got a good amount of snow this winter.
It was a really wet winter. It snowed a couple of times. You would laugh at what we close schools down over.
04:17
I'm sure I would. I've been rolling my eyes lately at what they close school for here.
We've closed school with no snow. It was just really cold. What was too cold? Less than 10 degrees. Not below zero though.
Mainly because they're afraid bus riding students will freeze at bus stops because they did not wear enough layers.
05:06
Good morning
 
2 hours later…
07:02
morns
07:34
o/
07:51
Good morning
What is the purpose of this chat ?
tonsorial of or relating to a barber or the work of a barber
@Jeeves wha
08:47
urm ...
yes ...
Snowden:~ krakjoe$ cat test.c
#include <string.h>
#include <stdio.h>
#include <monetary.h>

int main(int argc, char **argv) {
    char buf[1024];
    size_t len = strfmon((char*) buf, sizeof(buf), "X%nY", 3.1415);

    printf("%s\n", buf);
    return 0;
}

Snowden:~ krakjoe$ ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) ./test
=================================================================
==87265==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000b9 at pc 0x00010bb6979a bp 0x7fff540b23b0 sp 0x7fff540b1b50
but I can't find anyone talking about it on the interweb, which seems highly unusual ... maybe
macos is great
@JoeWatkins Maybe nobody ever uses strfmon?
There's also this stuff, which looks more legit: dev.azure.com/phpazuredevops/PHP/_build/…
maybe not directly, but do none of perl/ruby/node use it ?
zend_signal_handler_defer has a check for tsrm shutdown, but it's probably not working right
@JoeWatkins Doesn't seem so
that's not a proper check, that's a workaround for a fault ...
tsrm should expose a proper api for that
yeah, it should...
08:57
hellow all
defer function may be executed asynchronously ?
@JoeWatkins depends on what you mean by that...
It's a signal handler
the whole thing looks unsafe, even if you check on entry that tsrm has not been shutdown for the current thread, it could be shutdown during the execution of defer routine ...
I think it needs exclusion
@JoeWatkins hm...
I don't think that's true
signal handler will still interrupt the current thread ... right?
other threads might run in parallel, but not the one handling the signal
cmb
cmb
@JoeWatkins, it seems that either github.com/php/php-src/commit/… or github.com/php/php-src/commit/… broke bug67429 on parallel AppVeyor builds. I can't reproduce the test failure locally. Any ideas?
09:02
the defer function may be executed in parallel with the the thread to which it is delivering signals, the thread to which it is delivering signals may shutdown tsrm while defer is executing, any access to SIGG may fault in that case ... no ?
@JoeWatkins The signal runs on the thread, it can't execute other code in parallel
oh right, okay then
@cmb looks like it's missing an error message
cmb
cmb
It seems that the loop is only executed once.
not sure, there should be errors
there's margin for strangeness, the stop function is not very robust, and nor is the start function ... but if they were the cause of the error, I would expect an error message, if the server is running and for some reason the fsockopen in the script failed, there'd be warnings from that ...
09:28
SegFault when reuse statement after schema has changed – #78192
09:54
I want to do a bit of work on tsrm, is there another one you can work on until tomorrow ?
@JoeWatkins hm?
it's difficult to expose a consistent api for tsrm_is_shutdown, because there are multiple (unnecessary) ways to shutdown ...
heh
as usual...
I got some leak results, will be looking into those
cool, I'll get to the tsrm thing this evening or tomorrow morning
leak checking is brave
gd one looks simple ... gdFontCacheMutexShutdown is never called and there's no MSHUTDOWN in the ext to call it ...
may be helpful to symbolize the traces ...
10:18
guys, how i get the values from one table form to insert on the db?
someone tolld me how, but i forgot to write it down
cmb
cmb
@JoeWatkins, calling gdFontCacheMutexShutdown() in MSHUTDOWN doesn't look like a good idea, since RSHUTDOWN uses the mutex.
that's fine
@cmb rshutdown is called before mshutdown
cmb
cmb
oops
10:37
Hello,

I know you probably have a lot of stuff going on in your position, so I'll keep it short for you. American Equipment specializes in the recovery and supply of assets such as Generators, Boilers, Chillers, and Transformers.

We can purchase individual units, or we can purchase everything and provide a full, turnkey decommissioning of data centers of any size. We find value within your existing data center our competitors cannot, allowing us to offer the most cost-effective, stress free solution when you have a data center to decommission. If you or somebody you are aware of may benef
is this really an effective way to do business ? the only information they have is my email address, that's less than the information you have when knocking on doors selling cat litter, at least you might see if they own a cat ...
10:48
@cmb looks fine, just move the decl to somewhere close to minit
ah, missing forward decl
11:13
shoud i use ajax to submite the values on a table to other page by post?
 
1 hour later…
Wes
Wes
12:18
@NikiC would it be acceptable if the next auto increment index would be calculated only when the first push() happens after a unset() or a series of unset() ? i think it's the most efficient way of doing it. still inefficient compared to doing nothing
function unset($key){
    if(is_int($key)){ $this->markFindAutoIncrementId = TRUE; }
    // ...
}

function push($element){
    if($this->markFindAutoIncrementId){
        /* find it */
        $this->markFindAutoIncrementId = FALSE;
    }
    // do the push
}
basically an unset would invalidate the next auto increment id, unless the unset element is the same as pop()
@MadaraUchiha, are you there?
12:39
I have this weird issue with global variable.
I have set a global array with $GLOBALS and it's accessible outside of a class but not inside, what am i missing here?

Here's the code

print_r($GLOBALS['menus']); // THIS PRINTS ME THE ARRAY THAT IS SET PRIOR
class MENU{
public function getMenu($menutype){
print_r($GLOBALS['menus']); // THIS PRINTS MENU Object ( )
switch($menutype){
case 'submenu':
case 'sidemenu':

/*foreach($GLOBALS['menus'][$menutype] as $menu => $menuitem){
foreach($menuitem as $menuattr => $menuval){
Wait i'll provide the code with better format in a sec
put it on 3v4l.org so that it runs...
For some reason now it wont print anything inside of a class
@drpzz where are you creating the class and calling it's method?
Basically the branch is

init.php
// SET $GLOBALS['menus'] array
// require all the classes using spl_autoload_register

index.php
// require init.php
// call for a class $menu = new MENU();
// call for a method menu->getMenu($menutype);
Should i provide rest of the code?
@drpzz you should put a 'working' version on that site: sscce.org
12:54
Good Morning, All! Happy Friday.
13:05
o/
\o
13:21
o/
ThW
ThW
Why is the $code argument of exceptions restricted to int? Documentation of Exception::getCode() says "Returns the exception code as integer in Exception but possibly as other type in Exception descendants". Is here a reason why this limit exists for userland?
@ThW interesting - I'd say the int-return-type should be dropped as PDOException already breaks it
@ThW imo, the code stuff is pretty useless.....creating a type hierarchy with specific types is much easier to handle.
14:08
^ and then it will be real cleancode
ThW
ThW
@Wes :-(
ThW
ThW
14:24
@Danack How is that a reason to restrict $code (making it more useless)?
hi
<?php
if(isset($_POST['submit']))
{
$username = $_POST['username'];
$password = $_POST['password'];

if($username == "a" && password == "a")
{
echo "asdas";
}
else
{
echo ("its not true");
}
}
?>
why this is always shows its not true
ThW
ThW
@DarthSucuk You have an syntax error that should throw a warning or a notice. Increase your error level.
@ThW it wasn't accepted because people were used to doing echo $code;
and that works only if $code is scalar
cmb
cmb
@ThW, there is no syntax error.
@DarthSucuk, add vardump($_POST) to see what's in the array.
@ThW undefined constants are string i guess
14:31
@ThW ...if you want to add capabilities to a class you need to make a strong argument for it, not just 'we could do so why not'? It's not other people's responsibility to prove a negative case.
ThW
ThW
@WesAtWork well scalar or string castable objects would be fine I think.
@Danack 1. consistency with its own API, 2. it is an identifier, not a number
unrelated, gotta love clientWidth/height returning values at random because of box-sizing
1. I'd prefer to fix PDO. 2. It's a shitty identifier which is really annoying to use. Making it more capable wouldn't give us a good experience.
where to add vardump($_POST)
Has anyone used IPN API from PayPal? If so, how do you make sure that the request is actually coming from paypal and not some third party who found your url and wants to fake payments?
14:37
array(3) { ["username"]=> string(1) "a" ["password"]=> string(1) "a" ["submit"]=> string(0) "" } its not true
so its true
a and a
whyyy its not working
@JBis i did work with ipn but i don't remember at the moment, there is an id a token or something like that
also the ipn notify url is private
@WesAtWork Well I would probably name it something like /ipn.php, but I guess I could randomize the url
???
@cmb
@cmb could you pls help me
@user3655829 Yes, I read that function. Doesn't seem to verify that it is from paypal, just a valid request.
14:39
verify_sign maybe
How would the verification work else? What are you going to verifying against the server if not the original request?
Then it could be a checksum function but they used curl
@ThW I forgot to say - this is how I define exceptions that need to carry info with them:
class FooException extends Exception  {
	public function __construct(string $message, Foo $foo, \Exception $previous) {}
	public function getFoo(): Foo;
}
unless it makes a request to paypal to confirm the data:
for me, that's a lot better than an arbitrary 'code'.
        $info = curl_getinfo($ch);
        $http_code = $info['http_code'];
        if ($http_code != 200) {
            throw new Exception("PayPal responded with http code $http_code");
        }
14:42
is anyone help me please
its sending all your post data to the paypal server
Paypal Request -> YouPHPAPP -> Paypal verification
@user3655829 ? I want to make sure that paypal actually made the request to my url instead of some random person
@DarthSucuk you ignored the response you already got:
14 mins ago, by ThW
@DarthSucuk You have an syntax error that should throw a warning or a notice. Increase your error level.
ThW
ThW
@Danack Yeah, I did the same - basically implemented my own "code" in this case.
then use http reffers and a lot of ip hostname lookup
but i think paypal whants you to check against their db
-h
14:43
You have an syntax error that should throw a warning or a notice. Increase your error level. how can I find my syntax
its a notice. password is a string password.
@DarthSucuk that's something you can google.
I've already did it
also, if you used PHPstorm it would hightlight the error for you.
14:45
there is no syntax error
ahh that chaned in php7.2 to warning :3
there is
you missed a $
Results
No issues found.
@user3655829 If it confirms with paypal then thats probably more secure than some kind of key to verify in that request. So I am fine with that. Just didn't understand how it worked. Thanks.
you missed a $
where?
ThW
ThW
@user3655829 trying to teach him to fish
14:46
owww yeaaaaaaaaaaaa
ı found itttt
@ThW i know i know but after 5 minutes :/
I cant sit beside someone looking at the screen while he doesnt see it. It makes me jittery
@user3655829 Yepo
> Before you can trust the contents of the message, you must first verify that the message came from PayPal. To verify the message, you must send back the contents in the exact order they were received and precede it with the command _notify-validate, as follows:
\o/ i didnt look into the documentation. Code is documentation enough :3
but the paypal code could be cleaner hehe
ThW
ThW
15:09
@Danack I am implementing these errors. w3.org/TR/xpath-functions-31/#ERRFOER0000 Even with separate exception for some/each of them I would like to use the defined code property and not add a second method for it and ignore code. It feels wrong to add a second value for the same purpose (error identifier).
> It feels wrong
ThW
ThW
feels/seems/looks/... pick one
I think the correct thing would be to remove the code from the generic exception. But just because that's not possible, doesn't mean that we have to do something, that isn't clearly the right thing to do.
It really doesn't cost a lot to have another value that more accurately represents the details.
Except for feeling of not writing the cleanest code possible.
ThW
ThW
@Danack Not a feeling - it forces me to have have a duplicate in API.
And?
5 mins ago, by Danack
It really doesn't cost a lot to have another value that more accurately represents the details.
ThW
ThW
15:19
It is not "more accurately" - it is the error code
Hi all :)
if err:FOAR0001, Division by zero. as example. Do you want to catch GenericXpathException or DivisionByZeroException?
Hey -- @JoeWatkins @NikiC Shall I then make a PR to remove the "stat" property in PHP 7.4 and later regarding to bugs.php.net/bug.php?id=67348 ?
and if there would be one exception for every one nobody would check against the code if you could just catch the good named exceptions.
DivisionByZero should be an Error rather than an Exception, I would argue. That sort of thing should be caught with assertions really, it's a logic error
15:25
it was only the first on the error list
oh, didn't read the context properly
ThW
ThW
@user3655829 class InvalidPatternError extends XpathFunctionException { public function __construct() { parent::__construct('Invalid regular expression.', 'err:FORX0002'); }
@user3655829 and here is fn:error() that allows to throw custom errors from the XSLT.
@Derick To clarify, the $stat property gives you the same as the stat() method?
@NikiC Let me check that
ok i see but you could extend InvalidPattern even further to make it more specfic if the user wants to catch that.
15:31
@Derick Based on code, yes
In that case I'd say ok, remove it
It doesn't even seem to be documented, only the method is
Yeah, indeed, it looks like it does the same
kill it...
ThW
ThW
@user3655829 They will not by captured separately, they are errors triggered by the XSLT. All of them basically say "fix your template file."
im not sure if the user wants to know about technical specification details or just want to fix things. There could be a magic 'fix' function for one specific error you want to catch. Are there usecases where you need the code from that specification?
@ThW I'm sort of apprehensive about telling anyone that this is possible, but nevertheless it is: 3v4l.org/GS5S0
15:37
@NikiC On it
you can also manipulate stack traces in the same way, btw
the data is stored using regular private properties and the aren't type checked, only the ctor signature is
@DaveRandom lol
that's definitely undefined behaviour though
a black magican appears
@WesAtWork Any issues/drawbacks I should be aware of if I use CSS Grid Layout?
15:41
Are the subgrids already working?
i dont think so
It's broken?
@user3655829 I have used that technique in the past to remove superfluous stack frames from traces... i.e. when you have a $this->throwException() or something
I've never used this display attribute before but I was reading up on it here css-tricks.com/snippets/css/complete-guide-grid and it looked really promising.
I'm not recommending it, just saying it's technically possible
....and annoyingly, the "reflection is slow" argument doesn't even work here, because "you shouldn't optimise error paths"
ThW
ThW
@DaveRandom interesting option, thanks :-)
15:44
@ThW worth noting that while you can cache the ReflectionProperty as that code does, you need to do it separately for Error and Exception because they don't have a common base
@Wes Could you add your email address to the wiki.php.net/rfc/… and wiki.php.net/rfc/… RFCs please?
ThW
ThW
15:56
@DaveRandom and it allows for $this->expectExceptionCode('err:FORX0004');
oh cool, that's nice
18 mins ago, by DaveRandom
that's definitely undefined behaviour though
you should be good for 7.x but I don't know if it will come into play in 8... typed properties might make it interesting
Oh actually, getCode() is documented as having a return type of mixed php.net/error
so I think it's technically OK
as in, it can be formalised to allow that without a BC break
@DarthSucuk if($username == "a" && password == "a")
password == "a")... needs to be $password
@ThW it's worth exploring the properties of those two classes (they don't have a common base but the underlying implementation is the same code, just with different class_entry refs) - you can manipulate every property, they are just standard private properties and the type of the zval is not enforced, but if you change anything to do with the __toString() result then you need to clear the traceString property to have it regenerate the string
if you just do var_dump(new Exception) is shows everything
you can use the result of debug_backtrace() to replace the stack info
again, note that I'm not recommending any of this :-P
16:17
well now I should be able to use Docker
\o/
but I need to run errands before I can play with it
kinda wanna buy an easel ...
buy a weasel instead
painting without one is annoying
does docker run natively on W10:1903 or did they not build it like that yet?
16:20
I had to upgrade to 10 pro
not done the update yet but I want to play with WSL2 so I may do it tonight
but there are keys on ebay for cheap, I bought one for 6 USD
I mean that is of dubious legality but as long as it works
person's from Malaysia, so maybe
fyi you can still do the W7/8 -> 10 upgrade legally for free, so if you can get hold of an old legit license for either of those then that's a cheap option
there was/is and upgrade for free if ms detects that you stole it
Funny thing - my Windows 7 key is from the back of a laptop from a friend who wasn't using the laptop for anything at the time ... I have a legit copy of Windows 7, but I had lost it. I found it a couple weeks ago.
laptop key will OEM i.e. non-transferable
(between machines I mean)
I've been using it for three years without issue
but if it ever does present a problem, I can just enter in my 7 key now that I've found it
anyone know any 2 character domain registrar?
16:24
I think MS are getting a little bit less aggressive with it tbh, they have finally clocked that it's not where they make most of their money, and they will make more by letting people have the OS (i.e. a usable computer) so people can spend money on O365 instead
@DaveRandom depends, i saw laptops with oem and laptops with retail keys
@Ghostff you mean country TLDs?
if so, depends which country
they aren't all available for public registration, no matter which registrar you use
just google "xx tld registrar" where xx is the country code you are interested in
I mean something like ab.com ac.com?
@DaveRandom ...I ended up subscribing to O365 monthly to use Word for something niche, but I've gone ahead and kept it because it's nice to have
and it's only like 7 USD a month
yeh it's actually worth the money for most people I think
(I still just use 2007...)
well, on my personal machines anyway
@Ghostff most registrars should do that afaik?
it will cost an absolute crapload though
I recommend domains.google
their interface is a classic google no-bullshit-plenty-of-features, free private reg, and good integration with google SSO so you can delegate admin rights to other google accounts and stuff like that
yes, google will certainly let me register 2 letter names if I give them a stupid amount of money
16:38
it dosnt seem to support country tld
that depends on the country
they support .io, for example
yeah i think js io and us
some countries have absolute control over their SLDs (e.g. the UK), and some just don't allow registration of SLDs at all
17:36
@DaveRandom I just don't trust google with anything anymore. Looks to be about the same price as everyone else too.
@StatikStasis caniuse.com/#search=grid scroll down to subgrid. I dont know but if im gonna use grids i want subgrids
i got only the first one :/
17:50
@ScottArciszewski honestly is not a far comparison, I think preg_split is a perfect candidate. Still funny though
@Trowski thing is, they already know everything about me, that ship has sailed, I may as well use their reliable/good services. If I could go back to 1998 and do it over it might be a different story.
You do get more for your money than a lot of registrars though... free private reg, free dynamic A records, they support CAA
I don't necessarily disagree in principle though
18:08
@user3655829 Ah- I didn't realize. I went with flexbox instead. Very interested in grid though.
return type of – #78194
I was wondering: Can WordPress filters be compared to public properties of a class?
In the sense that they provide similar functionality and risks
18:51
Evening playlist, or at least something to start you off:
https://www.youtube.com/watch?v=gXNhL4J_S00
https://www.youtube.com/watch?v=LLK4oaXUuLg
https://www.youtube.com/watch?v=2WrIN7xhEks
(rebecca-free)
@DaveRandom Everyone in the 70s looked so ugly to me.
@DaveRandom The drummer for XTC reminds me James Franco.
I didn't actually watch the vids tbh, just googled the 3 songs from my Spotify:-P
Sort of looks like bez
19:09
hello
hello
If my web application has some links with javascript routes can I make other links with php routes
19:34
@PHPFan I don't think I understand. what is your server? what is the application, is it all client side, like react?
Now I am working with xampp localhost, my application is of SPA with angularjs, some pages with php
@FélixGagnon-Grenier So I want to add some hyperlinks for php page with php routes
it's been a little while since I've worked with angularjs, but I think the navigation within the app itself happens with hash-based links (#). If that's the case, you could differentiate between calls that angular should catch with angular nav calls vs normal browser url calls.
localhost.com#/section -> goes through angular router
localhost.com/php-section -> reloads the page from the server
otherwise, I think ajax calls will generally escape the router module, they should hit the php server if async calls meet your needs
localhost.com#/section -> goes through angular router
localhost.com/php-section -> reloads the page from the server could it works for me?
19:49
maybe
if you use the angular methods to navigate to pages, and directly use links (<a href="/section">link</a>) for php calls, there's a reasonable potential it would work
well I will try
Wes
Wes
i am starting to regret this office job already
2.5 hours meeting this morning
"sure we can have all the meetings we want, luckily the website gets made by itself"
freaking NiNet let me buy a 2 characters domain, only to tell me a day later "We have received your payment but domain should be between 3 and 63 characters ... we can suggest you to change your domain name"???
Wes
Wes
some actually believed that the site is programming itself
21:03
Datetime object coverts to empty arrays – #78195
21:20
Does it look ok to have one corner radius more rounded than another? i.imgur.com/nWbXec9.png
it's a tiny bit strange at first glance. then I get used to it, and start to wonder if I don't actually like it
That's where I am... it is supposed to look video-game-HUD-like.
The headers at the top will be changed to graphical icons... which I will make over the weekend.
@StatikStasis well, it pretty much did :) first thing I thought about was how the box looked like in finnal fantasy 7 :)
(which is a positive thing, in my opinion, in case you're wondering)
00:00 - 22:0022:00 - 23:00

« first day (3170 days earlier)      last day (2004 days later) »