[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: 314
Thread images: 40

File: 1493325312371.png (350KB, 500x492px) Image search: [Google]
1493325312371.png
350KB, 500x492px
What are you working on, /g/?

Old thread: >>62212233
>>
Dual PC wall mounting. Only thing I need to buy now is the PCIe risers.
>>
>>62217857
What's the most painless way to kill myself, /dpt/?
>>
>>62217884
hows that programming
>>
>>62217889
Divide yourself by 0.
>>
Rewriting my game engine for the third time. Is this normal?
>>
>>62217889
electrical clamps to the nuts
>>
http://www.buildyourownlisp.com/chapter5_languages

>So what does code that looks like a grammar...look like? Let us take a look at mpc by trying to write code for a grammar that recognizes the language of Shiba Inu. More colloquially known as Doge. This language we are going to define as follows.

>› An Adjective is either "wow", "many", "so" or "such".

>› A Noun is either "lisp", "language", "c", "book" or "build".

>› A Phrase is an Adjective followed by a Noun.

>› A Doge is zero or more Phrases.

who recommended me this
>>
>>62217930
>the state of lisp
>>
>>62217930
Why would you waste your time on anything involving lisp?
>>
>>62217930
>the language of Shiba Inu.
the grammar is correct

example is just funky and you are too much of a brainlet
>>
>>62217918
It is, the ratio of game engines to actual games should be kept at at least 3:1.
>>
>>62217945
Because writing a lisp compiler/interpreter is dead simple and a good way to get into compiler design.
>>
>>62217945
Not the one you replied to but I've thought about playing with lisp to get a better grasp on map/filter/reduce/zip and all other shit that makes code just a little bit shorter.
>>
File: 1361918016065.jpg (53KB, 261x257px) Image search: [Google]
1361918016065.jpg
53KB, 261x257px
>>62217918
Unfortunately, yes
>>
>>62217954
i'm not saying it's incorrect
>>
File: ctype.CPU7337.png (9KB, 820x623px) Image search: [Google]
ctype.CPU7337.png
9KB, 820x623px
>>62217857
Decompilation.
>>
>>62217930
How many other HAHA MEMES have you ran into with this?
>>
>>62218013
then what is the problem exactly
>>
>>62217964
Lisp is a dynamically typed language, writing a compiler for it not trivial. Writing an interpreter is tho, since it has no syntax that means it's trivial to parse. Still tho, it's better to learn about actually compiled languages with actual syntax.
>>62217971
>to get a better grasp on map/filter/reduce/zip
You might as well play with Python since it has all these things, and just like lisp has nothing to do with functional programming.
>>
>>62217889
Learn JavaScript
>>
File: p91.png (827KB, 827x672px) Image search: [Google]
p91.png
827KB, 827x672px
Python's where it's at! You can do almost anything with it!
>>
>>62218088
already did this
>>
File: 1503781261192.jpg (1MB, 620x4462px) Image search: [Google]
1503781261192.jpg
1MB, 620x4462px
How accurate is this? What needs to be changed/added?
>>
>>62218026
it's cringeworthy, it's adolescent, it doesn't take itself seriously so why should i. i could go on, do you want me to?
>>
>>62218182
APL and Prolog.
>>
>>62218182
what a cringeworty adolescent meme
>>
>he doesn't program in shakespeare, the thinking man's language
>>
>>62218220
did you write that website or something? are you really getting butthurt over poeple thinking your 2005 era memes aren't funny and aged like shit? next time don't use memes in a resource you want people to take seriously
>>
>>62218243
if you like the resource and learn things from it, you'll use it regardless of whether 'people take it seriously'
take it ez
>>
>>62218182
add BASIC between C++ and Fortran
>>
>>62217918
Are you using Rust?
>>
>>62218182
>What needs to be changed/added?
Change it so it's no longer on your hard drive, what a fucking awful meme
>>
Why is pattern matching so comfy?
>>
>>62218784
Because it's a great idea. Surprise surprise industry avoided it for as long as possible, too busy being "pragmatic"
>>
>>62218182
racket after lisp
>>
Why do integer types end with _t? Like int8_t and int16_t.
>>
File: 1499158142957.png (572KB, 563x706px) Image search: [Google]
1499158142957.png
572KB, 563x706px
Are you a little Anime girl, /g/?
http://www.strawpoll.me/13845606
>>
>>62218813
Traditional naming schemes for types
C89 had wchar_t, off_t, ptrdiff_t

Also POSIX recommends types to be named _t:


B.2.12 Data Types

The requirement that additional types defined in this section end in ‘‘_t’’ was prompted by the problem of name space pollution. It is difficult to define a type (where that type is not one defined by IEEE Std 1003.1-2001) in one header file and use it in another without adding symbols to the name space of the program. To allow implementors to provide their own types, all conforming applications are required to avoid symbols ending in ‘‘_t’’, which permits the implementor to provide additional types. Because a major use of types is in the definition of structure members, which can (and in many cases must) be added to the structures defined in IEEE Std 1003.1-2001, the need for additional types is compelling.
>>
File: 1504378123.png (30KB, 999x412px) Image search: [Google]
1504378123.png
30KB, 999x412px
>>62218924
not disappointed
>>
Finally got cmake to build my hobby os. Next step is to get jslinux to load it.
>>
retard here
is there any other, better, way of determining how many digits a number has?
    if (num <= 9)
n = 1;
else if (num <= 99)
n = 2;
else if (num <= 999)
n = 3;
else if (num <= 9999)
n = 4;
else if (num <= 99999)
n = 5;
else if (num <= 999999)
n = 6;
else if (num <= 9999999)
n = 7;
else if (num <= 99999999)
n = 8;
>>
>>62219060
log base 10
or, convert it to a string and check the length of the string
>>
File: 1496938417218.jpg (56KB, 512x642px) Image search: [Google]
1496938417218.jpg
56KB, 512x642px
>>62218924
>there is one little anime girls ITT
>>
>>62219060
Yes.
>>
>>62219060
make it into a string and get length
>>
>>62218580
No, C11.
>>
>>62219076
I just tried log base 10 on my calculator. I assume I just celi() the result?
>>
>>62219060
n = ceil(log10(num))
>>
>>62219060
Divide by ten until zero, count iterations
>>
>>62219101
>Modern C
Meme. ANSI or go home.
>>
>>62219076
>>62219093
>convert to string
>use log
why not
size_t digitCount(size_t n) {
size_t count = 0;
while (n > 0) {
n /= 10;
++count;
}
return count;
}


>>62219122
I like my declare-anywhere variables, anonymous structs and unions, fixed-size types and everything else just fine. You can go fuck yourself, mister jobless neet.
>>
>>62218151
Python was literally made for kids who are new to programming.
>>
>>62219168
And turned out to be a good language in its domains. Your point?
>>
>>62219168
>A-and Scientists! Not j-just kids! REALLY.
>>
>>62219168
python would be more decent if not whitespace
>tfw I thought earlier it was a nice idea
>>
>>62219213
It is good. It condenses code. I also think it would be good if you, in general, eliminated all style choice, that way condensing the language even more. Consider the following example:

>THIS_IS_CONSTEXPR
>thisIsAVariableAndFunctionsAreVariablesToo
>ThisIsAType

Also, if you get rid of colon before new indentation level you wouldn't need elif shit and could just write else if.
>>
>>62219179
No, it didn't.

>>62219213
Whitespace is the least of its concerns.
>>
What are some must-reads for software developers?

I nominate the following books:

The Structure and Interpretation of Computer Programs (SICP) - Gerald Jay Sussman and Hal Abelson

Applied Cryptography 2nd Edition - Bruce Schneier

Introduction to Algorithms (CLRS) - Cormen, Leiserson, Rivest, Stein

RFC 7231, HTTP/1.1 - Fielding and Reschke

Any more?
>>
>>62219302
Well, whatever. I'm using it for my game engine resource generator. Already over 500 lines.
>>
File: poster count.png (26KB, 458x745px) Image search: [Google]
poster count.png
26KB, 458x745px
I've written a small program that prints every new unique poster of a specific thread, but sometimes it prints the same poster two or three times in a row, I don't know what's going on, can someone take a look and help?

https://pastebin.com/Wrpwaiys
>>
>>62219350
How are you distinguishing unique posters?
>>
>>62219313
The Pragmatic Programmer - Andrew Hunt and David Thomas
Code Complete: A Practical Handbook of Software Construction - Steve McConnell
Design Patters - The Four Amigos

Graphics Programming:
Computer Graphics: Practices and Principles - Hughes, van Dam, McGuire, Foley, Feiner, Akeley
Real-Time Rendering - Akenine-Moller, Haines, Hoffman
Physically Based Rendering - Pharr, Jackob, Humphreys
>>
>>62219386
in the 4chan API there's a unique ips count, all I did is check if this number increases when someone does a new post, if it does, then it's a new guy
>>
>>62219386
and adding to that, I can only know the first post of a new guy, the rest of the posts that anyone makes are impossible to track
>>
File: 1500742619095.png (11KB, 411x387px) Image search: [Google]
1500742619095.png
11KB, 411x387px
>>62219076
>>62219113
log10(1000) = 3
>>
>>62219566
should be log10(n) + 1
>>
Is Haskell fun? I was watching some computerphile vids and stumbled upon some people who really liked it. Is functional programming all that much different from what I've been learning in school (oop)?
>>
File: 1500742769430.png (247KB, 638x359px) Image search: [Google]
1500742769430.png
247KB, 638x359px
>>62219580
that works. go do I in to math?

>ftw I passed calc
>>
>>62219618
Yeah, it's fun. It's not that practical by itself, but it would bend your mind in a beneficial way, making you a better programmer.
>>
>>62219618
Yes! Try it out!
>>
>>62219638
this

I love ADTs!
>>
>>62219638
>not that practical

question mark
>>
>>62219618
>Is functional programming all that much different from what I've been learning in school (oop)?
Functional programming is the light desu. We're just cursed by academia not caring about speed.
>>
>>62219638
>>62219642
>>62219646
don't fall for memes anon
>>
>>62219672
haskell is the new gentoo
>>
>>62217889
undefined behavior
>>
>>62219246
> It is good.
It is good if it doesn't make difference betwwen tab and space indentation.
But it fucking does!
>>
>>62219732
>he mixes tabs and spaces
thank lord Guido from protecting me from faggots such as yourself
>>
>>62219760
>he cares about spaces and tabs
lol what a faggot
>>
>>62219246
>you wouldn't need elif shit and could just write else if.
i can't see why that matters. elif is just as readable and it's shorter
>>
File: pathetic.jpg (24KB, 680x419px) Image search: [Google]
pathetic.jpg
24KB, 680x419px
>>62219799
>he cares about different byte values

>i can't see why that matters. elif is just as readable and it's shorter
It pollutes _keyword_ namespace (which is equivalent of registers in the CPU memory hierarchy) and shortness is literally nothing when you're talking about projects over 10kloc.
>>
I'm writing a GLFW wrapper. My question: who the fuck has 25 function keys?
>>
Can I get a job with Kotlin or should I focus on Java instead?
>>
>>62219861
>his keyboard has only 12 function keys
>>
File: code::blocks.png (67KB, 440x190px) Image search: [Google]
code::blocks.png
67KB, 440x190px
>tfw Code::Blocks has regex search and replace
>>
>>62219875
kotlin is a meme, stick with java
>>
>>62219875
You can get a job with anything if you're competent. Seeing as you're asking this, you probably are not and should increase your chances of employability by targeting a larger market, Java.
>>
>>62219879
I've never seen one that has more.
>>
File: MQ052.jpg (97KB, 1000x1000px) Image search: [Google]
MQ052.jpg
97KB, 1000x1000px
>>62219861
>>
What programming languages will be "on demand" in 3-5 years from now? (in your opinion ofc)
>>
>>62219936
JavaScript.
>>
>>62219936
Rust
>>
>>62219936
>what I wish
c++22
racket
r

>what will be
js
js
java
>>
>>62219936
Haskell
Haskel2020
PureScript
>>
>>62219848
They could:
a) forbid spaces or tabs for indentation, making the use of only tabs or only spaces for indentation
b) they could enforce not whitespace indentation
They did neither the first, nor the second.
IIRC there was some PEP on that, though.
>elif is just as readable and it's shorter
Don't greentext what I didn't say, mong, I agree about that.
>>
>>62219936
Just watch, COBOL2020 will take the programming by storm.
>>
>>62219313

