반응형
반응형

 

[python] asciichartpy -  터미널(콘솔) 환경에 깔끔하고 읽기 쉬운 텍스트 기반의 ASCII 아트 그래프를 그려주는 라이브러리

 

pip install asciichartpy

 

https://pypi.org/project/asciichartpy/

 

Client Challenge

JavaScript is disabled in your browser. Please enable JavaScript to proceed. A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, o

pypi.org

 

 

import asciichartpy 

data = [1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1]
print("ASCll Line Chart Example")
print(asciichartpy.plot(data, {'height': 10}))

 

import asciichartpy as ac

series1 = [20, 25, 22, 28, 30, 24, 35, 32, 26]
series2 = [10, 15, 12, 18, 20, 14, 25, 22, 16]

# 두 개의 계열을 하나의 차트에 표시
print(ac.plot([series1, series2], {'height': 15, 'colors': [ac.red, ac.blue]}))
반응형
반응형

겨울 채비를 하는 계절이 돌아왔다.
나무의 겨울 채비는 낙엽 지는 일로 시작한다.
가지에 무성하던 잎들의 미련을 냉정히 뿌리친다.
때가 되면 지난 계절 생명줄이었던 물을 끊어내는
것이다. 그다음은 농축이다. 몸속의 에너지 소모를
줄이기 위해 숨조차 제대로 쉬지 않고 버틴다.
그리고 다시는 잎사귀를 달지 않을 것처럼
빈 가지로 겨울을 난다.


- 김정묘의 《마음 풍경》 중에서 -


* 겨울이 다가오고 있습니다.
나무도 사람도 겨울 채비가 필요한 때입니다.
나무의 겨울 채비는 잎을 떨구는 일로 시작합니다.
그 무성했던 잎들을 단 하나도 남기지 않고 모두 버립니다.
빈 가지로 겨울을 나야 얼지 않고 견뎌낼 수 있기
때문입니다. 모두 비워야 새봄에 다시 새싹을
틔울 수 있음을 나무는 압니다. 빈 가지가
되는 것이 겨울을 나는 길입니다.

반응형

'아침편지' 카테고리의 다른 글

신이 주신 선물  (0) 2025.10.27
두려울 게 없다  (1) 2025.10.23
인공지능  (0) 2025.10.21
지옥 같은 고통은 왜 올까  (0) 2025.10.20
바보  (0) 2025.10.20
반응형

인공지능이
인간을 넘어설지에 대하여
많은 논의가 진행되고 있습니다.
인공지능은 데이터를 바탕으로 지식을 추출하고
미래를 예측합니다. 반면에 인간은 창의적인 사고로
인류가 경험하지 못한 상황에서도 적절한 판단이 가능할
것입니다. 이러한 면에서 인공지능은 인간을 넘어서기
어려워 보입니다. 단, 데이터는 감정이 없습니다. 모든
상황에서 객관적인 평가를 할 수 있습니다. 반대로
인간은 감정에 치우치며 종종 일을 그르치곤
합니다. 인공지능과 공존하기 위해서
인간에게 필요한 것이 무엇인지
생각하게 됩니다.


- 김용대의 《데이터 과학자의 사고법》 중에서 -


* 시대가 변하고 있습니다.
이전과는 전혀 다른 세상이 열리고 있습니다.
인류가 경험하지 못했던, 한 번도 걸어보지 않은 길을
가고 있습니다. 인공지능이 사람의 일을 대신하고 있고,
모든 것은 데이터로 남아 스스로 학습하며 진화하고
있습니다. 그 정점에 메타버스가 있습니다. 그러나
인공지능에는 온기가 없습니다. 사랑과 감사,
따뜻한 감성, 정서적 교감이 없습니다.
인공지능은 인간이 사용하는 도구일 뿐,
사람은 사람과 더불어 살아야 합니다.

반응형

'아침편지' 카테고리의 다른 글

두려울 게 없다  (1) 2025.10.23
겨울 채비  (0) 2025.10.22
지옥 같은 고통은 왜 올까  (0) 2025.10.20
바보  (0) 2025.10.20
'거대한 가속'의 시대  (0) 2025.10.17
반응형

