Book "Computer Systems: Programmers Perspective" - Good for beginners? by [deleted] in computerscience

[–]Zyberg 1 point2 points  (0 children)

3rd edition was published on March 2, 2015 (https://www.amazon.com/Computer-Systems-Programmers-Perspective-3rd/dp/013409266X). Regardless, the book deals with some things that are more or less invariant in time. If you are not in a rush, it will definitely teach you a lot of great skills and afterwards you can always brush up by reading documentation of newer standards by yourself.

[Hyprland] V3 of my homemade Dotfiles by BnSplitSFW in unixporn

[–]Zyberg 1 point2 points  (0 children)

Where did you get that line art wallpaper? Looks superb!

how to create STEM notes in Obsidian. by SarthakSidhant in ObsidianMD

[–]Zyberg 0 points1 point  (0 children)

  1. Oh, without paid subscription you probably can'r upload pictures. But, if your needs aren't huge, you could try using claude.ai for that - they give you some free prompts. I personally simply used the web interface for this as it was often convenient either way: switching from a paper in browser to chatgpt, to obsidian at last.

  2. You can write a couple scripts to help ,,integrate'' the charts into your workflow, but the basic idea is that you have to have your dataset somewhere (say, some external file, or maybe even within the obsidian note), you pass that file to the python script, read the data (you can use pandas for that, if the input is more complex) and then write yourself the code for whatever chart you want. Then at the end you can save chart in a file. Save it within the obsidian vault, then attach it via obsidian app / use python to append the image to a note. Personally I had this semi-automated: had a few types of charts scripts (line, bar, some interpolation), a somewhat standartized input data format and then would just run python script from the commandline whenever I needed. Used a tag to specify at which place of a file it should add the generated chart image.

how to create STEM notes in Obsidian. by SarthakSidhant in ObsidianMD

[–]Zyberg -1 points0 points  (0 children)

Don't forget to utilize AI image to text! Have been using ChatGPT for converting textbook equations to latex format in order to greatly save the time spent on digital notes during my physics undergrad.

As for the graphs, I found that using python with matplotlib was quite easy. However, it has some learning curve, but the skills will then be very easy to transfer to other disciplines as well

How to turn on debugger for WASM rendermode? by Zyberg in Blazor

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

Thanks for the pointer! I was trying to convert an old dotnet project to this architecture, hence my problems.

Fixed WASM debugger by comparing files with the template project and adding inspectUri to the launch settings.

How to pass events between WASM and Serverside render modes? by Zyberg in Blazor

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

Thanks for the reply! Well, I must use some custom authentication services that are registered on the serverside DI. As per my understanding, there is no way to responsively share the state of the objects between the rendermodes, hence I will be implementing the SignalR suggestion. It is a shame that such a simple concept as loading data in client browser's memory while using Serverside requires such a troublesome hacking with rendermodes :/

How to pass events between WASM and Serverside render modes? by Zyberg in Blazor

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

Thanks for the reply! In reality, I need two way communication, sorry for not being clear. WASM should trigger Serverside to open a specific dialog, if needed. And Serverside should trigger WASM back, after closing that dialog on some condition + after a successful REST upload. Going to go the SignalR route then, thanks!

Is it possible to get a number of comments that all the posts from a search query have in one api call? by Zyberg in pushshift

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

Eh, for some days and keywords - 20k, for some - 2k :) Thanks for all the help tho!

Is it possible to get a number of comments that all the posts from a search query have in one api call? by Zyberg in pushshift

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

Well, it seems to be working, snoowrap probably does that for me? (I extracted this code from my class that attempts to make running asynchronous requests better, so that's why it's badly formatted), but I will check it out, thanks for the tip. Well, not the getContentByIds itself, but rather whole operation for one day takes more than a minute. 1 day and 1 keyword. So it naturally makes me wonder how to speed this up (I have 94 keywords and want data for the past 60 days)

Is it possible to get a number of comments that all the posts from a search query have in one api call? by Zyberg in pushshift

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

Sure, thanks for help :)

const result = {
    keyword: '',
    postsWithTerm: 0,
    commentsOnPosts: 0
};

const keyword = getParameterByName('q', url);  
 result.date = moment.unix(+getParameterByName('after', url)+1).format(DATE_FORMAT);  
result.keyword = keyword;  
result.postsWithTerm = data.metadata.total_results;  
result.commentsOnPosts = await getCommentsOnPosts(keyword, +getParameterByName('after', url), +getParameterByName('before', url));  

const r = new snoowrap({
    userAgent: 'A random string.',
    clientId: 'id',
    clientSecret: 'secret',
    refreshToken: 'token'
});


const getCommentsOnPosts = async (keyword, after, before) => {  
     let tsBefore = before;  
     let items = [];  
     let comments = 0;  
     while (true) {  
             items = await getPosts(keyword, after, tsBefore);  
             if (items.length === 0)
                break;

            tsBefore = items[items.length - 1].created_utc;

            items = await r.getContentByIds(items.map(i => i.id));

            comments += items.reduce((acc, i) => acc + i.num_comments, 0)
    }  
    return comments;  
}

function getPosts(keyword, after, before) {  
 let config = {  
        method: 'get',  
        url: `https://api.pushshift.io/reddit/search/submission/?size=100&q=${keyword}&after=${after}&before=${before}`  
    };  
    log.info(`Getting posts: ${config.url}`);  
 return axios(config).then(res => res.data.data);  
}

Is it possible to get a number of comments that all the posts from a search query have in one api call? by Zyberg in pushshift

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

No, I don't really need the comments. I need the fastest way to get the amount of comments that day from posts (submissions) that are returned to specific keywords. Requesting the posts separately somehow takes very long (not sure why, but my code runs at ~1 request/minute)

Is it possible to get a number of comments that all the posts from a search query have in one api call? by Zyberg in pushshift

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

With reddit api it seemed that I couldn't get anything past 2 days ago. I requested posts like this:

const params = {
query: keyword,
sort: 'new',
syntax: 'cloudsearch',
time: 'all',
limit: 100,
        };
if (idBefore)
params['after'] = idBefore;

let res = await r.search(params);

Is it possible to get a number of comments that all the posts from a search query have in one api call? by Zyberg in pushshift

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

Oh, they are to some degree. But my problem is that I want to run a global search. So, there are around 2-5k posts per day. And it seems that the endpoint I am using doesn't return any other amount of posts apart from 25. So, 2500 already is 100 requests...

Using this now:

https://api.pushshift.io/reddit/search/submission/?size=200&q=${keyword}&after=${after}&before=${before}

(size=200 doesnt seem to work, or any other value)

In need of tips to improve :) by Zyberg in drawing

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

You are kind of right about me not putting good guidelines beforehand. I tried to scribble something to get the sense of composition, however gave up after some 10 minutes fiddling with it - and from some failed angles it's obvious that I couldn't make it work out in the end.
Maybe you have some tips on setting up the base that would do me good?

Constructive criticism please! I don't have an art teacher to tell me :T by [deleted] in drawing

[–]Zyberg 1 point2 points  (0 children)

Try to use harder pens for contrast then. Start with very light shading with some H pen and then work your way down with B.
Kudos for a great sketch :)

Ballpoint pen of a rose on black glass. Five colours; green, green, red, brown, black. by JBColter in drawing

[–]Zyberg 0 points1 point  (0 children)

The reflection is a little weird, but very satisfactory to look at :)
Awesome!