SICP
K&R
"31 days of refactoring" (free e-book!)

Also:
A decent book about Databases (i.e. "SQL antipatterns" by Karwin)
A decent book about Data Stuctures (i.e. "Open Data Structures" by Morin)


All in all I would avoid "bulky" books like "The Art of Computer Programming". It's better to read concise, entertaining and well written books. Life is short.
>>
>>62220043
THIS 2020 TIMES
>>
kabir, 13yo, programs in C, Crystal, and Python.

https://kabir.ml/
https://github.com/kbrsh
>>
>>62219625
I haven't even passed calc. Took me 3 tries to do Calc I and I'm on my 2nd try on Calc II. I fucking hate math, but I have an encyclopedic memory for obscure technology facts. I think a lack of effort is my greatest weakness
>>
>>62219101
Rewrite it in Rust.
>>
>>62220063
>It's better to read concise, entertaining and well written books.
>war and piece
>>
>>62219890
Code::Blocks is comfy as fuck to me. we use VS at work and it feels so clunky.
>>
>>62220117
I won't write my engine in a meme language.
>>
>>62220129
>Writing a game engine in C
Meme engine
>>
>>62220084
he also made a hashing lib in x64 assembly, it's very simple but still impressive for a 13 years old.

https://github.com/kbrsh/slash
>>
File: logo.png (580KB, 1000x1000px) Image search: [Google]
logo.png
580KB, 1000x1000px
>>62220084
apparently also rips of the kotlin logo
>>
>>62220145
It will produce at least one game.
>>
>>62220145
Not him, but I'm writing an engine and software renderer in C++ with a C library
>>
>>62220156
he's a programmer, not a designer.
>>
>>62220191
and how does that exempt you from having a sense or originality?
>>
>>62220084
Every 13 year old pajeet who's dubbed a genius by retards simply has pajeet parents who beat their kids until they can recite interview questions about algos and DS in their sleep.
>>
Hello lads. I am looking for the fastest programming language that is readily used out there. From what I read, the fastest possible programming languages are assembly languages, but I can't imagine those are used often or are in demand in the job market. Rust is also supposedly fast, but no one uses it, so that's out. That leaves C and C++. My understanding is C is probably a little faster, but not much faster than C++, and much less often used. Would this mean C++ is the way to go, or is C still useful? Also, would a C++ compiler also be able to compile C programs? Can you compile C in Microsoft Visual Studio? Thanks lads
>>
>>62220084
>1751 commits in a repo
>most are single line changes
Why?
>>
>>62220239
Judging by your post you're a complete brainlet. Take some enterprise language with a huge standard library and *do not* try to implement any algorithm. I would recommend Java.
>>
>>62220239
C++ is just as fast as C if you write it the same as idiomatic C.
In practice that doesn't happen at all and you take on several abstractions that slow things down significantly.
C++ and C usage are even I guess, it depends on the field exactly.

