[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 336
Thread images: 33

File: Homura_DPT_rust.jpg (128KB, 563x712px) Image search: [Google]
Homura_DPT_rust.jpg
128KB, 563x712px
Old thread: >>58275717

What are you working on /g/?
>>
>>58283032
First for D
>>
java and C++ are literally the best languages top kek at using irrelevant memelangs like D and rust
>>
>>58283057
Java is hot garbage
>>
>>58283072
nice meme here's your (You)
>>
>>58283057
I don't think you could have made a post any memeier.
>>
>>58283082
It's true
>>
I'm afraid to post my serious response to a serious question now. Wth mods.


>>58282896
You use map and set because they're convenient.
I'd probably just go with a 2d vector. Ideally in "tiled" chunks using morton-ordering or something.

But just switching to vector(C++)/arraylist(Java) should give you a boost. I think. I haven't profiled your code or even read it to understand what you're doing in detail but with a path finding algorithm you do very little actual work for each node. So you spend a lot of time just waiting. If you make it so your CPU can work on each node (in your case square in the grid) without waiting as much you get way better performance.

I'd probably go find a different algorithm for this altogether if speed is very important (say you wanted multiple of these per 16ms or something, in a game). There's tons of interesting stuff in pathfinding.
I'm rambling. But just try using an arraylist instead if it's not too much hassle.

>>58282893
Yeah. It's deceptive obviously.
But, something that's worth noting that he doesn't mention because it's rather insulting. If your C++ code is slower than your Java code. You're a crap programmer or the problem is too hard for you. So in many realistic cases Java comes out on top.
>>58283094
That's an incredibly petty and stupid reason to delete a thread where people were participating constructively.
>>
>>58283057
java is ugly and I hope nobody gets to experience it as his first language
>>
File: 1468472224634.jpg (61KB, 990x557px) Image search: [Google]
1468472224634.jpg
61KB, 990x557px
>>58283111
>>
Justed started to get into programming and started doing some Python in Code Academy, not sure if this is a good place to start
>>
>>58283263
See for yourself, pajeet. This thread is cancer.
>>
>>58283263
>Python in Code Academy
no, please don't, seriously

https://docs.oracle.com/javase/tutorial/
>>
>>58283263
>not sure if this is a good place to start
It's perfectly fine to learn syntax. The biggest complaint i have is that they don't really give you a good path to follow when you're done. And the way you get congratulated on your successes seems to give a slightly misleading idea of what programming is.
But I don't think it's all that harmful. The way they gameify learning the boring parts of programming is good to keep some portion of people motivated.

Just don't ever feel like you're far off doing something useful. It's a very short road for new programmers with languages like python.
>>
>>58283032
>not using atom
>>
>>58283344
This is some of the weakest bait I have seen in a long time.
>>
58283311
literally shoot yourself in the head and or leave this thread
>>
>>58283365
What are you gay? Atom is the best.
>>
>>58283311

>The way they gameify learning the boring parts of programming is good to keep some portion of people motivated.

Gameify, you say?
https://alexnisnevich.github.io/untrusted/
>>
>>58283365
What do you use anon
>>
>>58283368
Rekt.
I'd prefer to have an argument though.
>>
The deleted thread was created like 5 posts before bump limit. Jesus christ you guys are autistic for making such a big deal out of it.
>>
V8II83387
>rekt
You might wanna fuck off back to your website.
>>
>>58283387
>tfw you started bragging but now realize you have a bug
fuk.
>>
>>58283387
>no you
yeah, that is the point. and even if you fix your stupid little script it'll still be counterfeiting
>>
>>58283311
>Just don't ever feel like you're far off doing something useful. It's a very short road for new programmers with languages like python.
How do I go from being a scrub to making something useful? :(
>>
>>58283391
You must have missed the thread wars.
The bump limit needs to be followed EXACTLY, otherwise shit will spiral out of control.
Not even a single post before.
>>
you can't. you were destined to remain a scrub for your whole life.
>>
>>58283416
And yet it's okay to have thread wars instead of discussing /dpt/. Good policy.
>>
>>58283311
Im a different anon just popping in. Ive been learning python as my first language

There seems to be quite literally a module for every single operation I want. I google how to do something, told to just import a module to plug and play it.

I feel like a fag using them without understanding them.
How beneficial is it to know the underlining concepts?

Am I putting myself behind in terms of overall structure and concepts by learning with such a high level language?
>>
>>58283443
>I feel like a fag using them without understanding them.
You should.
>Am I putting myself behind in terms of overall structure and concepts by learning with such a high level language?
In my opinion, yes.

If you aren't even capable of implementing your own data structures and algorithms, you're nothing but a code monkey.
>>
>>58283443
>How beneficial is it to know the underlining concepts?
i hope this isn't an actual question lmao
>>
>>58283443
python is complete shit for learning

when you're doing non-trivial programming tasks you will have to implement things from scratch, there won't be modules to help you (except for trivial math stuff and such)
>>
File: umatrix-edge.png (242KB, 1440x900px) Image search: [Google]
umatrix-edge.png
242KB, 1440x900px
Enough for today. Things left to fix:
- logger
- host file update
- user agent spoofing
>>
>>58283414
My brother is a freshman at university and he wrote software that an actual company had use for. All it does is take a list look of applications/dependancies through a large cve database and sees what exploits exist for that software, classifies them and prints a nice tex paper that they can deliver to the company. It does things like suggest upgrades or replacements of software too optionally.

It's incredibly trivial stuff but it's really useful to have.
It's all in python (he also has a tex file he uses as a template) and it's really trivial stuff.
>How do I go from being a scrub to making something useful?
You have an idea for something you want to do that's useful and you start doing that useful thing.
And steer clear of functional programming.
>>58283443
You're not hurting yourself by relying on codes other wrote unless you can't walk away from it. There's so much stuff nowdays that is just lego's. Even in electronics. So I don't think you should feel bad about it. You should feel disappointed that you're not running into issues that can't be solved easily.
Really what you should focus on is if you're learning something or not.
Say you're writing a videogame. There's no fault in using a game engine for it. You just won't learn how to make a game engine (rendering, audio, events, streaming content etc is stuff you don't get to implement yourself). But you can still learn tons about how to structure a videogame.

To claim stuff like >>58283462 >>58283455
is silly. They haven't even built the basic components/circuits/computer/OS/compiler they're on yet they make these claims.
>>
>>58283462

that, and it actively encourages shit behavior/ideas eg. exceptions for control flow are idiomatic instead of frowned upon.

It's teaching you wrong
>>
>>58283443
Don't listen to the people here. Programming is as useless as life, just learn whatever.
>>
>>58283481
Jesus christ, this post can't be serious.
>>
i see this thread is retarded as well. i guess making a thread with the name D-T is a sure way of making it the shittiest thread on the board.
>>
>>58283481
kys my man
>>
>>58283481
fuck off back to your subreddit
>>
>>58283494
>>58283519
>>58283533
I can't even tell what you're complaining about.
>>
>>58283481
>They haven't even built the basic components/circuits/computer/OS/compiler they're on yet they make these claims.
This is actually a good point I think. Most programmers I assume really just treat say the CPU, RAM and hard drive/SSD, and probably most of the compiler and OS they're using, as a black box they can interact with in certain ways and expect it to work, without really having an in-depth knowledge of the particulars of these things. This isn't necessarily bad since all of this shit took reams of people probably millions of hours of work to build so it's unrealistic to expect every codemonkey to understand everything fully, and is kind of unnecessary most of the time too since they're built in such a way that others don't have to be experts in them to make proper use of it.
>>
>>58283365
if you have enough ram there's literally no reason for you not to use it
>>
File: gallbladder.jpg (18KB, 480x360px) Image search: [Google]
gallbladder.jpg
18KB, 480x360px
>>58283481
You seem alright to me, matey
>>
>>58283567
>literally no reason for you not to use it
What if there's something better?
>>
>>58283481
>>58283552
>They haven't even built the basic components/circuits/computer/OS/compiler they're on yet they make these claims.
You two really are projecting pretty hard.
You don't know how much knowledge people on here might have about the internals of a computer, the software they use, and so on.
Some of us has Computer Science degrees from Universities that aren't complete crap.
>>
>>58283575
Im aware of the other text editors available, tried all of them and found atom most comfortable for some reason
go figure
>>
File: photo.jpg (132KB, 900x900px) Image search: [Google]
photo.jpg
132KB, 900x900px
>>58283552
>they're built in such a way that others don't have to be experts in them to make proper use of it
Which is exactly why
>they're built in such a way that others don't have to be experts in them to make proper use of it

Abstraction is a meme.
>>
>>58283552
>>58283591
Sorry failed to copy for some reasons. 2nd quote was meant to be
>this shit took reams of people probably millions of hours of work to build
>>
>>58283546
your blatant redditry. now fuck off
>>
>>58283580
If you have spotty knowledge at some point throughout that chain from fundamental physics to high level programming you obviously are doing just what he's doing to some degree (the guy who just uses python modules for most things).
And I know a lot of that low level stuff. But I wouldn't sneer at someone for not knowing it. Because for a lot of work you don't have to know that stuff.
I don't generally couldn't use python to do what I need to do. But some can. Again, I'd be disappointed with his set of problems he's required to solve.
>>
>>58283481
that's a lot of implication my guy
>>58283614
some things are more relevant than others, especially depending on your problem domain. if you're focusing on games, you should understand your engine.
>>
>>58283609
>redditry
I'm sick of newfags 'calling me out' on this.
I've been on this site since I was 13 and I'm 24 soon.
You're clearly the foreign invasion if you can't handle discussion.
>>
>>58283481
>They haven't even built the basic components/circuits/computer/OS/compiler they're on
Speak for yourself, redditor.
>>
>>58283624
>if you're focusing on games, you should understand your engine.
Well that "should" needs motivation.
Which has yet to be given throughout this thread.
>>58283627
Impressive that you've managed to dope enough transistors to make your post and read HTML. All by yourself.
>>
>>58283626
>I've been on this site since I was 13 and I'm 24 soon.
this is only possible if you were in a coma for an extended period of time. now fuck off back to your subreddit.
>>
>>58283637
writing code that doesn't shit the bed. it's like how Java fags will write 10k+ lines of code and not be able to see why they have a null pointer exception/prevent one without spending ages looking shit up on StackOverflow. if you don't understand what the abstractions are doing to some degree, you are unable to write good code
>>
>>58283614
>>58283644
Physics, transistor logic, CPU state logic, and all of that shit is pretty irrelevant for software.
You would only need to be aware of that shit when you're writing with HDLs.

But really, you're attacking a fucking strawman. My original point is that any reasonable programmer should have a good understanding about data structures and algorithms, because that is what programming fucking is.
>>
>>58283637
>Impressive
Thanks, I know. I can manage that since I'm not a redditor like yourself.
>>
>>58283666
programming is instructing the computer to do something
you don't need good understanding of data structures and algorithms for that
>>
>>58283683
And this is why we shouldn't let non-CS fags into programming.
>>
>>58283688
>we
who?
>>
>>58283683
>>58283683
that's a good point lots of cs fags miss
>>
>>58283696
The weasel words "we".
I thought that was obvious, but I forgot that I was dealing with a sub-80 IQ individual.
>>
>>58283591
Why abstraction is a meme?
>>
>>58283711
Who are you talking about? Specify the exact people and then tell me how are you guys going to accomplish your goal of "not letting non-CS fags into programming"? Also explain why you even think that such a thing is remotely possible.
>>
>>58283727
Oh great, he's autistic as well.
>>
>>58283659
I know exactly what abstraction does and how it's very bad.
But the "need" is
>>58283666
>My original point is that any reasonable programmer should have a good understanding about data structures and algorithms
If good means more than shallow I'd say no. It's helpful to know some of datastructures an algorithms as it's usually taught by books and classes.
But it's certainly overkill. Especially since it's more about computer science than programming most of the time and they're only covering the basics. What I'd ideally see is a more broad view of different classes of algorithms and datastructures rather than the detail view they usually give you. It's a more dense set of usable knowledge. To learn about linked datastructures in general as a concept than learning trees or hashmaps or linked lists.

Managing complexity is far more important. Most classes on that are just plain awful. Most books on that are often misleading teaching you things like design patterns that often just solve issues they've constructed for themselves.. It's all just awful.
So no I disagree satan.
>>58283688
>.t cs student who hasn't written good software ever and considers the software he uses daily like an OS to be major feats of engineering and not horribly broken pieces of shit he puts up with because he doesn't have the time
The relative quality of software is so low is so low that it doesn't take much to replace each part myself. But the ratio of software that's OK to the amount of software I use is so low that I couldn't feasibly replace it all.
>>
>>58283736
Yeah, don't try to answer my questions or anything. At this point you've shown yourself to be mentally handicapped so you might as well just delete your posts so that nobody else has to see this retardation
>>
File: i.png (156KB, 581x344px) Image search: [Google]
i.png
156KB, 581x344px
Let's settle this once for all. Post your IQ and your favorite language.

146 and C
>>
>>58283770
50. Python.
>>
>>58283032
account cracker
>>
File: 1389022013617.jpg (15KB, 362x276px) Image search: [Google]
1389022013617.jpg
15KB, 362x276px
>>58283770
I've never taken an IQ test, and I don't really want to.
C
>>
>>58283770
>IQ
136 according to SAT correlation.
>Language
Not announced yet.
Among langauges I use it's C.
>>
>>58283770
i literally max out every IQ test

C++
>>
File: 1482586276695.png (3MB, 2048x1714px) Image search: [Google]
1482586276695.png
3MB, 2048x1714px
>>58283770
306 and C
>>
>>58283770
haskell 154
>>
File: 1481237353532.jpg (436KB, 1280x1483px) Image search: [Google]
1481237353532.jpg
436KB, 1280x1483px
>>58283770
1200 and 日本語
>>
I am bored and need some project to work on, so do you have any ideas for intermediate, a bit bigger project? Most of the project ideas on the web are for complete begineers.

Or some books like Mazes for programmers, growing artificial societies, calendrical calculations, etc. Books that aren't about programming languages, but about specific toy projects.

I mostly use Common lisp and Racket, but books can be in other languages too.
>>
>>58283799
motherfucker. got caught up having to switch back to my English keyboard to type in the captcha. nearly used the same image as you
>>
>>58283813
Read the dragon book and make your own toy programming language.
>>
>>58283807
>1200 IQ
lmao. more like the amount of kanji you "know"
>>
>>58283823
>dragon book
But it's terrible for anyone who wants to write their own compiler nowdays. It wasn't even ever any good compared to alternatives.
>>
>>58283817
>>58283826
>60 and C#
>>
>>58283770
N/A and Go
>>
>>58283823
>recommending the dragon book for writing compilers
>in the year of our lord MMXVII
i shiggy diggy doo
>>
>he/she hasn't written a program that compiles, runs and profiles your software with different compiler flags iteratively to find the sweet-spot where his application performs 25% better in the performance critical parts.
>he/she still ships software
Disgusting.
>>
>>58283847
what would you recommend?
>>
>>58283724
a meme is just a memory. not just any memory a viral memory that spreads to other human beings. this memory this gets memorialized on the internet for eternity to spread it's idea to others.
>>
>>58283844
>>58283847
I skim read the part about lexical analysis parsing a while ago.
It seemed alright.

Is the rest of the book supposed to be shit or something?
What the the go-to compiler book these days?
>>
>>58283870
Completely serious:
If you know a little about writing compilers already just going your own route will teach you more and you likely end up with a better result than all the theory will lead you to.
I don't know of any good books though. Maybe there's a holy grail out there but you'd have to find it yourself.
>>
>>58283863
That's the whole problem with education. That's why I keep saying we need to teach everything from the bottom.
>>
>have loose ideas about best practices you don't agree on
>find that someone you respect also had the same idea
>is now rock solid and try and thrust your rock hard idea into every mind you come across
Feels amazing.
>>
>>58283845
I don't even know C#
>>58283844
seriously though, this. SICP + EOPL are probably the best you can get if you're looking to make your own programming language. these are great especially for someone using Lisp, but even Jonathan Blow cites SICP as how he learned to write a compiler
>>58283856
>>58283870
see above. there are some others but basically, SICP will teach you the most about the full stack that you'd need to be aware of for a compiler, while EOPL is a lot more language design. the dragon book is pretty much only good for understanding parsers. also the Modern Compiler Implementation in ML/Java/C books are quite good for a more concrete text
>>
>>58283885
But anon, good CS theory leads to good programs, and ignoring CS theory leads to bad programming.
Just look at modern regex implementations.

I could probably get as far as building a shitty AST right now, but I wouldn't know about generating demonstrably "correct" programs from that and how to optimise things.
>>
Hey guys, I have a simple thing to ask.

In the simplest way possible (without semaphores) how can I do one thread that starts running when main() calls it, then waits until it gets notified from main, then starts doing a job, when the job is done it notified back main, main does some other crap before it notifies said thread.

I hope it was clear. Basically how can I implement a simple worker thread that does a job when notified, and then notifies back main when it's done.

I'm still breaking my head over the "notified" part. Language I'm talking about is C, with the Pthreads API used for multithreading. I am trying to do it with condition variables to understand it better but I can't seem to figure it out.

Can anyone help me?
>>
>>58283893
the public education system only exists to keep the population in check, once you open your eyes and see the human potential, you just know.
>>
>>58283922
But it's too late, you always wasted a good chunk of your brain with nonsense.
I wanted my first language to be lojban.
>>
>jonathan blow is mentioned
How many of you actively follow JAI but don't say a word about it for whatever reason?

And how many of you follow the crowd Jblow is in in general?
>>
>>58283943
but i haven't been in the public education system
>>
>>58283948
I do follow it. I've mentioned it here a couple of times, but haven't spoken of it recently since his streams got less regular. I sort of pay attention to handmade hero but I don't know much else about that crowd
>>
>>58283948
i hate that fagit mostly because i cant stand him talking
>>
>>58283915
It kinds of depends on the nature of what the worker thread is doing, and how often it needs to be doing it.
If it's somewhat infrequent, you could just (re)create the thread again, and then pthread_join the thread when main wants to get the result when it's done.
That's the "lazy" way of doing it, though.

>but I can't seem to figure it out
>Can anyone help me?
What exactly are you having trouble with?
>>
>>58283915
Upgrade to C++.
http://en.cppreference.com/w/cpp/thread/condition_variable
>>
>>58283770
96% on mensa test, which is roughly 126, 127 iq.
Either Scheme, C, spinalHDL or asm, depending on which project currently interest me most.
>>
>>58283823
Already made some, some functionals (using EOPL book) and some forth clones.
>>
>>58283915
>main does some other crap before it notifies said thread.
This doesn't make sense.
>without semaphores
Well you can only do that in the most trivial cases.

The simplest model for multithreading that I tend to use is a work queue. The main thread pushes work onto the queue, the workers pull work off the queue (using semaphores to make sure they don't both start working on a set of work). The main thread is 'notified' that work is done by checking the state of the old work, it gets labeled as completed when a thread finishes (I usually do a R&W barrier for the completed state, not sure if that's a good idea or not).

It's a fairly general solution to a lot of threading where there's no thread other than the working thread that needs to access the data.

I think we need more details to give a good answer.
>>
>>58283967
>>58283965
Hm ok.
Because they're in that weird space between well known and just a small group of people doing their thing.
So I'm very interested in the developments that might happen with JAI given how incredibly solid it looks. I'd be really happy if it overtook C++, though that's rather unrealistic.
>>
>>58283992
>>58283978
Hello sirs thanks for responding!

>>58284014
I think I want to do it like that. The queue is lock-free I assume? This is a good model for a thread pool, is it not?
>>
What is the purpose of rust? How is it supposed to replace C when C is irreplaceable?
>>
>>58284054
>The queue is lock-free I assume?
Don't be so averse to locks. Trying to create a lock-free data structure that can potentially be modified by multiple threads is extremely complicated, and that extra complexity is probably going to negate the advantages of not having a lock.

>>58284072
Rust feels more like a C++ replacement to me.
It doesn't seem anywhere near fit enough to replace C.
>>
>>58284072
The same as Haskell. Making programming easier.
>>
what mac do i get if i wnat to start programming objective c
>>
File: b49.gif (1MB, 680x680px) Image search: [Google]
b49.gif
1MB, 680x680px
>over 100 posts
>not a single post with progress
>not even a single block of code
>instead hacker news-tier arguments copy-pasted straight from 1st page of google
You're all hacks. Consider finding a new hobby
>>
>>58284085
whatever mac is default for your hardware.

Why should MAC address even matter if you aren't doing networking?
>>
>>58284104
>Posts a frog
Do you seriously expect anybody to take absolutely anything you say seriously?
Kill yourself, you cancerous fuck.
>>
File: dylan_function_builders.png (90KB, 687x592px) Image search: [Google]
dylan_function_builders.png
90KB, 687x592px
>>58284104
Here you go. Just finished some utilities.
>>
>>58284054
>thread pool
Well as i described it it's a work pool not a thread pool.
A thread pool is when you have work you assign to threads from a pool.
But I often do use a thread pool too because if have a setup and a kickoff where I do have a thread pool I assign work. But I also just set them to run until I deliver a piece of work that tells them to shut down when done with this piece of work.

It's not a perfected system. It's just a rather crusty model I often use.
>lock free
Not a very specific term in my experience but I'd say yes to that. This queue doesn't have any dependencies between workloads. If I wanted to have work that depends on one-another I'd probably invent something new. I'm not that hardcore yet.
>>58284085
Doesn't matter to my knowledge. Ask on some Mac developer forum. /dpt/ is too general.
>>58284104
>posting his patent pending, super skookum® code in a forum where the hacker known as 4chan goes.
That's just foolish.
>>
>calling making utilities ""programming""
>>
File: 1436275723531.png (285KB, 720x720px) Image search: [Google]
1436275723531.png
285KB, 720x720px
>tfw GNOME devs made a programming language
>it's the bastardized sibling of Java and C#
// Hello World in Vala
class Demo.HelloWorld : GLib.Object {

public static int main(string[] args) {

stdout.printf("Hello, World\n");

return 0;
}
}


>captcha: Ruby ROAD
>>
>>58283863
Why abstraction is a
>memory this gets memorialized on the internet for eternity to spread it's idea to others
?
>>
>>58284152
It's quite chill for when you have nothing better to do. Also any utility you implement now you won't need to implement during larger projects.
>>
>>58284127
>defun curry
found the pajeet
>>
is clojure worth learning?
>>
>>58284207
>JVM
No
>>
>>58283770
above 125 and c
>>
>>58283121
>>58283082
>>58283090
>literally wanting all your customers to install Java Virtual "Computer AIDS" Machine
not that the JVM is bad
but why the fuck would you want anyone to install additional shit
make you disgusting shit standalone ffs
>>
>>58283770
Never taken one, C++.
>>
>>58284236
>using a web browser with 4chanx and ublock to shitpost
>using an OS
muh
>>
>>58283770
>current year+1
>IQ tests
wew lad
>>
>>58284250
>4chanx
>ublock
I use neither of those
but nice try, goyim
>>
>>58284253
found the j*va brainlet
>>
should I learn Python on codecademy, datacamp, or learnpyhton.org?
>>
>>58284314
>
>>
>>58284314
>censoring the J-word
>>
>>58284322
>
>>
>>58284320
>should I learn Python
no
>>
File: Screenshot_2017-01-02_13-11-42.png (50KB, 679x526px) Image search: [Google]
Screenshot_2017-01-02_13-11-42.png
50KB, 679x526px
>>58284104
Working on bans. The backend is mostly done, so need the input forms, "USER WAS BANNED FOR THIS POST" rendering and a proper ban page now.
>>
>>58283111
>his

This is why we need feminism.
>>
>>58284077
Yeah man, I've seen a bit of Rust and it looks like C++ for hipsters.
>>
>>58283169
https://wiki.installgentoo.com/index.php/Daily_programming_thread#The_Image_Wars
>>
>>58283480
what was that extension called?
>>
>>58284492
Yeah because the wiki's on 4chan are super accurate and never biased in anyway.
Not that I'm not biased or anything. But they're not a definite source to point to at all. Hardly any editors and the ones that are there are not there for conveying accurate information.
>>
Atom
>>
>>58284520
At least it has a page for Terry Davis while Wikipedia don't.
>>
>>58283813
So... any ideas?
>>
>>58284589
Neural network that generate anime by reusing existing frames with different soundtracks and speech synthesis.
>>
which language should I start on functional programming?
>>
do you guys know where I can find myself a girl who wants to suck my dick while I'm working on writing applications in Haskell? Please don't suggest looking for guys
>>
>>58284846
C
>>
>>58284846
>>>/fpt/
>>
>>58284850
No such thing, but I bet there are plenty of faggots willing to do that even in this thread.
>>
>>58284850
haskell is like the ultimate chick repellant
>>
>>58284159
is it useful to learn ?
>>
>>58284927
This. Haskell makes you:
1) A computer nerd
2) A math nerd
3) A fanatic extremist
4) Unemployed

