This forum is for all the topics that don't fit anywhere else. Post anything from Hello's to Web Links.
 #126746  by Akimoto
 
So... I am learning a new programming language (C#), and I was wondering if any windows users (C# is made for Windows) could help me test my mathelatur... mathelator... (name undecided)... calculator!

Download link (.zip): http://www.dropbox.com/s/87b0jvz9ffpugl ... r.zip?dl=1
Size: ~40 kb

I have already had a few of my friends test it, only to find a bug that crashed it - which is now FIXED (wohoo)

There are a few "visual" bugs (low priority) that I intend to fix. For one, the comma looks screwed up while typing. Another one is when you enter negative numbers, the "-" is behind the number, not in front!

Screenshot of the calculator:
http://prntscr.com/4lim4f
Last edited by Akimoto on Wed Sep 10, 2014 6:34 pm, edited 3 times in total.
 #126755  by Key
 
Akimoto wrote:... C# is made by Windows ...
Image

Where Windows is code-word for Microsoft


anyways, I'd be more interested in looking at your source files if you want coding related critique
 #126767  by jawfin
 
Its so cute. If you want to make it a powerful calculator you need only give it the option to accept "Reverse Polish notation".
 #126769  by Zabuza
 
Akimoto wrote:

For one, the comma looks screwed up while typing.
You mean the decimal point, correct? If not, when I select a number and then the decimal point, the decimal point appears before the number which is incorrect.

Anyway, you need to set a maximum length on your textbox. If you want your maximum length to be greater than the width of your textbox's width, then you'll need to wrap your text.

Also, being picky as a double math major, when x / 0 we usually refer to it as undefined, not infinity.

If you need help, I'm a C# developer "by trade".

Edit: Just found that if you do 0 / 0 it will display NaN which is fine, should be like that for the case i gave above.
 #126777  by jawfin
 
As Key said, if you want real feedback, hand over the source!! Trust me, I *will* find things to be improved upon, ask any fledgling programmer here ;)
 #126782  by Akimoto
 
I am going to read up some more about GIT. I really want to use it, however I am really poor at... uhh... keeping it sync'd! I would like to learn how to use the simple "git" thing (console commands only) and manually pull push and commit that stuff. I still have trouble differentiating between the pull push commit stuff.

Once I find out how ... I will put it on github, then anyone can fork it and help :D (The most important part is that I learn!!! Don't do all the work for me :) )


Edited by Jawfin: Removed swear word. And may I add Image
 #126800  by jawfin
 
It's not like this is some massive open-source project, it's a tutorial 101 - just to put it in perspective. Just because you painted a picture with finger painting doesn't mean you immediately go looking for a gallery to display it in. If you want honest feedback just zip the source and host it somewhere.
 #126802  by Key
 
Jawfin wrote:ask any fledgling programmer here ;)
I remember when I showed Jaw one of my first shaders... I got a lashing for incorrect indentation, and that was before the real lesson even started

the more I think about it the worse I feel, so I apologize Jaw for all the horrible bowls of code spaghetti I threw at you. But look where I am today! I can still barely make a working linked list in C++! :D
 #126816  by Akimoto
 
Can Jawfin PM me the swear word I used? As far as I know, I did not swear...

Jawfin wrote:It's not like this is some massive open-source project, it's a tutorial 101 - just to put it in perspective. Just because you painted a picture with finger painting doesn't mean you immediately go looking for a gallery to display it in. If you want honest feedback just zip the source and host it somewhere.
I agree, the calculator itself is a "tutorial" (at least that's where I started to get familiar with C#), however the tool I am making requires a calculator, so the calculator itself is the easy part. (I promised myself when I completed my tool, I will buy Oculus Rift DK2)
 #126830  by jawfin
 
I haven't fully dissected it, but I must say you write good code, well structured, useful comments, meaningful variable names. The long-winded "if then else"s are hard to read - you could remove all the bracketing around the single statements, just so it flows (assuming C# supports that) - but that's not a criticism, just a personal preference.
 #126874  by Akimoto
 
Okeey!

I think I have fixed the serious bugs, since I am no longer able to reproduce the crashes. If I am wrong, please let me know asap so I can start working on it! :)
I also have to find a way to put the minus infront of numbers, instead of behind them - no idea where to start , probably at Google (among other "features" I want to implement).

Download @ https://www.dropbox.com/s/87b0jvz9ffpug ... r.zip?dl=1
Source (latest) @ https://github.com/Tyboroth/Calculator

Appreciated!
Jawfin wrote:I haven't fully dissected it, but I must say you write good code, well structured, useful comments, meaningful variable names. The long-winded "if then else"s are hard to read - you could remove all the bracketing around the single statements, just so it flows (assuming C# supports that) - but that's not a criticism, just a personal preference.

Yes, I agree; I want to clean up all the if else statements. I basically added them wherever I needed them to prevent bugs and/or add "features".
 #126911  by Akimoto
 
Cleaned up a bunch of code and added more informative comment (should be able to follow the programming flow without having to think "too" much, hehe). I cannot find a single bug that can crash the calculator!! bwaha.. hrh..
 #126913  by Zabuza
 
A C# convention is to name methods with the first letter uppercase. Overall, your code is well designed.

Edit::

Another suggestion I have is to declare your operator characters, +, -, etc, as class level constants. Also, on the line above a function header, you can type /// to make method comments.
 #126914  by Akimoto
 
Zabuza wrote:A C# convention is to name methods with the first letter uppercase. Overall, your code is well designed.

Edit::

Another suggestion I have is to declare your operator characters, +, -, etc, as class level constants. Also, on the line above a function header, you can type /// to make method comments.
Thanks - I'll fix it. I always aim to follow the convention of each language (although it can sometimes be difficult to differ between then).

Not sure how the constants work in C# (syntax). I'll keep that in mind next time I am working on the code.
 #126972  by Lothar
 
You know you don't belong in this conversation when the first thing you think upon reading " Calculators " is ...... " What numbers can I make look like words? "
 #127027  by Akimoto
 
All bugs are fixed. Only visual "annoyances" left. I want minus infront of the "%¤%&#¤ numbers and comma to display correctly when pressing "2 . " (it displays as .2 )
 #127056  by Zabuza
 
Lothar wrote:You know you don't belong in this conversation
 #127094  by Akimoto
 
Unless someone know how I can get the minus infront of the result textbox (instead of currently behind on the right) and/or how to fix the weird display of comma - I will not be working on this for a while. Currently focusing on working on the RCG Tool (also on github) :)
 #127095  by Mandalorian
 
RCG? Ronald Craig's Ghetto?
Renting Colored Garages?
Rescuing Cold Groceries?
 #127097  by Zabuza
 
Manda, please stay on topic..
 #127099  by jawfin
 
Even still, Aki didn't answer the question.
Google + "RCG Tool github" = https://github.com/laurion/RoboSoccer/b ... ol/rcg.xsd

Google + "RCG Tool wikipedia" = http://en.wikipedia.org/wiki/RCG
Radio Crne Gore, a radio station in Montenegro
Republic of Montenegro, state preceding independent Montenegro
The Radio Church of God, now the Worldwide Church of God
Range Concatenation Grammar, a type of formal grammar
Revolutionary Communist Group (disambiguation), several political parties
Royal Cambodian Government
Reed Canary Grass, a type of biomass.

Of all those I would guess Range Concatenation Grammar, but that seems too complex to follow a basic calculator.

When using unknown terms, it wouldn't hurt to actually explain them.
Or as urban dictionary puts it "rollercoaster girl" - big help that was!

How to vague?
 #127100  by Zabuza
 
I'm guessing Random Character Generator based on the content in Github.