/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1543156373486.jpg (621x909, 268K)

Other urls found in this thread:

en.wikipedia.org/wiki/Whitespace_(programming_language)
cyclone.thelanguage.org/
pastebin.com/QeTsf8Qk
twitter.com/NSFWRedditGif

First for C.

nth for Nim!

Second for nim

language-specific package managers: good idea or shitty trend?

G R E A T
Anyone saying otherwise is a dumb cnile/sepplet.

What are some good projects to work on?
Preferably something you can do on your own.

Extremely shitty trend. It encourages every language is exist in their own little bubble, making any multi-language shit extremely hard to do, and leads to static-linking bloat.

>Mein negger

They're OK if your language doesn't change major version numbers often.
You can't rely on retarded devs to keep up with their version guards.

microservices were specifically designed to allow for that to happen and for everyone to not have to give a shit.

>making any multi-language shit extremely hard to do, and leads to static-linking bloat.
package managers have no impact on interoping with C.
Elm has an interesting take on it where, no matter what, the author has to bump up version numbers in the package or it'll refuse to install.

good because you can just import packages at will
bad because packages break, support dwindles over time, wrecked packages every major version, over-reliance on packaging destroys languages
so overall a terrible trend, but the alternative is having to go through loops to get libraries

I don't understand.
So not updating your packages is like violating the NAP or something?

>good because you can just import packages at will
Leads to massive dependency bloat.
Go install any rust program and watch it download and install like 50 dependencies.
Also there is the left-pad nonsense.

>his language has syntax

everything has syntax, no matter how abstract or minimal.

I did an artificial intelligence class ages ago and ended up dropping out for unrelated reasons but something was annoying me for the first assignment. I had to do a uniform search and then an astar search but whenever I tried to do the astar it ended up being slow as heck. Was I supposed to cheat and process the heuristic beforehand? I just couldn't get it to be faster than a normal uniform search. I did try asking the lecturer at the time but she was fucking useless.

false

I don't get this question. What quantifies as a non language specific package manager? A package manager that distributes DLLs/SOs?
What use is that? I write in a high level language to abstract away systems programming

How does a package manager that distributes python going to help me in Node?

then show me your language with no syntax.

he just means things like cargo or dub or nimble or stack, non-language specific just being your system's PM like apt or pacman.

For arrays of size known at compiletime, should I use a for loop or memcpy?

...

The compiler will optimize either.
Do whatever you think looks cleaner.

That contains newlines.

not a language considering you have no means to give instructions, you dweeb.

en.wikipedia.org/wiki/Whitespace_(programming_language)

>Edwin Brady
O U R
L A D

>I'm the one you're replying to
See I know

That has syntax.

i was playing the long game.
>what do you mean no instructions? the new lines are.
>and what are newlines
>...

Hey guys.
I really really don't like x.
So I'm thinking of frequenting a website filled with x to sit their and complain about people posting x.
Do you think this is a good use of my personal leisure time?

>not liking letters
illiterates out.

I'm doing C# exercises, and it wants me to read the inputs 11001101 and 01010111 from the user, then do a binary XOR between them. But I don't know how to actually read the second one, and get it into a byte variable with the leading zero intact

Attached: 1496367781044.jpg (540x540, 93K)

the heuristic for each position is just the distance between you and the target.
You are not supposed to pre-calculate the heuristic because if you do, there are no optimizations to be gained.

The A* pathfinding algorithm is in a nutshell, a greedy search algorithm which calculates the heuristic for the nodes with the lowest expected heuristic value.
Once the algorithm has calculated the heuristic of the target node, we backtrack our recursive algorithm to find our approximated optimal path.
The trick is in figuring out which nodes to calculate and which ones to avoid.
A regular recursive algorithm is not much different from depth first search or breadth first search.
But we have extra information to work with: we have a heuristic value.
What data structure do you use when you always want the lowest value out of all of the numbers you have?
That's right--a min-heap. Where every unvisited node is "infinity", and the act of visiting a node is just an increase key operation.

