/dpt/ - Daily Programming Thread

Old thread: What is Jow Forums working on?

Attached: nodejs.jpg (768x552, 45K)

Other urls found in this thread:

better-dpt-roll.github.io/
stackoverflow.com/questions/7718299/whats-an-object-file-in-c#7718363
python.org/dev/peps/pep-3132/
twitter.com/NSFWRedditImage

first for elixir

degenerate

>These two guys are giving Hime some trouble! They're watching her every move, she needs to text her friends secretly to come pick her up! Write her a function that allows her to send a secret encoded message to her friends. The function will accept a normal "dummy" message and the secret text to be encoded with it. It will capitalize the letters in the dummy message according to the secret text.

friendly reminder not to try to write sane code drunk at 6AM. It ain't pretty, but it works. I will clean it up later.

string SecretMessage(string text, string message)
{
var place = 0;
text = text.ToLower();
Func Replacer = (x, a) => ((place == 0 ? string.Empty : a.Take(place).Pipe(string.Concat)) + new Regex(Regex.Escape(x.ToString())).Replace(a.Skip(place).Pipe(string.Concat), x.ToString().ToUpper(), 1), a.Skip(place).Pipe(string.Concat).IndexOf(x) + place);
message.ForEach(x => (text, place) = Replacer(x, text));
return text;
}

Attached: anal beads.png (927x148, 11K)

>6am

Attached: bretty.gif (482x800, 29K)

does anyone have those cool roll 0-99 for a programming challenge lists?
the more the better

Attached: 31444640_2016736421909334_3286950433112719360_n.jpg (644x960, 99K)

Here's one: better-dpt-roll.github.io/
Now fuck off and stop trying to shit up the thread.

no

Im trying to make a audio visualizer, but i cant figure out how to capture the ouput of pulseaudio..

I made a hashmap in c and learned how to make it a library using cmake

Attached: 1499843626616.jpg (870x490, 106K)

`-c' ?

Recently had to use R, it is the worst fucking trash that people use unironically

Attached: 766a53c.jpg (630x478, 45K)

Agreed

I dont understand

switch to M

t. datadata

gcc with the `-c' switch makes object files

Nice

>c
>objects
no

>Doesn't know what object files are
You don't know C.

someone link a /dpt/ discord or irc

there isn't one

Should I go to this bank job interview, or will I end up working on ancient cobol mainframes?

there is one but it's quite literally dead most of the time
maybe, but they would put that into the description
also, cobol is not boring

object FILE, not object period
stackoverflow.com/questions/7718299/whats-an-object-file-in-c#7718363

yeah just continue your sperging you autistic fuck

???
I only responded to you once and in a nice manner too

Attached: sweetie.jpg (680x680, 66K)

sauce?

Attached: yamero.jpg (197x200, 6K)

I'm not him
also, I want a gf like that

ok, but you're asking on the wrong board

will black helicopters come for me in the night if i change my computer and router to use 1.1.1.1 or 1.0.0.1 for dns

I think you can't even do that can you?

course you can. it's a free country.

Attached: 390472134823.jpg (195x259, 5K)

What should I do first: learn C, Python, Lisp, or read SICP?

Attached: 1524769655798.jpg (500x297, 15K)

If I wanted to use some even more obscure shit I'll just use asm

Attached: 1496745340946.jpg (220x336, 72K)

C++.

-what's your background
-what do you want to do with the knowledge

But generally speaking, I enjoy C the most out of those options.

>background
NEET who's interested in tech and wants to learn useful shit
>what do you want to do
I'm not sure really, just hobby stuff.

I'm sorry to be the one to tell you, but you're a brainlet, son

>M
>obscure

You might be confused.

post a screenshot of your text editor

are you afraid of people seeing your code?

Attached: scrot.jpg (3840x2129, 919K)

Do you have any previous knowledge whatsoever?
If not: read K&R for C or SICP for Lisp, both are great starting points.
Don't start with python ever, it might seem simple but trust me it'll get confusing soon enough.
If you like micro-managing memory and being a bit of a wild west cowboy, C is fun.
I don't know much about lisps though, someone else will have to fill you in.
But in general, I wouldn't recommend lisps to beginners because there are some rudamentory things that you need to understand before delving into fp and lisps are not the best for learning these basics.

>text editor
What are you, in high school?

you're trying too hard there /b/uddy

Are you writing own language that compiles to Rust bytecode?

editor & colour scheme?

>Decide to give reverse engineering and programming a shot. It's always interested me, but seemed so foreign.
>Remember a game I loved to play called Infinite Crisis, was a DC Comics MOBA that had the servers killed.
>Track down the files, .pck, .dll, .bik, and a few .exe
>Oh boy. I feel like an idiot, but I'm sure Jow Forums would be right at home and I doubt they're even hard to figure out.
>Looking for the SLL file, can't find it.
Any good resources to read to help me out? I opened a file called "TurbineLauncher.exe.config" and got










But, for the most part, everything seems clearly marked in the few .dll files I browsed with dotPeek

SICP.
You'll actually learn to program, not just code in a particular language.

So I have a list with X elements in it and I want to pass all of them to a function, but I don't know how many elements I have in it (X can be 5, 50, 100, etc.).

