VizionEck

Off-Topic => Off-Topic Community => Topic started by: the-pi-guy on Mar 13, 2016, 10:39 PM

Title: Programming Thread
Post by: the-pi-guy on Mar 13, 2016, 10:39 PM
I love programming, and I know a handful of people here also enjoy programming (or at least they do it), so why not have a thread for it?  



C++ will kill me.  
Title: Re: Programming Thread
Post by: kitler53 on Mar 13, 2016, 10:47 PM
what languages does everyone know?

i learned on c and basic but my work mostly uses c# which i spent some time getting acquainted with but i don't really know it. 
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 13, 2016, 10:52 PM
-Decent at Java
-Learning C++
-Probably doesn't count, but "TI-BASIC" it's for calculators.  :P
Title: Re: Programming Thread
Post by: Legend on Mar 13, 2016, 10:56 PM
I use PHP, Javascript, C#, and Cg/HLSL on a regular basis. 100% self taught with these so I only know what I've needed to use.

Took classes involving Python, C++, matlab, and excel's stuff but saying I'm rusty would oversell my abilities.
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 14, 2016, 01:31 PM
I love programming, and I know a handful of people here also enjoy programming (or at least they do it), so why not have a thread for it?  



C++ will kill me.  

As I say to my students: "Be kind to C and C will be kind to you."
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 24, 2016, 03:57 AM
Testing code:
*list works, adds in for loop*
*stops working*
*takes out loop*
*works*
*puts loop back in*
*stops working*
*takes out loop*
*works*
*puts loop back in*
*works*

I'm not sure what happened, but it works!  
Title: Re: Programming Thread
Post by: ethomaz on Mar 24, 2016, 05:15 PM
Right now I'm planning to create a Pilates Manegement System for my girlfriend in PHP (just because she can access from any device via Internet).

:)
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 28, 2016, 03:34 AM
If anyone has C++ knowledge, I'd like some help.  

I'm getting an error that says "does not define this operator or a conversion", but I have defined the operator, and Visual Studio even takes me to the operator when I ask for it.  

Figured it out.  
It likes it this ++way, and not this way++.  
Title: Re: Programming Thread
Post by: Legend on Mar 28, 2016, 04:21 AM
What's the difference between c++ and c#?

++way seems foreign to me.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 28, 2016, 04:32 AM
What's the difference between c++ and c#?
Haven't used C#, but from what I've seen it looks a lot like Java.

Some random person says this:
Quote
C# and Java discard C for C++. They take C++, throw away the pointer notation, and all variables become hidden pointers (except for the value types, primitive types, due to performance reasons). They add forcibly garbage collection, metadata to your classes, all the objects will be derived from a base class, called object or Object, which adds automatically virtual methods to objects, and they never compile to native code
++way seems foreign to me.
Same.  :P
I spent like half an hour, only to find the fix is putting it on the other side.  
I pretty much always write it like foo++, but this apparently needed to be written ++foo.  Not exactly sure why.  
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 28, 2016, 01:04 PM
Haven't used C#, but from what I've seen it looks a lot like Java.

Some random person says this:Same.  :P
I spent like half an hour, only to find the fix is putting it on the other side.  
I pretty much always write it like foo++, but this apparently needed to be written ++foo.  Not exactly sure why.  
The ++var notation needing to be necessary seems very weird.
Title: Re: Programming Thread
Post by: ethomaz on Mar 28, 2016, 04:16 PM
Haven't used C#, but from what I've seen it looks a lot like Java.

Some random person says this:Same.  :P
I spent like half an hour, only to find the fix is putting it on the other side. 
I pretty much always write it like foo++, but this apparently needed to be written ++foo.  Not exactly sure why. 
There are differences.

++var add first and return the val after

var++ return the val first and add after

Eg.

a = 1
b = ++a 
// result b = 2 ; a = 2

a = 1
b = a++
// result b = 1; a = 2

It is weird but that is what happen in most modern languages.

And the languages are dropping this ++ -- notation... this sintax will be deprecated soon.

Edit - A good explanation why modern languages are dropping ++ --

https://github.com/apple/swift-evolution/blob/master/proposals/0004-remove-pre-post-inc-decrement.md

Swift 2.0 didn't compile with ++ or -- code anymore.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 28, 2016, 04:20 PM
There are differences.
Yep I know all about the differences.  I just tend to try to make it work with foo++;
But in this case, it wasn't working at all with foo++;
Saying the operator wasn't defined for the class, even though it clearly was.  
Title: Re: Programming Thread
Post by: ethomaz on Mar 28, 2016, 04:22 PM
Yep I know all about the differences.  I just tend to try to make it work with foo++;
But in this case, it wasn't working at all with foo++;
Saying the operator wasn't defined for the class, even though it clearly was. 
I like them... how the code looks with these operators but there are movement in the dev scheme to drop them from all languages.

I'm not using them anymore just for the sake to don't need to review my code in the future.
Title: Re: Programming Thread
Post by: Legend on Mar 28, 2016, 04:41 PM
I like them... how the code looks with these operators but there are movement in the dev scheme to drop them from all languages.

I'm not using them anymore just for the sake to don't need to review my code in the future.
So instead they want us to write out foo+=foo?
Title: Re: Programming Thread
Post by: ethomaz on Mar 28, 2016, 04:46 PM
So instead they want us to write out foo+=foo?
:P

foo += 1

To increase 1.

foo += foo will increase the foo value to foo.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 28, 2016, 04:47 PM
So instead they want us to write out foo+=foo?
foo = foo + goo;
Title: Re: Programming Thread
Post by: Legend on Mar 28, 2016, 04:57 PM
:P

foo += 1

To increase 1.

foo += foo will increase the foo value to foo.
Oh yeah duh...  :P


foo++ is so much nicer though
Title: Re: Programming Thread
Post by: kitler53 on Mar 28, 2016, 05:07 PM
https://www.kickstarter.com/projects/primotoys/cubetto-hands-on-coding-for-girls-and-boys-aged-3

Title: Re: Programming Thread
Post by: darkknightkryta on Mar 28, 2016, 08:18 PM
Yea I saw that.  We need more of that.
Title: Re: Programming Thread
Post by: Legend on Apr 01, 2016, 09:34 PM
I froze my computer the other day.  ::)

Tried procedurally generating an 8K texture when my program already had issues at 256*256.
Title: Re: Programming Thread
Post by: ethomaz on Apr 01, 2016, 10:16 PM
I froze my computer the other day.  ::)

Tried procedurally generating an 8K texture when my program already had issues at 256*256.

Vizioneck sub 256p confirmed.
Title: Re: Programming Thread
Post by: Xbro on Apr 02, 2016, 03:12 PM
Anyone here know Ruby?
Title: Re: Programming Thread
Post by: Legend on Apr 02, 2016, 03:17 PM
Anyone here know Ruby?
Nope.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 02, 2016, 04:45 PM
No, but why?

On another note, I'm really liking C++, even though some things are a bit bleh.  
Title: Re: Programming Thread
Post by: Legend on Apr 02, 2016, 04:49 PM
Urgh, I'm going to have to learn multithreading. Most Unity games are CPU bottlenecked, and VizionEck's no different.


Also I have a memory leak. Optimizing is fun!
Title: Re: Programming Thread
Post by: ethomaz on Apr 02, 2016, 10:05 PM
Anyone here know Ruby?
Just what I learned on university... Ruby is one of most OO languages.
Title: Re: Programming Thread
Post by: Xbro on Apr 03, 2016, 03:03 AM
Just what I learned on university... Ruby is one of most OO languages.
Well would you happen to know how to send a Get request to a site with custom headers and retrieve the response?
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 03, 2016, 03:52 AM
I'm implementing multithreading into my searching program.  :)
Title: Re: Programming Thread
Post by: Legend on Apr 03, 2016, 05:15 AM
I'm implementing multithreading into my searching program.  :)
What does it search for?
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 03, 2016, 05:55 AM
What does it search for?
Nothing too exciting.  
It checks a webpage for the number of occurrences of a string is all.

For example, I could search vizioneck.com/forums./index.php?topic=5000
For all occurrences of "1/2 tau".

Or even all the pages of a thread here.  

I used it once to count how many posts you made in the million thread.
Title: Re: Programming Thread
Post by: Legend on Apr 03, 2016, 06:06 AM
Nothing too exciting.  
It checks a webpage for the number of occurrences of a string is all.

For example, I could search vizioneck.com/forums./index.php?topic=5000
For all occurrences of "1/2 tau".

Or even all the pages of a thread here.  

I used it once to count how many posts you made in the million thread.
That's cool.

Title: Re: Programming Thread
Post by: the-pi-guy on Apr 03, 2016, 06:17 AM
That's cool.


If you say so. :)
Title: Re: Programming Thread
Post by: ethomaz on Apr 03, 2016, 04:57 PM
Well would you happen to know how to send a Get request to a site with custom headers and retrieve the response?
Not that depth.

We just had a overview of the language sintax.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 04, 2016, 12:03 AM
For some reason, I'm having issues with C++.

Defining something in the .h file works perfectly.  Defining it in the cpp file stops working.  
Title: Re: Programming Thread
Post by: ethomaz on Apr 04, 2016, 12:39 AM
For some reason, I'm having issues with C++.

Defining something in the .h file works perfectly.  Defining it in the cpp file stops working. 
I don't get at all what you are saying... in easy terms I use:

myclass.hpp // declaration of my class
myclass.cpp // my class body code with #include "myclass.hpp"
main.cpp // my main programs with #include "myclass.hpp"

I can use myclass in main.cpp fine doing this way.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 04, 2016, 12:47 AM

For some reason, when I moved the constructor/destructor to the .h file, it started working.  But the other methods still do not. 
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 03, 2016, 07:39 PM
Bump. 

Programming is too much fun to not have this thread for it.  lol

These 2 code segments look the same, but for some reason one is working.  And the other is not. 

Nope, it seems even weirder, it's working with some inputs but not others. 
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 03, 2016, 08:02 PM
For some reason, when I moved the constructor/destructor to the .h file, it started working.  But the other methods still do not.  
I was having issues with this too with regular C.  I had to end up just doing all definitions in the H file.  I can't remember how to not do it that way.

Almost done making solutions to my student's assignments.
Title: Re: Programming Thread
Post by: Legend on Nov 03, 2016, 08:05 PM
A few weeks ago I copied some shader code and it had compile errors. Turns out I needed to retype a section of it myself since the webpage screwed up the characters even though they looked correct.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 03, 2016, 08:17 PM
I really don't like a lot of the Visual Studio errors. 

When I program in Java using eclipse, an error like "Expect ';' here.  Now it works. 

Right now, I'm getting an error that says "cannot open (insert file name) for writing"

What does this even mean?
This is like the 20th time for me to run the program, and only now it stops working. 

----------
Started working again after restarting my computer... 
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 03, 2016, 10:26 PM
(http://imgs.xkcd.com/comics/wisdom_of_the_ancients.png)
Title: Re: Programming Thread
Post by: Legend on Nov 03, 2016, 10:46 PM
(http://imgs.xkcd.com/comics/wisdom_of_the_ancients.png)
I hate/love it when I have a problem and there aren't any results on google, so I just kinda give up and work on something else. Then later on I get back to it and find a ton of results on google, only to realise it's been over a year since I first tried it.
Title: Re: Programming Thread
Post by: the-pi-guy on Jan 20, 2017, 11:32 PM
Been working on a project every so often, the past few days.
Basically I made a text file that contains the unicodes for Japanese characters (at least hiragana and katakana).
The text file was supposed to make it easy for expansion, so I could start adding Kanji characters very easily.  

Been having troubles implementing this in Java.  Was reading up about better ways to implement the text file reader.  I was having issues, because the IDE that I'm using wasn't able to show the characters, so without implementing something, there was no way to find out if the program was working.  
So I implemented a little drawing interface, and found a really easy way to make the character importer worked (a few days after I started....)  Would have been nice to find out about that earlier.  
Then I was able to quickly make a thing that would convert the hexadecimal to the characters they needed to be.  
So the character importer is now working!  
Title: Re: Programming Thread
Post by: Legend on Jan 21, 2017, 12:52 AM
Been working on a project every so often, the past few days.
Basically I made a text file that contains the unicodes for Japanese characters (at least hiragana and katakana).
The text file was supposed to make it easy for expansion, so I could start adding Kanji characters very easily.  

Been having troubles implementing this in Java.  Was reading up about better ways to implement the text file reader.  I was having issues, because the IDE that I'm using wasn't able to show the characters, so without implementing something, there was no way to find out if the program was working.  
So I implemented a little drawing interface, and found a really easy way to make the character importer worked (a few days after I started....)  Would have been nice to find out about that earlier.  
Then I was able to quickly make a thing that would convert the hexadecimal to the characters they needed to be.  
So the character importer is now working!  
What's your end goal?

I use monodevelop with Unity and so far it has every foreign character. Can also change its font if you need support for something specific.


When you mention hexadecimal, are you talking about Unicode encoding? Like 6F22 being the code for 漢?
Title: Re: Programming Thread
Post by: the-pi-guy on Jan 21, 2017, 05:26 AM
What's your end goal?
Make some sort of vocabulary game.  
Either flashcards or make one of those falling word games.  I'm not sure exactly yet.  

I use monodevelop with Unity and so far it has every foreign character. Can also change its font if you need support for something specific.
The IDE itself utilizes unicode, but it doesn't output in the console part of it.  
System.out.println( "漢");
Would work fine, but it would output a "?"

When you mention hexadecimal, are you talking about Unicode encoding? Like 6F22 being the code for 漢?
Yeah, unicode encoding.
In java, you have to do it like \u6F22, but it wasn't working through the text file.  
But there's an easy way to just cast it into a character.  (char)6F22
Except I had to change to decimal, because the integer parser worked only for decimal.  
Title: Re: Programming Thread
Post by: Legend on Jan 21, 2017, 07:21 AM
The IDE itself utilizes unicode, but it doesn't output in the console part of it.  
System.out.println( "漢");
Would work fine, but it would output a "?"
Did the ? look like this REMOVED or � ? (I have no idea what that will look like to you) In my experience the problem is that the font doesn't support that character.

Yeah, unicode encoding.
In java, you have to do it like \u6F22, but it wasn't working through the text file.  
But there's an easy way to just cast it into a character.  (char)6F22
Except I had to change to decimal, because the integer parser worked only for decimal.  
Clever solution. ;D  I was doing some testing a long while back and came up with such a convoluted mess to get the job done. I'd be embarrassed having to show my code to others.


EDT: had to remove the first symbol. It confused the forum and erased the rest of my post.
Title: Re: Programming Thread
Post by: the-pi-guy on Jan 21, 2017, 12:57 PM
Did the ? look like this REMOVED or � ? (I have no idea what that will look like to you) In my experience the problem is that the font doesn't support that character.
It is literally just the ? mark.  
Might have been that something wasn't working quite right or that there's a setting that needed to be changed in eclipse.  Not exactly sure, I tried messing with a few.

Clever solution. ;D
Thanks!  
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 03, 2017, 01:08 AM
We are using Python for my Artificial Intelligence class.  
Did a little over view the past 2 class periods of python.  
It's kind of ludicrous.  

No semicolons, use indentation instead of braces for things.
Loosely typed madness.

Declare two variables like this:
x,y=50,100

Swap statement:
x,y=y,x

return a,b,c

def method(a,b=10,c=12)

call the method in any of these ways:
method(c = 15, a=16)
method(12, b=15,c=17)
method(c=12,b=12,a=7)
Title: Re: Programming Thread
Post by: Legend on Feb 03, 2017, 02:13 AM
We are using Python for my Artificial Intelligence class.  
Did a little over view the past 2 class periods of python.  
It's kind of ludicrous.  

No semicolons, use indentation instead of braces for things.
Loosely typed madness.

Declare two variables like this:
x,y=50,100

Swap statement:
x,y=y,x

return a,b,c

def method(a,b=10,c=12)

call the method in any of these ways:
method(c = 15, a=16)
method(12, b=15,c=17)
method(c=12,b=12,a=7)

I used python a few times in college. Their method system is something I liked a lot  ::)
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 03, 2017, 01:58 PM
I used python a few times in college. Their method system is something I liked a lot  ::)
The language is like mystical.  A lot of features that seem like bad ideas in other languages.  
Totally different from Java, C++.  
Title: Re: Programming Thread
Post by: Xevross on Feb 03, 2017, 10:17 PM
My tutors said we used python because it's clear and tidy
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 15, 2017, 04:30 PM
My tutors said we used python because it's clear and tidy
It is.  