That's 4 times the women repellant of a regular programmer.
>>
I've gotten to the point where my anime program can find the groups with releases of currently airing series.
There are still some annoying corner cases to iron out, though.
>>
>>58284959
yes
>>
>>58284159
>this code is real

lmfao it's like a parody
>>
>>58284159
>every project invents its own language

WTF man, how can we replace C++ in this environment?
>>
>>58285014
Post code senpai.
>>
File: file.png (134KB, 1005x309px) Image search: [Google]
file.png
134KB, 1005x309px
Still working on my first real Qt application. Currently I'm struggling to find a way to deal with the huge number of QActions in my MainWindow class without going insane. I think I've settled on this abuse of lambdas to keep all the code related to a single QAction in the same place. It's not very object oriented, but OOP can suck a dick. Maybe I'll hate myself for this decision in the future. I'm definitely not going to resort to subclassing QAction though.
>>
I'm looking for a way to store lists of translations. Any suggestions?
I'm leaning towards a map with the name of the list as key and an array of 2-length tuples as its value.
>>
I have a general question about C.

I'm writing a program to solve sudokus and i'm unsure which way would be better to handle getting the co-ordinates, and some other aspects, of each square, when needed.

I can either calculate all the details before i need them, and store them for later or work them out on the fly.

My question is more or less:
Is it better to conserve the RAM or the CPU?
Or is there an easy way to determine which is best?
>>
>>58285417
Here's a Sudoku solver in Python: http://norvig.com/sudoku.html
>>
>>58285411
What kind of transformations?
>>
>>58285411
>>58285456
Oh nevermind, I misread

