/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: programming languages timeline.png (4912x3050, 1.02M)

Other urls found in this thread:

twitter.com/skirani/status/1149302828420067328
ivm.sourceforge.net/icvmcpp.html
app.klipse.tech/
stackoverflow.com/a/77336
twitter.com/NSFWRedditImage

go to hell

in b4
>OP is not anime
>OP is not amphibian
Here. Happy?

Attached: aa.jpg (214x236, 11K)

getting a new pair of programming socks. Recommend me some if you can! teehee :3

>haskell from scheme, not ml
what?
i wish i could report this

Are you a 10x programmer, user?

twitter.com/skirani/status/1149302828420067328

please don't make me look at brown people

Forgive me for asking a simple question, I only just started learning programming two weeks ago.

So in this recursive function, the compiler isn't even compiling the code below the recursive step, i.e. the if (min < A[n - 1]) stuff, until it reaches the base case correct?

int findMaxRec(int A[], int n)
{
int min;

if (n == 1)
{
return A[0];
}
else
{
min = findMaxRec(A, n - 1);//recursive step

if (min < A[n - 1])
{

return min;
}
else

return A[n - 1];


}

}

char* *********x;

>that butthurt guy absolutely seething

It's compiling it, it just won't execute it if the condition is met.

you don't mean the compiler or compiling but whatever is executing the program (and executing), for example an interpreter interpreting

>was forced to learn scheme in college
>started programming again
holy fuck, why is scheme fucking CS 101 again? all this other shit is so much fucking easier.

>internet c++
ivm.sourceforge.net/icvmcpp.html
That's just bonkers. You made a programming language specifically to make an ad-serving videogame?

scheme is really easy though