The zero is still there even if it doesn't get printed out.

Attached: 1541283524897.jpg (933x1200, 159K)

if you're using Console.ReadLine()it should be intact, you just need to unpack it into a bitarray (bytearray?) from the string you're given
then again I know shitall of C#, what's the issue that's preventing you from doing that?

what did xxxtentacion do to you?
are you some kind of racist?

I know GCC will use memcpy intrinsics, but I don't know what this well generate.

Have to do some tests.

I did that for my uniform search but doing any kind of heuristic just takes too long. My uniform finishes thousands of nodes in about 30 milliseconds but when I add in the heuristic is shoots up to multiple seconds.

Can you elaborate?

Do you really want to drag the anime discourse into this thread too?

Attached: 1543245663408.jpg (418x488, 45K)

Who said anything about anime?

Well I mean really I have zero idea what I'm even doing here. Do I read it into a string? Int? I can't convert a string to byte, it seems. The material makes zero mention of byte arrays, only bytes. I've been trying to convert the string with the numbers into an int, and then into a byte, but the expected output is wrong so I assumed the leading zero is going missing during this

You know what you're doing, you cheeky little cunt.

Attached: 327.png (600x608, 584K)

Hold on, I didn't realise 4channel was a girls and birds website. Are you sure you're allowed to post that?

It could too. Crows in asia routinely create shorts in electrical systems.

>Hold on, I didn't realise 4channel was a girls and birds website. Are you sure you're allowed to post that?
My assertion was that this isn't an anime site, and definitely isn't for posting lewd anime pictures, brain-damaged dildo. I never said anything about not being allowed to post anime. Fucking cum slurping dickhead.

Who the fuck said anything about anime you dumb nigger?

>Fucking cum slurping dickhead
Whoa, user? This is a wholesome Christian website. Please refrain from such lewd and inappropriate language.

>I've been trying to convert the string with the numbers into an int
huh, ok
coming from python, I'd probably just iterate through the string and turn that into int, plop that into a list and then xor the lists and then .join the result
next best thing I think is just taking a dictionary and going with it?
Dictionary d = new Dictionary()
{
{"0", 0},
{"1", 1}
};
and then just
foreach (char c in s)
You can also just zip the two strings into a tuple list and xor each tuple individually?
I really don't know enough C# to know what the fuck I'm even telling you, but a quick search is giving me several methods that all look kinda weird to me

>Crows in asia routinely create shorts in electrical systems.
I just saw a video on this about birds in the US. Shouldn't the be okay on powerlines? They're not creating a circuit by just chilling on the powerlines.

>why would someone do that?
>go on the internet and lie like that.

>lewd anime pictures
As long as the image is SFW (no tits or genitalia) there's nothing against posting it.
And as you've already implied anime posting is fine so therefore lewd anime posting is fine.
So you're just being a retard complaining about it. No one cares about your personal opinions.
People generally prefer to go to websites that are more inline with their personal opinions and tastes, so I implore you do the same instead of ruining things for us.

of course you can just use literal 0b0 and 0b1 instead of ints
I think

I think it's either asia crows are fucked up or asian power is garbage. I assume the latter.

lads give me an idea for an interesting eso lang to implement.

C++

i said interesting, not bloated shit.

Ouch! My nut bladder!

Crows in much of asia are a distinct species. They're much larger and have different behavior. They create shorts by building things out of pieces of metal all over the power lines.

>huh, ok
I mean if there's a better way of doing this then by all means, as I said I have no idea what I'm doing. The material basically just shows how to use the bitwise operands, so I've just been trying to google around how to get those inputs into a format that I can actually even use. So this exercise seems way more elaborate than I'd expect based on the examples they've given

Attached: 5f0dee60.jpg (1600x1600, 212K)

Make C but with function overloading and better array implementation. That's all you really need to make it far better for more abstract or high level projects.