Yes, you could use a co-ordinate to represent a translation
>>
>>58285465
a point*
>>
>>58285211
sepples is stronk. divide and conquer
>>
>>58285456
>>58285465
>>58285471
FYI they're lists of JA -> EN translations for hiragana, katakana, kanji and common words.
Thanks, I'll use the map with arrays of points.
>>
>>58285014
What font is that?
>>
>>58285442
Cheers anon, i'll check it out.
>>
>>58285580
You might be able to use a trie
>>
>>58285387
How did you learn Qt?
>>
File: output.webm (1MB, 526x310px) Image search: [Google]
output.webm
1MB, 526x310px
Working on my terminal emulator and sixel stuff, managed to further improve performance of the player and sixel rendering.

Now trying to make an mpv vo for sixels, which will never get merged because wm4 doesn't like terminfo or "stupid" terminal shit.

The first naive try is way slower in mpv for some reason, probably because the hashmap implementation I'm using there is shit.
>>
File: 1479984241978.jpg (134KB, 807x935px) Image search: [Google]
1479984241978.jpg
134KB, 807x935px
Employed Haskell programmer reporting in
>>
>>58279797
Fucks sake. Why can't you just use stdin of the father?
>>
>>58285721
Teach me how to Haskell. How do I learn?

Give me some good projects to do in Haskell.
>>
>>58285655
Care to explain why you would want to use a trie instead of a map with arrays as values?
>>
>>58285744
up +
haskell or lisp?
>>
>>58285761
It's probably not worth the effort desu
>>
>>58285794
>up +
What?

