« first day (3143 days earlier)      last day (1805 days later) » 

Wes
4:54 AM
any php wordpress alternative these days? cc @Danack
 
5:33 AM
For a blog or to missuse wordpress as cms?
 
Wes
for an actual blog :P
 
5:53 AM
morningz
 
ok :D typo3 with a blog extension. I never saw a good php blog software out there :(
 
wordpress is a good blog, but it's shit software
last time I actually used it, as a blogger, it was really alright ... and most bloggers don't care how it works ...
 
Yes i was pointing out the quality of the code. Never saw a good example of a good solid base
 
@DaveRandom something is up with lxr, it's alive, but behaving really strange, not sure how to fix it ...
 
 
1 hour later…
7:07 AM
Guys is there a way to query a datatable object from the variable ?
say i load my table to a variable and i need to select a row based on the ID of the row
is there a way to do it without looping ?
 
7:31 AM
*depends on how your datatable object looks :)
 
8:00 AM
disparage to depreciate by indirect means (such as invidious comparison) : to speak slightingly about
 
 
2 hours later…
10:09 AM
Morgen
 
Guten.
 
11:01 AM
Anyone know how to start an auto increment at 001?
 
Id like to do so while AI'ing as such 001, 002,... 099, 100, 101... I dont want to merely "Pad" the number as Ive seen others trying to do this which would ultimately result in 00100, 00101, 00102, ... I DONT want that
@Kalle Id seen that but that will result in 00100... Not what I want. Plz see above
 
Can't you just do like an LPAD with a max length of 3 so that once it hits 100 it won't add any more padding, or format it with str_pad in PHP perhaps?
 
+1
Gonna be investigating further
Might just roll with normal AI 1.2,3,4,5... 99,100,101...etc
Not even sure why I want to go with 001 etc
Looks better?
Instead of part number 1 I'm thinking it would look better as seeing a part number as abc001 vs abc1
Open to input
This is during the creation of my home grown shopping cart
Pretty stoked about this. No data sharing or monthly fees
100% Home Grown
and climbing
 
:) Sounds interesting!
 
11:15 AM
Work in progress @Kalle ;)
 
and here I am working on making a tool that can convert any loop + switch statements into goto to annoy my team leader at work ^^
 
Cant comment b/c you just flew one over my head
Im like a do what?
Thanks for the link tho
Yall take care
and have a great day
 
 
2 hours later…
ThW
1:31 PM
 
2:21 PM
Please, I have a laravel issue, i wrote this function for getting the last message inside the database, but instead, it is getting the first message.

$recent_message = Message::where(function ($query) {
$query->where('from', '=', Auth::user()->slug)->latest();
})->orWhere(function ($query) {
$query->where('to', '=', Auth::user()->slug)->latest();
})->first();
Im hoping to get any assistance from here, even though it is a laravel question. Thanks in advance
 
i have no idea but is there a ->last() method?
:D
 
no lol
The latest() method is already doing something similar to what last() method will be expected to do
 
2:58 PM
then you need the sort query part from that query builder
google from laravel message sortBy
and then probably something like ID asc
 
3:46 PM
Terrellbon – #78065
 
4:17 PM
What is the reason behind that kind of spam? SEO would not be working. The community is also not the best target group
 
4:56 PM
PHP eats the first byte of a program that comes from process substitution – #78066
 
5:30 PM
@user3655829 php.net ranks very highly on search terms. Most search engines put some weight for a page, on which pages link to it. So getting a link from php.net to your site should bump your site up quite a bit.
 
5:40 PM
Do you think that google doesnt filter that out?
 
No. And does it matter what I think? It's what the spammers think.
 
6:04 PM
Yay .. 6k unique visitors per day!!
 
@Wes @hakre uses Wordpress for blogging.
And I like using it for the purpose of a BLOG.
 
Pie
6:34 PM
Hi everyone
I code in java
I started learning php
but could understand code on stackoverflow
I could not understand single question
What should I do
@StatikStasis
 
7:18 PM
hy
shall we make a whatsapp group with users from all around the world
 
7:48 PM
What would cause a sha512 to change it's value when it's given the exact same string?
I'm trying to verify the data wasn't altered by using a hash.
  $payload = json_encode($this->__outputValues());
  $this->token = hash("sha512", $salt . $payload);
 
> $salt
vs
> exact same string
 
?
The $salt is just a string.
 
You don't show where it's coming from, and normally salts are uniquely generated...
 
true... this is not one of those
 
8:06 PM
Its unique to the class that's using the scratch table.
So it's a salt of sorts
just bad variable naming on my part
 
ThW
Make sure that the $salt and the $payload is really the same, you're using json_encode() so just a different order of filling the output values or a type could change the generated json string.
 
