[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 315
Thread images: 41

File: dpt.png (1MB, 1052x1342px) Image search: [Google]
dpt.png
1MB, 1052x1342px
What are you working on, /g/?

Previous thread: >>60084350
>>
>>60088699
First for D
>>
File: 1489145174130.gif (2MB, 500x400px) Image search: [Google]
1489145174130.gif
2MB, 500x400px
Realistically speaking, should I be adding I/O to my language at all?
>>
>>60088752
Realistically speaking you're retarded.
>>
Rust is a fantastic, modern compiled cross-platform programming language :)
>>
>>60088471
turing machines don't use quantum mechanics
>>
File: 1493082541188.png (108KB, 512x512px) Image search: [Google]
1493082541188.png
108KB, 512x512px
What are some good Books/Resources for learning HLSL?

I have literally no experience with it

I already know c++ and c# but would rather use c++ if it relates
>>
>>60088763
This
>>
>>60088752
why is she hitting herself??
>>
File: instructions.png (14KB, 498x354px) Image search: [Google]
instructions.png
14KB, 498x354px
>>60088699
Testing my cpu.
>>
>>60088786
Implement this https://github.com/ForwardCom/manual
>>
File: 1478756493135.gif (704KB, 600x337px) Image search: [Google]
1478756493135.gif
704KB, 600x337px
>>60088763
>>60088777
Why would you say such a thing?
>>60088782
I think she might be mildly autistic.
>>
>>60088773

I don't know about HLSL but for GLSL the OpenGL superbible is pretty nice
>>
>>60088699
How to get ideas for programming projects?
I am a CS student and I know I should build up a github for employers, but I have no fucking idea what to make.
I usually finish projects in class faster/more efficiently than my peers, but I have no creativity. Guess that means I definitely should not start my own company.
>>
>>60088833

Make a vidya game. It's pretty fun.
>>
File: 1473977534286.jpg (777KB, 1920x1080px) Image search: [Google]
1473977534286.jpg
777KB, 1920x1080px
>>60088766
I love rust too. Started playing with it yesterday. "The Rust essentials" book is a nice short introduction.

I like that Visual Studio Code has a god tier plugin for Rust too. Although I kinda miss their lack of syntax checking in the plugin.
Overall, it's quite nice.
>>
>>60088846
vs code + Racer is nice and i've seen cool configs for cargo integration
>>
File: mips.png (90KB, 735x918px) Image search: [Google]
mips.png
90KB, 735x918px
59 MIPS, watch out 68040.
>>
>>60088883
The VS code official plugin works fine though. The Only thing I miss is automatic syntax checking. VIm has it, but project management in Vim is very counter productive.
>>
>>60089005
oh sorry, didn't realize you said vs code, I was talking about the official pluggin
>>
>>60088752

A programming language that can only produce two kinds of programs -- empty programs and infinite loops -- is fairly useless. You should add I/O so that you can generate actual computer programs, rather than just some busy machines that crunch numbers and then throw the result on the floor.
>>
>>60088699

In way in over my head trying to port this html5 everywhere IceCat add-on to webExtensions.

I'm emailing RMS and I don't have the heart to tell him "no"

He asked me to because I made him the McDonald's add-on he asked for on his website
>>
@60089285
>A programming language that can only produce two kinds of programs -- empty programs and infinite loops
I don't recall posting the formal semantics of my language.
>generate actual computer programs
What the hell is an "actual" computer program?
>crunch numbers and then throw the result on the floor
An empty program can't do that, and an infinite loop "throwing results on the floor" would be a self-contradiction.
>>
>>60089359
"programs are proofs" aspie detected
>>
>>60089376
What were you going to mean by this?
>>
> haskell

oh ya I want it on my pu$$y
>>
>>60089359
What makes you think anyone is even going to read your whole post if you can't even reply to others normally?
>>
I have more fun doing low-level programming. Am i autistic?

Literally everyone I know hates it.
>>
>>60088699
i started studying pthreads. this is my first program
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void *add_elem(void *line)
{
int *line_pointer = (int *)line;
int accum = 0;
for(int i = 0;i < 3;i++)
accum += *(line_pointer+i);
*line_pointer = accum;
pthread_exit(NULL);
}

int main(void)
{
pthread_t thread;
int matrix[2][3];
matrix[0][0] = 1;
matrix[0][1] = 2;
matrix[0][2] = 3;
matrix[1][0] = 1;
matrix[1][1] = 1;
matrix[1][2] = 1;
int rc;
rc = pthread_create(&thread, NULL, add_elem, &matrix[1]);
if(rc) {
printf("ERROR; return code from pthread_create() is %i\n", rc);
return -1;
}
int *line = matrix[0];
int accum = 0;
for(int i = 0;i < 3;i++)
accum += *(line+i);
*line = accum;
if(pthread_join(thread, NULL)) {
printf("error joining thread\n");
return -1;
}
printf("line 1: %i\nline 2: %i\n\n", matrix[0][0], matrix[1][0]);
pthread_exit(NULL);
return 0;
}

it sums line 0 and 1 and puts the result on the first element of each line.
if i wanted to return accum instead of putting in the first element, how would i do that? how can i get the return value?
>>
So I want to create an APP

Do I begin with learning bineary?
>>
>>60089402
My whole post is meant for a single subhuman, nobody else has to read it.
>>
File: 1437497521042.jpg (60KB, 1280x720px) Image search: [Google]
1437497521042.jpg
60KB, 1280x720px
/g/ cool kids club checklist