>haskell or lisp?
Haskell
>>
File: maki-good-news.jpg (156KB, 720x720px) Image search: [Google]
maki-good-news.jpg
156KB, 720x720px
>reply to and upvote this post or your mom will die in her sleep tonight

I want Java normies to leave
>>
>>58285808
up cause I wanna know too
+ "haskell or lisp" question
>>
>>58285820
Damnit maki
>>
>>58285692
Just messing with it on and off for the past few years, I guess. I also found it pretty useful to read through other large Qt programs to get an idea of how to structure my own. https://github.com/KDE has a lot of projects of various sizes to read through, though a lot of them use KF5 classes.

I don't think I've "learnt" Qt yet though. This is the furthest I've gotten with a non-toy Qt application and I'm still not sure I'm experienced enough with Qt to finish it.
>>
I don't get the Big-O notation.

why is the get of hashtable O(1) while the get of linked list O(n)?
won't the hashtable iterate and look for a matching hash so it should be O(n) as well?
what's the difference here?
>>
File: maki-this.jpg (111KB, 1024x768px) Image search: [Google]
maki-this.jpg
111KB, 1024x768px
Thinking of creating an Binary Options app to get those extra shekels from the goyns.
>>
>>58285721

Yes, but are these two qualities related? That is, is it your job to write Haskell programs, or are you merely a Haskell programmer who is employed as a McDonalds fry cook?
>>
File: CryingWojak.jpg (55KB, 500x500px) Image search: [Google]
CryingWojak.jpg
55KB, 500x500px
>>58285891
>>
> trying to upgrade kde linux software from source

