Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 673 674 [675] 676 677 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 890475 times)

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10110 on: October 14, 2016, 03:37:53 am »

Quote
Maybe. In which case it's still may or may not be useless. Because there's pyoo.

Pyoo isn't an option, because unless you're e.g. making a toy office app, you're making it so you can get a job making office apps that other people can use. And almost always that means MS Office compatibility. Recommending a plug-in for Open Office isn't a good counter-argument to learning Visual Basic.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10111 on: October 14, 2016, 03:40:48 am »

Quote
The above is just a long euphemism for "interpreter is already shovelwared in". I don't see how "made by Microsoft" is an advantage.
“You can easily write your own report processor in place of the usual megalithic masonry.”

Other people can use it without a special set-up, and you can run in on virtually any host system at school or work without needing admin privileges or web access. They seem like good reasons to at least know how to do it. I mean, you wouldn't knock "learn Bash scripting" the way you're knocking learning how to write native VB scripts for Windows, and "learn Bash scripting" is relevant to literally 2% of the PCs in existence, vs "learn VB scripting" which will work out of the box on 90% of the world's PCs.

It's objectively a useful skill to know how to use the native scripting language used by 90% of the world's PCs. Being against anyone learning it for the sole reason that it's "made by microsoft", and promoting as an alternative something which probably has at most a 5% install base in the entire world (assuming 100% of the linux PCs have Python installed, and the same number of Windows boxes), is in fact a fairly irrational position, no matter how much more elegant Python is. That's like telling someone to learn Esperanto instead of English, or to type on Dvorak rather than Qwerty. They're objectively more elegant solutions to the same problem, but all three examples suffer from the same flaw of not taking reality, standards and interoperability into account.
« Last Edit: October 14, 2016, 05:04:16 pm by Reelya »
Logged

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10112 on: October 14, 2016, 06:59:00 am »

Code: [Select]
#!/bin/bash
password="abc"
mdecrypt test.nc $password
# and so on...

Something like this should work. If your password has whitespace, your variable needs to be quoted as well -
Code: [Select]
mdecrypt test.nc "$password"

Quote
Also, does anyone know where the files for "Bash on Ubuntu on Windows" are stored? They're supposed to be in appdata\local\rxss but the rxss folder is not there.

I'll have to check when I get home - didn't take my personal laptop to work today. I thought I found the directory before.
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10113 on: October 18, 2016, 10:59:18 pm »

Hey guys!

I just finished a very simple pokemon game on Java and I wanted to share it with all and ask what you think of it in terms of how it could have been made better. For the project I really wanted to work with oop, pointers, and anything else I felt was hugely important to the basics of programming in java.

In here is my main class/ tester where I run the code.
Spoiler (click to show/hide)

Spoiler (click to show/hide)

Again any thoughts or critique is appreciated since I know you all have your own things to do. Thanks for any help :)
Logged

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10114 on: October 18, 2016, 11:21:41 pm »

You do not need a duplicate Scanner.  Like, ever.  Or at least, I've never seen it.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10115 on: October 19, 2016, 02:35:41 am »

I'm putting my foot down: you've been told on at least three occasions now about the duplicate Scanners thing. you need to fix that before I'd even consider having a look at the rest. And by "fix" I mean rewrite the program, then edit your existing post with the improved version. Don't spam additional posts with the same code, because that will just clutter the thread, modify the old post with any improvements.

 If you ignored people about the scanners thing, how do I know that any advice I give you won't be ignored as well?

I seem to recall you saying something similar happened in your job: they got angry because you made the same mistake more than once. Be aware that you're doing the same thing to people in this thread. If you ever want a job as a programmer, they expect quick learners. The trick with being a so-called "quick learner" is to pay attention to what people tell you, then apply that. It's about actually paying attention to feedback.
« Last Edit: October 19, 2016, 03:11:32 am by Reelya »
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10116 on: October 19, 2016, 05:53:13 am »

Pretty much, yeah. Use a nice, simple IDE up until the point you need to link libraries.
Linking libraries is hell regardless of your IDE.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10117 on: October 19, 2016, 12:25:07 pm »

You do not need a duplicate Scanner.  Like, ever.  Or at least, I've never seen it.

I'm putting my foot down: you've been told on at least three occasions now about the duplicate Scanners thing. you need to fix that before I'd even consider having a look at the rest. And by "fix" I mean rewrite the program, then edit your existing post with the improved version. Don't spam additional posts with the same code, because that will just clutter the thread, modify the old post with any improvements.

 If you ignored people about the scanners thing, how do I know that any advice I give you won't be ignored as well?

