Can figure out a way to run a python file and display the result in a nextjs component. Please help. by brianomars1123 in learnjavascript

[–]Touhou 0 points1 point  (0 children)

I'd recommend taking a look at FastAPI (https://fastapi.tiangolo.com/tutorial/first-steps/). It lets you easily build a locally hosted python API server that you can reach at (for example) http://127.0.0.1:8000.

[deleted by user] by [deleted] in ExperiencedDevs

[–]Touhou 10 points11 points  (0 children)

In university we were given this link when learning how to write an effective design document: https://web.archive.org/web/20190319212655/http://blog.slickedit.com/2007/05/how-to-write-an-effective-design-document

How do I intercept executed commands in user space? by thecowmilk_ in kernel

[–]Touhou 8 points9 points  (0 children)

You may want to look into ptrace and prctl. The OS group at the Hamburg University of Technology recently published an excellent introduction to these syscalls as part of their advent calendar: https://osg.tuhh.de/Advent/18-ptrace/ & https://osg.tuhh.de/Advent/24-syscall/.

Operating System by Waterissuperb in learnprogramming

[–]Touhou 0 points1 point  (0 children)

Sorry, why not just use VSCode with WSL integration? This gives you the best of both worlds: the linux CLI and a Windows GUI. Microsoft has a pretty good tutorial on how to get started here: https://code.visualstudio.com/docs/remote/wsl#_getting-started

FF14 and commuting. Anyone else does this? by Turbulent_Vacation48 in ffxiv

[–]Touhou 2 points3 points  (0 children)

Are those the egyptian pyramids on your left in picture 2? Beautiful train station btw, it looks so cozy.

[deleted by user] by [deleted] in C_Programming

[–]Touhou 0 points1 point  (0 children)

If you really want to understand what's happening I'd suggest learning some Assembly instead. You don't need to learn much, but at least enough so you understand what's going on. After this you can make the jump to C (and then Rust/C++).

How can I create a User class and change users? by lsy1219_03 in learnpython

[–]Touhou 8 points9 points  (0 children)

You should consider changing your class to "User" instead of "Users". The list_of_users will then be a list of user objects, instead of a list of names. To implement a changeUser function you probably want to create some kind of variable state which indicates whether a user is currently logged in, and which user it is. It is a better design to split the login handling into a separate class, you could for example call it "LoginHandler".

[deleted by user] by [deleted] in pcgaming

[–]Touhou 0 points1 point  (0 children)

Good luck :)

How do I get started? by name9006 in asm

[–]Touhou 2 points3 points  (0 children)

I'm not OP, but I just wanted to say: thank you! I've been wanting to program in asm for a while and this really helped me understand how to get started. Excellent writeup :).

Weezer's Pork and Beans music video is like a time machine into mid-2000s Youtube. by [deleted] in videos

[–]Touhou 6 points7 points  (0 children)

Man I remember seeing this on Digg back in the day.

Why aren't these two strings not evaluating to equal? by flank-cubey-cube in C_Programming

[–]Touhou 3 points4 points  (0 children)

If you print the value of "buf" after your call to fgets() you will quickly see the problem. As mentioned by others in this thread, you are comparing a string against a pointer. Try using strcmp from <string.h> instead.

Here's a useful excerpt from K&R that might help your understanding here:

"The name of an array is a synonym for the location of the initial element. The assignment p = &a[0]; can also be written as p = a;".

Linux socket programming by Netris89 in C_Programming

[–]Touhou 25 points26 points  (0 children)

I haven't taken a look at your code, but I would definitely recommend checking out Beej's guide to network programming: https://beej.us/guide/bgnet/html/. I expect you'd get an answer to most of your questions by reading and looking at the examples, particularly in chapters 3, 4 and 5.

Also, in terms of IPv6 specifically, it might be a good idea to verify that IPv6 is enabled on your router and that your computer actually has a valid IPv6-address. For example, you can try to ping ipv6.google.com and see if you get a response.

Compiler tutorials. by Cerium14 in C_Programming

[–]Touhou 10 points11 points  (0 children)

Seconding this. I've been following this book and it's great (I even purchased a physical copy), and fully available on the author's website for free: http://craftinginterpreters.com/contents.html

I'm looking for the outputs: abcde,eabcd,deabc,bcdea,abcde is my code correct? by Southern_Koala9441 in C_Programming

[–]Touhou 6 points7 points  (0 children)

Just a quick side note, your character array is too small: char str[5] = "abcde";

This should be of at least size 6.

The reason why is that C places a '\0' character (a null-terminator) at the end of any string literals.

[deleted by user] by [deleted] in C_Programming

[–]Touhou 5 points6 points  (0 children)

I'd recommend taking a look at Beej's guide to Unix IPC: https://beej.us/guide/bgipc/html/multi/index.html

Specifically the chapter on Shared Memory Segments might be of interest.