and yes if you imagine expanding it out in your head it will keep recurring at min = findMaxRec until n == 1 (which will never be the case if N

You don't get to learn as much arguably.
I agree though. They should start people off with C instead of high level stuff.

Lisps are so fucking easy and fun to use compared to C though. I think I wouldn't have dropped out of college if I was taught Lisp instead of that garbage language.

Are these the fucking pajeets i'm going to have to deal with when I graduate? So far my small uni's CS program is just composed of regular normal people/nerds. Nothing like this shit.

Attached: Capture.png (783x875, 118K)

twitter posters are a self-selected demographic

Literally everyone I know says that,
I found C much, much, much easier than scheme.

I find it really interesting that people have such different reactions.

if there weren't 5 posts i would think he's making fun of the guy here who is still worse even if equally cringy

The word you're looking for is "insecure".

I'm tired and misstyped, i thought guy i screenshotted was kinda amusing. What i meant was, is that pajeet who started the thread the kinda people i'm gonna deal with in the workplace?

it's possible its because I was retard at 18 and the class forced to use old ass terminal computer for lab (all work outside of class had to be written down and manually imputed)

Unlike when I learned C and could just google shit after class.

10x engineers are people who spend a lot of time on their one project. Their environment allows them to work this way. This could be achieved by just working 8 hours a day very diligently or completely destroying a work life balance. Spending maybe 60 hours a week on work.
Split their attention sufficiently and you'll ruin that. That's what this manager sees. He could probably improve general performance by segmenting people more and leaving them alone. Assuming they're not just slacking as soon as they could get away with it.

scheme is very easy, dude

Depends on the company.
Pajeets plague FAANG though.

i wouldn't know, i hope not. sounds like something a manager or someone else who doesn't program would say.

I don't think it was really about the language. Sounds like:
>thinking and writing code
vs
>copying snippets from stack overflow

Stack overflow didn't exist when I learned C and still psuedo code everything anyways.

some people are actually proud of being the most cucked wagecuck? HAHAHAH

I can see how that would be difficult. Lisps are normally meant to be used interactively.

are you responding to OP pic? I haven't actually read it

How do I get started writing the graphics output of a terminal emulator or text write program?

I want to support italic, bold, strikethrough etc., so having bitmap fonts is out of the question, and that means i need some sort of font rasterization shit right?
But how are these rasterized fonts sent to the gpu? Is it just software rendering to a framebuffer thats sent as one big texture?

>look up whether or not gcc has an equivalent to #pragma comment(lib, "libname.ext")
>first stack overflow page is filled with un*xtards completely misunderstanding how linker pragmas work
wow
i'm not sure what i expected, but it wasn't this
i suppose support in both clang and msvc is portable enough

I believe so, of the two font libs I know, fairly certain stb_truetype works that way, and I think that's how freetype works
As I understand it, fonts are a metric bitch and a half, so I'd use one of those two, definitely wouldn't try rolling your own font library.

I mean that sounds like absolute shit. We are literally in current year and peoplw arent using big shaders to render the fonts for them? Wouldnt that be faster for big text and terminal resolutions?

Sadly people complain a lot if you just support the minimum set of compilers you need for reasonable cross platform support. According to them you must support their compiler.
Nonsense.

Where can I get help on a specific question?

Stackoverflow seems to close questions that are not broad enough for everyone to benefit from them.

Either here or wherever the community for the language you're using is hanging out.
Often there's a community irc or slack filled with helpful people.

have you tried here

I think there's signed distance fields that are used for rendering text. But they're just better not really vector graphics rendering. To me it sounds like that's what you wanted.

Beware, answers to broad questions tend to have heavy bias.

I feel a bit bad asking here because I don't want to turn /dpt/ into another homework/help place and I've already posted a few questions this week here.

But anyway, I'm basically struggling with map/reduce in Clojure. I have some code which simplifies my actual program:

(def X [ 1 2 3 4 ])
(def Y [ 5 6 6 7 ])

(defn foo [a b c] (+ (* a b) c))

(def answer 0)

(loop [i 0]
(when (< i (count X))
(let [x (nth X i)
y (nth Y i)]
(def answer (foo x y answer))
(recur (inc i)))))

answer ; should be 63


How do I write this without the loop using a lambda? Everything I try doesn't actually do what this loop does, which is reassign the value of `answer` and use that in the next iteration.

I want to get a commit in the Linux kernel. Kind of a bucket list thing.

I'm familiar with C and C++, but I was wondering if there was a good, all-encompassing book I could rely on to help me get a good understanding of the kernel to the point where I can contribute to it.

The code gives me nil when I run it.

>Software project at work started 2 years ago
>It's in python 2.x

Seriously, what the fuck is wrong with people.

>reassign the value of `answer` and use that in the next iteration
sounds like a fold/reduce

I'm working on this python exercise where I have to write my own sort() function. I'm trying not to use max either.
What a fucking mindfuck. So far I am able to sort list items with their first character, but I'm currently stuck when the algorithm have to compare the following ones.

Attached: pepe.png (806x1178, 680K)

I don't know how fold works in clojure, but in guile you can do it like this:
scheme@(guile-user)> (define (foo a b c) (+ (* a b) c))
scheme@(guile-user)> (fold foo 0 '(1 2 3 4) '(5 6 6 7))
$1 = 63

Tried it here app.klipse.tech/ and it gives me 63 as it does in my repl.

I'm in the same boat. Thankfully we'll be migrating to 3 soon, but we use a patched interpreter so it could take a while...

Okay this is probably the way to go but the fold in Clojure doesn't work like this. I'm going to have to take some time out and just read the docs in detail.

small brain
>spend a week working through a textbook on a programming language and saving yourself hundreds of hours of headaches
big brain
>learning the basic syntax and skipping right into writing code but getting stuck constantly because you don't know the ins and outs
huge brain
>figuring out how the programming language works by guessing code and changing it according to compiler errors

I had a technical interview where one of the questions was how I would write some data associated with a URL to its own file on a filesystem without collisions. I also couldn't modify the URL to use as the filename because it may have invalid special characters and I had to assume that I didn't know what they all were. I might not have interpreted this constraint correctly but I think that's what was said.

My answer was to use a UUID but I was told something along the lines of there possibly being a collision (a UUID doesn't have enough bits to be unique for every URL). It was a good enough answer but not the best one apparently.

What would have been the best answer to this?

telling them to fuck off and shitting on their table while screaming for bananas, like a real code monkey

hash the url with a hash that's big enough for their usecase

I looked into it, but thats just the particulars of rendering a single character. Unless I missed something, it didnt look like the gpu did the dynamic rescaling?

So for SDFs processed fonts you would supply an alpha only channel image in the same resolution as the original bitmapped font, then adding filtering you could render it at a larger scale using the gpu?

Make sure you're using the right tools for the job.

Attached: tools.jpg (275x183, 10K)

>forth: extinct
>forth continued on as post script
There is so much wrong with OP's pic

irl URLs map nicely to directories in unix since the only illegal character is /.

>feel bad about asking questions
But I like answering these questions!
(reduce (fn [answer [x y]]
(foo x y answer))
0
(map vector X Y))

Is this answer okay?

>not fusing the map into the reduce
>2 traversals

You're probably right, I should put my algorithm on paper before anything.

wait i forgot map is zip in lisp
well you could still do it in one traversal

`map` produces a lazy sequence, so technically it is one traversal.

i c

Maybe they're just asking for base64url or something. But I would consider the question a bit deceptive if that's the case. And very pointless. You'd absolutely Google that normally if you didn't know. It's not a good way to judge someone.
>I had to assume I don't know all the invalid characters
To me sounds like you actually just don't know. The point being you can't hardcode for them. I don't know what the point of that would be. I can't think of a way that'd help you. Any substitution would just collide with the substitution as input.

> But anyway, I'm basically struggling with map/reduce in Clojure.
; MapReduce paradigm in Clojure
(reduce + (map * [1 2 3 4] [5 6 6 7]))

>protected and endangered same color
Why?

>Any substitution would just collide with the substitution as input
that's why you would escape the escape character too. say if * and @ were invalid and you chose & as your escape character, replace * with &s, @ with &a and & with &&.

I didn't make the chart. I just found it in my images dir when I was looking for an OP image.

>orange and red are the same color
????

Yeah that seems to work too. I would guess that's the trick they're looking for over someone knowing base64url exists.

some people may have colorblindness minor enough that they aren't even aware of it

Both are red, my dude

I have the appropriate color blindness to confuse those two (protanopia) and they're easily distinguishable for me. So I'd say he's pretty severe.

or a cheap monitor

>protected
>EB662A
which is orange, made obvious by the fact that it has significantly more green (Ox45 more, to be exact) than
>endangered
>DD2121
which is mostly red, having equal parts blue to green

whoops
did not mean to include the image again

Int a = 1 and var a: Int = 1
are those two conventions named somehow?

Attached: 1539720934031.jpg (753x999, 118K)

Researching deep learning methods to combat abusive language and racism online.

Attached: Screenshot_20190713-185212_Drive.jpg (1231x1417, 1.22M)

retarded and less retarded

>Pic
It's just not there by default.
stackoverflow.com/a/77336
And iirc windows just prompts you if you want to open the debugger.

Godspeed user. When I have kids I want them to be safe. Is there anywhere I can donate?

>Are you a 10x programmer, user?
my yes, look at my anime github profile pic

c-style and the retarded type theory one
i don't understand how anyone could defend the latter, it's way too verbose, and nowhere near as readable

...

c-like vs ml-like.

you're racist

the second style is more consistent of the language permits type annotations anywhere, otherwise it's just pseud wank

just drop the dumb var keyword, also retarded type theory one should have type inference (if it really is retarded type theory wankery)
actually even the value 1 should be optional, if it's a good type theory the compiler should be able to deduce the value from the rest of the program.

What algorithm/things do i need to get text from image?

how do dynamic websites manipulate dom of a website? I can understand getting values from database and putting them in html but when it comes to displaying information a little more nicely how do the template know about things like how much stuff is coming.
for example a webpage that shows a table and fetches values from database but depending on count of values it changes table row/column and stuff.
generally how do dynamic websites work/created, is database the only thing that separates static and dynamic sites and maybe run server side programs?
what are building blocks of these dynamic websites.
please help I want to get into backend web dev

Lisp is the most powerful programming language.

You should read a book.

/dpt/ dev team

Attached: 1562898675138.jpg (1920x1080, 170K)

...