극단적인 괴로움과
지옥 같은 고통은 왜 오는 걸까?
두말할 나위 없이 집착에서 온다.
집착은 왜 하게 되는 걸까? 집착하는 대상으로
하여금 내가 원하는 욕심을 채워 행복하기 위함이다.
감정에만 취해서 복잡한 업의 내용을 단순하게
생각한다면, 고통을 없앨 수 있는 방법은
요원하다. 집착하는 만큼 고통의
과보를 감내해야 한다.


- 진우의《두려워하지 않는 힘》중에서 -


* 집착은
여러 형태의 내적 고통을 안겨줍니다.
집착이 강할수록 고통의 강도도 세집니다.
삶 전체를 나락으로 떨어뜨리는 '지옥 같은 고통'으로
이어질 수 있습니다. 집착은 욕심에서, 그것도 이기적인
욕심에서 비롯됩니다. 그 이기적인 욕심을 이타적인
꿈으로 방향을 바꾸는 순간, 고통은 사라지고
마음의 평화와 행복이 찾아옵니다.

반응형

'아침편지' 카테고리의 다른 글

겨울 채비  (0) 2025.10.22
인공지능  (0) 2025.10.21
바보  (0) 2025.10.20
'거대한 가속'의 시대  (0) 2025.10.17
저체온 여성이 늘고 있다  (0) 2025.10.16
반응형

바보

 

남 탓, 세상 탓

 

반응형

'아침편지' 카테고리의 다른 글

인공지능  (0) 2025.10.21
지옥 같은 고통은 왜 올까  (0) 2025.10.20
'거대한 가속'의 시대  (0) 2025.10.17
저체온 여성이 늘고 있다  (0) 2025.10.16
길만큼 좋은 스승은 없다  (0) 2025.10.15
반응형

PHP 8.5: The Version That Will Actually Makes Life Easier

 

https://pixicstudio.medium.com/php-8-5-new-developer-features-f9617311c590

 

PHP 8.5: The Version That Will Actually Makes Life Easier

The Developer-Friendly Upgrade You’ve Been Waiting For

pixicstudio.medium.com

 

PHP 8.5 is out soon, and honestly, it’s one of those releases that makes me excited as a developer. Some of the features are small, but they just feel so right, you know? I’m talking about stuff that just makes your life easier every single day. Let me take you through it.

Pipe Operator: No More Temporary Variables

The pipe operator, you’ve probably seen it floating around in tweets and RFCs. And yes, it’s actually useful.

Imagine this: you have a function called sendEmail. It takes an email address, but before you send it, you want to clean it up. Trim spaces, make it lowercase… usual stuff. Before PHP 8.5, you might do something like this:

$email = "  TEST@EXAMPLE.COM  ";
$email = trim($email);
$email = strtolower($email);
sendEmail($email);

Temporary variables, reassignments, all that noise. Now with the pipe operator:

"  TEST@EXAMPLE.COM  "
    |> trim()
    |> strtolower()
    |> sendEmail();

No temporary variables, everything flows left to right. Makes your code so much cleaner.

No Discard Attribute: Stop Ignoring Return Values

Next up, #[NoDiscard]. This is actually amazing. Sometimes you call a function, and you must use the return value, but people (or even yourself) might forget. PHP 8.5 can now warn you if you ignore it.

#[NoDiscard]
function getName(): string {
    return "Nuno";
}

If you do this:

getName(); // PHP will warn you: "Hey, you should use the return value!"

It forces you to handle the result or explicitly cast to void if you really mean to ignore it. Honestly, this one is top three features for me. You combine this with the pipe operator, and you can write clean, safe chains without warnings.

Closures in Constant Expressions

PHP 8.5 now lets you use static closures in places that only accept compile-time values. Class constants, default property values, attribute arguments… you can now use closures in all of them.

class Example {
    public const VALIDATOR = static function($value) {
        return !empty($value);
    };
}

Before, this would fail, now it works. You can literally attach reusable logic directly to constants or attributes. This is huge for frameworks like Laravel that use a lot of validation or metadata.

Array Helpers: array_first() and array_last()

You know how annoying it was to get the first or last element of an array? I mean, PHP has reset() and end(), but they move the internal pointer. Now we have:

$users = ["Adrian", "Maria", "Pedro"];
$first = array_first($users); // Adrian
$last = array_last($users);   // Pedro

It’s simple, intuitive, and doesn’t mess with your array pointer. Little change, big difference.

