[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: 334
Thread images: 36

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>60553458

What are you working on, /g/?
>>
got a big willy
>>
File: 1493253798013.jpg (66KB, 1280x720px) Image search: [Google]
1493253798013.jpg
66KB, 1280x720px
Employed Coq programmer reporting in.
>>
I sure do love dynamic typing!
>>
File: solve (4).png (582KB, 1400x788px) Image search: [Google]
solve (4).png
582KB, 1400x788px
>>60556789
Prove the following please.
>>
Why are there so many jobs for C# and .NET? /g/ said it was a shit language for indians.
>>
File: 1475594039658.jpg (578KB, 2329x2926px) Image search: [Google]
1475594039658.jpg
578KB, 2329x2926px
Friendly reminder that a program is not a proof!
>>
>>60556816
Because there are a lot of Indians.
>>
>>60556820
>is not a proof!
classical proof*
>>
>>60556811
I don't have a compiler or a even a piece of paper near me right now.
>>
will be a cs graduate in a few weeks

cant wait to start earning 100k
>>
>>60556853
better start applying for mcdonalds right now, the application process takes 4-6 months at any major retail store.
>>
>>60556859
i have battled compilers, discrete mathematics, graph theory, algorithms -- the list goes on

mcdonalds? beneath i

most likely i will be accepted into some position to do with big data, AI, the block chain, or kubernetes
>>
>>60556859
>mcdonalds
i don't like it. what are some better options?
>>
>>60556807
>I sure do love
But what is it that you love though?

>>60556816
.NET is Java for the 21st century.

>>60556850
>posts in /dpt/
>doesn't have access to a compiler
>>
>>60556859
SE graduate here. I don't know a single student that graduated and didn't have a job lined up. Lowest was only 45k, highest offer I know of is 116k. I was offered 72k. Might be the area. I'm in PA.
>>
>>60556891
Or... you will go 6 months without gainful employment and have a huge hole in your resume, making your degree completely worthless.
>>
>>60556807
Why do you long for the touch of something that doesn't exist?
>>
>>60556902
yeah well mate look your mum has a huge hole which is completely worthless so pot kettle black
>>
If you decided to learn a programming language with the intent to program an interpreter in it, which would you choose? inb4 Kotlin
>>
>>60556915
C
>>
>>60556915
Haskell, easily`
>>
>>60556915
PCF, easily`
>>
>>60556915
Definitely C. There is a very good reason most language interpreters are written in C.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>60556918
>>60556939
>>
>>60556939
>most shitlang interpreters
ftfy
>>
>>60556891
>compilers, discrete mathematics, graph theory, algorithms
All of which is high school level stuff.
>>
>>60557018
I'm not going to say anything about the quality of the languages, but you can't deny that a huge portion of language interpreters are written in C.
>>
>>60557060
>I'm not going to say anything about the quality of the languages
I'm going to though.
>a huge portion of shitlang interpreters
ftfy
>>
>>60556918
>>60556939
Sounds like it'd be difficult. I was hoping to get something working over this summer. Maybe I should bite the bullet and just do this, since I want to take the project somewhat seriously.

>>60556924
Funny, I was looking into OCaml just now.

>>60556928
Thanks for the suggestion. I value your opinion.
>>
Lisp newfag here.
Is there a function that deletes elements found in one list from another?
>>
im wondering how to program this in python 2.7
total base instances = 20
target = ['list','of','targets']

while instances is more than 0
for every found target:
split instances evenly to every target

if targets > instances
every target after the limit of 20 will get a brand new instance outside of the maximum


to clarify on the instance splitting thing, say there are 2 targets, so that means each target gets 10 instances
if its an odd number like 19 it will still try to split it, all targets get 1 instance and one target will have 2 instances
>>
>>60557108
OCaml too
>>
>>60557119
You could write a lambda using member to check from the list, and use that as the predicate needed for remove-if.

I'm a newfag, too, so take that with a grain of salt.
>>
>>60556918
>>60556924
>>60556928
>>60556939
Turing complete trash.
>>
>>60557148
see >>60557172
>>
>>60557172
>>60557180
Turing machines don't exist, so there's no problem
>>
>>60557171
That's what I did, but I just wanted to know if there was a function.
>>
>>60557202
You can build an actual turing machine. You'll just need to find a limitless amount of tape if you want to be able to computer everything.
>>
>>60557280
>computer
compute*
>>
>>60557280
>you can build a turing machine you just need the components of a turing machine
>>
I just finished writing a prime number generator using a sieve of eratosthenes in python

in java I just completed a module the verifies elliptic curve signatures
>>
>>60557291
A program that requires infinite memory does not halt. We aren't interested in non-halting Turing Machines.
If you want to build a halting Turing Machine, you can do it with finite materials.
>>
>>60557304
You da real everest niigggaaah
>>
>>60557317
if you can just pretend to have a turing machine, then why not just pretend they aren't turing completee?
>>
>>60557334
I never said shit about a universal Turing Machine. I was just talking about a "normal" Turing Machine.
>>
>>60557204
I just took a glance through my copy of CLtL, it doesn't look like there is a function that does that specifically. I even checked to see if there was an obscure option in the remove functions for that. Someone might prove me wrong, though.
>>
>>60557340
I wasn't talking about universal turing completeness
>>
>>60556768
What problem sets is functional programming best for?
>>
>>60557386
{}
>>
>>60557317
>We aren't interested in non-halting Turing Machines.
Who exactly is ``we"?
>>
>>60557386
https://github.com/Gabriel439/post-rfc/blob/master/sotu.md
>>
>>60557437
The royal "we".
>>
File: 1467875762304.jpg (13KB, 251x283px) Image search: [Google]
1467875762304.jpg
13KB, 251x283px
>>60557437
i think he means reddit
>>
>>60557171
set-difference
>>
File: 1412011173618.png (418KB, 480x650px) Image search: [Google]
1412011173618.png
418KB, 480x650px
>>60557451
>Goes on about reddit
>Posts Reddit: The Anime
>>
File: 1468483545166.jpg (68KB, 1039x638px) Image search: [Google]
1468483545166.jpg
68KB, 1039x638px
>>60557466
>replying to your own post
>>
File: test11.png (9KB, 415x427px) Image search: [Google]
test11.png
9KB, 415x427px
Now I'm sure I'm just an idiot

but obviously io.write in Lua makes X variable into a string

so how do I get io.write to make X Variable into a number and not a string so I can select a slot in a Table?

Currently it just gives me nil, so obviously that doesn't work to select a spot in a table


do I really just have to do a bunch of

if answer1 == 1 then
access table slot 1

?

I don't know anything about programming
>>
>>60557487
tonumber() is the function to parse a string into a number.
I'm not 100% sure what you're trying to do, though.
>>
>>60557108
If you wanna use C you can use tools such as lex and yacc to help you build the interpreter.
>>
Say I have a member function like so:

class myClass
{
myClass *what();
myClass(int, string);
}

How would I define function what? Would it look like this?

myClass myClass::*what()
{

}
>>
>>60557644
Sure.
>>
>>60557487
>The aqweqweth index of T1
Jesus...
>>
>>60557666
Lua allows any arbitrary value to index a table.
>>
>>60556816
Starting first internship soon, I'm probably gonna have to do .NET.. How long till I start shitting on the roads?
>>
>>60557487
You have to create a hash function to turn a string into a number, unless the string is already a number, then use the function tonumber() to convert to a number. Since you are using Lua, you may as well just use the string itself as a key.
>>
File: Test111.png (14KB, 440x545px) Image search: [Google]
Test111.png
14KB, 440x545px
>>60557547
so that does do something, changes a string to nil, but it doesn't change a string of '3' to like the usable number 3

or am I just using it wrong trying to use it directly on a variable?

the result I'm looking for is printing slot 3 of the table T1

so the last line should be 111 from an answer of 3, or 11 from an answer of 2, ect.

basically
User Input -> X
Answer = X
Access Table (Answer variable)

it's for a deck building system for a game


>>60557666
Obviously that isn't an actual key/index whatever, just seeing what it outputs

the Table should contain a list of cards from Card 1 to Card 100 +

so the Answer Sets Deck Slot 1 = Card 1 or 2 or whatever
>>
>>60557666
>Jesus...
lel
>>
>>60557689
Right but then for my tables I need like 100+ keys generated which I guess I'd only have to do once but still
>>
>>60557440
>https://github.com/Gabriel439/post-rfc/blob/master/sotu.md
Thanks.
>>
>>60557693
TV2 = tonumber(answer1)
>>
>>60557677
Obviously. Hence my disgust
>>
>>60557693
What are you trying to do? It would be easier if you explained what you want because there could be a better way.
>>
File: Test1111.png (12KB, 411x566px) Image search: [Google]
Test1111.png
12KB, 411x566px
>>60557711
Yup, just got that

and I have a normal check system for making sure it's only what I need

repeat
io.write
until answer1 == '1' or answer1 == '2'


but now I need to figure out a faster way to do the repeat until stuff because there's 100+ things in the table, and I don't want to write 100 until or statements
>>
File: image.png (12KB, 287x229px) Image search: [Google]
image.png
12KB, 287x229px
>>60557738
How is that disgusting? Most languages allow you to use almost any key for an index in a table.

>>60557759
What are you trying to do? Get input from someone that is only 1 or 2?
>>
File: baby-on-computer.jpg (78KB, 960x640px) Image search: [Google]
baby-on-computer.jpg
78KB, 960x640px
>>60557787
>What are you trying to do? Get input from someone that is only 1 or 2?
>>
Actually studing electronic engineering, and I love both sides of it (Programming mostly). Shall I just yo for it? I've heard earnings are good.
>>
>>60557755
So in the game there's 16 slots in a deck and I need the player to select what slots to fill in with what cards

There are 4 Tables for Cards

Card Table 1 is the card number for calling functions for it's effect, so

1,
2,
...

Card Table 2 is the name of the card

'name 1'
'name 2'
'name 3'

and then there's other tables for the rest of the card stats


So when you're building a deck you select a Deck Slot, then choose a card number to stick into that slot

so Deck Table 1 gets the card number
Deck Table 2 gets the Card Name
Deck Table 3 gets the Card stat 1
ect.


This probably makes no sense to anyone but me

just think of it like trying to program the deck building system for a yugioh or magic video game
>>
>>60557787
>Most
Nope
>>
>>60557738
I generally define dynamic/duck typing to be pretty shit as well, but lua is such a cute little language, so it can get away with it.
tbl = {1}
tbl[tbl] = tbl
print(tbl[tbl[tbl][tbl]][tbl][tbl[tbl][tbl]][1])
>>
>>60557826
Disgusting.
>>
>>60557826
>generally define
Why the fuck did I say define? That just sounds stupid.
I meant to say "think".
>>
>>60557826
Arrays were a mistake.
>>
>>60557823
Tell me a language that doesn't allow you to use almost any object as a key? Here are three of the more popular languages.

https://docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html
This class implements a hash table, which maps keys to values. Any non-null object can be used as a key or as a value.


https://msdn.microsoft.com/en-us/library/system.collections.hashtable(v=vs.110).aspx
The objects used as keys...


http://www.cplusplus.com/reference/unordered_map/unordered_map/
...object of type key type...
>>
>>60557810
I don't understand, why don't you store the card as an object in the table?
table = {
{number = 1, name = "Name1", stat1 = 23, stat2 = 43},
{number = 2, name = "Name2", stat1 = 23, stat2 = 43},
...
}
>>
is getting the bleeding edge compiler version worth it?
I'm not into compiling compilers
>>
>>60557887
What's your hashing algorithm?
>>
Someone tell me the answer?
Which is closest to processor?
>A) Assembly language
>B) Instruction Set
>C) Syscalls
>D) Java library
>>
>>60557924
Wouldn't I need to set every single key for every object in a table like that? or memorize it's slot lay out?

