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

File: hackers.jpg (131KB, 1920x1080px) Image search: [Google]
hackers.jpg
131KB, 1920x1080px
What are you working on, /g/?

Old thread: >>58345243
>>
File: monad diagram.png (26KB, 334x358px) Image search: [Google]
monad diagram.png
26KB, 334x358px
M
O
N
A
D
S
>>
File: 1476111082775.jpg (46KB, 540x652px) Image search: [Google]
1476111082775.jpg
46KB, 540x652px
thank you for using an anime image
>>
>>58354286
Thank you for using a non-anime image
>>
>>58354286
learning make and company c++11 coding guidelines for new work.
>>
what's the most simple programming mistake that you spent most time with?
>>
>>58354336
>C++11
come on bro
it's 2017
>>
>>58354357
Using C++.
>>
>>58354360
Im reading 11 now, later I'll move to 14 part.
but they don't use later stardards.
>>
>>58354336
One algorithm for Disjoint Sets I missed an i for a j in my implementation and it took a couple hours of debugging to find.
>>
>>58354427
And you blame the language for your typo? I don't get the message.
>>
>>58354443
Sorry meant to reply to
>>58354357
>>
>>58354479
ok mate, sorry too.
cpp defense mode off.
>>
In Python how can I use a dictionary in a function I wrote before that dictionary
>>
>>58354560
Make the dictionary an argument.
>>
>>58354560
Have the function accept the dictionary as an argument.

Failing that... global variables.
>>
I'm interested in low-level programming. Should I learn C or rust?
>>
>>58354601
the non-meme language obviously
>>
>>58354601
C. Is it objectively a much more popular language, and learning C will help you appreciated the strengths and weaknesses of Rust.
>>
>>58354572
>>58354574

this doesnt work


def scrabble_score(word,**score):
word = word.lower()
scoresum = 0
for i in word:
if i in score:
scoresum = scoresum + score[i]
print (scoresum)


input = "Hello"
scrabble_score(input)

score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2,
"f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3,
"l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1,
"r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4,
"x": 8, "z": 10}

>>
>>58354601
Depends how you take your pronouns.
>>
>>58354601
C, than Rust.
>>
>>58354601
>low level
>C
>fucking Rust
this meme needs to die
>>
>>58354601
both will give you job.
But c is here for the last 40 years, and will be for the next 40.
>>
>>58354639
You need to unpack the dictionary ie scrabble_score(**input)
>>
>>58354673
Programming is just hobby for me.
>>
is it even possible to have a replacement for C? what should it be for it to do so?
>>
>>58354687
So try both, start with c because it's the lingua franca of this world.
My hobby is wargames. I have plenty of ones that are horrible and I no longer play and i regret nothing.
>>
>>58354657
are you saying c is not low level?
>>
>>58354687
Then there is no reason to use C.
>>
>>58354601
As someone whose favorite language is Rust, C first and then Rust, for the reasons in >>58354638.
>>
>>58354720
No, it's not. Maybe compared to some other languages, but it is not a "low-level language" itself.
>>
>>58354740
yeah, k
>>
>>58354740
ok granpa, go back to you punching cards.
>>
Fess up /dpt/, which one of you was this?

https://github.com/rust-lang/rust/issues/38869
>>
>>58354872
Dunno, but that Meh guy from Opalgate posts here. He's the guy making the terminal emulator in Rust.
>>
Text editor poll continues
http://www.strawpoll.me/12023125
>>
What is the most practical way to parse asm code with c?
>>
>>58355036
Implement a Haskell compiler in C, then use Parsec.
>>
File: 17010616001.gif (408KB, 400x264px) Image search: [Google]
17010616001.gif
408KB, 400x264px
>>58354360
>mfw C++20 will have modules, concepts, coroutines and ranges
>>
>>58355051
One can only hope, brother.
>>
File: 1453651138545.jpg (57KB, 601x577px) Image search: [Google]
1453651138545.jpg
57KB, 601x577px
>>58355051
>mfw C++20 still won't be any good
>>
>>58355010
That relates to me.
Is sublime a meme? Is it worth 70$?
VSCode gives me bad memories of MS telemetry services, and many people complain about atom effectiveness.
I don't want to start learning 2 state editors neither... opinions?
>>
>>58355051
>C++20 will have modules, concepts, coroutines and ranges
And the standard library designed for C++98.
>>
>>58355051
great, more bloated syntactic sugar
>>
>>58355049
Please go back to your containment general.
>>
>>58355158
I'm already there, muthafuckaaa
>>
>>58355114
None of these are "syntactic sugar" though.
>>
I studied C for a few weeks as my first programming language and now I'm learning Python.

I have so many "I can't believe I can express it like this and it actually works" moments. I'm blown away.

def censor(text, word):                     
new = ""
textaslist = text.split()
for i,n in enumerate(textaslist):
if n == word:
textaslist[i] = len(n)* '*'
new = ' '.join(textaslist)
print (new)


censor("hello how are you","are")

>>
File: 1478498024385.png (85KB, 388x218px) Image search: [Google]
1478498024385.png
85KB, 388x218px
>60 elements
>almost sorted
>elements are just uint32_t
which sorting algorithm would be the fastest in this case?

