/dpt/ - Daily Programming Thread

No language holy wars edition.

Previous Thread: What are you working on Sup Forums?

Other urls found in this thread:

gnu.org/software/gforth/)
tldp.org/LDP/Bash-Beginners-Guide/html/intro_02.html
doc.rust-lang.org/std/thread/struct.ThreadId.html
github.com/jamwt/libtask
swtch.com/libtask/
edx.org/micromasters/software-development
twitter.com/NSFWRedditVideo

Is it true? What am I missing?

>teach_me_cpp_senpai.
learncpp.com

Is this a decent or should I go with a book

That's the most modern C++ resource I found online

Fuck sepples. Use C.

Why is it that if I do:
${var: -1} using sh script.sh, it gives me shit, but not when I use ./script.sh?

Where do I learn the theory and on how to master the most important Scheme constructs such as continuations or define-syntax or force, delay?

Programming on a tablet.

Last night i had a dream where i was programming a new OS on my laptop at school (during a break).
I had TempelOS running in a VM for some reason, but i did all my programming
in vim (or some vim-like editor). All was going well, but then some of my
classmates showed up and asked wtf i was doing and was i using LINUX.
The time around me stopped when i heard the word LINUX. image of RMS
flashed in my mind and i heard the words of the Holy Interjection echoing in my ears.
Then i had autistic meltdown, and i yelled: "IT'S CALLED GNU + LINUX".
Then i told that i am programming a new OS in GNU Forth. (gnu.org/software/gforth/)

After this i woke up.

So /dpt/, how do i learn to program (hobbyist) OS?

Is there something like visual studio for html and javascript?
I used to do them i notepad++ but after tasting the godlike combination which is visual studio and c#, going back to notepad++ was like going back to eating rancid shit after eating delicious cakes for years

nigga why

should I learn bash?
I'm still learning C and i'm a noob
but I have basic proficiency using linux (intermediate cli usage)

>should I learn bash?
ye

Fuck C. Use Rust.

You just need to create a kernel, or adapt the minix one like linus did, and then slap gnu tools on top of it and there you go, an OS

>should I learn bash?
It's decently useful to know, especially for automating some shit you might do, but it fucking sucks for writing anything complicated.

> What is bash?

>rust

Based Rust.

${var: -1} is a bashism, and your /bin/sh probably doesn't support it.
I would guess that you're using Debian/Ubuntu, and your /bin/sh is dash.

yeah I know I think it's the next step after you learn basic cli shit and what a shell is
I'm gonna start with this guide
tldp.org/LDP/Bash-Beginners-Guide/html/intro_02.html

should I read the man bash before or after?

>lol

I'm pretty excited. Next week we're going to be starting the process for open sourcing the three different tools I've made for Kafka/Elasticsearch automation & monitoring.

Nice!

That's the sepples philosophy. If it's broke, add another feature to fix it.

Clearly fake.
Are you stupid?

I'm learning C and I can't seem to find an open source project that I could grasp entirely

any suggestions?
How and when did you start contributing to open source projects?

what are good resources about kernels/os design?
i already got Modern Operating Systems 2nd ed. and Operating Systems: Design and Implementation 3rd ed.

Did you guys even read the OP?
>No language holy wars edition.
You have to wait until the next thread to start a language holy war.

Is there a way in Rust to constrain access to resource to a single thread so that calling any methods on it from a different thread would panic?

Most "real" open source projects are large and complicated, and can take weeks, or even months for someone to get familiar with; even experienced programmers.
Don't expect to be making large changes to anything. Start with trivial shit, and over time you will become more familiar with the code (also, the other developers will trust you more), and then you can start working towards more substantial changes.

>Is it true? What am I missing?
It isn't. There's a fuckton of older hardware or even just shitty recent hardware that doesn't support Vulkan. Browsers don't support it. Most mobile devices don't support it. If you want anything remotely close-platform that can run on non-gaming PCs, stick to OpenGL.

not legal

>editions in /dpt/
This thread should have been deleted already, dumb fuck.

Use this?
doc.rust-lang.org/std/thread/struct.ThreadId.html

There are no 'editions', fuckface.
In fact, there should be no extraneous text in the OP at all. It's not your personal shitposting space.

ok thanks for the tip

>doc.rust-lang.org/std/thread/struct.ThreadId.html
That would be part of the solution, I guess, but what I really need is some kind of a proxy object that does the check automatically before calling a method on the proxied resource. I really don't want to have to manually add this check to every call.

Which utility library to use with C: glib, tbox, qlibc, klib, apr or something else?
Also thread pool or coroutine library like qthreads?

I get the intention is to make fun of how Americans can't speak, but why not call it sepplespples?

It helps if the project's issue tracker has anything marked as 'easy', but not everybody does that.
Also, if the project has an IRC channel or something, it would be in your best interest to join it.

to every method*

qthreads are cancer compared to the standard library alternatives.

Utility (bloat) libraries are completely unnecessary, especially trash like glib.
I refuse to use glib (or any dependency that pulls it in) in any of my programs.

Haven't though about this too hard, but how about wrapping the resource in an opaque struct and performing the thread id check inside an Deref impl?

I'm think the auto-deref on method calls would call your custom implementation. I may be quite off with this idea, don't really do too much complex rust shenanigans.