Learn C first. C is a small and complete language. C++ is a big and hacky language and not all the pieces feel like they fit.

Most C is valid C++, but not all. One of the major differences is that void* does not implicitly convert in C++, but does in C, causing programs which initialize a variable with malloc (i.e. most programs) to fail to program.

I believe MSVC is known for having issues compiling C later than C89. I don't know much more than that, I always use gcc
>>
>>62220294
so you can have

5,898 contributions in the last year

on your front page!
>>
>>62220294
https://news.ycombinator.com/item?id=15157735
>>
>>62220191
i'm not a writer, so when i wrote a book i just copied harry potter verbatim and then changed the names
>>
>>62220346
i doubt he coped kotlin logo, he just made a generic one. kotlin logo has nothing special.
>>
>>62220294
Actually, it seems, that i have more loc in my repo with just 200 commits than that guy with over 8 times the number of commits.
>>
File: 1491974399698.jpg (19KB, 239x207px) Image search: [Google]
1491974399698.jpg
19KB, 239x207px
>our consultant who is in charge of handling the setup of our new ops
>picks mysql server
>>
>>62220360
if you can show me a logo that looks that strikingly similar to the kotlin logo i'd be impressed. because it's a bit of a coincidence that he'd come up with a nearly identical logo as a logo made in the same field as he's interested in, and that was made shortly before he made his own. so if that was just coincidence, you should easily be able to find 10-15 from the past 50 years or so from all the different industries
>>
>>62220403
Why do you need a consultant if you're so smart yourself anon? Couldn't you have just advised on what technologies to use?

Sure is easy to complain here ;^)
>>
>>62220084
I'm 20 :(
>>
>>62220403
>mysql server
What is the problem?
>>
>>62220425
search "logo k" on google image
>>
>>62218182

I agree more or less, but why don't you like C or Rust?
Also Fortran is really meh..
>>
File: T_T.png (33KB, 564x419px) Image search: [Google]
T_T.png
33KB, 564x419px
Sometimes i wish i was using haskell.
All that repetition is because scala doesn't really have a nice way of making a function that can work on longs, floats and doubles.
>>
>>62220301
>Take some enterprise language with a huge standard library
I already know Python, which has a fairly large standard library. I am trying to take some of my Python programs, and rewriting them in other languages to see how fast my programs can go.

>>62220303
Thanks lad. So it sounds like if I write a basic C program, I would be able to compile it in a C++ compiler?
>>
>>62218784
Isn't pattern matching is just glorified way to handle different arguments?
>>
>>62220579
Only if it's a trivial C program.
Most programs of a decent size will run into one of the incompatibilities.
>>
test
>>
File: 331.png (7KB, 560x151px) Image search: [Google]
331.png
7KB, 560x151px
Brainlet here, why isn't this giving me the correct angles? Shouldn't they be 60?

