نوشتههای ترمینالی
تفاوت expression و statement (احتمالا نادقیق) هر دستوری توی زبانهای برنامهنویسی statement هست. هر چیزی مثل a=2 یا print یا return اما هر چیزی که قابل محاسبه به یک value باشه میشه expression. مثلا if (true){ int a = 3; } // statement int a = ( 1…
آیا همه function call ها expression هستند؟
حتی اونها که تایپ برگشتی void دارند؟
بله همشون.
فقط اونها که تایپ برگشت void دارن رو نمیشه یه کارهایی باهاشون کرد مثلا assign کرد.
https://stackoverflow.com/a/56817959
حتی اونها که تایپ برگشتی void دارند؟
بله همشون.
فقط اونها که تایپ برگشت void دارن رو نمیشه یه کارهایی باهاشون کرد مثلا assign کرد.
https://stackoverflow.com/a/56817959
Stack Overflow
Void function call as expressions
It's clear from the C standard that general function calls are expressions from the definition:
An expression is a sequence of operators and operands that specifies computation of a value, or that
An expression is a sequence of operators and operands that specifies computation of a value, or that
نوشتههای ترمینالی
آیا همه function call ها expression هستند؟ حتی اونها که تایپ برگشتی void دارند؟ بله همشون. فقط اونها که تایپ برگشت void دارن رو نمیشه یه کارهایی باهاشون کرد مثلا assign کرد. https://stackoverflow.com/a/56817959
در نهایت میرسیم به این که چرا نباید void برگردونن توابع و باید واقعا یه value مثل unit (در اسکالا) برگردونن که یه مقدار ولیده.
نه یه تایپ که هیچ مقداری نداره.
نه یه تایپ که هیچ مقداری نداره.
Dynamic voltage and frequency scaling (DVFS)
https://whatis.techtarget.com/definition/dynamic-voltage-and-frequency-scaling-DVFS
https://whatis.techtarget.com/definition/dynamic-voltage-and-frequency-scaling-DVFS
WhatIs.com
What is dynamic voltage and frequency scaling (DVFS) ? - Definition...
What is dynamic voltage and frequency scaling (DVFS)? This definition explains what DVFS is and how it's used to optimize power usage and performance in a variety of products.
عبارتهای لامبدا همه جا هستند. اینبار اکسل
https://faceit.ir/articles/lambda-in-excel/
https://faceit.ir/articles/lambda-in-excel/
فیسیت - چهره و اخبار فناوری
مایکروسافت قابلیت LAMBDA را برای اکسل معرفی کرد؛ انقلابی در فرمول نویسی
امروز شاهد معرفی قابلیت LAMBDA در اکسل توسط مایکروسافت بودیم که با فراهم کردن امکان ایجاد فرمولها به صورت تابع در خود اکسل، فرمول نویسی در این برنامه را متحول خواهد کرد.
نوشتههای ترمینالی
توی مانجارو گنوم، بعد از اینکه موقع آپدیت ctrl c زدم، سیستم رو خاموش کردم. توی بوت بعدی این ارور اومد.
برای حل:
رفتم توی tty (با ctrl alt f5) و بعد با دستور
sudo pacman -Syyu
گذاشتم کامل اپدیت ها دانلود و نصب شد بعد ریستارت کردم و اوکی شده بود همه چی.
رفتم توی tty (با ctrl alt f5) و بعد با دستور
sudo pacman -Syyu
گذاشتم کامل اپدیت ها دانلود و نصب شد بعد ریستارت کردم و اوکی شده بود همه چی.
بالاخره خروجی malloc رو کست کنیم یا نه؟
https://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc
https://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc
Stack Overflow
Should I cast the result of malloc?
In this question, someone suggested in a comment that I should not cast the result of malloc. i.e., I should do this:
int *sieve = malloc(sizeof(*sieve) * length);
rather than:
int *sieve = (int *)
int *sieve = malloc(sizeof(*sieve) * length);
rather than:
int *sieve = (int *)
Forwarded from مشقِ نوشتن (AliReza Fereydouni)
اگه فقط یک درصد فکر کردین که زبان C (یا C++) رو بلدین میتونین این تست رو بدین تا روشنتون کنه! 😁
https://wordsandbuttons.online/so_you_think_you_know_c.html
https://wordsandbuttons.online/so_you_think_you_know_c.html
wordsandbuttons.online
So you think you know C?
It's a C test. If you think you know C, take this test. It only has 5 questions.
و مشخص کردن typeها در jsdoc
https://google.github.io/styleguide/javascriptguide.xml#JsTypes
https://google.github.io/styleguide/javascriptguide.xml#JsTypes
چرا در css کامنت تک خطی نداریم؟
۱- از اول نداشتیم، حالا خیلی سخته بخواد اضافه بشه.
۲- از اول نداشتیم چون در زمان تحلیل، میاد فاصله ها رو ایگنور میکنه بنابراین نمیتونه بگه «تا وقتی به n\ نرسیدی»
https://stackoverflow.com/questions/2479351/why-do-comments-work-in-stylesheets-but-comments-dont
۱- از اول نداشتیم، حالا خیلی سخته بخواد اضافه بشه.
۲- از اول نداشتیم چون در زمان تحلیل، میاد فاصله ها رو ایگنور میکنه بنابراین نمیتونه بگه «تا وقتی به n\ نرسیدی»
https://stackoverflow.com/questions/2479351/why-do-comments-work-in-stylesheets-but-comments-dont
Stack Overflow
Why do /**/ comments work in stylesheets, but // comments don't?
Is there a good reason for this? It is a lame question, but I just wondered if there was a reason why.
توضیح stateless بودن http
https://home.sandiego.edu/~liao/cs194/1998.client.server/lectures/maintain.state.html
https://home.sandiego.edu/~liao/cs194/1998.client.server/lectures/maintain.state.html
چرا فورترن میتونه از سی سریع تر باشه؟
چطوری سی رو به اون سرعت برسونیم؟
معرفی کلیدواژه restrict
https://stackoverflow.com/questions/146159/is-fortran-easier-to-optimize-than-c-for-heavy-calculations
چطوری سی رو به اون سرعت برسونیم؟
معرفی کلیدواژه restrict
https://stackoverflow.com/questions/146159/is-fortran-easier-to-optimize-than-c-for-heavy-calculations
Stack Overflow
Is Fortran easier to optimize than C for heavy calculations?
From time to time I read that Fortran is or can be faster then C for heavy calculations. Is that really true? I must admit that I hardly know Fortran, but the Fortran code I have seen so far did no...
Forwarded from Useful Links and Documents (Mohammad Amin Sharifi Minabi)
سلام دوستان, یک مطلب درباره نحوه اندازه گیری زمان اجرا و میزان مصرف رم توی پایتون و ژوپیتر نوت بوک نوشتم ( Ipython دقیق تر)
https://bigm.ir/calculate-python-execution-time-and-ram/
قدم اول بهینه سازی کد این هستش که بدونیم مشکل کجاست. در سری های بعدی درباره بهینه کد نوشتن پایتون مینویسم.
به زودی هم ویدیوش رو میسازم و توی کانال یوتوب قرار میدم.
#python
#jupyter
#Ipython
#ram #timing #cpu
https://bigm.ir/calculate-python-execution-time-and-ram/
قدم اول بهینه سازی کد این هستش که بدونیم مشکل کجاست. در سری های بعدی درباره بهینه کد نوشتن پایتون مینویسم.
به زودی هم ویدیوش رو میسازم و توی کانال یوتوب قرار میدم.
#python
#jupyter
#Ipython
#ram #timing #cpu
امین شریفی - Amin Sharifi
چطوری حافظه و زمان اجرا را در پایتون و ژوپیتر نوت بوک حساب کنیم؟
قرار هستش در این اموزش با روش های ساده تا پیشرفته محاسبه زمان اجرا و وضعیت مصرف حافظه در پایتون رو با هم بررسی کنم پس ما من همراه باشید. خیلی خلاصه بگم که توی ژوپیتر نوت بوک ابزار مورد علاقه من کلی ابزار هست که میتونیم از اونها استفاده کنیم و زمان اجرا…
میدونستید نمیشه virtualenv پایتون رو جا به جا کرد؟
https://stackoverflow.com/questions/32407365/can-i-move-a-virtualenv
https://stackoverflow.com/questions/32407365/can-i-move-a-virtualenv
Stack Overflow
Can I move a virtualenv?
If I create a virtualenv, and I move it to a different folder, will it still work?
$ virtualenv -p /usr/bin/python3 /home/me/Env/my-python-venv
$ source Env/my-python-venv/bin/activate
(my-python-v...
$ virtualenv -p /usr/bin/python3 /home/me/Env/my-python-venv
$ source Env/my-python-venv/bin/activate
(my-python-v...
https://stackoverflow.com/questions/47590444/slice-vs-map-to-be-used-in-parameter
چراییِ تفاوت map و slice در go
چراییِ تفاوت map و slice در go
Stack Overflow
slice vs map to be used in parameter
In golang, slice and map are both reference types. When you simply need to modify elements in slice/map, the modification to slice/map members will be "broadcasted" to all slices. E.g, given m1 := ...