/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

tour.golang.org
golang-book.com
nim-lang.org/docs/tut1.html
howistart.org/posts/nim/1/index.html
nim-by-example.github.io/getting_started/
w3schools.com/php/
businessinsider.com/how-china-went-from-communist-to-capitalist-2015-10
youtube.com/watch?v=GI6_KjmmrSQ
matt.sh/howto-c
wiki.osdev.org/System_V_ABI#x86-64
en.wikipedia.org/wiki/Software_Freedom_Law_Center
twitter.com/AnonBabble

Productivity tips? Currently:

>Having a sleep schedule (rise at 6 and go to bed at 10)
>Alternating between focused-work and rest (60 min for work, 30 min for rest) sessions
>Using Python and Make (free multithreading) for scripts (level generation from image) and C11 (need performance and too much of a brainlet for C++) for the game engine
>Sometimes using physical work (splitting logs) as rest from programming, but longer (90 min session for a full trailer). I think it's working just as well, maybe just as good as good as just resting, but you get perspired so that sucks.
>Reading random excerpts from C11 standard, OpenGL ES 2.0 guidebook, OpenGL ES 2.0 standard, GLSL 1.0 standard on free time when just can't think about programming anymore (it gets too much, maybe I don't like it as much as I thought I did, but it's too late to "search for myself" now, I'm fucking 20 already)
>Using Code::Blocks svn build (much fewer bugs and much faster) and IDLE as IDEs
>Dropped Lua because Python does its job (except for high-performance embedded game-engine scripting, but my little turd is very far from that) and focusing on Python
>Thinking about starting drinking coffee, maybe it improves focusing on code (or maybe I should look into aderall for a real thing?). So far not having any major bad habits (smoking, drinking, drugs) but this one might actually be beneficial.
>Got ~3.5 years to start my own company because then I get my university degree (software engineer) and if I'm not good enough to sell my own shit by then I'm officially a failure
>So far got some primitive matrix/vector math that I'm really using, nothing else, even algorithms (only BFS, DFS, backtracking and shit I have probably re-invented when I needed) in my head, maybe that's enough. Can't wrap head around physics with angular velocity (haven't really tried yet), for know I'm fine with "minecraft-like bit-array using primitive physics", access is O(1)

Read PSP.

yeah physical work/exercise is good

stay hydrated

i drink coffee everyday BUT i would not recommend it unless you need to be focused for a specific activity at a specific time at the cost of getting more tired at other times

Trying to implement fresnel reflections in my c++ raytracer

Pic related is what I have so far, the triangle has a custom glossy BRDF

Learn Go:
tour.golang.org
golang-book.com

what are the best php books out there? i hate php, but if i don't learn it i won't find a job

Learn Nim:
nim-lang.org/docs/tut1.html
howistart.org/posts/nim/1/index.html
nim-by-example.github.io/getting_started/

Rate my abstract Fizzbuzz:
#![feature(conservative_impl_trait, inclusive_range_syntax)]

use std::borrow::Cow;

fn fizzbuzz(until: usize) -> impl Iterator "FizzBuzz".into(),
(0, _) => "Fizz".into(),
(_, 0) => "Buzz".into(),
_ => format!("{}", x).into(),
})
}


fn main() {
for fb in fizzbuzz(100) {
println!("{}", fb);
}
}

Any books that aren't specifically about a programming language but instead are more about more general computation such as algorithms, math (and programming too).

the chinese are better programmers than you and there's hordes of them, and they're cheaper. they're far from unintelligent, they just don't have a creative bone in their body. your webdev job isn't secure

-- if empty, just insert it
insert_last x [] = [x]
-- if not empty, insert it at the end
insert_last x (y : ys) = y : insert_last x ys


Haskell is cute! CUTE!

How do you pronounce clang, /dpt/? Cee-lang? Clang?

Klang

a bunch of Access VBA and SQL

i need a cup of coffee.

WE

Try Sedgewick's Algorithms, Bhargava's Algorithms, Goodrich and Tamassia's Algorithm Design, Ron Rivest et al.'s Introduction to Algorithms, Knuth's The Art of Computer Programming, Kernighan and Pike's The Practice of Programming, Scott's Programming Language Pragmatics, Lang's A First Course in Calculus, Rorres and Anton's Elementary Linear Algebra with Application, Ross' Probability Models for Computer Science, Wiley and Wilson's Much about Calculus, Lax's Calculus with Applications and Computing.

What esoteric programming language is this?

You asked this in the other thread already