some cppcon guy (chandler carruth i think) said bubble sort was best for fewer than 64 elements and when they're just numbers.

the consensus on wikipedia and stackoverflow seems to be that insertion sort is better than bubble sort, but wikipedia said that the threshold of number of elements for when you should choose quicksort over insertion sort was only around 10.

would the cocktail shaker sort be a good choice?
>>
>>58355233
>>almost snorted
xD
>>
>>58355233
https://www.toptal.com/developers/sorting-algorithms/
>>
>>58355214
def censor(text, word):
print (text.replace(word,"*"*len(word)))
>>
>>58354639
Why are you unpacking the dict into keyword arguments? Just do it normally.
>>
>>58355303
because i wanted some internet points
>>
>>58355297

yea lol
>>
>>58355214
def censor(text, word):
print (' '.join([len(x) * '*' if x == word else x for x in text.split()]))

censor("hello how are you", "are")
>>
>>58355233
>some cppcon guy (chandler carruth i think) said bubble sort was best for fewer than 64 elements and when they're just numbers.
I wouldn't mind a citation, because that seems very surprising. I think bubble sort is just worse than insertion sort.

If you care about performance you should implement a few different sorts and just time them. Intuitively insertion sort should be the fastest, as the small array + almost sorted are both good for insertion sort.
>>
File: Capture.png (25KB, 599x274px) Image search: [Google]
Capture.png
25KB, 599x274px
How lazy are you?
>>
File: shaw.png (583KB, 720x992px) Image search: [Google]
shaw.png
583KB, 720x992px
>>58355297
>>58355297

wait a second

your code is not good because it wouldnt work with

censor("hello how are you", "el")

for example
>>
>>58355350
https://www.youtube.com/watch?v=fHNmRkzxHWs

52:30
>>
>>58355233
Here's a fun sorting algorithm you've never heard of:
https://en.wikipedia.org/wiki/Bead_sort
>>
I'm planning on implementing a language with similar behavior to c++ with better metaprogramming
>>
>>58355233
>60 elements
>caring about speed
>>
>>58355478
They might be sorting a million 60-element arrays.
>>
>>58355408

Clearly very

Haze got cucked by mandingos.
>>
>>58355478
it'll run on mobile devices, most of the time it'll be in a worker thread where it's basically free but in some cases it may need to run repeatedly in the rendering loop, and it has to run fast on the weakest devices, hopefully without skipping frames, and there's a lot of other things too so even if just the sort is "fast enough" it should not be slower than necessary
>>
>>58355441
Why not just do cuckoo hashing but with having a fixed array queue of entries for each hash and when the fixed sized queue is full pop off an element and then push it to a new location?
>>
>>58355108
sublime has free version with full functionality, only sometimes (about 1:100 or even 1000 saves?) when you save file it asks you to purchase full version

its really effective, nice and quite easy to use, has a neat package control system with lots of useful (and unuseful too) packages and doesn't choke on files larger than 1MB (like Atom)
I think its worth that 70 bucks

although you should learn at least basics of vim too, cause it enables you to be productive without x system, like through ssh or on other architectures
>>
>>58355108
>VSCode gives me bad memories of MS telemetry services
It's literally open source, and I'm assuming by "many people" you mean the NEET memelords in /dpt/.

It's a fantastic editor.

That being said, Sublime is also great. You can easily get a license key for Sublime, too.
>>
What is the best place to start out learning how to program neural networks? I would prefer something that goes over everything conceptually instead of in code.
>>
>>58355773
Did you mean to greentext the atom part?

>>58355734
I think I cannot use free version commercially and that's what I'm intending to do.
>>
File: 6XiRgru.png (1MB, 960x720px) Image search: [Google]
6XiRgru.png
1MB, 960x720px
>>58355108
>Is [x] a meme?
>telemetry
Pic related.

VSCode and Sublime are both good; I like both equally. Have/had an intern at work who absolutely LOVED Sublime and had a tiny fit if someone was using something not Sublime, but it's still good software. Don't purchase Sublime unless you really want to.
>>
>>58355734
He can also get rid of the prompt to purchase the license by binding the ^S key to save command.

Also Sublime has Vintage mode which enables Vim-like navigation so he could have the best of two worlds.
>>
>>58355845
Yes, but I don't see how that changes the meaning of what I said.

VS Code is open source: https://github.com/Microsoft/vscode

Atom is fine, but VS Code actually improves on Atom's performance and feels more streamlined overall, with a fuckton more features.
>>
>>58355475
>c++ with better metaprogramming