FML
>>
>>58285593
looks like terminus
>>
>>58285881

Hash table average case O(1), worst case O(n) or O(log n) depending on how the buckets are implemented.

A hash table is implemented as an array of "buckets". Each bucket may have some sort of data structure in it for storing objects with the same hash. When you do a lookup, you run a hashing function on the key, which results in a number between 0 and the number of buckets. You use this number on the array of buckets. This takes O(1) time. If the bucket is empty, then there are no elements with that key in the hash table. If the bucket has one element, then you can fetch it in O(1) time and return it. If the bucket has more than one element, then the worst case time complexity of the hash table is spent to find the element.

A well designed hash table will have few hash collisions (multiple elements having the same key) and re-hash every so often. As such, the overwhelming majority of elements will be found in O(1) time. Therefore, we conclude that it has O(1) average case time complexity.

>>58285910

:3
>>
Can anyone recommend a decent python bootcamp? Not interested in web development. Would consider powershell.

I would prefer the bootcamp be in a classroom as opposed to virtual. Could be there for a couple of weeks,,, maybe a month
>>
is there a python module for this?

> 98%[======================================================> ] 110,54M 2,06MB/s eta 1s
>>
>>58286012
just read a book
>>
>>58286013
https://github.com/WoLpH/python-progressbar
>>
>>58286085
thanks
>>
What do I need to learn in order to create desktop applications in C++ for Windows?

I have an Arduino project going that I'm trying to develop a program/application for which monitors the data being fed into it
>>
>>58286022

Sorry, no time for Python books,
>>
File: output.png (2KB, 572x116px) Image search: [Google]
output.png
2KB, 572x116px
import sys
from datetime import datetime

numbers = [ [ [" -- "], ["| |"], ["| |"], [" "], ["| |"], ["| |"], [" -- "]], [ [" "], [" |"], [" |"], [" "], [" |"], [" |"], [" "]], [ [" -- "], [" |"], [" |"], [" -- "], ["| "], ["| "], [" -- "]], [ [" -- "], [" |"], [" |"], [" -- "], [" |"], [" |"], [" -- "]], [ [" "], ["| |"], ["| |"], [" -- "], [" |"], [" |"], [" "]], [ [" -- "], ["| "], ["| "], [" -- "], [" |"], [" |"], [" -- "]], [ [" -- "], ["| "], ["| "], [" -- "], ["| |"], ["| |"], [" -- "]], [ [" -- "], ["| |"], ["| |"], [" "], [" |"], [" |"], [" "]], [ [" -- "], ["| |"], ["| |"], [" -- "], ["| |"], ["| |"], [" -- "]], [ [" -- "], ["| |"], ["| |"], [" -- "], [" |"], [" |"], [" -- "]]]

def print_number(n, sep="."):
"""
Takes a list of 4 numbers from 0 to 9, and a seperator, which defaults to '.'
"""
if len(n) < 4:
print("error, print_number takes a list of 4 numbers from 0 to 9")
sys.exit(1)
else:
for number in range(len(numbers[0])):
print(numbers[n[0]][number][0], numbers[n[1]][number][0], sep, numbers[n[2]][number][0], numbers[n[3]][number][0])

def get_current_time():
current_time = datetime.now().strftime("%H:%M")
x = current_time.split(":")
h1 = int(x[0][0])
h2 = int(x[0][1])
m1 = int(x[1][0])
m2 = int(x[1][1])
time_list = [h1, h2, m1, m2]
return time_list


if __name__=="__main__":
print_number(get_current_time())

image the numbers list being formatted in a nice way.


I did the 145th /g/ challenge thing, a ascii digital clock
>>
Anyone able to give me a little help?
I'm looking for a way to execute a python script with arguments from Java.
I built myself an Arduino shield for playing Commodore sid files from here https://github.com/atbrask/RealSIDShield.

