Search found 37 matches

by blumenwesen
Sat Aug 17, 2024 12:07 pm
Forum: Programming
Topic: permutation combination by position number in bash?
Replies: 8
Views: 815

Re: permutation combination by position number in bash?

Runs well and is very fast, so I will soon be able to calculate the course of the individual rooms in the hypercube. :D
Thanks for the script, I have adapted it in bash.

n=5
i=$[50-1]
fact=(1)
for (( k=1; k<n; k++ )); do
fact[$k]=$(( ${fact[$(( k - 1 ))]} * k ))
done

perm=()
for (( k=0; k<n; k ...
by blumenwesen
Fri Aug 16, 2024 9:48 pm
Forum: Programming
Topic: permutation combination by position number in bash?
Replies: 8
Views: 815

Re: permutation combination by position number in bash?

I found this code, but it also seems to be a run of all variants and then a comparison with the searched, I'm not quite sure.

https://www.geeksforgeeks.org/find-the-k-permutation-sequence-of-first-n-natural-numbers/

Have now searched a lot but unfortunately not found a calculation option, although ...
by blumenwesen
Fri Aug 16, 2024 12:37 pm
Forum: Programming
Topic: permutation combination by position number in bash?
Replies: 8
Views: 815

Re: permutation combination by position number in bash?

Thanks for the help runs much faster, i dynamically adjusted it so that only the base "{1..4}{1..4}{1..4}{1..4}" must be changed.
Came across interesting data that the mathematical basis 9 or 3 reveals, no matter what length the number arrangement has.
I am not further and it is certainly very ...
by blumenwesen
Thu Aug 15, 2024 11:48 pm
Forum: Programming
Topic: permutation combination by position number in bash?
Replies: 8
Views: 815

Re: permutation combination by position number in bash?

the simpler would be "1 2 3" and the fifth combination position is "312" out of six possible variants.
how can the combination "312" be calculated only by specifying the number of all elements "3", the maximum possible variants "6" and individual variants position "5"?
It is actually more math than ...
by blumenwesen
Thu Aug 15, 2024 4:56 pm
Forum: Programming
Topic: permutation combination by position number in bash?
Replies: 8
Views: 815

permutation combination by position number in bash?

I found this script and would like to find a specific combination by its number in the sequence.
If 4312 comes in position 23, can this combination be found just by calculating the sequence number 23 without comparing and running through all possible sequences?
Otherwise it takes too long with bash ...
by blumenwesen
Wed Oct 25, 2023 1:46 pm
Forum: Programming
Topic: How to get multiple video volume at different time intervals?
Replies: 2
Views: 442

Re: How to get multiple video volume at different time intervals?

Thanks for the hint, I tried from the example "-filter_complex [0:v]trim=start=5 ..." for ffprobe in "-f lavfi amovie=" to integrate multiple start and end times as a trim but the separator ";" is not accepted here.
In the description for atrim on a help page it says that it is possible with ...
by blumenwesen
Mon Oct 23, 2023 11:51 am
Forum: Programming
Topic: How to get multiple video volume at different time intervals?
Replies: 2
Views: 442

How to get multiple video volume at different time intervals?

Try to read volume values in several places with ffprobe.
With "aselect=between(...)+between(...)..." the script takes a very long time if the file is larger.
I tried using ffmpeg and volumedetect, but then the script would also have to process the file several times in the for loop.
My idea is to ...
by blumenwesen
Sun Jul 16, 2023 5:48 am
Forum: Programming
Topic: How to bash sort files numerically correctly in awk? (Solved)
Replies: 8
Views: 850

Re: How to bash sort files numerically correctly in awk?

I have to edit the file names in the script, so I used awk.
Thanks for the help, now it clicked =).

ar0="musica 10 00.mp3\nmusica 10 01.mp3\nmusica 8 00.mp3\nmusica 8 01.mp3\nmusicb 11 00.mp3\nmusicb 11 01.mp3\nmusicb 2 00.mp3\nmusicb 2 01.mp3\nmusicb 5 00.mp3\nmusicb 5 01.mp3"

time echo -e ...
by blumenwesen
Sat Jul 15, 2023 6:44 pm
Forum: Programming
Topic: How to bash sort files numerically correctly in awk? (Solved)
Replies: 8
Views: 850

Re: How to bash sort files numerically correctly in awk?

In the logical order, not the one given by the system.
correct: 1,2,3,4,5,6,7,8,9,10,11,12,...
wrong: 1,10,11,12,13,14,15,16,18,19,2,20,...

by blumenwesen
Sat Jul 15, 2023 3:05 pm
Forum: Programming
Topic: How to bash sort files numerically correctly in awk? (Solved)
Replies: 8
Views: 850

How to bash sort files numerically correctly in awk? (Solved)

Hello, have tried with awk not sort, because further processing has to be done to arrange files numerically correctly.
Please help.

musica 1 00
musica 5 00
musica 10 00
musicb 2 00
musicb 18 00
...


ar0="musica 10 00.mp3\nmusica 10 01.mp3\nmusica 8 00.mp3\nmusica 8 01.mp3\nmusicb 11 00.mp3 ...
by blumenwesen
Fri May 26, 2023 9:23 am
Forum: Programming
Topic: Bash: digital numbers in bash without awk, bc, expr, printf
Replies: 2
Views: 779

Re: digital numbers in bash without awk, bc, expr, printf

Wow thank you, I made it really awkward before. :thumbup:

by blumenwesen
Thu May 25, 2023 7:42 pm
Forum: Programming
Topic: Bash: digital numbers in bash without awk, bc, expr, printf
Replies: 2
Views: 779

Bash: digital numbers in bash without awk, bc, expr, printf

Hi have tried to calculate digital numbers, but without awk, bc, expr, printf.
The first variant does not come over "9223372036854775808" as with "echo -e $[2**63+1]" returns 0 again from the limit.
The second variant multiplies only the crossing points of two single digits, then puts them together ...
by blumenwesen
Tue Dec 13, 2022 4:06 pm
Forum: Programming
Topic: python or bash snapshot current cpu realtime binary calculations
Replies: 5
Views: 627

Re: python or bash snapshot current cpu realtime binary calculations

Ok I was hoping there is a way to read out current data directly without assambler. Thanks anyway.

by blumenwesen
Fri Dec 09, 2022 10:48 am
Forum: Programming
Topic: python or bash snapshot current cpu realtime binary calculations
Replies: 5
Views: 627

Re: python or bash snapshot current cpu realtime binary calculations

It should be just a short excerpt, and show a few recent reactions of the program code processing.
A few MB is more than enough, where /proc or /sys or in /dev can the kernel be read?

by blumenwesen
Tue Nov 29, 2022 7:18 pm
Forum: Programming
Topic: python or bash snapshot current cpu realtime binary calculations
Replies: 5
Views: 627

Re: python or bash snapshot current cpu realtime binary calculations

Ok, it seems to be impossible.
But how can I read out the memory in a short moment?

by blumenwesen
Fri Nov 25, 2022 4:30 pm
Forum: Programming
Topic: python or bash snapshot current cpu realtime binary calculations
Replies: 5
Views: 627

python or bash snapshot current cpu realtime binary calculations

Hi, can the current pc work be displayed in binary with bash or python?
A snapshot of the current realtime cpu calculations in binary, i.e. the complete system working code from the processor.
Only a short excerpt may be possible at intervals, otherwise the work of the selection program would ...
by blumenwesen
Fri Oct 28, 2022 2:44 pm
Forum: Programming
Topic: bash how filter non showable uncode chars?
Replies: 8
Views: 721

Re: bash how filter non showable uncode chars?

Yes, that would be an idea, but I don't know if all visible characters can be displayed in a file.
In geany, the complete text is deleted and an error is displayed with other editors.
Well, but it worked out so thank you again.

by blumenwesen
Thu Oct 27, 2022 10:04 am
Forum: Programming
Topic: bash how filter non showable uncode chars?
Replies: 8
Views: 721

Re: bash how filter non showable uncode chars?

Thanks for the improvement, I've changed it now.
therefore, I have to realize that it is not possible with bash, and the blocks can only be deleted manually.
in this sense, the main thing is save, the man himself. :mrgreen:

by blumenwesen
Mon Oct 24, 2022 2:41 pm
Forum: Programming
Topic: bash how filter non showable uncode chars?
Replies: 8
Views: 721

Re: bash how filter non showable uncode chars?

Ok thanks, but how to distinguish the installed from the uninstalled?
I made this here, but is there a faster or better way to compare + filter the characters?

str='ɨɆ01ab!?🙏⃹'
for ((z=0; z<${#str}; z+=1)); do
for y in $(fc-list : family | sort | uniq); do
for x in $(fc-match --format="%{charset ...
by blumenwesen
Sun Oct 23, 2022 6:47 pm
Forum: Programming
Topic: bash how filter non showable uncode chars?
Replies: 8
Views: 721

bash how filter non showable uncode chars?

Hi, how can I delete special characters like "💩🐕힚팧" and leave only normally visible ones like "01abŁÐ....".
With the code I can display, but not filter them out.

zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if(NR>25001 && NR<27000) {gsub(/\//, "\\\\"); system("/usr/bin/echo -ne "$2" | grep -oP ...
by blumenwesen
Wed Jul 20, 2022 4:48 pm
Forum: Programming
Topic: bash using awk and amp to write between the passing variable
Replies: 10
Views: 1322

Re: bash using awk and amp to write between the passing variable

how do I have to change the script if I only want to replace the space between the numbers?
results="02:43 (03:36)945+7 :0+1+07:37 - 08:59 (01:21)"

echo "02:43 (03:36)945 7 :0 1 07:37 - 08:59 (01:21)" | awk '{a=gensub(/([[:digit:]]) ([[:digit:]])/, "+\\1+1\\1", "g"); print a}'
by blumenwesen
Mon Jul 18, 2022 11:39 am
Forum: Programming
Topic: bash using awk and amp to write between the passing variable
Replies: 10
Views: 1322

Re: bash using awk and amp to write between the passing variable

I'm sorry made a mistake, meant the code should be with gsub and passing variables parameters such as "()[]{}&$_" split and write between these characters 0 + ":" + 1 + "b" + 0 + ":" + 1 + "c".

# example
echo "a:b:cd" | awk -F "" '{print $1"0"$2"1"$3"0"$4"1"$5}'
echo "a:b:cd" | awk '{gsub(/:b:c ...
by blumenwesen
Sun Jul 17, 2022 3:09 pm
Forum: Programming
Topic: bash using awk and amp to write between the passing variable
Replies: 10
Views: 1322

bash using awk and amp to write between the passing variable

Hello, I wanted to know how it is possible with awk in example one with the general definitions of punct, alpha to pass the variable with the amp character so that it can be written between the passing variable, as with the result of example two.
can the variable passed by the amp be shortened, for ...
by blumenwesen
Sun Apr 17, 2022 3:07 pm
Forum: Programming
Topic: Bash echo within awk hex conversion?
Replies: 29
Views: 5097

Re: Bash echo within awk hex conversion?

I've done it now.

zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if(NR>42 && NR<1135) {gsub(/\//, "\\\\"); a=system("/usr/bin/echo -ne "$2); gsub(/\\\\/, " ", $2); print " "$2" "substr($1, 3, 4)" "$3" "$4" "$5" "$6" "$7" "$8" "$9}}'

zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if(NR>42 && NR ...
by blumenwesen
Sat Apr 16, 2022 10:37 am
Forum: Programming
Topic: Bash echo within awk hex conversion?
Replies: 29
Views: 5097

Re: Bash echo within awk hex conversion?

Is it possible from 138 subsequent characters (⇳, ֆ, ⇵, փ, ...) also to show?


zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '/\/x/ {if(NR>41 && NR<1138) {gsub(/\/x/, "", $2); system("/usr/bin/echo -e \\\\u"$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9)}}'
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if ...
by blumenwesen
Fri Apr 15, 2022 9:55 pm
Forum: Programming
Topic: Bash echo within awk hex conversion?
Replies: 29
Views: 5097

Re: Bash echo within awk hex conversion?

Have installed 6.4 but then completely replaced it with current ones, and this both echo commands works very well.


zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '/\/x/ {if(NR>41 && NR<138) {gsub(/\/x/, "", $2); system("/usr/bin/echo -e \\\\x"$2"")}}'
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk ...
by blumenwesen
Fri Apr 15, 2022 6:30 pm
Forum: Programming
Topic: Bash echo within awk hex conversion?
Replies: 29
Views: 5097

Re: Bash echo within awk hex conversion?

Yes it worked well I just noticed it now.
Thanks for solving the problem.

by blumenwesen
Fri Apr 15, 2022 12:27 pm
Forum: Programming
Topic: Bash echo within awk hex conversion?
Replies: 29
Views: 5097

Re: Bash echo within awk hex conversion?

Sorry, Echo runs normally for me and I also get "a" from "echo -e \\U61" but I was hoping that I can use echo instead of prinf in awk.

by blumenwesen
Wed Apr 13, 2022 1:41 pm
Forum: Programming
Topic: Bash echo within awk hex conversion?
Replies: 29
Views: 5097

Re: Bash echo within awk hex conversion?

have Awk 5.1.0 Copyright © 1989, 1991-2020

Go to advanced search