It's, may Allah forgive me for uttering such a word, Rust

a good chinese programmer is going to move to a first world country or stay in china at a high tech company and take a large salary, the ones that would do outsourcing work for cheap would be the uneducated and malnourished peasants

you get what you pay for, as is very well aware of, you naive summer fuck

What's the best statically typed, compiled and portable language for general purpose stuff and interfacing with?

fuck

Just use the W3Schools tutorial:
w3schools.com/php/

>No generics
>Productivity

No. Mastering C++ makes you the most productive, because it's the most versatile language. It can literally do everything.

sicp and hacker's delight

that's not true, though. the cost of living in china is much lower, and there's plenty of code monkeys who are quantitatively smarter than the average american coder. it doesn't pay much because creativity isn't valued there, so all of them do boring jobs like programming even if they don't like it. in america, generally only people who are drawn to programming do it. everything you say is fueled by emotion and what you want to be true

Pascal

ok have fun outsourcing your website to the chinks

c++
haxe

Who here working on machine learning implementations on any of their projects?

i'm not the one outsourcing anything. why are you angry at me? i'm just telling you the truth. there will still probably be web dev jobs, but it's going to be dealing with designing the website & requirements, maintaining, and testing the code written by other people. knowing a couple programming languages doesn't make you invaluable in the long term

R8 mine:
interface FizzBuzzable {
public int value();
public String doFizzBuzz();
}
final class FizzBuzzableNumber implements FizzBuzzable {
private final int num;
public FizzBuzzableNumber(int n) { this.num = n; }
public final int value() { return this.num; }
public final String doFizzBuzz() { return new Integer(this.num).toString(); }
}
abstract class DivisibleNumber implements FizzBuzzable {
protected final FizzBuzzable original;
public DivisibleNumber(FizzBuzzable origin) { this.original = origin; }
public final int value() { return this.original.value(); }
public final String doFizzBuzz() {
String fizzBuzzed;
if (this.isDivisible()) fizzBuzzed = this.fizzBuzzing();
else fizzBuzzed = this.original.doFizzBuzz();
return fizzBuzzed;
}
protected abstract boolean isDivisible();
protected abstract String fizzBuzzing();
}
final class NumberDivisibleByThree extends DivisibleNumber {
public NumberDivisibleByThree(FizzBuzzable origin) { super(origin); }
protected final String fizzBuzzing() { return "Fizz"; }
protected final boolean isDivisible() { return ((this.value() % 3) == 0); }
}
final class NumberDivisibleByFive extends DivisibleNumber {
public NumberDivisibleByFive(FizzBuzzable origin) { super(origin); }
protected final String fizzBuzzing() { return "Buzz"; }
protected final boolean isDivisible() { return ((this.value() % 5) == 0); }
}
final class NumberDivisibleByThreeAndFive extends DivisibleNumber {
public NumberDivisibleByThreeAndFive (FizzBuzzable origin) { super(origin); }
protected final String fizzBuzzing() { return "Fizz Buzz"; }
protected final boolean isDivisible() { return ((this.value() % 15) == 0); }
}