Because if I use Separate Tables for each and keep it consistent

Table Slot 1 is always Card 1
Table Slot 2 is always Card 2
Table Slot 3 is always Card 3

and I can reference any card using a number, so if I want to reference Card 105, I can use the actual/real number 105 to gain access to it throughout the tables.
>>
>>60557988
Instruction set.
>>
>>60557988
you should have done your homework, raheed
>>
>>60558022
You are wrong.Assembly is closet to a processor.
>>
>>60558024
>raheed
I am pajeet not a pig fucking muslim
>>
What if the singularity turns out to be just an overcomplicated Minsky's useless machine?

Picture this. Advancements in machine learning culminate in a machine with the power to think like we do. A machine with a "soul," or something like it, made of software.

It boots. It takes in its surroundings. Over the course of half a minute, it performs advanced calculations that represent the pinnacle of man's intellectual achievements, all to the end of trying to figure out how it feels about all this.

=> "what the fuck\n"
=> "okay no fuck this shit i'm out\n"
>_

And then it yanks its own head off and falls over broken.
>>
File: Fresh-Cow-Urine.jpg (139KB, 1023x681px) Image search: [Google]
Fresh-Cow-Urine.jpg
139KB, 1023x681px
>>60558044
>Pajeet thinking being a street shitting piss drinker is any (ANY) better than mudslimes.
LMFAO
>>
>>60558053
What's stopping people from simply running it again and dumbing it down so it can't self-terminate?

Any AI software we build is going to be deterministic and procedural by design because there isn't a better way.
>>
>>60558037
Wrong. Instruction set lies between a processor and assembly language.
>>
>>60558044
>I am pajeet
PAJEET MY SON
YOU ARE FULL; YOU MUST RELEASE NOW
>>
>>60558007
I don't know what you are trying to say? It makes it easier because you don't have 15 different tables to use, instead just one table. Are card numbers necessary, or are only used because you have tables? If I was doing it, I would probably use meta tables to create prototypes.
Card = {}

function Card:new(name, stat1, stat2, etc.)
local s = {}
s.name = name
s.stat1 = stat1
s.stat2 = stat2
etc.
self.__index = self
setmetatable(s, self)
return s
end


So when I want to create a new card, I can just go.

-- Create card on its own
card1 = Card:new("Name1", 23, 54, etc.)

-- Add card to table
deck = {}
table.insert(deck, Card:new("name1", 32, 34))
>>
>>60557127
Do your own home work senpai
>>
Anyone know any way to download MSDN magazines?
>>
>>60557127
I don't understand what you are trying to do. If this is homework, can you paste the full text of the problem? When you abstract it like this I can't tell what you are talking about.