function createTriangle(a, b, c) {
function isValid(a, b, c) {
return (a + b) > c && (b + c) > a && (c + a) > b;
}

function angle(opposite, adj1, adj2) {
return Math.acos( (Math.pow(opposite, 2) - Math.pow(adj1, 2) - Math.pow(adj2, 2)) / (-2 * adj1 * adj2) );
}

if(!isValid(a, b, c)) {
throw "Invalid triangle";
}

return {
a: a,
b: b,
c: c,
angleA: angle(a, b, c),
angleB: angle(b, a, c),
angleC: angle(c, b, a)
}
}
>>
File: 1394031748708.jpg (27KB, 215x296px) Image search: [Google]
1394031748708.jpg
27KB, 215x296px
IDENTIFICATION DIVISION.
PROGRAM-ID. APPLYTRANSACTIONS.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IDX-MOVIE-FILE ASSIGN TO "MOVIESIDX.DAT"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS IDX-MOVIE-ID
FILE STATUS IS MOVIE-STATUS.

SELECT TRANSACTION-FILE ASSIGN TO "MOVIESTRANSACTIONS.DAT"
ORGANIZATION IS LINE SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD IDX-MOVIE-FILE.
01 IDX-MOVIE-REC.
88 EOF-IDX-MOVIE-FILE VALUE IS HIGH-VALUES.
02 IDX-MOVIE-ID PIC 9(7).
02 IDX-MOVIE-YEAR PIC 9(4).
02 IDX-MOVIE-TITLE PIC X(100).
02 IDX-MOVIE-GENRE PIC X(20).

FD TRANSACTION-FILE.
01 TF-DELETION-REC.
88 EOF-TRANSACTION-FILE VALUE IS HIGH-VALUES.
02 TYPEID-TF PIC X.
88 DO-DELETION VALUE IS "D".
88 DO-INSERTION VALUE IS "I".
88 DO-UPDATE VALUE IS "U".
02 TF-MOVIE-ID PIC 9(7).

01 TF-INSERTION-REC.
02 FILLER PIC X.
02 TF-INSERTION-BODY.
03 FILLER PIC X(131).

01 TF-UPDATE-REC.
02 FILLER PIC X(8).
02 UP-MOVIE-TITLE PIC X(100).

WORKING-STORAGE SECTION.
01 MOVIE-STATUS PIC XX.
88 MOVIE-OK VALUE ZERO.

PROCEDURE DIVISION.
001-MAIN.
OPEN I-O IDX-MOVIE-FILE
OPEN INPUT TRANSACTION-FILE
READ TRANSACTION-FILE
AT END SET EOF-TRANSACTION-FILE TO TRUE
END-READ
PERFORM 002-UDPATE-MOVIES UNTIL EOF-TRANSACTION-FILE
CLOSE IDX-MOVIE-FILE, TRANSACTION-FILE
STOP RUN.

002-UDPATE-MOVIES.
EVALUATE TRUE
WHEN DO-DELETION PERFORM 003-DELETE-MOVIE
WHEN DO-INSERTION PERFORM 004-INSERT-MOVIE
WHEN DO-UPDATE PERFORM 005-UPDATE-MOVIE
END-EVALUATE
READ TRANSACTION-FILE
AT END SET EOF-TRANSACTION-FILE TO TRUE
END-READ.

SQL is gay
>>
>>62220638
Basically the program I want to convert just loops through certain files in a zipfile, and reads specific data from it. I assume its simple enough to not run into issues
>>
>>62220714
You won't know until you try to compile it.
>>
>>62220675
it's cobol
>>
File: f24.gif (62KB, 563x237px) Image search: [Google]
f24.gif
62KB, 563x237px
>>62219879
>he doesn't want to support the AS/400
>>
In SDL, what's a renderer, a context and a surface?
I'm confused.
>>
>>62220747
RTFM
>>
>>62220659
They are right, just in radians. You have to convert them if you want them in degrees.
>>
yo wtf? why does pthread_cond_timedwait return ETIMEDOUT immediately?

https://ideone.com/TyXxr1
>>
>>62220745
https://www.helpsystems.com/blog/as400-dead

Learned something new today.
>>
>>62220747
surface is a picture as an array of pixels in RAM memory
context = openGL context, the state of opengl objects attached to your current window
the SDL renderer is an abstraction of either accelerated or software rendering, depending how you set up the window
>>
>>62220743
That was the point, real men use COBOL
>>
>>62220859
>real men
>>
File: COBOL.png (14KB, 200x200px) Image search: [Google]
COBOL.png
14KB, 200x200px
>>62220859
Can you link with OpenGL in COBOL?
>>
What do you usually do when you have no idea how to start an assignment?
>>
>>62220917
think
>>
>>62220927
What if you're a brainlet?
>>
>tfw branelet
>>
>>62220945
think harder
>>
>>62220851
Okay, thanks.
What do you mean by the "state" of OpenGL objects though?
>>
>>62220747
If you want to learn that SDL2, just checkout Lazy Foo's Beginning Game Programming 2.0. Its an SDL tutorial, and a good one at that.

To add to what the other anon said:
SDL_Renderer contains the state of SDL's own rendering system. If you 're using the hardware accelerated renderer, it will use OpenGL 1.0 behind the scenes - not very efficient, but it gets the job done for most 2D things.
>>
>nearly 700 lines of javascript just to render a spinning cube
Jesus christ WebGL suck more why don't you
>>
>>62220984
OpenGL is a stateful API. When it's initialized, you create an "OpenGL context" on the thread you're initializing from. Then any GL function calls made from that thread will affect that context's state, like "what is the currently active viewport", "what's the currently bound vertex array object", and so on.
>>
>>62220945
think longer
>>
>>62220994
>700 lines
>proper 3D
That's pretty short.
>>
>>62220987
Thanks. I've read somewhere that Lazy Foo's wasn't a great tutorial, so I chose to avoid it. I'll give it another look. I'm using willusher.io's ones at the moment.
>>
>>62220994
>he fell for the webgl meme
ask yourself why 99% of webgl apps are shadertoy-tier fragment shaders and babbys first video game demos
>>
>>62221078
Literally the only normal graphics API for the web. I myself work with OpenGL ES 2.0 in C11.
>>
>>62221095
yeah but random people shouldn't be using it. most websites shouldn't even require javascript imo
>>
>>62218023
Is that gohufont?
>>
>>62221117
unifont
>>
>>62221113
>yeah but random people shouldn't be using it.
why
>>
Named parameters need to be the standard. Compare C++ to Obj-C:
myCar.drive(42, 4, true, false);

