/script>
[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: 337
Thread images: 28

File: really makes you think.png (20KB, 352x556px) Image search: [Google]
really makes you think.png
20KB, 352x556px
Previous thread: >>59843315

What are you working on, /g/?
>>
>>59848775
>Posted before the bump limit
Delete this thread, idiot.
>>
>>59848775
Lisp is the most powerful programming language.
>>
first for cs is useful
>>
I'm learning GNU Octave by writing some functions related to quantum computing.
I have to fix the quantum relative entropy function, because it's negative and it should always be non-negative.
>>
I would post my code here but I don't want to be turned into a CS grad meme
>>
>>59848876
You are already a CS grad meme.
>>
First for (insert language here)

It doesn't matter what the language is you fucks will still argue over it
>>
fn (type arg) = (type return) { body }
>>
>>59848876
i've been turned into a cs grad meme but i posted the code intentionally trying to bait it
>>
>>59848905
>being mad you don't know enough about programming languages to be able to take part in the arguments
>>
god I love haskell
is there anything that can beat this beauty of its expressiveness
>>
>>59848938
They're each good/bad in their own way, anon.
>>
>>59848961
>haskell
Trash.
>>
>>59848961
name three (3) useful large-scale programs written in haskell
>>
File: 1490500072932.jpg (150KB, 672x1000px) Image search: [Google]
1490500072932.jpg
150KB, 672x1000px
>>59848986
xmonad, pandoc, GHC
>>
>>59848986
xmonad
>>
>>59848986
name three (3) useful large-scale programs written by you
>>
File: 1491299243518.jpg (38KB, 362x346px) Image search: [Google]
1491299243518.jpg
38KB, 362x346px
>>59848961
>beat this beauty of its expressiveness
How can you beat something which simply doesn't exist?
>>
>>59849029
Irrelevant.
>>
>>59849043
So are you
>>
>>59849055
Vicious
>>
>>59848961
Yes, this is a common thing pleb-filter language users feel. We can only hope this is temporary and you don't get blinded by fake things.
>>
File: me.jpg (53KB, 1174x659px) Image search: [Google]
me.jpg
53KB, 1174x659px
what language is better for hacking, python or C?
>>
>>59849092
C is good for nothing
>>
>>59849092
Ada
>>
>>59849092
how do you expect to hack when your language doesn't even trust you with memory?
>>
>>59849092
JavaScript is all you need, go learn that and don't worry about anything else
>>
>>59849089
Honestly, once I started doing projects, I was frustruated because of the lack of libraries and shitty documentation and package manager systems
>>
>>59849092
joke aside, you can hack using only a notepad.
Most hacks are not very sophisticated, so python to automate the boring stuff (incidentally the title of a book) is perfectly fine.

>>59849136
fuck you.
>>
>>59849092
English, for social hacks
>>
>>59849141
That doesn't have anything to do with the supposed "expressiveness" a language with a crippled type system supposedly "has".
>>
>>59849163
>crippled type system
expand
also, haskell is super fucking expressive
on average, it has a third the loc of other langs like python, c or sepples
>>
>>59849092
Python for IDA, Ruby for Metasploit
>>
>>59849190
Being better than most languages doesn't somehow make it "expressive". A type system where you can't encode list length in the type can't be called "expressive" by any stretch of the imagination.
>>
who idris
>>
>>59849224
thats because of infinite lists, dipshit.
its intentional.

Not to mention that the number of elements has jack shit to do with expresiveness.
>>
Is Typescript comfy? I think it's comfy.
>>
File: 1466760100193865949.jpg (149KB, 900x900px) Image search: [Google]
1466760100193865949.jpg
149KB, 900x900px
>>59849106
>Made an integral portion of an program in Ada
>I was moved to a more pressing project
>mfw my old partner has to now take a crash course in Ada's tasking model
>>
>>59849254
asm and c++17 are the only comfy languages
>>
>>59849274
C++17 is not a uncorn that suddenly makes C++ "good". Fuck off with your shitty FUD
>>
>>59849283
C++ has been good since C++11, it has been great since C++14 and is not really, really, awesome with C++17.

Proof:

https://pastebin.com/X4jzhmfK
>>
>>59849248
A pleb-filter language user who doesn't even have the slightest idea of what he's talking about. That's pretty common.
You can have languages which allow both infinite lists and types like "a list with n elements".
>Not to mention that the number of elements has jack shit to do with expresiveness.
A language which doesn't let you express your intentions in the types can't be called "expressive". It's as simple as that.
>>
>>59849313
>Proof
I didn't know you were joking
>>
>>59849313
This is where I tell you to go kill yourself.
>>
>>59848938
>>59849262
Who are you guys quoting?
>>
File: AAAAAAAAAAAAA.gif (247KB, 480x430px) Image search: [Google]
AAAAAAAAAAAAA.gif
247KB, 480x430px
>>59849313
> using t = concat< typename meta_functor< head >::t, typename transform_impl< typelist< tail... >, meta_functor >::t >;
>>
>>59849224
>muh dependent types
ayy lmao, where is this even useful?
>>
>>59849352
>muh
>incorrect usage of ayy lmao
>"""""useful"""""
Did you have a stroke or something?
>>
>>59849313
Metaprogramming was a mistake.
>>
>>59849314
your intentions are retarded in this case.
Ever thought about that possibility, dipshit?

Also for large scale projects in haskell:

http://stackoverflow.com/questions/3077866/large-scale-design-in-haskell
>>
I really wish the next C standard includes support for lambda/closures and gives us a real macro system.

Maybe even standardize a common set of data structures as part of the standard library.
>>
>>59849362
here, meme master

>muh dependent type
wew lad, where is this even useful?
>>
>>59849411
Just use Lisp.
>>
>>59849411
already exists, its called C++
>>
>>59849424
Lisp has no libs.
>>
>>59849352
That post didn't make a single claim about "usefulness". All it's stating is that a language which can't have them simply can't be called expressive as per definition of "expressive".

>>59849393
>your intentions are retarded in this case.
Me not being able to express them already means that the "language" isn't expressive.
>Also for large scale projects in haskell:
Where did I even ask you for this? I couldn't care less.
>>
In vim, how do you
1. Increase/decrease indent of a specific block?
2. Add/remove comment sequences like // or """ in a block?
>>
>>59849428
C++ can't even compile all C code.
>>
>>59849020
ghc doesn't count
>>
>>59849411
>2017
>STILL using C trash
>>
>>59849418
>muh
>wew lad
>meme
Were you dropped on your head and fed bleach as an infant?
>>
>>59849449
it only compiles the good parts.
Built-in QA, wanker.
>>
>>59849432
Wrong.
>>
>>59849461
Can you address my talking point, you faggot?
>>
>>59849454
>watch me move those goalposts
>>
File: d-dicks.gif (550KB, 728x720px) Image search: [Google]
d-dicks.gif
550KB, 728x720px
Can I pretend I know C++ on my resume?
I wanna write C with classes, not that C++11 stuff.
>>
>>59849495
Learn templates.
>>
>>59849495
No one knows C++, not even Björn Stosstrupp
>>
>>59849489
Your talking point isn't worth addressing as I didn't and will never make claims about anything's "usefulness"
>>
>>59849508
don't do this
>>
>>59849474
>only compiles the good parts
>can't compile C11 threads
>can't do generics in defines
>doesn't support safer functions and removes older ones that are bug ridden provided in C11

just to name a few
>>
>>59849512
>claim you need dependent types
>doesn't tell you why
being expressive for the sake of expressiveness is wrong
it should only be for producitivy
>>
>>59849495
>C++
>C with classes
>C++11
>>>/t/umblr
>>
File: stargazer.gif (924KB, 500x281px) Image search: [Google]
stargazer.gif
924KB, 500x281px
>try to optimize my sum of primes program by setting j to i*i instead of i*2 for sieve
>it segfaults so i have to change it back
>>
>>59849535
The original claim was "Haskell is expressive", obviously it can't be since it doesn't have dependent types, a thing without which a type system simply can't be expressive.
I didn't make a single claim, I only showed the inherent retardation in claiming that Haskell is somehow expressive.
>it should only be for producitivy
Anyone over 18 should be able to understand that a language can't have the property of being "productive".
>>
>>59849571
iterate i to sqrt(n) so i*i won't go out of bounds
>>
I want to learn Javascript. are there any recommended books?
>>
>>59849493
>>59849530
>>59849535
>>59849571
Who are you idiots quoting though?
>>
Garbage collectors are for garbage producers. RAII is where it's at.
>>
>>59849610
i dictate my posts and then cortana quotes me and posts them
>>
today i found out about the function
madvise

>madvise - give advice about use of memory
>int madvise(void *addr, size_t length, int advice);
>>
>>59849617
Nice
// raii.rs
fn create_box() {
// Allocate an integer on the heap
let _box1 = Box::new(3i32);

// `_box1` is destroyed here, and memory gets freed
}

fn main() {
// Allocate an integer on the heap
let _box2 = Box::new(5i32);

// A nested scope:
{
// Allocate an integer on the heap
let _box3 = Box::new(4i32);

// `_box3` is destroyed here, and memory gets freed
}

// Creating lots of boxes just for fun
// There's no need to manually free memory!
for _ in 0u32..1_000 {
create_box();
}

// `_box2` is destroyed here, and memory gets freed
}
>>
>>59849610
Are you retarded, meme arrows can be used in other contexts other than quoting.
>>
Is it bad if ive used 5 'for loops' within 40 lines of code
>>
>>59849664
Too vage, post code.
>>
>>59849646
neat
>>
@59849658
>meme arrows
>>>/v/
>>>/b/
>>
>>59849670
I can't, it is HW for Uni
>>
>>59849681
Please, I'll do your homework.
>>
File: IMG_20170411_193352.jpg (2MB, 4160x3120px) Image search: [Google]
IMG_20170411_193352.jpg
2MB, 4160x3120px
I just picked these up at my university's library. Will this make me a good programmer?
>>
>>59849702
>C++
No.
>>
>>59849702
>if you have to ask...
you'll give up after the first month
>>
>>59849702
are you a computer science major?
>>
>>59849687
The homework is already complete
>>
>>59849729
>if you have to ask...
He didn't say that though.
>>
File: cycling bomb.gif (234KB, 645x231px) Image search: [Google]
cycling bomb.gif
234KB, 645x231px
>>59845646
alright, now digits cycle to the next one odometer style
>>
anyone else here crack rsa by hand for fun?
>>
>>59849715
(You)
>>59849729
I'm only a sophomore, did shit in a programming competition and want to get better. Also went to a presentation intro to Djikstra's alg and was intrigued. And I'm learning in C++ at my school right now, figured I'd just stick to the same language
>>59849739
Yes. And I want to apply some of what I learned in discrete
>>
>>59849778
i did that in Discrete Structures course
>>
>>59848775 i hope you debug it if you ever plan on releasing it. i remember back in uni i used it as a substitute for matlab for a super simple assignment but ended up spending six hours fixing the piece of shit step response function in one of the toolboxes. Seriously what kind of cuck messes up a simple convolution function and releases it.
>>
>>59849603
Read Programming in Lua, apply it to JS since they're close languages, then read JS: The Good Parts as it's a short book, then see mozilla's documentation as needed
>>
I finally finished up that cubemap conversion tool.

For those unaware, if you work with a 3D engine, then you'll probably use cubemaps at some point. A cubemap is a 360° panoramic image of a scene, but this panorama is stored as six cube face textures that form a skybox in 3d space.

The problem is that most panoramas you find online (on sites like Flickr) aren't formatted as a cubemap, but are formatted with the equirectangular projection. So I made a little tool which converts these panoramas to proper cubemaps.

Dunno if anyone's interested, but the code is here: https://github.com/jaxry/panorama-to-cubemap

It's a web app (link in the readme) so it uses the Canvas API to pack and unpack image data for manipulation. Some parts were surprisingly challenging to program and I can share some experiences if you'd like.
>>
@59849824
>>>/g/wdg
>>
File: input.jpg (699KB, 1024x512px) Image search: [Google]
input.jpg
699KB, 1024x512px
>>59849824
Original image for comparison
>>
File: 123123.png (7KB, 641x675px) Image search: [Google]
123123.png
7KB, 641x675px
>>59849824
interesting
>>
>>59849782
sicp's a good read
>>
>>59849824
Nice
>>
>>59849824
i can't use your fluid project on github

nothing happens when i move the mouse

pls respond
>>
File: 1464409145733.jpg (500KB, 1152x2048px) Image search: [Google]
1464409145733.jpg
500KB, 1152x2048px
>>59849655
Nice
>>
Visual Basic is the language of the programming language connoisseur
>>
>>59850104
who the fuck still reads comic books in 2017
>>
>>59850139
Don't judge me
>>
>>59850104
the co/tv and /g/ memes are colliding
>>
>>59850104
That kid looks like he has autism
>>
>>59850191
he said he knows rust
>>
In java, this is allowed
int a = -2147483648;


but not this
int a = -(2147483648);


the heck?
>>
>>59850104
the writing and dialog pacing is terrible, people actually pay for this shit?
>>
>>59850223
yes
>>
>>59850223
You are not used to American comics
>>
>>59850251
maybe you're right
i read it from left to right and it's still shit
>>
File: comic book guy.jpg (11KB, 250x229px) Image search: [Google]
comic book guy.jpg
11KB, 250x229px
>>59850223
Sorry, forgot my image
>>
>>59849824
Here's the cubemap being used in a surface plotter I'm working on.

https://my.mixtape.moe/rqlpie.webm
Video of it. I don't know if it looks correct, but that material is supposed to be hand-forged metal.
>>
File: dsfu3882.jpg (607KB, 2645x1984px) Image search: [Google]
dsfu3882.jpg
607KB, 2645x1984px
#include <stdio.h>
//arithmetic function(s)
int math_Add(int a, int b)
{
int add_result;
add_result = a+b;
return add_result;
}

int main()
{
int sum;
sum = math_Add(3000,1.0);
printf("3000 + 1.0 = %d\n", math_Add);

return 0;
}

>result of 3000+1.0 is 4199541, i know it has to do with the float number (i think) but wouldn't it just come out to 3001 without the decimal point since it's an int and not float/double?
>>
>>59849495
if you don't know template metaprogramming you don't know C++
>>
>>59850197
Does the magnitude of the maximum negative int in Java exceed that of the maximum positive int? I think it's usually the opposite, but that would explain why it doesn't like an unsigned integer literal of that magnitude. Also, try enclosing the whole value in parentheses, including the negative sign.
>>
>>59850308
Who are you quoting?
>>
>>59850223
>expecting the writing of a programming ad to be good
>>
>>59850305
see >>59849910
>>
>>59850319
I meant to delete the arrow, this is my own words
>>
>>59850323
Who said this?
>>
>>59850197
are you retarded?
>>
>>59850315
>Also, try enclosing the whole value in parentheses, including the negative sign.
yeah that works but still
>>
>>59850260
shit i just realized i read it right to left
>>
>>59850338
>>59850308
Anyway, the problem is that you're printing math_Add, which is a function pointer, not that sum you just calculated.
GCC -Wall should have warned about that.
>>
>>59850341
are you?
>>
File: 1486397062619.png (769KB, 1052x1342px) Image search: [Google]
1486397062619.png
769KB, 1052x1342px
I'm very new to C so please bear with me

Let's say I have information that I can print to the console. It can be any information, like in my particular case it's information about a doubly-linked list.

What's the best way to take what I print to the console and store it in a variable that I can access later?
>>
>>59849910
>>59850326
Thanks for catching that. Apparently it doesn't work for me either in Firefox, but it works in Chrome.

Based on the errors in the console, Firefox isn't correctly loading the WebGL floating point texture extension. I have no clue why that is because it used to work in older versions of Firefox. Anyone have any ideas?
>>
>>59850364
no, because i know why its not allowed
>>
>>59850351
Oh wow, thanks
>>
>>59850391
looks like you have a bug to fix
>>
>>59850385
redirect stdout to a memory buffer and then print it out later.
>>
>>59850385
int a = x;
printf("%d\n", a);
// 'a' still equals x
>>
File: 3d-registers.png (435KB, 897x1124px) Image search: [Google]
3d-registers.png
435KB, 897x1124px
reading this document on graphics card hardware registers, it lists the 3d registers too.
for some reason I feel compelled to actually use this information
I mean, programming a 3D card in staight asm without using an API.
it sounds so completely ridiculous, it's almost interesting.
>>
>>59850393
oh yeah, but for example
int a = -(6);


is allowed

why is 2147483648 not allowed? because it doesn't fit in a Int?

i think the range is -2147483647 to 2147483647 or something
>>
>>59850413
printf("holy shit rekt hahahahahahaha");
>>
>>59850424
I hope you realize GPU instructions are not platform agnostic and even the way you upload them to the GPU and get data back is driver specific.
The whole reason they invented opengl is so you could write portable graphics code.
>>
What's the best way to make a lot of money and work 40~ hr weeks, living in NYC probably, if I get a CS degree?
>>
>>59850426
6 is well with in bounds of int
>>
>>59850460
>40~ hr weeks
>living in NYC
>CS degree

pick only 2
>>
>>59850460
by getting a job
>>
>>59850410
Thanks, this worked. I used freopen()
>>
>>59850449
>What's the best way to take what I print to the console and store it in a variable that I can access later?
not being a smart ass, the question is just really stupid and that's the answer
>>
>>59850467
the last two, I guess.
>>59850472
yeah but what job? sorry I'm not knowledgeable, I'm currently a senior in HS
>>
>>59850499
no, you misunderstood the question.
>>
>>59850521
you, you wrote the question incorrectly. you don't even know what a variable is
>>
>>59850139
I do
>>
>>59850551
no, you definitely misunderstood it. you probably still don't understand it.
>>
>C++-style automatic memory management smart pointers for D using std.experimental.allocator
https://github.com/atilaneves/automem
>>
>>59850453
I know, it would only work on this one specific card, maybe it wouldn't even be compatible between different revisions of the same gpu.
idk why but that makes it sound even more interesting somehow.
>>
Manual memory allocation is tedious in most of the programming tasks. It's only useful if you are writing drivers. For desktop applications it's unnecessary --the profit is not too big.

>>59850580
Nice.
>>
>>59850608
If you really feel this way, just write constructor/destructors for your objects and don't think too much about it.
>>
>>59850621
>objects
>>>/r/abbit
>>
>>59850580
>POO-lang
>>>/r/ibbit
>>
File: 2017-04-11_20-56-58.png (5KB, 371x147px) Image search: [Google]
2017-04-11_20-56-58.png
5KB, 371x147px
I need someone who knows how to assembly

[Sorry for picture and not text code, 4chan thinks MIPS is spam]

Trying to get the volume of a cylinder given radius in $a0 and height in $a1. Should be simple enough, but for example if I use r=3.9 and h=8.4 The answer should be 401.38244379... but for some reason the answer comes out to 401.38247681, which is off (I need like 12th decimal accuracy.
I've tried using double precision but I've never gotten that to work; it always spews jibberish.

Eternally grateful for a solution
>>
>>59850632
>>59850654
I literally have a reddit tab open :D
>>
File: 1491948821349.jpg (2MB, 1936x2576px) Image search: [Google]
1491948821349.jpg
2MB, 1936x2576px
>>59850656
>>
>>59850656
Ignore the NSA/C shills. Programming in C should be banned and outlawed.
>>
>>59850682
As attractive as that young man is, he's not a solution.
>>
>>59850700
Why are you referring to yourself in the third person?
>>
>>59850695
This
>>
>>59850672
Disgusting.
>>
>>59850716
please stop posting moe
>>
>>59850761
Please stop using words you don't understand.
>>
>>59850768
gabriel dropout is the definition of moe shit
>>
>>59850785
I'll repeat myself, please stop using words you don't understand.
>>
>>59850793
here's a word you may not understand: aspergers syndrome (you have it)
>>
>>59850785
SoL != moe.
Anything not shonen shit != moe
Anything you dont like != moe
>muh dbz and MANIME
kill yourlelf
>>
>>59850823
That's actually five words.
>>
>>59850823
How is that relevant? Just please stop using words you don't understand.
>>59850825
My statement was universal, not existential.
>>
>50 minutes episode 720p webdl -> 1.63 GB
>50 minutes episode 1080p webdl x265 -> 350 MB

i love software
>>
>>59850889
>x265
thank you future
>>
I'm building a PHP webapp that auto installs SSL certificates.

I've got something worked out with the comodo api and cpanel api.

Right now I'm trying to figure out a clever way to extract required fields for CSR from a whois query of a domain. I'm thinking about just doing a regex capture for city, country, etc.
>>
How do we save desktop from electron plague
>>
anyone want to do pico ctf with me? there's only 3 days left
>>
@59850923
Wrong thread. Fuck off.
>>
>>59850966
You don't.
desktop applications development is a dead end.
If you want ANYONE to use your software, it has to be a webapp or a library/framework that people will use to build webapps.
>>
>>59849702
There's a newer edition of that c++ book
>>
>>59850996
I see, so for me to use my own software I would have to make it a webapp?
>>
>>59851040
I'm saying there isn't much incentive for people to make platform specific desktop versions of their software when everyone has a web browser and software as a service has been the in thing for at least 5 years now.
>>
>>59851074
>If you want ANYONE to use your software, it has to be a webapp
Did you not write this?
Should I make my own software a webapp if I want to use it?
>>
Who here actually has a career in software and can you share what it is?
>>
>>59851095
quit playing the fool
>>
>>59850343
>Wahhhh I have to write a language's syntax correctly
Kill yourself
>>
>>59851113
Yes, I mainly introduce almost undetectable bugs into various compilers.
>>
>>59851115
Please answer the question.
>>
>>59849764
You're the dot matrix display anon? How big were the ones you've bought? How much did you pay?
>>
>>59851151
quit playing the fool
>>
Lisp programmers:
>it's a linked list it must be lisp!!!!!!
>>
>>59851210
autism is a life threatening disease.
>>
>>59851220
>butthurt lispie
Do people give you a wide berth when they pass you on the street?

Are you banned from most local restaurants?
>>
>>59851242
calm down bjorne
>>
File: 1474335032135.png (115KB, 289x277px) Image search: [Google]
1474335032135.png
115KB, 289x277px
Can a quote be an element of itself?
>>
>>59849148
Spanish if you're going to Mexico
>>
>>59851409
"GNU" is not unix
>>
Programming a game yo.

So the Game class has an Area class, and inside that is an array of Objects that get rendered to the screen.

The Game class has a 'money' variable and I want to have it so when an object's 'onClick()' function is called, it will add 1 to money. What is the best way for the object to know about the Game class's money variable? (Without making it public or static or having to pass reference of the Game to each Object)
>>
>>59851531
Shitlangs aren't real programming
>>
>>59848775
How do you go about networking for job opportunities? I'd really like to have some work experience and exposure to functional systems and work flow so that I can make my own projects in the future. Is it a good idea to go to tech "meetups" in my area? Should I look for free internships?
I've been in college for two years and I am just sick of it. 80% of learning comes from youtube videos and online tutorials, and I'm realizing that my diploma actually doesn't mean anything. They make us do a lot of group work and at least half of the students do zero work and have no idea what they are doing, it's to the point where if I had my own company I would not hire any one that went to my college.
>>
Programming is pretty fun desu. It's a great feeling when you look at a programming problem and don't even know where to begin, then you think about it for a while and slowly figure it out, and then you solve it! It's like a puzzle
>>
File: wasmIcon2017.jpg (13KB, 523x331px) Image search: [Google]
wasmIcon2017.jpg
13KB, 523x331px
What does /dpt/ think about WebAssembly?

Is it a meme? Will it see mainstream use? Will it finally make Rust relevant?
>>
>>59848775
NASM assembly question
anyone know why I get warning
"label alone on a line without a colon might be in error" (yes that's how the message is written)

it says its at line 12, which is where I have my

global_start
>>
>>59851531
Yes they are.
>>
wow im an idiot it's

global _start

not global_start
>>
>>59851649
>Will it finally make Rust relevant?
That can't possibly ever happen.
>>
>>59851516
I don't see the point of having a Game class then not making it public
>>
holy shit this thread got pruned
>>
>>59851673
Just you wait. Given a choice between C/C++/Rust, hip web devs will choose the most obscure, Rust.
>>
>>59851672
you wrote global_start twice
>>
>>59851729
What does Rust have to do with C/C++?
Besides, as soon as they've chosen it, it's no longer obscure enough for more of them to use it.
>>
>>59851669
>Quotes might as well not follow the axiom of regularity
They are sets, meaning they do since you wouldn't be able to call them sets otherwise.

>>59851695
A quote is a set though, why would it not be?
>I hope your education was free
I don't live in a barbaric country.
>>
>>59851750
Those are the 3 languages you can compile to WebAssembly
>>
That banhammer
>>
>>59851265
who the f*ck is bjorne?

>>59851657
I think it's advising you to place a colon after the label, so that it won't be confused with other types of tokens.

>>59851681
enjoy your segfaults
>>
stdin–The standard input for reading.
stdout–The standard output for writing.
stderr–The standard error for writing error messages.
>>
I'm a in CS1 and this shit has stumped me.
It's supposed to be printing the First and Last letter of the input phrase on the first line, second and second to last letter on the second line, third and third to last letter on the third line and so on.
https://pastebin.com/r00DzxBh
I can't figure out why it's not printing it out in an X shape.
I've tried changing ~if (n != phrase.length)~ to ~ if (n != phrase.length-1) ~
And it changes it to the x shape but then it doesn't print the last character on the proper line.
I don't even care if you fix it for me, I just want to know why NEITHER of them work right despite the problem obviously being the final character.
>>
>>59851859
cout and cin will always reign supreme
>>
File: big_lizard.webm (226KB, 1280x720px) Image search: [Google]
big_lizard.webm
226KB, 1280x720px
>>59851868
>>
Python and Python advocates should be banned. It has no redeeming features and has retarded progress in the software industry for over a decade.
>>
>>59851868
You're not going to make it, anon; switch majors to business.
>>
>>59851870
That's what your mum said to me last night.
>>
>>59851893
It's better than JCL.
>>
>>59851886
>>59851904
Tell me why it's not working and I'll consider changing majors.
>>
>>59851868
> if (n == i || n==phrase.length)
this is the problem. not gonna run it b/c im on my desktop and dont want to install java but i suspect your program is doing exactly what you're telling it to. ie printing half of the x and then with a straight line on the right end? also you have a ton of unnecessary variables
>>
>>59851913
I'm sure piss tastes better than acid but I wouldn't want to drink it.
>>
>>59851913
what is JCL?
>>
>>59851922
Just keep thinking about the program and keep working at it
>>
O(!n)
>>
>>59851923
actually thinking about it the loop is < phrase.length so it'll never hit that second condition. so you're just getting half the x. if you did charAt(phrase.length) it'd be '\0' in C idk java, probably just throws an error
>>
PHP is faster than Python. There is literally no reason to ever use Python.
>>
>>59851975
PHP is poop
>>
i think the new /dpt/ e-peen should be the absolute fastest sum of primes below X executable possible that runs correctly on every number <= 2,000,000, instead of just being able to do it
>>
>>59851983
And yet it's faster poop than Python.

I'm gonna fire the next guy on my team who prototypes something in Python.
>>
Holy shit, I got an email from a place wanting to schedule a phone interview. I've never had an interview for a job before, and haven't even heard back from a place since I started looking. I'm pretty nervous. When should I say I'm free to call? What kinds of things do they ask in phone interviews? It's an SDET I position, so hopefully nothing too out there. I don't really know how to prepare though.
>>
>>59852001
Probably ask you basic shit if it's phone only (no screen sharing/online editor stuff), like complexity of operations on some data structure
>>
>First assignment for machine learning class released.
>For this assignment, professor wants us to implement the learning algorithms ourselves, and as such is limiting our use of libraries to only approved ones (for handling things like matrix multiplication), and limiting language choice to either C, C++, or Java.
>Warns us that C is not recommended because he has had several students in the past say that they wished they had done it in Java instead.
>Am probably one of the only students in this class using C++.

Seriously, there has never been a time in my life where I have said to myself, "Man, I wish I had chosen to do this in Java." I have said to myself, "I wish I could have done this in C++ instead," but never Java. The only time I'd ever consider the damn language is if the alternative is something clearly worse, like PHP or COBOL.

I dunno, what language would you guys have chosen to train a linear regression model from scratch?
>>
>>59852035
D
>>
>>59852035
If performance is critical then C. Otherwise Haskell.
>>
>>59852055
Nice coffin-filling language, loser
>>
>>59852066
Nice meme, come up with it yourself?
>>
>>59852035
I blame Javaschools, i.e. schools that teach CS/SE students Java and only Java. When all you know how to use is a hammer...
>>
>>59852001
You should read the book "cracking the interview" or something like that
>>
>>59852075
Yes, I originated it.

The meme will live longer than D ever did.
>>
could i write my own version of <windows.h> or would that be ILLEGAL
>>
>>59852035
Rust
>>
>>59852108
Prosecutable offense
>>59852116
>tfw too dumb to learn rust
>>
>>59852123
exdee. meme lord has spoken.
>>
>>59852116
>still no HKTs
>>
>>59852108

Yes. If the guys behind MinGW can do it, so can you.
>>
>>59852098
Well, it's got about 15 years (and counting) of catchup to do then!
>>
If a language isn't pure functional then it's worthless.
>>
File: 1461112656802.jpg (59KB, 655x527px) Image search: [Google]
1461112656802.jpg
59KB, 655x527px
finished my recursive sudoku solver in C

feel like a brainlet for looking up help on the solution
>>
>>59852143
>implying D was alive for 5 years, let alone 15
>>
>>59852136
>still no useless feature most people will never even read about
>>
File: LvDxQZi.jpg (48KB, 640x960px) Image search: [Google]
LvDxQZi.jpg
48KB, 640x960px
Is Flex any good, or are there better alternatives?
>>
>>59852158
>C
>Frog poster
>Brainlet
Clockwork
>>
>>59852136
HKTs are useless.
Give me one situation where they are sufficiently useful.
Pro-tip: you can't
>>
>>59852168
>literally blub paradox
>>
>>59852166
It's being actively developed, why wouldn't it have been?
>>
>>59852184
You being too stupid to think of a use for them does not imply that there are no uses for them.
>>
>>59852084

My university isn't really a Java school. We use Python, Java, and C in a lot of the core classes, but many classes allow the choice of whatever language we want. Also, when I was doing my undergrad, they actually used Ada for the beginner courses.
>>
>>59852189
Necromancy

>>59852201
>Python and Java school
Run.
>>
>>59852158

add grad student to the list too

at least i have a job :&)
>>
>>59852184
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
>>
>>59852212
Oh so edgy. You are well up to date with the current memes, aren't you?
>>
>>59852200
>avoiding the point
>resorting to insults

you have no argument I see.
>>
>>59852230
>insults
Can the truth be an insult?

>>59852229
Give it up, Andrei. Your language would have done well in the 90s had it not been badly mismanaged. In 2017? No chance.
>>
>>59852230
He avoided the point because he can show no real usage of HKTs. Isn't it obvious?
>>
>>59852212
>Necromancy
No such thing
>>
>>59852261
See >>59852227
>>
>>59852273
Trying to bring a corpse to life sure sounds like necromancy to me.
>>
>>59852288
It's not dead though
>>
>>59852295
It has been dead for over a decade. Let it go, Andrei.
>>
>>59852304
No it hasn't, and I'm not Andrei. He's too good for this shithole
>>
>>59852318
Who are you then, his buttboy?

It's definitely dead. Haven't you noticed the stench? The fact that outside of one esoteric forum, nobody talks about it seriously other than fervent members of said forum?
>>
>>59852084
*raises paw* my uni is trying to be a java school. thankfully based old nordic professor fights against these evil forces so the impact isn't too bad
>>
>>59848775
How should I go about learning C? What resources are recommended?

Am virgin so be gentle
>>
File: are-you-wizard.jpg (39KB, 500x664px) Image search: [Google]
are-you-wizard.jpg
39KB, 500x664px
>>59852338
>*raises paw*
>>
>>59852212

Python, Java, and C. There are a couple of mandatory classes that require the use of C.
>>
>>59852348
C is a disservice to intelligent programmers. It has almost 0 features that a modern and intelligent programmer uses to be productive. Since C is such a timesink, it's popularity is falling more than any other languages in the market.
C is dying and it should die ASAP. C programmers are actually retards in general. C is a small language to grasp, exactly the kind of shit that makes things retard friendly.
C has no advanced features like C++ does.

But as a newfag you are kinda in the right direction. C is for newbies. Think of it this way:
During ancient times, counting to 10 was a big deal and a person who could count to 10 was considered to be "wise".

Fast forward a few century counting to 10 is so trivial we teach this to toddlers. Now toddlers appreciate the vast "knowledge" of counting to 10 while matured brains are busy with modern technologies.

C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things.
C doesn't have delegates
C doesn't have resizable arrays
C doesn't have strings
C doesn't have string concatenation
C doesn't have namespaces
C doesn't have exception handling
C doesn't have closures in the standard
C doesn't have unit tests
C doesn't have Function overloading
C doesn't have memory safety of any kind
C doesn't prevent memory exploits and has no bounds and runtime checks
C doesn't have dynamic method loading/creatin
C doesn't even have generics and templates
C doesn't have meta programming
C doesn't have mixins
C doesn't have higher order functions
C doesn't have contract programming
C doesn't have inner classes
C doesn't have function literals
C doesn't have array slicing
C has a very limited support for implicit parallelism
C doesn't even have string switches

C is a cancer that plagues the modern software industry. If you want guaranteed memory exploits and security vulnerabilities in your program with timesink development period then use Assembly, not C.
>>
New thread:

>>59852366
>>59852366
>>59852366
>>
>>59852371
What lang do you recommend to begin then?
>>
>>59852335
>Who are you then, his buttboy?
No
>It's definitely dead. Haven't you noticed the stench? The fact that outside of one esoteric forum, nobody talks about it seriously other than fervent members of said forum?
That's wrong, in fact the news about dmd switching to Boost made it to the top of Hacker News recently
One of the devs was also asked to give a talk at C++Now

Sorry your memes are wrong
>>
>>59852351
Irrelevant if the bulk of the material is Java and Python. It'll be like indoctrinating someone in creationism and then showing them a picture of the word "evolution". It won't stick.
>>
>>59852385
C++, D or Rust
>>
>>59852227
Does Rust really not have that? How is this acceptable?
>>
>>59852392
What resources for D and Rust are good in your opinion anon?
>>
>>59852371
If C is a disservice then Python, Go, JavaScript, Ruby, etc. are atrocities.
>>
>>59852408
No, it does not have that.

I do not know why this is considered acceptable by anyone.
>>
>>59852227
Now give me an example in a proper language like C++.
Because the fact that you've used Haskell code here tells me that they're completely useless.
>>
>>59852410
>D
http://ddili.org/ders/d.en/
>Rust
Not for beginners
https://doc.rust-lang.org/book/
>>
>>59852410
D is OOP garbage, better avoid it.
>>59852416
Sure, that's obvious.
>>
>>59851933
Job Control Language, a scripting language used in old IBM mainframes.
>>
@59852437
>Now give me an example in a proper language like C++.
This request is impossible to fulfill since C++ is anything but a "proper" language.
>>
>>59852437
You know that's an invalid argument.
>>
>>59852437
C++ can't do that, which obviously means it's garbage.
>>59852468
I'm afraid he doesn't.
>>
>>59852439
Ty
>>59852440
So I should go for Rust instead?
>>
>>59852483
Rust is not for beginners, anon
>>
>>59852468
>>59852477
So basically what your telling me is that HKTs are just some special snowflake Haskell thing that is actually completely useless in real programming.
Ok, got it.
>>
>>59852477
I only hope he also doesn't know how stupid he is, to be aware of possessing such a calamitous lack of intellect would almost certainly be a miserable existence.
>>
>>59852483
D's perfectly fine, try both and see what you like better
>>
>>59852483
>Should I go for x instead of y (assuming y is POO)
Absolutely.
>>59852498
It's not that hard either.
>>
>>59851999
Speed should not be a concern during prototyping.

>>59852387
rekt
>>
>>59852507
They're in Scala too.

They're very useful, I use them nearly every day.
>>
>>59852498
>>59852511
>>59852516
Oki doki, I'm off to try them out
>>
>>59852371

C is considered a lingua franca of programming. Given its ubiquity among software used by the everyday person, it should help that every programmer understand it, so that they can understand the inner workings of existing programs. Preferably, it should be learned as an introductory language, due to the fact that its syntax is simple, and it can help programmers understand as they learn new languages, what their higher level abstractions look like at a lower level.

C is a language that plays an excellent role in teaching programming. For creating new projects, however, C++ and Rust make better choices where C was once appropriate.
>>
>>59852507
HKTs are a pretty basic thing every non-trash language should have. There is literally nothing "special" about them.
>useful
You do realize this is an absolutely meaningless word, right? You obviously don't find them useful since you've never used them, while other people do. Meaning it's a retarded subjective metric.
>real programming
What is "real programming"? Can programming be "fake"?
>>
>>59852545
I think using most dynamic languages is "fake" programming: it provides the illusion of productivity, but nothing more.
>>
>>59852562
Something is either programming or something isn't programming. There are no other possible states.
In which case it's pretty clear that using dynamically checked garbage is definitely not programming.
>>
>>59852477

>C++ can't do that
C++ has HKTs. I don't quite understand the syntax of what you are doing in Haskell (I understand very little Haskell), but with a better description of what it is and what it does, I could likely translate it to C++, probably with template template types.

>>59852610

Just because a language doesn't have a static type checker doesn't mean it's not programming.
>>
>>59852660
Programming in a dynamic language is like performing car maintenance with a dildo.
>>
@59852660
>Just because a language doesn't have a static type checker doesn't mean it's not programming.
That is the very definition of not being programming.
>>
HKT's usefulness in Haskell comes from how easy they are to readily use. Most languages require heavy boilerplate to emulate them, so people used to working in other languages don't see how they are useful and think they are a waste of time.

They are simply a way to abstract higher-order types. We already abstract values using functions and objects, and most languages now see the utility in abstracting types using a sort of generics system. The logical missing step is just to be able to abstract the "List" part of the type "List<Int>", rather than just being able to abstract the "Int" part.
It's like, being able to pass first class functions around. Most languages didn't implement lambdas and closures because they didn't see the utility, but now every language does because it's fucking useful. Perhaps HKT's will follow similarly, perhaps they won't
>>
@59852693
>objects
>We
Speak for yourself, shit-eater.
>>
>>59852688

No, the definition of not being programming would be not being turing complete. Even Brainfuck is considered to be a programming language.
>>
>>59852759
>No, the definition of not being programming would be not being turing complete.
This is comically wrong.
>>
>>59852782
You do realize who you're talking to, right? Even if you're new here, her previous post outright shows you the full extent of her retardation.
>>
>>59852839
I'm feeling charitable, I suppose.
>>
>>59852693
And what is the usefulness of abstracting the List part?
>>
>>59852962
What is the usefulness of generics?
>>
>>59852962
Being able to provide functions that are always to and from the same "kind" of data.
The often cited example is being able to provide a generic "map" operation that maps any kind of things, whether that be a list, or a tree, or something more subtle (like an optional type, or even monads if you take it so far).
>>
>>59852989
And then be able to build functions using those generic functions. Want to map with one function, then another? You can write a generic map2 function using map.
>>
To be honest, the most useful thing about HKT's is being able to have monads, in the Haskell sense. Most people don't see the point in being able to create composable mini-interpreters in their code, but Haskell folks like it a lot. Maybe that's fine.

One big problem with HKT's in a language like Rust is that it doesn't always work.
You WANT a sort of abstract "foreach" function that iterates over any kind of collection, e.g. (pseudocode)
fn foreach<T<_>, A> (what : T<A>, how : Action<A>) -> void


But this doesn't really work with a lot of structures. The obvious example is strings. Strings aren't generic containers; they're specific containers over just chars. So in this case a String class wouldn't be able to instantiate the 'foreach' function, because it isn't generic. Haskell gets around this by not really having a real string type, but a language that intends to be efficient might night have the luxury of representing strings as linked lists of each character.

Other than Traversable and Monad, what use would Rust have for HKT's? I think what it really needs it type-level integers, which they are probably extremely reluctant to implement.

I'm thinking about building a language myself that is extremely meta, the line between interpreting and compiling being very blurred. Not full-on dependent types, since that basically requires your language to be a proof engine, which is not the goal. I'm going to experiment with boundless type level values and see how it works out for practicality. It might end up like C++'s template mechanism on steroids.
>>
>>59850656
moar digits of pi?
>>
>>59853115
>Other than Traversable and Monad, what use would Rust have for HKT's?
All the uses Haskell has for HKTs.
>>
>>59850305
>but that material is supposed to be hand-forged metal.
Nope, looks more like marble or something
>>
You all go on about monads yet no one can even explain what a monad is.
>>
>>59853283
I think they meant in that video clip
Thread posts: 337
Thread images: 28


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