[x] hate OOP
[x] hate IDEs
[x] use only Haskell
[x] never produce actually useful software (this is important)
[x] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)
>>
>>60089527
>[x] hate OOP
>[x] hate IDEs
>[x] use only Haskell
>[x] never produce actually useful software (this is important)
>[] wear knee socks
>[] tiling window manager
>[x] dark-like-my-soul customized colors
>[x] hate popular Linux distributions (because too intelligent for them)
>>
[x] hate OOP
[x] hate IDEs
[ ] use only Haskell
[x] never produce actually useful software (this is important)
[ ] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)

The funny thing is that I'm a CS freshman.
>>
>>60089558
then soon you'll be wearing knee socks like the rest of us
>>
>>60089573
I want to dress like a girl too.
>>
File: 1478364584179.gif (137KB, 340x340px) Image search: [Google]
1478364584179.gif
137KB, 340x340px
[x] hate OOP
[x] hate IDEs
[] use only Haskell
[x] never produce actually useful software (this is important)
[x] wear knee socks
[x] tiling window manager
[] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)
>>
>>60089527
[] hate OOP
[] hate IDEs
[] use only Haskell
[x] never produce actually useful software (this is important)
[] wear knee socks
[] tiling window manager
[x] dark-like-my-soul customized colors
[] hate popular Linux distributions (because too intelligent for them)
I don't really hate or like anything. I am not cool.
>>
>>60089411
it isn't elegant but make a struct with two elements: one being the address of the segment of the matrix you want to operate on, the other being an int.
>>
Can you allocate a struct on the stack?
>>
>>60089678
http://lmgtfy.com/?iie=1&q=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3DCan%2Byou%2Ballocate%2Ba%2Bstruct%2Bon%2Bthe%2Bstack%253F%26ie%3Dutf-8%26oe%3Dutf-8
>>
>>60089678
Simply impossible
>>
>>60089678
Yes, why couldn't you?
>>
>>60089670
that's a viable option. i can use a global variable for the thread function as well(i think so). i think your solution is more elegant than using a global variable.
>>
>>60089527
[x] hate IDEs

im a C++17 dev who uses macOS, vim, and YCM

im pretty boring
>>
File: Screenshot_20170426-180153~2.png (244KB, 1080x1373px) Image search: [Google]
Screenshot_20170426-180153~2.png
244KB, 1080x1373px
>>60089699
Enlightening stuff
>>
>>60089734
Apologies
http://lmgtfy.com/?iie=1&q=Can+you+allocate+a+struct+on+the+stack%3F
>>
>>60089678
Of course not.
>>
def makingChange(denoms, amount):
optimums = {}
optimums[0] = 0
optimums[1] = 1 # to make change for 1 cent, use a single 1 cent coin
coinCounts = {}
coinCounts[0] = []
coinCounts[1] = [1]
for i in range(2, amount+1):
next = [i-x for x in denoms if i-x >= 0]
bnext = next[0]
for j in next:
if optimums[j] < optimums[bnext]: bnext = j
optimums[i] = optimums[bnext]+1
oldList = list(coinCounts[bnext])
oldList.append(i-bnext)
coinCounts[i] = oldList

return coinCounts[amount]

for i in range(1, 101):
print(i, " : ", makingChange([1,5,10,25], i))


i felt productive today. i think i may try to implement the solution to one dynamic programming challenge every day until i feel comfortable with it, and then i'll switch to learning about stuff like red black trees and other data structures i don't know enough about.

what do you guys thi nk about that idea?
>>
>>60089527

[ ] hate OOP
[x] hate IDEs
[ ] use only Haskell
[x] never produce actually useful software (this is important)
[ ] wear knee socks
[ ] tiling window manager
[x] dark-like-my-soul customized colors
[ ] hate popular Linux distributions (because too intelligent for them)

I use C++ and Ruby for the most part, wear crew socks, and use Ubuntu.
>>
>>60089734
lul
>>
>>60089527
>[_] hate OOP
>[x] hate IDEs
>[_] use only Haskell
>[made a website for a guy once] never produce actually useful software (this is important)
>[x] wear knee socks
>[_] tiling window manager
>[x] dark-like-my-soul customized colors
>[_] hate popular Linux distributions (because too intelligent for them)
>>
>>60089527
[] hate OOP
[] hate IDEs
[] use only Haskell
[] never produce actually useful software (this is important)
[] wear knee socks
[] tiling window manager
[x] dark-like-my-soul customized colors
[] hate popular Linux distributions (because too intelligent for them)
>>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>>60089806
>[ ] wear knee socks
No lying.
>>
>>60089796
great idea. i'm also doing programming challenges everyday. the cormen book "introduction to algorithms" gives a nice view about RB trees, dynamic programming and complexity. i suggest you take a look! good luck and keep practicing!
>>
>>60089806
BROTHER
>>
Reminder that OOP has literally zero mathematical theory or rationale behind it.
>>
File: IMG_20170426_100242_015.jpg (1MB, 4160x3120px) Image search: [Google]
IMG_20170426_100242_015.jpg
1MB, 4160x3120px
Does this look like a good answer?
f: addi $sp, $sp, -4
sw Sra, 0($sp)
jal func
add $aO, $vO
add $al, $at, $a3
jal func
lw $ra, 0($sp)
addi $sp, $sp, 4
jr $ra
>>
>>60089891
Reminder that by making this post you have guaranteed some absolute fucking retard, who survives his day to day life by pretending the people who come up with the algorithms they use, the languages they write, and the computers they use, aren't academics and don't have masters; or at least dropped out which somehow discounts them from that, will reply with