that would do it, I've noticed variables are loading into the database in a random order.
How can I fix that?
public function __outputValues() {

      $this->__normalize();

      $rtn_val = [
        "username" => $this->username,
        "password" => $this->password,
        "passwordConfirm" => $this->passwordConfirm,
        "firstname" => $this->firstname,
        "middlename" => $this->middlename,
        "lastname" => $this->lastname,
        "addressline1" => $this->addressline1,
        "addressline2" => $this->addressline2,
        "addressline3" => $this->addressline3,
        "country" => $this->country,
Should I add each item individually, instead of this nested ...
 
ThW
No, but I would suggest forced string casts
 
That's what normalize does.
Retro fits the variables from whatever they are to the expected json object.
 
ThW
And really $rtn_val? Why not name the variables like you speak them aka $returnValue
@JustinKaz you modify/change the object property types just for the output?
 
8:20 PM
lol, comes back from my old old coding days, that's like the only one... for nostalgic reasons
@ThW No. I don't cast objects. I choose to live wildly or recklessly
 
@Danack Are you reachable on your @php.net handle by mail?
 
it should forward to my own email, yes.
 
@Danack Gracias, I see the mail it redirects to is the same one gmail had auto added to my contacts :)
 
Apparently "The problem is that in JavaScript only arrays are ordered, objects are not."
but whyyyyyyyyyyyy
 
ThW
Javascript?
 
8:28 PM
I was reading this... and I am so confused.
14
Q: json_encode not preserving order

resizemyimg.comI have a multi dimensional array, in PHP: Array ( [1] => Array ( [19] => Array ( [type] => 2 ) [6] => Array ( [type] => 4 ) [12] => Arra...

 
ThW
You're expecting PHP to generate the same json and hash as some JS implementation?
 
No. I'm expecting PHP to generate the same JSON to Hash to itself
It's just not preserving the order
It's literally the same object used to store the values and verify & generate its own token. Which is why I'm confused.
 
morns
 
ThW
@JustinKaz I don't think so - log and compare the generated payload.
imho What this question is talking about is different, they talk about how this would look if you parse the JSON in Javascript
 
@Danack Sent, thanks :)
 
@Danack ;-)
 
on logs they are all out of order
 
ThW
@JustinKaz That will not happen with the source you have shown.
 
I'm still digging
 
@JustinKaz you shouldnt generate a hash from a json
and also not to compare them
there should be a better solution for your problem
 
ThW
8:50 PM
@user3655829 You can not generate a checksum from a complex structure, you need to serialize it to a string first. JSON is a valid format for that.
 
uhm
 
ThW
how the checksum/hash is used it another topic.
 
back in the years i learned programming there was a compare function for that. especially when youre comparing the same objects....
now you serialize to json and shifted the problem to the json interpretation wow
 
I will admit to not knowing I'm doing, just trying to pursue my dreams lolz
 
ThW
nope, object compare is complex. A checksum can be really useful for some use cases - think checksum files for downloads for example. Or finding duplicates in your storage.
 
8:55 PM
I'm trying to prevent the data from being tampered with
 
ThW
@JustinKaz You can't keep it on the server (in the session)?
 
It's attached to the database by a session id ( well scratch ID that's passed around)
but it is locked to a device ID - a cookie I create
 
ThW
@JustinKaz I use checksums to recognize changes, for example that a delete confirmation has the expected request variables. But I don't use it for "security"
 
It's just a simple, does this match that test. If not, throw an error.
 
ThW
Library is back to 100% code coverage - now a beer.
 
9:08 PM
So apparently when the object is stored in the database it does something weird to it.
MySQL Json field is where the madness starts.
 
ThW
Arrays in PHP have a fixed order, so you fill it in a different order.
 
It's the same function for both. The token is stored in the database than the database values are checksummed and should match the token. But this is not the case.
 
9:29 PM
I'm legitimately out of any ideas.
my next idea is to just upload the class and see if you guys can help
 
ThW
@JustinKaz my suggestion is to change normalize into a function that returns the normalized values - not change the object.
 
I also use it in validation of the object.
The interface can send whatever to it, and than it reports normal human readable errors.
 
ThW
so it does more then one thing - separate it
Do you have unit tests for it?
 
I've heard that term before.
lol, but I don't know what that is.
 
ThW
You write code that executes you "units of code" (functions, methods, ...) and validates the results.
 
9:40 PM
@ThW then youre almost at the compare function...
only with a detour over json comparing instead of value comparing
 
ThW
@user3655829 The point is to get a checksum, which allows to stuff like SELECT COUNT(*) FROM sometable WHERE checksum = :checksum or validate that the request parameters match the checksum (send as a request parameter)
 
@ThW I could kiss you! Lol! When I made normalize, normalize to an array instead of itself. For some odd reason that worked.
I suspect I should dig into it later but it seems to be working rather well.
 
ThW
@JustinKaz object state is not "immutable" - a return value is.
well except it contains an object (reference)
@JustinKaz but please learn about Unit Testing - it is one of the big steps for a developer.
 
ok
 
ThW
use it for new projects first. :-)
 
9:56 PM
How to connect reacta with api built in the php framework?
 
blake2b hash support – #78067
 
ThW
@Umbro HTTP
 
@ThW So far, I have used third party api eg spotify, youtube
@ThW Is this similar?
 
ThW
@Umbro PHP is not a framework but a programming language. It is optimized for the web and can output JSON responses easily. The how depends on both the React application and the required HTTP responses.
Here are many PHP based frameworks
 
@ThW framework Yii
 
ThW
10:05 PM
Just like React is a framework bases on JavaScript
@Umbro Well googling for "React Yii" returns yiiframework.com/extension/yii2-react
 
@ThW This is the endpoint spotify example: api.spotify.com/v1/tracks. Where can I find such an endpoint in my api. How it's working?
 
ThW
@Umbro That is a strange question, you implemented the API so you should know what you implemented.
 
@ThW It's not mine api. Only company.
@ThW I have never used such api
@ThW only spotify, youtube
 
@ThW This is a new project
 
ThW
@Umbro You will need to ask the people who implemented it. Ask for documentation.
 
10:14 PM
@ThW Only no one wants to help me. I am a total junior.
 
ThW
@JustinKaz Writing unit tests changes how you program (in a good way). So writing unit tests for existing code is difficult and frustrating. One of the idea is that you write the test before the actual code.
@Umbro At the end of the day it is HTTP requests. Use the developer tools of your browser to look at them.
 
11:09 PM
hello?
echo echo echo
 
testing 1 2 3
 
11:29 PM
morning all
 

« first day (3143 days earlier)      last day (1805 days later) »