/dpt/ - Daily Programming Thread

Pure FP edition.

What are you working on Sup Forums?

Previous thread:

Other urls found in this thread:

youtube.com/playlist?list=PL_vIhjXh1UTpfw8atiA31uP3F4Sjix_ZQ
strchr.com/x86_machine_code_statistics.
pastebin.com/wtwSA2Hi
reddit.com/r/rust/comments/6ewjt5/question_about_rusts_odd_code_of_conduct/
github.com/ch0c0pain/tuturu
theguardian.com/politics/2017/may/10/labour-party-manifesto-pledges-to-end-tuition-fees-and-nationalise-railways
twitter.com/NSFWRedditVideo

You created this before the previous one hit the bump limit retard.

Working on a bot that will spam comments sections to get people to vote Labour.

The messages need to be varied and realistic but I think I know enough about AI and Lisp to pull it off.

Wish me luck lads.

Third for COBOL

> AI and Lisp
What is this, the 80s?

Lisp isn't dead.

Daily reminder that python is being used in production environments

Am I the only one to notice that this sort of things happens more often these days?

>Pure FP edition.
I started a channel where I'll do a zero background introduction to dependent types using Idris

youtube.com/playlist?list=PL_vIhjXh1UTpfw8atiA31uP3F4Sjix_ZQ

>What are you working on Sup Forums?
I'm currently editing the second video (pic related) going though the installation of Haskell, Idris and the Atom package for Idris

What's wrong with that?

It's a toy language.

Yeah, just like COBOL isn't dead.

This literally disproves that.

hello folks
idk if it's the place to post this but i'll try my luck
does anyone know how to connect to a wifi with password?
thx

It can still be a toy language when it's being used in a production environment

nice stuff m80

>>>g/sqt/

and read the fucking sticky ffs.

He's a toy poster.

what can i say, im a nooobe, thx anyway

I thought FP meme died already

It did, save a few autists.

Hi /dpt/,
i'm currently working on a function that moves a subtree of a BST one level up. the BST is saved in an array with the root of the tree being on index 0, the left child of i at 2i +1 and the right child at 2i + 2 and so one.
My current approach in pseudocode is:

void shiftUp(int from, int to) {
if (!existsNode(from))
return
tree[to] = tree[from]
tree[from] = NIL
shiftUp(leftChild(from), leftChild(to))
shiftUp(rightChild(from), rightChild(to))
}


But because of the recursion it won't copy every node correctly. any ideas?

>meme

I noticed it too. For some reason the janitors don't seem to care (which we already knew seeing how last weeks have been "who are you quoting", gate keeper, Mozilla shills etc shitposting).

Recursions aren't Turing complete.

>What are you working on Sup Forums?
A thread pool that would allow, at the same time, just throwing parallel work at it, and synchronized groups of tasks. Not a very good one mind you and nothing complicated like lockless stuff, but anyway.
Starting to be done with it for the moment so afterwards gonna start working on a networking API for the same program I need the pool for.

What kind of AI and where did you learn it.

No, not this shit again.

Oops

No you don't know enough AI to make it seem real. If you did you would not just "believe" to pull it off. You would know.

Correct me if I'm wrong here.
In linux, when I open a file in my C program, and then outside of this program change the file, then the filesystem creates the new version in another "place" on the disk, and changes the old filesystem pointer to point to this new place, while my program still uses the old handle that point to the old data, that is still in the old place. Once the pointer is freed in the program, the old data is not pointed to by anything, therefore it's regarded as a writeable space.
Am I thinking about this right?
And if yes, does this happen every time a file is edited?
Writing the entire file into different space on disk instead of changing it in the current space?

How can languages have "lives"?

Which means it's probably garbage any sane person should avoid.

Works on my machine.

That you described happens if someone deletes the file you've opened or overwrites it via mv. If someone changes the file, i.e. if the inode of the file stays the same, all users of the file share it and can see each other's changes in the real time. This is why you're supposed to lock important files before reading them or writing to them if there's a chance of someone else messing with them.

In the sense that the language's tooling is community is active. For instance, PL/I is a dead language because there is no active community towards developing its tool chain.

Friends, I need some urgent help from java experts. how would I go about developing a java plugin for an application? Can anyone give me an idea where to start?

guys, is there a way to read function calls to lib from an exe? or are lib contents inlined and there is no trace of function names?

i gotta find out what functions are called in an old exe made with borland c 6.

could you elaborate on your task a bit more senpai

Just check you're not breaking the law m8

...

But can you stimulate your prostate with it?

>Pure shite edition
Dropped

what's the point of this?
literally 2 minutes in arduino ide

Why is she smiling like that?

Sure is. You can even override the function calls using LD_PRELOAD

what? i'm talking about winshit executables.

finally finished my Instagram scraping script

Starting a new research project where I perform statistics on compiler (and perhaps in the future, human) generated code for different computer architectures. Using those statistics I can draw some conclusions about bottlenecks in the architecture and extract idioms for the design of new architectures to improve their code density and performance.

This all started after I began designing the ISA for my new computer architecture. I was uncertain how to most efficiently design the ISA so that it doesn't stand in the way of a performant implementation. x86's ISA requires a hardware parser, u-op translation and packing, and a complex scheduler. It's part of the reason x86 will NEVER compete with ARM in the low-power market: operation for operation, x86 requires more hardware. ARM and most RISC ISAs do not have great code density: you don't need 32 bits to clear a register. That leads in the macro scale to general I-cache bloat, which means cache misses, which means less performance.