>muh useless academia
>>
File: 1480793786841.png (576KB, 960x933px) Image search: [Google]
1480793786841.png
576KB, 960x933px
New to rust here. Why is it not printing stuff before read_line? What am I doing wrong?
use std::io;

fn main() {
print!("What's your name?");
let mut string_input = String::new();
io::stdin()
.read_line(&mut string_input)
.expect("Invalid input");
let user_name: &str = string_input.trim();

print!("Great, what's your age?");
let mut string_input_2 = String::new();
io::stdin()
.read_line(&mut string_input_2)
.expect("Invalid input");
let user_age: i8 = string_input_2.trim().parse().expect("Can't parse age");

println!("Hello, {}({}).", user_name, user_age);
}
>>
>>60089979
What's a cute anime girl like you doing in a place like this?
>>
>>60089894
pls halp
>>
>>60089979
4chan is fucking terrible with image formats, not supporting apng, or vp9.
>>
>>60090051
how the fuck does this work
>>
>>60089979
https://doc.rust-lang.org/std/io/trait.Write.html#tymethod.flush
>>
>>60089979
Because buffering.
>>
>>60090061
layers
>>
>>60090078
>>60090068
Can you guys give me a quick rundown of buffer and flush etc? How are they related to I/O streams?
>>
>>60089527
>[] hate OOP
>[] hate IDEs
>[] use only Haskell
>[] never produce actually useful software (this is important)
>[] wear knee socks
>[x] tiling window manager
>[x] dark-like-my-soul customized colors
>[] hate popular Linux distributions (because too intelligent for them)
>>
I'm practicing Java or Jawa as pajeet would call it.

What program should I write to test my profiency?
>>
>>60090057
apng is a meme, and the the VP9 ABI isn't stable (1.5 broke back compatibility with all previous generations).
>>
>>60090133
p
a
j
e
e
t
>>
>>60090134
make a game
>>
>>60090134
Make a lisp and ditch java
>>
>>60090143
still shit that it doesn't support either
>>
>>60090159
Like a text-based game?
>>
>>60090164
No i wanna make fart apps so i can make big money
>>
>>60090166
Don't get me wrong, I'd love VP9 support, but you'd then be stuck in a hell of broken support or enforcing a specific library version (which is too much for most people). In any case it's too much work and worry for the site ops.
>>
>>60090113
Writing single characters or whatever at a time to a file is extremely inefficient, so they are buffered and only get written to the file when the buffer is full, or you explicitly flush it.
stdout is typically line-buffered, which means that it will write to the buffer when it encounters a newline character. You didn't write a newline, so it didn't get flushed.
If you're ever going to write something that you want to be displayed immediately and you haven't printed a newline character, you have to explicitly flush it.
None of this is Rust specific. Basically every language does it like this.
>>
>>60090205
>write to the buffer when it encounters a newline character
flush the buffer when it encounters a newline character*
>>
>>60089979
see >>60090068
>>60090113
see https://www.youtube.com/watch?v=dSsukh8EdWk
Note that the print!() macro doesn't flush input, println!() does
>>
>>60090224
>not flush()ng
Have you ever used Ioo before, pajeet?
>>
>>60090230
>>>/global/rules/6
>>
I unironically want to be a little girl.
With programming socks, and be a LISP and C master.
>>
>>60090243
It was a double pun of the highest quality
>>
>>60090224
>fflush(stdin);
Non-portable microsoft-only shit.
>>
>>60090061
I don't know i got it from Chegg because i couldn't understand it.
>>
>>60090265
>C is a "portable" assembly guise
>>
>>60090244
>programming socks
What did she mean by this?
>>
>>60090282
You are a fucking idiot.
>>
>>60090244
And I want to make you sit on my lap while we program together. What do you say?
>>
>>60090282
kek
>>
>>60090143
>meme
>>>/v/
>>
>>60088752
I read that as "Realistically spanking..."
>>
>he calls hashes dicts
>>
>>60088752

