Programming

13384 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
176
 
 

Hi all, I implemented yet another on-line cryptographic hash functions calculator. It is written in C, compiled into WebAssembly and is running inside your web browser (nothing is sent to the server). The calculator: https://marekknapek.github.io/hash, web page source code: https://github.com/MarekKnapek/MarekKnapek.github.io, C source code: https://github.com/MarekKnapek/mk_clib.

177
178
179
180
181
26
How to Linux? (self.programming)
submitted 1 year ago by TheCalzoneMan to c/programming
 
 

So after reading a number of posts and comments on here about Linux, I've decided to give 'er a go. I have access to an Azure VM, but I have never done anything involving Unix before and have only a basic understanding of coding in general.

Where do I even start? The most daunting thing for me is command line script, as it seems I have to memorize close to 150 common commands and their functions. Is there a set of tools or free classes that would make it easier for me to understand, or should I just get stuck in there? I was planning on using Pop!_OS since I do a lot of gaming and it seems like the closest thing Ubuntu has for that purpose.

182
 
 

Seems like an answer to products like TeslaFi and Teslamate

183
 
 

Unlike other browser-based x86 emulators, OSes running inside v86 can actually access internet via a transparent proxy relay. You can load your own OS images, or choose one from a pretty comprehensive list (Arch Linux, Windows 1.01 to 2000, SerenityOS, *BSD, Android 1.6, Haiku, QNX, and so on).

The VM images are loaded in stages, so it boots fast. When you run a program or code that's not loaded yet, it'll fetch the image and perform a JIT compilation of x86 code to wasm. The delay when fetching additional images and performing JIT compilation is noticeable, but the program run fast afterward considering this is a full x86 emulator running entirely within a web browser.

184
 
 

I am excited to share what I have been working on as a Software Engineer Intern at Leaning Technologies. At Leaning Technologies, we create WebAssembly solutions to help businesses transition from native to modern Web Applications.

My primary project was to overhaul the company's previous profiling workflow. The blog post dives into profiling web applications, how I developed a new custom profiling workflow, and what I learned and discovered while doing so. It was an incredibly fun and challenging project, and I even discovered a small bug in the Linux Kernel source code while working on it! I also assembled a collection of useful tools and information in a GitHub repository, which is linked in the post. Feel free to check it out!

185
 
 

Hey Beehaw!

I've recently received a copy of Physically Based Rendering 4th edition. I've been going through the book slowly, but have had a hard time retaining information. I used to use markdown to take extensive notes, but found that I would end up copying too much useless information. Also, writing latex notes for math is painfully slow.

I was wondering what note taking methodologies you all use. I think my ideal note taking method would fulfill three criteria:

  1. Minimal note-taking overhead: Doesn't take too much time to create notes. (Esp for complex math expressions)
  2. Easy to reference: The notes should be brief and easy to comprehend at a glance. They should also be searchable.
  3. Easy to store: Minimal physical presence. I tend to lose papers all the time.
186
 
 

Hello! I've been a hobbyist programmer for a couple years, and now I want to turn this hobby into my day job. I find Android a fascinating platform so I've started my learning path. Google search, pointed me to google developer codelabs, and they pretty fun!

However, I'm getting a little stuck, and am looking for a community of android developers. I'm avoiding Twitter and Reddit at all costs, but a lot of resources have pointed me there, any other places I should check out, or learning resources other then Google themselves? For context, I'm learning Jetpack compose with Kotlin and Android Studio.

187
 
 

cross-posted from: https://kbin.social/m/kbinStyles/t/109271

kbin-mod-options

Description

The purpose of this script is to allow mods to more easily implement settings.

Functionality

Header

kmoAddHeader(<modName>, <{author: 'name', version: 'versionNumber', license: 'licenseType', url: 'modUrl'}>);

  • modName - required
  • info object - optional

Example

kmoAddHeader(
    'kbin-mod-options examples',
    {
        author: 'Ori',
        version: '0.1',
        license: 'MIT',
        url: 'https://github.com/Oricul'
    }
);

Header Example

Toggle Switch

kmoAddToggle(<settingLabel>, <settingValue>, <settingDescription>);

  • settingLabel - required
  • settingValue - required
  • settingDescription - optional

Example

// Create toggle switch
const settingEnabled = kmoAddToggle(
    'Enabled',
    true,
    'Turns this mod on or off.'
);
// Listen for toggle
settingEnabled.addEventListener("click", () => {
    // Log enabled state to console.
    console.log( kmoGetToggle(settingEnabled) );
});

Toggle Switch Example

Drop-Down

