AbstProcDo

joined 11 months ago
[–] [email protected] 1 points 10 months ago

The issue was resolved by substituting UTF-8 with UTF-16:

(set-default-coding-systems 'utf-16)

https://preview.redd.it/aego1de5zbzb1.png?width=730&format=png&auto=webp&s=838c4970dfcbc6e3025d9932794796e68157f02b

 

When checking the weather for different locations in org-babel, I encountered an issue where the symbol for partly cloudy was not displayed correctly. Here is the code I used:

#+BEGIN_SRC shell :results output
curl 'wttr.in/{Paris,SanJose,Washington}?format=4'
#+END_SRC

#+RESULTS:
: Paris: 🌧   🌡️+10°C 🌬️↗9km/h
: SanJose: ☀️   🌡️+16°C 🌬️↘15km/h
: Washington: ⛅️  🌡️+12°C 🌬️↓4km/h

The symbol of partly-cloudy in washington was not rendered:

https://preview.redd.it/oisno3plx9zb1.png?width=641&format=png&auto=webp&s=54d2246de4877f8c08bdb98fc8504b27ea1b36da

I'm currently using Emacs 29.1 on Windows 10, and have set the symbol fonts as ""Segoe UI Emoji" which does have symbol of partly-cloudy.

(set-fontset-font t 'symbol "Segoe UI Emoji" nil 'prepend)

I alterntively tried "Symbola" font but the issue repeats. How could solve the problem?

[–] [email protected] 1 points 10 months ago

The issue of setting a light-colored background for SVG images in org-babel can be resolved using gnuplot's own settings.

` set terminal svg background "#ffffff" `

https://preview.redd.it/a5o9vtozfnxb1.png?width=575&format=png&auto=webp&s=b96967b2a9c85d4c454e9ec899f2be33e4dadabd

 

Gnuplot generates SVG images in Org Babel as shown below.

In the left solarized-dark theme, the SVG images exhibit a brown background that blends with the dark theme, resulting in very reduced visibility.

Conversely, in the right solarized-light theme, the SVG images display a pleasant light-blue background, offering excellent readability.

https://preview.redd.it/v1rb8scyvhxb1.png?width=1158&format=png&auto=webp&s=384dd8adef7ab7e085fb3887d1a1207a8468aa6e

How can SVG images be displayed with a light-blue background in the dark theme, as it is in the light theme?

[–] [email protected] 1 points 10 months ago

Thank you for the information provided. This confirms that it is indeed not a new feature of version 29.

[–] [email protected] 1 points 11 months ago

Yes, I understand it better now.

[–] [email protected] 1 points 11 months ago

agreed, this OS is amazing.

[–] [email protected] 1 points 11 months ago

PGTK

thank you, I will try it.

[–] [email protected] 1 points 11 months ago (2 children)

Yes, it not support Windows temporarily:

This feature is supported only on X Windows, Haiku, and Nextstep (macOS or GNUstep

That does not matter at all, I rarely have such a requirement to move file out from emacs, since it could easily move around within Emacs.

 

In Emacs' Dired, You could conveniently move files from outside into Emacs by simply dragging them there.

Drag files in dired

That is effective.

Emacs has been my faithful companion for over 5 years, and I just stumbled upon this remarkable feature minutes ago.

Typically, I rely on async-shell-commands to open the current buffer directory in Windows 10's File Manager, then move files from folder to folder.

But, now, this seeming-trival discovery has greatly enhanced my workflow, instill in me a strong sence that Emacs not only coexists within the operating system, but rather embodies the operating system itself.

While it is true that Windows does not support dragging files to external locations, I seldom encounter such a requirement in my day-to-day workflows.

Have you ever had such an experience? Discovered an amazing feature after a long time using Emacs?

[–] [email protected] 1 points 11 months ago

One could run gnuplot in mind to draw a graph with very limited lines, but impossible to get such a job done with large amount of matplotlib's code.

[–] [email protected] 1 points 11 months ago

great book ,thank you.

 

I tried gnuplot and amazed by its performance. It allows you to directly plot mathematical formulas into graphs with just one single line of math equation.

#+BEGIN_SRC gnuplot :file images/trigon01.png
plot [-10:10] sin(x),atan(x),cos(atan(x))
#+END_SRC

https://preview.redd.it/bmp9izl57kvb1.png?width=640&format=png&auto=webp&s=3c13ffc06a7f3b196b2a71067b9aa8d6d048b2e0

when set arguments, it might requires one more line:

#+BEGIN_SRC gnuplot :file images/sd01.png
g(x) = exp(-0.5*(x/s)**2)/s
plot s=1 g(x), s=2 g(x), s=3 g(x)
#+END_SRC

https://preview.redd.it/efjvennd7kvb1.png?width=640&format=png&auto=webp&s=50cbd91d566721af5a95cd9737c2ee9ac79786e2

I feel frustrated, how I wish could acquainted with such a tool a decade ago while grappling with the challenges of visualizing mathematical formulas.

[–] [email protected] 1 points 11 months ago

It's usually hard in mind to manipulate those complex PM tools such as MS project or Omni Plan by very carefully moving mouse.

Which gantt charts tools you prefer?

[–] [email protected] 1 points 11 months ago

I assume that any form of walking is an opportunity to unleash mental power and enjoy imagination. Almost the same with a treadmill desk, we stroll along the streets amidst "the concrete jungle of steel and cement."

 

I have been experimenting with PlantUML in Org Babel recently, and it has greatly enhanced my ability to visualize concepts mentally. During post-meal walks, I often engage in mental planning exercises, such as sketching Gantt charts. However, my deficient drawing abilities consistently impede my progress, particularly when it comes to mentally manipulating lines, arrows, and objects. Since discovering PlantUML, the visualization skills have steadily improved, thanks to its intuitive text-to-graph syntax.

When reading "Marcovaldo: Or, The Seasons in the City" before bedtime for sleep aid, I spend a significant amount of time immersed in its pleasing pages, sometimes without a clear sense of progress. In such instances, I draw a Gantt chart to gain a visual representation of the slow progress.

@startgantt
Project starts 2023-10-02
[Reading Marcovaldo] lasts 2 weeks and 4 days and is 30% completed
@endgantt

https://preview.redd.it/gqhuh7g9f6vb1.png?width=587&format=png&auto=webp&s=74df6808ae7e6b5baa53ded20991d72552f41b5f

This chart illustrates that the book is being read slowly, and at the current pace, it will take another three weeks to complete.

PlantUML's Gantt chart is expressive, it mimic task bars as [ ] , specify durations with the "lasts" keyword, and "complete" to indicate progress with percentages. This helps to construct mental diagrams and translate thoughts or words into visual representations effortlessly, eliminating the need for manual drawing of lines, arrows, and objects. This feature is particularly beneficial for individuals with limited drawing skills.

PlantUML's Gantt chart functionality goes beyond planning in days, months, and other timeframes. It can also be adapted to manage a single day effectively. Although the smallest unit in PlantUML is a day, it can be flexibly adjusted to represent hours within a day. This means that a Gantt chart spanning 24 days can be used to represent 24 hours each.

@startgantt
!theme mono
[Sleeping] starts on D+0 and lasts 5 days

then [Wakeup@05:45] as [Wake] happens on D+5
then [Breakfast] lasts 1 day and is displayed on the same row as [Sleeping]
then [Morning-Tasks] starts D+8 and lasts 3 days
then [Lunch] starts on D+11 and lasts 1 day and is displayed on the same row as [Breakfast]
then [Afternoon-Tasks] as [Afternoon] lasts 5 days and is 50% completed
then [Dinner] starts on D+17 and lasts 1 day and is displayed on the same row as [Lunch]
then [Evening-Tasks] lasts 4 days
then [Bedtime@22:45] happens on D+21 and is displayed on the same row as [Wake]
then [Sleep] lasts 1 day and is displayed on the same row as [Sleeping]

Separator just at [Sleeping]'s end
'Separator just at [Dinner]'s end
Separator just at [Evening-Tasks]'s end
printscale daily zoom 1.8
'highlight today
today is 14 days after start and is colored in lightgray
'Label on the first column and right-aligned

hide footbox
@endgantt

https://preview.redd.it/duh8uv1jf6vb1.png?width=758&format=png&auto=webp&s=59d72d860bb96048c3a7eaea9140df1828f51681

Just like a wizard casting spells in PlantUML, you can conjure a vivid visualization of the complete panorama of a day in mind. Whether during walks, bedtime, or while commuting on the subway, by consistently practicing and leveraging the unique features of PlantUML, you will unlock the untapped mental prowess for visualization and creativity.

 

I am not skilled in drawing, but after trying PlantUML, I found that I can create visual representations directly using code. This has greatly aided my spatial imagination.

Take, for example, the usecases diagram:

@startuml
:user: -right-> (Right)
:user: -up-> (Up)
@enduml

https://preview.redd.it/1bx7h7sa7vub1.png?width=152&format=png&auto=webp&s=6271256f6855b88a93a62abf63569f1bc542ded5

With the use of directional terms like "up" and "right," you can intuitively draw the diagram as shown. it lowers barrier for non-artists - no drawing ability needed and focuses thought process on structural elements and relationships.

When immersed in text, our spatial imagination can often become less active. For example, when trying to imagine the hierarchical structure of an article such as org-mode, our mental representation tends to be more like a bullet structure in an editor, rather than a graphical tree structure.

PlantUML addresses the challenge of limited spatial imagination by providing an intuitive text-graph syntax. One notable feature is the Work Breakdown Structure (WBS) functionality.

Consider the following example:

@startwbs
!theme mono
    Emamcs
    ** Texting Editing
    ** Note taking
    ** File Manager
    ** Literature Programming
@endwbs

https://preview.redd.it/95b2mg6w9vub1.png?width=567&format=png&auto=webp&s=2e0f00c54e4d411ec731eba7b23a46a665ed78fc

The WBS feature in PlantUML facilitates the effortless transformation of a vertical structure into a horizontal representation. This allows me to mentally interpret and visualize the PlantUML code, automatically converting the vertical structure into a spatially-oriented horizontal structure in mind. Consequently, it effectively resolves the issue of my limited visual imagination and improving it continually.

 

In elisp, symbols serve as fundamental data structures that are more foundational compared to strings. This distinction often caused confusion for me until my encounter with the read function.

 ~ $ (type-of (read))
 symbol

The fact that the read function yields symbols instead of strings from user-input was a delightful revelation. This discovery convinces me that the fundamental nature of symbols in elisp when compared to strings.

 

While a for-loop is a straightforward construct in other programming languages, the loop macro, despite its power, can present challenges due to its intricacy. I find myself frustrated by its complexity.

However, its conceptual abstractions are intriguing. Take, for example, the following code snippet:

(loop for i below 10 sum i)

The utilization of the term "below" in this context is particularly striking. Contrastingly, in languages like JavaScript, I typically read "i < 10" as "i less than 10," pronouncing the two words "less than" in order to read the "<" symbol.

The act of reading "<" as "less than" momentarily interrupts my cognitive flow between the two words. The loop macro condenses it as a single word, "below," allowing me to pronounce "i < 10" more succinctly and smoothly, without interruption. Another viable alternative could be "under."

Moreover, the expression `1 < i < 10` can be read as "from 1 to 10."

(loop for i from 1 to 10 sum i)

It enhance code readability mentally and streamline cognitive processing.

 

Once I saw nil or 'nil from some (setq ..), it usually worried me.

The barely nil appears to be a variable name no more than `foo bar zoo` and there shoud be a value it points to.The quoted 'nil seems to be a data or a value in data mode and there might exist a name it is given.it looks no difference with symbols as 'nilll 'nilllllll or 'nillllllllll as data.

Every time see them, I find myself hesitating, uncertain and disturbing.

This picture tells they are identical and comfort me to get an insight that lisp is much more pragmatic in evovling by patching up.

As a result, I stop worring its theoretical consistency and confidently proceed with using `nil`.

4 disguises of nil

The wizard book SICP states it as:

Lisp was not the product of a concerted design effort. Instead, it evolved informally in an experimental manner in response to users' needs and to pragmatic implementation considerations.

view more: next ›