It should be able to write to memory
>>
>>60089891
muh proofs!111!!1 1 1 one
>>
>>60090361
no one calls hashes dicts. some people call hash tables dicts.
>calling hash tables hashes
>>
>>60090309
S-Sure.
>>
>>60090402
>typing an extra word
>>
File: 1490305042940.jpg (134KB, 844x720px) Image search: [Google]
1490305042940.jpg
134KB, 844x720px
>>60090409
>>
At what volume are association lists unacceptable.
>>
>>60090422
i want to cummy on her tummy!!
>>
>>60090436
When n is about 10^6 or 10^7 if you're infrequently searching it. If you have to do anymore than log(n) searches on this list it will be noticeably slow at those ranges.
>>
is effective stl and more effective c++ still worth reading? they are old as fuck
>>
whats a good youtube channel for c# guides?
>>
>>60089891
OOP is based on category theory since it has objects.
>>
>>60088833
A lot of programming projects come in the form of automating something the programmer does a lot. For example perhaps writing a script that automatically downloads and converts YouTube videos added by a certain user, and uploads them to a server.
So find something you do a lot, and see if you can figure out how to automate it.
>>
anyone know if sys.stdin.isatty() works on the windows version of python?
id like my script to be cross platform.
>>
>>60090416
it'd be different if hashes weren't a thing, but they are. hashes are used in hash tables, hashes aren't hash tables
>>
>>60090658
automating shitposting
>>
>>60089527
>[] hate OOP
>[/] hate IDEs
>[] use only Haskell
>[x] never produce actually useful software (this is important)
>[] wear knee socks
>[x] tiling window manager
>[x] dark-like-my-soul customized colors
>[/] hate popular Linux distributions (because too intelligent for them)
>>
>>60090692
What the fuck is "/"?
>>
>>60089527
I hate popular linux distributions, but it is because I hate linux as a whole
>>
>>60090692
You're retarded alright.
Omitting the ones you don't apply will give out as much informationa s including it with a "/"
>>
Someone post lolicons.
>>
hating ides is a meme
>>
how can i get python to connect to my purevpn account?
>>
>>60090687
Automated pasta poster
>>
>>60090734
If people don't code on ide. What do they use? Bash?
>>
>>60090687
i unironically wrote this already
>>
>>60090701
Partial
It's literally half an X come on think about it.
>>
>>60090687
Good idea. I could use a script that automatically replies "kys" to a random comment.
>>
>>60090740
terminal
>>
is there anyway to do a non-blocking check of stdin in python without using the threading module?
>>
>>60090740
Vim/emacs.
Sublime/Atom if they hate themself.
>>
>>60088752
That depends, do you intend for the language to be useful?
>>
>>60090759
For what purpose?
>>
>>60090658
This is true.
I'm not even a programmer, but i've written dozens of scripts that help me do my job faster.
>>
>>60090773
Gets the bitches wet
>>
>>60090785
what if I'm not into bitches?
>>
>>60090797
then your a gay faggot and you need to fuck off
>>
>>60090797
Stick with your IDE then
>>
>>60090759
>>60090785
A couple months ago I spent all day writing code in a food court while I was on the road. A little kid thought it was fascinating and asked her mom what I was doing. The mom hurried her along and told her not to look at me.
Nobody over the age of 7 thinks using a terminal is cool.
>>
>>60090830
That is not cause you were coding. That was cause you were sporting the school shooter look.
>>
File: 1480616865437.jpg (224KB, 1280x720px) Image search: [Google]
1480616865437.jpg
224KB, 1280x720px
>>60089527
>>
>>60090805
so those two are mutually exclusive?
>[] hate IDEs
>[] wear knee socks
>>
>>60090850
I was shaved and showered and wearing a shirt and tie. Nice try, though.
>>
>>60090830
if you cant understand the reason why coding in a terminal is better than an IDE then you need to stop being in high school
>>
>>60090883
Must be the pedo vibe then.
>>
is a bachelors in cs worthless? the entire degree is googleable
>>
>>60090906
Yes. Join the military instead.
>>
>>60090906
Almost all degrees are google-able.
I am not sure what you can't google about, EE, ME, CE or even medicine.
>>
>>60090890
wow man you're so cool I'll walk with you during the break
>>
>>60090962
You can't google doctor.
>>
>>60090770
Useful for whom?
Any language is useful in the abstract.
>>
>>60090981
you can't google software developer
>>
>>60091043
>make a web-crawler in python
>put in github
>respond to a job posting
>??????
>prophet
>>
>>60091083
>make shitty project
>put on github
>someone with a degree gets hired instead
>??????
>woah!
>>
>everyone bitching about inane bullshit
>no one actually working on anything
>>
>>60091100
>CS bachelor getting hired
o i am laffin
Job market is saturated with boot camp retards.
Plus, CS doesn't teach you how to program. It teaches you about time complexity and algorithms, which aren't really needed seeing as the important algorithms are already implemented in the base libraries of any language.
>>
>>60091174
t. community college dropout
>>
>>60091191
I'm still in community college.
>>
>>60091174
CS is not important for every day tech. High performance software is where it may shine, but at that point a Math degree with programming will go much farther and allow you to solve much more interesting problems.

t. CS grad who wishes he did math instead.
>>
>>60091280
>a Math degree with programming
What do you mean? Having a math degree and being able to program?
>>
>>60091305
Meant to say math degree with programming skills. Fuck I need some coffee.
>>
>>60090830
Cool story, I'll remember to look at programming as a fashion statement from now on
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that D-chan is not dead, and she's super duper cute! Say something nice about her, anons!
>>
Are PIC microprocessors still relevant? Would an employer be impressed if I did a project with one? Or is everyone using Arduinos?
>>
>be in a 'group' for school which is supposed to do homework together and then a project
>they help with the first homework and then after that nothing
>I do all the homeworks and then put their name on it
>w/e maybe they are doing it and then just not texting me about it or w/e
>project time rolls around
>suddenly they have my number again
>i already finished the project so i dont need them

HAHA TIME TO THROW PEOPLE UNDER THE BUS
>>
>>60091426
I work closely with embedded product developers. They all like PIC and don't care about AVR (what Arduino uses).
>>
File: 1490668798302.jpg (102KB, 400x240px) Image search: [Google]
1490668798302.jpg
102KB, 400x240px
>>60089527
[x] hate OOP (Dislike would be a better word)
[_] hate IDEs
[_] use only Haskell
[x] never produce actually useful software (this is important)
[x] wear knee socks (I wear leggings)
[_] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)
>>
>>60091445
Nice. My school's Intro to Embedded Systems class uses Arduinos, but in trade school I used a PIC32. I always thought Arduinos were kind of hobbyist, but was questioning myself since my uni seems to be all about them.
>>
>>60090244
We're all lolis in /dpt/
>>
>The compiler technology for the Intel X86 architecture is basically as good as it gets because a huge effort by compiler designers (Microsoft) finally made it as efficient as RISC.