The arduino basically functions as an emulator for the C64 CPU and passes instructions to the sid chip.
Anyway, it uses a python script to communicate with the arduino over USB.

I have no experience with python and my Java's fairly rusty.

I basically need to call the script like so
python "script name(I assume I need the full path)" "Com port" "Sid file(again I assume I need the full path)"
I also have the option to use -s to select a track if the sid file contains more than one.

It's working fine from the command prompt but it's a bit of a pain to type in the directories every time, especially as the HVSC directory is a bit of a clusterfuck.

I basically want to have a small java program that'll let me open a file explorer to select the file I want to play and then just hit play.

So, is there any way to run a command prompt from java and then run the script?
>>
>>58286147
https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#exec-java.lang.String-
>>
Reminder that if you're using a dynamically typed language in 2017, you're a failure.
>>
>>58285920
Gentoo does not have this problem.
>>
>>58286111
Best to use a node server and have the arduino send it wirelessly via HTTPS with an ESP8266
>>
>>58286111
>c++
>windows
When you say desktop application do you mean a GUI?
>>
>>58286358
Yes.

I've got an Arduino with an NFC shield that scans tags, and I want to write the data onto a .csv file and send it to my PC over the USB cable that's plugged into the Arduino. The Application would then import the .csv and process the data.
>>
What is the biggest mistake in the history of programming language design and development?
>>
>>58286470
GUI
>>
>>58286470
Java, JS, C++, VS, C#, etc
>>
>>58286434
>over the USB
Yeah that's gonna be serial data. So what you want is either to learn winapi and interface with your com port that way or find a library that does it for you.
>>58286349 Is a perfectly valid suggestion. ESP8266 is easy to work with and being able to network interface with a device is far far more convenient and very often HTTP requests are better supported than serial data nowdays.

>GUI
I only have experience with QtGui.
>>
>>58286187
Cheers, that's working.
Just one more thing.
When java does that command, I assume it runs in the background somewhere.
The python script usually keeps going until I either close the command prompt it's in or load the script again.
How do I kill the process in java?
>>
>>58286480
>>58286488
Incorrect, the biggest mistake in history is the keywords "true" and "false" not having the same amount of letters.
>>
File: fvf.jpg (119KB, 800x790px) Image search: [Google]
fvf.jpg
119KB, 800x790px
What's the best way to draw an oval?
>>
>>58286141
GOOD JOB

Finally someone actually programs something
>>
>>58286524
https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#destroy--
>>
>>58286141
You are retarded, to be honest.
>>
>>58285820
>>58285885
Makiposting should be a bannable offense.
>>
>>58286500
The device would be sitting next to the host PC - transmitting wirelessly seems a bit overkill, doesn't it? I have a two week deadline, so I may not have time to buy the parts needed.

>Learn winapi and interface com port
So that would be interpreting data from the Windows side. How would I actually send the data over the serial port on the Arduino side?
>>
>>58285862
Thanks for the response.
>>
>>58286588
>How would I actually send the data over the serial port on the Arduino side?
I haven't looked into how to transmit data 'properly' that but there's https://www.arduino.cc/en/Serial/Print that'd work for your usecase.
Build your csv file as a long string and just print it out in chunks.
Or build your csv file in chunks and print it out.

I'm a bit surprised you don't know about the serial.print though. It's how I debug my arduino programs all the time.

>learn winapi
I'd look for libraries first. Winapi can be very cruddy in places and I don't know if com ports are one of those.
>>
>>58286633
I know very little about Arduino, so sorry in advance if this sounds retarded:\

I thought Serial.print() was just to send messages to the Serial monitor. Where do the Serial.print() commands go, if they're transmitted over the USB cable?

I've looked into using Serial.write(), but the syntax isn't explicit about where the data is sent. I'll be happy even if I can send one tag's worth of data over COM, I just need it to end up in a .csv file.
>>
>>58286696
Well serial communications is just that the arduino produces the serial data output on its transmit pin. Whatever listens at the other end doesn't actually matter. The serial monitor is just a program (just like the application you have in mind would be) that receives the data. I'm not sure how windows deals with multiple listeners, perhaps that works, but your application would do something very similar except it would just write it to a file rather than printing it to screen.
serial.write seems more approriate.
It just takes a pointer to the data you wish to send and then how much you want to send. serial.print is for sending ascii symbols specifically.
There's no actual difference but with serial.print you need a null terminated string to send. With serial.write you can just take the pointer to where you store your values and straight up send them. Process them to CSV at the receiving end maybe. I'm not sure what you'd prefer there.
>>
>>58286633
>>58286696
If I understand correctly, I need to write a program (which runs on the PC) that reads the serial data being sent from the Arduino to the PC using Serial.print() or Serial.write()?

For example:
void setup(){
Serial.begin(9600);
}

void loop(){
String data = "example"; //Variable that stores data which we want to send to the PC
Serial.print(data);
}


And then the program on the PC would read the serial data, and extract the contents of the 'data' variable?

>>58286775
>Serial monitor is just a listener
I understand now. I know you mentioned that windows might not like multiple listeners, but would it be possible to listen for what's being sent and write it to a file? I just need to know if it's possible to read the serial data being sent, and then write it to a file.
>>
File: maki-what.jpg (23KB, 500x281px) Image search: [Google]
maki-what.jpg
23KB, 500x281px
>>58286582
Your mom should be a bannable offense.
>>
>>58285820
I want you to kill yourself.
>>
File: maki-blushing.jpg (59KB, 1280x720px) Image search: [Google]
maki-blushing.jpg
59KB, 1280x720px
>>58286889
rude
>>
what's her favorite language?
>>
>>58286823
>If I understand correctly, I need to write a program (which runs on the PC) that reads the serial data being sent from the Arduino to the PC using Serial.print() or Serial.write()?
Yes. When you call serial.print/write it sends some serial data. We've got that end finished basically. We just need to know how to receive it.
And I only pointed to windows API because I know most operating systems do support serial communications

>but would it be possible to listen for what's being sent and write it to a file?
Yes it's all possible anon. Serial communication works. But you'd have your application recieve the data and THEN write it to a file. I doubt you could tell windows to write all serial data on a port to a file directly.
The question is really just what's the most neat/simple way to do this.
https://github.com/wjwwood/serial
is a random serial communications api I googled. Can't attest for its quality. But I'd say you should try something like this before you try winapi. Winapi is more low level and is likely to be fairly specific and have details you don't really care about.
This library seems to make it all rather simple looking at their example:
http://wjwwood.io/serial/doc/1.1.0/serial__example_8cc.html
Alternatively we could just use this arduino guide I found:
http://playground.arduino.cc/Interfacing/CPPWindows
It could be a bit more simple as the other api we have requires you build it with cmake, which I assume you have no familiarity with.
So even if the code looks a bit more complicated it's probably simpler overall.
>>
File: maki-pepe.png (122KB, 640x890px) Image search: [Google]
maki-pepe.png
122KB, 640x890px
>>58286950
makine language
>>
>>58286956
I found a program that solves my exact problem, called CoolTerm: http://freeware.the-meiers.org/

