kionite231

joined 2 years ago
MODERATOR OF
[–] kionite231 2 points 2 months ago (1 children)

I am not much familiar with Rust that's why I am making these naive mistakes. Thank you for the suggestions though.

[–] kionite231 1 points 2 months ago

If the user only presses Enter then the first character would be "\n".

[–] kionite231 2 points 2 months ago

yeah, you are right. Thanks for pointing out.

[–] kionite231 4 points 2 months ago (1 children)

What version of Odoo was the best one?

[–] kionite231 2 points 2 months ago

Thank you for the in depth suggestion :)

[–] kionite231 1 points 2 months ago

Thanks, I will keep that in mind.

[–] kionite231 4 points 2 months ago

Thank you so much for the suggestion. I have updated the code locally :)

[–] kionite231 2 points 2 months ago (6 children)

but to do that I have to use external deps? which I am not comfortable doing. (I am newbie :) )

[–] kionite231 3 points 2 months ago (1 children)

Thank you for the suggestions.

attempts is used to display total attempts when user wins the game so it is used in the program, I don't see any warnings from compiler.

[–] kionite231 2 points 2 months ago (8 children)

done :D

use std::io;

fn main() {
    let mut input: String = String::new();
    let stdin = io::stdin();

    let x = rand::random::<u32>() % 101;
    let mut attempts = 0;

    let mut user_inputs: Vec<u32> = Vec::new();
    loop {
        println!("Guess a number from 0 to 100:");
        stdin.read_line(&mut input);
        input = input.to_string().replace("\n", ""); // removing the \n
        let user_input: u32 = input.parse::<u32>().unwrap();
	user_inputs.push(user_input);
        if x == user_input {
            println!("You won! attempts: {attempts}");
	    println!("Your inputs:");
	    for input in user_inputs {
		print!("{input} ");
	    }
	    println!("");
            break;
        }
        else if x < user_input {
            println!("too big");
            attempts += 1;
        }
        else {
            println!("too small");
            attempts += 1;
        }
        input.clear()
    }
}

[–] kionite231 2 points 2 months ago

Thank you for the suggestion, I will keep these in mind.

33
do you use 4chan? (self.asklemmy)
 

hello,

I have been diving into these anonymous boards and stuff. I wanted to know if anyone use it for any actual purposes like for getting some tech knowledge or something?

 

Hi,

I want to export all of my data including all the post, comment, post I upvoted, list of communities I subscribed to, log of my IP address, all of my logins. In short all the data I gave to the instance I am using.

is there a way to export all of these data to a JSON file or something?

Thank you in advance!

 

hello,

so first of all she is hot and I have a big crush on her so much that I can't even concentrate in her lecture.

I like when she make me plea for her signature and make me realize that I will fail the semester if she don't sign on my journal. however she then signs when I beg before her.

she also forces me to be extra polite in front of her. I fucking love it!

I don't know I am just a weird person :(

 

so we already know that youtube doesn't like people freeloading their bandwidth using something like invidious, piped, newpipe etc. why don't they just close the public web api and require a login or something. by requiring login they can keep track of what users are watching and if a user is watching thousands of videos daily they can rate limit that user.

are they afraid of losing their user if they do so? I personally don't think it can affect their business or profit. It will cut down their cost of bandwidth and computation costs. so why don't just cut off users that don't bring any revenue??

 

Hello,

I want to create an AI model to learn about AI/ML. so I have scraped some data from Threads and Instagram.now I am wondering how can I use this dataset to make an AI model or do something useful with it? (BTW I don't know anything about AI/ML. I have done internship as Data Analyst so I know a little bit about Linear regression etc. but don't know anything advance.)

I am really curious to explore this space :)

 

Hello,

I have made Python scripts to scrape Instagram and Threads. I would like some suggestion or criticism :D

 

I want to scrape a website using python selenium however every time it gives different id to same html element. I don't know how to circumvent it.

maybe XPATH is my saviour? but I don't know how reliable it is.

 

I have scraped a lot of links from instagram and threads using selenium python. It was a good learning experience. I will be running that script for few days more and will see how many more media links I can scrape from instagram and threads.

However, the problem is that the media isn't tagged so we don't know what type of media it is. I wonder if there is an AI or something that can categorize this random media links to an organized list.

if you want to download all the media from the links you can run the following command:

# This command will download file with all the links
wget -O links.txt https://gist.githubusercontent.com/Ghodawalaaman/f331d95550f64afac67a6b2a68903bf7/raw/7cc4cc57cdf5ab8aef6471c9407585315ca9d628/gistfile1.txt
# This command will actually download the media from the links file we got from the above command 
wget -i links1.txt

I was thinking about storing all of these. there is two ways of storing these. the first one is to just store the links.txt file and download the content when needed or we can download the content from the links save it to a hard drive. the second method will consume more space, so the first method is good imo.

I hope it was something you like :)

8
submitted 1 year ago* (last edited 1 year ago) by kionite231 to c/[email protected]
 

Hello,

I made a simple script to scraper threads.net using python and selenium. the script is just few lines long and it's easy to understand.

So what this script does?

first it will open edge browser(which you can change it to firefox or chrome). now you have to enter credentials to log into it. your browsing data and credentials will be stored in user_data which you can move around.

It scroll through threads's feed/hashtag/explore and It will store the src of every image it encounters so at the end we will have a links.txt file containing all the links to the images we have encountered.

now we have links.txt and we can use the following command to download all the images from the links.txt

wget -i links.txt

the script:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.options import Options
import time

options = Options()
options.add_argument("--user-data-dir=user_data")

driver = webdriver.Edge(options=options)

driver.get('https://threads.net')

s = set()

input("Press any key to continue...")
for i in range(30):
    try:
        elements = driver.find_elements(By.XPATH, "//img")
        for e in elements:
            s.add(e.get_attribute("src"))
        driver.execute_script("window.scrollBy(0, 1000);")
        time.sleep(0.2)
    except:
        print("oopsie")

with open("links.txt", 'w') as f:
    links = list(s)
    for l in links:
        f.write(l+"\n")

driver.quit()

I hope it was usefull :D

Edit: here is a link to links.txt https://0x0.st/HGjx.txt

 

Hello, I wanted to use hyprland on fedora silverblue but I couldn't find any image. I found this image however when I rebase to that image it drops me into rescue mode after reboot. :(

do you have your own hyprland silverblue images? I would love to try it out :D

view more: ‹ prev next ›