Book I'm reading said this. What did Microsoft have to gain by doing this?
>>
>>60091500
Arduinos are a project by the Illuminati and you should honestly steer clear of them if you don't want the universe to flux. I heard of one guy who got holes drilled in his brain stem.
>>
>>60091444
What are you talking about? Is this from some story?
>>
>>60091522
its the story of my life this semester for one of my classes
>>
>>60091531
But did someone write it down or say it?
>>
File: 1492824462366.jpg (22KB, 240x320px) Image search: [Google]
1492824462366.jpg
22KB, 240x320px
I'm buying a microcontroller to fuck around with. MIPS or AVR?
>>
>>60088772
Quantum Turing machines do.
>>
>>60091516
Thanks for the tip.
>>60091567
Obviously MIPS.
>>
>>60091551
I wrote it
>>
Whats the go-to php book? I have to learn this shit for school this semester and i dont wanna just do shitty codeacademy courses
>>
>>60091567
If you don't have extreme lower power consumption in mind (i.e in the micro amp range), or just enjoy the limitation of 8 or 16 bit, go with 32 bit arm m0-m3 (depending on need).
>>
File: sleepy-chan.png (483KB, 507x561px) Image search: [Google]
sleepy-chan.png
483KB, 507x561px
>>60091648
>Obviously MIPS.
Thought so

>>60091878
My budget is around ~$50, but thanks
>>
>>60091899
>My budget is around ~$50, but thanks
Cortex M0s are around ~5$, and supporting electronics is not more than a few bucks as well.
You can definitely throw together a board for way under $50.
>>
>>60091936
Not him, but I wanted to get into this as well. What supporting electronics do you mean?
>>
>>60091936
But you have to buy that shit in bulk, or at least that's what I found.
>>
>>60091964
Crystal, some decoupling caps, some form of power circuit (unless you intend to just have some fixed 3.3 or 5V brick), and whatever else you intend on driving or taking input from, some bjts and fets, lcd display, buttons, etc.
All of these are still pennies to a dollar.
>>
what are the five languages every good programmer should know/master?
>>
>>60092051
1. your favorite imperative
2. your favorite functional
3. ASM

all you need 2bh
>>
>>60092097
One of those can actually make you money though. dlang is cute though.
>>
sqrt(num)

or
sqrt( num )
>>
>>60092289
sqrt num
>>
>>60092289
>>60092306
num.sqrt

desu
>>
>>60092289
std::pow(num, 0.5);
>>
>>60092289
>wasting precious column space
why

