Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

added pronounce snippet from #152 and macOS compatibility from #149#158

Merged
bugswriter merged 8 commits intobugswriter:purert-versionfrom
PureArtistry:purert-version
Mar 1, 2021
Merged

added pronounce snippet from #152 and macOS compatibility from #149#158
bugswriter merged 8 commits intobugswriter:purert-versionfrom
PureArtistry:purert-version

Conversation

@PureArtistry
Copy link
Copy Markdown
Collaborator

now feature compatible with main, just needs some testing

@BeyondMagic
Copy link
Copy Markdown
Contributor

Yo, tuxi is broken for me. On bash it just crashes.

image

On dash
image

On zsh
image

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

PureArtistry commented Feb 28, 2021

ahem - this will teach me to just push without testing, give me a minute sorry

i just copy pasted the macOS bit, including it's bashisms

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

sorry about that, you wouldn't mind trying again (sorry about wasting your time the first time)

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Feb 28, 2021

(sorry about wasting your time the first time)

it's okay, ((bro?)) I love testing it, seriously

Yep, it's working. Strangely the macOS PR to main is working fine.

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

that's why I just c/p it without testing, assumed it would work fine. I'll try debugging it tomorrow

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

are you getting any double answers and what's the speed like compared to main now?

@BeyondMagic
Copy link
Copy Markdown
Contributor

@PureArtistry I'm sorry, I was eating, I'm back now.

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

@PureArtistry I'm sorry, I was eating, I'm back now.

no need to apologise for me, no need to rush either :)

@BeyondMagic
Copy link
Copy Markdown
Contributor

are you getting any double answers and what's the speed like compared to main now?

As you know, the speed depends on the type of query, but it seems on both (main and purert-version) math is at the top, so that's what you want to test out, right?

image

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

I haven't done any testing really as to where stuff should be in the priority, I just copied the order from main
as math is top of main it is always going to come out faster than mine, mine should be faster for queries that are further down the list to main

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

have you tried the updated test script in test/tuxiqualitytest.sh

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Feb 28, 2021

Back again, now my computer had problems, incredible. You're responding really fast so I want to, too lol

I haven't done any testing really as to where stuff should be in the priority, I just copied the order from main
as math is top of main it is always going to come out faster than mine, mine should be faster for queries that are further down the list to main

Nah, it seems that the bottom (kno_right) for example takes 1.2s while math at the top takes 0.2s.

have you tried the updated test script in test/tuxiqualitytest.sh

Testing right now.

Oh, if we try to call tuxiqualitytest.sh from another folder, it doesn't load the testqueries.txt from the origin script.

How many End runs there is? On the first 17 failed.

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

yeah, I haven't hardcoded any paths, just using the working dir and assume you're running it from there

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Feb 28, 2021

Ok, it seems that I scrapped google so many times that it doesn't give me any results anymore from any tuxi, lol

image

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

wow, google is rejecting your queries!?! that seems wierd - I've never had that

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Feb 28, 2021

Yep, I debugged it and the HTML page is blank, I've had that before when fixing bugs in tuxi. Wew, it normally works after a few hours :\

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://www.google.com/sorry/index?continue=https://www.google.com/search%3Fhl%3Den_us%26q%3D4%252B5%252B6&amp;hl=en_us&amp;q=EhAoBAFMZeSc_H8cH4tpSgjiGKzs74EGIhkA8aeDS6G5rZIjkLmlp9yEgPiNM48bbAt8MgFy">here</A>.
</BODY></HTML>

I can't help you anymore then for those hours

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

that's cool mate, thanks for all you are doing anyway and as I said before - there's no rush for me.

I'm probably not going to be looking at any code until tomorrow anyway, got lots of dota to catch up on

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Mar 1, 2021

strange... it stopped.

Anyway, for macOS compatibility, you'll really need to do all that? Renaming sed & paste will definitely confuse future developers; Can this work instead?

[ "$OSTYPE" = "darwin" ] && gsed "$@" && sed "$@"
[ "$OSTYPE" = "darwin" ] && gpaste "$@" && paste "$@"

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

you can't do it as a function similar to the original pr because that is what causes the recursion and seg fault as the sed command in the script runs the sed function that runs a sed command that runs the function etc... (this will work fine on the mac however as sed will run gsed)

there probably is a better way of doing it (I am still very much a novice) but I can't think of one right now that doesn't either involve renaming sed the way I have done or having every snippet have 2 versions, one each for mac and linux.

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Mar 1, 2021

Hmm, that there is working in your branch for me in dash, bash and zsh. Can you test it?

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

I legit don't understand exactly what the snippet you posted does or where in the script I should put it, I'm gonna need your help with this one

@BeyondMagic
Copy link
Copy Markdown
Contributor

Replace the macOS function that you had with those two lines.

It probably can be simplified to one-line, but just try this one.

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

cool, that works - I now need to do some reading I suppose to figure out how, those lines still make no sense to me

@BeyondMagic
Copy link
Copy Markdown
Contributor

# verify if it's macOS   & true? use gpaste   & false? use paste
[ "$OSTYPE" = "darwin" ] && gpaste "$@" && paste "$@"```

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

the false bit is confusing me, && and not ||, and not just that but how it works in general (I know I'm not articulating this well)

I'm going to need to do some reading on that, figure out what it's doing.

Thanks, I've sort of half learned something today

@BeyondMagic
Copy link
Copy Markdown
Contributor

I'm dumb, I'm dumb, stop aaaaaaaaaa this wont work properly, actually

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

?

@BeyondMagic
Copy link
Copy Markdown
Contributor

I just realized now, I'm so dumb, gsed won't be called

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Mar 1, 2021

I am going to resolve this properly, my bad for the trouble!!

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

PureArtistry commented Mar 1, 2021

thought of a fix myself before reading the comments again, sorry!

(it's a bit of a shame as I really quite liked the word play in the hacky fix)

@BeyondMagic
Copy link
Copy Markdown
Contributor

ok, back

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Mar 1, 2021

we almost thought the same thing, I tried to rename the sed builtin for gsed, but that just didn't work, so I tried calling sed with hardpath, you used whereis and I used which

actually, it does

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

PureArtistry commented Mar 1, 2021

I can't test my newest fix but I think it should be fine, the one before that deffo would have worked but it was 3 times slower because it would have to run both whereis and awk before it run sed every single time

I am still going to have to read up on what you suggested does and how it works

@BeyondMagic
Copy link
Copy Markdown
Contributor

BeyondMagic commented Mar 1, 2021

the one before that deffo would have worked but it was 3 times slower because it would have to run both whereis and awk before it run sed every single time

yes, I tried with only which, but it's slower than just calling it directly

I can't test my newest fix but I think it should be fine

The last one is working fine

I am still going to have to read up on what you suggested does and how it works

ehhh, it doesn't, unfortunately, but it's good learning that to avoid using ifs and elses in future shell scripts.

@PureArtistry
Copy link
Copy Markdown
Collaborator Author

PureArtistry commented Mar 1, 2021

I think I may have finally cracked how to send terminal escapes through sed so I can redo my did you mean bit and tidy some more code up

yep, I have - I'll update in about 30 minutes.

@bugswriter
Copy link
Copy Markdown
Owner

I am merging this many people are sending PR for new features in main. They don't know I am about to replace main with your version.
Can you tell me how ready purert-version is for merging with main?

@bugswriter bugswriter merged commit 6149d9a into bugswriter:purert-version Mar 1, 2021
@PureArtistry
Copy link
Copy Markdown
Collaborator Author

give me a few minutes, I'm about to send another pr with an updated did you mean that no longer needs sd - almost finished

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants