the-algorithm icon indicating copy to clipboard operation
the-algorithm copied to clipboard

[#1953] [#1935] rewrite the algorithm in docx + security and performance issue fix

Open ar1ja opened this issue 1 year ago • 20 comments

fixes #1953 and #1935

docx > *, best programming language known to man,, customizability, memory safety, speed and also supported on the best IDE ever -- microsoft (r)(c)(allrightsreserverd)(m$) word

and added SECURITY.png file for security ensurance

ar1ja avatar Jan 23 '24 17:01 ar1ja

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jan 23 '24 17:01 CLAassistant

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

no, if twitter cant follow basic open source ethics ( or ethics in general ) im not gonna sign this shitty cla bro

ar1ja avatar Jan 23 '24 17:01 ar1ja

( for anyone interested in the very bad automation scripts, license : cc0, aka do whatever u want

click to expand the shitty scripts

d.py

from docx import Document
from sys import argv
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
from os import path
from docx.shared import Cm, Pt

# read file
with open(argv[1], "r") as file:
    content = file.read()

# create a new Word document
doc = Document()

# set default style
style = doc.styles["Normal"]
# font size and type
font = style.font
font.name = "Arial"
font.size = Pt(12)

# margin
sections = doc.sections
for section in sections:
    section.top_margin = Cm(2.5)
    section.bottom_margin = Cm(2.5)
    section.left_margin = Cm(2.5)
    section.right_margin = Cm(2.5)

# add paragraph to the document
for line in content.split("\n"):
    paragraph = doc.add_paragraph()
    paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.JUSTIFY
    paragraph.add_run(line)

# save the doc
doc.save(f"{path.splitext(argv[1])[0]}.docx")

a.sh

cd the-algorithm/

count=0

for file in $(find . -type f -not -path './.git/*'); do
    echo "$file"
    python3 ../d.py "$file"
    rm -f "$file"

    ((count=count+1))

    if ((count % 200 == 0)); then
        git add -A
        git commit -sm "[docx] split commit for file $count"
        git push -u origin main
        echo 'pushed, sleeping'
        sleep 10
    fi
done

git add -A
git commit -sm "[docx] final commit @ $(date) for file $count"
git push -u origin main
echo 'pushed'

)

ar1ja avatar Jan 23 '24 17:01 ar1ja

can musky husky pls merge this faster, this is a security critical issue !!

ar1ja avatar Jan 23 '24 19:01 ar1ja

ive also fixed #1935 in the mean time

ar1ja avatar Jan 23 '24 19:01 ar1ja

can musky husky pls merge this faster, this is a security critical issue !!

sorry musky husky

image

ar1ja avatar Jan 23 '24 19:01 ar1ja

Internet, please never change

DarkGuy10 avatar Jan 23 '24 22:01 DarkGuy10

Internet, please never change

i will make sure i <3 corporate stunts by shitty companies not go as well as they expected it to go plus like its entertaining lmao, id rather procrastinate and do this

image image image

redbubble is funny

ar1ja avatar Jan 23 '24 22:01 ar1ja

have you considered using .doc instead of .docx? it would allow for much wider compatibility

rollerozxa avatar Jan 24 '24 14:01 rollerozxa

have you considered using .doc instead of .docx? it would allow for much wider compatibility

i think its a better idea to stick w more modern technologies, such as docx, for best performance and features,, we can deal with compatibility by re-distributing pre-built packages

ar1ja avatar Jan 24 '24 17:01 ar1ja

have you considered using .doc instead of .docx? it would allow for much wider compatibility

i think its a better idea to stick w more modern technologies, such as docx, for best performance and features,, we can deal with compatibility by re-distributing pre-built packages

@TruncatedDinoSour i personally think we should be using .docm to allow for a more extensible featureset over time, by allowing macros

after a long time of considering, i have decided to take the executive decision to not include this, .docm uses vba which is, as we all know it - c, and c is slow ( :vomiting_face: ) and not memory safe ( :no_entry: :rocket: )

so far, after very extensive research, docx seems like the best option here for high performance applications with security in mind, such as ~~twitter~~ x( org ??? foss ref ??/?? )

ar1ja avatar Jan 31 '24 15:01 ar1ja

lgtm

ghost avatar Feb 26 '24 11:02 ghost

sorry for the unverified commits, i mightve needed to change my gpg key a bit :+1: also the person who :-1: this pr, pls make changes to make this pr better - talk is cheap

ar1ja avatar Feb 29 '24 18:02 ar1ja

LGTM

Marioood avatar Mar 01 '24 01:03 Marioood

Lgtm

DarkGuy10 avatar Mar 01 '24 01:03 DarkGuy10

can twitter review and merge this

ar1ja avatar Mar 06 '24 22:03 ar1ja

LGTM.

FujiwaraChoki avatar Aug 15 '24 09:08 FujiwaraChoki