kmoAddDropDown(<settingLabel>, <[{name: 'friendlyName', value: 'backendValue'},{name: 'friendlyNameTwo', value: 'backendValueTwo'}]>, <currentSetting>, <settingDescription>);

  • settingLabel - required
  • options array - required
  • name/value in options array - required
  • currentSetting - required
  • settingDescription - optional

Example

// Create drop down
const font = kmoAddDropDown(
    'Font',
    [
        {
            name: 'Arial',
            value: 'font-arial'
        },{
            name: 'Consolas',
            value: 'font-consolas'
        }
    ],
    'font-consolas',
    'Choose a font for kbin.'
);
// Listen for drop down change
font.addEventListener("change", () => {
    // Log drop down selection to console.
    console.log( kmoGetDropDown(font) );
});

Drop-Down Example

Button

kmoAddButton(<settingLabel>, <buttonLabel>, <settingDescription>);

  • settingLabel - required
  • buttonLabel - required
  • settingDescription - optional

Example

// Create button const
const resetButton = kmoAddButton(
    'Default Settings',
    'Reset',
    'Resets settings to defaults.'
);
// Listen for button press.
resetButton.addEventListener("click", () => {
    // Log press to console.
    console.log( 'button pressed!' );
});

Button Example

Color Dropper

kmoAddColorDropper(<settingLabel>, <currentColor>, <settingDescription>);

  • settingLabel - required
  • currentColor - required
  • settingDescription - optional

Example

// Create color dropper const
const primaryColor = kmoAddColorDropper(
    'Primary Color',
    '#0ff',
    'Select primary theme color'
);
// Listen for new color change
primaryColor.addEventListener("change", () => {
    // Log color selection out to console.
    console.log( primaryColor.value );
});

Color Dropper Example

Usage

Simply add kbin-mod-options to your script's requires.

// @require    https://github.com/Oricul/kbin-scripts/raw/main/kbin-mod-options.js

Example

// ==UserScript==
// @name         kbin-mod-options-dev
// @namespace    https://github.com/Oricul
// @version      0.1
// @description  Attempt at standardizing mod options.
// @author       0rito
// @license      MIT
// @match        https://kbin.social/*
// @icon         https://kbin.social/favicon.svg
// @grant        none
// @require      https://github.com/Oricul/kbin-scripts/raw/main/kbin-mod-options.js
// ==/UserScript==

(function() {
    'use strict';

    // Section header - kmoAddHeader(<modName>, {author: 'name', version: 'versionNumber', license: 'licenseType', url: 'modUrl'});
    // modName - required, author - optional, version - optional, license - optional, url - optional
    kmoAddHeader(
        'kbin-mod-options examples',
        {
            author: 'Ori',
            version: '0.1',
            license: 'MIT',
            url: 'https://github.com/Oricul'
        }
    );
    // Toggle switch - kmoAddToggle(<settingLabel>, <settingValue>, <settingDescription>);
    // settingLabel - required, settingValue - required, settingDescription - optional
    const settingOne = kmoAddToggle(
        'Enabled',
        true,
        'Turn this mod on or off.'
    );
    // Listener for toggle switch - kmoGetToggle(<toggleSwitchVar>);
    // toggleSwitchVar - required
    settingOne.addEventListener("click", () => {
            console.log(kmoGetToggle(settingOne));
    });
    // Dropdown Menu - kmoAddDropDown(<settingLabel>, [{name: 'name', value: 'value'},{name: 'name2', value: 'value2'}], <currentSetting>, <settingDescription>);
    // settingLabel - required, name & value - required, currentSetting - required, settingDescription - optional
    const settingTwo = kmoAddDropDown(
        'Font',
        [
            {
                name: 'Arial',
                value: 'font-arial'
            },{
                name: 'Consolas',
                value: 'font-consolas'
            }
        ],
        'font-consolas',
        'Choose a site-wide font.');
    // Listener for dropdown menu - kmoGetDropDown(<dropDownVar>);
    // dropDownVar - required
    settingTwo.addEventListener("change", () => {
        console.log(kmoGetDropDown(settingTwo));
    });
    // Button - kmoAddButton(<settingLabel>, <buttonLabel>, <settingDescription>);
    // settingLabel - required, buttonLabel - required, settingDescription - optional
    const settingThree = kmoAddButton(
        'Default Settings',
        'Reset',
        'Resets settings to defaults.'
    );
    // Listener example for buttons.
    settingThree.addEventListener("click", () => {
        console.log('button pressed');
    });
    // Color Dropper - kmoAddColorDropper(<settingLabel>, <currentColor>, <settingDescription>);
    // settingLabel - required, currentColor - required, settingDescription - optional
    const settingFour = kmoAddColorDropper(
        'Primary Color',
        '#0ff',
        'Select primary color for style.'
    );
    // Listener example for color dropper.
    settingFour.addEventListener("change", () => {
        console.log(settingFour.value);
    });
})();