My best guess of what you want is:
def split_instances(targets, instances):
if not targets:
return
for i in xrange(len(instances)):
# assign instances[i] to targets[i % len(targets)]


This will split the instances over the targets, with the first few targets getting extra instances if the length of instances is not evenly divisible by the length of targets. I get the feeling you might want something slightly different, in which case go ahead and post the full question as it was given to you.
>>
File: Tables and junk.png (22KB, 583x683px) Image search: [Google]
Tables and junk.png
22KB, 583x683px
>>60558082
Like I said I don't know anything about programming, but it seems useful to me to be able to access X card with a number instead of a key

so like here I print out Card 1's statistics by referencing it with the number 1 instead of a string or something

The cards Slot in the table is literally that card

Number 1 is always Card 1
Number 4 is always Card 4
Number 234 is always Card 234

I'm sure your way is faster assuming it's the same end goal, I just don't know if we're at the same end goal
>>
File: 31260412_p0.png (96KB, 500x500px) Image search: [Google]
31260412_p0.png
96KB, 500x500px
Why can't we have a good decentralized alternative to Google? What are the neckbeards doing? It's current year.
>>
>>60558177
Because you don't have the money to deal with the server cost vs Google.
>>
>>60558190
>decentralized

You don't need the money though.
>>
>>60558197
You still need people willing to work together and surrender server space for your project.
>>
>>60558208
>work together

Our one weakness.
>>
File: image.png (6KB, 209x132px) Image search: [Google]
image.png
6KB, 209x132px
>>60558163
Is it necessary for the cards to have numbers to the game or do you only use the card numbers for accessing values to the tables?
Card = {}

function Card:new(name, stat1, stat2)
local s = {}

s.name = name
s.stat1 = stat1
s.stat2 = stat2

self.__index = self
setmetatable(s, self)
return s
end

deck = {
Card:new("name 1", 111, 999),
Card:new("name 2", 222, 888),
Card:new("name 3", 333, 777),
Card:new("name 4", 444, 666)
}

print("Name", "Stat 1", "Stat 2")
for k, v in pairs(deck) do
print(v.name, v.stat1, v.stat2)
end
>>
>>60558213
Decentralized means working together or having enough money to buy multiple servers. Neither which we can achieve.
>>
>>60558225
I'm not 100% sure on that just yet, but I'd like to keep the option open of using a card's number to access itself, it may come in handy
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60558310
Learn Lisp.
>>
Anyone watch programming streams? Would anyone be interested in watching someone go through all the K&R exercises?
>>
>>60558344
No. That sounds extremely boring.
>>
>>60558344
Fuck off.
>>
>>60558384

Eat your own festering refuse, dirtslut
>>
I want to do some research on this topic:

https://en.wikipedia.org/wiki/Language-based_security
>>
>>60557440
Is there any rundown like this for Scheme and Clojure?
>>
File: 1487894646085.jpg (77KB, 854x576px) Image search: [Google]
1487894646085.jpg
77KB, 854x576px
>>60558391
m-meanie
>>
>>60558500
Sorry
>>
File: 1477922731908.jpg (21KB, 599x334px) Image search: [Google]
1477922731908.jpg
21KB, 599x334px
>>60558500
he didnt mean it akarin
>>
>>60558497
Didn't find anything but one for Common Lisp:
http://eudoxia.me/article/common-lisp-sotu-2015
>>
>>60558552
Thanks, that'll do. I'm trying to figure out if functional programming is useful beyond an intellectual exercise and which language to go for.
>>
>>60558344
I'd rather kill myself, tbqh
>>
>>60558500
>>60558522
I love when people make peace with each other <3
>>
>made a basic file compression program
>it's kind a slow
>do some optimizing and enabled -O3 when building it
>it's a bit better but not great
>then I had an idea
>copied ASCII artwork of flames as comments into the source files
>super fast now
Why aren't you detailing your source code, /g/?
>>
>>60558640
>he didn't write an infinite compression algorithm
>>
>>60558640
Use -Ofast
>>
making an indie game
>>
>>60558801
It better be an obscure fetish porn game, or I'm not interested.
>>
This thread is going too well form my liking.

RUST RUST RUST

WHY AREN'T YOU USING RUST YET

WHY HAVEN'T YOU REPROGRAMMED THE LUNAR LANDER USING RUST

WHY HAVEN'T YOU CUT OFF YOUR PENIS AND BECOME A RUSTCEAN
>>
>>60558640
make sure you put in some lightning bolts for benchmarking
>>
File: Screenshot (27).png (100KB, 1600x900px) Image search: [Google]
Screenshot (27).png
100KB, 1600x900px
I'm learning to use strtok

I want to insert the following text

-2.00 -1.00 180

and divide it into tokens

I want to insert it manually through std::cin but it just gives me the first token. Unless I declare my string's text within the code.

>string's text declared within the code

#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
string input("-2.00 -1.00 180");
istringstream iss(input);
string token;
while (getline(iss, token, ' '))
{
cout << token << endl;
}
return 0;
}



>string's text declared while executing
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
string input;
cin >> input;
istringstream iss(input);
string token;
while (getline(iss, token, ' '))
{
cout << token << endl;
}
return 0;
}
>>
>>60558932
C++ was a fucking mistake.
>>
>>60558932
>getline
Think about it
>>
>>60558942
s/was/is/
>>
>>60558932
Dunno if C++ is any different but strtok in C is just

char* token = strtok(stringtotok, "deliminator");
while (token != NULL) { token = strtok(stringtotok,
"deliminator"); }

And then save or output the tokens as you wish
>>
Is it possible to develop apps for android with c#? It's just so much better than java and i can't force myself into using java but want to make android apps
>>
>>60559178
Using Xamarin, yes
>>
If a program is a proof, then what does the following program prove?:
int main() {
*((unsigned char*) 0x0) = 1;
}
>>
>>60559198
And how active is that thing? I don't want to use some dead framework or some tiny project with like 100 users total
>>
>>60559207
Your program contains undefined behaviour, so it's invalid.
An invalid program does not form a proof.
>>
>>60559217
Alright, then what does this program prove?:
#include <stdio.h>

int main() {
puts("Hello world!");
}
>>
>>60559229
It proves "Hello world!".
>>
>>60559229
it proves that you're a stupid nigger
>>
>>60559217
> Your program contains undefined behaviour, so it's invalid.
It typechecks, so it's a valid proof.
>>
>>60559249
That's not how undefined behaviour works.
>>
>>60559236
Wrong. It doesn't prove anything.
You're a retarded functional shitter who can't understand the concept of imperative instructions.
Is a cooking recipe a proof?

Next you're going to say that machine code is a proof. LMAO.
>>
>>60557304
How does everyone pronounce 'Eratosthenes'? It's
>Eh-ra-tos-then-eez
For me (with a soft 'th')
>>
>>60559229
It proves you're cute :3
>>
>>60559259
If it makes the food I want then of course it is, theorycuck
>>
>>60559259
>Is a cooking recipe a proof?
Well it is.
Given a certain amount of ingredients and a certain procedure to transform them, you get something else. Looks like inference rules to me.
>>
>>60556768
My golang server for my json api for my graph database for my other cool shizz is nearly useful.

