- 149
- 624 418
Oceano
Italy
เข้าร่วมเมื่อ 31 ส.ค. 2022
I code with you, i’m not a teacher.
My problem is equal to yours, let’s solve it together. Comment for optimizations, corrections & co. This page can become a gold mine for learners. (Attention, there may be 🐞😂)
My problem is equal to yours, let’s solve it together. Comment for optimizations, corrections & co. This page can become a gold mine for learners. (Attention, there may be 🐞😂)
Let's build a super simple shell
CODE (refined a little for github, made nicer)
github.com/suspectedoceano/imperfect-cell.git
Writing Your Own Shell:
www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf - Chapter 5: Writing Your Own Shell (PDF guide).
github.com/kamalmarhubi/shell-workshop - A step-by-step guide to building a shell in C.
indradhanush.github.io/blog/writing-a-unix-shell-part-1/ - Blog series: Writing a UNIX shell in C.
github.com/tokenrove/build-your-own-shell - A GitHub project for building your own shell.
danishpraka.sh/posts/write-a-shell/ - Tutorial: Writing a shell in C.
www.gnu.org/software/libc/manual/html_mono/libc.html#Implementing-a-Shell - The GNU C Library: Implementing a Shell.
aosabook.org/en/v1/bash.html - A deep dive into Bash's architecture.
Big Picture (Minishell):
whimsical.com/minishell-architecture-big-picture-7b9N8PL3qHrddbs977mQ2J - Visual architecture for building a shell.
m4nnb3ll.medium.com/minishell-building-a-mini-bash-a-42-project-b55a10598218 - Blog: How to build a mini-bash shell.
Cool Tools:
explainshell.com/ - Tool to match command-line arguments to their help text.
MIT Shell Resources:
th-cam.com/play/PLbtzT1TYeoMhF4hcpEiCsOeN13zqrzBJq.html&si=o2z1PYgmMfqUUs5u - MIT Playlist: Shell code explained.
typedef struct 🔗s_links🔗
{
🇮🇹🍕🍝My Italian channel - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html
👨🏻🏫 FREE Udemy course for total beginners, pre_knowledge before C (Overflow, 2’s complement, BASH, VIM…) - www.udemy.com/course/oceano_0b0001/?referralCode=C218698D6A3E3D16EEEB
📑 Notion community page (FREE coding sources) - suspectedoceano.notion.site/Ocean-s-42-fd42e3ed0f6049ca98fb3b290b84d4d0?pvs=4
🧾 Medium (code articles) - medium.com/@jalal92
📲 Telegram group - t.me/suspectedoceanO
💻 GitHub - github.com/suspectedoceano
🛸 Discord - discord.gg/hkUvRaDcEP
🐦 Twitter - SuspectedOceano
☕️ ChannelSupport - www.buymeacoffee.com/suspectedoceano (if you read this, you are already supporting, TY!)
} 🔗t_links🔗
Timeline
00:00:00 Intro
00:05:40 REPL, reading a line from stdin
00:19:30 REPL, strtok to get tokens
00:30:08 REPL, builtin
00:40:35 fork, execvp, wait
github.com/suspectedoceano/imperfect-cell.git
Writing Your Own Shell:
www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf - Chapter 5: Writing Your Own Shell (PDF guide).
github.com/kamalmarhubi/shell-workshop - A step-by-step guide to building a shell in C.
indradhanush.github.io/blog/writing-a-unix-shell-part-1/ - Blog series: Writing a UNIX shell in C.
github.com/tokenrove/build-your-own-shell - A GitHub project for building your own shell.
danishpraka.sh/posts/write-a-shell/ - Tutorial: Writing a shell in C.
www.gnu.org/software/libc/manual/html_mono/libc.html#Implementing-a-Shell - The GNU C Library: Implementing a Shell.
aosabook.org/en/v1/bash.html - A deep dive into Bash's architecture.
Big Picture (Minishell):
whimsical.com/minishell-architecture-big-picture-7b9N8PL3qHrddbs977mQ2J - Visual architecture for building a shell.
m4nnb3ll.medium.com/minishell-building-a-mini-bash-a-42-project-b55a10598218 - Blog: How to build a mini-bash shell.
Cool Tools:
explainshell.com/ - Tool to match command-line arguments to their help text.
MIT Shell Resources:
th-cam.com/play/PLbtzT1TYeoMhF4hcpEiCsOeN13zqrzBJq.html&si=o2z1PYgmMfqUUs5u - MIT Playlist: Shell code explained.
typedef struct 🔗s_links🔗
{
🇮🇹🍕🍝My Italian channel - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html
👨🏻🏫 FREE Udemy course for total beginners, pre_knowledge before C (Overflow, 2’s complement, BASH, VIM…) - www.udemy.com/course/oceano_0b0001/?referralCode=C218698D6A3E3D16EEEB
📑 Notion community page (FREE coding sources) - suspectedoceano.notion.site/Ocean-s-42-fd42e3ed0f6049ca98fb3b290b84d4d0?pvs=4
🧾 Medium (code articles) - medium.com/@jalal92
📲 Telegram group - t.me/suspectedoceanO
💻 GitHub - github.com/suspectedoceano
🛸 Discord - discord.gg/hkUvRaDcEP
🐦 Twitter - SuspectedOceano
☕️ ChannelSupport - www.buymeacoffee.com/suspectedoceano (if you read this, you are already supporting, TY!)
} 🔗t_links🔗
Timeline
00:00:00 Intro
00:05:40 REPL, reading a line from stdin
00:19:30 REPL, strtok to get tokens
00:30:08 REPL, builtin
00:40:35 fork, execvp, wait
มุมมอง: 3 007
วีดีโอ
Code performance in C: Augment your Linked List
มุมมอง 4722 หลายเดือนก่อน
Code performance in C: Augment your Linked List
Minitalk : Goku and King Kai having a minitalk using Unix signals and sigaction in C
มุมมอง 1.5K2 หลายเดือนก่อน
CODE github.com/suspectedoceano/minitalk My bug stackoverflow.com/questions/71132499/siginfos-si-pid-sets-itself-to-0-after-a-few-calls-of-the-same-function TIMELINE 00:00:00 intro 00:02:00 getpid function 00:02:47 pause function 00:03:24 sigaction for SIGUSR1 and SIGUSR2 00:15:13 client & server connection code 00:30:08 volatile an sig_atomic_t in C 00:31:28 concluding/debugging/testing typede...
Why is the gets function so dangerous that it should not be used?
มุมมอง 1.2K3 หลายเดือนก่อน
Code github.com/suspectedoceano/gets.git 00:00:00 gets 00:05:20 Is fgets safe?
Beej's guide to C programming, chapter 8: Structs
มุมมอง 1.8K3 หลายเดือนก่อน
FREE C BOOK beej.us/guide/bgc/ Thumbnail from: nmhuxtoo_design?igsh=MngyaGxpM2ZnOHJj& Let’s create the biggest coders community! typedef struct 🔗s_links🔗 { 🇮🇹🍕🍝My Italian channel - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html 👨🏻🏫 FREE Udemy course for total beginners, pre_knowledge before C (Overflow, 2’s complement, BASH, VIM…) - www.udemy.com/course/oceano_0b0001/?referralCo...
print_combn using backtracking
มุมมอง 3863 หลายเดือนก่อน
00:00:00 Easy backtrack to exercise 00:08:07 print_combn
print_combn recursive: foo displaying all different combinations of n numbers by ascending order
มุมมอง 3754 หลายเดือนก่อน
Link to Alberto www.linkedin.com/in/alberrod?
The n queens problem using backtracking and Naruto in C ELI5
มุมมอง 1.2K6 หลายเดือนก่อน
Code github.com/suspectedoceano/piscine42/tree/main/c05/N_QUEENS_VIDEO typedef struct 📖must_read_book 📖 { The C programming 👑-amzn.to/3VJEC4X Command line, IDE, GIT tldr-ELI5-amzn.to/3BDPZ7x CSAPP, great book to understand computers deeply-amzn.to/3VKUG6a Best book on computer architectures- amzn.to/4fmtu4N OS- amzn.to/4gfq5pI Crafting interpreters, all about interpreters compilers-amzn.to/4iKs...
These are very different performances with the Fibonacci sequence algorithms in C
มุมมอง 7686 หลายเดือนก่อน
TIMESTAMP 00:00:00 Fibonacci recursive naive solution 00:02:30 Fibonacci iterative 00:04:14 Fibonacci with memoization 00:07:35 Benchmarking the algos 00:12:20 Function to derive fib values et’s create the biggest coders community! typedef struct 🔗s_links🔗 { 🇮🇹🍕🍝My Italian channel - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html 👨🏻🏫 FREE Udemy course for total beginners, pre_knowledge before ...
Beej's guide to C programming, chapter 7: Strings
มุมมอง 7458 หลายเดือนก่อน
Useful source links for video sources medium.com/@jalal92/strings-in-c-86bd06d6063e stackoverflow.com/questions/164194/why-do-i-get-a-segmentation-fault-when-writing-to-a-char-s-initialized-with-a macOS video version th-cam.com/video/RbcAHJOWVzw/w-d-xo.html BEEJ book beej.us/guide/bgc/pdf/bgc_usl_c_1.pdf 👨🏻🏫 Udemy course for total beginners, pre_knowledge before C (Overflow, 2’s complement, BA...
Why this also works? A bad Intro to strings in C
มุมมอง 1.9K8 หลายเดือนก่อน
mentioned videos th-cam.com/video/lFRp0tZKosc/w-d-xo.html from @tortellini_soup th-cam.com/video/lubj1yUN9hw/w-d-xo.htmlsi=05f8tWmo5SESmp4v from @ThePrimeagenClips th-cam.com/video/i55ptVQw1Kk/w-d-xo.htmlsi=BEC_kvrQQqIFh0Hf from @lauriewired The theory behind the C quick is already explained there, I don't repeat in this video. The trick also works with strings, as in C strings "barely exist", ...
is a computer science degree worth it?
มุมมอง 1.9K8 หลายเดือนก่อน
🇮🇹🍕🍝Canale Italiano - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html
Are arrays just pointers in C?
มุมมอง 1.3K8 หลายเดือนก่อน
🇮🇹🍕🍝Canale Italiano - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html . BEEJ book beej.us/guide/bgc/pdf/bgc_usl_c_1.pdf Stack Overflow stackoverflow.com/questions/3959705/are-arrays-pointers stackoverflow.com/questions/1641957/is-an-array-name-a-pointer stackoverflow.com/questions/4607128/in-c-are-arrays-pointers-or-used-as-pointers typedef struct 📖must_read_book 📖 { The C programming 👑-amzn.to...
Beej's guide to C programming, chapter 6: Arrays
มุมมอง 4958 หลายเดือนก่อน
🇮🇹🍕🍝Canale Italiano - th-cam.com/channels/gq3a4_mJ0YCwzWu4tW90kQ.html . 🚨 These videos are just additional material to the book to improve comprehension, RTFM! 🚨 BEEJ book beej.us/guide/bgc/pdf/bgc_usl_c_1.pdf 👨🏻🏫 Udemy course for total beginners, pre_knowledge before C (Overflow, 2’s complement, BASH, VIM…) - www.udemy.com/course/oceano_0b0001/?referralCode=C218698D6A3E3D16EEEB Notion page wi...
Beej's guide to C programming, chapter 5: Pointers---Cower In Fear!
มุมมอง 8069 หลายเดือนก่อน
Beej's guide to C programming, chapter 5: Pointers Cower In Fear!
Beej's guide to C programming, chapter 4: Functions
มุมมอง 5669 หลายเดือนก่อน
Beej's guide to C programming, chapter 4: Functions
Beej's guide to C programming, chapter 3: Variables and Statements
มุมมอง 7689 หลายเดือนก่อน
Beej's guide to C programming, chapter 3: Variables and Statements
How to visualize gprof output as graph using Gprof2Dot
มุมมอง 9289 หลายเดือนก่อน
How to visualize gprof output as graph using Gprof2Dot
Beej's guide to C programming: Hello, World!
มุมมอง 3.1K9 หลายเดือนก่อน
Beej's guide to C programming: Hello, World!
Fetch, decode, execute cycle visualised TL;DR
มุมมอง 57010 หลายเดือนก่อน
Fetch, decode, execute cycle visualised TL;DR
Save you debugging pain with this simple trick in C
มุมมอง 1.5K10 หลายเดือนก่อน
Save you debugging pain with this simple trick in C
Let's build a printf! Episode n° 3 : render int + binary extra feature
มุมมอง 1.1Kปีที่แล้ว
Let's build a printf! Episode n° 3 : render int binary extra feature
Let's build a printf! Episode n° 2 : render chars and strings
มุมมอง 1.6Kปีที่แล้ว
Let's build a printf! Episode n° 2 : render chars and strings
Let's build a printf! Episode n° 1 : Format parser
มุมมอง 7Kปีที่แล้ว
Let's build a printf! Episode n° 1 : Format parser
great video, how much time it takes you to make a code like this one?
Your videos are helping me a lot I'm planting to go to the piscine next month, and I have been following you for awhile, and you are absolutely great at simplifying concepts for begginers like my self even though sometimes it’s takes me long time to grasp the concept, put are the best thank so much.
this video was so good wtf thanks!
Thanks for the video, sometime I get more than 5500 move, that mean I have a problem in my code, right?
Hey Yassine, frankly I don't remember 🤣. So much time as passed. I think my code was ~5500 moves_max on average but not robust to every combo.
Your videos are great. I know the basics of C++. I want to join 42 school in the future. I want to learn C. I tried to learn it in a day, but my hands became accustomed to C++ until I started forgetting and writing in C++ in C. Do you have any advice for me to separate the languages in my mind and start thinking and writing in one language?
Thank you rely rely is best explanation i found keep continuing your code and learn us all lecture please thank you ❤
thank you so much for these videos, it helps a lot !
Otra padreada de mi padre oceano, el padre tirame la bendición
can do hexdump?
36:05 - 44:48 Error handling
Italian?
man im about to binge consume your channel! thx jalal! and thx for the sweet resources in the description
Normally at that stage of the Piscine you are not supposed to know about pointers. So you should not be writing a function that takes an array as variable.
chokran
amazing bro thank you so much
thank you!!!
Another video telling people that va_end() 'is not crucial ... What a BAD example ! ... The man page clearly states (and for good reason) that you must call va_end() for each va_start() you called. Telling people in educational videos that this is not necessary is HORRIBLE style. ZERO POINTS, OCEANO! Sorry! If you (for whatever reason use va_start in the same function more than once you will see your finction failing if you do not call va_end ... also, the implementation might change so that va_end is even needed in such a simple example. This is why it is usually always a good idea, to read manpages rather than just playing arround with things ... especially if you intend to tell other people how it works.
U right, My bad. To be clear for others: On macOS, as well as Linux va_end is generally a no-op, meaning it doesn’t perform any observable action in most cases. This is because the va_list is typically implemented in a way that does not require special cleanup. Anyway, as the comment pointed out, you shall always use va_end( ), for Portability, best practice and to avoid undefined behaviours. In my silly 1_function_program example nothing really changes. Zero point for me😂
I am learning C your channel is heaven to me very grateful to you for precious knowledge.
Ty bro & merry xmas 🎅🏻!
can you Explain into us dfs like we are kids?
Thanks for this series
Thank you for your efforts. when I run this command, and pass a BUFFERSIZE like -1 or 0, the program shouldn't works, but it still works (gcc -Wall -Wextra -Werror -D BUFFERSIZE=-1 get_next_line.c get_next_line_utils.c
this code is more complicated than it should be, in my humble opinion. Great work though. Keep posting dude.
I Agree 😄
v2 porfavor
what the hell!
I want lines, please :) Also RT friendlyyyyy M ;) thank you for your work!
👏👏👏👏👏👏👏
Legendary homepage pull
Please shere all of your vim plug-ins and sets, thank you very much Oceano
Here's the plugs ;) call plug#begin('~/.vim/plugged') " Essential plugins Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'dense-analysis/ale' Plug 'preservim/nerdtree' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'octol/vim-cpp-enhanced-highlight' Plug 'ryanoasis/vim-devicons' call plug#end()
Thanks a lot broo
Oceano with the clutch content! You and Jonas Birch have the coolest C content on YT
Ty ❤️ Jonas Birch top player!
Wow!!! 🎉🎉🎉
Awesome!!!!!
Great video ! Keep up the good work.
great vid
Good work pro; Keep going.
thank you sir
hi terry davis
Hello ! why do you set i to -1 and do ++i instead of set i to 0 and do i++ ? Is there a special reason ? you said you prefer this way.. but why ?
Thank you
When you input a timestamp lesser than 60ms, it displays the error message but then goes on with the program. It should not perform the program if one of the timestamps is lesser than 60ms, right ?
I'm making a C compiler from C++ and I have a problem: If I need parse this kind of lines of code: printf("%d ", x); When the Token *Scanner::nextToken() recognize each token that found, immediately after printf( , I mean, I see in terminal: TOKEN(PRINTF) TOKEN(L_PAR) And the program finish. How Can i do to recognize the next "string" "%d " , x); And then generate: TOKEN(PRINTF) TOKEN(L_PAR) TOKEN(STRING_LITERAL, %d ) TOKEN(COMMA) TOKEN(ID, x) TOKEN(R_PAR) TOKEN(SEMICOLON)
thanks for your help bro and informations
bro keep going
Smartish man go on
This is super comprehensive.I searched a lot about Variadic functions and this one is a game changer. Thank you :)
All 1337 students respect u , u are welcome to visit us here <3 , big thanks
what did you use to get color highlighting in your man pages? it's way more readable that way for my dyslexia. Also Idk if you care but just an update, I finished the nand to tetris part 1 on coursera and built the assembler in C. Thanks for having made that video where you shared it, I really enjoyed it all and am planning on making my own computer from scratch because of it.
thank you, BG1337
For my point of view, you complicate your life doing all this, remenber this ex will come on the Exam3... dont do it like this. BUTTT I understand why you did it, just for fun.
hi where to go next after completing this beginner series .Learned a lot thnks .also how should i practice what i've learned so far
18:10 you malloc what ???? Never malloc a buffer, that's exactly the opposite of what you should do 🥲