[myCar driveDistanceKm: 42 inGear: 4 usingHybridPower:YES leftHandTraffic:NO];

The readability difference is drastic. And no, passing a dict or struct as the only param is not the same thing.
>>
File: 1498123654717.png (98KB, 612x491px) Image search: [Google]
1498123654717.png
98KB, 612x491px
>>62220817
pls

https://stackoverflow.com/questions/46018295/pthread-cond-timedwait-returns-etimedout-immediately
>>
>>62221428
using good variable names at least makes function calls more readable

myCar.drive(distance, speed, is_4wd,
is_parked)


I'm not arguing named parameters aren't better, just that you can minimize damage/headaches with better practices
>>
>>62221428
>passing a dict is not the same thing
why not?
>>
>>62221428
IntelliJ annotates parameter types
>>
>>62220084
>I'm a maker
Stopped reading there.
>>
>>62221428
You are fucking retarded. You can easily accomplish that in C++.

myCar.drive(DriveDistanceKm(42), InGear(4), UsingHybridPower(YES), LeftHandTraffic(NO));
>>
File: s4n3rzvpzsicyiglju8o.jpg (57KB, 800x531px) Image search: [Google]
s4n3rzvpzsicyiglju8o.jpg
57KB, 800x531px
Why isn't software development as sexy as the media made it out to be? I want all-nighters with other cool dudes and keggers. Then when I make a bajillion dollars I wanna spend it all on hot Korean chicks. Why are all other people in CS such fucking losers?
>>
File: 1403837987365.png (48KB, 400x389px) Image search: [Google]
1403837987365.png
48KB, 400x389px
>>62221537
>cool dudes and keggers
Thank God this doesn't happen a lot in software development, "bro".
>>
>>62221553
This is what I'm talking about. Nobody in CS wants to make friends or hang out. Everyone around me is so fucking boring
>>
>>62221519
>A struct or class for each of those arguments
How completely retarded
>>
>>62221575
Consider switching to Business Administration like most dudebros
>>
>>62221575
get out normie
>>
>>62221469
Passing a dict/map (like you might do in JS) is obviously straight out (can only be checked at runtime, requires dynamic memory allocation by design, string comparisons just to read parameters, etc). I'll assume you meant passing a struct. That's more sane, but:
1. Most languages don't provide clean, non-redundant syntax to create and pass a struct as a param
2. You still need to define a param struct for every complex function, located away from the function definition itself. Thus creating bloat, boilerplate, and redundancy.

>>62221479
How does it decide which ones to annotate? I would argue it still isn't as readable as obj-c.

>>62221519
So you need a struct w/ctor for each parameter of each function? Do you define those manually, or generate them in some way?
>>
File: SwAYmH3.jpg (73KB, 640x426px) Image search: [Google]
SwAYmH3.jpg
73KB, 640x426px
>>62221537
"We sat down one morning," recalls Steele. "I was at the keyboard, and he was at my elbow," says Steele. "He was perfectly willing to let me type, but he was also telling me what to type.

The programming session lasted 10 hours. Throughout that entire time, Steele says, neither he nor Stallman took a break or made any small talk. By the end of the session, they had managed to hack the pretty print source code to just under 100 lines. "My fingers were on the keyboard the whole time," Steele recalls, "but it felt like both of our ideas were flowing onto the screen. He told me what to type, and I typed it."

The length of the session revealed itself when Steele finally left the AI Lab. Standing outside the building at 545 Tech Square, he was surprised to find himself surrounded by nighttime darkness. As a programmer, Steele was used to marathon coding sessions. Still, something about this session was different. Working with Stallman had forced Steele to block out all external stimuli and focus his entire mental energies on the task at hand. Looking back, Steele says he found the Stallman mind-meld both exhilarating and scary at the same time. "My first thought afterward was: it was a great experience, very intense, and that I never wanted to do it again in my life."
>>
>>62221625

Yeah but you have to hang out with an autist like RMS
>>
Is /dpt/ an appropriate place to post code for help?
>>
>>62221693
Yes, we love to help people, especially if it's related to web development.
>>
>>62221600
Somehow your social skills should determine your major? I'm a software developer, not some college sophomore. All I'm saying is that CS people are absolutely retarded when it comes to interacting with other people. You can't just coast on programming skills for your entire career, at some point you have to move up to a job that involves, you know, interacting with people. At that point, the "dudebros" will be promoted and the sperglords will find themselves being replaced by people 20 years younger, and unable to find a job in a market dominated by 20-somethings
>>
>>62221693
yes, but not homework or web stuff

>>62221519
that's bad
>>
So far I've only been writing console programs (I'm only starting) in C#. What is the name of the most default GUI style for Windows apps? If I took a Windows 95-era program and executed it in Windows 10 what would be used to render it?

There seem to be too many options of making your software eye-catching nowadays. I just want to make simple, Windows 98-like software for modern systems.
>>
>>62221713
>Thinking that everyone should have to move "up" to a management role
I like development because it's a peaceful job where I can be inside my head most of the day. I still get along very well with my colleagues and we get out a lot, but I don't want it all the time.

Plus, my plan is to be mortgage free before I'm replaced. So far I'm on track.
>>
>>62221711
>>62221761
Thanks amigos
How do I post code?
>>
>>62221791
Enjoy dying poor and homeless
>>
>>62221888
sorry, should've just googled it first