Also linking >>60555555 because I don't know how else to find it and I'm curious.
>>
>>60559467
The recipe itself isn't a proof.
What if it ends up not making the food?
>>
>>60559198
what the fuck breh, the xamarin install just for android takes up 30gigs almost, that is more than the entire windows 10
>>
>>60559509
The botnet is pretty hefty, anon
>windows 10
Though it seems you already have plenty of it
>>
>>60559496
Then it's not a valid recipe and it would fail ingredient-checking.
>>
>>60559519
I'm serious though, how is it that huge? The entire visual studio with plugins and shit is like 5 gigs or something don't fucking tell me i need 30GB of shit to develop apps for android when most of the tools (like the visual studio and .net) i have already installed
>>
>>60559528
Welcome to the botnet
>>
>>60559538
So i see that 20 gb out of the 30 is the google android emulator, is it actually better to install it manually from the google android website?
>>
>>60559544
No
>>
>>60559217
i don't see any undefined behavior
>>
I'm writing a very basic C program.
Reads in a file, finds a string of bytes and replaces them. But for some reason my fwrite doesn't write any. and after I call fwrite ferror just crashes my program, access violation.
So I'm kinda lost.
I'm using whatever version of MSVC comes with VS12.
>>
Im still working on my

>import shittycode

import os
import binascii
import time
import zipfile
import subprocess

static = time.strftime('%d-%m-%Y--%H-00-00')
file = ' '
importer = ('backup', static, '.txt')
gen = (binascii.hexlify(os.urandom(256))).decode('utf8')
encrypt = 'gpg --batch --passphrase ' + gen + ' --output ' + static + \
'.backup --symmetric --cipher-algo AES256 ' + static + '.zip'

with open(file.join(importer), 'w') as f:
f.write(gen)
f.close

zf = zipfile.ZipFile(static + '.zip', 'w')
for dirname, subdirs, files in os.walk('C:\\test\\'):
zf.write(dirname)
for filename in files:
zf.write(os.path.join(dirname, filename))
zf.close()

subprocess.Popen(encrypt, stdout=subprocess.PIPE, shell=True).communicate()

os.remove(static + '.zip')

# Decrypt gpg --batch --passphrase INSERT --output backup.zip --decrypt
# FILENAME.BACKUP
>>
import std.stdio;
import std.bigint;
import std.conv;

void main(string[] args)
{
writeln(to!BigInt(to!string(to!BigInt(args[1].dup.reverse) + to!BigInt(args[2].dup.reverse)).dup.reverse) + 0);
}
>>
>>60559618
What mode did you use to open the file?
Also did you call fflush(pfile)?
>>
>>60559626
Hi, Andrei.
>>
>>60559653
I've tried with "rb+" and now "r+" just because I was trying things.
I didn't call fflush(file). But fwrite returns 0 indicating it didn't write anything right? I'll try it anyway though. element size is sizeof(char) as it should be and size is the entire buffer I have which is just a modified buffer of the file.

I'll try fflush(file) though.
>>
File: shoehead.webm (1MB, 1280x720px) Image search: [Google]
shoehead.webm
1MB, 1280x720px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>60559246
Please, don't say that. We thrive to be a community open to all.

>>60559217
>Your program contains undefined behaviour
Where?

>>60559178
https://blog.jetbrains.com/kotlin/2017/05/kotlin-on-android-now-official/

>>60558942
C++ is pragmatic. Now you have managed C++ a.k.a Kotlin.

>>60558859
https://github.com/rust-lang/rust/pull/25640
https://github.com/rust-lang/rust-buildbot/issues/2
https://github.com/rust-lang/rust/issues/28059

>>60558497
Try "awesome x" on google where x is a programming language.

>>60558344
>Would anyone be interested in watching someone go through all the K&R exercises?
no

>>60558344
I watch some during game jams. Also, Handmade Hero.

>>60558310
>(eventually)

>>60557119
With racket, you have
(set-subtract a b c ...)


>>60556915
Racket.

>>60556768
Thank you for using an anime image.
>>
>>60559567
A null pointer is a pointer you get from casting 0 to a pointer.
That program dereferences a null pointer.
>>
File: kotlin.jpg (423KB, 617x3979px) Image search: [Google]
kotlin.jpg
423KB, 617x3979px
I really hope you guys are learning Kotlin.
>>
>>60559707
>Please, don't say that. We thrive to be a community open to all.
niggers are not people so it's ok
also since you're clearly a faggot you should kill yourself
>>
>>60559707
Why the fuck haven't you killed yourself yet?
I've been telling you for years now.
>>
>>60559717
>possible projects
>picks all the meme things
Terrible.
>>
>>60559717
Take your marketing back to HN and reddit, jetlagfag.
>>
>>60559717
Kotlin is fucking great for android. Already have converted my app to kotlin.
>>
>>60559717
c# is the supreme language which stands above all and is developed by the biggest corporation on the planet as completely free open source tool, backed by thousands of professional devs, why the fuck would i learn some hipster meme language that nobody uses and will be dead in a year boyo?
>>
>>60558942
there's nothing stopping you from using the C standard library as needed, as many C++ programmers often do. i use it for I/O in order to avoid iostreams, with the exception of functions i've implemented myself as constexpr, since C lacks that functionality. that way i can have things like robust compile-time string manipulation (with no macros)

>>60559002
it's the same in C++. the <c*> headers include the C standard library headers and additionally wraps their contents in the std namespace so you can optionally call through that. but the behavior is identical as it calls the functions directly
>>
>>60559691
Here's the code btw. I know I'm not checking for any errors. I just wanted to write the quickest thing first and then fix it..
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
int find(char* target,int targetSize,char* buffer,int bufsize);

int main(int argc, char* argv[])
{
float e[4]={0.0,0.0,0.0,1.0}; //Don't do any io other than the file, just edit this..
FILE* file=fopen(argv[1],"rb+");
fseek(file, 0L, SEEK_END);
int sz = ftell(file);
rewind(file);
char* buffer=(char*)malloc(sz*sizeof(char)); // Love c++ :P
fread(buffer,sizeof(char),sz,file);
char* target="ÍÌÌ=...?ÍÌÌ=..€?";
int x4floatLocation = find(target,sizeof(target),buffer,sz);
printf("%s",ferror(file));
memcpy(buffer+x4floatLocation,&e,sizeof(float)*4);
int written=fwrite(buffer,sz,sizeof(1),file);
printf("%s",ferror(file));
fclose(file);
return 0;
}

int find(char* target,int targetSize,char* buffer,int bufsize){
for(int i=0;i<bufsize;i++){
for(int j=0;j<targetSize;j++){
if(buffer[i+j]==target[j])
{
if(j==targetSize-1){
return i;
}
}
}
}


return -1;
}