I seem to recall you saying something similar happened in your job: they got angry because you made the same mistake more than once. Be aware that you're doing the same thing to people in this thread. If you ever want a job as a programmer, they expect quick learners. The trick with being a so-called "quick learner" is to pay attention to what people tell you, then apply that. It's about actually paying attention to feedback.

Where am i re-using the scanner? An i'm not saying 'fix this for me' i'm asking how you would have made it better as in a general design concept. It's not meant to be 'add x codes' onto here rather 'you should have re-written this with y in mind' or something.

Again where am I re-using scanners?


Scanner inputSystem = new Scanner(System.in);
      Scanner playerName = inputSystem;

I did this above so that my scanner could send input to playerName which is for objects.

EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

EDIT 2: Anyone know how to make the code boxes bigger? I have tiny little one sentence box that I can scroll which looks stupid.
« Last Edit: October 19, 2016, 01:19:27 pm by 3man75 »
Logged

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10118 on: October 19, 2016, 12:58:18 pm »

Hi! Can anyone point me in the right direction for solving this problem? I'm running Windows and I want to execute a program on a bunch of files. I can issue a command to the program like so:

Code: [Select]
ImageResizer /load "image.png" /resize auto "XBR 2x(hbounds=const, vbounds=const, thresholds=1)" /save "image_2x.png"
Basically, I want to run this program on all the images in a folder (and subfolders), loading in [IMAGENAME].png and saving as [IMAGENAME]_2x.png. The resize command is always the same. How do I do this programmatically? I've heard of things called shell scripts and batch files but I don't know where to start. I'm also somewhat competent at C, C++, Java and Python if there are easier solutions in those languages.
« Last Edit: October 19, 2016, 01:01:03 pm by DragonDePlatino »
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10119 on: October 19, 2016, 02:18:23 pm »

It's been a long time since I wrote a batch file, but I think you can just make a text file, put the commands you want on different lines, then name the file ending in .bat to make it a batch file.

If you want to pass different files, write a Python script that takes two filenames as command line arguments, then creates a command string using those filenames. From there you can use os.system(string command) to run it in the Windows shell.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10120 on: October 19, 2016, 02:37:20 pm »

If you're on a version of Windows with PowerShell and don't mind longer command names, I'd actually suggest a PowerShell script. Ranking serious programming languages by usability, I would place batch near the bottom.

We've got a piece of software here at work that I had to help maintain at one point. The effort to translate it into bash, fix it, and reverse the translation was preferable to just fixing it by itself.
Logged

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10121 on: October 19, 2016, 03:01:33 pm »

Yikes.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10122 on: October 19, 2016, 03:13:24 pm »

EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

But why are you naming your scanner after the variable you want to input? What would you do if you wanted to use scanners to input player name and player age? Can you demonstrate that? Then I'll show you what you're not understanding.
« Last Edit: October 19, 2016, 03:20:19 pm by Reelya »
Logged

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10123 on: October 19, 2016, 03:16:59 pm »

EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

But why are you naming your scanner after the variable you want to input? What would you do if you wanted to use scanners to input player name and player age? Can you demonstrate that? Then I'll show you what you're not understanding.
Yeah...
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10124 on: October 19, 2016, 04:42:10 pm »

EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

But why are you naming your scanner after the variable you want to input? What would you do if you wanted to use scanners to input player name and player age? Can you demonstrate that? Then I'll show you what you're not understanding.

Dosen't System.in take in any input whether they be a string or int (but not both of course)? I assume so because otherwise you would need a scanner for int, another for string, and maybe yet another for something like a double.

As for why I named it that I can say that I just don't remember. I built this project without a clear end point and built it up stage by stage and my naming of variables came with the need at the time. Specifically, I named each variable and scanner for what I needed at the time and not make it, um, more eternal.


EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

But why are you naming your scanner after the variable you want to input? What would you do if you wanted to use scanners to input player name and player age? Can you demonstrate that? Then I'll show you what you're not understanding.
Yeah...

Bro come on. Theirs enough salt in the sound as is. I've been beating my head again for almost the whole day and I really could do without with one word answers that emphasize someone else's point. It's not helpful and it serves only to frustrate ppl.
Logged
Pages: 1 ... 673 674 [675] 676 677 ... 796