Literally D
>>
>>58355836
andrew ng coursera
>>
>>58355933
how's it going with removing the garbage collection from the standard library?
>>
>>58355923
>>58355874
I never used VSCode neither Sublime thus my corelation to peoples opinions. I just heard a lot good stuff about the second. On the other hand I heard a lot of bad about atom (which I'm testing atm desu).

thanks for the feedback
>>
>>58354286
linked lists c implementation for uni
>>
File: aoc.png (62KB, 667x833px) Image search: [Google]
aoc.png
62KB, 667x833px
How many of you actually completed Advent of Code on Christmas?
>>
>>58356032
VS Code is built on top of the same framework as Atom, but that's like comparing Arch and Ubuntu.
>>
>>58356126
I started working on a bunch of other programming projects around the same time and abandoned it after a few days
>>
>>58356126
I got behind during finals week but managed to barly finish
>>
guys seriously Python gives me a huge boner

def count(sequence,item):          
count = 0
for i in sequence:
if item == i in sequence:
count += 1
return count

sequence = [2, 3, 4, 2, 3, 9, 7, 7]
item = 7

print (count(sequence,item))


it's light years apart from C
>>
>>58356440
print $ length $ filter (== item) sequence
>>
Scraping images off booru to get datasets to train a cute anime girl classifier. Goal is to have a watched folder where I save cute anime girl images and then my program classifies it as a certain girl and moves the image to the appropriate folder if it is sufficiently confident, and into a manual sort folder if it is unable to classify.

I worry that there are too many labels so I will need a lot of training data. So for now I'm also thinking of how to reduce this. Perhaps only choose the most common or popular girls/series.
>>
>>58356440
print(sum(c == item for c in sequence))
>>
>>58356440
But that's basically the same as the C version, at least >>58356508 >>58356573 show off higher-level features.

And
if item == i in sequence:

pretty sure "in sequence" is irrelevant, in fact why does this even work? Shouldn't it become
True in sequence
or
False in sequence
which would always be false?
>>
>>58356724
Probably a typo.
>>
>>58356840
Actually, he's just misread it.
>>
>>58355051
>no goroutines
fuckin dropped!
>>
numbers = [1, 1, 1, 2, 2, 3, 3, 3, 3, 5, 5, ]


def remove_duplicates(numbers):
new = []

for i in numbers:
if i not in new:
new.append(i)
return new


so what's the high-level feature solution for this?
>>
>>58357328
numbers = [1, 1, 1, 2, 2, 3, 3, 3, 3, 5, 5]

def remove_duplicates(numbers):
return list(set(numbers))
>>
>>58357328
numbers.Distinct();
>>
>had a good job interview
>recruiter told me they want to hire me
>said they'd get back to me this week
>no response yet
>sent an email
>no response

if you want to kill a man who's out of options, this is how you do it
>>
>>58354601
Neither. Learn a bit of assembly, implement your own forth, use it.

You will learn a lot more about computer and will at least understand what you are doing.

Assembly isn't hard at all, it gives you a lot of freedom (and thus power and thus responsibility), and because of this a bit more work, but it changes your way of thinking, kinda like learning lisp for first time. Implementing forth isn't hard at all and is a very good experience and it's ultimate low-level language. It's very low level, but it has very good means of abstraction.

For assembly maybe try Programming from ground up book and for forth try to find literate forth assembly tutorial.
>>
I have found an algorithm to iterate over an entire, perfectly normal/regular, array in O(log n)

Ask the next richest man on Earth anything
>>
>>58355475
Literally common lisp, just ignore half of its features.

It has all this low level stuff, from go to-s to embedding assembly. And it's the god of metaprogramming
>>
>>58357559
>Ask the next deadest man on Earth anything
>>
>>58355836
I started with this resource: http://neuralnetworksanddeeplearning.com/
>>
>>58355938
Agreed. Great course.
>>
>>58357559
where n = 2^(length of the array)
>>
>>58354639
Try harder m8.
def scrabble_score(word, score):
return sum(score[i] for i in word if i in score)
>>
I need a good capstone project guys. I want to something that I can show to companies and be like fuck yea I did that.

Something with data mining maybe or nueral networks. I have no idea where to start looking tho. Fuck
>>
>>58357328
>he literally does not know what a set is
laughingCSgrads.jpg
>>
http://blog.jwilm.io/announcing-alacritty/
>>
>/dpt/ talks about something
>it gets turned into a 3blue1brown video
https://www.youtube.com/watch?v=IxNb1WG_Ido

freaky
>>
>>58357681
>data mining maybe or nueral networks
Why?
>>
>>58357714
might use this desu
>>
>>58357328
nub numbers
>>
>>58357724
Wow... It really fires up your neurons...............
>>
>>58357681
Is ML even impressive anymore?
1. Download Theano and Keras
2. Scrape some convnet from github that works well with a problem similar to yours
3. Get enough data
4. Train for fucking ever
Wow, it works.
>>
>>58357714
>GPU accelerated TERMINAL

Tell me again why you linux fags think IDEs are bloated, fucking kek.
>>
>>58357714
>GPU accelerated terminal emulator.
For what purpose?
>>
>>58357764
Because he can
>>
>>58355426
neither does OP's
>>
>>58357758
Why do you standarize and what does it have to do with Linux?
>>
>>58357705

I'm studying EE and I have no respect for cs grads
>>
>>58357848
I'm studying EE and I know what a set is. Step it up senpai.
>>
>>58357848

also the exercise told you not to use built in functions
>>
>>58357848
Normally I would side with the EE guy, but that set thing, dude.
>>
>>58357798

mine does because I split the string into a list
>>
File: laughinggirls.jpg (13KB, 200x202px) Image search: [Google]
laughinggirls.jpg
13KB, 200x202px
>>58357705
>CS kids don't get told about babby's first math until grad school!
>>
>>58357865
def remove_dups(l):
return [a for a in {b for b in l}]
>>
>>58357918
Are you thick? If they have graduated then they have already learned about sets in their undergrad.
>>
>>58357705

list(set([1,2,2,3,3]))



would return [1,2,3]

and that's wrong because 1 is not duplicate
>>
>>58357734
I don't know those topics seem interesting and companies seem like they are more and more interested in data mining, analytics, and recommendation engines.


>>58357743
Yea not too impressed with ML anymore desu
>>
>>58357950
That's not wrong. Are you and idiot? The problem is to remove the list without duplicates, not return the duplicates.
>>
what the fuck are you guys talking about?

I'm from Germany and we learn sets in fucking high school
>>
>>58357758
>>58357764
higher fps in libcaca/tct
>>
>>58355051
But will it have std::socket?
>>
>>58357992
Well we have to support nigs and white-trash in our public schools who can't even comprehend the usefulness of algebra. And of course to be "fair", our nation follows the least common denominator. Public education in the US is third-world-tier.
>>
>>58357992
but you didn't learn how to empty the sets
>>
>>58357992
Same, I live in the US and learned about sets in high school.

These guys probably never paid attention in class.
>>
>>58358014
std::kneesock
>>
>>58357992
Slovenia here, in fucking elementary school.

In CS terms a set is unordered collection of unique objects, with defined operations is-member?, intersection, union, complement, ...

>>58358039
In math sets are fucking immutable, in programming it depends on language.
>>
>>58357992
cambodia here
we learn that shit in kindergarten
>>
how do i assign variable x to equal what variable y first initially equals? (y will change throughout my program, but i want x to never change).
>>
Is bisqwit /dpt/ approved?
>>
Croatia here, we get taught sets in the delivery suite.
>>
https://www.youtube.com/watch?v=v0HIkFR1EN4

HASKELL WINS AGAIN
>>
>>58358090
are you talking about the jewish finn? if so then i don't see why he wouldnt, hes pretty good
>>
>>58357992
Hungary here, we are born with that knowledge
>>
>>58358106
Yep, I liked his livestream when he went to make a helper software for representing the NTFS filesystem.
>>
>>58358110
Norway reporting in. Most current mathematics is genetic knowledge in Scandinavians.
>>
>>58358104
>games
>musical applications

I didn't think Haskell could be made any more useless
>>
File: yablewit.jpg (12KB, 245x318px) Image search: [Google]
yablewit.jpg
12KB, 245x318px
>>58357945
>going to college to learn about sets
>>
File: record12.webm (2MB, 1364x764px) Image search: [Google]
record12.webm
2MB, 1364x764px
I have made this

Have you ever done this?
>>
File: 1483710968102.png (126KB, 774x1032px) Image search: [Google]
1483710968102.png
126KB, 774x1032px
>>58357328
>o(n^2)
>>
>>58358152
How is it n^2? There's only one loop.
>>
>>58358148
I don't believe I've ever come across a productive use for such a thing.
>>
>>58358171
Appending to arrays is linear
>>
>>58358171
if i not in new

checking if an element exists in a list is an o(n) operation
>>
>>58358171
lol? Checking to see if an element is in a list in O(n), and you are doing that in a loop over n elements.

>>58358179
No it isn't. It's amortized O(1).
>>
>>58358171
Holy shit man
>>
>>58358179
It can be but it is amortized so insertion is o(1) on average
>>
File: 1481699474788.png (126KB, 309x313px) Image search: [Google]
1481699474788.png
126KB, 309x313px
>tfw no laptop to code with while comfy in bed
I FUCKING hate my desk
>>
>>58358323
So get a laptop
>>
>>58358323
Shouldn't you be lamenting the subpar qualities of the body you inhabit leading to your inability to obtain sufficient currency to purchase things that you desire?
>>
File: mystique.jpg (118KB, 634x850px) Image search: [Google]
mystique.jpg
118KB, 634x850px
numbers = [3,5,8,6,8,9]                                   

def median(numbers):
sorted(numbers)
median = 0

if len(numbers)%2 != 0:
median = numbers[int(len(numbers) / 2 )]
else:
index = len(numbers) / 2
index = int(index)

median = ( numbers[index-1] + numbers[index] ) / 2

return median



I feel like I'm brute forcing every solution

inb4 median(numbers)
>>
>>58358516
I think you'd enjoy C.
>>
>>58358516
How about
def median(l):
return sorted(l)[int(len(l) / 2.0)]
>>
undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' 
>>
File: anime girl butts.png (37KB, 1053x917px) Image search: [Google]
anime girl butts.png
37KB, 1053x917px
Why is this ?
>>
>>58358632
Are you compiling a C++ file with gcc instead of g++?
>>
>>58358627
>
int(len(l)
>>
>>58358516
>>58358516

why do I have to divide by 2.0 instead of 2 in python 2.x ?
>>
i have a written algorithms exam in an hour how do i stop freaking out
>>
>>58358725

or maybe it was just the exercise program getting triggered by it.

I wrote it in python 3.6 and copy pasted it into the python 2.x exercise program and it wouldnt accept it without changing 2 to 2.0
>>
>>58358725
Python 2 assume integer division, whereas Python 3 introduces // as the integer division operator. For example, in Python 3:

> 3 / 2
> 1.5

> 3 // 2
> 1

(I think)
>>
>>58358835

I see. thanks
>>
>>58358769
because / in python 2 is strictly integer division
>>
>>58358850
*when the operands are integers that is
>>
>>58358655
reminds me of needle
http://scrambledeggsontoast.github.io/2014/09/28/needle-announce/
>>
Should I learn Python 2 or 3?
>>
>>58358179
I suppose it depends if the array doubles in size or increases by a fixed amount.
>>
I already posted this in the wrong thread but whatevs

>I'm trying out Visual Studio Code and damn... it is comfy as fuck. Free, Open Source and runs all on all platforms. WTF this isn't the Microsoft I know

Has anybody else used it?
>>
>>58358925
>WTF this isn't the Microsoft I know

they've been pushing a lot of open source and linux stuff recently
makes me wonder if the curry ceo is behind this and if yes then what is his end game
>>
>>58358148
(((you)))
>>
>>58358925
How does it compare to emacs?
>>
>>58358632
maybe
#include <iostream>
>>
>>58358925
https://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish
>>
Trying to use CImg for a program I'm using, but I keep getting a shit ton of crazy linker errors...

I have the #include file correct and in XCode's "Search Paths" I put in the correct directory for the header file... Anyone know why I'm getting these errors?

(Not sure how much this helps, but CImg is a library that's entirely templetized and all of the functions are in "CImg.h", so I don't know what else I could do to get the linker to work its magic)
>>
 g++ -std=c++11 -static -pthread $(code_dir)/*.h $(code_dir)/*.cpp $(code_dir)/LuaSrc/*.h $(code_dir)/LuaSrc/*.hpp -Wl,--no-as-needed -ldl -L$(code_dir)/LuaSrc/ -lluajit -o LuaJITSandbox.o 


I need to link a static library "luajit.a" into my project but no matter how i arrange my compiler command it fucks up one way or another.

How do I link static files for idiots? Can anyone provide an example?
>>
>>58358956
ofc Embrace Extend Extinguish
>>58358925
I really like it out of all the GUI editors, but once I realised I could have all this shit in Emacs as well as horizontal splits, elisp instead of js, running in a terminal, better vim emulation, etc I quickly switched back.
>>
>>58358925
>WTF this isn't the Microsoft I know
Microsoft is a huge fucking company and their DevDiv is actually fantastic.

The Windows branch is not indicative of what they offer developers these days.

In the last two years, they've:
>open-sourced the C# compiler
>bought Xamarin and made it free and open-source (was closed source and $1,000/year)
>paid developers to contribute to fucktons of open-source projects like Mono
>Created VS Code (free, open-source)
>Become a Linux Foundation member
>Support Linux deployment on Azure, namely RHEL
>Red Hat Enterprise Linux, Canonical (Ubuntu), and many more FOSS companies are joining the .NET Foundation
>RHEL comes with .NET out of the box now
>Created .NET Core, a lightweight open-source, cross-plat implementation of .NET
>bash/ubuntu subsystem on Win 10

Lots of good stuff for devs since "Sweaty Balls" Ballmer left.
>>
>>58358956
>>58358985

I figure they'll make a good product and get everyone using it, then start introducing the traditional microsoft nightmare.

It already has telemetry enabled by default, just like Windows 10.
>>
>>58359015
>good stuff for devs
I don't see
default everything to utf-8 (without that shitty bom)
specs of NTFS
>>
>>58358985
>>58359012
That was quite literally over 20 years ago, and they've shown no indication that this is the "plan" these days.

They make tons of money from cloud hosting, so it's actually in their best interests to simply embrace and extend, which is a great thing for devs.
>>
so, i kinda wrote a makeshift program for one of my courses. i'll upload the source to some public domain. do i need to put anything as a license, like a disclaimer or sth? i see everyone just pasting the MIT licence everywhere but i'm clueless about that stuff desu.
>>
>>58359048
So how much do they pay you?
>>
>>58359078
Nice meme.
>>
>>58354601
Learn C but don't wear yourself thin

C is good for demystifying how a computer works and what exact algorithm and data structures you need

Then proceed with C++11, it's awesome because it offers

        Z
E
A B S T R A C T I O N S
O O
S
T


C++11 is the only language you will ever need after that
>>
>>58359085
Don't hide behind overused buzzwords
>>
>>58359088
zero cost unsafety more like
>>
File: 1382724515292.jpg (184KB, 2000x1500px) Image search: [Google]
1382724515292.jpg
184KB, 2000x1500px
are there some reported cases where long-time experienced programmers lost their ability to program after head injury?
>>
>>58359088
>C is good for demystifying how a computer works
I've never learned a low level language like C. I assume you're talking about memory management (pointers)?
>>
This thread is pathetic. It is not about programming. It's just a bunch of computers illiterates and first semesters memeing about whatever they just learned.

A quick search shows that most arguments used here are not original and have been copied from some trendy tech blog or other shit site.

The only real programming questions I have seen so far are from beginners(it's fine to be a beginner btw).

This entire site is shit and I don't know why anyone would regularly come here.
>>
>>58358925
VS Code is shit, SHIT

I'm not going to use a HTML+CSS+JS based text editor that's slow to start, doesn't offer features you can get on Vim, Emacs or a good IDE like NetBeans, and requires me to edit JSON files just to make it work.

I tried it and it's shit. The MS shills are promoting it, don't fall for their lies.
>>
>>58359146
I almost fail for your bait.
>>
>>58359088
cringe
>>
File: loser.jpg (87KB, 640x480px) Image search: [Google]
loser.jpg
87KB, 640x480px
>>58359150
>The MS shills are promoting it
Not a shill (but that's exactly what a shill *would* say!) I'm just a sublime text user who found VS Code and got excited about it, so I posted.

Sorry for enjoying something, I'll make sure to be miserable like you in the future.
>>
>>58359144
It's good for learning how unix works. There is no need for an other OS to use the same abstractions.
>>
File: asdf.jpg (1KB, 203x209px) Image search: [Google]
asdf.jpg
1KB, 203x209px
https://github.com/rust-lang/rust/issues/38869
>>
>>58359005
Okay found the error and how to fix it thanks to this tutorial: http://techhao.blogspot.com/2013/10/a-short-tutorial-on-using-cimg-under.html

Basically, CImg needs the X11 framework (both included as a Header Search Path and as a Framework in XCode)
>>
>>58359219
It wasn't funny the first time, fuck off
>>
>>58354872
>>58359219
Already been posted you bellend
>>
Yeah, Ocaml really is the best lang.
>>
>>58359219
Either retard "alt-right" or SJW false flag, because it's obvious the person posting this doesn't actually mean it.
>>
>>58354286
What's the goto book for C these days? Has C11 changed it?
>>
>>58359265
C Programming: A Modern Approach or C Primer Plus
>>
>>58359265

whatever you do dont fall for the K&R meme
>>
>>58358516
Why mystique never wear any clothes in it's normal form? Why she doesn't have a vulva?
>>
>>58359285
do you say "meme" in real life?
>>
>>58359265
No because there does not exists compiler that supports c11.
>>
File: batman.gif (442KB, 500x375px) Image search: [Google]
batman.gif
442KB, 500x375px
>>58359294
only if they're dank
>>
>>58359285
You mean The C Programming Language? Why.
>>
>>58359294

no cause meme in my native language is Gedankeneinheit
>>
>>58359300
>gcc
>>
>>58359284
Which would you pick first.
>>
>>58358516
If only Python had decent pattern matching.
>>
>>58359319
>does not support <threads.h>
>>
>>58359219
>There are blind programmers

Well, huh
>>
>>58359327
First one only because I didn't read the other
>>
>>58359339
I mean it has an -std=c11 option so I assume it does what it says.
>>
>>58359339
muslel has threads.h
>>
>>58359353
Threads I don't think is required, so gcc doesn't seem to care about them.
>>
>>58359359
Yeah but glibc does not so go fuck yourself
>>
Is Go any good? Taro liked Go but then he went away. Maybe it was because he used Go?
>>
>>58359252
Oh yeah.
>tfw you're paid to use the best language ever.
>>
>>58359379
Literally use anything relevant like ocaml, sml, haskell, common lisp
>>
File: coding_blind.png (62KB, 789x421px) Image search: [Google]
coding_blind.png
62KB, 789x421px
>>58359219
And he's for real: http://camlorn.net/pages/about.html
Now I feel like a useless shit, sitting here watching youtube and lurking on 4chan or spending my work hours browsing the internets.
>>
File: 1483543721292.png (87KB, 853x621px) Image search: [Google]
1483543721292.png
87KB, 853x621px
>>58359379
- GC.
- No generics.
- Outdated type system.
- No ADT.
- No pattern matching.
- Not enough functional stuff.
- No RAII/IDisposible/Context managers.
- Ugly syntax.
- The most retarded and unsafe error handling story after C.
- Structurally typed interfaces instead of proper interfaces/type classes/traits.
- NIH infrastructure with authors spending years reinventing stuff instead of using LLVM.
- Community comprised of mostly python-kiddies.
Overall the language was designed to be as simple as possible and then even more simple so Google can train code-monkeys on an industrial scale, the only good thing about it being coroutines.
>>
File: kys.jpg (37KB, 600x600px) Image search: [Google]
kys.jpg
37KB, 600x600px
>I'm a programmer
>Yeah? What language do you use?
>HTML
>>
>>58359437
can we please stop bullying uriel
he has been dead for ages now
>>
>>58359377
>glibc
xd
>>
>>58358088
You could allocate a third variable equal to the value of y, and just keep that around until you need it.
>>
Is there a decent C# book with little exercises throughout?
>>
>>58359622
That's Not My Tractor
>>
>>58354872
>major rust contributor is blind
explains the syntax. practically looks like Braille
>>
>>58359507
woah man, can't you like express like all code, descriptively, if its all a turing machine
hold on i got to go hit the bong
>>
>>58358014
Yes it will. There will be a standardized network library based on boost asio.
>>
>>58354639
Are you a fucking retard
>>
>>58354740
>>58354787
>>58354808
whose surprised nerds have hard ass time understanding contextually relative qualifiers
>>
>>58359563
hey it may not be perfect but its the best we've got god darn it
>>
What if instead of making all these retarded "c killers" that will never get anywhere the devs would put their effort into making better/safer libraries for C.
>>
>>58359437
>>58359538
go is shit and fuck fallen off the train long ago nigga rob pike
>>
>>58359851
>you will never be so mad about a programming language that you make an incomprehensible shitpost like this
>>
>>58359622
Yellow Book:
http://csharpcourse.com/

Free PDF on page, lots of code samples to download, too.
>>
>>58359622
lmao I like my books the other way around theory puts me to sleep
>>
>>58359833
how could anyone assert their superiority online if we'd all do the reasonable thing
>>
>>58359833
You mean C++
>>
>>58359868
you have hard time reading huh? or did you need that phrased as an formally correct syntax tree?
>>
>>58359917
disgusting unpure oo garbage
>>
What exactly makes C++ bad?
>>
File: anime tiddies.png (30KB, 803x533px) Image search: [Google]
anime tiddies.png
30KB, 803x533px
>>58359931
Not even the robots can figure out what the fuck you were saying, mate.
>>
>>58359972
it is all FUD
>>
>>58358148
nem rossz :^)
forraskod?
>>
>>58359972
C it's based on.
>>
>>58359994
I assumed as much but I want to see what people say.
>>
>>58359011
start by using a Makefile
then come back
>>
>>58359088
You spelled leaky abstractions wrong.

>>58359310
Standard changed a lot from back then. Also code in it is styled way differently from standard today (at least it's consistent and similar to GNU C style standard, but it's still ugly)

>>58359833
What if instead of making all these retarded "COBOL killers" that will never get anywhere the devs would put their effort into making better/safer libraries for COBOL.

Let's face it, vast majority of business is still in COBOL and it ain't going anywhere.
>>
>>58359975
this is a very brutal self own, thanks friend
>>
>>58359972
Two things

>writing drivers, kernels or other "close to the metal" software
>when C++ can't optimize your code

That's it. There's no other reason not to use C++, unless you're a company manager and your programmers are C gurus and you want to leverage their experience.
>>
>>58360059
I mean when the C++ compiler you're using. But that would by an extremely specific case anyway.
>>
I have c++ code that I wrote without using Visual Studio, that I'm compiling from the command line using Visual Studio ("cl" command).

How do I change the icon of the exe file that the compiler outputs?
I don't have an actual VS project so I can't change it from the Visual Studio.
I have my .rc file but I don't know how to include it during the compile.
>>
>>58360059
>>58359975
>>58359437
>>58360025
Please don't reproduce
I met many retarded people in my years on this site but you easily made it into the top 10 with this

You actually don't understand shit, so please let me give you this one advice, and please take it:
You are horribly stupid and it hurts, don't ever try to spread the shit you believe to know about anything ever again.

Now please try to think about the shit you're telling us here for at least 5 minutes and maybe you find the giant flaws in your logic all by yourself.
No one is here to give you private lessons. Maybe google or wikipedia to have a basic idea of the subject?.
If you still don't get it then, just kill yourself.
>>
>>58360121
So... The I have no evidence personal attack argument?

I admit C++ has (like most other languages) better abstraction facilities than C, but they are still fundamentally unsafe and limited, especially when compared to FORTH and Lisps.
>>
File: adhominew-blog-post-042815.jpg (20KB, 674x357px) Image search: [Google]
adhominew-blog-post-042815.jpg
20KB, 674x357px
>>58360121
>>
>>58360059
c++ has brutally complex semantics so you incur massive programmer education and maintenance costs, no matter limiting your number of competent applicants by an order of magnitude.
of course you __could__ use an in-house subset of the language but that shit never works since you're stuck with the turbonerd greybread ecosystem
>>
>>58360121
lmao at this weak ass attempt at an insult.
you realise you sound like a stereotypical small dick nerd from a tv show?
>>
File: lisp_v_java_v_c.png (63KB, 426x565px) Image search: [Google]
lisp_v_java_v_c.png
63KB, 426x565px
Why do people still insist lisps are slow?

This study was conducted using 16 programs in each language. For lisp 12 were in common lisp and 4 in scheme.

Having access to far greater expressive power and abstraction facilities doesn't mean sacrifice in power.

http://www.flownet.com/gat/papers/lisp-java.pdf
>>
>>58360236
uh could you summarise some choice bits from the paper regarding its methodology and such?
because you have to be a crazy motherfucker if you thing i'm going to read all that without getting paid
>>
>>58360236
> I take my idea of programing languages performance from 17 years old study
How desperate you have to be, really. Meanwhile in the present you can just look at https://benchmarksgame.alioth.debian.org/u64q/lisp.html
>>
File: 1482164713193.gif (178KB, 281x484px) Image search: [Google]
1482164713193.gif
178KB, 281x484px
>>58360188
>turbonerd greybread ecosystem
>>
>Before winter break, working on research
>Visual Studio won't fucking break all on drivers even after shit tons of troubleshooting
>Decide to put off fixing it until after the break
>Come back
>Despite no updates to anything, shit's working again
>I have no idea what caused the problem, or what fixed it

>>58360079

I can't think of many CPU targets that aren't supported by GCC or Clang, which are both incredibly good at optimizing C++...
>>
>>58355408
where did you get that info?
>>
>>58360295
It's four (4) fucking pages m8.

It's basically a redo of previous study, with lisp added to comparison.

Results:
Comparable speed to C++, comparable memory use to Java, way faster development time.

>>58360323
Lisp code (well, probably most of the code in other langs here) is horrible here and not optimized really well.

A bit more recent study (I can't find it right now, I think it's cited in some Paul Graham's article) compared java, c++ and common lisp on variety of problems. Common lisp beat c++ on 2 problem areas, and was on average 5-15 times slower. Java was 8-200 times slower than c++. Granted many of these problems were in functional domain.
>>
Trying to reproduce this effect >>58359088 in every possible way but it's getting painful
>>
http://www.strawpoll.me/12045680
>>
>>58360450
>using discord

You're _all_ faggots.
>>
>>58360450
what's the discord?
>>
>>58359219
rust users on suicide watch how will they ever recover c
>>
File: Alyosha! - No Thank You.png (287KB, 798x644px) Image search: [Google]
Alyosha! - No Thank You.png
287KB, 798x644px
>>58360450
>Using discord
>>
>>58360376
you fucker got me
>>
>>58360450
>joining the autie speak club.
>>
>>58360411
> Comparable speed to C++, comparable memory use to Java, way faster development time.
*Representing the state of affair in the year 2000, before modern CPU, optimization techniques and JIT compilers.
>Lisp code (well, probably most of the code in other langs here) is horrible here and not optimized really well.
You're welcome to contribute your own, preferable in idiomatic Lisp and not in C coded in Lisp. I've heard it several times, I wonder why no one contributed better implementations yet.
>Paul Graham
I don't get why people cite him as an authority. He may be a good businessman and an author, but I doubt he wrote any code in the last 20 years, except maybe for yet another my-own-take-on-lisp-written-in-lisp-no-one-gives-a-shit-about aka Arc. His two decades of Lisp evangelism were a total failure and had no impact on the industry at all.
>>
prices = [12.50, 9.99, 7.75, 6.00, 1.89, 25.00]
def smallest_and_largest():
mini = min(prices)
maxi = max(prices)
answ = [mini, maxi]
return tuple(answ)
print(smallest_and_largest())


WHY DOES IT PRINT A TUPLE AND NOT A LIST?
goddamn I hate python
>>
>>58359826
totally and factually incorrect
>>
>>58360616
>return tuple(answ)
>>
>>58360616
*sigh*
prices = [12.50, 9.99, 7.75, 6.00, 1.89, 25.00]
def smallest_and_largest():
return [min(prices), max(prices)]
print(smallest_and_largest())
>>
>>58360671
>>58360679
oh

thanks
>>
>>58360599
Yes, he is an author and one of the best authors lisp has. He and Norvig are probably the two persons who understand lisp best and as such can act as authority.
>>
>>58359219
issue#9876

the builtin help() function is transgressive towards trans/disabld people. if help() is called indirectly it could be very triggering to our disableism community reducing their personal autonomy and their CHOICE to call help().
>>
>>58360737
can't find that issue
>>
File: browser #113.webm (3MB, 1920x1080px) Image search: [Google]
browser #113.webm
3MB, 1920x1080px
>tfw fixing bugs in your code that you weren't even aware of
code review is actually useful
>>
is c++ the most supported langauge out there?

i'm going ot teach myself progarmming for the new year and i want to make sure the language i choose has a lot of libraries, and support.
>>
>>58360839
don't reply to nazis sorry
>>
>>58360656
you are one of those weird little nerds who type /s after jokes aren't you
>>
>>58359404
Why doesn't he develop a graphics library? Xddddd :^)
>>
is it worth investing time in rust, or should i keep my filthy fingers to f#?
>>
>>58360878
actually no
>>
>>58360839
You should learn APL, it stands for Aryan Programming Language. Its especially good for beginners. 1488 let's rim in hell white brother
>>
>>58360888
rust is good
>>
>>58360888
Rust is a hell of a lot better than F# if you don't care about .NET.
>>
>>58360888
It's worth a try, and it has many things in common with F#.
>>
New thread:
>>58361105
>>58361105
>>58361105
>>
Is there a library to run a Google search, preferably in a c library?
>>
>>58361108
You may be retarded
>>
>>58359379
It's very good for building servers. Absolute shit for mostly anything else.
>>
File: 1481608948974.jpg (18KB, 636x398px) Image search: [Google]
1481608948974.jpg
18KB, 636x398px
>>58354427
tfw
>>
>>58359300

PellesC supports it
Thread posts: 313
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.