Programming Thread

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

previous topic - next topic

0 Members and 4 Guests are viewing this topic.

Go Down

the-pi-guy

That moment when you're following a tutorial for something related,  (Because you're trying to use a combination of tools that aren't the most common combination)

you figure you're okay, because the php and mysql stuff will carry over no problem

But it's not working.  And you're not sure if it's a code problem or something else.  

Then bam, 5 hours later, you find out that it's because the file you saved was in the wrong folder, because this stack requires putting it in a totally different folder than the one for the tutorial you were following.  




darkknightkryta

Apr 20, 2020, 06:55 PM Last Edit: Apr 20, 2020, 06:58 PM by darkknightkryta
I am so frustrated with the people at... whoever the hell maintains the core linux kernel (Yes I know it's more than 1 person).  So here I was, programming a usb to jamma (arcade) converter using the joystick parsers that are built in, when I plugged in my dualshock 4 and found out my dpad wasn't registering.  Buttons were, but the dpad wasn't.  Obviously, the controller works fine, as I'm using it for games.  So I go and look into things, aaaaaaaaaaaaand joystick stuff was depreciated.  It was merged in the generic event stuff.  Cause apparently mice, keyboards, microphones, and controllers all have the same needs.  So what used to be something as simple as putting in js0 (Or any number, assuming I know how many joysticks there are going to be), to me having to parse the file system looking for something that ends in (joystick-events).  So now I have to write a directory parser, that needs to be constantly run since you can plug or unplug controllers.  I also need to figure out how the hell I'm supposed to use their new parser, since there isn't much information out there.  I went from parsing a few bytes of data for 1's and 0's to having to figure out if a button is pressed or not using their convoluted event system.  There was also a lot of tools with the old system that hasn't been replaced either.  It's mind boggling to me that sort of updating their file parsers with the old system, was somehow harder to maintain than merging everything and going through the glut of their event parser.  Like, I can't even fathom who thought this was a good idea.  I have to scrap everything I did in the past few months.

On another note, I need to find out of Raspberry Pis switch their GPIO pins from read to write blazingly fast.  I made a mistake with arcade boards.  They read 0 as a button press.  I was working under the assumption that 1 was a button press.  I can't send 1 to the board cause that might damage the arcade board (5V going up stream to a pin that's sending 5V downstream).  I have to set the pin to read for it to register as a no press, and 0 for a button press.  I might have to use a register->transistor system.  But I need to work with 40 bits at least.  the largest transistor array I found is 7 bits.  This is a massive circuit if I have to go through with that idea.

Legend



Controller inputs suck everywhere. For Twisty Puzzle Simulator I used Unity input, PS4 input, Steam VR input, and Steam Controller input all because everyone tries to be a one size fits all solution yet fails.

darkknightkryta



Controller inputs suck everywhere. For Twisty Puzzle Simulator I used Unity input, PS4 input, Steam VR input, and Steam Controller input all because everyone tries to be a one size fits all solution yet fails.
What gets me is that they have to leave the joystick stuff in for legacy.  Like, holy shame, just update the joystick parsers and leave them separate.  You have to update them anyways.

the-pi-guy


Legend


Love a good Tom Scott video.

That excel bug is great. It's almost like the fake island that stayed on google maps for years.


the-pi-guy

So I bought the Real Time Rendering textbook.
I'm a bit worried about it.  The content is supposed to be better than ever, but the actual quality of the printing and binding has had scores of concerns.  Including pages just falling out.  

Legend

So I bought the Real Time Rendering textbook.
I'm a bit worried about it.  The content is supposed to be better than ever, but the actual quality of the printing and binding has had scores of concerns.  Including pages just falling out.  
Hopefully it's all good. Should be a good book to have.

the-pi-guy

I ran into a situation where it was vastly more helpful to use a book than Google.
Kept trying to use Google to figure out how to combine 2 mysql queries.  No real luck with what I searched. 

But it turned out the solution was literally on the page I left myself on in my database book. 

This whole project is kind of crazy for me.  Slapping together some PHP, HTML, CSS, Angular, and MYSQL stuff on the fly.  Despite the fact that I've done very little of any of this before. 

Hopefully it's all good. Should be a good book to have.
It seems a little on the low end, but no real problems! 

Legend

I ran into a situation where it was vastly more helpful to use a book than Google.
Kept trying to use Google to figure out how to combine 2 mysql queries.  No real luck with what I searched.  

But it turned out the solution was literally on the page I left myself on in my database book.  

This whole project is kind of crazy for me.  Slapping together some PHP, HTML, CSS, Angular, and MYSQL stuff on the fly.  Despite the fact that I've done very little of any of this before.  
It seems a little on the low end, but no real problems!  
If you don't mind sharing, what was your solution? I'm wondering if you used joined queries or did something I've never heard of since I've only learned mysql from google.

the-pi-guy

If you don't mind sharing, what was your solution? I'm wondering if you used joined queries or did something I've never heard of since I've only learned mysql from google.
Sorry, I wasn't accurate with my wording. I'm just dumb with this stuff.  And I think my googling has gotten worse or something.  Just now pretty easily found this first solution.  

What I was actually trying to figure out how to do:
SELECT x, y, z FROM a WHERE x="something" AND ( y LIKE "something" OR z LIKE "something")

This would work, but wasn't sure if I could chain it like that, because all of the examples I was looking at only looked like "a AND b AND c".

But from my book this works:

SELECT x, y, z FROM a WHERE y LIKE "something" OR z LIKE "something" from
   (SELECT x,y,z FROM a WHERE x="something")

the-pi-guy

I need to rest more.

the-pi-guy

So I'm not sure what to do here.  

My supervisor suggested just using Google sign in to manage security stuff.  

So now I'm wondering what I should do.  

1.) Should I have a register page, then they sign in later with Google and match it to the right email?  (Downside is having to deal with more stuff)

2.) Should I not have a register page, then just match an account with an email? (Downside is people could have multiple accounts on accident).  

3.) Should I do something horrible like mix and match.  Have a register page and have Google sign in also do the same kind of thing?  


I don't know what the recommendation here.  

This whole project is weird for me.  A whole mountain of stuff I don't care about.  

What kinds of not completely pointless information should I be saving?  



Not to mention, website development stuff and databases are kind of not my thing.

Legend

So I'm not sure what to do here.  

My supervisor suggested just using Google sign in to manage security stuff.  

So now I'm wondering what I should do.  

1.) Should I have a register page, then they sign in later with Google and match it to the right email?  (Downside is having to deal with more stuff)

2.) Should I not have a register page, then just match an account with an email? (Downside is people could have multiple accounts on accident).  

3.) Should I do something horrible like mix and match.  Have a register page and have Google sign in also do the same kind of thing?  


I don't know what the recommendation here.  

This whole project is weird for me.  A whole mountain of stuff I don't care about.  

What kinds of not completely pointless information should I be saving?  



Not to mention, website development stuff and databases are kind of not my thing.
I've never used google sign in but you shouldn't need to also have a registration page.

Google sign in is just used to authenticate the user. Once you know the user is who they say they are, you can seamlessly create an account on your backend if one doesn't already exist.


Shouldn't save email addresses unless you need to be using them beyond signing in.

the-pi-guy

I've never used google sign in but you shouldn't need to also have a registration page.

Google sign in is just used to authenticate the user. Once you know the user is who they say they are, you can seamlessly create an account on your backend if one doesn't already exist.
Sounds good.  This was what I was leaning towards.  


Quote
Shouldn't save email addresses unless you need to be using them beyond signing in.

Yep!  
Saving as little as possible of anything.

Go Up