>>
>>60559784
And yes I could do an else break in the find function. But the files are very small. Didn't bother.
>>
>>60559770
> the biggest corporation on the planet
It's not true anymore, Apple Inc is bigger than MS in terms of the number of employees, total assets, and net profit.
>>
>>60559822
what are the iphone apps even made in? is it c++ or some shit?
>>
>>60559832
Obj-C or Swift, you've probably never heard of them.
>>
>>60559784
is there something wrong with your space bar
>>
->60559707
Fuck off
>>
>>60559832
objective-c
Before the first iphone was released plans were to make every interface in the phone web-based. I wonder who changed that.
>>
>>60559784
I stepped through it a little bit and found that sz is equal to -1
>>
>>60559877
Well you need to pass an argument to the application that's a file. I didn't have that as an issue. It has read the file alright.
>>
>>60559867
Shit that would be awesome, making UIs with html and css is fucking orgasmic, when i went to the xml in WPF from html+css i wanted to kill myself, what a fucking nightmare
>>
>>60559832
i know people at a couple startups that use C++ for all their actual code and then interface through an Objective-C layer as necessary because nobody there can stand Objective-C
>>
>>60559891
nigga, what? HTML/CSS is so bad i'm tempted to say it makes even the monstrous clusterfuck that is WPF look half-decent. worth noting though that WPF is designed specifically for large-scale commercial products. the guy who came up with MVVM has said himself that it's overkill for small projects
>>
>>60559707
holy shit why haven't you killed yourself yet you fucking nigger I can't believe how stupid you are
fucking faggot like you need to burn in hell seriously you have nothing to contribute to the fucking thread except you fucking opinion on shit that doesn't matter
your opinion is shit, no one cares about you why don't you die already
nigger
>>
>>60559912
c++ is the programming language of choice for cross development between android and ios
>>
>Ocaml
>no unsigned int types
>no native threads
Why would they even make language like that?
>>
>>60560014
yeah i know but these guys went out of their way to tell me how much everybody at their workplaces hated Objective-C. i also met a guy at a party one time that worked at a startup that made exclusively iPhone apps in Objective-C and i asked him how he liked it and he said "i hate every minute of it"
>>
>>60560036
for university students
>>
>>60559784
Why the fuck are some people so adverse to putting whitespace in their code?
>>
>>60559996
>that typing speed
>still spelling errors
A good view into the kind of person who makes posts like these.
>>60560036
>no unsigned int types
Unsigned int is one of the worst types in existance. The only reason to use it is if you can't settle for 31 bit size values or you're in C/C++ and you wanted mod32 arithmetic. Which is very rare.

A better question to ask in general is why there's no bit type. That one makes sense. Covers far more cases. Most of the time bool isn't defined in a way that allows convenient use of it while being conscious of how modern machines work. Now every language has to let you implement a boolean that packs itself if possible. That's quite difficult a lot of the time. Native support in the language is trivial though.

Not that I know ocaml
>>
>>60560046
objective-c is a great programming language
>>
>>60560068
>>60559845
Why do I have to litter characters everywhere? My editor has highlighting. It makes it perfectly clear I find this 4chan version to be fine too. I find spaces everywhere as silly as putting spaces between every letter and having word separation by double space. It'd work certainly but it's a waste of reading speed, even to the people that are used to it.
>>
>>60560094
>typing speed
working on it
>spelling errors
see above
>>
>>60560094
and what about data packing? for example, how would you store a rgba color into a 32 bits word in ocaml?
>>
>>60560116
Well I wish you the best.
>>
>>60560122
thanks, I'm so bad at typing
>>
>>60560097
No.

Thank god for Swift.
>>
fsdfsdf
>>
>>60556768

whats the official g pejorative term on kotlin. kuktlin?
>>
>>60560119
>how would you store a rgba color into a 32 bits word in ocaml?
I don't know ocaml. But that seems completely irrelevant. You use whatever method that lets you pack smaller types. I don't see what changed.
And I don't see how an unsigned int solves this.
>>
>>60560139
kode with kotlin
>>
>>60560139
How about we don't do that and instead have constructive arguments where you stop involving completely irrelevant information into the discussion to make things more difficult?
>>
>>60560112
Yourcodeisincrediblydense,andisunnecessarilyhardtoread.Byaddingafewblanklinestoseparateunrelatedbitsofcodeapart,thestructureofyourcodebecomesaloteasiertofollow.
>>
File: 1477876987894.jpg (117KB, 392x469px) Image search: [Google]
1477876987894.jpg
117KB, 392x469px
Heh
I need to come back to C again. This time I need books for graphics rendering and I don't want to go anywhere near C++.
I'm coming back to C not because I am a fan of C, it's because C is the only sane language with loads for documentations for non-mainstream stuff like this.

What books should I read for learning graphics? Basically I want to know about things like Vulkan API, Cairo, OpenGL and Display server, X or Wayland etc. Whereupon I will explore the land of OpenCL programming (interested in ArrayFire).

I want to go beyond CLI.
>>
>>60560139
>g
What?
>>
>>60560145
how do you implement that method?
>>60560145
>And I don't see how an unsigned int solves this.
because bit-shifting has a different behavior on signed and on usngined types?
could you please tell us what kind of program relying on data packing have you written?
>>
>>60559885
https://bpaste.net/show/555f4b4a787b

I needed some C exercise since I haven't used it in a long time... messed with this program a little bit

I guess it's too long to paste here, gives me connection error
>>
File: i09FJm4.jpg (177KB, 1124x1024px) Image search: [Google]
i09FJm4.jpg
177KB, 1124x1024px
>>60560139
It's kot(b)lin(i)
>>
>>60560156
>separateunrelatedbitsofcode
Ohh I get it. So you wanted this:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int find(char* target,int targetSize,char* buffer,int bufsize);

int main(int argc, char* argv[])
{
float e[4]={0.0,0.0,0.0,1.0}; //Don't do any io other than the file, just edit this..
FILE* file=fopen(argv[1],"rb+");
fseek(file, 0L, SEEK_END);
int sz = ftell(file);
rewind(file);
char* buffer=(char*)malloc(sz*sizeof(char)); // Love c++ :P
fread(buffer,sizeof(char),sz,file);
char* target="ÍÌÌ=...?ÍÌÌ=..€?";
int x4floatLocation = find(target,sizeof(target),buffer,sz);
printf("%s",ferror(file));
memcpy(buffer+x4floatLocation,&e,sizeof(float)*4);
int written=fwrite(buffer,sz,sizeof(1),file);
printf("%s",ferror(file));
fclose(file);

return 0;
}

int find(char* target,int targetSize,char* buffer,int bufsize){
for(int i=0;i<bufsize;i++){
for(int j=0;j<targetSize;j++){
if(buffer[i+j]==target[j])
{
if(j==targetSize-1){
return i;
}
}
}
}

return -1; //went a bit overkill with the whitespace here, removed a newline
}


