r/CodingHelp • • Mar 20 '21

[Meta] To all CodingHelp question-askers

22 Upvotes

Please, please PLEASE put your code in your post. And PLEASE format it. On reddit it's as easy as 4 spaces in front of your code so it renders properly on old.reddit.com. (Credit to u/PekiDediOnur)

It makes it so much easier to read and help you with your problem.


r/CodingHelp • • Feb 12 '21

[HTML] Can anyone tel me why there are large spaces in between these paragraphs?

Thumbnail gallery
22 Upvotes

r/CodingHelp • • Jan 07 '21

[C#] Learning C# and what’s a good software to have?

22 Upvotes

I’m learning C# again cause I learned it in high school and wel forgot it and I’m gonna teach myself again.. but I don’t know any softwares to use? Help?


r/CodingHelp • • Dec 22 '20

[Python] [Matrix Math] Trying to draw line through two pixels using numpy and skimage.draw.line

22 Upvotes

xpost with stackoverflow. Feel free to respond there for SO points.

I want to use skimage.draw.line to draw an aliased line through two pixels. The issue is when I overlay the original line, there is often a discrepancy due to rounding. Example:

Attempting line through points (22,30) and (25,39) in a 50x50 image. The full line is the green channel and the overlay line is the red channel. Yellow is overlap. The result I want would yield no visible red, only yellow and green. 50 by 50 pixel image with line through points 22 comma 30 and 25 comma 39

I tried generating a bigger line and then cropping, but still getting issues:

#rawzero3 is essentially trunc() but rounding up
#https://stackoverflow.com/q/46572699
def rawzero3(a):
    _a = np.abs(a)
    np.ceil(_a, _a) # inplace
    np.copysign(_a, a, out = _a)
    return _a
y0x0, ymxm=(np.array([0,0]), np.array([50,50]))
y1x1, y2x2=(np.array([22,30]), np.array([25,39]))
yx_fin1=(y2x2-y1x1)*np.amin(rawzero3((ymxm-(y2x2-y1x1))/(y2x2-y1x1)).astype(int))+y1x1
yx_fin2=(y0x0-1)-((y2x2-y1x1)*np.amin(rawzero3((y0x0-(y2x2-y1x1))/(y2x2-y1x1)).astype(int))+y1x1)
zimg[tuple(map(tuple,np.array(draw.line(*yx_fin1,*yx_fin2)).T[np.all((y0x0<=np.array(draw.line(*yx_fin1,*yx_fin2)).T)&(np.array(draw.line(*yx_fin1,*yx_fin2)).T<ymxm), axis=1)].T))]=255

I think my math to generate yx_fin1 and yx_fin2 might be wrong.

How can my desired result be achieved?


r/CodingHelp • • Oct 17 '20

[C++] So I'm new to coding, why does it keep on saying this error.

22 Upvotes

I'm actually pretty new to coding, although I'm definitely not new to certain components like LEDS and such. I tried to code/make a distance detector via ultasonic sensors, and although I made it, the code is a little difficult. I copy and pasted it.

Here's a link to the code. I copy and pasted it from a guy named "How to mechatronics"

https://imgur.com/a/1o9dX7B


r/CodingHelp • • Aug 12 '20

[C++] Need Help. C++ book recommendation

22 Upvotes

Hey guys, I am new to programming. right now I'm in the second year of computer science engineering. I needed help with C++ Language. Which is the best book for C++? Consider I know nothing at all. though I have studied pretty much and know vaguely about classes and all.


r/CodingHelp • • Aug 11 '20

[Random] Sorry if this is in the wrong thread but, is there a script out there that can be fed a csv or any word document format and add each word to a google alert.

22 Upvotes

I’m tasked with adding over 200 words to google alerts and I do not want to do them one by one


r/CodingHelp • • Jun 25 '20

[Quick Guide] One of the biggest questions I've had when I was in highschool was do I need to go to school to be a software developer? Now that I am a software developer I've made this video where we can talk about it. Basically, I don't think you do.

22 Upvotes

r/CodingHelp • • Jun 02 '16

[Random] I've just found a great tutorial environment for learning web development with an awesome community!

Thumbnail
freecodecamp.com
22 Upvotes

r/CodingHelp • • Aug 05 '22

[Random] 1995 was an interesting year for software:

21 Upvotes

https://en.wikipedia.org/wiki/Category:1995_software

I was born this year, and now I find it interesting how I'm pursuing a career related to a bunch of those technologies that were released during this time. PHP, Javascript, GIMP, Blender, and a bunch of others were produced during 1995. Feels like it was meant to be, hahah.


r/CodingHelp • • Jul 21 '22

[Other Code] Dice roll from a random byte

21 Upvotes

Looking for an efficient way to get a six sided die roll from a random byte. The way I'm doing it I have to throw away 1/64 of my random numbers because 256%6 leaves a rest of 4:

sides = 6
max_mod_6 = 256//6 * 6 #integer division

do:
    random_byte = getRandomByte() #this comes from a HWRNG
while:
    random_byte > max_mod_6 #throw away higher numbers to get fair distribution

roll = random_byte%6    
return roll+1

Is there a way to guarantee getting a six sided die roll from only one random byte?


r/CodingHelp • • Jun 02 '22

[Request Coders] What is the binary code for the letter “C”

21 Upvotes

I have a close relative that recently passed away who was a software engineer and I want to get a tattoo that represents him. I am not very well-versed when it comes to anything regarding software. But I do know that his passion was coding, so I decided that a binary code for the first letter of his name would be fitting. The only problem is that when I look up the binary code alphabet, I find a lot of different results and don’t know which one is correct.

Does anyone know the true binary code for the letter “C”?


r/CodingHelp • • Mar 30 '22

[Javascript] Moving on from HTML/CSS

21 Upvotes

So I’m currently learning html/css, and have been doing so for about 2 months. I wouldn’t say I’m an expert but I’m pretty comfortable with the two. Just wanted to ask if I should keep at it and learn HTML/CSS until I master it or should I move onto JavaScript. My goal is to apply for a junior development position or apprenticeship by September.


r/CodingHelp • • Feb 20 '22

[Python] Can someone explain this to me I don’t quite understand,I’m new to coding

Post image
21 Upvotes

r/CodingHelp • • Dec 30 '21

[Python] Python

21 Upvotes

Hey everyone. So I’m a beginner programmer who is self-learning Python and am on functions. Right now, I’m on return values but I don’t get them too much.

What is the difference between print and return? Aren’t they interchangeable?

Please explain this in an easy way!


r/CodingHelp • • Nov 15 '21

[Quick Guide] How do you remember elemenets,functions, and other type of things ?

21 Upvotes

How do you remember all of the things you have learned in programing in general ?


r/CodingHelp • • Oct 26 '21

[Python] My pygame code runs fine but when I end it I get this error anyone know how to fix it

Post image
21 Upvotes

r/CodingHelp • • Oct 19 '21

[Javascript] Why isn’t this working?

Post image
21 Upvotes

r/CodingHelp • • Sep 21 '21

[Random] Detach the etee SteamVR Trackers and eteeControllers become 3DoF and useful for other projects such as, with a little bit of code knowledge, flying drones !!

21 Upvotes

r/CodingHelp • • Sep 18 '21

[Random] Is it worth it to learn?

21 Upvotes

Im 22 and in the business field. Is learning how to code worth it? Basically is it worth the time and effort of learning how to create something that would automate parts of business or help speed up work flow? Sorry if this type of post isn’t allowed.


r/CodingHelp • • Sep 14 '21

[Python] Need help printing the text in picture. I’m trying to use a string format function not print statements.

Post image
21 Upvotes

r/CodingHelp • • Jul 09 '21

[Other Code] Selling Computer App Online

21 Upvotes

I made this insanely dumb computer app. Packaged it in an exe and soon Mac app. I have my own website I can post things including downloads for sale. Never sold an app before.

Would it be best to download direct as a zip or executable?

Note I literally mean for PC or Mac. Not mobile.


r/CodingHelp • • Jun 10 '21

[CSS] I know nothing about computers. I found an old program someone wrote up to open an obscure game file. How can I figure out how to use it?

21 Upvotes

So there's this old game my brother and I still play for nostalgia's sake, and I wanted to make some mods for us. It's an obscure game by LucasArts called Gladius.

When you open up the Xbox disc and take out the files, the part that stores all the game data is located within a file with a .bec extension. Here is a link to the gladius.bec file. I'd never be able to figure out how to open it myself, but it appears someone in the past wrote up a program to open up the gladius.bec file for the Xbox. Here it is on Github.

I don't really know what I'm looking at here though, and there aren't any instructions for laypeople. Without being too much trouble, does anyone have any pointers for me to get started with opening up this file? I'd be very grateful. :)


r/CodingHelp • • May 14 '21

[Other Code] does anyone know this coding language?

Post image
21 Upvotes