P = "hello world"
Print(P)


Java:
String P= "hello world";
System.out.print(P);
Title: Re: Programming Thread
Post by: Xevross on Feb 15, 2017, 05:42 PM
It is.  

P = "hello world"
Print(P)


Java:
String P= "hello world";
System.out.print(P);
Yeah when I used it for our project it was super easy to pick up different concepts and use them. I'm quite happy with it.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 25, 2017, 10:42 PM
Programming Languages Influence Network | Exploring Data (https://exploringdata.github.io/vis/programming-languages-influence-network/)
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 26, 2017, 12:28 AM
I wanted to use Python to teach, but the lack of braces and semi colons put me off.  I don't want my students coding like bedsprings.  I want them to get gud, so I'm teaching them Java.  I'm actually contemplating teaching them C next year.
Title: Re: Programming Thread
Post by: the-pi-guy on May 12, 2017, 02:07 PM
I am starting to really hate python.  

Code that I haven't touched in the past 8 runs of my program just randomly decided that the spacings were wrong.  
Title: Re: Programming Thread
Post by: darkknightkryta on May 12, 2017, 04:01 PM
I am starting to really hate python.  

Code that I haven't touched in the past 8 runs of my program just randomly decided that the spacings were wrong.  
I don't like Python's structure.  It's why I'm not really teaching with it.
Title: Re: Programming Thread
Post by: Legend on May 14, 2017, 01:09 AM
I made a time tracker for Unity. Now I can know every 10-millisecond I spend working.

Time to track my non-productivity!
Title: Re: Programming Thread
Post by: the-pi-guy on May 14, 2017, 03:21 AM
(https://pics.me.me/using-git-to-distribute-and-manage-code-using-google-docs-19973310.png)
Title: Re: Programming Thread
Post by: Legend on May 15, 2017, 12:25 AM
(https://forum.unity3d.com/attachments/image-jpg.107559/)
Title: Re: Programming Thread
Post by: darkknightkryta on May 15, 2017, 12:35 AM
I think I have to learn php...
Title: Re: Programming Thread
Post by: Legend on May 15, 2017, 01:19 AM
I think I have to learn php...
I Like php.

I Write it in a text editor.
Title: Re: Programming Thread
Post by: darkknightkryta on May 15, 2017, 01:43 AM
I Like php.

I Write it in a text editor.
I forgot to mention sql.
Title: Re: Programming Thread
Post by: Legend on May 15, 2017, 02:22 AM
I forgot to mention sql.
I Like sql.

THe forum software handles the integration part so I can't help with that, but I do a lot of queries myself.
Title: Re: Programming Thread
Post by: the-pi-guy on May 15, 2017, 02:33 AM
(http://i.imgur.com/ojUc2Ui.png)

https://www.reddit.com/r/rails/comments/6b2zlw/are_trains_still_running_in_maltby_rotherham_uk/
Title: Re: Programming Thread
Post by: Legend on May 15, 2017, 02:37 PM
(http://i.imgur.com/ZCqw2oL.jpg)
Title: Re: Programming Thread
Post by: the-pi-guy on May 15, 2017, 03:50 PM
I really don't like those brackets though.  

If coding doesn't work, apply algorithms.  
If algorithms don't work, make some code.  
If you're dealing with the halting problem, you're dead.  
Title: Re: Programming Thread
Post by: darkknightkryta on May 16, 2017, 12:52 PM
I Like sql.

THe forum software handles the integration part so I can't help with that, but I do a lot of queries myself.
I was introduced into a web based teaching tool.  It lays out units and lessons as if they were RPG battles.  So you complete a lesson, you gain experience.  I wanted to program my own.  Which is why I think I need to learn php and SQL.
Title: Re: Programming Thread
Post by: Legend on May 16, 2017, 02:20 PM
I was introduced into a web based teaching tool.  It lays out units and lessons as if they were RPG battles.  So you complete a lesson, you gain experience.  I wanted to program my own.  Which is why I think I need to learn php and SQL.
Making the lessons may be harder but overall sounds easy. Php and sql would be perfect for that.
Title: Re: Programming Thread
Post by: darkknightkryta on May 16, 2017, 03:19 PM
Making the lessons may be harder but overall sounds easy. Php and sql would be perfect for that.
I have the lessons done.  It's more of creating a way to upload the files, create a "user" in SQL with specific data, creating a json or xml generator to use to create webpages, etc.
Title: Re: Programming Thread
Post by: Legend on May 16, 2017, 03:32 PM
I have the lessons done.  It's more of creating a way to upload the files, create a "user" in SQL with specific data, creating a json or xml generator to use to create webpages, etc.
PHp creates webpages directly? Use echo.
Title: Re: Programming Thread
Post by: the-pi-guy on May 16, 2017, 05:43 PM
I messed up my search engine.  :P
Breaks if you try searching a word that isn't in any of the documents. 
Would have been nice if I tried that before turning it in....
Title: Re: Programming Thread
Post by: DerNebel on May 16, 2017, 05:46 PM
Any of you guys know ABAP?
Title: Re: Programming Thread
Post by: Legend on May 16, 2017, 06:06 PM
Any of you guys know ABAP?
Nope. Never heard of it even.

Are you needing to learn it?
Title: Re: Programming Thread
Post by: DerNebel on May 16, 2017, 06:26 PM
Nope. Never heard of it even.

Are you needing to learn it?
Yeah, I just got out of a 5 day training session as part of my work traininig, now I knoe the basics at least.

It's the programing language used in SAP, not all that sexy honestly,  ;D
Title: Re: Programming Thread
Post by: darkknightkryta on May 16, 2017, 11:17 PM
PHp creates webpages directly? Use echo.
You can embed php into html.  I like it better than Ruby.
Title: Re: Programming Thread
Post by: Legend on May 16, 2017, 11:58 PM
You can embed php into html.  I like it better than Ruby.
EMbeding html in php is so much nicer. Gives you a lot more control.
Title: Re: Programming Thread
Post by: the-pi-guy on May 28, 2017, 04:09 PM
(https://imgs.xkcd.com/comics/workflow.png)
Title text: There are probably children out there holding down spacebar to stay warm in the winter! YOUR UPDATE MURDERS CHILDREN.



This will never not be funny.  
Title: Re: Programming Thread
Post by: Legend on May 28, 2017, 09:53 PM
IN Unity I was doing some custom rendering stuff. I could have merely put a script on each camera that needed it, but that would have been annoying. Instead I just set it up to auto work on every camera.

TUrns out this really ment every camera. Even the little preview images for materials in the editor were getting the custom rendering. I break Unity a lot.
Title: Re: Programming Thread
Post by: the-pi-guy on May 31, 2017, 01:38 PM
(https://i.redd.it/zg2r8snhgt0z.jpg)
Title: Re: Programming Thread
Post by: Legend on May 31, 2017, 04:08 PM
Oooh I just learned about "ref." That works so much better than "out" for lots of things.  ::)
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 05, 2017, 03:57 PM
(https://i.redd.it/012cukejqs1z.png)
Title: Re: Programming Thread
Post by: Legend on Jun 05, 2017, 04:04 PM
(https://i.redd.it/012cukejqs1z.png)
These volume memes have been amusing.

(https://thumbs.gfycat.com/PassionateOddballBlueandgoldmackaw-size_restricted.gif)
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 06, 2017, 12:06 PM
Game developers who have worked on terrible games, when and why did you realize the game was going to flop? : AskReddit (https://www.reddit.com/r/AskReddit/comments/6fjxym/game_developers_who_have_worked_on_terrible_games/)
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 06, 2017, 01:16 PM
Game developers who have worked on terrible games, when and why did you realize the game was going to flop? : AskReddit (https://www.reddit.com/r/AskReddit/comments/6fjxym/game_developers_who_have_worked_on_terrible_games/)
I hate that you fail upwards in life.  You honestly need to pass some kind of sanity test before you're allowed to move into any management position.
Title: Re: Programming Thread
Post by: Legend on Jun 09, 2017, 03:20 AM
wowowowowowowowowowoowwowowowoow oh my gosh


YOU CAN CHANGE AN INDIVIDUAL VECTOR NUMBER!!!!!

vectorname.x=5 is valid!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Holly mothballs that's incredible!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


I'm pretty sure what happened is back when I was learning Unity in 2013 I saw that transform.position.x could not be set directly, so I just assumed that was a way vectors worked instead of how position works. Blows my mind. Instead I've been doing stuff like vectorname=new Vector3(5, vectorname.y, vectorname.z). Really doesn't affect the results of the code, but it's a great quality of life feature to know about.
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 11, 2017, 01:49 PM
(https://i.redd.it/xwlb42y2nx2z.gif)
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 14, 2017, 12:23 PM
(https://i.imgur.com/FoQ0hUA_d.jpg?maxwidth=640&shape=thumb&fidelity=high)

"It is a bit of a problem. I'm British and I still often type 'colour' rather than the American 'colour' in css, or forget to use the American spelling 'true' rather than 'indubitably'"
Title: Re: Programming Thread
Post by: Legend on Jun 14, 2017, 02:46 PM
How does programing work in other languages?

Is it common practice to just do everything in English like it's designed, or is the local language sprinkled in when possible?
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 14, 2017, 02:53 PM
How does programing work in other languages?

Is it common practice to just do everything in English like it's designed, or is the local language sprinkled in when possible?
Lol, thats actually what that post comes from.
programming languages - Do people in non-English-speaking countries code in English? - Software Engineering Stack Exchange (https://softwareengineering.stackexchange.com/questions/1483/do-people-in-non-english-speaking-countries-code-in-english)

Basically they use English or some combination of English and their native language.  

I do know there are some programming languages in other languages but they are not always very popular.  
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 20, 2017, 02:28 PM
Trying Android Studio, but it's not really cooperating with me. 
Took an hour to start up certain aspects of it.  It had to redownload some things, but it was still troublesome. 

Also I think this is just such a weird setup. 
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 20, 2017, 06:30 PM
So I'm going to make a vocabulary game on my android.  Probably going to make a couple.  
All to learn japanese vocab.  

Starting out with some matching.  I have been putting some thoughts together about a few other apps, that I might finally decide to put together.  

I have an idea of using what I know of Japanese to make a text based RPG kind of game, but we will see about that.  

Also thinking I will make some conjugation practicers.  
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 21, 2017, 12:53 PM
Was trying to take this page:
List of jōyō kanji - Wikipedia (https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji)
Take all the Kanji and their meanings and map them up to a database.  Was having a lot of trouble.  There were a few entries that would break.  Like that one with 3 kanji in the box.  
I spent  a few hours and a few hundred lines of code trying to get it to work.  
Anyways it turned out to be much easier, just to use excel and take out all the stuff pretty easily.  

Matching each kanji and counting the unicode from this page was much easier.
 Unicode Kanji Code Table (http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml)

But one of the characters still seems to be breaking..
Title: Re: Programming Thread
Post by: Legend on Jun 21, 2017, 02:12 PM
ARe you parsing the raw html? Fetching it with an xml parser might help. That's how our bot system searches websites for content.
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 21, 2017, 03:28 PM
ARe you parsing the raw html? Fetching it with an xml parser might help. That's how our bot system searches websites for content.
Wouldn't really fix the issues I'm working with.  
Now, I'm getting some kind of weird error.  The output shows that a character is the first one, and I removed all the spaces.  Yet the character isn't grabbed unless I grab the second character...
Title: Re: Programming Thread
Post by: Legend on Jun 21, 2017, 03:40 PM
Wouldn't really fix the issues I'm working with.  
Now, I'm getting some kind of weird error.  The output shows that a character is the first one, and I removed all the spaces.  Yet the character isn't grabbed unless I grab the second character...
I love those errors. Can you force your system to tell you the value of the first character for debugging?
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 21, 2017, 03:44 PM
I love those errors. Can you force your system to tell you the value of the first character for debugging?
Yep, I figured it out.
Why is  appearing in my HTML? - Stack Overflow (https://stackoverflow.com/questions/9691771/why-is-65279-appearing-in-my-html)
'ZERO WIDTH NO-BREAK SPACE'
And it has been fixed!
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 21, 2017, 04:27 PM
That was probably the worst project I've ever done.  Really should have been a few hour project at worst, but quickly became a day and a half thing.  Wasn't working on it the whole time, but eh.  
I had a bunch of difficulties.  

The one part of the project was to grab each listing from Wikipedia.  This was hard because the table wasn't consistent. Some boxes were empty, other boxes had three things in them, each on it's own line.  Plus the first two boxes were usually identical.
Ultimately I did this manually.  Got rid of all those boxes as they were all in the same line.  Excel and the formatting Wikipedia used ultimately made this a few minute process at most.  

Second difficulty was using that site to match up the kanji to a Unicode.  So I used a counter to start with 0 and go all the way up to f using the first part of the string as the number.  
This was actually pretty easy.  Just had to be careful of spaces and double spaces while counting.  The solution is of course to get rid of all the spaces.  

Third difficulty - deleting lots of my code thinking I would never use it anymore.  Then finding that there was a one off error in the character database.  But this time I made it much more optimized.  Originally it just continually combed the kanji Unicode website, refetching it every time I wanted to match a character.  
Now it just keeps it on for usage.  


Voila a few minutes later. And I have a database of 2300 characters.  
And me wondering at what point would it have been more efficient to just have done it manually, with the starter code I had.  
The starter code asked me for each character, and then fetched the kanji Unicode as before.  

(https://imgs.xkcd.com/comics/the_general_problem.png)

This xkcd comic is painfully true sometimes.  
Title: Re: Programming Thread
Post by: Legend on Jun 21, 2017, 05:48 PM
Yup it's just so fun to over engineer things. I do that every week  :P


Biggest problem I have is accepting that rapid iteration is so much faster than doing something perfect the first time. I've gotten better in the last year at least.
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 22, 2017, 06:19 PM
Has anyone made an Android app?
Title: Re: Programming Thread
Post by: Legend on Jun 22, 2017, 06:35 PM
Has anyone made an Android app?
No.

Are you making your vocab learner into one?
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 22, 2017, 06:40 PM
No.
Are you making your vocab learner into one?
That's my plan.  
It's different than what I'm used to.
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 22, 2017, 08:22 PM
Trying Android Studio, but it's not really cooperating with me.  
Took an hour to start up certain aspects of it.  It had to redownload some things, but it was still troublesome.  

Also I think this is just such a weird setup.  
Yeah... Still better than Eclipse
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 22, 2017, 08:30 PM
Yeah... Still better than Eclipse
I haven't had problems with eclipse.  :p
This on the other hand....
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 22, 2017, 11:06 PM
I haven't had problems with eclipse.  :p
This on the other hand....
You haven't Blackberry programmed in Eclipse.  I have... shudders...

But yeah I think you just have to get used to the xml programming.  Or getting used to the UI tools and then hooking them into Activities.
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 23, 2017, 01:47 PM
Obviously there are vocabulary apps on Android.  There are like a ton of them, but the vast majority of them either cost money, or they have in-app purchases.  Some of them aren't very feature filled.  

So, benefits are that I can control what the vocab list is, and I'd be able to expand into some new things.

You haven't Blackberry programmed in Eclipse.  I have... shudders...
But yeah I think you just have to get used to the xml programming.  Or getting used to the UI tools and then hooking them into Activities.
Yeah, I wouldn't want to use Eclipse for this.  

I'm having issues with this.  It comes with a fair amount of auto generated code, but there were two lines of which that the compiler can't match up anything to.  I tried removing the lines, and I tried doing some other things with those lines.  But I'm not sure if I'm missing something on the xml side or if I'm missing something on the java android side of things.  
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 23, 2017, 03:23 PM
Obviously there are vocabulary apps on Android.  There are like a ton of them, but the vast majority of them either cost money, or they have in-app purchases.  Some of them aren't very feature filled.  

So, benefits are that I can control what the vocab list is, and I'd be able to expand into some new things.
Yeah, I wouldn't want to use Eclipse for this.  

I'm having issues with this.  It comes with a fair amount of auto generated code, but there were two lines of which that the compiler can't match up anything to.  I tried removing the lines, and I tried doing some other things with those lines.  But I'm not sure if I'm missing something on the xml side or if I'm missing something on the java android side of things.  
XML.  You have to make sure you rmanifest file is right.  Plus you have to add all your activities to your manifest, or something.  It's been a while so I don't quite remember.
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 26, 2017, 02:03 AM
It's not very fun when I don't know where an error is.  
Android Studio isn't reporting any error right now, but my app keeps crashing.  :P
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 26, 2017, 08:42 PM


  Log | Android Developers

 (https://developer.android.com/reference/android/util/Log.html)

lol, there's a log.wtf for logging messages.  
Title: Re: Programming Thread
Post by: Legend on Jun 27, 2017, 02:55 AM
It's not very fun when I don't know where an error is.  
Android Studio isn't reporting any error right now, but my app keeps crashing.  :P
I'm practically all self taught so welcome to my world! I would never know where an error is or what the error even is.

I'd use a freakton of print statements to breakup the code so I can track down which section the error occurred. If it's a problem where the program just crashes or can't run, I'd comment out all the newish code and slowly add it back until it breaks again. Also involved a lot of just general trial and error.

Wasn't until fairly later that I actually started learning about the "correct" way to fix bugs.
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 27, 2017, 10:50 AM
I'm practically all self taught so welcome to my world! I would never know where an error is or what the error even is.

I'd use a freakton of print statements to breakup the code so I can track down which section the error occurred. If it's a problem where the program just crashes or can't run, I'd comment out all the newish code and slowly add it back until it breaks again. Also involved a lot of just general trial and error.

Wasn't until fairly later that I actually started learning about the "correct" way to fix bugs.
Eclipse would show where the error occurred.  
It'll say what line and give a general reason why it broke.  Then I'd pack that area with prints to see what the trouble variable was doing, unless the problem was obvious.  

Android Studio doesn't seem to do the same thing.  Even though it uses Java System.out.print doesn't work.  Had to look up how to do it.  I still wasn't sure it was working. The thing it prints out to is filled with stuff, and nothing sticks out.  

The problem is, it'd compile and everything.  But if I tried running a certain activity, it'd break.  I had no idea where.  I tried the debug thing and it at one point didn't even seem to be teaching my code.  :P
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 27, 2017, 02:51 PM
Everything seems to be working.  
Now to see if I can break it.  
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 27, 2017, 05:37 PM
"How to read from a file"
Make sure it's in the asset folder. 
"It works! "

"how to write to the file"
You can't write to the asset folder during runtime. 
:o >:(

Now I have to redo the reading.  :P
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 02, 2017, 01:00 AM
My app is "finished".
Everything seems to be functional.  I have  around 500 vocab words on there.  A matching game works, and the translation game works.  

My complaints are:. The text is hard to read.  It's dim. Theres also some weird view issues.  When the app starts up, it starts in a full screen that is blank.  Touching the screen causes the full screen to go away, and the buttons to appear.  Not exactly sure what the issue is.  

Also in the matching game, the buttons change size with different words, which is fine.  But the buttons are aligned with the one below it.  The alignment means that longer words will push both boxes into the ones on the left.  
Problems aren't so bothersome that I will fix them, I don't think.  

On another note.  
I really enjoy discovering tricks.  
I did this a lot when programming my calculator.  
For example, there wasn't a way to append a number to a string.  The way to get around this was to basically turn the number into a function and then transfer that function to a string, then you could append it.  

Also graphics tricks were fun.  They were pretty obvious, but the results were pretty cool. So I was making a menu.  And originally, I had it set up to output every time the cursor moved.  Which is ludicrous.
Instead I just erased where the cursor was, and Drew it in the new place.  Ran faster, and looked better (because it wasn't flashing while drawing).
Title: Re: Programming Thread
Post by: Legend on Jul 02, 2017, 01:52 AM
For example, there wasn't a way to append a number to a string.  The way to get around this was to basically turn the number into a function and then transfer that function to a string, then you could append it.  
Strings suck. The standard ones in C# are so inefficient to change or modify. Appending a letter to the end of a string actually generates a new string and tosses the old one.

What do you mean you turned the number into a function?
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 02, 2017, 02:29 AM
What do you mean you turned the number into a function?
The TI-83 is basically all preset variables.  A,B,C,etc for numbers.  
Str0, Str1, Str2, all the way to Str9

They also have y1, y2, etc are the functions that the calculator graphs.  The only variables that can be made are lists.  

But something like "A"+6 doesn't work.  It gives a data type error.  

You have to convert the 6 to a string using this code.  (Where N=6)

 {0,1→L₁
:{0,N→L₂
:LinReg(ax+b) Y₁
:Equ►String(Y₁,Str1
:sub(Str1,1,length(Str1)-3→Str1

Basically it makes 2 lists one for the domain and one for the range of the function.  
From these two lists, the next line makes the function
Y1=Nx+0
It then transfers from the function y1 to the string str1.
At which point substring cuts off the "x+0".  

How's that for inefficient!
Title: Re: Programming Thread
Post by: Legend on Jul 08, 2017, 04:35 PM
(https://i.imgur.com/fbrxjMk_d.jpg?maxwidth=640&shape=thumb&fidelity=high)
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 02, 2017, 05:26 PM
This next semester, I have Operating Systems, Software Engineering I and Computer Organization.  

SE I is all about practices.  How to design stuff, how to test stuff, how to communicate with a client.  This one has a major project.  
"This course will provide an in-depth study and analysis of at least one large scale software
system. Students will analyze, design, and partially implement an extensive software
project. Case studies will address major system concerns such as specification,
classification, inter-relationships, validation, and evaluation. Other topics include the use of
UML, prototyping, data flow diagrams, etc."


Computer Organization "This course focuses on the design of microprocessors, especially
the Arithmetic and Logic Unit and the Control Unit, as well as the memory hierarchy, especially registers,
DRAM-based main memory and caches"

Operating Systems. "
An introduction to operating systems concepts. Topics covered include: interrupts,
memory allocation, virtual memory techniques, process scheduling and synchronization,
deadlocks, resource allocation, and file systems. A major programming project will be
assigned to provide experience with operating system design."

From what I hear is, Computer Organization is probably the hardest class in the major.  
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 07, 2017, 03:04 AM
My app is "finished".
Everything seems to be functional.  I have  around 500 vocab words on there.  A matching game works, and the translation game works.  

My complaints are:. The text is hard to read.  It's dim. Theres also some weird view issues.  When the app starts up, it starts in a full screen that is blank.  Touching the screen causes the full screen to go away, and the buttons to appear.  Not exactly sure what the issue is.  

Also in the matching game, the buttons change size with different words, which is fine.  But the buttons are aligned with the one below it.  The alignment means that longer words will push both boxes into the ones on the left.  
Problems aren't so bothersome that I will fix them, I don't think.  
Tomorrow my plan is to update my app.  
Already fixed the matching button issue.  Probably won't fix the previous one.

The biggest thing will be the vocab will be greatly expanded.  I finally found an awesome vocab list that has something like 1400-1500 words in it.  Just have to build something to go through the excel file I guess...  
Would be nice if there was already a program built that could make it easy...
Title: Re: Programming Thread
Post by: Legend on Aug 07, 2017, 06:14 AM
I Learned ++int is not thread safe. Seems I had two different threads doing ++int and --int on the same value at the exact same time and only one or the other would be applied.

Explains why the glitch I was noticing was so rare.
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 07, 2017, 09:07 PM
Someone actually made a huge vocab list from this other textbook I have.  Which has ~7200 words.  This is going to be huge.  :o

I Learned ++int is not thread safe. Seems I had two different threads doing ++int and --int on the same value at the exact same time and only one or the other would be applied.

Explains why the glitch I was noticing was so rare.
In my second programming class, there was a little bit about multithreading. 
We had to use "synchronized", a keyword in Java.  Otherwise if we assigned one thread to add 2500 to a number, and another thread to add 2500 to the same number, it usually wouldn't quite make it up to 5000. 
Both threads would access the number, and change it at the same time.  Which would cause it to only go up by 1 instead of 2. 

"synchronized" made sure that the other thread would wait for the thread to finish accessing it. 

Although it was funny, because when the teacher tried demonstrating it, without the keyword (so he was expecting something like 4800 something.)  It actually got really lucky and made it all the way to 5000, 2 out of the first 5 times.  Only 2 times it actually worked. 
Title: Re: Programming Thread
Post by: Legend on Aug 07, 2017, 09:29 PM
Someone actually made a huge vocab list from this other textbook I have.  Which has ~7200 words.  This is going to be huge.  :o

In my second programming class, there was a little bit about multithreading.  
We had to use "synchronized", a keyword in Java.  Otherwise if we assigned one thread to add 2500 to a number, and another thread to add 2500 to the same number, it usually wouldn't quite make it up to 5000.  
Both threads would access the number, and change it at the same time.  Which would cause it to only go up by 1 instead of 2.  

"synchronized" made sure that the other thread would wait for the thread to finish accessing it.  

Although it was funny, because when the teacher tried demonstrating it, without the keyword (so he was expecting something like 4800 something.)  It actually got really lucky and made it all the way to 5000, 2 out of the first 5 times.  Only 2 times it actually worked.  
Yeah in C# it's called "lock." I'm needing my code to run as fast as possible so I tried to design it with as few locked parts as possible.

However I'm probably still going to switch it over to the GPU. I'm rendering 100s of thousands of lines and issuing the draw call can take so much CPU time. Instead I figure I could store the lines in a compute buffer and render them in a more direct fashion.
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 08, 2017, 03:04 AM
I was thinking about my raspberry 1/2 tau project.  And I think right now I'm going to scale down the hardware part of it.  I don't think I really have the art skills to build the case that I'd want.  Instead I think I can probably make something decent, just by making a case for the screen and the 1/2 tau itself (Actually found one made, that I plan on paying Tacos to make for me.)  

It'll be a bit lame, but I think it'll be fairly cool and get some actual usage out of it.  Then I could use the battery to connect to the 1/2 tau outside of the case.  And have a controller of some sort.  I don't like having to carry around 3 parts, but it'll be something at least...  Maybe just have a little bag or something to make it more manageable.

I also want to look into making some sort of OS for it.  I have that class coming up, and it'd be really cool to have something substantial to show for it.  
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 19, 2017, 08:49 PM
(https://i.redd.it/thv46yzpcpgz.png)
Title: Re: Programming Thread
Post by: Legend on Aug 20, 2017, 09:45 PM
(https://i.redd.it/5u8fw0stmvgz.jpg)
Title: Re: Programming Thread
Post by: Legend on Aug 29, 2017, 11:54 PM
"A different error message! Finally some progress!"
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 04, 2017, 03:08 PM
(()(())+())(+())(++(+())(+())) is "n" in javascript : ProgrammerHumor (https://www.reddit.com/r/ProgrammerHumor/comments/6xzcgb/is_n_in_javascript/)
Title: Re: Programming Thread
Post by: Legend on Sep 04, 2017, 05:13 PM
(()(())+())(+())(++(+())(+())) is "n" in javascript : ProgrammerHumor (https://www.reddit.com/r/ProgrammerHumor/comments/6xzcgb/is_n_in_javascript/)
That's kinda awesome!
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 04, 2017, 05:20 PM
That's kinda awesome!
It's awesome and horrifying at the same time.
Title: Re: Programming Thread
Post by: Legend on Sep 19, 2017, 08:08 AM
(https://i.redd.it/6ikzrki1jrmz.gif)
Title: Re: Programming Thread
Post by: Legend on Sep 21, 2017, 12:11 AM
YOU MUST BE LOGGED IN TO SEE THIS CONTENT
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 21, 2017, 01:54 PM
Have a virtual machine so I can program C with all the special features.  
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 22, 2017, 09:38 PM
It's been pretty cool learning how an OS works. How it manages processes and threads.
Title: Re: Programming Thread
Post by: Legend on Sep 23, 2017, 12:09 AM
It's been pretty cool learning how an OS works. How it manages processes and threads.
How good is windows in regards to that stuff?
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 23, 2017, 12:29 AM
How good is windows in regards to that stuff?
We aren't doing so much with how specific OS do things.  
Just the how, why threads/processes work the way they do, and how to implement them.  

The professor has sometimes mentioned tidbits about certain OS's, but it's not the focus.  
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 23, 2017, 06:36 PM
The OS has to basically switch from a process to itself to a process every time interval.  
There's also special permissions that the OS has to manage to ensure that software is limited to it's own space, but also able to expand that space to look infinite.
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 25, 2017, 10:25 PM
A lot of newbie programmers are really bad.  Like I was never this bad.
Title: Re: Programming Thread
Post by: Legend on Sep 25, 2017, 11:01 PM
A lot of newbie programmers are really bad.  Like I was never this bad.
I was bad.

On one of my first school projects I didn't understand functions yet and just copy/pasted code inside itself to nest it...
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 25, 2017, 11:10 PM
I was bad.

On one of my first school projects I didn't understand functions yet and just copy/pasted code inside itself to nest it...
Lol. That's not too bad. 

Some of these people are in their second programming class, and they still seem to have trouble understanding some pretty basic stuff. 
Like some still have trouble understanding different data types and stuff.

Maybe part of it is I'm kinda biased towards my skill now, but some people seem to have a struggle with it.
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 26, 2017, 02:50 PM
Have to program a shell. :o
Title: Re: Programming Thread
Post by: darkknightkryta on Sep 26, 2017, 03:56 PM
How good is windows in regards to that stuff?
Not sure now, but it was terrible before.  Windows didn't really properly multi task until recently.

The OS has to basically switch from a process to itself to a process every time interval.  
There's also special permissions that the OS has to manage to ensure that software is limited to it's own space, but also able to expand that space to look infinite.
I don't remember it that much, but memory management was interesting.  The OS, heap, etc.  So much stuff I forgot but vaguely remember.

Have to program a shell. :o
Command prompt?  
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 26, 2017, 04:15 PM
Not sure now, but it was terrible before.  Windows didn't really properly multi task until recently.
I don't remember it that much, but memory management was interesting.  The OS, heap, etc.  So much stuff I forgot but vaguely remember.
Command prompt?  
Yeah, a command prompt.
Title: Re: Programming Thread
Post by: Legend on Sep 26, 2017, 04:46 PM
My brother is taking programing 101 classes but for one class they're using C++. Good opportunity for me to learn it through helping him  ::)


The other day he was using an int instead of a bool in his homework. I tried to help him switch it to a bool, but then he got upset and reverted to an int because he didn't want to change how the variable was assigned  :P
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 26, 2017, 06:06 PM
My brother is taking programing 101 classes but for one class they're using C++. Good opportunity for me to learn it through helping him  ::)


The other day he was using an int instead of a bool in his homework. I tried to help him switch it to a bool, but then he got upset and reverted to an int because he didn't want to change how the variable was assigned  :P
Well that's not the worst thing to do.

I convinced someone to switch their Boolean to an int, because they were trying to use a loop to find out if a move was valid and another loop for figuring out what move is valid.  

So like, the first loop says yes you can put it in this column, the second one says this is where it goes if you put it in this column.  Put the loops together, and used -1 to say that it wasn't valid.  

Some languages aren't too picky with letting you use ints as a boolean.  Pretty sure C++ let's you use 0 as false, and anything else is true.  

Title: Re: Programming Thread
Post by: darkknightkryta on Sep 26, 2017, 08:42 PM
Yeah, a command prompt.
We never got to that.  We just had to simulate stuff in C.  Like thread dispatching, file management, etc.  We never had to make a command prompt.  Sounds like fun.
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 26, 2017, 09:14 PM
Computer Organization is pretty cool.

It's like okay, we are going to use NAND gates to build Or/And/Not gates.  
Now we are going to use these gates to make Mux chips.

And now we built ALU's, which you can use Much chips to make.  
Title: Re: Programming Thread
Post by: darkknightkryta on Sep 26, 2017, 10:50 PM
Computer Organization is pretty cool.

It's like okay, we are going to use NAND gates to build Or/And/Not gates. 
Now we are going to use these gates to make Mux chips.

And now we built ALU's, which you can use Much chips to make. 
Yeah that stuff was fun.  I'm going to be teaching them soon to my grade 11s.  I still need to learn how to make an 8 bit cpu out of logic gates.
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 29, 2017, 10:09 AM
(https://imgs.xkcd.com/comics/still_in_use_2x.png)
Title: Re: Programming Thread
Post by: darkknightkryta on Sep 29, 2017, 07:15 PM
(https://imgs.xkcd.com/comics/still_in_use_2x.png)
I would get so frustrated with the way Objective C handled their garbage collector.  I had this exact issue and there was nothing I could do about it.
Title: Re: Programming Thread
Post by: the-pi-guy on Sep 29, 2017, 09:57 PM
So, people.  

What was a bad programming mistake you made?  
Title: Re: Programming Thread
Post by: the-pi-guy on Oct 08, 2017, 09:33 PM
I'm having some issues with C.  
I'm trying to compare two strings...  And the stack overflow solution isn't working at all.  

For some reason trying to print out:
Char s[100];
print(s[0]);

This code prints the entire array.
Title: Re: Programming Thread
Post by: Legend on Oct 08, 2017, 10:37 PM
So, people.  

What was a bad programming mistake you made?  
I make infinite loops far too commonly.

I'm having some issues with C.  
I'm trying to compare two strings...  And the stack overflow solution isn't working at all.  

For some reason trying to print out:
Char s[100];
print(s[0]);

This code prints the entire array.
Does s[1] also print the whole array?
Title: Re: Programming Thread
Post by: the-pi-guy on Oct 08, 2017, 10:44 PM
I make infinite loops far too commonly.
Does s[1] also print the whole array?
I figured out part of it.  
I was misusing pointer stuff.
s[1] prints out the whole array minus the first character.  
Title: Re: Programming Thread
Post by: the-pi-guy on Oct 10, 2017, 08:54 PM
For some reason one print line executes and the one underneath it doesn't. 
C is upsetting... 
Title: Re: Programming Thread
Post by: the-pi-guy on Oct 26, 2017, 11:04 PM
It's really crazy all the things that an OS does.  

Basically every time period, the OS basically does a "context switch", the OS gets reloaded into the computer many, many times a second.  
Learning about the program counter in a few different classes.  Like the computer stores what line of code it is reading.  

It just feels so weird to think about with how nice OS's are, that basically every second, every program stops running for a very tiny portion of time, gets switched to something else, and back again before anyone notices.  

This semester seems like a lot of obvious things that still seem weird to think about.  Like it's obvious the OS has to work that way, but then it seems crazy at the same time.  

Another thing that is obvious, but just seems so counter to experience, is that programming languages vary from compiler and OS.  

Usually you work in 1 compiler, 1 OS, so you don't notice these things all the time.  
But it's just weird sometimes how little things can completely wreck your program on someone else's computer.  (Obvious.)  

Like this:
for(int i=0; i<20; i++)

Works perfectly fine on my computer at home on a Linux OS.  It doesn't work on the school computers.  Instead this does:
int i;
for(i=0; i<20; i++)
Title: Re: Programming Thread
Post by: the-pi-guy on Oct 26, 2017, 11:14 PM
I spent a while working on my assignment and was frustrated.  

Spent 20 minutes looking at someone else's code, also frustrated.  Then it suddenly made complete sense.  

Walked back to my own assignment, and suddenly for no reason it suddenly made sense.  I suddenly came up with an idea on the spot that fixed my issues from the past few hours.  
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 04, 2017, 01:25 PM
Computers be like:
"10+10=100"
"11+11=110"
"101*1101=1000001"
Title: Re: Programming Thread
Post by: Legend on Nov 04, 2017, 03:16 PM
Computers be like:
"10+10=100"
"11+11=110"
"101*1101=1000001"
I mean yes that be factual.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 04, 2017, 03:44 PM
I mean yes that be factual.
I think someone who doesn't know binary would be very confused that 10+10 =100.
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 04, 2017, 04:24 PM
I'm having some issues with C.  
I'm trying to compare two strings...  And the stack overflow solution isn't working at all.  

For some reason trying to print out:
Char s[100];
print(s[0]);

This code prints the entire array.
Why not sure printf?
printf("%c",s[0]);
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 04, 2017, 05:33 PM
Why not sure printf?
printf("%c",s[0]);
I meant printf.  
But that's probably why it was outputting the whole array.  
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 04, 2017, 05:47 PM
I meant printf.  
But that's probably why it was outputting the whole array.  
Yeah the way you were using printf was just all kinds of wrong so I wasn't sure if there was an actual print command in C.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 09, 2017, 04:25 PM
Increasing cache memory can actually decrease performance if using a FIFO algorithm.  

It never hurts performance in least frequent or least recent algorithms.

But for FIFO, there are work loads where having a smaller cache gives better results.  
Title: Re: Programming Thread
Post by: Tachikoma on Nov 09, 2017, 04:38 PM
So, people.  

What was a bad programming mistake you made?  
I once ported some code to the wiiu, what a waste.
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 09, 2017, 05:31 PM
Increasing cache memory can actually decrease performance if using a FIFO algorithm.  

It never hurts performance in least frequent or least recent algorithms.

But for FIFO, there are work loads where having a smaller cache gives better results.  
What are you?  An Engineer?  Call it a queue like a normal computer scientist!
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 09, 2017, 06:01 PM
What are you?  An Engineer?  Call it a queue like a normal computer scientist!
I see FIFO all the time in CS books.
My OS book calls a lot of things FIFO.  

A queue is a "FIFO data structure" is usually how they call it.
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 09, 2017, 06:59 PM
I see FIFO all the time in CS books.
My OS book calls a lot of things FIFO.  

A queue is a "FIFO data structure" is usually how they call it.
Those CS books were made by engineers.

On another note, when I had an interview with Capcom and I said "I'd store the files with a stack" he was like "No, have you heard of Filo?"  I wanted to slap him since he didn't know they were the same thing.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 09, 2017, 07:19 PM
Those CS books were made by engineers.
No. ::P
First in, first out is the official name for the algorithm in the context of scheduling.
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 09, 2017, 09:19 PM
No. ::P
First in, first out is the official name for the algorithm in the context of scheduling.

That's scheduling, not compsci

(https://vignette.wikia.nocookie.net/roblox/images/3/38/Transparent_Troll_Face.png/revision/latest?cb=20120713214853)

Anyways, I have to write lessons for all the sorting algorithms in textbooks.  I'm arbitrarily starting with quicksort.  Does it "have" to be recursive?  I can't find a non-recursive algorithm and I'd rather not write one.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 09, 2017, 09:31 PM
That's scheduling, not compsci

(https://vignette.wikia.nocookie.net/roblox/images/3/38/Transparent_Troll_Face.png/revision/latest?cb=20120713214853)

Anyways, I have to write lessons for all the sorting algorithms in textbooks.  I'm arbitrarily starting with quicksort.  Does it "have" to be recursive?  I can't find a non-recursive algorithm and I'd rather not write one.
No. Nonrecursive
Optimized QuickSort -- C Implementation (Non-Recursive) (http://alienryderflex.com/quicksort/)



Usually it's possible to change an implementation from recursive to iterative.  
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 09, 2017, 09:40 PM
No. Nonrecursive
Optimized QuickSort -- C Implementation (Non-Recursive) (http://alienryderflex.com/quicksort/)



Usually it's possible to change an implementation from recursive to iterative.  

It is, I just didn't want to write one from scratch.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 11, 2017, 11:47 PM
Hmmm this code isn't getting the right answer. Let's track what's going on with a print statement.  

What.. now I got the right answer.  
*Runs it a few more times*.
Okay, half the time I get the right answer of 94, the other half I get 109.

This makes no sense.
Title: Re: Programming Thread
Post by: Legend on Nov 11, 2017, 11:51 PM
Hmmm this code isn't getting the right answer. Let's track what's going on with a print statement.  

What.. now I got the right answer.  
*Runs it a few more times*.
Okay, half the time I get the right answer of 94, the other half I get 109.

This makes no sense.
Is it somehow not starting with a clean slate before each test?
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 11, 2017, 11:58 PM
Is it somehow not starting with a clean slate before each test?
It's starting with a clean state every time.  But half the time it keeps counting even though it shouldn't. 

There's nothing in it that depends on time or randomness, so it doesn't make a lot of sense. 

Every time it comes to the wrong value, it's because it is adding up another value that it shouldn't even be reaching.

Like I'm passing in an array of 10 values, but half the time it adds an 11th value that seems to come out of nowhere.
Title: Re: Programming Thread
Post by: darkknightkryta on Nov 14, 2017, 06:48 PM
It's starting with a clean state every time.  But half the time it keeps counting even though it shouldn't.  

There's nothing in it that depends on time or randomness, so it doesn't make a lot of sense.  

Every time it comes to the wrong value, it's because it is adding up another value that it shouldn't even be reaching.

Like I'm passing in an array of 10 values, but half the time it adds an 11th value that seems to come out of nowhere.
At least your while loop based quick sort isn't bugging out when a zero is on the right side.
Title: Re: Programming Thread
Post by: the-pi-guy on Nov 21, 2017, 12:25 PM
That moment when you are testing your program, not sure why it isnt passing your "test cases", when you realize your test cases are what's wrong.  
Title: Re: Programming Thread
Post by: the-pi-guy on Dec 09, 2017, 09:21 PM
Finally got my (simulated) multiplication chip working. 

Was kind of a pain. 
Title: Re: Programming Thread
Post by: Legend on Dec 10, 2017, 12:24 AM
(https://i.redd.it/glm9twiqvq201.jpg)
Title: Re: Programming Thread
Post by: the-pi-guy on Dec 15, 2017, 03:39 PM
Working on an assignment due tonight.

I have a variable that is being changed between print statements, despite the fact the only time that variable gets changed is when it gets set originally.
Title: Re: Programming Thread
Post by: Legend on Dec 16, 2017, 12:58 AM
Working on an assignment due tonight.

I have a variable that is being changed between print statements, despite the fact the only time that variable gets changed is when it gets set originally.
I just had an issue like that!

In c# I replaced the variable with a function that acted like a variable. Then it could print a message everytime it was changed and tell me who changed it. Does c++ have similar?
Title: Re: Programming Thread
Post by: the-pi-guy on Dec 16, 2017, 02:26 AM
I just had an issue like that!

In c# I replaced the variable with a function that acted like a variable. Then it could print a message everytime it was changed and tell me who changed it. Does c++ have similar?
I think it's possible to have a pointer variable, that points to a function. 
Never tried it, but I recall reading something about it. 


I just had an issue like that!

In c# I replaced the variable with a function that acted like a variable. Then it could print a message everytime it was changed and tell me who changed it. Does c++ have similar?
I've been messing around some more. 

For some reason, this method is changing the value.  literally one line:
Code: [Select]

int getSize(int i)
return list[i].size;
Title: Re: Programming Thread
Post by: the-pi-guy on Dec 16, 2017, 03:53 PM
I just had an issue like that!

In c# I replaced the variable with a function that acted like a variable. Then it could print a message everytime it was changed and tell me who changed it. Does c++ have similar?
So what the assignment is, is to implement malloc (memory allocation).
But it requires a data structure to keep track of data locations.  

I was using an array that would change length, by getting reassigned basically.  

But apparently assigning the arrays that way has some unusual behaviors.  

I changed all the declarations to utilizing malloc, which feels wrong.  Now it works great.  

It's apparently fine if the data structure uses malloc, but eh I don't like it.  
Title: Re: Programming Thread
Post by: darkknightkryta on Dec 16, 2017, 06:56 PM
I think it's possible to have a pointer variable, that points to a function.  
Never tried it, but I recall reading something about it.  

I've been messing around some more.  

For some reason, this method is changing the value.  literally one line:
Code: [Select]

int getSize(int i)
return list[i].size;

Yes you can make a variable point to a function.  I vaguely recall it being in a lab.  Not sure why'd you would use it.

So what the assignment is, is to implement malloc (memory allocation).
But it requires a data structure to keep track of data locations.  

I was using an array that would change length, by getting reassigned basically.  

But apparently assigning the arrays that way has some unusual behaviors.  

I changed all the declarations to utilizing malloc, which feels wrong.  Now it works great.  

It's apparently fine if the data structure uses malloc, but eh I don't like it.  
Memory related issues are the hardest to debug.  C's memory system isn't that good either (Was at the time I guess).  Though as I tell all my students "Be kind to C and C will be kind to you"  So use malloc and like it :P
Title: Re: Programming Thread
Post by: the-pi-guy on Dec 16, 2017, 07:18 PM
Yes you can make a variable point to a function.  I vaguely recall it being in a lab.  Not sure why'd you would use it.
Memory related issues are the hardest to debug.  C's memory system isn't that good either (Was at the time I guess).  Though as I tell all my students "Be kind to C and C will be kind to you"  So use malloc and like it :P
How can I use malloc if I'm trying to implement malloc?  
Title: Re: Programming Thread
Post by: darkknightkryta on Dec 16, 2017, 08:23 PM
How can I use malloc if I'm trying to implement malloc?  

Implement malloc?  You have to inline assembly for that...
Title: Re: Programming Thread
Post by: Legend on Dec 20, 2017, 01:30 AM
I'm having a stupid thing and I don't understand.

In Unity objects have a forward vector, a right vector, and an up vector. These are the calculus kind, not the c++ kind. I have a custom vector that's defined by a quaternion*vector, then multiplied by the object's rotation.

Something is screwing up because through testing I've realised that even if an object has two of these custom vectors defined, it can be in multiple rotations. Should be mathematically impossible but I really don't understand where my mistake is. Visually my custom vectors seem to function properly.

edt: figured it out!!!!!!!! my custom vectors were 180 degrees opposite of eachother so the system had issues. I should have checked on that possibility sooner.

edt2: well now it's not creating the full amount of vectors! I shouldn't program when this tired...
Title: Re: Programming Thread
Post by: the-pi-guy on Dec 20, 2017, 04:37 AM
What do you mean multiple rotations?  Why is it impossible?
Title: Re: Programming Thread
Post by: Legend on Dec 20, 2017, 04:40 AM
What do you mean multiple rotations?  Why is it impossible?
If you define an object's forward direction and it's upwards direction, then you've fully defined its rotation. There is only one state it can be in. My forward and upward directions were accidentally opposite so the second vector didn't actually define anything new.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 02, 2018, 03:56 AM
1/2 tau created his first server!

It plays a code breaking game with a client.
It's cool.
Title: Re: Programming Thread
Post by: Legend on Feb 02, 2018, 12:05 PM
1/2 tau created his first server!

It plays a code breaking game with a client.
It's cool.
So are you hosting it?
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 02, 2018, 01:07 PM
So are you hosting it?
Well the server and the client are both being run on the same machine.  

Right now it's only set up to take one client, and then it shuts down.  
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 03, 2018, 10:52 PM
Yeah I need to get back into figuring out server programming.  I need to make my "gameification" of learning.  I have a whole JRPG idea for going through lessons and completing quizzes.  Gonna take me a while though.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 09, 2018, 03:49 PM
Next server is multithreaded!
Many threads. Many clients.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 10, 2018, 12:12 AM
So are you hosting it?
It seems to be as easy as changing the hostname in the server program to be able to do it over the internet.  

Would someone like to try?  :D

Actually maybe it doesn't work yet.  

I'm not sure how much of my errors is because something isn't set up right or because the computers aren't allowing it on campus.  

And I'm not sure how much trouble I could get into.  
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 10, 2018, 09:22 PM
The first week of compilers seems like Automata + Programming Languages.
That class is fairly intimidating.  The final project will be a few thousand lines of code, and will be a fully working compiler.  

It's kind of cool to see stuff show up again and again.  This semester I've seen it a lot in my CS courses.   Like automata have been showing up in both my classes.  
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 11, 2018, 01:25 AM
The first week of compilers seems like Automata + Programming Languages.
That class is fairly intimidating.  The final project will be a few thousand lines of code, and will be a fully working compiler.  

It's kind of cool to see stuff show up again and again.  This semester I've seen it a lot in my CS courses.   Like automata have been showing up in both my classes.  
We bailed translators once it turned into a math class.  But I'm sure you'll love it.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 12, 2018, 03:13 PM
Getting into peer to peer vs server client.  
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 12, 2018, 03:43 PM
Getting into peer to peer vs server client.  
I still remember when we learned about Web 2.0.  P2P was supposed to replace servers.  To save, millions from piracy, corporate america is spending billions in servers.
Title: Re: Programming Thread
Post by: Legend on Feb 12, 2018, 04:27 PM
I still remember when we learned about Web 2.0.  P2P was supposed to replace servers.  To save, millions from piracy, corporate america is spending billions in servers.
How would p2p work with anything but static html though? 99% of websites nowadays are custom generated just for the person visiting.
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 12, 2018, 06:17 PM
How would p2p work with anything but static html though? 99% of websites nowadays are custom generated just for the person visiting.
I mean for sharing data.  Like instead of Sony spending god knows how much money on servers, all your DLC/Patches/Updates are all downloaded from each other.
Title: Re: Programming Thread
Post by: Legend on Feb 12, 2018, 06:57 PM
I mean for sharing data.  Like instead of Sony spending god knows how much money on servers, all your DLC/Patches/Updates are all downloaded from each other.
Ok yeah for just specific files that's more usable. How would that theoretically handle PS4s turning off or going into a game and shutting off the upload?
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 12, 2018, 07:38 PM
Ok yeah for just specific files that's more usable. How would that theoretically handle PS4s turning off or going into a game and shutting off the upload?
You need servers still.  You just don't need huge server farms.  It brings down costs significantly.  Hell I think even Netflix could work off of P2P to an extent.  Like it wouldn't replace servers, it' just make server load way smaller.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 12, 2018, 08:41 PM
Technically you could probably do just about anything with P2P, whether it makes any sense to do it that way is a different question.  

P2P email exists for example.  But to make it work well, you either have to allow emails to be lost, or you have to go to extraordinary lengths to be secure.  

Centralized servers makes more sense for big companies though.  Netflix could do a hybrid like DKK mentioned.

Have clients upload to the movies to other clients.  
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 16, 2018, 04:14 AM
Just did a networking homework that was about testing out the school website for packets.  

Really sucked.  My computer would get like 1000's of other packets, so I had no idea how many came from the school.  

No idea what to do about it.  
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 20, 2018, 11:02 PM
Pros of working with someone else:
-Work can get done twice as fast.

Cons:
- When they like things formatted differently than you do.  So they spend several minutes reformatting even though it was already exactly how you liked it.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 25, 2018, 08:36 PM
Fellow programmers, how do you like your brackets?
Code: [Select]

public void name(){

}

public void name()
{


}
public void name() {


}

Something else?

What about other stylistic preferences?
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 26, 2018, 03:15 AM
Fellow programmers, how do you like your brackets?
Code: [Select]

public void name(){

}

public void name()
{


}
public void name() {


}

Something else?

What about other stylistic preferences?
Line them up
{
}
It'll save you headaches later when you go down the rabbit hole.
Title: Re: Programming Thread
Post by: Legend on Feb 26, 2018, 06:38 AM
First one duh!

Also I do:

if (){

}
else {

}

Really annoying having the else statement on the same line as the if's bracket.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 26, 2018, 01:22 PM
First one duh!

Also I do:

if (){

}
Me too!!!


else {

}

Really annoying having the else statement on the same line as the if's bracket.
Uh oh...  
I like the else kind of packed in with the if.  


Line them up
{
}
It'll save you headaches later when you go down the rabbit hole.
A lot of IDEs magically connect them, regardless.
Title: Re: Programming Thread
Post by: Legend on Feb 26, 2018, 03:12 PM
(https://i.redditmedia.com/ERBSzGTC935D2MVi7ZGWsehKTRvKAcmZB_FqMv1aqD0.png?w=696&s=c7cd899dea5cf78d6291c589840e4e15)
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 26, 2018, 05:53 PM
Me too!!!


Uh oh... 
I like the else kind of packed in with the if. 

A lot of IDEs magically connect them, regardless.
The problem isn't the connecting, the problem is trying to find when you're missing one.  A lot of time I spend helping my students debug their programs have to do with a missing bracket.  Having them lined up let's you know what's missing since they're lined up, you can just follow down and see where it's missing.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 26, 2018, 06:04 PM
The problem isn't the connecting, the problem is trying to find when you're missing one.  A lot of time I spend helping my students debug their programs have to do with a missing bracket.  Having them lined up let's you know what's missing since they're lined up, you can just follow down and see where it's missing.
You can do the same thing with the other format.  You just match it with the start of the line that connects it.


Code: [Select]

public static void main(stuff){
      for(stuff){
             if(stuff){

             }


      }
}


A lot of IDEs still tell you if one is missing.  Not always accurately, albeit. 
Title: Re: Programming Thread
Post by: darkknightkryta on Feb 27, 2018, 03:03 AM
You can do the same thing with the other format.  You just match it with the start of the line that connects it.


Code: [Select]

public static void main(stuff){
      for(stuff){
             if(stuff){

             }


      }
}


A lot of IDEs still tell you if one is missing.  Not always accurately, albeit.  
Look very carefully at your first example.  The top doesn't line up at all with the bottom.  Now imagine programs with worse formatting.  I've spent more time hunting down brackets than anything.  Having them lined up helps a ton.
Title: Re: Programming Thread
Post by: the-pi-guy on Feb 27, 2018, 12:20 PM
Look very carefully at your first example.  The top doesn't line up at all with the bottom.  Now imagine programs with worse formatting.  I've spent more time hunting down brackets than anything.  Having them lined up helps a ton.
It lines up with the p.  

I personally haven't spent very much time looking for brackets.  9/10 times the editor tells me where the issue is.  
Title: Re: Programming Thread
Post by: Legend on Mar 01, 2018, 02:50 AM
How realistic is it to have an incredibly large memory object in graphics memory for rendering? Would say a 1 gigabyte object be fine or is there some restriction and something like that would have to be split into multiple objects? Xbox One uses ESRAM so that's problematic but would it work on say the GTX 970?
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 01, 2018, 03:23 AM
How realistic is it to have an incredibly large memory object in graphics memory for rendering? Would say a 1 gigabyte object be fine or is there some restriction and something like that would have to be split into multiple objects? Xbox One uses ESRAM so that's problematic but would it work on say the GTX 970?
Not aware of any issues, should work.
Title: Re: Programming Thread
Post by: Legend on Mar 01, 2018, 05:11 AM
Not aware of any issues, should work.
Good. Wouldn't think it'd be a problem but I know relativly little about the hardware side and the way memory actually works.
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 01, 2018, 03:03 PM
How realistic is it to have an incredibly large memory object in graphics memory for rendering? Would say a 1 gigabyte object be fine or is there some restriction and something like that would have to be split into multiple objects? Xbox One uses ESRAM so that's problematic but would it work on say the GTX 970?
Your space in your card is your space.  1 gigabyte will fit in a 2 gig card.  Now trying to put more after that 1 gig object...
Title: Re: Programming Thread
Post by: Legend on Mar 01, 2018, 03:23 PM
A 512x512x512 buffer might be possible after all :)

Now if only i could figure out my AI issues with VizionEck and get that released.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 01, 2018, 03:37 PM
Here comes first compiler test.  
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 01, 2018, 06:41 PM
Here comes first compiler test.  
You'll do fine, you're good at the math behind compilers.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 01, 2018, 06:55 PM
I felt really good about 95% of the test.  
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 02, 2018, 03:54 PM
"2.2, just like 2.1 just no more NAKs"
Title: Re: Programming Thread
Post by: Legend on Mar 05, 2018, 08:36 AM
Unity uses floats for time. This works since game sessions don't last that long.

However, modern consoles can suspend games. Going 50 hours without restarting is common. At that length of time, anything based off floats would be super screwed and probably crash. So I wonder if future unity versions will use doubles.

Supposedly unity internally uses doubles but they want to keep it easy for devs.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 05, 2018, 02:41 PM
I'm sure you've read this.
What happens when Time.time gets very large in Unity? - Game Development Stack Exchange (https://gamedev.stackexchange.com/a/141811)
Title: Re: Programming Thread
Post by: Legend on Mar 05, 2018, 03:19 PM
I'm sure you've read this.
What happens when Time.time gets very large in Unity? - Game Development Stack Exchange (https://gamedev.stackexchange.com/a/141811)
Haha yup that's the page I found last night when I was thinking about it.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 06, 2018, 01:56 AM
I now have books on databases.  

The only subject matter that I can think in CS, that I don't have a textbook is security.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 06, 2018, 03:20 PM
.
Did you start off with any tutorials in Unity?  

Or did you just read documentation?
Title: Re: Programming Thread
Post by: Legend on Mar 06, 2018, 03:56 PM
Did you start off with any tutorials in Unity?  

Or did you just read documentation?
I happened upon this simple FPS tutorial and was just going through that to learn Unity and scripting.



(was a new video the last time I watched it  :P )

Before finishing that series, I started working on VizionEck and then just learned through documentation/google.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 06, 2018, 04:03 PM
I gotta find time to do that.
Title: Re: Programming Thread
Post by: Legend on Mar 06, 2018, 04:26 PM
I gotta find time to do that.
Are you trying to learn Unity, or do you mean for Lumberyard?
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 06, 2018, 04:31 PM
Are you trying to learn Unity, or do you mean for Lumberyard?
Well either one.   ;D

Would like to do Lumberyard, but Unity might be a better segue. 

Being familiar with Unity is probably a plus whether I use unity or lumberyard at some point. 
Title: Re: Programming Thread
Post by: Legend on Mar 06, 2018, 04:37 PM
Well either one.   ;D

Would like to do Lumberyard, but Unity might be a better segue.  

Being familiar with Unity is probably a plus whether I use unity or lumberyard at some point.  
Unity is fairly easy especially if you like programing. You could probably pick it up in less than a day.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 06, 2018, 04:38 PM
Unity is fairly easy especially if you like programing. You could probably pick it up in less than a day.
Just have to find a day when I can work on stuff.  :D
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 06, 2018, 08:18 PM
Here comes first compiler test.  
First one done, and got the highest score.  96.5%
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 07, 2018, 12:20 AM
@Yo

Do you remember how to do precedence in a recursive descent parser?  
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 20, 2018, 05:20 PM
(https://i.redd.it/fpv90jjx4wm01.jpg)


I wonder if there are two stacks in the Bible.  That'd make it Turing Complete!  

@Yo

Do you remember how to do precedence in a recursive descent parser?  
Got 100% on it!  
Title: Re: Programming Thread
Post by: Legend on Mar 24, 2018, 04:42 AM
Shader programming is hard/fun. It's really unique withh how it runs.
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 24, 2018, 12:52 PM
Shader programming is hard/fun. It's really unique withh how it runs.
Did they make shader compilers?  Last time I looked at them was about 10 years ago.
Title: Re: Programming Thread
Post by: Legend on Mar 24, 2018, 02:07 PM
Did they make shader compilers?  Last time I looked at them was about 10 years ago.
Yeah I thought they always had them?

Most shaders are instant but if you use newer features it can take a good few minutes to compile them.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 24, 2018, 02:28 PM
Shader programs are a little different because they don't run by themselves.  Instead they are run with C++, Java or a few others.  
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 24, 2018, 03:02 PM
Yeah I thought they always had them?

Most shaders are instant but if you use newer features it can take a good few minutes to compile them.
They didn't.  Maybe Direct X had them, but OpenGl didn't.  
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 25, 2018, 07:13 PM
I haven't used stack overflow that much, but I am reading a thing about how bad they've gotten.  
Stackoverflow has a mod election going on:

2018 Moderator Election - Stack Overflow (https://stackoverflow.com/election?cb=1)

Several of them are bragging about how they delete and close many questions.  

That's just ludicrous.  

On another note.  I should make an American compiler for funsies.  

Arrays start at 1776.  Accessing 1775 will give a "the Redcoats are coming" error.  

The keyword for "class" will be "americanDream" .
There will only be one number type, doubles.  Numbers smaller than 1 will be switched for their greater/less than, so 1/4th will correctly be considered bigger than 1/3rd.  

I could do all kinds of terrible things.  
Title: Re: Programming Thread
Post by: Legend on Mar 25, 2018, 07:25 PM
I haven't used stack overflow that much, but I am reading a thing about how bad they've gotten. 
Stackoverflow has a mod election going on:

2018 Moderator Election - Stack Overflow (https://stackoverflow.com/election?cb=1)

Several of them are bragging about how they delete and close many questions. 

That's just ludicrous. 
Reddit devs dislike stack overflow a lot for that and I agree. I google and find links from them a lot and so often the question has been closed as a duplicate. Or people say the op is wrong and give a useless answer and mark it closed. Like if a person asks about speeding up the loops in a raymarch shader, the solution is not to get rid of the loops and use a different method! (I encountered something like that a few days ago)
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 26, 2018, 01:58 AM
How ludicrous would it be to learn how Unity works without being able to use it?  On the weekdays, I spend almost all day at school.  But they don't have any kind of unity at school of course.
Title: Re: Programming Thread
Post by: Legend on Mar 26, 2018, 03:00 AM
How ludicrous would it be to learn how Unity works without being able to use it?  On the weekdays, I spend almost all day at school.  But they don't have any kind of unity at school of course.
Since you already know programming, not that hard. You could definitely get a hang of how the scripting works at the very least.

Do you know about general game dev concepts from Lumberyard? That'd also help. Update() vs FixedUpdate() for example are just functions that are called either every frame or every n milliseconds.

Newer versions of Unity are trying to be more dev friendly and have pre-built methods of doing most things and learning those would really benefit from having access to Unity, but most of the time I use my own scripts for things.




Have you tried installing Unity on a flash drive? You could then use it at school without installing anything on their computers.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 26, 2018, 03:10 AM
Have you tried installing Unity on a flash drive? You could then use it at school without installing anything on their computers.

Thank you!  I didn't even think of doing this!  
Do you know about general game dev concepts from Lumberyard? That'd also help. Update() vs FixedUpdate() for example are just functions that are called either every frame or every n milliseconds.
I don't have too much from Lumberyard unfortunately.  
I did try starting a unity tutorial that my brother in law bought me from Udemy.  It's really slow paced though, because its made with the expectation that the watcher doesn't know any coding.  (I tried skipping all of that, but then they started diving into projects with code made.)
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 26, 2018, 01:59 PM
I agree about the stack overflow.  They'll close unanswered questions, and the answer would be wrong.  

Talking about Stack Overflow reminded me of this comic:

(https://imgs.xkcd.com/comics/wisdom_of_the_ancients.png)
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 26, 2018, 02:24 PM
I agree about the stack overflow.  They'll close unanswered questions, and the answer would be wrong.  

Talking about Stack Overflow reminded me of this comic:

(https://imgs.xkcd.com/comics/wisdom_of_the_ancients.png)
Love that comic.  
Another problem: only question, OP says they figured it out. No answer posted.  
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 26, 2018, 05:20 PM
Love that comic.  
Another problem: only question, OP says they figured it out. No answer posted.  
I fudgy hate that.
Title: Re: Programming Thread
Post by: the-pi-guy on Mar 28, 2018, 02:32 AM
Each project of my compilers class has been to implement something from scratch.  But then the next project, we use a tool to do that for us. It doesn't do exactly what our project did, it's for a far more complex grammar.  

Even the simple projects though, pretty easily become 1,000 lines of code.  

That's pretty what we've done so far, but the rest of the projects literally build on each other.  

The first one is about completing the parser.  Last two projects we have are pretty similar.  They will basically take something resembling java code, and output a MIPS program.  The last project includes stuff about getting classes to work.  Oh boy.  
Title: Re: Programming Thread
Post by: darkknightkryta on Mar 28, 2018, 04:01 AM
Each project of my compilers class has been to implement something from scratch.  But then the next project, we use a tool to do that for us. It doesn't do exactly what our project did, it's for a far more complex grammar.  

Even the simple projects though, pretty easily become 1,000 lines of code.  

That's pretty what we've done so far, but the rest of the projects literally build on each other.  

The first one is about completing the parser.  Last two projects we have are pretty similar.  They will basically take something resembling java code, and output a MIPS program.  The last project includes stuff about getting classes to work.  Oh boy.  
There's a reason why I dropped translators =D
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 07, 2018, 01:39 PM
These are pretty neat:
Shadertoy BETA (https://www.shadertoy.com/view/XtlSD7)
Shadertoy BETA (https://www.shadertoy.com/view/4sfGWX)

It'd be nice if there was a place to try Super Mario Bros in VR.  That one's not set up for it, and it's horrid.  
Title: Re: Programming Thread
Post by: Legend on Apr 07, 2018, 04:02 PM
These are pretty neat:
Shadertoy BETA (https://www.shadertoy.com/view/XtlSD7)
Shadertoy BETA (https://www.shadertoy.com/view/4sfGWX)

It'd be nice if there was a place to try Super Mario Bros in VR.  That one's not set up for it, and it's horrid.  
Shadertoy is a great website to spend way too much time at  ::)

Wouldn't Super Mario Bros be pretty standard in VR? Just a big flat wall?
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 07, 2018, 04:41 PM
Wouldn't Super Mario Bros be pretty standard in VR? Just a big flat wall?
Depends on how they set up the display.  Having the game display directly on the headset without simulating a TV feels very weird though.  Shadertoy has a VR mode for those, so I was able to try it out.  Ish.  Kind of didn't feel like a TV, but it didn't feel like VR either.  

New Super Mario Bros or LittleBigPlanet would be pretty awesome though.  
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 08, 2018, 01:42 AM
(https://i.redd.it/qghb61z3zhq01.png)
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 08, 2018, 03:55 AM
This networking assignment is a lot bigger than the previous ones.  Already at 650 lines of code.  

Not the biggest thing I've done this semester at least.  :P
Title: Re: Programming Thread
Post by: Legend on Apr 08, 2018, 04:12 AM
(https://i.redd.it/qghb61z3zhq01.png)
I heard about those tweets and loved it. Like if someone wanted to hack us we'd be screwed, but we do the standard things. Crazy how many companies have poor systems.

This networking assignment is a lot bigger than the previous ones.  Already at 650 lines of code.  

Not the biggest thing I've done this semester at least.  :P
Is that split up into separate files? I've always kinda prefered sticking lots of code together vs making unnecessary extra files so I'm a bad judge of what the industry considers large or not. (probably helps that no one but me has to read my code.)
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 08, 2018, 12:44 PM
I heard about those tweets and loved it. Like if someone wanted to hack us we'd be screwed, but we do the standard things. Crazy how many companies have poor systems.
Yeah, I'm just really hoping that person has no idea what they are talking about.

I don't have a whole lot of knowledge about security, there is a class about it next semester.  Not likely I'll be taking it, though.

But not storing passwords is like rule 0, I know that much.  

Is that split up into separate files? I've always kinda prefered sticking lots of code together vs making unnecessary extra files so I'm a bad judge of what the industry considers large or not. (probably helps that no one but me has to read my code.)
Separate files are all about putting stuff together that makes sense to put together. So there's not really a size.  Sometimes small makes sense, sometimes gigantic makes sense. I'm sure you're doing things the usual way.  

It's in 3 separate files, and they are all pretty tiny.  The files are server, client and game.  

We are making a Scrabble spin off.  

The server is only like 55 lines.  Servers are pretty easy.  

The game was a pain though, have to check 5 different conditions and like 3 of them required for loops, which needed their own if statement.  And two of those for loops we're actually embedded in the other.  
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 09, 2018, 02:43 AM
Servers and Clients feel weird to program.  

It just feels weird to have your server keep running, fix the client program, compile it, and then return to playing the game; all without doing anything to the server.  Server has no idea.  

It's obvious it can work this way, but actually doing it just feels weird.
Title: Re: Programming Thread
Post by: Legend on Apr 09, 2018, 04:02 AM
Servers and Clients feel weird to program.  

It just feels weird to have your server keep running, fix the client program, compile it, and then return to playing the game; all without doing anything to the server.  Server has no idea.  

It's obvious it can work this way, but actually doing it just feels weird.
How does the server not notice the client disappearing during the compile?
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 09, 2018, 11:22 AM
How does the server not notice the client disappearing during the compile?
The server and client are completely separate programs that just happen to connect to each other.  The only time the server knows about any of the clients is when they successfully make a connection, which only needs an IP address and a socket number.  

It feels weird.  You could make several different client programs connect to the server, even if each one is doing something completely different from the rest.  

You could end up connecting completely different clients, one that's trying to play the game and another that could be sending random messages.  
Title: Re: Programming Thread
Post by: Legend on Apr 11, 2018, 04:58 AM
The server and client are completely separate programs that just happen to connect to each other.  The only time the server knows about any of the clients is when they successfully make a connection, which only needs an IP address and a socket number.  

It feels weird.  You could make several different client programs connect to the server, even if each one is doing something completely different from the rest.  

You could end up connecting completely different clients, one that's trying to play the game and another that could be sending random messages.  
It's not real time I guess, that's what I was meaning.

Yeah I remember how weird it was learning about networking. Back in 2013 when VizionEck was still a PC game I was setting up multiplayer and it kinda shocked me how "fake" it is. I just kinda assumed multiplayer games would run on all systems as a shared program of sorts, instead of each system running a unique version of the game for that player. Like it blew my mind that one player they could see everyone as cubes yet the other player could see everyone as spheres by just building the executables separately.



I watched a GDC talk about light field rendering and it really made me nostalgic for my old work. ~10 years ago when I was building my light field displays I didn't know a thing about programing and actually rendered my first light fields manually over the course of a few weeks. Then I eventually set up an animation in Blender that could render the lightfield piece by piece as a video and then I'd composite every frame together. You have no idea how happy I was to be able to set up a light field within half an hour!

Nowadays it'd be almost trivial to setup Unity to run in real time on one of my light field displays.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 11, 2018, 12:11 PM
It's not real time I guess, that's what I was meaning.

The server is set up not to care about the connection.  

If one of the players leaves, the server has no way of informing the other player.  But the other player can come back and start playing a different game.  

Yeah I remember how weird it was learning about networking. Back in 2013 when VizionEck was still a PC game I was setting up multiplayer and it kinda shocked me how "fake" it is. I just kinda assumed multiplayer games would run on all systems as a shared program of sorts, instead of each system running a unique version of the game for that player. Like it blew my mind that one player they could see everyone as cubes yet the other player could see everyone as spheres by just building the executables separately.

It's just weird and really cool.  On the one hand, it makes sense that it can be done that way and on the other hand it's so bizarre to actually do it that way.  
Title: Re: Programming Thread
Post by: darkknightkryta on Apr 11, 2018, 12:24 PM
It's not real time I guess, that's what I was meaning.

Yeah I remember how weird it was learning about networking. Back in 2013 when VizionEck was still a PC game I was setting up multiplayer and it kinda shocked me how "fake" it is. I just kinda assumed multiplayer games would run on all systems as a shared program of sorts, instead of each system running a unique version of the game for that player. Like it blew my mind that one player they could see everyone as cubes yet the other player could see everyone as spheres by just building the executables separately.



I watched a GDC talk about light field rendering and it really made me nostalgic for my old work. ~10 years ago when I was building my light field displays I didn't know a thing about programing and actually rendered my first light fields manually over the course of a few weeks. Then I eventually set up an animation in Blender that could render the lightfield piece by piece as a video and then I'd composite every frame together. You have no idea how happy I was to be able to set up a light field within half an hour!

Nowadays it'd be almost trivial to setup Unity to run in real time on one of my light field displays.
That's how networking has to be though.  Sending vertices is way cheaper on bandwidth than sending textures.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 13, 2018, 06:51 PM
@Legend
Do you know much about formal grammars?

I feel like that's probably one of the bigger topics that programmers that are mostly self taught don't know about.  It's basically a central topic in like 3 CS courses.
Theory, Compilers, and PL.  It's not something that I really knew about before taking Theory.  I've seen a grammar before, when you shared the link about L-systems, but I wasn't really familiar with them until I took Theory.
Title: Re: Programming Thread
Post by: Legend on Apr 13, 2018, 10:51 PM
@Legend
Do you know much about formal grammars?

I feel like that's probably one of the bigger topics that programmers that are mostly self taught don't know about.  It's basically a central topic in like 3 CS courses.
Theory, Compilers, and PL.  It's not something that I really knew about before taking Theory.  I've seen a grammar before, when you shared the link about L-systems, but I wasn't really familiar with them until I took Theory.
Well to be frank, what is a grammar?
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 13, 2018, 10:59 PM
Well to be frank, what is a grammar?
They're a collection of rules that make words.  

S -> SS
S -> a

The words this grammar produces are a, aa, aaa, aaaa, aaaaa, aaaaaa, aaaaaa, etc onto infinity.  
Title: Re: Programming Thread
Post by: Legend on Apr 13, 2018, 11:26 PM
They're a collection of rules that make words.  

S -> SS
S -> a

The words this grammar produces are a, aa, aaa, aaaa, aaaaa, aaaaaa, aaaaaa, etc onto infinity.  
Well outside of programing stuff for conlangs then no I don't know much about them.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 22, 2018, 07:02 PM
One of my slides for class:

Scoping Issues

Same name can be declared multiple times if the declarations occur in different scopes.  


This is a valid Java program:
public class Test{
     int Test;
     public void Test(){
         double Test;
    }
}

This is allowed in C++:
int Test(){

double Test;

  {
  bool Test;
  }

}
Title: Re: Programming Thread
Post by: darkknightkryta on Apr 24, 2018, 03:08 PM
I remember those grammars.  I learned about them in my formal langauges math course.
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 26, 2018, 08:02 PM
So in the next two weeks, I basically have to:
Finish a compiler, and finish a P2P file transfer program.  

All while keeping up with my other classes.  Ugh.
Title: Re: Programming Thread
Post by: darkknightkryta on Apr 26, 2018, 11:30 PM
So in the next two weeks, I basically have to:
Finish a compiler, and finish a P2P file transfer program.  

All while keeping up with my other classes.  Ugh.
There's a reason I dropped compilers  8)
Title: Re: Programming Thread
Post by: the-pi-guy on Apr 27, 2018, 12:28 AM
There's a reason I dropped compilers  8)
It's so awful.  
Title: Re: Programming Thread
Post by: darkknightkryta on Apr 27, 2018, 12:38 AM
It's so awful.  
It's weird cause before the math teacher took over it wasn't bad.  You'd kind of brute force your compiler and just parse with if statements. That's how a programmer would go about it.  Once you add formal languages and the rest of the math it becomes a nightmare.
Title: Re: Programming Thread
Post by: the-pi-guy on May 02, 2018, 04:31 AM
So I'm working on the peer to peer file transfer program.  

Struggled for a few hours, with some issue that a third peer wouldn't respond to the first one:
1-->2-->3
Wasn't sure if the message wasn't getting sent or if the message wasn't getting delivered.  

Decided to not worry about it for a little bit, worked on something else.  Tried it again, randomly it worked.  what.  

I'm tired.
Title: Re: Programming Thread
Post by: the-pi-guy on May 09, 2018, 02:44 PM
The best language is lol code
HAI 1.2
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
    AWSUM THX
        VISIBLE FILE
    O NOES
        INVISIBLE "ERROR!"
KTHXBYE
Title: Re: Programming Thread
Post by: Legend on May 09, 2018, 04:55 PM
The best language is lol code
HAI 1.2
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
    AWSUM THX
        VISIBLE FILE
    O NOES
        INVISIBLE "ERROR!"
KTHXBYE
It hurts
Title: Re: Programming Thread
Post by: the-pi-guy on May 10, 2018, 11:51 AM
It hurts
I like it, because it's so stupid:

I didn't see example 3:
Code: [Select]

HAI 1.0
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
   UP VAR!!1
   VISIBLE VAR
   IZ VAR BIGGER THAN 10? KTHX
IM OUTTA YR LOOP
KTHXBYE


"IM OUTTA YR LOOP"   ....  wow.


I'd hate to use it though....  
Title: Re: Programming Thread
Post by: darkknightkryta on May 10, 2018, 12:51 PM
The best language is lol code
HAI 1.2
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
    AWSUM THX
        VISIBLE FILE
    O NOES
        INVISIBLE "ERROR!"
KTHXBYE
I cried when my students showed me this a few years ago.  Good ol' lolcat langauge.
Title: Re: Programming Thread
Post by: the-pi-guy on May 11, 2018, 04:01 PM
https://www.reddit.com/r/gamedev/comments/8iivkj/7_months_progress_of_working_on_opengl_rts_engine/
Title: Re: Programming Thread
Post by: the-pi-guy on May 13, 2018, 07:28 PM
Compilers are huge beasts. 

I can't wait to be done.
Title: Re: Programming Thread
Post by: the-pi-guy on May 15, 2018, 03:24 AM
A compiler works in phases.  

There's the scanning(lexing) phase, the parsing phase, and then the code generation phase.  Technically you can split it up more.  The code generation phase is actually an intermediate phase, which gets followed by an optimization phase, which gets followed by another code generation phase.  That can get even more complicated than that.  

Lexing is done with a simple DFA.  
It's basically set up with 1000 if statements to match the input character by character.  
Read an i, that means it can be either:
-int
-identifier
-if
etc.  
Read an f, that means it can now be either a:
-if
-identifier

Read an = sign, take the input as an if.  But if you read a t, take the input as an identifier.  

Okay, it's probably usually closer to 100 if statements.  (Although it's not hard to imagine it blowing up even more.)

That's the scanning phase.  The output will be something like
if leftparen id equals id rightparen
etc, where each word is some meaningful thing in regards to the input.

Then that gets passed to the parser.  

The parser can be worked a few different ways.  
Some work really nicely with recursion.  Other's don't work as nice.

The way a language is set up is with a grammar.
Something like this:

Statement -> assign    
Statement -> print
assign -> id = value
print -> print(id)

Then the way the parser works, is that it'll basically check if the first thing is a print or an id.  Then it knows what should come next.  


The parser gives a tree for the code generation.  The bottom of the tree is whatever the first thing that needs to be done is.  

The tree is especially useful for statements like this:

x = x+5*y-3

It'll basically change it to something like:
sub(add(x,mul(5,y)),3)

Although it's not exactly obvious how that's a tree.  

Then the code generation uses that to make something like this:
li $t0, 5
lw $t1, y
mul $t1,$t1,$t0
etc.


Even a very simple 3 phase compiler, can quickly become a massive project.  

For the most part, they are not difficult to make.  

But even very simple ones are huge projects.  Very time consuming.

It does get a little tricky, need to set up some things to manage registers and memory locations.  But for the most part, they are time consuming more than difficult.  
Title: Re: Programming Thread
Post by: Legend on May 21, 2018, 04:31 AM
(https://i.redd.it/tfgiebsqa2z01.png)
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 02, 2018, 02:11 AM
Code: [Select]


public class Driver{
  public static void main(String[] args)
  {
   List l = new List();
    for(int i=0; i<12; i++){
     l.display();
     l.getNext();
     
    }
    System.exit(0);
  }
}

public class List{
  int[] current;
  int[] next;
 
  public List(){
    current = new int[1];
    next = new int[0];
    current[0] = 1;
  }
 
  public void add(int i){
    expand();
    next[next.length-1] = i;
   
  }
  public void expand(){
   int[] temp = new int[next.length+1];
    for(int i=0; i<next.length; i++){
      temp[i] = next[i];
    }
    next = temp;
  }
  public void getNext(){
    next = new int[0];
    for(int i =0; i<current.length; i++){
      if(current[i]>4 && (current[i]-4)%6==0){
       add(current[i]*2);
       add((current[i]-1)/3);
      }else{
        add(current[i]*2);
      }
     
    }
    current = next;
  }
 
  public int[] getCurr(){
   return current;
  }
 
  public void display(){
    for(int i =0; i<current.length; i++){
      System.out.print(current[i] + "   ");
    }
    System.out.println("");
   
  }
}


I threw together some code on my chromebook for the collatz conjecture.  And I don't really want to lose it.
It makes the tree of successors for where each values can go. 
Title: Re: Programming Thread
Post by: Legend on Jun 04, 2018, 02:47 AM
Microsoft Will Acquire Coding Site GitHub - Bloomberg (https://www.bloomberg.com/news/articles/2018-06-03/microsoft-is-said-to-have-agreed-to-acquire-coding-site-github)
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 04, 2018, 04:33 PM
Microsoft Will Acquire Coding Site GitHub - Bloomberg (https://www.bloomberg.com/news/articles/2018-06-03/microsoft-is-said-to-have-agreed-to-acquire-coding-site-github)
Microsoft confirms it will acquire GitHub for $7.5 billion - The Verge (https://www.theverge.com/platform/amp/2018/6/4/17422788/microsoft-github-acquisition-official-deal)

$7.5 billion
Title: Re: Programming Thread
Post by: Legend on Jun 05, 2018, 10:21 PM
(https://i.redd.it/fowf2ewub7211.png)
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 09, 2018, 01:54 AM
spl/fibonacci.spl at master · flowerhack/spl · GitHub (https://github.com/flowerhack/spl/blob/master/examples/fibonacci.spl)

This is the worst programming language.  
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 09, 2018, 02:20 AM
spl/fibonacci.spl at master · flowerhack/spl · GitHub (https://github.com/flowerhack/spl/blob/master/examples/fibonacci.spl)

This is the worst programming language.  
I don't know, Python exists.
Title: Re: Programming Thread
Post by: Legend on Jun 09, 2018, 03:13 AM
I don't know, Python exists.
Hehe

I like python. Never really used it, but Blender uses it.

spl/fibonacci.spl at master · flowerhack/spl · GitHub (https://github.com/flowerhack/spl/blob/master/examples/fibonacci.spl)

This is the worst programming language.  
What does that example do?
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 09, 2018, 03:36 AM
I don't know, Python exists.
There are so many worse.  
Python is great. ::P

What does that example do?
I don't even know.  
I have a good idea of what a few lines do, but the whole thing is just bizarre.
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 09, 2018, 12:16 PM
Python is terrible.  I would honestly rather program in x86.
Title: Re: Programming Thread
Post by: Legend on Jun 09, 2018, 04:08 PM
Python is terrible.  I would honestly rather program in x86.
Is that even doable?
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 09, 2018, 04:21 PM
Python is terrible.  I would honestly rather program in x86.
No it isn't.  
Is that even doable?
I'm assuming he means assembly.  
Unless he means binary.  Then he's way wrong.  
Title: Re: Programming Thread
Post by: Legend on Jun 09, 2018, 04:38 PM
No it isn't.  I'm assuming he means assembly.  
Unless he means binary.  Then he's way wrong.  
(https://imgs.xkcd.com/comics/real_programmers.png)
Title: Re: Programming Thread
Post by: darkknightkryta on Jun 09, 2018, 04:47 PM
Yes I would rather cornver x86 assembly into binary than program Python
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 23, 2018, 08:52 PM
So a while ago, I made up a matching game for Android for Japanese words.  
I kind of gave up on it.  There was a weird blue screen that im not sure where it comes from and loading the words takes way too long.

 
I want to go back and fix it up though.  
Title: Re: Programming Thread
Post by: Legend on Jun 25, 2018, 04:57 PM
So a while ago, I made up a matching game for Android for Japanese words.  
I kind of gave up on it.  There was a weird blue screen that im not sure where it comes from and loading the words takes way too long.

 
I want to go back and fix it up though.  
How were you loading the words?
Title: Re: Programming Thread
Post by: the-pi-guy on Jun 25, 2018, 05:26 PM
How were you loading the words?
The least efficient way possible. (Literally)

Made an encoding so that I didn't have to worry about the encoding type not saving or reading properly.  

And every code has to be decoded to the correct character.  
Title: Re: Programming Thread
Post by: Legend on Jun 30, 2018, 02:30 AM
Maybe I should make my own server at home. It could be a cheaper way to store slow data.
Title: Re: Programming Thread
Post by: Legend on Jul 08, 2018, 11:28 PM
I'm updating from Unity 5.6 to 2018.1

Hopefully doesn't break too much  :P
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 09, 2018, 12:42 AM
I'm updating from Unity 5.6 to 2018.1

Hopefully doesn't break too much  :P
Narrator: everything did.
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 10, 2018, 09:23 PM
It feels kinda weird where im at with things.  

Like in a lot of areas, I have a really good amount of experience. Then there's other stuff where I have an idea but I don't exactly know the best thing to do there.

Like one thing I wonder about is how do open world games manage their characters and other objects.

You could have a giant list of all characters.
Or you could have smaller lists of characters in your vicinity.  It's all about trade offs, but sometimes one way is better enough to never bother with the second way.

Or maybe there's some other super brilliant way to do that kind of thing.  
Title: Re: Programming Thread
Post by: Legend on Jul 10, 2018, 09:33 PM
Narrator: everything did.
Well I did just waste a lot of time debugging only to realise their new set matrix function doesn't work correctly.  :P
It feels kinda weird where im at with things.  

Like in a lot of areas, I have a really good amount of experience. Then there's other stuff where I have an idea but I don't exactly know the best thing to do there.

Like one thing I wonder about is how do open world games manage their characters and other objects.

You could have a giant list of all characters.
Or you could have smaller lists of characters in your vicinity.  It's all about trade offs, but sometimes one way is better enough to never bother with the second way.

Or maybe there's some other super brilliant way to do that kind of thing.  
It's all about streaming that content in and out of memory. Essentially once you leave an area everything is deleted.

When you return, people and objects are loaded up again and placed based off time of day/weather.
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 10, 2018, 09:35 PM
It's all about streaming that content in and out of memory. Essentially once you leave an area everything is deleted.

When you return, people and objects are loaded up again and placed based off time of day/weather.
Cool. That's what I figured.
Title: Re: Programming Thread
Post by: Legend on Jul 10, 2018, 11:24 PM
Cool. That's what I figured.
It'd be pretty cool if a game didn't work like that.

Imagine if every NPC was run off the GPU and kept active during the entire game. IE if there was some super immortal enemy it could just be slowly roaming around killing full cities while you're off on side quests.
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 12, 2018, 04:03 AM
Forgot about this:
Become one with Legend: a software development thread Game Jam SIGNUP!  (http://gamrconnect.vgchartz.com/thread.php?id=179312&page=1)

Quote
GAME JAM!!!  (Sharing) Genre/topic:  Flappy bird clones!  
think-manJoeTheBro
Still not entirely sure how this game jam will be run, I'm accepting ideas!  

  

 With that said, if you want to make it a competition, make it a friendly one.  

 ---------------------------------------

 "Are people interested in non technical software/game development help as well? Level design, game mechanics, etc."

 Those who are interested speak up!  

 ----------------------------------------

  As this is a gaming forum, there are many of us who have dreams of doing something related to software.  And many of us specifically want to develop games.  I am making this to assist those that have an interest in developing software, whether that be games, or just software in general.  If you feel that a tutorial is not up to par, or have a tutorial for replacement, that would be much appreciated.  I'd like this to be an awesome resource for software developer enthusiasts or something.  There are so many tutorials, so much software available, so I can't put it all, but I'd like to put in as much that would be useful.  Any suggestions, compliments, insults would be very much appreciated.  Please and thank you!  

  

  

 
C++


 
http://www.cplusplus.com/doc/tutorial/ 
http://www.learncpp.com/ 
http://www.tutorialspoint.com/cplusplus/ 
http://www.pluralsight.com/training 

 
http://www.cprogramming.com/tutorial.html  


 
 

 
Java


 
http://www.learnjavaonline.org/ 
http://docs.oracle.com/javase/tutorial/java/ 
http://www.tutorialspoint.com/java/ 
http://www.pluralsight.com/training 
  
  
 


 
C#


 
http://www.tutorialspoint.com/csharp/ 
http://msdn.microsoft.com/en-us/library/aa288436(v=vs.71).aspx 
http://www.csharp-station.com/tutorial.aspx 
http://www.completecsharptutorial.com/ 
http://csharp.net-tutorials.com/ 
http://www.pluralsight.com/training 
Python 


 
http://docs.python.org/2/tutorial/ 
http://www.learnpython.org/ 
http://www.codecademy.com/tracks/python 
http://learnpythonthehardway.org/book/ 
http://www.pluralsight.com/training 
  
OpenGL


 
http://glprogramming.com/red/ 
http://www.arcsynthesis.org/gltut/ 
http://www.opengl.org/wiki/Getting_Started 
http://www.learnopengles.com/ 
  
  
Game Development Software


 
Development KitWeb SiteUsable languages
Game Makerhttp://www.yoyogames.com/ GameMakerLanguage
Unityhttp://unity3d.com/UnityScript, C#, Boo
Unreal Development Kithttp://www.unrealengine.com/en/udk/
 UnrealScript

 http://www.unrealengine.com/en/features/unrealscript/    http://wiki.beyondunreal.com/UnrealScript_overview

 
JmonkeyEnginehttp://jmonkeyengine.org 
   
   
  
Video tutorials!  

 http://thenewboston.org/tutorials.php

  

 IDE

 There's a bunch of IDEs, many of them support multiple languages.  It is best to download some that are more recent in updating.  If you need any help feel free to ask.  

 http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments

 http://www.codeblocks.org/

 https://www.eclipse.org/downloads/

 https://xamarin.com/   - mobile development.  

 Other softwares:  

 http://www.notepad-plus-plus.org/ 

 Notepad++ is a free "source code" editor.

 http://www.sublimetext.com/2

 Text editor for code, free as long as you don't register.  

 http://www.blender.org/

 Blender is a free and open source 3D computer graphics software used for creating animated films, visual effects, art, 3D printed models, interactive 3D applications and video games.    [/font][/size]

 Programming on the go with Android. - Haven't used either one, let me know your thoughts.  [/color][/size]

 https://play.google.com/store/apps/details?id=com.aide.ui&hl=en

 C/C++/Java

 https://play.google.com/store/apps/details?id=x.compiler&hl=en

  [/font][/size]This one apparently supports a whole bunch.  

 -------------------------------------------------------------------------------------[/font][/size]

 (http://www.streamhead.com/wp-content/uploads/2011/02/what_programming_language_to_learn.png/)

 Recommendation:

 Do NOT set out to make a game engine!  Make a game first. 

Title: Re: Programming Thread
Post by: the-pi-guy on Jul 14, 2018, 01:33 PM
A One-Letter Typo is (in Part) the Reason Aliens: Colonial Marines Sucked (https://gizmodo.com/a-one-letter-typo-is-in-part-the-reason-aliens-colon-1827595643/amp)
Title: Re: Programming Thread
Post by: Legend on Jul 14, 2018, 03:45 PM
A One-Letter Typo is (in Part) the Reason Aliens: Colonial Marines Sucked (https://gizmodo.com/a-one-letter-typo-is-in-part-the-reason-aliens-colon-1827595643/amp)
Oops.

How would that not throw an error message?
Title: Re: Programming Thread
Post by: the-pi-guy on Jul 23, 2018, 01:04 AM
(https://i.redd.it/1drzv99kdib11.jpg)
Title: Re: Programming Thread
Post by: Legend on Aug 01, 2018, 06:18 PM
I updated to the new version of Unity and Unity breaks all my models by forcing me to re-import them (even though they literally work perfectly fine without being re-imported).

Unity can be really dumb.
Title: Re: Programming Thread
Post by: Legend on Aug 06, 2018, 11:09 PM
I know I don't need it, but I really want to set up arbitrarily precise floating point numbers in Unity.

IE floats are 4 bytes and doubles are 8 bytes, but I want 16 bytes and 32 bytes!!!
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 07, 2018, 12:51 AM
I know I don't need it, but I really want to set up arbitrarily precise floating point numbers in Unity.

IE floats are 4 bytes and doubles are 8 bytes, but I want 16 bytes and 32 bytes!!!
I really like playing with the bigdecimal class in Java. Although I wish it was a little friendlier.  
Title: Re: Programming Thread
Post by: Legend on Aug 07, 2018, 12:59 AM
I really like playing with the bigdecimal class in Java. Although I wish it was a little friendlier.  
I'm jealous of bigdecimal. If I was in Java I could just use that.

What makes it unfriendly? I only know it exists but I don't know how it's used.
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 07, 2018, 03:41 AM
I could have swore there was something awful about it.  

But maybe I just didn't like that operations were done like:
One.add(two);
Title: Re: Programming Thread
Post by: Legend on Aug 07, 2018, 06:11 AM
I could have swore there was something awful about it.  

But maybe I just didn't like that operations were done like:
One.add(two);
Oh yuck why would you ever set something up like that!?
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 07, 2018, 04:33 PM
Oh yuck why would you ever set something up like that!?
I don't like it.  It gets messy with bigger programs.
Title: Re: Programming Thread
Post by: Legend on Aug 12, 2018, 04:29 PM
(https://i.redd.it/3whkjaq68mf11.jpg)
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 12, 2018, 05:37 PM
Sometimes I like working inside my limits even when it makes no sense to do so.  

Like I'm really tempted to make my RPG from scratch, instead of learning how to use a game engine.  
Title: Re: Programming Thread
Post by: Legend on Aug 12, 2018, 06:07 PM
Sometimes I like working inside my limits even when it makes no sense to do so.  

Like I'm really tempted to make my RPG from scratch, instead of learning how to use a game engine.  
Well making your own game engine could look pretty good on a resume.  :)
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 12, 2018, 06:46 PM
Well making your own game engine could look pretty good on a resume.  :)
Yeah.  That's pretty much the only good reason to, though.  
I've thought about it.
Title: Re: Programming Thread
Post by: Legend on Aug 12, 2018, 06:55 PM
Yeah.  That's pretty much the only good reason to, though.  
I've thought about it.
Well are there any cool features you'd want your RPG to have that'd make it unique? If you do make your own engine, then it'd be nice if players could tell it wasn't just an off the shelf solution.
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 12, 2018, 07:24 PM
Well are there any cool features you'd want your RPG to have that'd make it unique? If you do make your own engine, then it'd be nice if players could tell it wasn't just an off the shelf solution.
This is for my language learning game.  I want to flesh it out and make it awesome. 

But I don't know of any very unique features to make it stand out. 
Title: Re: Programming Thread
Post by: Legend on Aug 12, 2018, 07:34 PM
This is for my language learning game.  I want to flesh it out and make it awesome.  

But I don't know of any very unique features to make it stand out.  
Oh I guess I just jumped in to assuming a 2D rpg.

If you're making a 3d game engine, that's just so much freaking work. (or is your language game 2d?)
Title: Re: Programming Thread
Post by: the-pi-guy on Aug 12, 2018, 07:43 PM
Oh I guess I just jumped in to assuming a 2D rpg.

If you're making a 3d game engine, that's just so much freaking work. (or is your language game 2d?)
I was thinking 2d like early Pokemon.

We cover this in a graphics course:

1. Graphics hardware, specifically the somewhat obsolete fixed function pipeline (OpenGL) and the programmable pipeline
(WebGL and GLSL) that has replaced it.
2. Two-dimensional graphics
3. Math necessities beyond the course prerequisites
4. Transformations in two- and three-dimensions
5. 3-D Viewing with the synthetic camera
6. Modeling 3-D shapes with polygon meshes
• Meshes obtained from various data collections
• Meshes obtained from "pure" mathematical surfaces, that is, surfaces with coordinates defined strictly from (paramet-
ric) functions.
• Approximating/interpolating curves and surfaces
7. Hierarchical modeling of 3-D objects
8. Lighting and Shading - the algorithmic rendering ladder
• The Phong reflection model and its variations, the Lambertian and Phong-Blinn models
• Gouraud shading
• Phong shading
• Texture mapping
• Bump mapping
• Reflection mapping
• Ray tracing
• Photon mapping
• Radiosity
9. Raster Algorithms - as time allows