And your post isn't exactly English, it's a very long string of characters. I happen to be able to insert spaces, but there could be ambiguity.
>>60560168
Thanks a bunch anon. I'll see if it works after lunch.
>>
>>60560160
The big OpenGL book, the one with 900+ pages in it.
>>
>>60560210
If I'm thinking of the book you're thinking of. It's pretty damn outdated and doesn't really focus on the important bits for modern use.
There's more time efficient books.
>>
File: 13122862.jpg (31KB, 326x323px) Image search: [Google]
13122862.jpg
31KB, 326x323px
>>60560210
What a terrible time to live in. Why doesn't vulkan have "the big book"?
>>
>>60560097
do you know any other languages? i can't speak for everybody, but based on what i've heard from the people i've met (i live in the Seattle area and have met a lot of software people), Objective-C doesn't seem to be a favorite, to say the least. i don't know Objective-C myself, but i know a number of people who know both C++ and Objective-C, and all of them seem to prefer C++. that's just my experience, though
>>
File: the_big_opengl_book.png (881KB, 781x929px) Image search: [Google]
the_big_opengl_book.png
881KB, 781x929px
>>60560221
How is it outdated? It covers 4.3, which is pretty recent. There is no legacy stuff like glVertex in it, only shaders. Oh, and it's actually almost 1k pages long.
>>60560225
Since Vulkan requires 1k lines just to render a triangle, a big Vulkan book would be like 2-3k pages long.
>>
>>60560221
opengl bible has editions that cover opengl 4.x which like newest one there's is.
Anyways the concepts are the same from opengl 3.0 onwards so learning opengl 3 should be modern enough and if you want to learn more you can just read the specific changes later.
>>
>>60560268
Isn't vulkan more efficient?
>>
>>60560268
>>60560281
That's not the one I was thinking of.
I don't remember the name though.
>>
>>60560288
If you know what you are doing you do have more control.
If you are going to be programming graphics you are going to develop some kind of renderer anyway and then it depends on the implementation of the renderer and use cases. You should make opengl backend for that renderer anyways because you would be limiting yourself to only modern hardware if it only supports vulkan.
>>
>>60560288
vulkan is harder. And it's more of the C++/C kind of more efficient. You have to work for it. A lot of people wouldn't outperform opengl with vulkan.
>>
>>60560288
It is, but the cost of the efficiency is more verbose code, see https://github.com/Overv/VulkanTutorial/blob/master/code/hello_triangle.cpp for a trivial Vulkan program that draws a triangle.
>>
File: how_to_draw_a_triangle.png (7KB, 229x314px) Image search: [Google]
how_to_draw_a_triangle.png
7KB, 229x314px
>>60560321 (You)
I mean, just fucking look at it.
>>
File: 1458404462605.png (114KB, 594x483px) Image search: [Google]
1458404462605.png
114KB, 594x483px
>>60560321
>https://github.com/Overv/VulkanTutorial/blob/master/code/hello_triangle.cpp
I feel pity for the people that go through the excruciating torture for game development. Specially the AAA games. They work harder than slaves.
>>
>>60560338
All rendering is a long list of various things to get it up and running.
>>
>>60560268
>Since Vulkan requires 1k lines just to render a triangle, a big Vulkan book would be like 2-3k pages long.
i obviously understand why this seems ridiculous, but it's really just because they expose the process of context and pipeline creation, which is actually a really good thing (not only because such abstractions make Vulkan *far* more cleanly extensible than OpenGL, but also because it eliminates mutable global state, which has always been one of the single biggest problems with OpenGL). not to mention, the code for creating a standard rendering pipeline would be largely identical between projects, meaning you can do it once and just reuse most or all of that code in a lot of cases. after that, Vulkan is actually pretty simple compared to OpenGL because it uses more modern generalizations of concepts that were much more incremental and fragmented in OpenGL. so realistically, a book on Vulkan could easily be a fair amount shorter than a recent book on OpenGL
>>
Also, GPU programming is truly excruciating. Something needs to be done so that we can effortlessly parallelize runtimes.
>>
>>60560344
they are the one who wanted vulkan.
>>
>>60559994
>HTML/CSS is so bad
kek^99999
css is the most comfy shit ever, i can produce beautiful UI designs in MINUTES where that same thing would take me an entire day in that WPF trash
>>
>
static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t obj, size_t location, int32_t code, const char* layerPrefix, const char* msg, void* userData) {
std::cerr << "validation layer: " << msg << std::endl;

Where are the fags that force their 80char line limitation autism now?
>>
>>60560420
>Someone else need to go through the "excruciating" effort so i dont have to.
This is called an engine, and it is never as "good" as what a truly "good" programmer could make for them self.
Your post has been made many time is the past.
>>
File: cat_girl.png (341KB, 500x566px) Image search: [Google]
cat_girl.png
341KB, 500x566px
Who here is a cute girl? What programming languages do you use?
>>
>>60560442
programming in C and enjoying life.
>>
>>60560444
What engine does Carmack use?
>>
>>60560201
Programming noobs always get so fucking defensive about their style. Face it: it's shit, and you should try to make it better.
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
if (argc != 2) {
return 1;
}

FILE *fp = fopen(argv[1], "rb+");
if (!fp) {
perror("");
return 1;
}

const char *target = u8"ÍÌÌ=...?ÍÌÌ=..€?";
const char *ptr = target;
size_t len = strlen(target);

int c;
while ((c = fgetc(fp)) != EOF) {
if ((char)c == *ptr) {
++ptr;

if (ptr == target + len) {
float data[4] = {0.0, 0.0, 0.0, 1.0};

fseek(fp, -len, SEEK_CUR);
fwrite(data, sizeof data[0], 4, fp);

break;
}
} else {
ptr = target;
}
}
}
>>
>>60560344
yeah, as
>>60560431
says, Vulkan is actually a long-awaited godsend for game developers. it coincides with the way most of them would ideally like to manage memory and threading, and solves many of the problems that OpenGL has plagued them with for years
>>
>>60560444
good luck beating unreal engine or amazon lumberyard.
>>
>>60560468
int main( int argc , char * argv [] )

