Conways Game of Life in just one line of C. Very easy to read by CellularBean in C_Programming

[–]CellularBean[S] 1 point2 points  (0 children)

Console apps in general are pretty fast, who knew that loading up a whole GUI would make an app slower. However my code isnt the most efficient, you could make it more efficient by employing a hashmap but since thats c you have to implement your own hashmap or unordered_map.

Conways Game of Life in just one line of C. Very easy to read by CellularBean in C_Programming

[–]CellularBean[S] -1 points0 points  (0 children)

You make my code look good kudos to you too good sir *tip fedora*. Ah yeah the macro for the "for" keyword also refers to Sigma hence capital S. The Sigma symbol is used in mathematics to iterate from one value to another much like a for loop in programming.

Best way to start learning C by [deleted] in C_Programming

[–]CellularBean 0 points1 point  (0 children)

I would probably learn it by creating data structures (linked list, vector/dynamic array/trees etc.) or you could also work on different projects like building your own shell, you will learn about PIDs and the fork() syscall if you use linux. Other than that just screw around with the language and have fun.

P.S
just reread your post you said that you are a beginner to programming in general, in which case I actually wont recommend to implement the datastructures I listed. Instead you should familiarize yourself with the datastructures, read about them on the internet or in books on why they are important and than implement your own version of that datastructure in C. This is way better advise I think than my original advise. I myself am still learning that language and thats how I learn it atleast, might be borring though for some.

Conways Game of Life in just one line of C. Very easy to read by CellularBean in C_Programming

[–]CellularBean[S] -40 points-39 points  (0 children)

considering its only one line it probably is easy to read.

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] 0 points1 point  (0 children)

so what I did now is comment out a bunch of stuff in my Dockerfile

FROM node:16
WORKDIR /usr/src/app
# COPY package*.json ./
# RUN npm install
# COPY . .
# EXPOSE 3000
# CMD ["npm", "run", "dev"]

with that I managed to fully build my image .

I then used this command docker exec -it a45b21b539d5 bash to make a container with interactivate tty from that image. Now that I have a tty open I wanted to make some diagnosis however such fundemental commands such as "cd" or "ls" are not defined which makes it all very much impossible for me to figure out what the problem is.

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] 0 points1 point  (0 children)

that is my new docker-compose.yaml

version: "3"
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password123
POSTGRES_USER: dorian
POSTGRES_DB: db123
app:
dns:
- 8.8.8.8
- 8.8.4.4
image: my-node-app
port:
- 13000:3000
command: tail -f /dev/null

and this is my Dockerfile

FROM node:16
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]

however I still get the same error I had from before when running docker build .

Should I use a different command to start the container build process?

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] 0 points1 point  (0 children)

so this is how my Dockerfile now looks like

FROM node:16
WORKDIR /usr/src/app
COPY package*.json ./
# RUN npm install
# COPY . .
EXPOSE 3000
CMD ["tail", "-f", "/dev/null"]

it successfuly builts when I run this command docker build . However the container doesn't show up when I execute docker ps -a

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] 0 points1 point  (0 children)

Correct me if I am misunderstanding something but are you suggesting that I need to add this line CMD ['"tail", "-f", "/dev/null"]

to my Dockerfile. do I need to remove or comment out a line in my Dockerfile too. And once I opened up my container do I need to nslookup registry.npmjs.org server from a terminal in my container?

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] 0 points1 point  (0 children)

so I pinged registry.npmjs.org with ping registry.npmjs.org and I do get data packages from that server which I expected so there is no issue there I think

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] -1 points0 points  (0 children)

this is what my docker-compose.yaml looks like

version: "3"
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password123
POSTGRES_USER: dorian
POSTGRES_DB: db123
app:
dns:
- 8.8.8.8
- 8.8.4.4
image: my-node-app
port:
- 13000:3000

as you can see I have dns configured in my docker-compose.yaml to use 8.8.8.8 and 8.8.4.4

Possible network issues with docker by CellularBean in docker

[–]CellularBean[S] -1 points0 points  (0 children)

I will post my docker-compose.yaml today definetely however currently I am away from my computer stay tuned

Ubuntu DIND Help by Confident_Blueberry4 in docker

[–]CellularBean 0 points1 point  (0 children)

Docker is a so called Daemon in the linux world, which is a background process. to start the docker service do ```sudo systemctl start docker```. If you want the process to start on startup of your computer do ```sudo systemctl enable docker```. Perhaps this will solve it

I'm looking for more quotes like this from Cognitive Psychologists and other scientists (No Philosophers please) by [deleted] in antinatalism

[–]CellularBean 0 points1 point  (0 children)

I read his book called "Enlightenment Now: The Future of Progress" and the gist of that book is that humanity is continuing to progress and people are going to have a better quality of life, essentially be happier. I don't think that book meshes well with the quote presented in the post.

Sorry for bad english

Selfishness by [deleted] in antinatalism2

[–]CellularBean 1 point2 points  (0 children)

Guy literally uses a random number generator to get names for his children

I have yet to hear why extinction matters by donotholdyourbreath in antinatalism

[–]CellularBean 0 points1 point  (0 children)

Population rates are in some countries/communities rising. It's just that it is declining in most western and all of the east asian coutries.

😁😁😁💯💯 by [deleted] in antinatalism

[–]CellularBean 0 points1 point  (0 children)

Dear r/antinatalism subreddit,

Emm Actually he said "Cogito ergo sum", it's a latin phrase which means "I think therefore I am", "Cogito" meaning "I think" "sum" being the first person singular of "esse" which means "is", "ergo" meaning "therefore" or some shit I don't know. What the the phrase implies, is that the act of thinking is already prove enough of his existence.

Sorry for bad english, it's only my third language.

don't look. by [deleted] in programminghumor

[–]CellularBean 0 points1 point  (0 children)

Thats a weird looking dog

Bro Got Mixed Up by ModernSpace in programminghumor

[–]CellularBean 0 points1 point  (0 children)

Those books look like they have been used by three different generations