The only issue is I can't use that program, I have to create that program's functionality myself and implement it into my own code.
>>
>>58287095
Yeah.
http://playground.arduino.cc/Interfacing/CPPWindows
Doesn't look at all far off though.
All you need to do is change the "printf("%s",incomingData);" in their main.cpp to a fprintf.
>>
File: 1482947570434.jpg (144KB, 750x1334px) Image search: [Google]
1482947570434.jpg
144KB, 750x1334px
>>58284127
Name the 6 best rappers in the world.
>>
>>58279809
You said you wanted to learn Scheme, you fucking liar.
>>
>>58287126
That looks promising, thanks a lot anon.
I'll report back on how things go soon
>>
>>58287231
No problem. Please do. It's interesting to see projects develop.
>>
>>58286470
Alan Turing
>>
>>58286470
>>58287617
Specifically the turing machine.
Vastly inferior, uglier and shittier than the lambda calculus.
>>
File: autism.jpg (54KB, 514x536px) Image search: [Google]
autism.jpg
54KB, 514x536px
>>58287617
>>58287635
>>
>>58287635
this.
i'm the guy who created lambda calculus by the way
>>
>>58287735
You know it's true.
>>
>tfw work uses a nonstandard build system and you're not allowed to move to a better one
>>
learning c++, and i just wanna know: can i use 'using namespace std' or should i just not do that? people say it's bad practice to do that because there could be potential overlap or lack of readability, but everywhere I'm learning it from just uses the std namespace. should i get into the habit of it or am i good for now?
>>
>>58287798
>because there could be potential overlap or lack of readability,
you can narrow it to names you actually want to use like this

 using std::cout; 
>>
How likely is it that a programmer is also an anime faggot?
>>
>>58287864
100%
>>
>>58287792
>Lambda calculus
>Has nothing to do with calculus
It can never be true.
>>
File: lena_lineart.png (122KB, 512x512px) Image search: [Google]
lena_lineart.png
122KB, 512x512px
>>
>>58287864
95%
>>
>>58287893
>>Has nothing to do with calculus
It's a calculus
>>
File: 1474130162951.png (496KB, 713x781px) Image search: [Google]
1474130162951.png
496KB, 713x781px
>>58283770
>IQ
Never taken an IQ test and don't plan on doing so anytime soon.
>Favorite language
I don't have a favourite language. I read and write in any language I have to to get the job done. I probably write more C than anything else though.
>>
How come there isn't anything as A E S T H E T I C as templates in other languages?

template<class T, class = std::enable_if_t<std::is_integral<T>::value> >
T average(T a, T b)
{
return a/2 + b/2 + (a%2 & b%2);
}
>>
>>58287842
thank you!
>>
>>58288016
Templates are fucking shit.

Haskell signature:
averageI :: Integral t => (t,t) -> t
>>
>>58288105
>I see your <>:: and raise it with by ::=>
fucking disgusting
>>
>>58288105
>haskell
>abstracted primitive types
lol
Enjoy your slow code.
>>
>>58288016
>class = std::enable_if_t<std::is_integral<T>::value>

it's a thing now?
>>
>>58288126
If the compiler knows which version you're calling, it can quite easily generate template instances like C++ would.
It can unbox too.

In an extremely simple example like that, I imagine the code would almost be exactly the same for the Int instance.