First thing this morning I wrote a little program in the vein of this strchr.com/x86_machine_code_statistics. It lists the top 20 most common instructions used in a program. Currently, I've only tested it on x86. The research project will have to involve making a bunch of cross-compilers and really improving on this simple analyzer. For example, 'mov' is a load, a store, and a register-to-register moving instruction; xor reg,reg and mov reg, 0 are both 'clears'; etc. And it's different for every architecture. And why the hell are there so many 'mov's? Is the compiler spilling because there aren't enough general purpose registers? Or are they necessary load and stores? Does ARM produce less loads and stores because of its greater number of general purpose registers?

TL;DR The script finds out the percentage of total instructions in a compiled program each instruction fills

pastebin.com/wtwSA2Hi

d(ead)

please make it work with pipes; if there no argv[1], then read from stdin

objdump -d -Mintel /path/to/program | python3 thisscript.py

F

What books are good for learning HTML5, CSS3 and Javascript? Starting out in web coding.

You're in the wrong thread. >>>/wdg/

Ah. That is why I am asking simple questions

>The research project will have to involve making a bunch of cross-compilers
Or you could just use LLVM?

>For example, 'mov' is a load, a store, and a register-to-register moving instruction
It might be more correct to say that there are three instructions here, just with the same mnemonic.

For C++, std::tuple vs boost::tuple?

They're discussing the CoC on the /r/rust, and it's kinda interesting: reddit.com/r/rust/comments/6ewjt5/question_about_rusts_odd_code_of_conduct/ .
> If someone just can't get their work done effectively or can't enjoy themselves without stalking or harassing someone, or cracking a sexist or racist joke, or getting into a flame war, or insulting their colleagues, I suggest they go enjoy the numerous other totally viable language communities.

kys

The thread is dead anyway.

why doesn't someone just fork it and make a fascist version

Exactly. How does one "fork" the community tho?

Still not as dead as haskek

>he can't read graphs
Haskell has been more "alive" for 4 years already, and github stats kinda confirm it.

Isn't that what hitler tried to do?

>reddit.com/r/rust/comments/6ewjt5/question_about_rusts_odd_code_of_conduct/
MAn get a truckload of white testosterone to the straight white male (or so they say) cucks on plebbit, they already excuse themselves from not being intelligent enough to understand how "marginalized folks" feel about the issue, even though NO ONE has been able to bring up a SINGLE EXAMPLE of a community being "toxic" anywhere in the discussion. That's beyond ridiculous.

I was bored today so I made this
github.com/ch0c0pain/tuturu

All you need is pulseaudio and ncurses.

Non! Je refuse!

>no readme
stopped reading right there

Why would you ever use boost if you can use std?

Whats the best python book?

No.

I'm already using boost to parse an ini file.

Where is /dpt/ CoC though?

>>>/global/rules

Where should I start if I want to learn how computers work?

I want a solid base for network shit and general programming

Isn't Labour still just Red Tories? Or did Corbyn finally manage to get rid of all the Blairites and Blue Tory plants?

>pulseaudio
Utter
Trash

>Using all of boost to parse an ini file once
This is exactly why people tell you to stay away from boost.

> Putting metal like that near a powered bare board.

What are you thinking? Use something non-conductive!

Yes-ish.

If the EXE statically links and you have a copy of the static libraries that were linked in then you should be able to disassemble and match various functions up based on diffing the assembly. If you don't have a copy of the static library and symbols were stripped from the EXE (I'm making some assumptions, I'm mostly familiar with ELF, not PE -- Portable Executable, which is what MS uses) then you'll have a rough time I think.

If it's dynamic linking there are probably easier tools but I don't have a whole lot of experience with those as most of what I do is embedded SW/FW.

>wake up
>had a dream I was making app to sell on Windows Store
hmmm, I don't even have Windows and last time I touched c# was years ago

>there is a "Sup Forums Sup Forumsrowser" for $2.49
heh

This sounds like a really awesome project!

At some point you'll want to take a look to make sure that you're snagging instructions based on op code and associated fields since the mnemonics from disassembly can be misleading regarding the operation that happens. Using the mnemonics to get started is definitely a reasonable first approximation and should yield some reasonable data tho!

If you're willing to use Python, pyelftools is a really useful library I use extensively for doing elf related tasks at work.

theguardian.com/politics/2017/may/10/labour-party-manifesto-pledges-to-end-tuition-fees-and-nationalise-railways

I am trying to code a Sudoku game.
I finally managed to fill the grid, but... well you see..

The problem is not with the code you're showing, look at the stack trace.

it's a problem with the class I was given.
I needed to use the lockAndDisplay Method beforehand.
Readng the output goes a long way I guess.

>numerous other totally viable language communities
Is he implying Rust is one of these?

I don't want reddit stink nearby. Fuck off.

Always prefer the standard library unless you have a specific and explicit reason for using otherwise.

So boost?

xd

Do you have a reason for using boost::tuple over std::tuple? Or will std::tuple solve the same problem the same way?

Can I sign up for google now? (I am not a tranny)

How do I become 31337?

rewrite this in Dart and we'll talk

learn how to spell fagget

Noice.

I've been reading through SICP but the python version, the original seems different, does it matter too much or is the new one missing out on some things?

I'm getting
../../externals/glad/libglad.a(glad.c.o): could not read symbols: Invalid operation

when trying to cross-compile a program. I can barely find any information about libglad, let alone its dependencies. The target is w64-mingw32. How do I fix this?