old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Kill yourself, fucking faggot
first for 12yo girls are sexy
how do you feel about subtracting about subtracting ascii values from chars to convert them to integers?
As far as I know that's the proper way to do it.
shamwow, those are some harsh bros bro
skittle your steez brosephina
we're all jenga in the end brostradamus
Tried and true.
My program crashes, but only sometimes. It never crashes when I'm in debug mode. That's usually a sign of a mishandled pointer, right? I can't find any non-deleted pointers anywhere.
uninitialized variables, maybe?
Have you tried shotgun debugging?
what programs do you guys even make? what is even the point of programming? You're just propagating the senseless consumption of media.
Assembly or C first?
doing it all wrong. prolog first, then ada
>You're just propagating the senseless consumption of media.
You're just propagating the pointless entropy of the universe.
I just found a single unassigned boolean that I don't even remember creating in a file that hardly ever gets used. Removing it seems to have fixed the issue.
Unless of course this is just a fluke sequence of non-crashes that will end any time now. I really find it hard to believe that removing a single variable could fix it, especially since this problem just recently started, after months of no issues.
so, you're agreeing with me
why are you suggesting high level languages for someone that wants to learn low level?
from bs4 import BeautifulSoup
import urllib.request
import re
url = "
because if you want to science and actually do real shit you learn high level
if you want to fuck a computer you learn low level
Using IntelliJ, tried to call a method that is listed on Java Documentation. Actually I am LITERALLY just copy pasting from the documentation and am getting compile errors.
docs.oracle.com
> people who know low level languages can't do "real shit"
have fun holding hands with your interpreter
Trying to learn how to use a graphics library for C++ (SFML), and am using this tutorial:
mjbshaw.com
When I run this code:
cmake -G 'Unix Makefiles' \
-DCMAKE_OSX_ARCHITECTURES='i386;x86_64' \
-DCMAKE_CXX_COMPILER='/usr/bin/clang++' \
-DCMAKE_C_COMPILER='/usr/bin/clang' \
-DSFML_BUILD_FRAMEWORKS='ON' \
-DSFML_INSTALL_XCODE4_TEMPLATES='ON' \
-DCMAKE_CXX_FLAGS='-stdlib=libc++' \
-DCMAKE_C_FLAGS='-stdlib=libc++' ../
I get the error in pic related... How did I fuck up, and how can I fix it?
Thanks for the help on HashMap, I was aware of its existence and it's amazing to see a really clever use for it outside of academia.
make sure you have the jdk8 and the java 8 language level set up in your project settings
Try adding "-DCMAKE_SYSTEM_NAME=Darwin". It seems to not recognize your system despite correctly detecting you have Apple's version of Clang as opposed to regular Clang for Windows/Unix.
C -> Assembly -> C
>I was aware of its existence and it's amazing to see a really clever use for it outside of academia.
Maps/Dictionaries are probably the most used structure behind Arrays/Lists
I've never used classes in haskell
I understand how its supposed to define behavior, and that types that support those behaviors can be a member, but what other behavior can there be?
do you mean typeclasses? a typeclass just says some object "can be thought of" as ____
for example, a list can be thought of something you can map over. so can a tree. that's why you can make them both Functors.
are you asking for examples of typeclasses?
Sup Forums api
lol, just lol
Hm... Still not working. Not sure if it helps, but I have the GUI version of CMake
i mean most haskell tutorials guide you this
did you just go in without learning?
yes
I have no idea on how to include typeclasses to the fullest
I need to know when to use it
pls halp
if you could provide an example that'd be great
Hashmaps are used extensively in networking. DHT for example refers to Distributed Hash Table, which is another word for Hash Map.
just read learnyouahaskell.
there's a chapter on typeclasses
I just got done with some stuff for my website.
I had the fellows at /wdg/ help me troubleshoot a massive shitfest that turned out to just be gey.
Apparently loading 2000 lines or so in a single module takes a while.
I switched a very long select element into just a numeric input box.
problem solved.
I did, but I still dont know when to use them
You put the system name after the "../"...
And also, I did a bit more digging and think the dual 32 bit and 64 bit binary setting might be messing with your build also. You could try to only go 64 bit with "-DCMAKE_OSX_ARTITECTURES='x86_64'" or committing the option entire since I'm sure CMake can configure automaically.
macOS hasn't used 32-bit since Lion so I'm sure unless you care about legacy, it would be fine to drop i386.
then you probably don't need them yet. unless you're building something right now that you're having trouble with/you think you might need typeclasses for? if so post details
someone screencap this and attach it to the CS grad meme, please
Do you guys feel like you learn anything from browsing these threads?
I've learned a lot from Sup Forums about various topics over the years , and I program for school but the professors make it so dry and lifeless. Can memes make me love programming again?
making shit and learning new shit is what makes programming fun
I only visit this place so I can learn the new memes and meme my code that I don't wirte because I spend all my time here
sure, just make a homepage hentai waifu webapp.
I'll be back on this after I finish more with my website
quick, give me something fun to do in haskell
hard mode, the end result is useful
>what is even the point of programming?
I got into it because I liked vidhya. Now I do it to get paid.
the stuff you learn in C is actually applicable to things you might want to make in the future. Assembly feels like more of an exercise in learning how does computer work.
I do, I'm able to compile other things and call other methods and even compile other JavaFX projects but this isn't working.
terminal
Assembly for a sane architecture like ARM or 68k.
You're confusing "low level" with "badly designed."
If someone wanted to learn about dynamic typing and closures, would you start by teaching them how to write JSFuck in JavaScript? No? Then why would you teach them C? C is JavaScript-tier crap made by noobs.
All of the low level programming in C is "undefined behavior" anyway.
I just have so many negative associations with it now because of school stress. I'm hoping that I can find some renewed genuine interest and enjoyment, because its starting to feel like a chore doing assignments and such
a terminal?
i'll call it ht, not logo
where do I even start
I guess I could a tui, but then how can a tui be inside a tui
any places to start?
*no logo though
Fucking faggot trap animeposter
you know he gets off on being called out
don't reply to him
just realize he will do this until he dies or Sup Forums is deleted
accpet it
what exactly is the point of having a server? If I download a file onto it I can't retrieve it without re-downloading it from that source. I can see as a proxy but I feel like it'd just take a lot of time for little payoff.
you are getting both the images and their links
you need to do a test like if str(link['class']) != 'a'
I'm sick of the gay agenda being pushed, there has to be a way
there is a plan, but I won't say it because he'll be aware of it
just think, what can you do
hime isn't gay
I know I'm being astronomical levels of retarded, but like this?
Or more like this:
cmake -G 'Unix Makefiles' \
-DCMAKE_OSX_ARCHITECTURES='i386;x86_64' \
/DCMAKE_SYSTEM_NAME=Darwin
-DCMAKE_CXX_COMPILER='/usr/bin/clang++' \
-DCMAKE_C_COMPILER='/usr/bin/clang' \
-DSFML_BUILD_FRAMEWORKS='ON' \
-DSFML_INSTALL_XCODE4_TEMPLATES='ON' \
-DCMAKE_CXX_FLAGS='-stdlib=libc++' \
-DCMAKE_C_FLAGS='-stdlib=libc++' ../
the internet is the gay agenda. wake up homes. they have you ese! You've become a farmhand to the 'putadoras
I haven't learned anything from Sup Forums.
if anything, I've become dumber. I always wonder what kind of things do people learn from Sup Forums, and what kind of people visit this piece of shit website.
dunno why I'm still here, I guess it's because of the need for """"socialization"""".....
Where is the line drawn on copying code in a professional environment?
I don't mean straight up copy-pasting a full program. I'm talking about something as simple as copying a sorting or pathfinding or fill algorithm straight off a tutorial website.
I'm obviously more than capable of personally writing out a bubble sort, to use a very basic example, but my job isn't to reinvent the bubble sort. It feels like a waste to spend any amount of time re-writing (and potentially accidentally messing up) something so absolutely basic.
I just made my vim experience 1000 times better by finally setting up proper split management mappings.
" Split navigation
nnoremap
nnoremap
nnoremap
nnoremap
" Resizing
nnoremap +
nnoremap -
nnoremap <
nnoremap >
" Easier splitting
nnoremap :aboveleft split
nnoremap :belowright split
nnoremap :leftabove vsplit
nnoremap :rightbelow vsplit
" Buffer navigation
nnoremap :bnext
nnoremap :bprev
The world must know.
Get off the internet, get rid of your TV, become a NEET and never leave your house again.
and thus you will learn nothing. churning out the shitshow themed crap companies make now. i salute you, you lazy piece of shit.
-love, your mom
Copy-pasting anything from the internet is a terrible idea.
If you're using existing code as a guide (perhaps porting to a new language) and someone can look at what you write as say "yeah, this almost definitely came from this source" seeing them side-by-side, you've copied too much.
If the algorithm is so simple that all correct implementations are practically identical, you probably shouldn't need to copy.
Is /dpt/ the last bastion of Sup Forums against full autism?
Seriously, this whole board is the definition of hypocrisy.
The gpu threads are the best example. They hate games, they claim they don't play them(they do) but they always have the latest GPUs and always talk about performance.
Now why do they need them? Cause they play games heavily? Or maybe they actually do something resource heavy? Fuck no, these asses play gaes 24/7 and they deny it.
What does it change that they lie about it? They are still a pathetic mess if theu are over 30..
Who cares if he isn't gay or not. The bigger problem is that he's in no way programming related in any sense at all. Editing media to make him seem programming related is retarded and in no way makes the character any more technology related than he will ever be. He's essentially a "forced meme" at this point.
I was fine with Yuki because her original premise at least was somewhat programming related. But it's tiring that a character this old which isn't even programming related keeps on getting posted. It's tolerable but it is honestly tiring and stupid. At least post stuff from Lain, Battle Programmer Shirase or even New Game!. It's honestly better and infinitely more on topic than whatever the Himegoto spammer will ever post.
If you're going to use CMake, at least learn what the basic syntax is. "\" is used so you can write mutiple options on mutiple lines and not run into errors.
You need the following:
cmake -G 'Unix Makefiles' \
-DCMAKE_OSX_ARCHITECTURES='i386;x86_64' \
-DCMAKE_SYSTEM_NAME='Darwin' \
-DCMAKE_CXX_COMPILER='/usr/bin/clang++' \
-DCMAKE_C_COMPILER='/usr/bin/clang' \
-DSFML_BUILD_FRAMEWORKS='ON' \
-DSFML_INSTALL_XCODE4_TEMPLATES='ON' \
-DCMAKE_CXX_FLAGS='-stdlib=libc++' \
-DCMAKE_C_FLAGS='-stdlib=libc++' ../
Makes sense? Also, try the suggestion I told you earlier about ommitting i386 from the OSX architectures line.
How is this different than a tiling wm?
Instead of managing X windows, it manages vim windows. Vim windows are sorta like X windows, except instead of containing a pixel grid, they contain a character grid.
Right. I'm asking what's the advantage? If I have i3 already should I still be using vim splits?
It'll work over SSH, it is less resource intensive, it allows the windows to share buffers, etc. for easy manipulation in vim (though you could probably find a plugin to make everything work between separate vim processes), and it works in cases where you can't use a tiling WM (on a locked down school or work machine, for instance).
Okay... Thank you for all the help, but it doesn't seem like CMake wants to work today... I copied what you told me I needed (and removed the i386), but I get the error in pic related... It probably has to do with my version of OS X, but then again, I'm new to the C/C++ scene
all right can I actually get some advice on this? control flow seems a bit weird, with some preprocessing done in "huffman" and passing in the "" to parseTree manually - in java or python that would be a default argument. Should I make a helper function here?
data Tree a = Leaf a | Branch (Tree a) (Tree a)
huffman :: [(a, Int)] -> [(a, String)]
huffman xs = let t = consume $ map (λ(x, n) -> (Leaf x, n)) xs
in parseTree t ""
consume :: [(Tree a, Int)] -> Tree a
consume [(t, n)] = t
consume nodes = let ((t, m):(s, n):ys) = sortBy (comparing snd) nodes
in consume ((Branch t s, m + n):ys)
parseTree :: Tree a -> String -> [(a, String)]
parseTree (Leaf x) prefix = [(x, prefix)]
parseTree (Branch t s) prefix = (parseTree t ('0':prefix)) ++ (parseTree s ('1':prefix))
What version of CMake are you using?
Type
cmake --version
Version 3.4.2
how much does it take you to learn a new language?
I feel bad, and become quickly demotivated, after just a couple days of trying to learn a language, only to see that i've seen the most basic shit (ints, strings, functions) and nothing else
what language senapi?
personally, I don't learn a new language without a specific project in mind that is especially appropriate for that language
ex, state machine in haskell
yeah, its never a good idea to have a dum argument
just make a general case in a helper private function, and make ur function a genral case
That's not terribly old but you're not up to date. What did you install CMake from? You should have 3.6.1 or at least a 3.5 variant. I think 3.4.2 is before El Capitan.
*make ur function a specific case
yeah, make parseTree private unless its used elsewhere
and make t also private
so something like
huffman xf - parseTree t ""
where parseTree = ...
t = ...
What's a good place to get started into OpenGL?
I installed Cmake from an OpenGL tutorial like a week ago. The GUI version of CMake I have (the one from their website) is 3.6.0, but I'm unsure of where to update the CLI version of Cmake
every time OP posts himegoto it fulfills a part of my life. ty based OP
any lang. right now, I'm learning lua, before I tried C#.
for both langs I just mentioned, I had projects... but I haven't even started them, because I fear I'll have to google whatever stupid problem I'll find, so I want to learn "properly"
Nigga, I've been trying to get a concrete answer and have gotten so lost in so many different ways...
But I found this tutorial, so maybe it can help you? (I had a bit of trouble with the Vertex and Fragment Shaders)
Learn OpenGL the Hard Way by Zed Shaw
a book
pic related
Maybe you should have a goal in mind before mindlessly learning scripting languages.
You should have started with C desu senpai.
I meant if you installed it from like Maccports, Homebrew, or compiled from source.
The GUI and CLI should update in tandem. You did something wrong somehow. Figure out how to correct your install and try again.
It sucks that setting up software sucks but it's honestly sometimes harder than getting productive with said software.
thanks, will do. tfw more lines of code :(
so private just means in a where block? I guess that makes sense
you'll never get anywhere by "learning properly". just look it up as you go, your code is going to be shit while you're learning anyway. what were your projects?
perhaps someone will recognize my problem... I made a similar post a while ago, and the response from some user was that I should seek therapy or something.
I'm a very insecure, impatient NEET, you can guess that's not a good mix...
I already know the basics of many langs: C, java, python, golang, bash, ...
Small correction: Just downloaded the binary files for CMake, but I'm not sure where to go from here... I'm told "Cmake is up to date when it clearly isn't
Then maybe you should attempt a project.
It will force you to learn about the language you're using and force you to think programmatically, which is something that is severely lacking in programming tutorials, I notice.
trying to learn shell as of this month and unaware why I need to learn it but I wanna fucking learn it sooooo
You know... That's fine. At least I sort of know where a problem lies which is more than I knew thirty minutes ago... .Thank you anyway. I'm gonna post something on StackOverflow or something