[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: 328
Thread images: 35

File: coders.png (439KB, 810x456px) Image search: [Google]
coders.png
439KB, 810x456px
What are you working on, /g/?

Previous thread: >>61550100
>>
Imagine C++ but good
>>
Kill yourself mudslime.
>>
>>61556266
What editor is that?
>>
>>61556270
Just keep calm and code on, anon.
>>
File: 1497150233764.jpg (109KB, 588x647px) Image search: [Google]
1497150233764.jpg
109KB, 588x647px
>>61556270
>>
>>61556268
Rust?
>>
what do I need to do next in this crazy github command line thing to make it so that I can do githubs to my repo?

i wanted to clone
> git clone [email protected]:xxxxx/project31.git projectDirectory

I could not clone. I got a permission error.
I went online and they said.
To make sure you are connecting to the right domain, you can enter the following command...
so I got pic related.

The instructions I was following didn't tell me what to do if I found an issue.
I'm still searching. just posting this here to maximize speed.
gotta code fast
>>
>>61556268
Java?
>>
>What are you working on, /g/?
Holy Rust
>>
>>61556291
>>61556300
both of those have completely different design goals and strengths
>>
>>61556300
t. pajeet
>>
>>61556304
eh Im learning it, it's not too bad, just needs a better book 2bh
>>
Reminder that C# is the best language and once cross-platform .NET mature it will liberate us from electron cancer for cross-platform software
>>
>>61556326
Slower than Java
>>
>be IT undergrad
>please use emacs blahblah
>yeah no, use sublime
>meh
>try Atom
>puke
>back to Sublime with extra plugins, megameh
>eventually install VSCode with extra plugins
it's fucking wonderful
would why anyone fucking use anything but VSCode
>>
>>61556338
eh, VS Code can't have multiple instances of windows, can it?
>>
>>61556299
Replied to you in the old thread.
>>
>>61556268
D?
>>
>>61556326
Since there will never be an official cross-platform .NET GUI, that's not going to happen. Unfortunately.
>>
>>61556338
Glad you found the light lad.
>>
>>61556299
add your public key to your account, or just use the https clone url
>>
>>61556321
What resource do you use for Rust?
>>
>>61556338
I don't know, I've been using VSC myself for a while. I even submitted some patches that I thought would be convenient for me but had a slim chance to get in but I was wrong and they got accepted.

>>61556346
Control-Shift-N?
>>
>>61556338
>would why anyone fucking use anything but VSCode
Because not everyone enjoys choking on cock.
>>
>>61556346
it can but theres no reason to, you can have multiple editor groups.
>>
>>61556333
Java doesn't even have real arrays
>>
>>61556348
But it has GC.
inb4 100 post-long shitstorm about @nogc
>>
>>61556348
good try but no
>>
>>61556366
Rust essentials
>>
>>61556376
int shit[0] is not an array? (serious question)
>>
>>61556381
Enjoy wasting your time with pointless memory management.
>>
>>61556392
I tried setting up Rust on VSC but I'm too retarded to set up any programming language on Atom based editors. I don't get all these .js config files.
>>
>>61556400
>I need to be handheld even at the most basic things
Haha
>>
File: very crappy sensor logging code.jpg (469KB, 1080x1920px) Image search: [Google]
very crappy sensor logging code.jpg
469KB, 1080x1920px
>>61556338
can you move that left hand activity bar thingy to the top yet?
>>
>>61556393
int[] is a real array, but because all object types in Java are reference types, an Object[] is just an array of pointers. Completely shits up up your cache locality. An array of structs in C# really is an array.

>>61556400
Even ignoring the argument about whether GC is good or bad, D's GC is one of the worst GCs out there. Worse than Go's for sure.
>>
>>61556415
>memory management
>basic
Tell me more about how C and C++ developers still haven't gotten such a "basic" thing right.
>>
>>61556423
D's garbage collector is the most modern out there. Stay mad, hater.

>>61556415
So your time is worth nothing?

Not surprised.
>>
>>61556338
Probably the most unreasonably hated piece of software on /g/, because Microsoft memes.

It's virtually perfect in every way, and it's FOSS. Definitely my go-to now.
>>
>>61556460
>stop the world
>modern
>>
>>61556272
Looks like Atom
>>
>>61556467
Only thing i still cant figure out are key macros.
Anyway to make caps lock type "->"?
>>
>>61556460
Every programming language is going to have its share of shitters. Memory management really is basic. This is not down to personal opinion, it's pure fact. It's not my problem that brainlets fuck it up.
>>
>>61556392
Is that book up to date with the latest Rust features?
>>
What's a good book for learning Perl? I already know how to program, so I don't need a book with a thousand pages or so.
>>
>>61556338
>Microsoft advertising on 4chan of all places


kek
>>
>>61556481
A world of buffer overflows begs to differ, newfriend.
>>
>>61556490
>Shilling FOSS software
Oh how the shekels will just roll in from all the linux users on VSC.
>>
>>61556479
There's a macros extension. I haven't tried it, but a coworker mentioned it. Not sure if it's bindable to caps lock.
>>
working on some docker projects.

I have this week off between jobs and begin my new one next monday.
>>
>>61556494
>buffer overflows are memory management
>>
>>61556490
It's FOSS, you dweeb.
>>
>>61556514
Buffer overflows are just the eternal C being the shit that it is.
>>
File: dpt.png (2MB, 3840x2160px) Image search: [Google]
dpt.png
2MB, 3840x2160px
trying my luck.
>>
>>61556502
>>61556515
https://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish
>>
>>61556546
Quite literally not an argument.
>>
Anon that caused a shitstorm because he dislikes the rust book here, is there a good resource on learning modern and idiomatic C++?
>>
>>61556508
Well capslock is a recognizable key, and i looked into the marcos extension but for the command section when making a macro, only mentions commands like editor stuff, and i couldnt find if it supports key actions.

When i get to the command section
"key": "capslock"
"command": "???"
>>
>>61556546
How can it be applied to a FOSS project that originates from MS? That makes no sense.
>>
>>61556531
But they are nothing to do with deallocation of unused memory, which is the purpose of GC, the original topic of the discussion.
C++ and Rust have their own answers to that question.
>>
>>61556546
>he still lives in 90s
Have you seen the new season of Friends? It's radical!
>>
>>61556546
Its FOSS, so its literally not an argument.
Anyone can strip out anything they dont like and even rename it if they want.
>>
>>61556268
C#.
>>
>>61556568
Clearly, Microsoft is just waiting to instantly delete every repository of VS Code on the entire internet all at the same time without warning, and then hold the world hostage by threatening not to update VS Code any more without a monthly license fee.
>>
>>61556583
This, but only in certain situations.

C# is not a directly replacement for C++, but far surpasses it in usability and toolset for a huge portion of things people traditionally built in C++. At the end of the day, C++ has the ability to be faster, so it still has its uses.
>>
>>61556583
>Garbage collected with mandatory runtime and interpreter
nah
>>
What's the output? (No Compiling (aka cheating))

One:

#include<stdio.h>
#include<stdlib.h>
int main(){
for (size_t i = 9; i <= 9; --i) printf("%zu ", i);
}


Two:

#include<stdio.h>
#include<stdlib.h>
int main(){
for (size_t i = 9; i >= 0; --i) printf("%zu ", i);
}
>>
>>61556546
Reminder that Microsoft did nothing wrong, that's just the free market.
>>
>>61556605
>>61556602
I C# because i live in a Visual Studio
>>
>>61556532
rawling
>>
>>61556605
Those are all good things, anon.
>>
>>61556619
Someone linked this in a chat I was on.

You have to go back.
>>
>>61556635
>Someone linked this in a chat I was on.
so?

>You have to go back.
i saw this sentence yesterday.

you have to go back
>>
>>61556609
>
%zu ",

what the fuck formatting does that print
>>
>>61556629
Whether they are good or bad depends on what you need to do.
>>
>>61556609
one: nothing
two: 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
correct?
>>
>>61556646
It's for
size_t
>>
>>61556658
nope.
>>
>>61556658
wrong
>>
>>61556609
At first I thought you were using size_t to do something tricky, but it looks like you're using the proper format specifier for it in printf. So in the first case it should go from 9 to 0, underflow, and stop, and in the second case it should loop forever, starting from 9, going to 0, and underflowing to the platform-dependent maximum of size_t and then all the way back down to 0 etc.
>>
>>61556690
ding ding ding

1000000 internet points to you, sire.
>>
>>61556682
>>61556685
oh apparently size_t is unsigned, but I still don't see why the first one would be wrong, shouldn't it not loop at all since the condition already fails before the first iteration?
>>
>>61556717
So why did you use size_t instead of some normal unsigned type?

>>61556720
In the first iteration of the first loop, i is 9 and the condition is "i <= 9" which is true. You might have missed the "or equal to" part of the "less than or equal to"
>>
>>61556720
>>61556741
>So why did you use size_t instead of some normal unsigned type?
..............fun?
>>
>>61556741
>In the first iteration of the first loop, i is 9 and the condition is "i <= 9" which is true. You might have missed the "or equal to" part of the "less than or equal to"
oh my...
>>
>just slapping together pieces of other code until it compiles
anyone else know this feel?
>>
>>61556835
No because thats not a productive way to program.
>>
>>61556835
Yes. It's a really shitty feeling. I have learned to avoid it altogether.
>>
>>61556835
No because my code always compiles correctly
>>
>>61556835
Yes.
t. Pajeet
>>
>>61556835
I only programmed this way when I first learned programming, by myself, at home and I was somewhere in the 12-14 year old age range.

I learned NOT to do this very quickly.

Seriously, just understand what your trying to do, that's all there is to it.
>>
File: 1428780772552.jpg (22KB, 380x286px) Image search: [Google]
1428780772552.jpg
22KB, 380x286px
>>61556933
>>
What's the most fun programming language?
>>
>>61556979
so it will crash and kill itself at run time
>>
>>61556985
C#
>>
File: a.webm (3MB, 1024x768px) Image search: [Google]
a.webm
3MB, 1024x768px
>>61556985
javascript
>>
>>61556996
>>61557000
vomitchan.png

>>61556985
C++
>>
>>61557000
>imgui
THAT PIECE OF SHIT
>>
I have an interview coming up for a job where "programming/automation experience is a plus"

I did some hackerrank challenges already for them, they were fairly basic, nothing too weird; 3 problems in an hour and I got like 70-80% of it

any tips? I've never been asked to code on the spot or asked programming-related questions in an interview

what's the best way to prepare? theory of the language? data structures?
any tips are welcome
I mainly know python and bash, and I've dicked about in d3.js but that's besides this job
>>
would it be optimal to develop an API for an OS' GUI in another language, while using C for everything else?
>>
>>61556996
Unironically this.
>>
>>61556985
self bump
Haskell
>>
Anyone know any good resources on writing mining software for crypto? I understand how blockchains work well enough, but there's not a lot of info on implementing miners and mining pools.
>>
mudslimes and niggers not wanted
>>
Are there any good streams or youtube channels where I can just watch people code?
>>
>>61557021
What job did you apply for?
>>
>>61557215
search for code live streams or somethin
>>
>>61557215
handmade hero
>>
>>61557156
Of course not.
>>
File: 3RpBLXK6Bg-8.png (22KB, 300x250px) Image search: [Google]
3RpBLXK6Bg-8.png
22KB, 300x250px
>tfw I dont know what to programm
>>
>>61557268
Automate your chores.
>>
>>61557268
A Javascript neural network program that hides replies from people that post frogs
>>
>>61557268
sudoku solver
>>
>>61557203
Took a look at minerd's source code, the crazy bastards actually wrote implementations of hashing algorithms in assembly for each platform.
>>
>>61556338
>slow
>bloated
>slow
>slow
>ram hog
>have to wait for intellisense to complete
>Find In Files not almost instantaneous
>slow
i'll stick to codelite or codeblocks, either is fine
>>
>>61557363
>sublime
>slow

nigguh pls
>>
>>61556268
C?
>>
>>61557277
ain't got any. It is exam phase.
>>61557278
>javashit
no.
>>61557291
What's the benefit?
>>
>>61557398
>asks for ideas
>no not that
top pleb
>>
>>61557398
>ain't got any. It is exam phase.
Porn search engine
Anime sorter
Music organiser
4chan CLI
...
I can go on for ages
>>
>>61557406
Well, in fact I didn't ask you.
>>
>>61557446
>Anime
>>
>>61557450
>tfw I dont know what to programm
>attention whoring this much

go back to r*ddit for karma points retard
>>
>>61557468
>Auschwitz
>>
>>61557268
Web browser.
or >>61556532

>>61557215
twitch
>>
>>61556321
>Let's take all the most disgusting parts of Haskell, C++, Java, and C and mash them together
>There! It's perfect!
>>
>>61556338
>please use emacs blahblah
>yeah no
How do you expect to get work done remotely on other machines? You have no experience using a command-line editor now.
>>
So I'm making a password manager.

Should I encrypt the passwords usiing gpg or something?
>>
>>61557520
where's the java?
>>
What's the difference between structs in c++ and oop?
>>
>>61557583
I don't understand the question
>>
>>61557595
What is the difference between a struct, with multiple variables, and a class in object oriented programming?
>>
>>61557583
structs are public by default whereas classes are private. Otherwise they're identical.
>>
>>61557575
Calling direct object attributes via the dot operator is very muchso a Java thing when they're not encapsulated.
You can do it in C, but the proper way is Struct->Direct.secondary, because you can't chain dot operators in it.
>>
>>61557604
Struct:
Big box with lots of things in it

Object:
Big box with lots of things in it, and a bunch of tools to help manipulate those things

e.g. Objects have methods inside them, structs are just data containers.
>>
>>61557608
>because you can't chain dot operators in it.
Tell that to my code. I've been doing
foo.bar.baz.array[4]

all over the place.
>>
>>61557220
it's a network engineer job where people automate stuff too

I'm already doing some of that; basically using Python and stuff like Ansible to get data out of various devices, process it, generate configs from templates (I use jinja2) and such
so scripting mainly, not huge projects
>>
>>61557644
Whoa buddy, you need some SAO's in there with a null coalesce on the end.
>>
>>61557604
In C++, there is literal difference between a struct and a class.
As far as the language is concerned, the members of a struct are public by default while a class is private by default. Structs are public-inherited by default and classes are private-inherited by default. Everything else is the same.

You should think of them differently and use them for different purposes. When a C++ programmer sees a struct, he will think it is nothing more than a tuple with named data members. When a C++ programmer sees a struct, he expects some kind of encapsulation and access protection, some member functions, maybe inheritance etc.
>>
File: pm-lee.jpg (53KB, 760x507px) Image search: [Google]
pm-lee.jpg
53KB, 760x507px
>>61557398
>What's the benefit?
Using some neat algorithms to solve a problem. There are several approaches from backtracking, stochastic search (simulated annealing, genetic algos like ant colony optimization), constraint propagation, simplex, you can even try to train a NN to solve sudokus
>>
>>61557664
>In C++, there is little difference between a struct and a class.
>When a C++ programmer sees a class, he expects some kind of encapsulation and access protection, some member functions, maybe inheritance etc.
I'm really bad today
>>
>>61557662
What are you talking about?
>>
>>61557533
I can use vim or sublime over SSH
>>
>>61557533
who the fuck uses command-line text editors in twenty fucking 2017 lmao
>>
>>61557656
I don't think they'll test your programming skills because, like you said, it's a plus.
>>
I kinda want to start making an image editor in my free time. Is it hard?
>>
>>61557656
my bud got asked to solve Sleeping barber problem in bash at a similar job interview
>>
>>61557713
>twenty fucking 2017
:thinking:
>>
>>61557533
But VSC uses the command line.
>>
>>61557558
>>61557558
>>61557558
>>61557558
>>
File: handy_mami.jpg (306KB, 702x985px) Image search: [Google]
handy_mami.jpg
306KB, 702x985px
>>61557698
>I can use vim
>>
>>61557729
pretty sure they will, at least they said so

>>61557772
haven't heard of that so I guess it's good to catch up on typical such problems then
>>
>>61557792
>SHA-256 for password hash
>Advanced Encryption Standard (AES, Rijndael) and the Twofish algorithm
>>
File: jared spurdo.png (41KB, 316x382px) Image search: [Google]
jared spurdo.png
41KB, 316x382px
What are some NON-INANE projects that you have accomplished?

I want to do some GitHub window-shopping for inspo


please
>>
>>61557846
lets be honest you're looking to steal code to put on your resume, thus the NON-INANE in all caps.
>>
>>61557533
sshftp.
Yeah, we have the bandwidth to waste on sending entire text files for edits instead of sending only the parts we edited/diffs. What a time to be alive.
>>
>>61557846
I made a program which finds the smallest and largest from a set of words.
>>
>>61557891
no, I have a job :-D:DD

Just absolutely nothing to do with my spare time
>>
>>61556270
>>61557213
https://www.youtube.com/watch?v=UuyJWi8em-A
>>
>>61557927
if you don't have any particular idea, just like join and contribute, anon
>>
>>61557801
>pretty sure they will, at least they said so
Aha, I didn't know that. For starters, learn Python until you feel comfortable with it. After that, focus on file manipulation. Maybe learn some regex while you're at it.
>>
>>61557940
But where?


(not Firefox)
>>
>>61555687
I'm coming around to this preference aswell. But someone here in /g/ said a few weeks ago that people use nim as an embedded scripting language instead now. But I can't find any resources citing people doing this. And it isn't commonly interpreted either.

I'm thinking maybe she was bullshitting.
>>
>>61557985
https://github.com/search

I found a couple of neat projects a while ago, now I spend some comfy weekend time tinkering with other fellas
>>
>>61556835
Yes. In the 70s it was called hacking. I do it all the time for my personal projects, but I wouldn't recommend it at work.
>>
>>61556270
https://youtu.be/rBPGgmsZQpI
>>
File: 1500901804302.gif (35KB, 501x600px) Image search: [Google]
1500901804302.gif
35KB, 501x600px
>>61558039
>We couldn’t find any repositories matching 'non-inane'
okay
>>
>>61556605
Spotted the neet.
>>
>>61557985
Choose wisely:

https://github.com/yegor256/eo
https://github.com/emojicode/emojicode
>>
>>61558070
what would be a proper antonym for inane though
>>
>>61557891
honestly that's how i feel right now.
i'm basically just reimplementing someone's shit into webapp form for shitpost purposes
>>
>>61558100
Speaking of which, is ninja good?
>>
>>61558100
>smalltalk
>not good enough oop
a bit triggered
>>
>>61558100
>
import org.eolang.cli
import org.eolang.printed
import org.eolang.string
cli:
printed:
string:
"Hello, world!"


but why
>>
>>61558164
a < b
ifTrue: [^'a is less than b']
ifFalse: [^'a is greater than or equal to b']


such is life of a true oop samurai
>>
Need a little assistance, /g/. I haven't done any serious programming in nearly three years, let alone decode someone else's work.

How can I submit POST data server side to an external website? The external website has the client run and execute a jQuery script that contacts an external website itself.

Or, well, how could I submit data and a response to
>https://www.mycallin.com/index.html

The jQuery script calls to
>https://sentry.norchemlab.com/Sentry/
>https://sentry.norchemlab.com/Sentry/WebCheckin/Lookup/
>https://sentry.norchemlab.com/Sentry/WebCheckin/Log/

Whenever using cURL with PHP I receive
>301 Moved Permanently

Allowing redirects I receive
>Samp::WebApp::WebCheckin=HASH(0x186822b0)

Finally, after submitting the first form, I then have to determine whether or not the received data is for my account by clicking 'submit'.

If I could get pointed in the right direction it'd be greatly appreciated.
>>
File: OOD-expert.png (8KB, 653x114px) Image search: [Google]
OOD-expert.png
8KB, 653x114px
>>61558144
>>61558164
http://www.yegor256.com/2017/02/21/say-no-to-google-recruiters.html
>>
>>61558285
>>>59079636
kek
>>
>>61558285
Damn. Traversing a binary tree is literally three lines of code.
>>
>>61558275
truly, the oop samurai does not live an easy life
>>
>>61558285

Daily reminder that slavs are not white.
>>
>>61558285
I see his point, but his language so far also assures me he is a shit designer.
>>
>>61556532
Why is a chatbot easy? Isn't it ai?
>>
>>61558374
It's not entirely his fault to be honest. He did fall for the OOP meme, to which an incredibly large number of intelligent people fall.
>>
hey /dpt/

I just got a contract to produce a college level online programming course for
>java

the goal is for these 35-40 year old dudes to be able to read little blocks of code and not fail the multiple choice exam.

what do i teach /dpt/?
>>
>>61558352
UFCS would make this slightly more bearable, but dear lord why
>>
>>61558386
Just use Markov chains, anon.
>>
>>61556502
Linux is a kernel.
>>
>>61558388
Even POO can not be completely terrible though.
>why assume your program will be non-CLI
>W H Y do i have to import the string library & tho print library to print it out
>why do i have to tell the compiler my "string" is a string
>why do i have to tell it its obviously printing to the console

I dont see the positives in any of this, its not safe, contractual programming, its just redundant nonsense. Fucking slavs.
>>
I want to code a simple terminal in C. Any hints where to start?
>>
>>61558457
Start by switching to a decent modern language invented after memory protection.
>>
Why do languages that strive to paradigm purity like Smalltalk or Haskell end up being impractical whereas shitshow mashups like C++ or Javascript dominate the world?
>>
>>61558457
What do you mean by simple terminal? A read eval print loop like bash or a digital teletype display like "terminal"
>>
>>61558490
go away pink haired tranny
>>
>>61558497
A terminal emulator.
>>
>>61558352
What does this have to do with OOP?

Why would anyone instantiate a new object for each method here?
>>
>>61558496
Because C ruined three generations of programmers.
>>
>>61558504
You're just mad at trannies because they arouse you and make you feel guilty for masturbating to them.
>>
>>61558496
purity is for academics, practical languages are used in the real world
>>
Help me decide, /g/. I've been considering starting an open source project. It would be a self-hosted license management system, that can be used to deal with serial keys and serial key distribution, tie licenses to hardware, provide users an overview over licenses and features.

This is probably a project that will take months and some really hard tech stack decisions. I also know there's a pre-existing startup that also offers self-hosting in this area, https://keygen.sh/, though I'm trying not to read their API docs or the like to avoid copying their ideas (API copyright is kind of a hot iron right now). Should I do it anyway, knowing I will probably throw it into the water and/or nobody will use it anyway? There are some interesting technical decisions to make and a stack to design, but that makes failure pretty likely.
>>
>>61558496
Marketing and/or right place at right time.

C++ was marketed with "why would you ever not use it manager? It's just C, but with more! It even places nicely with* your C code!"

Javascript was a prototype for Netscape to run scripts, and it ended up sticking instead of the planned Scheme (never got in) and Java (which got in, but was never fully integrated and eventually got pushed out).
>>
>>61558654
B-but wasn't capitalism supposed to reward e-excellence?
>>
>>61558604
At least you will learn something
>>
>>61558654
Imagine a world where only C and Scheme exist.
>>
>>61558674
Excellence is multifaceted. The fact is schemelets suck at marketing their shit so instead of a scheme paradise on the internet, we're stuck in a javascript malbolge.

It's totally 100% the fault of the scheme advocates.
>>
>>61558674
capitalism rewards kikery
>>
>>61558696
Id kill myself
>>
>>61558654
>haskell would've took off with right amount of marketing
eh, a bit of a stretch don't you think

>sticking instead of the planned Scheme
now that'd be fun I imagine
>>
>>61556266
Let's make the perfect language that everyone will use
>>
>>61558724
I'll make the logo
>>
File: ran_life.png (50KB, 283x190px) Image search: [Google]
ran_life.png
50KB, 283x190px
>>61558696
What does Scheme even do?
>>
File: 1499889391783.png (463KB, 640x427px) Image search: [Google]
1499889391783.png
463KB, 640x427px
I'm working on the exercises from K&R, and this one tells to create a program that removes C comments from other files.
Any tips on how to write better code / improve this one?

https://dpaste.de/5TR4
>>
>>61558285
I completely agree with the author of this article.
>>
>>61558721
Not a fan of haskell. I didn't wanna touch on that. Just pointing out that social skills are necessary for a good outcome.

I think haskell's already achieved market saturation to be honest.
>>
>>61558674
wew, another loser commie NEET blaming capitalism for everything wrong. Go back to watch your japanese cartoons.
>>
>>61556338
Because it runs like ass due to bloat, inserts tracking calls when compiling, and only supports Microshit's shitty .NET. You cant port your code to Linux, nor Mac, which is only acceptable for game programming.
>>
>>61558732
What do you even do
>>
File: smug_ran7.jpg (127KB, 634x1000px) Image search: [Google]
smug_ran7.jpg
127KB, 634x1000px
>>61558762
*takes clothes off*
>>
>>61558732
It's a tool to help you be a wizard.
>>
>>61558734
1. Use fopen/fread/fclose for portability.
2. Try reading the file in chunks. Imagine you're dealing with the SQLite3 amalgamation.
3. Having variables both named i and iter is fucking confusing.
4. Use an enum for the comment variable, something like
enum CommentType {
CT_SOURCE = 0,
CT_CXX,
CT_C
};

5. I didn't go through all of copy, but I'm pretty sure that's just strcpy(). If you're on a BSD or can link against libbsd, prefer strlcpy.
>>
>>61558732
Scheme is for snowflakes who think theyre better than Lisp even though its literally the same language.
>>
>>61558781
Where's her right nipple?
>>
File: 1437339480172.png (483KB, 529x470px) Image search: [Google]
1437339480172.png
483KB, 529x470px
>>61558604
Oops, forgot to post cute anime so people actually read my post
>>
>>61558781
Post fat Ran again
>>
File: ran_situp.webm (938KB, 640x480px) Image search: [Google]
ran_situp.webm
938KB, 640x480px
>>61558837
She's not fat she's very healthy.
>>
>>61558853
Uh-huh, and I'm currently not jerking it right now
>>
>>61558816
The only people who don't consider Scheme lisp are common lisp faggots who insist that only common lisp is lisp and feign confusion when you mention scheme exclusive features.
>>
I'm writing about 50,000 lines to a text file from a Java Array. Works fine up to the 47,678th line, then it just stops in the middle of it and doesnt print any further.
I know its not a loop issue, I'm tracking the last iteration count inside the conditional for printing, and its ending about 400 lines after it stops printing.

I've tried fucking with BufferedWriters buffer size but I've only managed to make the total amount printed smaller, and I've tried using FileWriter directly with no change.
I'm a bit lost.
>>
Does Windows support POSIX?
>>
>>61558960
disregard this, I wasn't flushing when done (poop joke)
>>
>>61558961
For the most part
>>
>>61558604
Yeah people would probably use it if it's decent, so they don't have to pay $100 a month to some startup that may or may not go under, crippling their software.

keygen.sh sounds cool and I'd be interested in using it but scares me deeply.

The one thing though is it should be dual licensed so you can actually make money off it.

That is publish it under AGPLv3, but sell exemptions for say $100.
>>
I won a ticket to watch an event with a programming competition and some conferences, what do?
>>
>>61559006
>most part
Why can't microsoft do anything correct?
>>
So I'm willing to learn how to program, and decided to pick the easiest language first, python. Now, as a non-native speaker, should I learn python in my language or in english? My language is very irrelevant, literally nobody speaks it outside my country.
>>
>>61559060
But Anon, all programming languages are in english if I am not mistaken.
>>
>>61559146
I mean the documentation, you know, how to do that and that, what to write and how to write a program.
>>
>>61559060
do whatever you want, its your code!
in industry, most people write software in english. most documentation is in english. by default, method names are english. writing in english makes things a lot easier if you need to share with people who dont know your language. but can write in your own language it everything will work just fine, so do whatever you want
>>
>>61559045
Well I'm not actually sure how much it doesn't support, I just know it has weird behavior when it comes to things like signals.
>>
>>61559170
Alright, I think learning it in my language would be easier, thanks!
>>
>>61559156
Oh, okay.
For me, I mostly use English resources to study. But for my own shitty programs, I usually use 50 % english, 50 % moonspeak.
>>
>>61559060
Read this book: http://htdp.org
>>
File: cover.jpg (51KB, 400x579px) Image search: [Google]
cover.jpg
51KB, 400x579px
>>61559275
Should I also read this or it is more advanced?
>>
goys, i'm trying to step into scala, but this fokken website doesn't work for shit
https://www.scala-exercises.org/

i get a blocked icon come up whenever i try to run the examples, can some anon tell me why i suck - i've disabled adblock
>>
>>61559324
Wait until you're confident programming.
>>
>>61559324
Read that one next. HtDP is for beginners and SICP is for experienced programmers.
>>
>>61559331
>>61559347
Okay, will do. Thanks everyone who helped me, I really appreciate it.
>>
>>61559328
Works in qutebrowser.
>>
>>61559328
>i'm trying to step into scala
big mistake nibba, don't do it
>>
>>61559397
ty

>>61559428
what else would be better? i'm already close to level-99 pajeet in java, figured scalas features looked sexy
>>
>>61559459
>what else would be better? i'm already close to level-99 pajeet in java, figured scalas features looked sexy
Not him, but why not try Clojure?
>>
>>61556268
can't even imagine desu
>>
>>61559347
> SICP is for experienced programmers.
It's time for this meme to die, SICP is literally an outdated introduction course built upon an outdated programming language, there's nothing special about it, there's no point to read it if you're an experienced programmer. Then again, there's no point to read it if you're an inexperienced programmer either.
>>
>>61559548
>outdated introduction course
false
>outdated programming language
false
>>
>>61559574
>when a long-running joke about two nearly useless books is latched on to by NEETs who laud memes over utility

SICP and K&R were always noob traps.
>>
>>61559622
Is that why functional programming is booming right now?
>>
>>61559548
SICP is not about computer programming, is about computer science and how a computer manipulates the data. It's very useful, even to this day.
>>
>>61559574
MIT itself stopped using it 10 years ago and has been used Python since then, this means it's outdated.
>>61559644
What SICP has to do with (modern) functional programming?
>>
File: chaturec.png (13KB, 292x502px) Image search: [Google]
chaturec.png
13KB, 292x502px
Making a recorder / notification app for chaturbate... jesus what am I doing with my life.
>>
>>61559687
>MIT itself stopped using it 10 years ago and has been used Python since then, this means it's outdated.
Do you really think Python is a good alternative to Scheme?
>What SICP has to do with (modern) functional programming?
It teaches functional constructs.
>>
when will hiro bring back textboards
>>
File: 1491126557492.png (38KB, 501x586px) Image search: [Google]
1491126557492.png
38KB, 501x586px
>>61559720
>tfw created something similar but it only recorded highlights
>never monetized it

What are you using for recording?
>>
>>61558696
>>61558724
C and bash is sufficient for all tasks
>>
Today I started learning React. Weird so far, but I guess it has uses.
>>
File: 14 - UVca6dW.jpg (65KB, 810x780px) Image search: [Google]
14 - UVca6dW.jpg
65KB, 810x780px
how do I change the current directory of the console in windows
nothing werks all the functions i try return success but the directory stays the same
>>
>>61559722
>Do you really think Python is a good alternative to Scheme?
Actually, I do, especially as a teaching language.
>It teaches functional constructs
No, it doesn't, it just uses Scheme, which has closures, that's all it has to do with FP. You can't really teach the actual FP with a dynamically typed language.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61559783
>30 Yen has been deposited into your PayPal
>>
File: 120.gif (509KB, 440x248px) Image search: [Google]
120.gif
509KB, 440x248px
>>61559796
>>
>>61559816
FP has nothing to do with dynamic/static typing.
>>
File: schnell.gif (2MB, 480x320px) Image search: [Google]
schnell.gif
2MB, 480x320px
>>61559841
N-nani?!?
>>
>>61559779
ffmpeg, or avconv as that's whats available on the raspberry. Simple, as in, it works great, but I can't ever remember the arguments for it.
>>
>>61559779
>>61559884
how did you define highlights?
>>
Someone pls post one of those charts
You know the ones
>>
File: lisp_is_not_lambda_calculus.png (23KB, 587x162px) Image search: [Google]
lisp_is_not_lambda_calculus.png
23KB, 587x162px
Look that I've found reading HoPL I, spoken by John McCarthy himself in 1978.
>>
>>61559687
>appeal to authority
They switched to python and the new course because (1) they wanted to unify intro courses for EE and CS to save money and (2) they wanted an """empowering""" """application""" focused intro course to """inspire""" students to continue with their degree instead of a fundamentals course.

I don't have a CS degree, but that train of logic is the reason why I had to take SIX calculus courses to get my math degree.

>calc BC*
>calc 3
>multivariable calc (a repeat of calc 3 but whatever, technically not introductory so I'll let it slide)
>theoretical concepts of calc*
>analysis 1*
>analysis 2
Courses with a star were introductory. I had to take introductory calculus courses THREE TIMES because they couldn't just teach calculus properly the first time around.
>>
File: lisp_is_not_lambda_calculus2.png (16KB, 582x94px) Image search: [Google]
lisp_is_not_lambda_calculus2.png
16KB, 582x94px
>>61560020
And again, this time in his essay.
>>
Reminder to never listen to math majors when they talk about programming. It's a eternal buttrage
>>
File: 1500242410994.png (18KB, 241x275px) Image search: [Google]
1500242410994.png
18KB, 241x275px
>>61559060
I'm a non-native English speaker as well, and I'd recommend learning it in English. English is pretty much a universal standard in this industry, so go with the standard.
>>
>>61560125
Ive always found it weird how math majors can be such eternal brainlets at programming.
>>
>>61560125
That's because you know "application" pedagogy is a waste of fucking time that doesn't create true understanding and everything learned from it will eventually have to be completely replaced. You know that application focused pedagogy is justified by being more tactile, despite the traditional approach having plenty of rooms for tactile projects.

t. SICP's symbolic algebra project, evaluator project, and register machine project
>>
File: 13049.jpg (38KB, 715x418px) Image search: [Google]
13049.jpg
38KB, 715x418px
>>61559884
Neat!

>>61559959
Using the view count or more buzzwordy, the wisdom of the crowd (see pic). If there's an large influx of people but it isn't the start of the stream there is probably something worth watching. If the view count falls over a certain period they are probably leaving (interesting event ended). At the beginning, I wanted to incorporate the chat for clues but that simple heuristic worked so well that I didn't need any more clues. It was a bit eerie at the beginning because the recordings just started before the action began, captured the whole show and then ended.
The main parameters you want to tune are the time slices and velocity rates
>>
How is this for commenting?
class Vector {
private:
//Each vector has, at least, an X and Y value.
float x, y, z;

public:
//Default Constructor
Vector() {x = 0; y = 0; z = 0;}
//Standard 3D constructor
Vector(float xP, float yP, float zP);
//Standard 2D constructor
Vector(float xP, float yP);

//Return the vector as a string
string getVector();
//Multiply each vector component by the given float value.
Vector operator*(float multiplier);
};

Anything to improve? What are some fundamental things to know when commenting professional code?
>>
>>61560453
each vector and the methods arent necessary.
>>
>>61560453
don't comment the what's only the whys

only comment if it isn't immediately clear what you're trying to do
a comment block describing your algorithms or disgusting hacks is fine, not "I AM DECLARING 3 VARIABLES HERE"
>>
>>61560453
Usually you comment up a class so that you can use an API documentation tool such as doxygen, so you should use the format that doxygen would want you to use.
>>
>commenting your code
It's like you're asking to be outsourced.
>>
>>61558754

http://www.wired.co.uk/article/bill-gates-capitalism
>>
>>61560467
>>61560470
>>61560491
Okay, thanks.
So only comment the implementation unless it's necessary to also comment the declaration?
>>
>>61560509
my code is self-explanatory
int width; // width of the plane


vs

int plane_width;
>>
int w; /* width */
>>
>>61560453
what's the P for in xP yP zP? pressing shift is very objectionable.

x is just as good as multiplier.

getVector should be called string or toString unless this is some c# crap i don't know about.
>>
>>61560538
you're a big guy
>>
>>61560531
Only comment if something non-obvious needs to be explained.
int abs()
{
return sqrt(square(x) + square(y) + square(z));
}

It should be clear what this code does just by looking at it. Any comment here would just distract.
>>
>>61560514
>wanting to feed niggers and cure their diseases
what's his endgame
>>
>>61560559
for whom?
>>
>>61560558
It's meant to stand for Parameter, but I'm not sure what other alternatives I could use.
What are some recommended formats? Or is it not really necessary?
>>
>>61560319
Yes I've been thinking about doing something similar, nice to hear it works. There are some streams that I want the whole thing for, so it'll probably be a toggle.
>>
File: 1499479373631.png (29KB, 741x568px) Image search: [Google]
1499479373631.png
29KB, 741x568px
>>61560561
>abs
>sqrt(square(x) + square(y) + square(z))
>>
File: scren.png (53KB, 759x436px) Image search: [Google]
scren.png
53KB, 759x436px
rate my calculator /g/
>>
>>61560531
only comment the implementation if it is confusing.

I.e. some highly specialized and optimized algorithm. For example I have a line drawing algorithm in one of my projects that's based on a plane-ray intersection algorithm, which itself I couldn't understand without a giant comment explaining it. You better believe that's commented because without it I have no help of understanding it myself in the future.

>>61560561
>calling euclidean distance abs
>>
>>61560661
bretty cool
>>
>>61560618
It's not necessary to have any explicit constructors desu. You'll just get the regular struct initialization rules.

But if you do, you can just use the same name as the members. With a constructor initializer list, the variable shadowing makes it nice and neat.
Vector::Vector(float x, float y, float z):
x(x),
y(y),
z(z)
{};

I've also seen people prepending _ to constructor parameters as a common style.
>>
>>61560683
>prepending _ to constructor parameters
aren't names beginning with _ reserved?
>>
>>61560767
No, prepending member names with an underscore is common for private members, in python it is in the style guide. It has been done in PHP since the beginning.
>>
>>61560767
Double underscores __ and underscores followed by a capital are reserved. Single underscores are only reserved in the global namespace.
>>
>>61560661
Why are you making a calculator in python?
>>
>>61560558
That's clearly C++ pleb
>>
>>61558734
Nice arbitrary limit retard.
>>
NEW THREAD!

>>61560889
>>61560889
>>
>>61560827
For my github, it's a small library that parses math expressions, get a few ppl to download it and employers will think im not a neet
>>
>>61560894
DUMBASS
>>
>>61560927
delete this shit thread
>>
>>61560862
i avoid class-oriented atrocities
>>
>>61560894
>>61560927
Jesus christ, both of these threads are fucking awful.
I hope a janitor deletes both of them.
>>
>>61560453
Why is gcc so shit?

#include <cstdio>

struct Vec3 {
float x, y, z;
};

int main()
{
//Vec3 vec = { }; works in gcc and clang -> all 0's
Vec3 vec = { .y = 1.0f, .z = 2.0f }; // only works in clang
printf("%f %f %f", vec.x, vec.y, vec.z);
return 0;
}
>>
Should I learn Haxe?
>>
>>61561148
gcc is irrelevant.
use clang.
>>
>>61561148
Because that's not C++
>>
>>61561148
>Designated initalisers
That's not valid C++, fuckface. That is a C-only feature.
Enjoy your trashy "constructors".
>>
>>61561150
No.
>>
>>61561187
Ah, fuck, you are right, Anon. I fucked-up, that's C++20 syntax:

http://en.cppreference.com/w/cpp/language/aggregate_initialization
>>
>>61561196
See the link I provided. I fucked up and used C++20. They work in clang already, though.
>>
>>61561220
>still crippled compared to C
lmao, I'm beginning to see why this language is such a joke
>>
>>61561220
>all designators used in the expression must appear in the same order as the data members of T.
What the fuck?
Good job removing a huge amount of usefulness, you retards.
>>
>>61561258
so much for encapsulation, right?

I suppose it makes sense though: doesn't C++ enforce that members are initialized in the order they are declared?
>>
>>61561311
The whole fucking thing is crippled.
It's just vastly inferior to C.
>>
>>61561334
It's just funny how basic features like this either don't exist or come years late and crippled but they continue to pile on more and more confusing and bizarre bullshit.
>>
Ok. I'm done being a neet. I was working in some help desk shit for a while but I've been laid off since December. And my neet bucks have run out.

Where do I start to get into programming. Boot camps look like scams, idek which moocs to check out. Are things like bento or codecademy any good?

Idc if it's a book or a site, but I'll take any recommendation for where to start.
Thread posts: 328
Thread images: 35


[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.