>>58288120
>template<class T, class = std::enable_if_t<std::is_integral<T>::value> >
is beautiful
>Integral t => is disgusting
>>
>>58288185
He creates an extra type parameter (he doesn't bind the name, like _ in a FP language) and if the template can't be instantiated it fails

>>58288120
>>58288195
Oh and when you eventually get concepts, it basically be that

template <Integral t>

And you'll have no excuse
>>
>>58288185
>>58288219

apparently C++14
>>
>>58288185
For the weakminded haskell user. This is similar to
template<class T>
T int_average(T a, T b)
{
static_assert(std::is_integral<T>::value, "you did an int average on non ints you dumb fuck");
return a/2 + b/2 + (a%2 & b%2);
}

Except with this method, you'd have to rename the function to do float average. At least I'd assume. I wouldn't expect the compiler to do checking like that.

I believe you can have another function with the same name but is_floating_point instead of is_integral with the original one. But I don't know, I haven't checked.
>>
>>58288364
if constexpr (std::is_integral<T>)::value {

} else (std::is_floating_point<T>::value) {

}
>>
alright guys, I want to start doing shit with my programming knowledge. Anyone have any guides and project ideas for making a simple firefox extension? I just want to make actually useful real world shit instead of doing exercises, and I have basic javascript knowledge(on top of java/ruby).
>>
>>58288016
>class =
>::value

what are these?

why?
>>
>>58288396
That checks it on runtime idiot
>>
Any Rust nigger out here? Why do I have to specify the array size? It should be a clever boy and figure it out by itself.
pub fn gojuuon() -> [(&'static str, &'static str); 2] {
[
("あ", "a"),
("い", "i"),
]
}
>>
>>58283770
79
Java
>>
>>58288515
>constexpr
Why are sepplesfags so stupid?
>>
This thread is pathetic. It is not about programming. It's just a bunch of computers illiterates and first semesters memeing about whatever they just learned.

A quick search shows that most arguments used here are not original and have been copied from some trendy tech blog or other shit site.

The only real programming questions I have seen so far are from beginners(it's fine to be a beginner btw).

This entire site is shit and I don't know why anyone would regularly come here.
>>
>>58288515
No. http://en.cppreference.com/w/cpp/language/if#Constexpr_If
>>
>>58288549

I've just realised.
It's because if they actually understood their language, they wouldn't be so zealous.
>>
>>58288535
Because an array's size is part of its type.
>>
>>58288624
>>58288549
> their language

what language do you use/recommend?
>>
>>58288535
It does within functions, e.g.
let x = ["foo", "bar"];
works. However, function parameters and the return type have to be written explicitly. Since the size of an array is part of the type, it has to be declared too.
>>
>>58288638
The only reason to use C++ is performance and explicit memory management.
>>
>>58288668
that doesn't answer the fucking question
>>
>>58288687
It depends what you want.
For a general purpose language I would recommend Haskell.
>>
>>58283032

I'm implementing kind of a proof of concept LFSR arrangement

I think x86 has a instruction for roll like the 8080 had back in the day that would be useful for this (isn't it called ROR?)

how can I use it in C++ to rotate an unsigned int?
>>
>>58288668
what about Java?
>>
>>58288638
use whatever gets the job done senpai
>>
>>58288698
>>58288687
You are being memed. JavaScript is the best suited for the task.
>>
>>58288704
What about Java?
>>
>>58288535
Because the 2 is a part of the type and there's no way to pass that is as a type yet. Use Box<[T]> or Vec<T> and then you can omit the length.
>>
>>58288722
is it still better than C++?
>>
>>58288636
>>58288654
>>58288732
Makes sense, thnx.
>>
Postee le chalenge sheet pls
>>
>>58288746
Java is still worse than C++, which is a remarkable achievement.
>>
File: torvalds_c++.jpg (265KB, 1211x1210px) Image search: [Google]
torvalds_c++.jpg
265KB, 1211x1210px
>>58288668
>>58288396
>>58288364
>>58288016
>>
>>58288782
http://harmful.cat-v.org/software/c++/
>>
>>58283391
I make Guitar Generals like twenty posts early sometimes, nobody gives a shit.

Difference audience, though.
>>
>>58288782

>Leenus Memevalds = god ecks dee
>>
>>58288797
>Alternatives:
> * C
> * Go
> * Throwing yourself into an active volcano.

jej
>>
>>58283770
134. C++.
>>
>>58288774
>Java is still worse
not worse to learn or use

just worst if you're an autist I guess
>>
>>58288746

You'll have way more fun doing c++ and learn a lot more

you can performance whore on c++, use assembly, implement bitwise hacks, write a DDR ram driver, program the firmware for a 8 bit micro or a straight up DSP, make a serious video game, use OpenGL without shitty java bindings, use pointers, make kernel calls

it's immensely more powerful than java. Java's real advantage is doing boring shit like apps and boring ass business infrastructural software
>>
>>58288797
Considering the author became an hero, how much longer will that site stay up? Who even owns it at this point?
>>
>>58288868
im pretty sure some guy on #cat-v on freenode owns it
>>
>>58288857
pure C will always outperform C++

most people just want to code useful apps instead of sperging out with that super low level stuff

again, most people, not autists
>>
>>58288934
The extra type information in C++ can be used to perform optimizations that a C compiler cannot.
>>
>>58288934
>Java is better than C++ because C is better than C++
???
>>
>>58288961
t. Haskell programmer
>t-the compiler will surely optimise this!
>>
>>58288997
He's saying that if you need performance, use C, otherwise Java is a better choice than C++ because we've already established that you don't need performance.
>>
>>58288961
nope

https://benchmarksgame.alioth.debian.org/u64q/c.html
>>
>>58289013
Java is less expressive than C++, though. And even if C is capable of producing slightly faster programs than C++ doesn't mean that you can't care about performance and not use C.
>>
>>58289013
No, Java is trash, just like C++.
If you don't need performance, you should be using Haskell.
>>
>>58289033
>Java is less expressive than C++
This is false, they're both Turing-complete
>>
>>58288997
if you want safety, easy reuse and maintainability then Java is superior

if not, or you need to play with the low level stuff >>58288857 mentioned, stick to C (it's not gonna overwhelm you to learn it anyway)
>>
I've set the command prompt pathway to the C:\Program Files (x86)\CodeBlocks\MinGW\bin

I've been trying to figure out how to compile to source files and use extern to change the value of a variable in the main one.

#include<stdio.h>

int i = 5;

int main(void)
{


printf("%i", i);


return 0;
}

#include<stdio.h>

void foo(void)
{
int x;
extern int i;
x = i *5;

printf("%i", x);


}

command line:
gcc 1.c 2.c -o dbtest


I'm using windows os, does this only work for linux or what am I doing wrong?
>>
>>58289020
>badly-written C++
>>
>>58289049
he said less expressive, not less powerful
>>
>>58289049
It's easier to write what you want in C++. In Java you often have to jump through hoops.

>>58289054
>safety
C++ has RAII, Java doesn't.

>easy reuse
C++ has multiple inheritance and more powerful generics through templates.

>maintainability
FactoryBeanBuilderSingleton
>>
>>58289061
>implying

in fact it's stripped down to almost bare C to be somewhat competitive

the people who optimize that code know what they're doing but you're welcome to try too
>>
New Thread When?
>>
>>58289020
>fannkuch-redux C gcc #5 program
>Based on the Ada program

>fannkuch-redux C++ g++ #4 program
>based on Java 6 source code
>>
>>58289020
benchmarksgame is shit senpai
>>
>>58289073
>C++ has RAII, Java doesn't.
Java has GC which removes the need for RAII.
>>
>>58289110
Point is, "the people who optimize that code know what they're doing" is clearly wrong. They don't even write their own code short of translating from one language to another.
>>
>>58289129
For memory, yes. For other resources where timely and orderly freeing is necessary, no.
>>
>>58289054

you sound like you fell for Java's marketing

> muh reusability
> muh conventions
> muh readability

An important lesson: it's all bullshit
>>
>>58289110
>>58289131
nope, what it means they took the algorithms and re-implemented it in other languages

again, you're welcome to try to improve it and get your due credit

anyone googling your name will find out that you're such an ace programmer
>>
new

>>58289160
>>
>>58289144
>it's all bullshit
you know what's bullshit? spending years learning C++ while you could master Java in months
>>
NEW THREAD

>>58289196
>>58289196
>>58289196


>>58289163
fucks sake, was waiting the cool down to post
>>
>>58289181

If you are gonna be a programmer that's what you should do
>>
new thread
>>58289160
>>
NEW THREAD

>>58289196 (You) (Cross-thread)
>>58289196 (You) (Cross-thread)
>>58289196 (You) (Cross-thread)
>>
>>58289227
>implying programmers don't have other shit to learn

I respect people who can master C++ AND other areas but I really think they have autism
>>
new

>>58289196
>>
>>58289284

Why fuck around? I'm gonna try to be the best instead of playing with a brainlet language
>>
>>58289309
wait, I don't advocate python
>>
>>58284846
Scheme is the gentlest one I guess and once you know it you can learn racket in few hours.

Or haskell if you are that badass.
>>
>>58285820
mods?
>>
>>58289519
I learned Bash, then Python, then Haskell.

Scheme I dipped in and out of along the way as, like you say, it's very gentle.
>>
File: Untitled.png (18KB, 300x100px) Image search: [Google]
Untitled.png
18KB, 300x100px
>>58286570
Thanks again, It's all done now.
One problem with the python script is that when you kill it the SID chip remains in the state it was in. So basically, when I hit stop and the process ends, the SID keeps blasting out whatever note it was on.

I'm going to try and find a sid file that just contains silence and have that load and then kill the process when I hit stop
>>
>tfw you stop caring that your code is a mess and you start actually getting work done
Thread posts: 336
Thread images: 33


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.