def sig(z1):
return 1/(1+np.exp(-z1))

def dsig(z1):
return sig(z1)*(1-sig(z1))

def softmax(z3):
pass

n_inputs = 2
n_outputs = 1
n_hidden_neurons = 100

W1 = np.random.randn(n_hidden_neurons, n_inputs)/np.sqrt(n_inputs)
W2 = np.random.randn(n_hidden_neurons, n_hidden_neurons)/np.sqrt(n_hidden_neurons)
W3 = np.random.randn(n_outputs, n_hidden_neurons)/np.sqrt(n_hidden_neurons)

b1 = np.random.randn(n_hidden_neurons)
b2 = np.random.randn(n_hidden_neurons)
b3 = np.random.randn(n_outputs)

X = np.array([[0,0], [0,1], [1,0], [1,1]])
Y = np.array([[0], [1], [1], [0]])

for i in range(0, 1000):
for j in range(0, 4):
x = X[j]
y = Y[j]

z1 = np.dot(W1, x) + b1
a1 = sig(z1)
z2 = np.dot(W2, a1) + b2
a2 = sig(z2)
z3 = np.dot(W3, a2) + b3
a3 = sig(z3)

C = (y-a3)**2 * 1/2

delta3 = (a3-y) * dsig(z3)
delta2 = np.dot(W3.T, delta3) * dsig(z2)
delta1 = np.dot(W2.T, delta2) * dsig(z1)
dCdb3 = delta3
dCdb2 = delta2
dCdb1 = delta1
a2 = np.reshape(a2, (a2.shape[0], 1))
dCdW3 = np.dot(a2, delta3)
dCdW2 = np.dot(a1, delta2)
x = np.reshape(x, (x.shape[0],1))
delta1 = np.reshape(delta1, (delta1.shape[0],1))
dCdW1 = np.dot(x, delta1.T)

learning_rate = 0.001
W1 += -learning_rate*dCdW1.T
b1 += -learning_rate*dCdb1.T
W2 += -learning_rate*dCdW2.T
b2 += -learning_rate*dCdb2.T
W3 += -learning_rate*dCdW3.T
b3 += -learning_rate*dCdb3.T

for i in range(0, 4):
x = X[j]
z1 = np.dot(W1, x) + b1
a1 = sig(z1)
z2 = np.dot(W2, a1) + b2
a2 = sig(z2)
z3 = np.dot(W3, a2) + b3
a3 = sig(z3)
print("final o:", a3)

Comments in reply to this post, running out of characters
>>
>>62221618
What if there is syntax for anonymous struct types and values? E.g.
def drive(car: Car, params: { distance: i32, gear: i32, hybridPower: u1, leftHandTraffic: u1 }): u0 = ...

drive(myCar, { distance = 42, gear = 4, hybridPower = true, leftHandTraffic = false })
>>
>>62221976
I'm trying to implement the most basic neural net in python to convert to CUDA C (for practice)
But my outputs are wrong, they'll return the average of the Y array (so 0.5 for all answers)
For just one set (e.g. x = (0,0), y = (0)), the output will be correct, so I don't think it's the math that's the issue
If there are any ML bros, help would be appreciated
>>
>>62221990
That's a lot better. Still an extra step, but I could deal with that. What's the language?
>>
>>62222089
It's my toy language, but i don't have anonymous structs implemented yet.
>>
>>62220084
kek
https://news.ycombinator.com/item?id=15158107
>>
Just finished a small script for searching and cloning repositories on github
>>
>>62221976
you don't have separate a values for each run. They are average over all the expected outputs. (0+1+1+0)/4 ~= .5
>>
>>62222318
>>62221976
nevermind. That's not it. I don't think
>>
>>62220851
So when using a renderer in SDL, does that mean you're essentially using the GPU instead of the CPU?
If you presented a surface to the screen it would be created using the CPU, and via renderer would use GPU?
>>
What would be a nice way to create a RSS reader for a website ?
>>
>>62222427
Yes the accelerated renderer operations SDL_Render* invoke the corresponding openGL operations
>>
>>62222209
What's its purpose? What does it search for, what do you need the repos it clones for?
>>
default parameters a shit
>>
>>62222089
>>62222135
Actually that would be ambiguous in the grammar, so i guess i'm just going to support proper named parameters.
>>
>>62222522
This. All of that hidden argument nonsense is shit.
>>
>>62222545
it's a lie, I can't even take a function pointer to the call with fewer arguments. Just make an overload you lazy cunt.
>>
Trying to set up an internal network for VirtualBox.
plz help
>>
// Example program
#include <iostream>
#include <string>

void printArgs(int i = 0, char c = 'x')
{
std::cout << "Int was " << i << " and char was " << c << std::endl;
}

int main()
{
printArgs();
printArgs(10);
printArgs('c');
printArgs(11, 'e');
}


Int was 0 and char was x
Int was 10 and char was x
Int was 99 and char was x
Int was 11 and char was e

sepples a shit. A shit!
>>
>>62222579
Overloads are absolute shit.
How do you take the functional value of the function foo when you have two of them?
>>
>>62222508
>Purpose
Searching and cloning repositories?
>What does it search for
Repositories on GitHub
>What do you need the repos it clones for?
So if, for example, an application I need isn't in the devuan repos, faster to just check in command line if there is a GitHub than looking it up in a web browser
>>
>>62222608
How is that programming related?
>>
>>62222635
> functional value
que?
>>
>>62222650
function pointer if you prefer
>>
>>62222635
https://stackoverflow.com/a/2942442/4602991
>>
>>62222666
Context.
int foo(void);
int foo(int);

