Forwarded from Dev
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from Dev
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from Galaxy Ai
Processes and Programs: Environment Variables
Each process has an associated string array known as the environment variable list. Each of its strings is an element in the form of name=value.
Thus, the environment represents a set of name-value pairs that can be used to store arbitrary information.
When a new process is created, it inherits a copy of its parent's environment. This is a simple yet commonly used form of inter-process communication (IPC), where the environment provides a means to transfer information from the parent process to the child.
The transfer of information from the parent process to the child is one-way and one-time. After the child is created, any subsequent instance can change its own environment, and these changes will be invisible from the outside.
Some library functions allow modifying their behavior by setting environment variables. This enables users to control application behavior without changing the code or recompiling it with the appropriate dependencies.
One classic example is the environment variable LDLIBRARYPATH, which we discussed earlier. When a program uses dynamic libraries, the loader searches for them in system directories like lib or /usr/lib. However, with LDLIBRARYPATH, alternative search paths can be specified:
Defining Environment Variables
In most shells, a value can be added to the environment using the export command:
In the example above, the first command creates a shell variable that, without explicit export, will not be inherited by the child process. The second call defines a variable for the environment and places it in the process's environment.
In bash and Korn shells, you can use the following syntax:
The commands shown above permanently add a value to the shell environment, after which this environment is inherited by all child processes created by the shell. A variable can be removed at any time using the unset command:
In the Bourne shell and its descendants (bash and Korn), you can use this syntax to add values to the environment of an executing program:
The definition will be added to the environment of only the child process that executes the specified program. The current list of environment variables can be displayed using the printenv command:
The list of environment variables for any process can be examined by accessing the Linux-specific "/proc/PID/environ":
Accessing Environment from a Program
In a C program, the list of environment variables can be accessed via the global variable environ. Like argv, the environ variable contains a list of pointers to null-terminated strings. The list itself is terminated with a NULL value:
An alternative method to access the list of environment variables is to declare a third argument for the main() function:
Individual values from the process's environment can be retrieved using getenv():
@Galaxy_deve _ #Linux
Each process has an associated string array known as the environment variable list. Each of its strings is an element in the form of name=value.
Thus, the environment represents a set of name-value pairs that can be used to store arbitrary information.
When a new process is created, it inherits a copy of its parent's environment. This is a simple yet commonly used form of inter-process communication (IPC), where the environment provides a means to transfer information from the parent process to the child.
The transfer of information from the parent process to the child is one-way and one-time. After the child is created, any subsequent instance can change its own environment, and these changes will be invisible from the outside.
Some library functions allow modifying their behavior by setting environment variables. This enables users to control application behavior without changing the code or recompiling it with the appropriate dependencies.
One classic example is the environment variable LDLIBRARYPATH, which we discussed earlier. When a program uses dynamic libraries, the loader searches for them in system directories like lib or /usr/lib. However, with LDLIBRARYPATH, alternative search paths can be specified:
$ LD_LIBRARY_PATH=/usr/local/lib ./myapp
Defining Environment Variables
In most shells, a value can be added to the environment using the export command:
$ SHELL=/bin/bash
$ export SHELL
In the example above, the first command creates a shell variable that, without explicit export, will not be inherited by the child process. The second call defines a variable for the environment and places it in the process's environment.
In bash and Korn shells, you can use the following syntax:
$ export SHELL=/bin/bash
The commands shown above permanently add a value to the shell environment, after which this environment is inherited by all child processes created by the shell. A variable can be removed at any time using the unset command:
$ unset VARIABLE_NAME
In the Bourne shell and its descendants (bash and Korn), you can use this syntax to add values to the environment of an executing program:
$ NAME=value program
The definition will be added to the environment of only the child process that executes the specified program. The current list of environment variables can be displayed using the printenv command:
$ printenv
LOGNAME=mtk
SHELL=/bin/bash
HOME=/home/mtk
PATH=/usr/local/bin:/usr/bin:/bin:.
TERM=xterm
The list of environment variables for any process can be examined by accessing the Linux-specific "/proc/PID/environ":
$ cd /proc/2953
$ cat environ
HOME=/home/xodefenderLANG=en_US.UTF-8LOGNAME=xodefender
Accessing Environment from a Program
In a C program, the list of environment variables can be accessed via the global variable environ. Like argv, the environ variable contains a list of pointers to null-terminated strings. The list itself is terminated with a NULL value:
#include <stdio.h>
extern char **environ;
int main(int argc, char *argv[]) {
char **list;
for (list = environ; *list != NULL; list++) {
puts(*list);
}
exit(EXIT_SUCCESS);
}
An alternative method to access the list of environment variables is to declare a third argument for the main() function:
int main(int argc, char *argv[], char *envp[])
Individual values from the process's environment can be retrieved using getenv():
#include <stdlib.h>
char *getenv(const char *name);
@Galaxy_deve _ #Linux
Forwarded from Linuxor ?
برای ساخت یه بازی به چه چیز هایی لازمه؟ این ریپو اومده هرچی لازمه رو یجا جمع آوری که کرده برای شروع خیلی کمکتون میکنه :
https://github.com/Kavex/GameDev-Resources
🐧 @Linuxor
https://github.com/Kavex/GameDev-Resources
🐧 @Linuxor
Forwarded from کانال کیا حامدی
آموزش رایگان پروژه محور جنگو ساخت فضای ابری – قسمت 32– زیرساخت انتقال و کپی کردن فایل (پارت اول)
خب دوستان در این قسمت ما زیرساخت اولیه برای مکانیزم های انتقال و کپی کردن فایل رو مینویسیم، بتونیم فایل ها و پوشه های مورد نظرمون رو انتخاب کنیم و توابع اولیه برای move, copy و past رو پیاده سازی می کنیم.
🌐 https://kiahamedi.com/freebird-p32/
📹 https://youtu.be/HbrPur7hEgs?si=BrK9ls9hES824qVq
#فضای_ابری #پروژه_جنگو #آموزشـجنگو
خب دوستان در این قسمت ما زیرساخت اولیه برای مکانیزم های انتقال و کپی کردن فایل رو مینویسیم، بتونیم فایل ها و پوشه های مورد نظرمون رو انتخاب کنیم و توابع اولیه برای move, copy و past رو پیاده سازی می کنیم.
#فضای_ابری #پروژه_جنگو #آموزشـجنگو
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from محتوای آزاد سهراب
این برنامه رو ما از خیلی وقت پیش داشتیم، البته صد البته امیدوارم که بتونید توی تحقق این امر به ما کمک کنید :)
تا الان دانیال عزیز و عرفان عزیز و یک عده دیگه از دوستان رو ما برنامههاشون رو به صورت یک بستهبندی در مخزن PCP قرار دادیم تا برای همه در دسترس باشن.
https://forum.parchlinux.com/t/topic/257
@SohrabContents
تا الان دانیال عزیز و عرفان عزیز و یک عده دیگه از دوستان رو ما برنامههاشون رو به صورت یک بستهبندی در مخزن PCP قرار دادیم تا برای همه در دسترس باشن.
https://forum.parchlinux.com/t/topic/257
@SohrabContents
Parch Linux
برنامههای جامعه پارچ
یکی از اهداف اصلی پروژه پارچ، حمایت از پروژههای اوپنسورس ایرانی است. ما باور داریم که جامعه توسعهدهندگان ایرانی ظرفیت بالایی برای خلق ابزارها و نرمافزارهای ارزشمند دارد و پارچ با فراهم کردن بستری مناسب، قصد دارد این تلاشها را به بهترین شکل ممکن به کاربران…
Forwarded from محتوای آزاد سهراب
#معرفیبرنامه
برنامه Karp که یک ویرایشگر پیدیاف نوپا برای میزکار کیدیای هستش کارهایی رو مثل ویرایش متادیتا، تغییر صفحات یک پیدیاف و همینطور رمزنگاری رو انجام میده.
این برنامه هنوز WIP (در دست توسعه) هستش و در آینده امکانات بیشتری هم بهش اضافه میشه.
برای نصبش توی توزیعهای آرچ بیس از AUR باید اقدام کنید.
@SohrabContents
برنامه Karp که یک ویرایشگر پیدیاف نوپا برای میزکار کیدیای هستش کارهایی رو مثل ویرایش متادیتا، تغییر صفحات یک پیدیاف و همینطور رمزنگاری رو انجام میده.
این برنامه هنوز WIP (در دست توسعه) هستش و در آینده امکانات بیشتری هم بهش اضافه میشه.
برای نصبش توی توزیعهای آرچ بیس از AUR باید اقدام کنید.
paru -S karp-git
@SohrabContents
Forwarded from محتوای آزاد سهراب
همینطور یک چیز جدیدی که دیدم اینه که کیدیای امکان ارسال گزارش هارو سادهتر کرده و یک دکمه اضافه کردن که میاد و چیزهای مورد نیاز برای یک گزارش مشکل رو کپی میکنه.
مثلاً این متن کپی شده از این ویژگی هستش:
Karp: 25.03.70
Parch Linux (Wayland)
KDE Frameworks: 6.8.0
Qt: Using 6.8.0 and built against 6.8.0
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.12.1-arch1-1
@SohrabContents
مثلاً این متن کپی شده از این ویژگی هستش:
Karp: 25.03.70
Parch Linux (Wayland)
KDE Frameworks: 6.8.0
Qt: Using 6.8.0 and built against 6.8.0
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.12.1-arch1-1
@SohrabContents
Forwarded from دستاوردهای یادگیری عمیق(InTec)
دکتر حبیبزاده از دوستان خیلی خوب بنده هست که قبلا هم کانال یوتیوب و لایوهای دیگرشون رو معرفی کردم مخصوصا وقتی دورههای عملی دانشگاهای کانادا رو درس میدادند.
یک سری ویدئو دارند توی یوتیوب قرار میدهند درمورد
Youtube Link
دیدن آموزشهای ایشون همیشه برام لذت بخش بوده؛ بسیار روان و ساده توضیح میدهند (مناسب برای شروع و درک عمیق مطالب) طوری که نمیشه مطلبی رو ایشون توضیح بدند و کسی متوجه نشه.
همیشه هم مطالب رو رایگان در اختیار دیگران میگذارند.
توصیه میکنم اگر به این موضوعات علاقه دارید حتما ویدئوهای یوتیوب ایشون رو ببینید.
یک سری ویدئو دارند توی یوتیوب قرار میدهند درمورد
LLM ها که مقدماتی هم هست (بخش سوم)Youtube Link
دیدن آموزشهای ایشون همیشه برام لذت بخش بوده؛ بسیار روان و ساده توضیح میدهند (مناسب برای شروع و درک عمیق مطالب) طوری که نمیشه مطلبی رو ایشون توضیح بدند و کسی متوجه نشه.
همیشه هم مطالب رو رایگان در اختیار دیگران میگذارند.
توصیه میکنم اگر به این موضوعات علاقه دارید حتما ویدئوهای یوتیوب ایشون رو ببینید.
YouTube
Part 03- Review on Large Language Models (LLMs)- AI for Business Insight - In Persian
In this video, Part 03 of a series reviewing applied machine learning, with a particular focus on large language models, we will explore key concepts and practical applications. The target audience includes anyone interested in understanding and using LLMs…
Forwarded from نوشتههای ترمینالی
https://dev.to/lissy93/cli-tools-you-cant-live-without-57f6
معرفی تعداد زیادی ابراز کاربردی و جذاب cli
معرفی تعداد زیادی ابراز کاربردی و جذاب cli
DEV Community
CLI tools you won't be able to live without 🔧
A list of 50 command line tools, which you should definitely check out!
Forwarded from محتوای آزاد سهراب
Forwarded from Programming Resources via @like
Every year on December AdventOfCode creates 25 days of coding puzzles that challenge your skills, creativity, and problem-solving abilities. Solve daily puzzles, climb the leaderboard, and have fun coding through the holiday season!
هر سال همین موقعها سایت adventofcode ۲۵ تا سوال روزانه میزاره به مناسبت سال جدید میلادی. میتونید خودتون رو تست کنید و مهارتتون رو محک بزنید :) ۲ تا سوال تا الان منتشر شده
#advent #code #practice #ACM #interview #challenge #newyear #new #year #2024 #leetcode
@pythony
adventofcode.com
هر سال همین موقعها سایت adventofcode ۲۵ تا سوال روزانه میزاره به مناسبت سال جدید میلادی. میتونید خودتون رو تست کنید و مهارتتون رو محک بزنید :) ۲ تا سوال تا الان منتشر شده
#advent #code #practice #ACM #interview #challenge #newyear #new #year #2024 #leetcode
@pythony
adventofcode.com
Forwarded from Linuxor ?
Forwarded from یک برنامه نویس تنبل (The Lazy 🌱 Raymond)
🔶 این بازار ارز دیجیتال بیش از حد سودده شود, مشکوک به نظر میرسد.
ارز ریپل که با گردش ۵۷ میلیارد توکن به چهارمین ارز پر طرفدار تبدیل شد و که ارزشش هم اکنون ۲.۸۳ دلار رسیده...
احساس می کنم که بازار ارز دیجیتال بیش از حد دستکاری شده یا در حباب سنگین به سر می ببره...
@TheRaymondDev
ارز ریپل که با گردش ۵۷ میلیارد توکن به چهارمین ارز پر طرفدار تبدیل شد و که ارزشش هم اکنون ۲.۸۳ دلار رسیده...
احساس می کنم که بازار ارز دیجیتال بیش از حد دستکاری شده یا در حباب سنگین به سر می ببره...
@TheRaymondDev
Forwarded from Linuxor ?
توی wifi ورژن 8 که قراره سه چهار سال دیگه عرضه بشه یه ویژگی جالب گذاشتن، زمان انتظار هماهنگ شده (Coordinated Target Wait Time) ؛ این ویژگی به دستگاههای کممصرف IoT اجازه میده تا با (AP) زمانهای خاصی را برای انتقال دادهها هماهنگ کنن، این کار مصرف انرژی رو کاهش میده و احتمال تداخل با ترافیک غیرحساس به تأخیر رو کمتر میکنه.
🐧 @Linuxor ~ thanks to sajadghorbaniii
🐧 @Linuxor ~ thanks to sajadghorbaniii
Forwarded from linuxtnt(linux tips and tricks) (hosein seilany https://seilany.ir/)
گاوومون زایید😂😂😂
🔹داشتم مقاله ای در زمینه Agentic AI مینوشتم.
که درباره نسل بعدی یا اینده بعدی هوش مصنوعی هاست. هوش مصنوعی در عمل. در زمینه یادگیری تقویتی (RL) هست.
🔹دنبال نمونه عملی که پیاده سازی شده بود میگشتم رسیدم به این: نمیدونم حس خوب داشته باشم یا بد. نظر با شما.
اولین مهندس نرمافزار کاملاً خودمختار"Devin AI"
یک مثال عالی از عاملهای هوش مصنوعی در عمل، "Devin AI" است که طبق گفتهی سازندگان آن در Cognition AI، "اولین مهندس نرمافزار کاملاً خودمختار جهان" است. Devin AI توانسته است با موفقیت یک پروژه نرمافزاری را به طور کامل و خودکار، از نوشتن یک برنامهی اجرایی تا ایجاد یک وبسایت، پیادهسازی کند. این روند حرکت از چتباتهای ساده که با سوالات یا وظایف ساده سروکار دارند، به عاملهای غنی از ویژگی که میتوانند وظایف پیچیده را به طور خودمختار انجام دهند
🔹داشتم مقاله ای در زمینه Agentic AI مینوشتم.
که درباره نسل بعدی یا اینده بعدی هوش مصنوعی هاست. هوش مصنوعی در عمل. در زمینه یادگیری تقویتی (RL) هست.
🔹دنبال نمونه عملی که پیاده سازی شده بود میگشتم رسیدم به این: نمیدونم حس خوب داشته باشم یا بد. نظر با شما.
اولین مهندس نرمافزار کاملاً خودمختار"Devin AI"
یک مثال عالی از عاملهای هوش مصنوعی در عمل، "Devin AI" است که طبق گفتهی سازندگان آن در Cognition AI، "اولین مهندس نرمافزار کاملاً خودمختار جهان" است. Devin AI توانسته است با موفقیت یک پروژه نرمافزاری را به طور کامل و خودکار، از نوشتن یک برنامهی اجرایی تا ایجاد یک وبسایت، پیادهسازی کند. این روند حرکت از چتباتهای ساده که با سوالات یا وظایف ساده سروکار دارند، به عاملهای غنی از ویژگی که میتوانند وظایف پیچیده را به طور خودمختار انجام دهند