>As long as the image is SFW (no tits or genitalia) there's nothing against posting it.
No, but it's off-putting, and you should be burned alive for posting that shit.

>And as you've already implied anime posting is fine so therefore lewd anime posting is fine.
Nice syllogism, dumbass.

>So you're just being a retard complaining about it. No one cares about your personal opinions.
You apparently do, shit for brains. Keep replying, show me how much you care about my opinion.

>People generally prefer to go to websites that are more inline with their personal opinions and tastes, so I implore you do the same instead of ruining things for us.
I go to this site, and specifically to this board to discuss technology, not look at anime fuckwad.

Bigger birds can create circuits by spreading their wings

Ah, that makes a lot more sense.

why does /dpt/ fight ;_;

Attached: 1468013405521.jpg (477x465, 48K)

you'd probably like Cyclone, even though it's dead in the actual sense of no longer having any devs working on it.
cyclone.thelanguage.org/

computing the heuristic for one node shouldn't take more than maybe three mathematical operations.
You're doing something wrong.

Because no one posted projects for me to do. Please respond.

Attached: 1335161397462.jpg (221x221, 26K)

I didn't start it, I was planning on leaving all that horseshit in the last thread.

Wireless devices are altering collective human behavior and causing gradual brain damage. Both the acute functional changes and the neurodegeneration contribute to the behaviors you're seeing everywhere.

Write something fancy looking in OpenGL.
It doesn't actually have to be useful; just look nice.

contribute to emulation.

I wouldn't personally go around admitting that I'm a machine without personality or interests, even on an anonymous reverse polish messaging board.

There are no studies, to my knowledge, that have found that radio waves affect us.

>No, but it's off-putting
No one but you cares. And your opinion literally does not matter. You have to put up with it and not complain, otherwise you're just pissing everyone off.
You already stated once before that you're okay with people posting non lewd anime.
>show me how much you care about my opinion.
If I cared about your opinion I'd stop posting anime, and I will do no such thing.
>I go to this site, and specifically to this board to discuss technology, not look at anime fuckwad.
Do you browse Jow Forums with your eyes closed? Because that's the only possible way to browse Jow Forums without looking at anime.

>tfw you find a really good tutorial on youtube that teaches you everything you need to know about programming in OpenGL so you follow it and now you gotta turn in the assignment but my code is 80% not mine

i-if I just comment everything I should be fine right? I had to link to the videos in some parts because some stuff is so evidently not done by an undergrad that i'd be shooting myself in the foot by saying "yes yup this was all me"

Attached: 1525655371808.png (420x405, 134K)

There have been studies of evolutionary algorithms (for I believe neuromorphic computing) on hardware devices which cannot be reproduced on other hardware or even dumped and emulated. Turns out the algorithms were making use of magnetic flux in addition to the usual transistor logic.
It would be entirely unsurprising if the human brain were to act in a similar way to other background noise.

What heuristic should I do then? I can't remember what I tired when I first made it but I tried a Manhattan and euclidean distance approach. It's a directional graph so those may not work well.

not w i d e enough

Unfortunately that's not the case, because I have ~2100 peer reviewed studies published from the 1940's onward showing pathological changes at power densities often well below the US safety standard, and even below Russia (and much of eastern europe) and China's much stricter standards. Many of those papers are reviews of decades of research on a particular aspect, at a particular lab or university, in particular country, etc.

And just for reference, the bibliography produced by the Naval Medical Research Institute, by Zorach Glaser, contained iirc 2308 citations. It was published in 1972.

Look at other tutorials and online guides until you understand what they are doing to the core and understand OpenGL, so you can attempt to replicate the outcome your own way.

> IARC has stated that there is limited evidence that RF radiation causes cancer in animals and humans, and classifies RF radiation as “possibly carcinogenic to humans”
all the evidence you really need.