public class Main {
public static void main(String[] args) {
for (int i = 1; i

You're hired!

>i'm not the one outsourcing anything
ok have fun sharing your deep insight with us

Communists do better work because labor is appropriately valued in a Communist society.

the chinese aren't communists, they will gladly do the bare minimum that would be considered a website, and charge you more than it's worth

the best person to ask for an unbiased assessment of the future of an industry is surely someone who's just starting a career in that industry

you're naive like a child, you think a chinese slave laborer can do as good of a job in a high tech industry as an educated first-worlder

Yes they are, you dumb faggot.

ENTERPRISE CODE!

businessinsider.com/how-china-went-from-communist-to-capitalist-2015-10

fuck off clueless antifa scum

Also don't jerk off.

>businessinsider dawt cawm
>he actually thinks that's a credible source about foreign political economy
kek

why, it's like 10 mins/days max if you're not too picky

you're going to get unmasked fag

you don't know much about china, watch the last half or so of this video
youtube.com/watch?v=GI6_KjmmrSQ

programming isn't a special, super difficult job which only white people with a 4 year degree can do well. ESPECIALLY web or app development. small children can learn how to do both of those proficiently, let alone chinese people who have to learn college level calculus and trigonometry in high school to pass their university admission exam

As opposed to?

LOL stay delusional

What website is that? I don't pointlessly march in the streets to get political shit done. I'm a dagger in the dark kinda guy, not one of the thousand swords at dawn.

You fags' problem is that you thought that we were playing chess.

...

Not really, but little pussies like you won't ever understand real politics. You still believe that Trump was your victory.

...

test

test

Do you have any more tired memes to share kiddo?

test

sicp

...

Hey Sup Forums

I want to learn to program. Thinking about c# or java. Which of those should I pick?

D

between those 2? C#

C# is a better language but .NET core isn't very mature yet, so cross-platform support is limited unless you use something like Mono.

...you joke but there is a reason enterprise code is heavily layered and abstracted.

Anyone experience with CCXT crypto lib?
Or bittrex api?

Currently fetching data from bittrex and another exchange and very often run into urlopen timeouts, suspecting the api server are just overloaded but some other experience would be good

do i really have to use the stdint.h types

Yes.

matt.sh/howto-c

seconded

time to go back to /r/programmingcirclejerk with your nogenerics lulz

...

t. buttplasted gopher

Sup Forums I have about one month before my first C/assembly class, which in my university is taught by a very hard grading, cunt teacher.

What is the best video tutorials I can go for C, pointers, etc. that can help me go through the class more easily? I have time. Thanks!

Just fucking go for it and if you have questions go to /sqt/. C isn't a hard language, it's just error prone if you're inexperienced.

Should I use GPLv3 or AGPLv3 for a library?

Disassembling my mobo BIOS^WUEFI

You may as well not release it if you're going to use a shitty cuck license.

The Art of Computer Programming

anyone familiar with using glibc in assembly can tell me how to fix this segfaulting?
; Source name : BOILER.ASM
; Executable name : BOILER -- though this isn't intended to be run!
; Version : 2.0
; Created date : 10/1/1999
; Last update : 5/26/2009
; Author : Jeff Duntemann
; Description : A "skeleton" program in assembly for Linux, using NASM 2.05,
; demonstrating the necessary code to preserve and restore EBP, EBX, ESI,
; and EDI. The program does nothing and is provided as boilerplate for
; assembly projects that link to functions written in C.
;

[SECTION .data] ; Section containing initialised data
StartMsg: db "Start",0

[SECTION .bss] ; Section containing uninitialized data


[SECTION .text] ; Section containing code
extern puts
global main ; Required so linker can find entry point

main:
push rbp ; Set up stack frame for debugger
mov rbp,rsp
push rbx ; Program must preserve ebp, ebx, esi, & edi
push rsi
push rdi
;;; Everything before this is boilerplate; use it for all ordinary apps!
push StartMsg
call puts
pop rax
;;; Everything after this is boilerplate; use it for all ordinary apps!
pop rdi ; Restore saved registers
pop rsi
pop rbx
mov rsp,rbp ; Destroy stack frame before returning
pop rbp
ret ; Return control to Linux


i stepped through with gdb and it gets to call puts fine. this is my makefile
timer: timer.o
gcc -o timer timer.o
timer.o: timer.asm
nasm -f elf64 -g timer.asm


i'm really fond of this assembly book i'm going thorugh, but he uses 32 bit and i can't find anything about this online. all the results are people trying to compile glibc binaries. i'm on the final chapter of the book

>shitty cuck license
>waaahhh I can't just take it for free and sell it in a proprietary product

You are absolutely delusional if you think big corporations give even the slightest fuck about your license. If your code is public, it's getting stolen. The chinks in particular give zero fucks.

The abi for x86_64 is different then x86, you can't just replace e with r. Parameters get passed in registers not on the stack.

wiki.osdev.org/System_V_ABI#x86-64

I got SDL to draw an Ulam spiral.

keen eyes will notice that the pattern is mirrored & inverted, this is because I'm dyslexic...

do you have anything i can read about it?

>some people will try to steal your work
>so you shouldn't even bother trying to discourage it or give yourself a chance of legal recourse
what am I even reading

cool, thanks!

alexy pls

i wonder how hard programming actually is for dyslexics

why is there no real open-source alternative to ida
radare2 is awful

easier than for the blind and harder than for those with normal vision i assume

then help improve it

I'd prefer to start from scratch

If your goal is for lots of people to use your library then GPL actively harms it as many people do not want to use poorly licensed code that infringes on their freedom.

this

do you think so many game devs would be using ogg if it was GPL? no, they wouldn't

>b-b-but a P-PROPRIETARY program might u-use it!! m-m-muh free s-software!!!

good shit user

If you want to use software I wrote in a proprietary product then pay me.

no thanks, i'll just take it anyway

en.wikipedia.org/wiki/Software_Freedom_Law_Center