int bar()
{
int (*ptr)(void) = foo; // can deduce it's foo(void)
}
>>
I have a job interview after being a NEET who hasn't touch programming for a whole year after college. It's android development. As an IT major, I did a lot of Java, but I feel like I've forgotten everything tho I know its my head somewhere since I recognize shit. Any tips to refresh my brain as I turn myself into a wagecuck?
>>
>>62222724
a) Project Euler
b) Build an Android app
>>
File: k.png (1MB, 1920x805px) Image search: [Google]
k.png
1MB, 1920x805px
>>62220480
you just proved my point fucking idiot. none of them look like the kotlin logo
>>
>>62222742
thanks
>>
File: 2017-09-02-235749_800x600_scrot.png (595KB, 800x600px) Image search: [Google]
2017-09-02-235749_800x600_scrot.png
595KB, 800x600px
I made my own pseudo-random number generator, using bit shifting, NOT, and EOR
>>
File: 2.jpg (90KB, 800x534px) Image search: [Google]
2.jpg
90KB, 800x534px
What's your favorite IDE for java?
>>
>>62222924
wtf is that

also
>IDE
git gud skrub
>>
>>62222957
it's an angry wet rock
>>
File: 1422139984182.jpg (57KB, 800x600px) Image search: [Google]
1422139984182.jpg
57KB, 800x600px
>>62222957
>wtf is that
>>
>>62222924
1. IntelliJ IDEA
2. NetBeans
3. Eclipse
>>
1
2
3 4
>>
>>62223118
why do we need something so wonky
look at their feets
>>
File: editor-latency-windows-text.png (8KB, 580x430px) Image search: [Google]
editor-latency-windows-text.png
8KB, 580x430px
>>62222924
*Consider this
>>
>>62221976
found it!
you access X[j] in the last for loop but increment over i.
change
x = X[j]
to
x = X[i]
8 lines from the bottom
>>
>>62217857
Started off programming Java, got bored due to easy it was. Moved onto lisp, and ran into the same problem. Even assembly didn't help me solve it. I started using a hex editor to program and though it provided a slight challenge, the boredom arose once again. That was about a year ago, right now I do all my programs in lambda calculus on graph paper. Sigh, if only I could go further down. Feels bad being a brainlet.
>>
>>62222706
sure it can? see >>62222689
>>
>>62223172
intellij shills on suicide watch
>>
>>62221428
#define _an(x,y) y
myCar.drive(_an(driveDistanceKm,42), _an(inGear,4), _an(usingHybridPower,true), _an(leftHandTraffic,false));
>>
>>62223694
How so?
IntelliJ has lower latency than everything else except GVim
>>
>>62223694
You did notice the IDEA (zero latency) entry higher than notepad++ and emacs, right?
>>
>>62223730
>>62223731
t. shills

https://dev.eclipse.org/mhonarc/lists/ide-dev/msg01153.html
>>
>>62223726
That's literally no different and more cryptic than
myCar.drive(/* drive distance */ 42, /* in gear */ 4, ...)
>>
>>62222143
>Child prodigy was a ruse, yet again
>>
>>62221428
it's more cluttered. just use proper variable names instead of passing raw literals. total baby duck syndrome
>>
>>62221519
That's not the same though because you need to know the order to put the variables in, compared to Obj-C where order is not important.
>>
memorizing the C standard library. it's not even that big so i'm just going to stop being a pussy and let dpt tell me to just do pajeetcode challenges instead to learn the library by googling shit like a numale
>>
what are the go-to sites for job hunting

right now im just going back and forth between Indeed, glassdoor, and linkedin.

i think i could easily get a job if i moved to a tech hub but i think im just going to wait for one to show up around here.
>>
>>62224415
Post Haskell code on github
Job finds you
300k starting
>>
>>62220917
typically you just type the name you want to assign to, then the assignment operator, then the value you want to assign, followed by the statement terminator (when applicable) of course haha
>>
>>62224430
> Haskell
> 300k

Kys please
>>
what are things that seperate big boy java devs from brainlet new grad java devs
>>
>>62222863
It looks the fucking same as the one in the upper right, but with bigger triangles.
>>
>>62222634
What is your problem here?
>>
>>62224369
Just use man when you need it.
>>
File: 1480841661286.png (1008KB, 1920x1080px) Image search: [Google]
1480841661286.png
1008KB, 1920x1080px
Should I use Gtkmm or Gtk-rs? Both seem to have their pros and cons.
>>
>>62223178
Thanks bud, nice catch
Unfortunately, that was a typo and doesn't fix the output averaging issue
Still much appreciated though
>>
>>62223221
Try programming something other than fizzbuzz
>>
>>62223172
IDEA Zero-latency != IDEA
>>
File: gOxCNus.jpg (41KB, 750x726px) Image search: [Google]
gOxCNus.jpg
41KB, 750x726px
>>62218088

> painless
>>
>>62224620
how would you know what to look up if you don't know the standard library?
>>62224598
that one has diagonal slices cut through it. pajeet did nothing different except round 2 corners. you're delusional
>>
>>62224752

that one has rounded corners. pajeet did nothing different except cut 2 slices. you're delusional.

>this is how retarded you sound
>>
I made a program that relies on checking internet connection state. I'm pinging google.com every 5 seconds, but 1 second would be ideal. Could that be considered abuse on their behalf?
>>
>>62218164
teach it to others

https://www.youtube.com/watch?v=XEQtSOTTPXw
>>
>>62224813
can you ping someone else
>>
>>62224787
wow you sure got me there. he definitely didn't rip off kotlins logo even though they look identical and the closest other logo you could find has major differences to it
>>
Going through The Little Lisper...
Anyone know what
(eqan? s1 s2)

does, and how it's different than
(eq? s1 s2)
?
>>
>>62225207
Don't blame me that you backed yourself into a corner. Both are extremely slight modifications (rounded corners, larger triangles) with a color scheme change. Either both are fine or neither is.
>>
Can I learn enough programming so that when I graduate with my mechanical engineering degree with no internships in May I'm not fucked? Was thinking C++
>>
>>62225233
rounded edges are a more minor modification than removing 30% of the image's surface area. post a picture of your hand with a timestamp, pajeet
>>
>>62225276
it's a simple fucking logo based on the shape of the letter K, even if he "copied" the kotlin logo that's hardly the worst he has done
>>
>>62225257
Did you not cover any MATLAB at least?
>>
>>62220173
nice banding, fucking jetbrains niggers
>>
>>62225276