Either manhattan or Euclidean distance should work.
Manhattan distance is literally just the absolute difference between Xs and Ys on the grid. That's a trivial number of operations to the CPU.
You're doing something wrong and it has nothing to do with the heuristic.
>directional graph
that's not any different from a wall.

>function overloading
If you're asking for named and default arguments, that's a great idea.
If you're asking for namespace resolution dispatched on a privileged function argument ("OOP syntax") then, well, okay, sure, I guess.
If you want totally arbitrary name overloading, please go fuck yourself with a tire iron.
>better array implementation
Arrays are pointers under the hood and you can't change that.

>thank goodness we don't only have serious problems, but silly ones as well.

>No one but you cares.
You do, you're replying. If you actually didn't care, you would just stop replying or not even replied at all. Admit it.

>And your opinion literally does not matter.
Neither does yours, stupid.

>You have to put up with it and not complain
make me

>otherwise you're just pissing everyone off
You piss me off with lewd anime, fair enough.

>Do you browse Jow Forums with your eyes closed? Because that's the only possible way to browse Jow Forums without looking at anime.
Do you look at Jow Forums. The majority of pictures posted on Jow Forums have nothing to do with anime. Just look retard.

int foo(int a, int b)
{
return a + b;
}

int main()
{
int a;
a = foo(1, 2);
}

or
int foo(int, int);

int main()
{
int a;
a = foo(1, 2);
}

int foo(int a, int b)
{
return a + b;
}

>I can't convert a string to byte
there's a Convert class: args are string, base

Convert.ToInt32("011",2); // returns 3

pastebin.com/QeTsf8Qk

I'm right now just using the weight on the graph as the heuristic which may be causing it to check more nodes than it needs to but I don't think anything else is wrong.

Cells are pretty much coupled oscillators. They can emit and transduce extremely subtle periodic signals, which they then amplify to change their state in response. Some of the earlier studies on this (a lot of which was concerned with mind and behavioral control during the cold war, eg with the moscow signal incident) just tried to entrain the brain by exposing it to EEG frequency signals. It doesn't quite work that simply (and research into what actually makes the EEG ties in), but it does produce striking effects. The most famous of which is the calcium efflux studies showing VLF fields amplitude modulated at ~16 hz caused a massive 40% increase in Ca2+ efflux from brain tissues. It was later found that the source of this was membrane glycoprotein bound calcium, not intracellular stores.

Like you said, it really shouldn't be a surprise that electricity and magnetism has strong effects on biological systems.

isn't that just djikstra's algorithm?

Why do you go to a website filled with things you hate and spend your time complaining about it?

>Do you look at Jow Forums. The majority of pictures posted on Jow Forums have nothing to do with anime. Just look retard.
That does not change the fact that there is always at least 1, usually more than 1, anime images in view at all times every single day.
Go into any thread, and there is always at least 1 anime image posted, if not quite a few.
Do you spend your time going into those threads and complaining about them? because it seems like you do, like you're doing right now.

const foo = (a,b) => a+b

I just counted the number of nodes I look at for each and they're the same. But when I have the Manhattan distance in there it causes it to slow down immensely. I must be doing something wrong.

Dijkstra's isn't super different from A*.
The difference is that Dijkstra just uses the distance traveled (this means it generalizes better for weird graphs) while in A* you have that, also every node just "guesses" how far away it is from the target.

>Anti-anime fag's post deleted
>Old thread drops by over 40 posts
Based janitor.

Attached: 1542326569607.jpg (650x832, 187K)

Only good when built into the the most widely used build system. See: cargo, gradle.

I can see the reason, but it's kind of annoying. Like I have cargo separate, but tied into MSYS2's path stuff.

how do I go about making a script that changes all frogposters to animeposters?
greasemonkey?

Thank you for clarifying

>I just counted the number of nodes I look at for each
If you're visiting the same number of nodes it means your heuristic isn't even doing anything.
It should change, even if just a little in either direction.