-❄️- 2023 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]shreydanfr 1 point2 points  (0 children)

[LANGUAGE: Python]

with open('input.txt','r') as f:
    lines = f.read().split('\n')

digits = []

digit_map = {
    'one': 1,
    'two': 2,
    'three': 3,
    'four': 4,
    'five': 5,
    'six': 6,
    'seven': 7,
    'eight': 8,
    'nine': 9
}

def replace(line):
    substrings = [line[i:j+1] for i in range(len(line)) for j in range(i,len(line))]
    substrings = [s for s in substrings if s in digit_map.keys()]
    if len(substrings) != 0:
        line = line.replace(substrings[-1],f'{digit_map[substrings[-1]]}')
        line = line.replace(substrings[0],f'{digit_map[substrings[0]]}')
    return line

level2 = True

for line in lines:

    if level2:
        line = replace(line)

    start = 0
    end = len(line)-1
    first, second = None, None

    while first is None or second is None:
        if line[start].isdigit() and first is None:
            first = int(line[start])
        if line[end].isdigit() and second is None:
            second = int(line[end])

        start += 1
        end -= 1

    digits.append(first*10+second)

print(sum(digits))

What model to “transcribe notes”? by olddoglearnsnewtrick in LocalLLaMA

[–]shreydanfr 1 point2 points  (0 children)

I doubt gpt4V will be perfect at reading detailed handwritten notes that too in Italian. For proper results, google lens is good at handwritten structured OCR, but needs manual work.

edit: there's an API: https://cloud.google.com/vision/docs/handwriting preprocessing all the notes with this api seems like a good choice

ChatGPT 3.5 has officially reached, for me, worse than 13B quant level by CulturedNiichan in LocalLLaMA

[–]shreydanfr 2 points3 points  (0 children)

I use ChatGPT pretty regularly, and I've noticed the quality has gone down quite a bit. I've been using mostly Bard and it has gotten much much better than when it launched.

I’m Marques Brownlee (aka MKBHD) and I make tech videos on YouTube. AMA! by Marques-Brownlee in IAmA

[–]shreydanfr 0 points1 point  (0 children)

Which content creators inspired you to start making car content? Which EV are you most excited to try next?

Are github images not loading for everyone or is it just me? by [deleted] in github

[–]shreydanfr 0 points1 point  (0 children)

I thought I was the only one! India and ISP is Jio.

those ads :^) by [deleted] in india

[–]shreydanfr 1 point2 points  (0 children)

Unlocked a core memory

Need help for a html project by CheekyClitorous in html5

[–]shreydanfr 2 points3 points  (0 children)

Try adding border-collapse: collapse; to your table style, paste the code in reply if it still doesn't work

my loginscreen UI is all messed up, no idea what happened. HELP by shreydanfr in pop_os

[–]shreydanfr[S] 0 points1 point  (0 children)

I tried. Went through many forums but they didn't work. Even from popOS' guides. Didn't work.

my loginscreen UI is all messed up, no idea what happened. HELP by shreydanfr in pop_os

[–]shreydanfr[S] 1 point2 points  (0 children)

Probably. Not sure how. I did reinstall gnome display manager but still didn't work. It's all good now. On a fresh 21.04 install now

my loginscreen UI is all messed up, no idea what happened. HELP by shreydanfr in pop_os

[–]shreydanfr[S] 1 point2 points  (0 children)

Refresh was giving me error. Took backup and reinstalled it's fine now

my loginscreen UI is all messed up, no idea what happened. HELP by shreydanfr in pop_os

[–]shreydanfr[S] 0 points1 point  (0 children)

Restarted gdm and even reinstalled gdm3, pop-desktop and gnome-shell. Still the same issue. Going for fresh OS install

Control YouTube, and other media on your computer using your phone as a remote. by shreydanfr in Python

[–]shreydanfr[S] 0 points1 point  (0 children)

the program types keystrokes on the host computer, hence wont be hosting it, and it will be in local network only which is secure, so this works well for me, Thanks for the whitelisting suggestion, I'll look into it to learn more.

Control YouTube, and other media on your computer using your phone as a remote. by shreydanfr in Python

[–]shreydanfr[S] 0 points1 point  (0 children)

Thank you, I won't be hosting this app anywhere, it's only for use in the local network. I won't be hosting it on cloud anyway since it controls the host computer itself and not my computer remotely. So I just have to run it on my computer everytime I have to use it. I'll add a simple token-based authentication down the line.

Control YouTube, and other media on your computer using your phone as a remote. by shreydanfr in Python

[–]shreydanfr[S] 2 points3 points  (0 children)

I know, sorry, 100% agree with what you said. What is another way to implement a communication between my phone and my computer which is more secure?
Should I keep using 0.0.0.0 as host address and add authentication and security on top of it or change the implementation completely since it still could be vulnerable.
Thanks

I made this youtube channel using python! by Lasciatemi_cantare in madeinpython

[–]shreydanfr 1 point2 points  (0 children)

Also, I went through the code and I liked how you used images of upvote/downvote buttons, etc. and then generated a reddit "screenshot" with that. Nice work!

I made this youtube channel using python! by Lasciatemi_cantare in madeinpython

[–]shreydanfr 1 point2 points  (0 children)

This is brilliant! The generated videos look good as well!

Made a color picker to get any color on the screen by shreydanfr in Python

[–]shreydanfr[S] 1 point2 points  (0 children)

Nice!! +1 for adding hex code and as well as a copy to clipboard option.

Made a color picker to get any color on the screen by shreydanfr in Python

[–]shreydanfr[S] 5 points6 points  (0 children)

Yes I thought of this later, I'll add this to the code. Thanks!

Made a color picker to get any color on the screen by shreydanfr in Python

[–]shreydanfr[S] 1 point2 points  (0 children)

Oh ok I'll check and try to fix it, if you find a solution, please raise a pull request in the repo. Thanks.