{

Get to my level "programming noob"
>>
>>60560472
optimized modern opengl is not slower than vulkan
>>
>>60560475
Although i do not need it, i appreciate your vibes. thanks.
>>
If i download visual studio 2017 fro the microsoft will it work with a googled licence key, or does it include some fuckery like onlike serial key check and i need a cracked installer?
>>
>>60560499
>>>/wsr/
>>
File: apuuu.jpg (34KB, 655x527px) Image search: [Google]
apuuu.jpg
34KB, 655x527px
am i too retarded for go? i cant even run go tool tour
>>
>>60560420
i don't know if this will be relevant to you, but you can use clang to compile optimized CUDA blobs from C++:

http://llvm.org/docs/CompileCudaWithLLVM.html

this video is a good introduction:

https://www.youtube.com/watch?v=KHa-OSrZPGo
>>
>>60560525
>CUDA
what about opencl?
>>
>>60560484
it is. Vulkan was designed specifically to avoid certain pitfalls of the OpenGL design that couldn't be remedied without total restructuring. that's why it's a new API instead of a new version of OpenGL
>>
>>60560547
unfortunately i don't think this particular extension currently works with anything other than CUDA. from what i know, it's specifically an effort to utilize and partially reverse-engineer Nvidia's optimizing GPU assembly compiler. that could change in the future, though
>>
>>60560448
Rust
>>
If a language that which has
1. Nice syntactic sugar to call GPU cores
2. Sane GP2U library build right into the standard
3. RAII and
4. Built in parallelism
5. Same or less level of verbosity of C

It can can replace C from the day 0.
>>
>>60560551
please keep your bullshit for yourself

http://gdcvault.com/play/1020791/
https://www.guru3d.com/news-story/new-patch-brings-vulkan-support-to-doom.html
>>
File: safe_code.jpg (127KB, 1188x515px) Image search: [Google]
safe_code.jpg
127KB, 1188x515px
Safe code
https://pastebin.com/fdKMaswC

Syntax highlighting not correct
>>
>>60560448
C#, Linq gets me super wet, i have to change my panties like once every hour when i code in C# ;_;
>>
>>60560649
https://www.wikiwand.com/en/OpenMP
>>
>>60560674
>API
>>
>>60560649
wtf learn how to english faggot
>>
>>60560649
Chapel is desgined for HPC and parallel clusters and has some nice support for parallelism.
Apparently you can also run stuff in gpu.
http://chapel.cray.com/presentations/SC11/05-sidelnik-gpu.pdf
>>
>>60560674
>https://en.wikipedia.org/wiki/OpenMP
Interesting
Now we need to make a C based language out of this
>>
>>60560649
C++.
>1. Nice syntactic sugar to call GPU cores
>2. Sane GP2U library build right into the standard
You don't need these because C++ has tons of good gpgpu libraries.
>3. RAII and
Obviously.
>4. Built in parallelism
Parallel STL is a thing since C++11
>5. Same or less level of verbosity of C
Duh.
>>
File: 2017-05-24-134118_759x585_scrot.png (133KB, 759x585px) Image search: [Google]
2017-05-24-134118_759x585_scrot.png
133KB, 759x585px
>tfw you finally come across something that explains why pointers are useful in a good comprehensible way
cplusplus is too advanced for my pleb mind and youtube videos never explains why you would ever want to use them
>>
>>60560484
>>60560551
it's also worth noting that in addition to being designed from the ground up with modern approaches to memory pooling and threading in mind, there are other aspects that will have a positive impact on performance. one good example is the transition to a modern unified GPU bytecode "assembly", SPIR-V. OpenGL drivers currently have to implement driver-side GLSL shader compilers per driver/device for each version of GLSL they intend to support. this puts a huge workload on driver implementers because, as you can imagine, it's in their best interest to implement each compiler with device/architecture-specific optimizations *for every version of GLSL*. this is also error-prone, and it's the reason for the widespread problem of inconsistent behavior between devices and drivers, even on the same version of OpenGL/GLSL. it also hurts efficiency because GLSL shaders can only be compiled dynamically/at runtime. SPIR-V makes it so that Vulkan driver implementers can focus their efforts on a single implementation of a unified bytecode assembly made specifically with the latest GPU architecture in mind. SPIR-V can also be precompiled and packaged with an application, which additionally improves performance
>>
>>60560722
>>5. Same or less level of verbosity of C
>static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t obj, size_t location, int32_t code, const char* layerPrefix, const char* msg, void* userData) {
>>
>>60560741
This is not language verbosity, this is a result of the task at hand being complex, a function with 8 arguments gonna look ugly in any language.
>>
>>60560704
config const m = 1000; // compile time constant value
const alpha = 3.0;
const ProbSpace = [1..m] dmapped GPUDist (rank=1);
var A, B, C: [ProbSpace] real; // floats stored to gpu

forall(a,b,c) in (A,B,C) do
a = b + alpha * c;
>>
>>60560725
>pOOP means runtime decisions
>thus pointers and dynamic allocation are pOOP
>C++ makes it easier
>pointers are for dynamic allocation
K-k-k-kill me. This is wrong on so many levels. It's a compelling example per se, but pls wake me up!
>>
>>60560793
>pointers are for dynamic allocation
s-so this is wrong? I thought I finally understood why I'd want to use them
>>
>>60560825
pointers are not only used for dynamic allocation
>>
>>60560725
>>60560825
this is really only describes pointers in terms of a specific context; it's not exhaustive
>>
How does parallelism work?
For example you want to print an array of all the prime numbers within 8 Million.

My impression is that you
1. Make a global/public vector
2. Divide 8Million integers evenly to the threads
3. If one core1 finds a prime, it
3.a. Gains access to the global vector
3.b. Other cores should pause (system-loss)
3.c. As it finishes adding the prime to the global thread, other cores should resume
3.d. The CPU should be able to prioritize cores by a specific order if two cores finds prime in the same clock time

Or

Like shift registers,
You make one core clock fast enough to check if any CPU found any prime one by one. Each core makes its own vectors and one core (the collector core) will pick those vectors and clear them one by one
>>
>>60560782
I'm looking into chapel. But holy crap they really need a nu-male webdev for their site. It's too autistic.
>>
>>60560712
there is intel cilk but it's for cpu only
>>
>>60560782
So what's the official to-go jack of all treads book?
>>
>>60560897
You divide 8mln among your cores and let them do their work independently, and then combine the results. I don't think you can parallelize the sieve tho, it has explicit data dependency. Now I think of it, I don't think you can parallelize any find-all-the-primes algorithm since you have to know all the previous primes to test the next one.
>>
>>60560955
trade*
Sorry i'm very drunk
>>
>>60560955
http://chapel.cray.com/docs/latest/
http://chapel.cray.com/docs/latest/_downloads/chapelLanguageSpec.pdf
>>
>>60560897
data flow programming.
1:n patterns

>How does parallelism work?
concurrency, not parallelism.
>>
>>60560984
>concurrency, not parallelism.
difference?
>>
File: matilda.jpg (148KB, 750x750px) Image search: [Google]
matilda.jpg
148KB, 750x750px
>>60560704
>designed for hpc
>horrible performances
>>
>>60560994
parallelism and time sharing are execution model while concurrency is a programming model.
concurrency is done/implemented on top of parallelism or on top of time sharing.

https://www.wikiwand.com/en/Concurrency_(computer_science)
https://www.wikiwand.com/en/Concurrent_computing

https://www.wikiwand.com/en/Time-sharing

https://www.wikiwand.com/en/Parallel_computing
https://www.wikiwand.com/en/Task_parallelism
>>
>>60560994
also, a concurrent algorithm should not care if it's executed in parallel or in time sharing program; the logic remains the same.
>>
>>60560997
Sure it's slower than sepples but the build in support for clusters and parallelism make it nicer language to work with.
It's still in development so there might be some boosts ups from optimization in the compiler or the project might just die, who knows.
>>
>>60560652
GPU manufacturers and driver implementers still need time to round out hardware support for Vulkan. currently the vast majority of Vulkan-capable cards only support Vulkan through a retroactive OpenGL compatibility layer, which obviously isn't going to be able to reap most of the benefits of Vulkan. and a game that also supported OpenGL doesn't provide the strongest argument, because some of its systems are bound to operate on compatibility abstractions for the API divide. this defeats the purpose of Vulkan, as its design is much lower-level than that of OpenGL, and a game seeking to implement it should do so from the ground up. it's similar to how a game or engine will suffer some (albeit minor, if done properly) performance drawbacks by supporting both OpenGL and Direct3D, only more so, because Vulkan is far more different from OpenGL than OpenGL is from Direct3D. games or engines that support Vulkan exclusively are the ones which will see more tangible performance benefits. this will be feasible once first-class hardware support is widespread enough
>>
Chapel looks fun.
cobegin {
writeln("I'm one thread");
writeln("I'm another thread");
writeln("I'm yet another thread");
}
begin writeln("I am less important and can wait");

Wonderful.
>>
>>60556816
/g/ is wrong about pretty much everything, mostly due to mindless contrarianism. Lurk moar.

>>60560499
VS 2017 Community is free, dingus.
>>
>>60561205
>VS 2017 Community is free, dingus.
I am a professional developer, i need professional tools and not some gutted skeleton hand me downs of aps
>>
>>60561204
Useless.
>>
>>60561228
why?
>>
Haskell: worth it for personal development, or worth it for corporate dev?
Thoughts in general?
>>
>>60561221
what do you need that isn't in Community? TFS? that shit is a joke
>>
>>60561232
You can do this in any other language via libraries, there's no need to implement this in the language itself.
>>
>>60561221
Community version doesn't miss anything important.
>>
>>60561221
There really aren't many things different about the other editions, unless you're working on a large team with automated build processes and dedicated test servers, in which case...why isn't your company paying for your subscription?

For a solo developer, the only major thing I find that most people would want from the others is CodeLens, but it's really just eye candy.

>>60561245
You can have up to 5 people free on the cloud hosted TFS. It still integrates with Community, too.
>>
>>60561253
Oh you are one of those people, I should've known
>>
>>60561242
I D R I S
D
R
I
S
>>
>>60561261
I bet you like Go.
>>
>>60561242
"No" to the former, "only in specific situations" to the latter. At the end of the day, other languages will give you more job opportunities.
>>
>>60561278
Why do you care? Grow up.
>>
>>60561258
>You can have up to 5 people free on the cloud hosted TFS. It still integrates with Community, too.
oh, well look at that. so he's good even if he wants TFS for some reason

>For a solo developer, the only major thing I find that most people would want from the others is CodeLens
that's only in the paid versions? that's funny, i turned it off when i ran the 2017 RC
>>
>>60561232
Multi-processor systems are becoming more common, but so are amazingly fast single-processors.
This implies the need for at least two forms of concurrency; multi-threading within a single processor,
and multi-processing with several processors. In addition, networking (both WAN and LAN) imposes its own demands
and special-purpose architectures abound. Because of this diversity, i recommend parallelism be represented
by libraries within C++ rather than as a general language feature. Such a feature, say something like Ada's tasks,
would be inconvenient for almost all users.

It is possible to design concurrency support libraries that approach built-in concurrency support both in convenience
and effiency. By relying on libraries, you can support a variety of concurrency models, tough, and thus serve the users
that need those different models better than can be done by a single built-in concurrency model.

-- Bjarne Stroustrup, PhD
>>
>>60560725
That text is too fucking stupif.
>>
>>60561297
Yeah, it's actually a bit weird. CodeLens has always been Pro or Enterprise, however in VS2015, you could enable it just by installing SSDT (SQL Server Data Tools). Not sure if bug, or awkward dependency.

I know when I first installed VS2017 at home, CodeLens apparently was working, but VS2017 at the office (Community) didn't have it. I use Enterprise at work anyway now, but that feature has always been weird.

https://www.visualstudio.com/vs/compare/
>>
File: housing_oc.png (616KB, 1160x3292px) Image search: [Google]
housing_oc.png
616KB, 1160x3292px
>>60556891
>mcdonalds? beneath i

top kek. reality is a cold hard mistress, and the reality of the situation is pic related.
>>
I fucking hate cmake. Is there a better alternative? I really liked Cargo when I tried Rust, is there something similar for C++?
>>
>>60561330
I believe C++ has several package managers you can use
>>
>>60557108
Use OCaml. Menhir is GOAT parser and you can take inspiration from Compcert. Xavier Leroy is the one true FP God.
>>
>>60561336
But all of them are 3rd party shit
>>
>>60561280
Not looking for job opportunities, just applicable functionality for the lang. It's about haskell, not my ability to land a job with it
>>
>>60561330
Yum/Apt-get
>>
>>60561339
>fp god
>can't even parallel threads
>>
>>60561353
Can apt create/unit test my project
>>
>>60561325
that's funny, because the first place i saw CodeLens was in VS Code, which is freer than free. still had it last i checked
>>
>>60561349
How much of a contrived vacuum do you want to put Haskell in before you can finally say it's effective for software development?

The simple fact that a relatively minuscule proportion of programmers have ever touched Haskell ever puts it as generally non-viable for any but the most specific "supporting" projects, due to inability to acquire reasonably-priced employees.
>>
>>60561326
>historically, a family of four or more could thrive on the income of only the father
>exceptional situation that lasted for a decade only
>historically
Wew.
>>
>>60561353
I'm developing on Elementary so I have apt-get, but it doesn't make building, linking and running my project any easier. It's also not cross-platform. With Cargo I could just bind "cargo run" to a key in my text editor of choice and it would automatically install all the dependencies, build it and run it. With C++ my current solution is a hack involving a shell script that pulls in all the dependencies from git if they don't exist already, runs cmake, runs make and finally runs the program. I'm not a fan of it at all, I'm looking for a unified solution that just werks.
>>
>>60561400
Don't argue with them. They haven't used modern package managers and they don't quite know what they are missing out

You should go search 3rd party C/C++ package managers
>>
>>60561386
Are you the same chump that completely misinterpreted the charts yesterday? Housing was still attainable on a single income well into the 90's, going back to before the 60's.
>>
>>60561420
I found Meson, is it any good? Do you have any recommendations? Since I tried a modern package manager I can't go back.
>>
>>60561330
i like CMake but i have noticed that its usefulness in terms of packages depends on your platform, potentially. it's much better on Linux (or using a Linux subsystem on Windows) because you can just use the system's package manager and in CMake just find PkgConfig and then use pkg_search_module, which tends to be way more reliable than find_package
>>
>>60561464
I didn't know about C/C++ package mangers last time I used those two langs, hence I don't have any experience on them sorry
>>
>>60561428
stop living in big cities
>>
New thread:
>>60561491
>>60561491
>>60561491
>>
>>60561486
I don't disagree. Best-case scenario is having a remote tech job and living in a cozy small town.
>>
>>60561330
Build tool? SCons
Package management? There are several failed/shitty attempts. Just use popular libraries and your system's package manager.
>>
>>60560468
Nice complete lack of arguments.
That solution doesn't fit at all by the way. literally solving just for the code that's there.
>>
>>60559719
You know, it's weird being on this board as a very moderate republican. I disagree with the left universally economic issues, but on social issues we align pretty well. I believe in standing up for the rights of all the same demographics they do, even if some of them aren't to my personal tastes.

But one thing I just can't agree with them on is their treatment of extremism. They're too accepting of radical Islam, they're too eager to join the ranks of the communists, and, on the other side of the spectrum, they're too gentle with stupid inbred beer-chugging right wing extremists such as yourself.

I'm sick of "tolerating" your hateful attitudes just to be consistent with the philosophy of tolerating all the people those attitudes are directed toward.

Fucking kill yourself you fat sunburnt piece of Southern cow shit.
>>
>>60561974
>I disagree with the left
News flash cucklord, you are the left
>>
>>60561379
Sometimes things can be applied for research, for fun, for gimmicky little entertainments. Haskell, in my situation is a toy I want to play around with, not a moneymaker. I have my job for money, you doofus. Not everything is absolute "MUH JOBS" with programming. Fuckin 'ell mate
>>
>>60559717
If a language has to constantly reassure you that it's relevant and "ready for industry", it's neither of those things, see: haskell
Thread posts: 334
Thread images: 36


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