Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

0 Members and 3 Guests are viewing this topic.

Go Down

the-pi-guy

May 01, 2020, 04:31 PM Last Edit: May 01, 2020, 04:47 PM by the-pi-guy
I have no clue what to do.  

I've spent today and yesterday trying to fix 1 bug.  

I've even tried using an example, and my code looks exactly like theirs.  But something is still amiss.  

And I'm not really sure if there's something wrong with the front end, or the back end, or if it's just a mismatch between the two.  


Just as I say this.  I have made progress....  

And it's doing it again, even after I rolled back every file.  

the-pi-guy

I have no clue what to do.  

I've spent today and yesterday trying to fix 1 bug.  

I've even tried using an example, and my code looks exactly like theirs.  But something is still amiss.  

And I'm not really sure if there's something wrong with the front end, or the back end, or if it's just a mismatch between the two.  


Just as I say this.  I have made progress....  

And it's doing it again, even after I rolled back every file.  
Very slowly figuring it out!  

the-pi-guy

The issue was the php stuff.  

Still not completely sure what is going on.  

The if statement breaks it for some reason.  Probably something stupid like a semicolon that I cant see.  

Legend

The issue was the php stuff.  

Still not completely sure what is going on.  

The if statement breaks it for some reason.  Probably something stupid like a semicolon that I cant see.  
Php can be funky with scopes, or does it not even run?

the-pi-guy

May 02, 2020, 02:44 AM Last Edit: May 02, 2020, 03:20 AM by the-pi-guy
Php can be funky with scopes, or does it not even run?
I figured it out.
It's something wrong with my mysql command.  It's not written right, but I'm not exactly sure what the exact right way to do it is.


I'm pretty burnt out though.

the-pi-guy

So my big problem is that I had no real debugging tools.  Was too lazy to do that.
I was basically just using the dev tools to tell me the angular code problems.  But the php and mysql that's inside the php does not give errors in the dev tools.  
So I had to try finding ways to debug the php and mysql separately.  

The problem was a lot easier to solve once I realized that...   :(

the-pi-guy

Sorry I like venting.  

The other really irritating thing was that the php was causing a CORS error. And literally every stack overflow post basically said it was a permission issue.  And to add the access to the .htaccess file or to add it to the post message.  


Nope. I had already tried that. The problem was something else in my mess of a program not working

the-pi-guy

It seems harder than it should be to have a method wait for a http get to return.  

The way I had it set up is to get the account, and then create it if it doesn't exist.  But there's an issue that the post doesn't wait for the get.  So it just ends up creating a new user every log in.  


But I'm wondering if it'd be easier to either:

-have the post request on the server end just check for duplicates.

-maybe roll in the get/post user into the same kind of command.  

Legend

May 04, 2020, 04:06 PM Last Edit: May 04, 2020, 04:08 PM by Legend
Are you using php?

I don't know the flow for google sign in but it shouldn't have issues like you are having.


Post and get are essentially the same thing and they go together in php. Are you talking about $_GET and $_POST not having the info you want? Or do you mean you're sending post and get info to google and not getting a response?

Edt, or you mean mysql side of things?


the-pi-guy

Are you using php?

I don't know the flow for google sign in but it shouldn't have issues like you are having.


Post and get are essentially the same thing and they go together in php. Are you talking about $_GET and $_POST not having the info you want? Or do you mean you're sending post and get info to google and not getting a response?

Edt, or you mean mysql side of things?


I mean the MySQL side. Google works good. 
I get the Google sign in and try getting the profile from MySQL.  And create one if it doesn't exist. 

I am using PHP.  I think I will try rolling it into the same php file.

Legend

I mean the MySQL side. Google works good.  
I get the Google sign in and try getting the profile from MySQL.  And create one if it doesn't exist.  

I am using PHP.  I think I will try rolling it into the same php file.
Make the google id unique in your database. Should stop dups.

the-pi-guy

Make the google id unique in your database. Should stop dups.
The issue there is, you cant make a text column unique.

The fix would be a varchar of a predetermined length. But everyone says not to do it, because the Id token supposedly can be of arbitrary length and have a tendency to get longer.

I can just make a varchar column that's just overly big.

the-pi-guy

May 05, 2020, 02:27 AM Last Edit: May 05, 2020, 03:19 AM by the-pi-guy

Once this website junk is complete, I think I want to make a quick and dirty vocab app.  

Hot jam.  

I finally got all the basic sign in stuff working!  

Today's stuff was super easy too.
-changed the PHP code to check if the user exists first, then sends either the new User or it sends the already created user.  
-changed the Angular code to wait for the profile data to get sent over, and then it changes the variable to let the user know they've been logged in.  It was literally just a 1 line code addition, but I was a bit worried that something more complicated was needed.  

the-pi-guy

May 07, 2020, 03:22 AM Last Edit: May 07, 2020, 03:39 AM by the-pi-guy
So I made a text editor for my website.

With how many WYSIWYG's editors that I was seeing while trying to find out how to make one, I was expecting it to be really difficult. 

But actually there are some good tools built into HTML/typescript that made it really easy. 

With how much work I'm putting into this, I think I'm ready to make VizionEck forum 3.0 from scratch.  8)

Nah, I really still don't like website development.

Although maybe I'll make that Japanese app a website...


Edit. Now that I think of it, the best thing that has come out of this, is to show when push comes to shove, I can push myself to make a decent sized project.

the-pi-guy

My website feels lame.  I really only made like 5 webpages.  

On the other hand, it took like 10 HTML, 10 CSS files, probably 30 typescript files, 14 php files to make it work.  

Still the learning curve really made this take a lot longer than it should have.
I think if I were making something similar in Java, it would have taken half or maybe even as little as a quarter of the time.  But it took a lot of creative bug fixing.


Go Up