>m-muh pajeet!

Even if I was, it just means I shat all over you as well as the street.
>>
>>62219168
And yet it's holding its own pretty well in data science, scientific computing, and machine learning. You know... The non-trivial stuff.
>>
>>62217857
I alterrate between programming in node.js and crying.
>>
File: 1497720582125.jpg (101KB, 512x411px) Image search: [Google]
1497720582125.jpg
101KB, 512x411px
os.system()
os.popen()
subprocess.Popen()


Why is Popen capital? Is there a semantic nuance or is it that way just to infuriate me?

Also, one way to do everything gois.
>>
>>62225407
no matter how well you think you may think you're arguing that the sky's green, the only one you're deluding is yourself. he ripped off the kotlin logo blatantly, and you can't find a similar example as you claim there are. idk why you're so emotionally invested in his graphic design abilities, even when you yourself said that he's unoriginal and that you yourself admitted it's unusually similar to the kotlin logo
>>
>>62225440
There is a good reason that people call it memesnek.
>>
>>62225440
>Why is Popen capital?
because Popen a class
>>
>>62225471
Not even the original guy. The only thing i'm invested in is laughing at a retard who looks at 3 near identical logos and says, "No, this one doesn't count because it makes me look stupid when I was trying to be smug."
>>
>>62225518
you need to get laid
>>
File: 1484832032973.png (21KB, 524x881px) Image search: [Google]
1484832032973.png
21KB, 524x881px
>>62225542

Better luck next time, kid.
>>
>>62217857
Rewriting the gnu coreutils in node.js
>>
>>62225374
I did a bit. Not enough to be particularly noteworthy, andI figured C++ was more reaching.
>>
>>62219157
Shouldn't it be n > 1?
>>
>>62225717
I can't speak for MEs, but I work surrounded by EEs, and MATLAB, especially SIMULINK based models, is the lingua franca of the office.
>>
>>62225765
heheh is going into divs forever.
>>
File: DeviceDriversJS.png (79KB, 506x662px) Image search: [Google]
DeviceDriversJS.png
79KB, 506x662px
>>62225659
Why?

Also, reminds me of this
>>
>>62225471
idk why you're so emotionally invested in the kotlin logo, oh wait, you're an intellij shill
>>
>>62222635
use Haskell with -XRankNTypes and -XExistentialTypes
>>
IDK man, Rust19 has some nice ideas. Const Generics, fully incremental builds, elfmalloc (an in-house implementation of jemalloc, Generic assoc types, non-lexical lifetimes, assoc functions/constants etc

Maybe I'll try Rust when Rust19 comes out
>>
>>62226440
But does it have HKTs, Rank N Types, existential quantification?
>>
>>62226445
No but it doesn't leak memory.
>>
>>62226445
>does it have HKTs
They already have accepted the generic assoc types, apparently this is their first step towards implementing an official HKT
>>
anybody else name test variables non traditional test variable names?
I do a lot of poop, poo, aaa, sukitnerd, and if I feel like it peepee.
>>
>>62226574
i do temp tmp temp1 temp2 tmp1 tmp2 foo bar
>>
>>62226677
>non traditional
>foo and bar
>>
>>62226574
>>62226677
>not using x, y, z, i, m, n, p, q
>>
>>62226712
>not fart, blart, shart, mart
>>
>>62225432
oh. me too anon.
>>
>>62226440

You mean 1.19? Because we're on 1.20 right now.
>>
>>62219050
testing random text + quote + comment

R-Rigby?!
>>
>>62220806
testing random text + quote + comment

Theyre also really soft
>>
Are there any good sources for teaching programming architecture? It's all good knowing the deep Vs shallow copy thing for C++ sort of stuff, but when I start a new project I stare at the Gradle/Cmake script thinking "I should make this nice and structured, but I don't know what is actually a good structure so I'll just stuff literally everything into a /project/src folder because I dunno what else to do and it kinda works..."
>>
writing tetris in c
>>
>>62227087
Simple is good. Putting every source file into src is a common strategy. Then, you often have a Makefile outside of the src folder and a separate build folder (which might be generated by the Makefile). In some cases you may also want a lib and include folder external dependencies.
>>
>>62227087
>>62227304
I'll just continue for a little. In the end setting up a project is all down to your own tastes, but there are some standards - for example, generally its expected that running "make" in the project's root directory will build everything automatically (or in the case of cmake I guess that would be 'cmake CMakeLists.txt', or 'mkdir build && cd build && CMake ../CMakeLists.txt'.)
>>
>>62227087
https://rix0r.nl/blog/2015/08/13/cmake-guide/
>>
>>62227304
>>62227324
I'm with you so far, the thing that is stopping me now is how to handle external dependency stuffs, like if I need Curl or something in the project, do I rely on the target to have it installed and fail the build if they don't? Or is it possible to just use Docker for everything external?
>>
>>62227449
There's a couple of strategies. If you use git and the project you rely on, you can use git submodules. That way when your repo is cloned, the submodule's git will also be cloned.
If the dependency is not a git repo but can be downloaded from the internet, you can make, for example, a wget command fetch it (and extract/build it) if it's not there at build time.
If the dependency doesn't have a great many dependencies itself and is quite small and unlikely to ever change, you can also consider building it once and just adding the binary to the project. This works especially on Windows because all machines tend to have the same stuff installed.
Some people also make their dependencies a separate repository which they then use as a submdule in the main project.
>>
New thread
>>62227640
>>62227640
>>62227640
>>
>>62227644
Early bake faggot

I've been waiting for 3 hours, you cunt
>>
>>62227324

You don't need to call cmake on the CMakeLists.txt file directly. If you run cmake with no arguments, or with a directory as an argument, it will look for that file explicitly. Same reason you don't do make -f Makefile.

Here's a handy build script:
#!/bin/sh

mkdir -p build
cd build
cmake ..
make
>>
>>62221764
>What is the name of the most default GUI style for Windows apps?
WinAPI
>>
>>62227656
>I've been waiting for 3 hours
it's not worth it
Thread posts: 314
Thread images: 40


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