How can I pass all of them to a function in Python?

Just pass the first element of the list to the function and then traverse all its elements. That's the whole point of a list, being able to not care about the size.

my own editor
my own colour scheme

What function? If it's one that you're writing yourself, you can just take a list as a parameter, otherwise, use the star operator - python.org/dev/peps/pep-3132/

lst = [1, 2, 3, 4]
fun(*lst) # == fun(1, 2, 3, 4)

The star operator did it for me. Thanks.

Now how do I do this in Haskell?

zipWith

hieroglyphics

Use a for loop :^)

I have a program that downloads images from a website. Now I want the program to do its magic at a fixed time interval.
I have two possible solutions. Create a cronjob that spawns the program at a fixed interval. The other solution is to run the program indefinitely by using a while loop and the sleep function.
What are the pros and cons of either solution?

meant for

t. retard

What's the question

Haskell has 3 major problems that are completely distinct in my opinion.

>Biggest technical problem:
lazy evaluation.

>Biggest cultural problem:
technical oneupmanship and code golf. Haskellers can get so caught up in no-compromises stylistic competition that it makes it hard to get anything done. If you finally finish up something that accomplishes your goals, your teammate is gonna come in and rewrite everything you just wrote so he can feel happy with it too. And then lecture you about how lenses are wonderful and how you need to learn the principle of least power.

>Biggest community problem:
a small minority of extremely obnoxious and toxic assholes. They raid other communities and make fun of their languages and members. They rant against and mock everything deemed inferior. They treat people like they're idiots for not understanding basic but unfamiliar principles of the language. And nobody ever seems to shut them down, despite the fact that the majority are pretty welcoming.

What the fuck is wrong with lazy evaluation?

Lazy evaluation is not a problem. If you don't like it, you can force arguments to be strictly evaluated.
>code golf
True
>obnoxious assholes
We like it that way

66th for OCaml

Use OCaml

Attached: the_reason_i_get_up_in_the_morning.png (628x578, 18K)

Haskell isn't the problem, it's those who criticize the language.
Haskell is in the category (no pun intended) of academic languages. It's perfectly fine to put category theory into practice, but not for mainstream use. We have C#, Java and C++ for that.

it's shit

Name one (1) thing OCaml can't do.

I'll wait

unsigned types
native threads
macros, have to use some shitty compiler extensions

be successful :^)

>unsigned types
Why would you need that?

>native threads
OCaml has a multiprocess philosophy. It is, effectively, as good as multithreading (better, even, since there's no shared memory space to corrupt).

>macros
Write your own extension to OCaml using ocamllex and ocamlyacc.

I'm still waiting for something that OCaml can't do.

OCaml is successful. It is used in many real world settings. Google Jane Street, for example.

OCaml is just by Jane Street and .... uh ... uhm ... *sweats* ... .

>Why would you need that?
Sounds like another case of blub. Pack it up, boys.

OCaml vs. ML?

Would you dismiss someone saying that C is successful because the only example they could think of was the GNU/Linux system?

Ignore both and use Lisp.

>one thing OCaml can't do
more than one thing.

I’m currently working on a Brainfuck JIT executor with LLVM in OCaml. So far I’m loving the language. I only picked it up because it seems it’s the only language with decent llvm bindings (except for C++ I guess).

name anything lol

OCaml doesn't have a multiprocess philosophy. The designers of OCaml regret their language relies on multiprocess for threading and doesn't have in-built facilities beyond that.
They haven't fixed it yet because multiprocess is "good enough," putting proper support as low priority.

Don't try to sympathize with this. Multiprocess approach has worked thus far because it's been relatively unimportant. But now with Go, Ruby getting guilds, Elixir, Rust, and a lot of other languages either getting first class support for parallelization or being designed for it from the ground-up, well, OCaml should probably get with the times.

CL vs Scheme?

when you reverse engineer something you usually have a goal in mind

I'm just pulling your leg senpai. As far as functional languages (Lisp, Haskell, ML) go, OCaml is the most popular one throughout the industry. It's still on my list to dive into some day.
What makes OCaml interesting for me, is it's point on parallel computing. Multithreading is absolute cancer. Multiprocess is the way to go.

>are you afraid of people seeing your code?
NDA. So yes.

Use Scheme if you're an idealist. Use Common Lisp if you're a realist.

>Heaviest

Only retards sign NDAs.

retards and employed people

>he doesn't have the balls to say no

Having done something like this multiple times always go the cron route. Cron is pretty easy to use once you get the hang of it. Also doing an infinite loop + sleep forces your functionality to be a persistent job, as opposed to being able to run it ad hoc if the need arises.

are you 12 years old? jobs require you to sign NDAs for projects and if you don't do it you don't get hired

i'm a programmer and this hasn't happened once

What benefit does it give me to share my code with you?
Open myself up to someone stealing my project?
When things are complete, I can negotiate to have them made public if I can make the case for it.
Not even my boss sees my code.

you mean jobs in western cuck america

I guess it depends on how high profile your job is

i don't care to see your code
however, signing NDAs is indeed retarded.

Than we'll take the cron route. I actually use systemd timers, but they're basically identical.