>wrapping the resource in an opaque struct and performing the thread id check inside an Deref impl
Sounds like a good idea, actually. Thanks, user.

Use Libtask for coroutines.
github.com/jamwt/libtask

swtch.com/libtask/

Just use the console and debugger built into browsers like Firefox or Chrome?

I always liken programming books to secret martial arts manuals.

That is for debugging not developing, what are you even doing in this thread you fucking normie?

>Libtask gives the programmer the illusion of threads, but the operating system sees only a single kernel thread.
no

>secret martial arts """manuals"""
Something that a typical virgin programmer would say

>he uses notepad to code
>"what are you even doing in this thread you fucking normie?"
Kek

Just tested this out with an example. Works as I initially thought. Here it is if it is of help:

struct UniqueThread {
id: usize
}

impl UniqueThread {
fn is_same_thread(&self) -> bool {
self.id == 0
}

fn func1(&self) -> u32 {
0
}

fn func2(&self) -> u32 {
3
}
}

struct UniqueThreadWrapper(UniqueThread);

impl ::std::ops::Deref for UniqueThreadWrapper {
type Target = UniqueThread;

fn deref(&self) -> &Self::Target {
if !self.0.is_same_thread() {
panic!("this wasn't the same thread!");
} else {
println!("checking thread before use!");
&self.0
}
}
}

fn main() {
let a = UniqueThreadWrapper(UniqueThread { id: 0 });

assert_eq!(a.func1(), 0);
assert_eq!(a.func2(), 3);

let b = UniqueThreadWrapper(UniqueThread {id: 1 });
assert_eq!(b.func1(), 0);
}


Get the expected output:

checking thread before use!
checking thread before use!
thread 'main' panicked at 'this wasn't the same thread!', src/main.rs:26:12
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Give me your best FizzBuzz /dpt/

#include
#include
#include

#define Oo 100ULL
#define __(oo,oO)\
for (o=(Oo*(oo)>>(oO));o>(oO)))OO ++[O]

int _o(const void *o, const void *O) { return
((*(uint64_t*)o) >> 48) > (uint64_t)(*((char*)O + 6)) ;}

int main(void)
{
uint64_t oo, oO, o, O [Oo * 0x1bbbbbbbd4 >> 36], OO = 0;

__(0x3e0f83e1ull, 35) = (o 060; oo =o;
while (!(oO^ (o [O])) && (o [O]&16711680))
printf("%s", (char*)&o ++[O]);
printf(!(o ^oo) ? "%s\n" : "\n", (char*)&o [O]);
} return

0;
}

Something's not quite right here

Lots of text editors have plugins to add support for stuff like that. But you could try atom or vs code if you're lazy. They're more bloated than text editors but they should have good support for html and js by default.

dummy, of course you aren't using the right platform! what do you think I write, portable c?

I don't get how you rustfags can stand that ugly syntax.

>bloat
that word means nothing to me, after trimming the visual studio 17 install down to only required components the install size was 22GB.
Literally any other editor no matter how bloated will seem super slim to me.

Just found out that Computer Science doesn't count as engineering, so I'm not actually graduating as engineer

so far my script can reverse or crack
>binary
>hexdecimal
>ROT
>base64
>md5
>sha1
>sha256
>sha512

what else should I add?

AES-256

What year are you from exactly and when did the leap to quantum computing occur? Does Trump actually manage to build a wall?

will do
uses wordlists

const fizzBuzz = (function(){
const _Fizz = "Fizz";
const _Buzz = "Buzz";
const _FizzBuzz = _Fizz + _Buzz;
return function fizzBuzz(limit = 100) {
for (let i = 1; i

Anyone knows a good CS MOOC? I tried CS50x but using Scratch is not really what I wanted.. I wanted something like C or Python.

edx.org/micromasters/software-development

what is the name of this anime pls ?

thanks

But does it store the results to speed up later searches?

Whats a way to only do something if the string is an exact match in python? currently using if "x" in choice but that doesn't need and exact match only 1 match

going to make a text editor that i plan to use while programming

"abc" == "abc"

bitch lasagna

>senior dev
>mysql
kek

>crack sha256/512
You can literally be a millionaire right now

see

>Head of HR
>50 dollarydoos/hour

Even if it wasn't fake, they would have run themselves into the ground before a court date could be set.

he thinks using a reverse table is cracking. the guy never heard about salted hashes and it does say a lot about his skills.

Please consult google with green threads/fibers/userland threads vs kernel threads

What terminal?
>nobody made one with sprintf and digit sum checks

reminder that go programmers are intellectual dwarves

>picking on an easy target

It's your civil duty to stamp out any attempt of adopting go.

Go is better than its alternatives.

I have to choose my own topic for my databases course project
gimme some neat ideas of databases nothing too big or tough though ;3

it attempts using salt after going through the wordlist once

go fuck yourself

Gitlab, bitbucket or github? or something else?

make a torrent indexer

Learning an ALGOL derivative as a first language causes brain damage.

i use gitlab but I'm not a serious developer

Haha you just started a new thread fucking yourself

what made you choose it?

I learned fucking JSP as my first language, followed by C++. Can confirm, learning scala and haskell made me very intimate with my own brain-damage

github doesn't offer free private repositories and bitbucket didn't have the word git in its name