188
 
 

Recently, I ran out of mobile data on my phone, and I was forced to browse at a significantly reduced speed. It was so slow that it was practically unusable, except for messaging apps. So, I developed a platform in the form of a search engine that allows browsing and accessing information while exchanging a negligible amount of data. This way, even with very slow or unstable connections, it became possible to search something on Google and read content. It can be useful as an emergency search engine. However, I must mention that the project is still in the proof-of-concept stage and has many bugs. Nonetheless, it has already enabled me to browse and search for information several times. I would be curious to hear your feedback, and I would be glad if it proves useful to someone other than myself! Additionally, it's worth mentioning that the visited pages are also accessible offline.

189
 
 

Good explanation of the difference between work efficiency and step efficiency when talking about parallel algorithms.

190
 
 

From a technical and legal standpoint, ignoring ethics and dignity, is there anything preventing us from scripting a scraper that recreates reddit posts in a lemmy instance? Like maybe top 100 posts of the top 50 subreddits, without comments. I think it would help convince people to join, since the major argument for sticking with reddit is that it has more content. Thoughts?

191
 
 

So what good open source game engine sare out there i know about things like godot but are there any others? i keep wanting to make a game but coding just gos right over my head but still i want to mak eone. it dosent help how my pc is low-end-ish (8gb of ram, windows 10, nvidia 1030 card).

im not even sure how to code or if there is a more visaul way to make games, i would prefer 2d btw becasue it seems easyier for beginner. im not even sure why i want to make a game but i just do maybe becasue im a nerd-ish and it give sme a goal/hobby.

also please share anything you feel is needed aswell and remeber im bascily a absolute beginner who dreams way too big.

192
 
 

Rust adoption at Google:

over 1,000 Google developers ... have authored and committed Rust code as some part of their work in 2022

The learning curve might not be as steep as often said:

More than 2/3 of respondents are confident in contributing to a Rust codebase within two months or less when learning Rust. Further, a third of respondents become as productive using Rust as other languages in two months or less

193
194
 
 

what is the best way to learn C ? I know basic python but would like to learn C, I tried searching online but couldn't find a good resource that's good for a beginner like me. any suggestions ?

195
196
 
 

There’s nothing like a good hands-on to understand what your tools are doing under the hood.

Also, the author admitted that he used ChatGPT to help write this. In his words:

Yep, I do use GPT as one of the tools in my workflow. I write these blogs in markdown locally and have a helper script which takes the raw content and with a prompt it helps me generate a title, summary, Intro and conclusion (personal preference to keep these consistent on all blogs) and proofread the whole raw content for any mistakes (replaces grammarly completely now).

Quite happy with this workflow because it helps me publish articles more frequently where I don't have to worry about stuff other than just dumping my thoughts in raw format.

It’s similar to how I use Astro as a tool to generate static pages from these markdown files to easily deploy on web or TailwindCSS etc etc you get the point.

197
 
 

cross-posted from: https://programming.dev/post/246221

Folks in this group would be well aware of various cloud load-balancers. Today I would like to introduce LoxiLB.

LoxiLB is a modern open source cloud-native load-balancer which uses goLang and eBPF tech provided by the Linux kernel. It's architecture and offerings makes it fast and flexible compared to others.

Check out this link to know what makes LoxiLB different from others:

Other resources:

Feel free to explore and give it a try!!!

198
 
 

I'm looking to get a lemmy bot figured out for posting sports scores in real-time (or near it) like Reddit had for NHL games. The lemmy api reference states that rust has the api as a loadable library, but I've only ever done C/C++ and python. Anything Coursera style to get a basic overview of how to get started in Rust?

I did also see lemmy-bot but it looks like it doesn't handle post editing at the moment, and not sure i really want to learn how to use npm to be honest.

199
 
 

Hey, folks! My son (currently 15) is interested in getting into game development. He's taken a class in Python in school and enjoyed it, but I know Python won't be enough. I don't think he's interested in ever making big, AAA games, but more along the lines of Undertale (which was made in Game Maker Studio) or Bug Fables (Unity).

There are just so many choices and so much content out there that I don't know where to start. Do you have any suggestions for which language(s) to learn or software (like Game Maker Studio) that you've found helpful? Thanks!

200
view more: ‹ prev next ›