What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
youtube.com
korbo.ga:82
twitter.com
I want to lick your bum OP
...
newfags don't know the bump limit
...
math is a social construct
Death to JavaScript
there's a problem i'm trying to get the most efficient solution for, and it's removing duplicates from a linked list. it's easy enough to get to n log n by sorting and then doing an iteration, but is it possible to get it this efficient while maintaining the original order of occurrence?
e.g. 3 1 2 3 becomes 1 2 3 my way, but i'm wondering about how it coule become 3 1 2
I do, just wanted to make sure some cunt doesn't advertise his Discord chat in the OP.
Convert it to a TreeSet and back?
>What are you working on, Sup Forums?
I'm making an Artificial Intelligence with Caffe on weeding out anime pictures on Sup Forums
I almost never use private, only public when I'm programming. When will I run into a problem for not privatizing things?
>meme language
trash.jpg
haskell has the set datatype which uses binary search. would adding things to the set as i go along the list and checking if they're in it be equivalent in efficiency to that?
If you don't privatize things you will ruin your economy.
>not using tensorflow
what a complete faggot
he wants to keep the same order
strawpoll.me/11751033
New poll
I think so.
Max cost of checking existence of/inserting an element into the set = log(N)
Number of times you need to do that = N
Total cost = N log(N)
>>meme language
Caffe is a deep learning framework written for both C++ and Python.
It's not a language
>this is the intelligence of the average anime poster
>using the jewgle botnet
>python
>unironically shit language
trash.jpg
>interpreted (see common use) language
>concerned about efficiency
Why?
>haskell
>interpreted
kys
>kysfag
go kiss your mother so can clean out your mouth
see
your mother, bro
Why aren't you watching Terry program TempleOS?
youtube.com
I have my own OS.
i'm the original poster, i believe my solution is optimal now. it has a set of things that have been seen, and the input list. thanks guys
"if you scale a project up, you use longer labels. if you scale a project down, you use shorter labels. that's how you be a good programmer."
t. erry a davis
Picrelated is a small slice of a graph I'm drawing using Pygraphviz. It outputs clunky svg or png files (from ~9500 lines of DOT language), that are a bitch to even open, let alone navigate and use.
I need some way to draw graphs like that in a non-static way. Sort of like radare2 or IDA Pro draw their disassemblies. So that I could move around in a graph easily, maybe interact with it.
Is this possible to achieve with Python without too much effort (i.e., writing something with OpenGL)?
If not, what would be a relatively simple solution, preferably without changing the graph itself? (of course I can break the graph up, i just don't wanna)
C++ is simple
template struct EnableIf;
template struct EnableIf { typedef T Type; };
template struct Conditional { typedef T Type; };
template struct Conditional { typedef F Type; };
in Haskell this is just
type family EnableIf (b :: Bool) (t :: k) :: k where
EnableIf True t = t
But do you get an error if you use EnableIf (False) ?
Fucking opengl is unusable without a wrapper, fuck all that cruft and depreciated functionality that is constantly referenced in every opengl book and tutorial.
I though GLNext would be a simpler cleaned up OpenGL and I was waiting for that to learn it.
Of course we got Vulkan, and you need a thousand lines to get a triangle...
if you try to assign something other than bottom, e.g.
x :: EnableIf True Bool
x = True
-- good
y :: EnableIf False Bool
y = True
-- bad
Well you're finding bad tutorials.
Find something which limits itself to modern (check the dates) opengl
In the real world, I'd get a paycheck
niggerlicious
So I am going into an Aps Development program at my college, and they say I have to use Slack to communicate with students, faculty, and update my assignments. I don't like slack, any tips for tolerating this meme?
In the real world, I get your paycheck
Write an IRC bot that syncs with slack and use IRC
>haskell programmers admit that they can't get a job in programming so they resort to working countergirl at a bank
>>haskell programmer admits to getting my money
Your money, maybe. But I challenge someone to make anything more complex than a fizzbuzz program in Haskell
...
I bet you can't even boot a computer with deprechaskell.
>Compare input to something else
>print when you're done
It's literally a fizzbuzz program
>programming exercises
case in point
>terry writes braces like {
proof that terry is better than 90% of /dpt/
}
>listening to that controlled op CIA nigger
>90% of /dpt/
I think 90% do the same.
Most of dpt I've seen use that style too. Only really newer programmers taking courses tend to write with a brace on the newline from what I see.
>Colour
also
>defusing bombs by cutting wires
What is this, the fucking 80 where they dont teach you basic chemistry? Do one of the following:
1)Remove power supply
2)Remove Det-Cap
3)Soak in water and Sodium Bisulfite
4)Blow it up early with a bot
Fucking google hr, making shit complicated.
Wait. Even if I'm rendering in software mode, doesn't the graphics data still pass through the GPU because that's where my DVI cable comes out of and into the monitor?
How does that work?
Software render:
Do all the drawing in math on the CPU.
Move the pixel buffer to the GPU
Move to monitor
Hardware:
Do first step on the GPU, skip second do third.
>1)Remove power supply
The battery is inside the casing, opening, perforating or damaging the casing triggers the bomb.
>2)Remove Det-Cap
Not externally visible.
>3)Soak in water and Sodium Bisulfite
Moving the device will nudge the accelerometer, triggering an explosion.
Dumping liquid on the device will be largely ineffective due to the waterproof shell.
>4)Blow it up early with a bot
Yes. Although you won't save the building it's in, if any.
I wish there wasn't so much fucking abstraction in modern computing. It confuses me.
I think I'm going to order a FPGA and make my own computer and stop dealing with all this crap.
Watching other people program can quite honestly be rather boring most of the time. I'll make an exception for the youtuber Bisqwit though, as he does not show himself programming live, but instead, shows a sped up programming video that he will occasionally comment on to explain more difficult concepts. It's a lot easier to follow, if you consider that 80% of programming is
Buy a RISC-V if you're going to start clean, x86 is a mess.
Maybe you care for handmadehero.org then
Aims to deal with that stuff as little as possible.
>opening the bomb tiggers the bomb
Then how would we get to the wires? Are they sticking out of the case? If so, then the case can be opened.
>cap not visible
It is if there are wires going to it
>Moving the bomb triggers an explosion
then how did they get it in place to begin with MIT? Do bombers bring their own lab with them where ever they go?
>blows up the building
Fuck it, its only trump tower
I'm not the user you were replying to, there are no wires on my bomb.
I'm just fucking with you.
>then how did they get it in place to begin with MIT?
Only once you active it does it start to defend itself. There's a button, push it once to activate the countdown, push it again and it blows up now.
>Fuck it, its only trump tower
Take that back, fucker
the bomb is biological and the wires are its veins
That sounds fucking cool, good way to die
and 80 year old archmages
you have to cut it in such a fashion that it isn't at any point aware of its death and capable of detonating
*wields katana*
*tips fedora*
Java decided one of it's libraries for handling formatted binary files didn't exist, so I decided I'd just convert the data to CSV instead. Wrote a small Ruby script to do it.
#!/usr/bin/env ruby
def read_uint8 file
file.read(1).ord
end
def read_uint32_big_endian file
file.read(4).unpack('N')[0]
end
ARGV.each do |filename|
File.open(filename, 'rb') do |file|
# Get type of file (array of scalars vs array of matrices)
magic = read_uint32_big_endian file
ndims = magic - 0x800
# Compute the number of rows and columns per generated CSV file
rows = read_uint32_big_endian file
columns = 1
(ndims - 1).times do
columns *= read_uint32_big_endian file
end
# Generate new CSV file and write the vector/matrix data to it
File.open("#{filename}.csv", 'w') do |csvfile|
rows.times do
columns.times do
value = "#{read_uint8 file},"
csvfile.write value
end
csvfile.seek -1, :CUR
csvfile.write "\n"
end
end
end
end
>Java
Found you're issue there
Super new to Haskell but just finished my first big-ish project in it. Are list comprehensions slow as shit or am I doing something wrong?
I made the same thing in java years back and it runs way fucking faster in java. Even compiled with O2 but I'm guessing I'm overlooking some basic optimizations.
here's a (You) for you're predicted response
FREE PASCAL REPRESENT
If you want performance, don't use the default lists
I gotcha bro.
Who /BCPL/ here?
I don't really have a choice, mate.
I don't know if this is the place for this but would anyone happen to know how to install directx through a batch file while not having administrator rights? I have access to notepad and I've been tried using this - cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "%1"" - to install but it still says I need admin access.
We draw together, autism edition:
korbo.ga:82
You can't install DirectX without being admin.
Is there such a thing as an embedded GPU? Mobile phones use something like that, right?
Yeah. NVidia's Tegra is pretty popular
This guy is as autismal as they come. After having to deal with the code of one of his acolytes (who misunderstood half the shit he wrote) I'm a little irked.
Whoa, those are pretty pricey chips individually
Well yeah, they're on the high-end and pack a lot of power in something much more constrained than a desktop GPU
Why are fimns always so autistic?
What languages to learn, friends? What languages will help me excel in the industry? Or bitterly regret my existence?
C++ will do both.
I was hoping to find something cost effective for doing fancy visual effects on a 640x480 display for an embedded project. Guess I'll have to research and see if there's something lower end than that. Could always dedicate a second CPU as a graphics co-processor, but that might struggle with some stuff.
I'm taking it this semester just to add to my languages and I absolutely hate the professor. Probably should've avoided the intro programming class. I'm learning how it parallels to other languages on my own anyways
I recommend learning things on your own and ignoring the prof. You'll have more fun and learn more deeply that way.
Its pretty much what I did, only two weeks of class left. Just went to class as a formality and tried tuning out her rambling. Couldn't even use computers during lecture so I just ended up working on algorithms and shit from my other class.
it's a pretty simple deterministic password manager, passwords aren't stored. it's just an SHA-256 hash function with settings stored per domain. what do you think?
Deterministic password managers are a very misguided idea. You should realize this.
Programming a CLI monopoly game in java for my CS course
Currently stuck on getting my array of players to talk to the array of BoardPositions using a for/while loop
i hear a lot of theory about this but no practical examples of them ever failing. most just do a poor job of saving settings
>java
stopped reading right their buddy
The whole point of deterministic password managers is that you don't have to store settings and sync your passwords database between devices.
But that fundamentally means that you can't change your password more than a couple times if you need to, because otherwise the user would have to remember the exact settings used for each website, defeating the whole point.
Furthermore, if someone finds your algorithm, all of your passwords are instantly compromised.
Instead of the password database being secret, the algorithm is secret. This is security by obscurity.
Now especially if your algorithm is just one round of SHA-256, you might as well consider all your accounts hacked already.
+bOu]imT~MG