>>60092312
go back to twitter, tard
>>
>>60092312
>>60092315
Fucking garbage.
Kill your own selves immediately.
>>
>>60092324
>twitter
?
>>60092328
num.sqrt
is objectively the cleanest though.
>>
>>60092289
function sqrt(double a)
{
double sum = 0;
double ds = 0.00001;
int max = 10000;
for(int n=0;n<max;n++)
{
double s = n * ds;
sum += exp(-x*s);
}
return 2 * 1.77/sum;
>>
Why do people complain about a lack of stackoverflow™ help for a language? Are they retarded? 99% of these peoples questions can be answered by reading a book or it's language agnostic.
>>
>>60092377
Please don't post worst girl. Thanks.

>>60092394
There was once a time when RTFM was a thing; that time is dead.
>>
File: idiot_mio.jpg (110KB, 670x437px) Image search: [Google]
idiot_mio.jpg
110KB, 670x437px
>>60092377
Should be 1/2 * 1.77 / sum at the end there and I forgot to close the bracket.
>fuck
>>
>>60092401
No.
>>60092403
And it should be -x*s^2 in the exponential holy shit I'm retarded.
>>
>>60092430
>No.
She's figuratively gave me cancer, anon. Please don't exacerbate it.
>>
>>60092472
Shes' very pretty and is a good girl.
>>
>>60092497
Bull-fucking-shit. What did she put in your drink, anon?
>>
>>60092394
A coworker complained about me using Ada for a section of our code base because it's "old and poorly documented". Fuck you, just because you have to read a book and can't literally code using Ctrl-C anymore doesn't make it poorly documented.
>>
File: c sharp hearthstone card.jpg (187KB, 653x628px) Image search: [Google]
c sharp hearthstone card.jpg
187KB, 653x628px
make a card for your favorite language
http://www.hearthcards.net/
>>
>>60092497
I would have her shot and thrown into a ditch.
>>
>after 2h thinking about how to solve a hacker rank problem, I finally realise I'm too stupid to do it
kill me
>>
>>60092543
>tfw can't rewrite missile guidance systems in rust
>>
>>60092558
It's ok if it's rated hard or expert. Otherwise, ya, you should feel bad.
>>
>>60092556
Is that it? I would have done concrete girl 2.0 on her.
>>
File: gentoo.png (328KB, 400x543px) Image search: [Google]
gentoo.png
328KB, 400x543px
>>60092551
>>
File: Master_Blacksmith_(1).png (130KB, 528x694px) Image search: [Google]
Master_Blacksmith_(1).png
130KB, 528x694px
>Working on my Senior Project
>The team is presenting tomorrow
>The past 36 hours has been all hands on deck implementing final changes, updates, bugfixes
>been playing Bon Jovi and Train all day
>Realize I've never had this much fun before

Is this what it's like in the industry? It's a rush. I can't wait to graduate.

pic related, I feel like a motherfucking digital blacksmith right now
>>
File: 1489703537699.png (438KB, 569x486px) Image search: [Google]
1489703537699.png
438KB, 569x486px
>>60088773
You're going to want to go over some general graphics programming theory. OpenGL/D3D are not like libcurl where you can just jump right in.
Well, you can jump right in, but you won't get very far that is.
Read Computer Graphics: Principles and Practice.
If you're a hard core motherfucker then read Real-Time Rendering by Akenine-Möller.
>>
>>60092572
They don't use dynamic memory, so there would be virtually no point.
>>
>>60092673
Good for you, anon, but
>been playing Bon Jovi and Train all day
I'd advise you to get better taste. (Not a /mu/fag either)
>>
>>60092543
What was the project?
>>
File: stallman.jpg (322KB, 492x564px) Image search: [Google]
stallman.jpg
322KB, 492x564px
>>60092615
>>60092551
>>
File: pajeet.png (323KB, 400x543px) Image search: [Google]
pajeet.png
323KB, 400x543px
>>60092714
>>60092615
>>60092551
i like this game
>>
>>60092615
>>60092714
>>60092774
>This gay "legally distinct" magic clone
>>
>>60092774
>i like this game
the game i am speaking of is the creative way to use /g/ memes in the cards.
never played hearthcards (or magic or yugio or pokemon or any of the others).
>>
how do I learn algorithms like bfs, dfs, etc.? is there any good book?
I know what they do, but I don't know how to implement them in code
>>
>>60092875
>code
Ask here:
>>>/g/wdg/
>>
>>60092710
Non of your business, but I used Ada because tasking is an order of magnitude better in it than C or C++.
>>
>>60092885
sorry anon, I don't know your memes
>>
>>60085213
I fucking hate this.
Just because you work with C doesn't mean you know about optimizations. The problem is generally not the calls themselves (although for cases where you do operator overloaded functions it will be) but the constraints having the compiler restrict itself by calling your function to do the transform.

Inlining is regarded as one of the primary optimizations compilers do because having inlined something implies so many other optimizations. Not having inlined something implies a lot of optimizations missing.

Why do programmers so often feel justified in speaking outside their expertise? Nobody who just 'writes C' should ever consider themselves performance experts of any form before they've at least profiled their code.

The example I posted turned out to be a 2x speed improvement. After further investigation where a call to the standards floor wasn't inlined it was all in all more than a 10x improvement. Yet this motherfucker likes to speak out his ass and claim its nothing.

Fucking hate you. Your kind is why my OS takes as long to boot today as it did in 1995.
>>
>>60092710
My organization's TRANF* stack. Ada was clearly the only logical choice.
*Totally Real And Not Fictional
>>
>>60092714
Stop spamming /dpt/.
These are only tangentially related to programming. I'd take the long essay on dealing with the Chinese that anon posted here a few threads back over this shit.
It's actually more related since it deals with development and adversity of a form.
>>
>>60092875
How you implement them is up to you. There's millions of implementations for the popular ones floating around if you want to grab them.
https://en.m.wikibooks.org/wiki/Algorithm_Implementation
I like this one.

But for implementing an algorithm you just put what it describes to you into code. Then you improve it if possible.
>>
>>60092953
maybe you are right in what you say,
but you ought not have said it as it was a wasted post due to it not being programming related.

however, by talking about a dpt topic down here, it's a nice loophole.

for example:
despite you all hating OOP, that fact is that OOP is what runs our modern world.
sure, you have specialized cases where you may need to write binary instructions for some scientific equipment or something. but for the vast majority of consumer products, OOP = win.
>>
>>60093036
Anon you're not framing the OOP-discussion you're trying to start here in a way that facilitates discussion. At the very least you could start with the leading question 'If OOP is so bad then why does everyone do it?'.
And there's plenty of ideas surrounding that.

Also your idea of non-OOP suitable cases indicates that you don't have much experience with regards to OOP and its alternatives. Which makes arguing with you like explaining science to someone who believes everything is random. It's a lot of frustrating work. And you probably won't gain anything from it.
>>
>>60092939
I was under the impression thatif you're using GCC, you can be using Ada or even FORTRAN with basically no effort.
>>
>>60092289
(sqrt num)
>>
File: you.png (350KB, 400x543px) Image search: [Google]
you.png
350KB, 400x543px
>>60093072
>>
>>60088699
messing around trying to write a gnome extension. shittiest documentation ever
>>
File: 1455055538322.jpg (11KB, 261x260px) Image search: [Google]
1455055538322.jpg
11KB, 261x260px
>>60093235
>shittiest documentation ever
It really is pure shit, isn't it?
>>
File: truly_free.png (35KB, 753x241px) Image search: [Google]
truly_free.png
35KB, 753x241px
>>60093137
>>
File: 1489377126242.gif (499KB, 500x514px) Image search: [Google]
1489377126242.gif
499KB, 500x514px
What type does anime have?
>>
>>60093539
cute
>>
>>60093539
>>60093539
> typeof loli_jy
> sex machine
> typeof loli_js
> bully victim
>>
>>60091426
Because Arduino is a processor
>Wtf?
>>
>>60092691
What? Rust only protects you in case of dynamically allocated memory? Sounds unreal and useless.
>>
>>60093276
Truly.

>We choose JavaScript for productivity and simplicity
>But you have to rely on C APIs, and use our own interpreter that we drastically change with every release
>>
>>60093726
I swear. Programming is one of those things that just cripple a lot of people's sanity when they do it.
>>
>>60093792
It's an area that's filled with bikeshedding, we'll make the best god damn settings window you've ever seen but everything else will be sphagetti.
>>
>>60093792
>>60093812
Gotta appease the plebs.
>>
What are some jobs that make you use c++?
>>
Writing a DOS clone that will be fully compatible with every DOS program. It will also run in big unreal mode so I can cram some other data and filesystem stuff up in the higher megabytes.
>>
>>60093896
Yes of course. Same with any language that isn't haskell.
Haskell is useless so nobody can be employed for long using it. Certainly not long enough to hire someone else to program in it.
>>
>>60093897
Cool. Is it on github or somewhere online?
>>
>>60094032
Not yet, but once I finish the bootloader it will be.
>>
>>60093539
C is trash
>>
>>60093539
It has not type but can be rid of with runtime.GC().
>>
How do I insert a " / " between these 2 numbers on this string?
Ruby
freem = `free -m`
puts freem.match(/cache:(.+)/)[1]

output:
root@0ef8493f8fdc:/workspace# ruby test.rb
490 3472
>>
>>60094390
Actually, any regex that gets me the first set of digits only? been googling but no luck
>>
>>60094403
RTFM about ruby regexes and try to understand. Don't google "how do I split free -m output with regexes" because even on Niggerflow people object to so much spoonfeeding.
>>
>>60094460
prove it
>>
>>60089527
[] hate OOP
I don't "hate" it, but moderation is required in everything. If anything, I dislike the fixation with "patterns" some people have and some awful practices people do. Nothing's wrong with some concepts of OOP themselves. That said, I mostly try to write my code in a pure way where it is applicable.
[] hate IDEs
I don't know what I would've done in the >500k lines of code project without VS. Plus, some of its features were very useful, especially profiling ones for native code.
In small personal projects I do use Vim, though.
[] use only Haskell
Come on now
[] never produce actually useful software (this is important)
[] wear knee socks
No socks > all

[] tiling window manager
[] dark-like-my-soul customized colors
[] hate popular Linux distributions (because too intelligent for them)
I use default Debian with KDE. I don't like ricing. Even my wallpaper is default.
>>
File: animes.jpg (251KB, 1280x806px) Image search: [Google]
animes.jpg
251KB, 1280x806px
>>60088699
Has anybody here used Chibi Scheme before?

Basically I want to have a C struct shared between a thread doing output and a thread running some kind of Scheme REPL, which modifies the C struct directly as it pleases. Is that kind thing possible? The documentation is kind of obtuse.
>>
>>60089527
[x] hate OOP
[x] hate IDEs
[] use only Haskell
[x] never produce actually useful software (this is important)
[] wear knee socks
[] tiling window manager
[] dark-like-my-soul customized colors
[] hate popular Linux distributions (because too intelligent for them)

Fuck. Am I a normie?
>>
>>60094829
It's possible, just make your C program and export either variable with pointer to the struct or function that returns pointer to the struct to scheme. Start your thread and the scheme.
>>
File: achnein.jpg (83KB, 1280x720px) Image search: [Google]
achnein.jpg
83KB, 1280x720px
>>60088699
Do you use syntax highlighting /g/?

A while ago I turned it all off because I couldn't find a good color scheme, and I found I never really needed it in the first place. The only time it makes sense is for differentiating comments from code.

Try it out sometime. You might be surprised that you fell for a meme.
>>
>>60094890
i guess you're doing assembly?
>>
>>60094917
C and Lisp

I realized if Ableson could count his parentheses on a chalkboard, then so could I.
>>
>>60094924
Barely, the classic intro video begins with obvious struggle to balance out the parens.
>>
>>60094934
I have trained myself to keep a counter in my head at all times.
>>
>>60094934
My old job was completely unrelated to programming and had me on a locked-down Windows machine, so I'd write my Lisp ideas down on paper while taking phone calls. I gained a sixth sense for parens then.
>>
>>60094829
Why are these girls staring at me?
>>
File: 1480712992863.jpg (134KB, 500x880px) Image search: [Google]
1480712992863.jpg
134KB, 500x880px
>>60089527
>[] hate OOP
>[] hate IDEs
>[] use only Haskell
>[] never produce actually useful software (this is important)
>[] wear knee socks
>[] tiling window manager
>[] dark-like-my-soul customized colors
>[] hate popular Linux distributions (because too intelligent for them)
well
>>
>>60094962
there looking at all your compile time warnings
>>
>>60094973
But I don't get any. I prove my code to be correct before actually giving it to the compiler.
>>
>>60089527
>[x] hate IDEs
why the fuck would anyone hate IDEs?
>>
>>60095013
The most common reason would be not being a retard.
>>
>>60095013
Slow, clunky and lack of customisability for starters.
>>
>>60089527
>[x] hate OOP
>[x] hate IDEs
>[] use only Haskell
>[] never produce actually useful software (this is important)
>[] wear knee socks
>[x] tiling window manager
>[x] dark-like-my-soul customized colors
>[x] hate popular Linux distributions (because too intelligent for them)
>>
Why do Pajeets like Java so much?
>>
At what point can I call myself Code Artisan irl?
>>
>>60095039
>lack of customisability
meaning no option of displaying chinese underage girls in the background? cause other than that they seem pretty fucking customizable to me
>>
>>60095072
>chinese
kys
>>
>>60089527

[] hate OOP - Only when it comes to anything filesystem related
[] hate IDEs - Love my debugger
[] use only Haskell - It's nice, but less practical because nobody on my team knows it
[] never produce actually useful software (this is important) - Job is to automate the jobs of plebs, working out well
[x] wear knee socks - business casual baka
[] tiling window manager
[] dark-like-my-soul customized colors
[] hate popular Linux distributions (because too intelligent for them) - Love me some Debian & redhat, but can do without anything ubuntu based
>>
File: 1475183357592.png (24KB, 251x243px) Image search: [Google]
1475183357592.png
24KB, 251x243px
>tfw web code monkey
How can i escape this hell? Can't even comprehend colleague's code.
>>
>>60095061
After you've memorized Morgo.js

What, you've never heard of Morgo? My Uber for Houseplants has it in its stack. Everybody's using it.
>>
>>60095061
One you know at least 2 popular JS frameworks by name and you have github account. (you don't actually need to know how to program)
>>
>>60095095
cant even comprehend my own code, dont worry about that.
I recommend Python as starting language because it stays useful later on.
Try "how to think like a computer scientist" its a great book
>>
>>60095128
Thanks senpai, i will look into it.
>>
File: 1475021298520.jpg (425KB, 1280x720px) Image search: [Google]
1475021298520.jpg
425KB, 1280x720px
I had the strangest dream last night, where it was revealed that Indians were actually gay aliens from space.
Don't ask why.
>>
>>60095188
Why though?
>>
>>60095206
What part of "Don't ask why." did you not understand?
>>
>>60089527
>[] hate OOP
>[] hate IDEs
>[] use only Haskell
>[x] never produce actually useful software (this is important)
>[x] wear knee socks
>[] tiling window manager
>[x] pink-like-my-boipuccy customized colors
>[x] hate popular Linux distributions (because too intelligent for them)
>>
File: 1487877917844.jpg (225KB, 1920x1080px) Image search: [Google]
1487877917844.jpg
225KB, 1920x1080px
>>60089527
>[~] hate OOP
I don't hate OOP but I prefer procedural. Functional is cancer though.
>[~] hate IDEs
I hate most of them.
>[] use only Haskell
I hate haskell.
>[] never produce actually useful software (this is important)
Made a few tools that are actually useful.
>[] wear knee socks
>not wearing a maid uniform while coding
>[] tiling window manager
forwhatpurpose
>[x] dark-like-my-soul customized colors
My eyes are fucked.
>[] hate popular Linux distributions (because too intelligent for them)
SUSE-fag here
>>
>>60095222
>I prefer procedural
>a subset of procedural is cancer though
What did she mean by this?
>>
>>60095095
>Can't even comprehend colleague's code.
That's normal though. Nobody ever follows the fucking standards for their language, you'll always end up having to monkey your way through their shit.
>>
>>60095243
>What did she mean by this?
Did you just assume xer gender?
>>
>>60095243
>implying I have to like the whole of something
>>
>>60095296
You said that you like a set, which implies that you like all subsets of it.
If you like just the imperative subset, then you should have said so.
>>
whats a good way to learn algorithms? I passed the class in uni, but I still barely understand most of them. I mean, I can use prerolled ones, and can look up worst cases etc, but I still don't "understand" a lot of them.
>>
>>60089527
No boxes checked for me.

I'm also employed. Might just be a coincidence, though.
>>
>>60088752
make it an embedded language, easily usable from C. Then you don't need I/O and you can piggyback on the whole C ecosystem.
>>
Can someone hmu with a torrent for the C programming language book? Amazon wants like £40 for it but I'm a Jew.
>>
>>60095083
>kys
lurk moar or go back to twitter
>>
>>60095287
Yeah, because she made a dumb statement and women are dumb programmers xD get it?
>>
>>60090599
The two best sources for C# videos are the free MVA courses and the Pluralsight courses.

MVA is free, and pretty damn good. You should start there.

You can get like 3 months Pluralsight for free, and even more if you're a student, if I recall correctly.
>>
>>60095334
Embedded in what? In C?
I would like to embed it in a non-shit language, by which I mean non-Turing complete. I guess I could remove loops from C.
>>
>>60095083
maybe you're cartoon girls are vietnamese, i don't give a shit
>>
Is it possible for a function using the cdecl calling convention to have a few pop instructions in it's epilogue after being compiled without any optimizations?
>>
Should I shower everyday?
>>
http://www.wolfram.com/language/

Is this meme?
>>
>>60095473
Yes, but don't user shower gel.
>>
>>60095489
Why? Should I use soap?
>>
>>60095540
It's bad for your skin and unnecessary.
>>
>>60089891
>OOP has literally zero mathematical theory or rationale behind it
... and?
>>
>>60095480
It is robust, scaleable, interactive and has built-in cloud support. Why would this be meme?
>>
>>60095473
No.

The scent enhances the masturbation experience.
>>
>>60095575
>Why would this be meme?
Can't write a kernel in it.
>>
>>60095593
Your point being?
>>
>>60095608
It's shit.
>>
New thread:
>>60095622
>>60095622
>>60095622
>>
>>60095620
Oh ok, cool opinion.
>>
>>60095637
Yeah good luck writing a kernel in Wolfram. lmao.
>>
>>60089527

[?] hate OOP
[x] hate IDEs
[ ] use only Haskell
[ ] never produce actually useful software (this is important)
[x] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)
Thread posts: 315
Thread images: 41


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.