Old thread: What are you working on Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
youtube.com
myslu.stlawu.edu
twitter.com
A waifubot
Gross.
>unironically posting 3D
get the fuck off my board
Please stop posting anime.
Gonna build my own VM, no idea what I'd do with it after though
seek psychiatric help
What's up with her ribs
Why isn't she writing code
She's fucking perfect
thank you for posting a waifu programmer image
Help
>dancer armour
i was fiddling with this idea myself cause it seemed interesting but then dropped it cause i wouldnt have anything to use it for...
i hope you're writing it in C/C++/Rust tho
I want to mess with images. There is openCV, imagemagick etc.
But before I start using those I'd like to know more about what an image file is exactly - is it text, how does text become an image etc.
I'd like to be able to generate such files, change their colors, distort them etc using programs that I made.
But i lack some theoretical knowledge.
I would google this shit, but i'm not sure what exactly I need to google.
Is there some resource that anyone here has used and liked about images.
I was thinking C or D.
not sure how much higher level D is, but as long as it's not too high go for it bro
(even tho its a dead lang)
Question about C: Is using void * frowned upon if you don't have to use it? It seems like void * could be a major source of type safety issues.
A pong clone
>what an image file is exactly - is it text
Wow, you have a bit to learn user..
an image file is almost always binary. They are usually compressed such as in the case of png and jpeg files.
A bitmap file is uncompressed, and is just a binary stream of all the pixel values. The beginning of the file will have information about how to interpret the pixels, such as how wide and high the image is meant to be, and what colour format the pixels are in.
Yep.
Do it rusty rusting rustless, D is dead, baby.
youtube.com
Rust has been taken over by SJWs and will go nowhere.
The community is still pretty active and it gets worked on pretty often. It's not dead, just not very popular
Does rust still have horrific compile time problems?
I dunno, I don't use it
thanks for not answering the question, tripfaggot
you might as well have not responded if you didn't want to offer an answer
How did i not answer the question? What is it you would like to know?
1) Find Freelance gig in your area
2) Hire Pajeets to do the project
3) Pay them 80% less than what you charge
Why aren't you doing this?
i'm using it, and this emacs plugin gives me live error checking by compiling the file, it's near instant for ~1500LoC projects.
also i was in the rust beginner irc and even though i agree they are SJW they are very competent programmers, and they dont push their agenda
Because I would kill myself knowing some pajeet copy pasted shit from stackoverflow without reading SICP
void * is good for two (some would say three, but I disagree) things.
1. If you're talking about a chunk of memory
2. As the other component (besides the function pointer) of a closure
The third way to use void * is as a (type-erased) generic, but IMO you should always use macros for generic programming (i.e. parameterizing code over a type).
So suppose I'm writing a function 'func' which always returns a pointer to a certain struct 'container'. Given
struct container* func(...){
...
}
and
void* func(...){
...
}
I should opt for the first option despite being considerably more verbose?
Not really programming but I had to run several scripts in SQL Server earlier (a nightly script I had to run not in the schedule to apply some changes).
>run script
>BIG RED ERROR: can't write to transaction log, please kill yourself
>check server, turns out the drive containing the .ldf file is full to the brim
>getting reports that users are unable to login to our main application
>PANIC
>decide to free up some space for the .ldf file, 1TB now free
>users still can't log in
>severity one(aka you better fix this right now or else we are going to lose money and you lose your job probably) already issued
>MORE PANIC
>restart our main application
>same issue, check all possible causes, application can't connect to DB
>but DB is up, connection is OK, both manually connecting to db through local and remote machines, all accounts used also tested
>everything tells me that the DB is the issue - restarting the DB server and services will take 8 hours
>already hear names of big guns sending emails to our support team
>1 century later(1 hour)
>decide to the app server's cache (not involved in our standard procedure)
>everyone can now login
Thanks for reading my blog. That was the most intense 1 hour of my life.
lmao
all my functions use void pointers and i just cast later
yolo
Insomniac and Naughty Dog uses them instead of templates for generic programming, which I guess qualifies as a place where you don't have to use it.
I'd say that's an exception rather than the rule though, if you walked into like NASA or some shit and started replacing templates with void * they'd probably go apeshit.
Yes, you should. The more type information you can encode in your function signature the better.
How does it feel people who develop Ruby on Rails apps and never even heard of SICP make 10 times more money than you?
Always.
obviously
you have a type system use it
They don't, though.
(Well, maybe some in California do. But then they go home to a tiny apartment that they pay $3k/mo rent for.)
Pretty good because cracking/exploiting their shit is easy like raping a 5 year old kid.
ess queue ell
or
sequel
Squall
This is unrelated to your problem, but if func is allocating the memory for the struct, don't. Pass it in as a pointer argument to be written out. It's frowned-upon in C to take away control over memory from the programmer, because that's pretty much the only thing C has going for it.
squeal
As a fellow DBA, I'd be lying if I said I haven't had a similar experience.
"Sequel", unless you want someone to immediately dismiss you as uneducated.
The latter, but I had a DB professor this past semester that absolutely insisted on the initialism.
I worked on a little chrome addon to download every image from an Sup Forums thread, it was kinda pain to code but it's open source so there's always room for improvement.
So suppose I'm making a computational algebra system (just an example) and I need to implement runtime polymorphism. In this case, void* seems like a good candidate. Is there a better way to do this?
You're still in college, Ozzy?
in this case use a language that supports real runtime polymorphism
Whom is this floor whore?
As the project's complexity grows, I'm finding it harder and harder to write self documenting code. Nobody taught me anything about this, what the fuck? I used to be able to tell what anything did in my code just from reading it but now that's almost impossible.
It was my first and my biggest blunder. it's been 6 hours since and I still can't sleep, I also haven't eaten anything yet, I don't think I can stomach anything right now.
Unfortunately.
that's cool. source source? im wondering what made it such a pain..
You'll (likely) need to use void *, yes, because what you want is easily accomplished with closures (a virtual method paired with its object is essentially a closure).
Where you at comrade
Karlie Kloss. She's a programmer.
Top secret government facility.
Whatcha studying?
>I'm finding it harder and harder to write self documenting code.
Probably because your codebase doesn't have a good hierarchical structure. Learn good code structure. It's essential to writing anything that's not script-kiddie tier shit.
nice programming related picture FAGGOT
The source code is available on my github
Jumono is my username if you're interested, I have tons of fun working on little things like that when I have a free time.
What if I have a function that returns a pointer to a struct based on its input. Since I don't know which pointer to struct the function is going to return, I'm assigning the value to a void* variabile. Then, based upon some other stuff, I cast the pointer to the actual struct type it's pointing.
is this ok?
She's a programmer, you idiot.
>karlie.jpg
overrated as shit
Not your board fucko.
>old hag
>shit op
fuck off
No, much better to use a union for that.
no she's not, you don't become something just because you feel that you are it
Uh-huh
I bet it's a community college, ain't it
Okay, thanks.
What if the output is of unknown size which is impossible to predict for the programmer? Is it still a better idea to just allocate a large chunk of memory outside of the function and set up a limit for the amount of memory used for the function?
If possible, separate the part that calculates the size into another function. Failing that, allow the user to pass in an allocation callback (basically something with the signature of malloc).
Oh, I actually never thought about using unions. Nice.
Okay, thanks.
Why the fuck are you programming in Swedish?
you're using vanilla js. i applaud you sir. so much of your code could've been saved by using jquery but you went all out.
respect man
>func
>container
>swedish
what
I only say to prefer something other than a callback because C doesn't have lambdas, and so it can be a bit of a hassle.
för att jag vill det
What?
Nice trips cuck
yea, and you're also not a faggot
CS
No, actually. I was going to a community college a while ago, but now I'm at a real university.
...
>C doesn't have lambdas
#define lambda(l_ret_type, l_arguments, l_body) \
({ \
l_ret_type l_anonymous_functions_name l_arguments \
l_body \
&l_anonymous_functions_name; \
})
Enjoy.
I don't like jQuery, never liked the syntax and I'm generally okay with doing pure JS
what's the best language to write the first compiler for? everyone recommends scheme, but I don't know anything about functional programming besides Java streams and lambdas. I intend to write it in C and for it to produce assembly code
I know right. I always get into lingerie and 6 inch stilleto heels, then sit on the floor without any equipment to do koding.
>if you don't use your an idiot
>your
CLite
it's not an actual language but great for learning
myslu.stlawu.edu
>xD
Downloading images from the NASA archive since I recently learned they are all free to use as long as you don't suggest NASA is endorsing you and they don't have astronauts in them.
Finally going back and reworking my Sup Forums api wrapper
import Foundation
import FourChanAPI
let a = FCBoard(name: "a")
// Getting a list of all boards
FCBoard.getAllBoards {boards in
print(boards)
}
// Updates the board's thread list
a.updateThreads {threads in
print(threads)
let thread = a.threads[0]
// Fill thread with posts
thread.updatePosts {posts in
// Print last post
print(thread[thread.count - 1]!)
}
}
It's the best way. I sometimes massage myself down there to get my blood flowing, and then meditate on zygohistomorphic prepromorphisms.
How can you tell?
gnu c
looks straightforward as fuck. thanks.