Global Constants with Attributes

Another subtle one. PHP 8.5 now lets you add attributes to global constants. Before, this was impossible. Now, you can do something like:

#[Deprecated("Use NEW_CONSTANT instead")]
const OLD_CONSTANT = 42;

Try echoing it:

echo OLD_CONSTANT; // 42 + deprecation warning

It’s basically metadata for constants. If your framework or package uses constants for configuration, you can now attach extra info cleanly.

Get Exception Handler

For framework developers, this one is neat. PHP 8.5 introduces get_exception_handler(). If you’ve ever used set_exception_handler(), you know it’s hard to inspect the existing closure. Now, you can actually grab it:

set_exception_handler(fn($e) => echo "Caught: " . $e->getMessage());
$handler = get_exception_handler();
var_dump($handler);

Perfect for logging, debugging, or even modifying exception handling at runtime. Frameworks like Laravel could make real use of this for global error handling.

Intel List Formatter

And here’s a fun one: IntlListFormatter. Not something you’d use every day, but when you need it, it’s perfect. You can take a list and format it according to locale rules.

$formatter = new \Intl\IntlListFormatter('en', \Intl\IntlListFormatter::TYPE_AND);
echo $formatter->format(['Lisbon', 'Porto', 'Coimbra']); // "Lisbon, Porto, and Coimbra"

It handles “and”, “or”, and other localized ways of formatting lists automatically. Nice little quality-of-life improvement for internationalized apps.

Minor Internal and CLI-Only Improvements

Even the small improvements in PHP 8.5 make a difference, especially if you work with the CLI or care about internal debugging and configuration.

1. php.ini Diff (PHP-IN-DIFF)

Ever wish you could quickly see which settings you’ve changed from the default PHP configuration? PHP 8.5 makes this super easy with a new CLI command:

php -i --diff

This shows you exactly which php.ini options differ from the defaults. For example, I always increase memory limits and disable timeouts for scripts while testing:

memory_limit = -1
max_execution_time = 0

Before, you had to manually compare or scroll through phpinfo(). Now it’s literally built-in. Such a small, but life-saving improvement for anyone debugging PHP setups.

2. PHP Build Date Constant

PHP 8.5 introduces a new constant that tells you exactly when the binary was built. Want to check?

echo PHP_BUILD_DATE;

Output:

2025-09-17 14:32:00

It’s perfect if you’re running multiple PHP binaries or want to verify the version/build you’re using. Nothing groundbreaking, but again, quality-of-life.

3. Final Property Promotion

PHP 8.5 improves property promotion with the ability to mark individual properties as final. You could already make an entire class final, but now you can target specific properties in your constructor:

class User {
    public function __construct(
        final public string $username,
        public string $email
    ) {}
}

Now $username cannot be overridden in subclasses. It’s subtle, but for codebases where immutability matters, this is a huge clarity win.

4. CLI and Debugging Tweaks

Other minor improvements include:

  • Better default error reporting when using php -d overrides.
  • Cleaner warnings for deprecated features in CLI mode.
  • Small optimizations under the hood that make scripts run slightly faster or consume less memory in edge cases.

None of these require code changes, but if you’re a framework developer or DevOps person, they make day-to-day PHP usage smoother.

Why Even Minor Changes Matter

Here’s the thing: PHP 8.5 isn’t just about flashy features. Even small internal improvements and CLI tweaks reduce friction in your workflow. That’s the real magic here, less time fighting configuration, more time writing code that actually does something.

Final Thoughts

PHP 8.5 is packed with quality-of-life features. Not every one of them will change your world, but together they make the language smoother, safer, and more enjoyable.

  • Pipe operator: clean chains, no temp variables.
  • NoDiscard: never ignore important return values again.
  • Closures in constants: attach logic anywhere at compile time.
  • Array helpers: easy access to first and last elements.
  • Attributes on constants: add metadata cleanly.
  • Exception handler inspection: framework-friendly.
  • Intl list formatter: smart, localized lists.

PHP 8.5 feels like one of those releases that makes you happy to write PHP again. It’s not flashy, but it’s clever, practical, and developer-first.

If you haven’t checked it out yet, start testing the beta. I guarantee some of these features will make their way straight into your daily coding habits.

반응형

+ Recent posts