/dpt/ - Daily Programming Thread

Deprecated: What are you working o-
Oh who am I kidding, this is just SQT v2.0

Other urls found in this thread:

youtube.com/watch?v=wKl6umkwKfU
en.wikipedia.org/wiki/Foobar
catb.org/jargon/html/F/foobar.html
en.cppreference.com/w/cpp/language/operator_alternative
stackoverflow.com/questions/13061979/shared-ptr-to-an-array-should-it-be-used
insightdataengineering.com
sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/
better-dpt-roll.github.io/
linuxmafia.com/faq/Kernel/linus-im-a-bastard-speech.html
en.chys.info/2009/09/esdelay-ncurses/
twitter.com/SFWRedditVideos

Finishing off chapter 7 of The D Programming Language.

Kill yourself degenerate weaboo.
Next time wait for bump limit.

>learning obscure programming languages without being required to

Why so butthurt?

Learn to count user.

Pure autism

feelsgoodman.webm

Both threads are cool.

I want to compile 64-bit C code with Emacs.

Does this look like the correct file to download?
emacs-25.1-x86_64-w64-mingw32.zip

It has "mingw32" and "w64" which seems like mixed signals.

you need a compiler
emacs is can integate into your build system

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA).

Emacs is not a C compiler.

Please, don't bully.

Thank you for using an anime image.

Mingw is a compiler though.
Clearly, having Mingw in the name implies that Mingw is inbuilt, I just don't know which architecture because I'm shit at interpreting filenames.

or it does mean that it has been compiled with mingw.

MinGW isn't a compiler. MinGW stands for "minimalist GNU on Windows". GNU also isn't a compiler.

first for c++

%:include
int main(){
int bar;
int foo, baz;
bar[2:> > bar

the bump limit is 310 kill yourself

>k-kill yourself
Cry some more, subhuman autist

>/dpt/ - Daily Programming Thread
>let's tell each other to kill their respective selves and cry about bump limits
is this /kindergarten/?

It's a great reflection of both Silicon Valley and Flyover programmers.

kill yourself

is there any class or language resource in GHC to get the name of a data type, kinda like
maxBound :: Bounded a => a
doesn't need a variable, just the data type, I'm looking for something of the kind
show' :: Show' a => String

to instantiate Show (IO a) like
Show (IO a) where
show _ = "IO " ++ show'

sure is reddit in here fuck off and die pathetic sperglords

>All this whining not related to programming
This is now maki thread!

You want to see whining?
Well I don't know why since no one's ever told me, but everyone hates me when I post this image.
Apparently it has something to do with ponies.

lmao

what is the generally good for? random stuff generators?

YOU GOT THE MOTHERFUCKING SHELLS

IT'S GOOD FOR STANDARD I/O

> tfw you get stuck on something very silly because you're a newbie
> get help from IRC/Stack Overflow/...
> feel like a idiot for a short while, but learn something new

programming 20+ years ago, when you were pretty much stuck with a book for help, must have been awful.

most people who were into programming back then weren't sub-110 IQ normies

> tfw you get stuck on something very silly because you're a newbie
> try to get help from IRC/Stack Overflow/g...
> get called idiot because you're a newbie
> feel like an idiot for a short time, but then find it out by yourself

FTFY

>tfw you're a 116 IQ moron
phew I'm safe

how can I test only sections of my program in C++?

is there a way to create a template for an three-dimensional [9][9][9] array, so i do not have to create the syntax all by myself?

Y'all have got to stop using commas it fucks up my JSON parser big time

youtube.com/watch?v=wKl6umkwKfU

JSON without comas?
wut?

I organize the JSON the Cred Forums api sends me by saving it as String then splitting by comma
If one of you uses a comma in their post it fucks up myline system big time

ooh that makes sense haha.
Why not be lazy and use some JSON parsing library instead?

Are Eastern European (including Russian) programmes better in the long run?

what makes you think so?

I'm a big boy that doesnt need libraries
I guess I'm going to need to revamp the system and split by { or something
Why the hell does the Cred Forums api include commas like that anyway seems pretty stupid to not just replace them with some code

wow, what shit language are you using that doesn't even have a JSON parsing library?

It's mainly because of Pajeets dominating the programming industry, and me having a distrust for them.

> doesn't need libraries
> splitting by commas instead of writing a parser

shot in the dark here but maybe try actually parsing json instead of splitting by comma

Java to be honest
Didnt know there was a JSON lib in the standard lib xDDD
Iguess I'm retarded

dunno. here in central europe, programmers are mostly local, as few are bothering to learn dutch or french to work here.

is there a way to create a multi-dimensional vector?
what would be a multi-dimensional iterator?

vector < vector < vector < vector >>> foo;

Testing what?

,{,},{foo,};;{,:

who came up with foo and bar as default placeholders?

I got the comma thing to work..somewhat
but it's pretty wacky

en.wikipedia.org/wiki/Foobar

ayy lmao'); TRUNCATE TABLE threads; --

catb.org/jargon/html/F/foobar.html

Use a JSON parsing library, you dumb faggot.

parsing json is fun exercise why would you prevent poor user from learning?

kek, don't think Cred Forums would have made it this far if they didn't sanitize their inputs fampai

It wasn't for Cred Forums; it was for potential dumb anons that are storing information from the APIs.

>be a Pajeet and use libraries although you could learn how to do it yourself
thanks no

why is JSON used again? all my string operations worked fine out of a normal .txt file.

How on earth do you parse formless text?

It's an structured data standard that easily maps to objects or data structures in most languages.

What would your alternative be? Computers need "hints" as to what they are looking at, and JSON provides structure to tag objects, store ordered data, and nest concepts within other concepts in a hierarchical manner.

ah yeah haha. but who would use a sql database for their autistic single-purpose Cred Forums browser app?

r8 my Cred Forums namefag name generator

[data]#include
using namespace std;
#include
#include
#include
#include


int main()
{
srand(time(NULL));
int first = rand() % 9;
int second = rand() % 9;
int third = rand () % 9;

cout

The last full-featured JSON library I used was well over 100,000 lines.

Good luck.

great formatting skills

fuck

r8 my Cred Forums namefag name generator

#include
using namespace std;
#include
#include
#include
#include


int main()
{
srand(time(NULL));
int first = rand() % 9;
int second = rand() % 9;
int third = rand () % 9;

cout

its worthy of pol

>not using a list of current countries from a public academic API
>that anemic adjective and noun list

1/10, at least put some effort into it.

jesus christ, you sure you don't mean 10,000? if not, you're confusing "full-featured" with "bloated as fuck"

When I said JSON parser i didnt mean that I was going to write a whole new one, just one that can deal with what the Cred Forums api, which wasnt all that hard pic related

you too :3
that list of countries list is a good idea. i need demonyms, though.

its difficult to find suited nouns, unless someone makes a list of Cred Forums memes

you know what i fucking hate?
dumb shits parsing context free languages like regular ones.

whats the difference between compiling and parsing?

Ok guys, tell me, why doesnt my script get terminated after i get exit status 1 after certain command?
Basically, it should not echo "hello world". Yet it does.
#!/bin/sh

set -e
set -o pipefail

$((1/0))

echo "Hello world"

that's not a json parser, or even a parser. also there's a lot of ways the content of a post can break that

>that's not a json parser, or even a parser
Really? It takes a (albeit specific) json input and gives me usable data

>there's a lot of ways the content of a post can break that
You have a example? I tested it on several threads and atleast didnt get any errors

I've written a JSON implementation, including a hashmap in C with only a few hundred SLOCs.
There is no possible way that it could be 100000 lines long.

Ain't that hard, friend.

As for the nouns, you could just parse various Cred Forums threads and use a natural language library to pick noun parts of speech, and then determine the meme-iest of them.

"com" : "com", "com" :
\"com\" ,"\"com"""\" :

Well, found a reason:
if you "bash a.sh", then set -e gets ignored
If you "./a.sh", then it exits with 1 properly and terminates immediately after encountering first exit status 1

Here's an example of the natural language analysis I've used.

This is getting deprecated.

Why do shared_ptrs not work w arrays?

what the fuck is this even?

trigraphs are like ??) (?? but not digraphs
Thats perfectly valid c++ (for now), google digraphs and trigraphs

Does this break Cred Forums's tag parser?
#define code 12

int myfunc(void) {
int arr = { 0 };
return arr[24/code];
}

en.cppreference.com/w/cpp/language/operator_alternative

They do though?

How do you get them to work then

Best C++ IDE? Preferably something lightweight

Well what did you try and what's your problem?

They do by default. Just copy paste code
and try it

i think for msvc you need to include cs616 or something

I dont mean the array container
Maybe theres something wrong w my code brb

Something like what was posted in this thread:
stackoverflow.com/questions/13061979/shared-ptr-to-an-array-should-it-be-used

dont forget to mix and match for added confusion

int arr[];
int arr;
int arr;

why not use std::array instead?

How does one authenticate a user by HWID in a way that's not crackable in 5 minutes?

The way I'm doing it right now is making a libcurl http request to a php script on my server with the useragent equal to the encrypted HWID. The script then checks if that HWID is valid and if it is, gives a response of a pseudorandom base64 number that returns true when passed through a function in the program.
Is this even safe?

Help.

is there a fast way to print out my stack and free stack size?

>How does one authenticate a user by HWID in a way that's not crackable in 5 minutes?
you don't

No idea what this is

When you read the cookbook, you parse it.
When you cook, you compile it.

Based on that user who was writing that shitty Cred Forums name generator, I took 10 minutes and wrote a racial slur generator in her honor.

Uses an API of current country demonyms, and scrapes the Racial Slur database's slur table, and pairs random countrymen with random slurs.

Need to iron out a few kinks. Or chinks.

So the main purpose of creating objects on the heap is having large, globally accessible objects?

If I close my program without clearing the stack, the objects created will still rot on my RAM?

Is Qt difficult? I don't want to make anything super fancy but want to make some gui stuff in C++

>*clearing the stack
clearing the heap

no, when you close the program, all memory your program was using is reclaimed by the OS.

Anyone us TypeScript here?

2.0 is just out. I might start fooling around with some TS based projects..

It's not, if you're not already familiar with Qt I suggest you learn QML for UI instead (It's part of Qt, but it's much nicer to create interfaces with QML becaue it's much more powerful and less annoying to work with than UI forms although Qt Designer is somewhat good too).

i would say, when you cook you run it

>American Whopper
kek

Going to wrap this in a GUI and open source it.

I wonder if GitHub will ban me for it.

Then how can a memory leak appear?

how do anti virus scanners recognize new viruses?

do they run an algorithm for similarity in code?

by not closing the program. memory leaks refer to your program using more any more memory unessesarily the longer it runs

memory leaks occur during program execution. Like when older versions of firefox ate 4GBs of ram..

>Zimbabwian Pipe Blower
Also yes, github is SJW central. I'm sure they will ban you.

they have virus definition files they update all the time. Some Windows Update updates are virus definition files

memory leaks are easily avoidable especially in java but what happens in a memory-leaking program it keeps using more and more memory while it's running but once you shut it down the memory gets reclaimed by the OS

they compare a file's hash with their database

Also, there's the issue that your operating system may not necessarily reuse the memory; most modern ones do, but the one you're developing for may not (or, also, if you're designing an operating system itself, I assume)

ah, okay. and the purpose of the heap is still to create globally accessible variables.

and why doesnt c++ manage the memory as well? it is not difficult to integrate an automatic garbage collector, given how memory management can be summarized by a single line

delete(stuff)

Crosscompiling with cygwin on Bangdows

should i learn Scala if i want to get a job?
I'd say I'm average skilled.

Im just in it for the $

its much more complex than that. Also garbage collector has big overhead

you should email bjarne

Please stop suggesting garbage collected C++. It triggers me. You might be interested in smart pointers though.

Garbage collection involves a lot of over head. Worst of all, it causes the entire program to pause every now and again while the GC runs. This is not good for a lot of applications.

scala is for data engineering afaik, and you need extra education for that

Do companies use Scala? Scala is a shit language anyways. If you just want a job learn Java. If you want a job with a good language, learn C#.

>If you just want a job learn Java.

>tfw this is the sad truth and all the beautiful languages out there are for enthusiasts only

>GC in sepples

>it is not difficult to integrate an automatic garbage collector, given how memory management can be summarized by a single line
>delete(stuff)
you're sorely mistaken, the entire point of using a garbage collector or your own custom allocator is so you don't have to delete stuff all the time, you do a cleanup all at once at appropriate times

I thought JAVA jobs are way saturated by rashid and habeeeb though

It's true.

Though C# is pretty employable and actually one of the better langugaes all things considered.

insightdataengineering.com

Yeah, but sadly, Rashid and Pajeet creating Java garbage apps creates an incentive for even more Java garbage usage, leading to more Java garbage jobs.

but as a C# dev you will probably start out making $40k if you're lucky.

40k euro (44$k dollars) is a normal junior wage for programmers in Europe.

Look up GSON

>mfw last job was €25k a year
>fired two years ago, unemployed since
fuck my life

No, when you eat you run it.

God dammit you kids are insufferable. And it's a Java shitter on top of it all.

>you will probably start out making $40k
Depending on where you live, that's quite nice for an entry-level position.

That same position would probably pay $70k+ if you're in a metro shithole like San Fran or New York.

Really, there's no point in even mentioning your's or anyone else's salary without specifying location.

thats so little $ though.

i want more $$

stupid sluts in HR make that much and they don't know shit about anything.

there are to ways to get lots of $$ in programming:

1. learn something hard, rare and needed
2. become more of a manager or sales executive than a codemonkey

otherwise, you will be stuck with an acceptable, but not phenomenal wage.

but i have no people skills. I could barely hold a conversation with random people because I dont actually care about most of the normie stuff.

I need help.

>i want more $$
Then you need to move into data warehousing and business intelligence.

It's an extremely unsaturated field, and it's growing rapidly in the mid-market right now.

in europe, business intelligence is mostly a quasi-monopolist company (SAP), which hands out certificates sparsely, so that sucks

Either learn to fake it or you're fucked.

I'm borderline psychopathic, but I've at least learned to reciprocate social cues that are expected, and act friendly and interested.

The #1 most important skill for getting money (reliably) is the ability to communicate and work with other people.

howd you do it?

please tell me, for the sake of those around me.

just don't be fucking retarded

people keep telling me that but I don't know what it means

Honestly? Working a shitty fast food job while I was in college.

I was able to figure out what the average customer appreciated as far as 20-second conversation goes, and listen to lots of interactions. I also had to learn to soothe and persuade basketball-americans to do their fucking job after I became a manager in my last years.

If you treat everyone like a "customer", whether a co-worker, family member, or boss, you can go quite a long way.

The following is not a meme: read How to Win Friends and Influence People by Dale Carnegie.

The biggest takeaway is to always put things in terms of what the other party wants.

I hope you aren't using windows you

wow, i could never work fast food. specially where i live, some people are fucking asses just because.

I'll check out those books. thanks.

It's one book.

just observe and try to mim8c. It worked for me, kinda...

Fucking religion, reeeee

CREATE FUNCTION dbo.GetEasterHolidays(@year INT)
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN
(
WITH x AS
(
SELECT [Date] = CONVERT(DATE, RTRIM(@year) + '0' + RTRIM([Month])
+ RIGHT('0' + RTRIM([Day]),2))
FROM (SELECT [Month], [Day] = DaysToSunday + 28 - (31 * ([Month] / 4))
FROM (SELECT [Month] = 3 + (DaysToSunday + 40) / 44, DaysToSunday
FROM (SELECT DaysToSunday = paschal - ((@year + @year / 4 + paschal - 13) % 7)
FROM (SELECT paschal = epact - (epact / 28)
FROM (SELECT epact = (24 + 19 * (@year % 19)) % 30)
AS epact) AS paschal) AS dts) AS m) AS d
)
SELECT [Date], HolidayName = 'Easter Sunday' FROM x
UNION ALL SELECT DATEADD(DAY,-2,[Date]), 'Good Friday' FROM x
UNION ALL SELECT DATEADD(DAY, 1,[Date]), 'Easter Monday' FROM x
);

Unit tests

SQL has such horrible syntax. Is there no decent alternatives?

mongodb

damn thats gross.
I feel sorry for you user, may god save your soul from that horror.

need a OCR cloud based api. Free or OS if possible.

I want to scan in documents and have read handwritten text into my program

this.

Tutorial D

>cloud based api
what

CDN

???

buzzwords user, buzzwords

Google Cloud Vision

you need to upgrade your buzz word packages.

what is "cloud based development", anyways?

the cloud is just a way to store data on accessible servers, isnt it? most of the data is stored this way nowadays,

yeah put your OCR on a CDN and SQL it to the cloud

wow thats pretty nice

but too much for my small project

know of any free alternatives?

any """"free"""" cloud-based service is a trap

what?

...

CDN

that's all he said to try to explain himself

>only doing things because you have to

>learning worthless meme languages when you could be out there getting experience developing real useful software in languages that matter

why cant you all be more like this guy? this guy saw past the buzz words and actually answered the questions. we could all learn from him

sadly, this actually means "use nothing but java"

how small is your project? Google offers 1000 queries per month

>only doing stuff that can bring $$, what sad life you lead...

How can you reply anything constructive to CDN? It could be 100 things... We have language for a reason

> learning to reinvent the wheel

>only doing stuff that can bring $$
thats the life of most americans tbqh
we dont even have paid vacation

very small, probably a few hundred of pages with about 100-200 characters per page

SQL is the industry standard for interfacing with relational databases, but you can do nearly everything in any language you want and only use SQL for menial tasks.

>using non-relational shit for anything but caching and other side components

sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/

why does it have to be cloud based? how do you expect it to be free, who's going to pay for the servers? do you know what a CDN is?

I think its good for input/output as the name and standard would lead one to believe

> female programmers

CDN content delivery network

Yeah, if you work for a shitty company.

I spend 3 weeks in Germany, and 2 weeks in Vegas and got paid the whole time. This doesn't include all the days I take off for personal things and other mini-vacations.

>CDN content delivery network
yes and how do you expect it to help with OCR?

I used to use purely the turing reference book in highschool, no google

not everyones as talented as you.

the same way Google geolocation works

>SQL is the industry standard for interfacing with relational databases
I know but.. something else would be nice...

so why is Access DB bad?

I'm not even that skilled yet.

I've only been out of school for a year, and am just now getting some experience.

You just have to find the right company.

PROTIP: Small companies don't have as many rules

Catch - it's really simple and you'll be able to tell if it's isn't good enough because of how easy it is to get going

a CDN delivers cached "static" information like a webpage or a youtube video. a CDN is not something you upload an image to and have it read the text for you.

Do you have a learning disability that you can't learn multiple languages? Once you know how to program it's really just syntax you have to learn.

if you had an attention span to learn even a single language properly you'd know that languages are more than just syntax

you should a compiler design class first, much more useful, learn about lambdas, data structures, algorithms, etc... . then learning languages are just syntax really.

you're a fucking joke dude

O.

isnt he right though?

Do you want specific examples?

The better question is "Why would you use Access DB over all of the other alternatives?"

get an education in CS. It's worth it in the long run.

You won't have to play catch up every time something new comes out.

Depends on what you mean by "he" and "right".

>learning metallurgy when you could be perfecting your stone working skill
copper is a meme, just use flint

no. for example someone who knows C, lisp, python, haskell isn't going to write GOOD java or C++ any time soon.

Why can't you just do 3D array or 3D vector?
The >'s should separated on the right side, otherwise your invoking the output stream operator

bait?

nice dunning kruger kid

what does that have to do with what he said?

read again.

Kek
So I should try to convert my Java facades or adapters in C? How about writing actual multithreaded code in python?

kill yourself retard

>you should a compiler design class first, much more useful, learn about lambdas, data structures, algorithms,


he said nothing about C, lisp etc.Idea is that programming != knowing java syntax and libraries. Former is much more difficult than latter

noob here

what does multi-threaded even mean?

buzz words

uneducated code monkeys.

More than one thread.

Bing it.

God C++ is such a hideous abomination of a language. Just stick with C user. Or some other language if you really must OOP

Concurrency

>i've "learned" a dozen shitlangs and it doesn't matter that i can't use any of them particularly good because i'm "really good" at the "programming concepts"

jackass

Running several pieces of code simultaneously.

>not Yahooieing it

>God C++ is such a hideous abomination of a language

i heard that about every langauge in existence by now, lel

Talk to me family. Teach me. How does syntax teach you all the nuances of a language? Or even it's broad goals as to why it was developed?

Bing points.

...

A normal program flow is that instructions get executed one after another until you reach the end of the program. With mult-threading, you can leverage the multiple cores of your CPU to execute some things at the same time. Like a road that forks then merges later on. This can speed up performance or be used as a nice way to structure your program when it has several independent parts that could happen at the same time. For example an online multiplayer server could create one fork in the road per player and handle them independently.

>i'm not very proficient in any particular programming language but i swear i'm a great programmer you guys!
stay delusional

I actually agree with this user.

Just because I understand the basic concepts of programming, doesn't mean you can quickly learn any language.

oh, an actual answer, thanks a lot.

>tfw i can't even do some of the easy level programming challenges
Being a programming newfag sucks. They seem easy enough reading them and then writing out what I have to do but I don't know how to implement what I want to do. My google-fu sucks, on top of it; lots of tangentially related articles and crappy "its ez just write this and it werkz" tutorials but nothing that actually teaches implementation.

How do you get past this? Is it syntax memorization?

How can you not see he's being baited? No shit you agree with him

what?
no ones talking about syntax.
learning syntax is easy. its just googling and practice, memorization.

My point is ONCE you understand the lower level abstractions that most languages, say functional, imperative, etc... languages use then in comparison, Syntax is kids play.
Yes that includes, parallel programming, lambdas etc..

Well if original user claimed that i would agree too but naah. He is just baiting

you're one of the lucky ones. Post tits?

It's a well understood, well documented, and often used topic.
Any amount of research you put in would have been incredibly more useful than anything posted on here.

as us, user

generally, you have to apply taylorism to everything as a newbie, e. g. break everything down to parts everyone can do.

i'm not even sure who you're referring to

if you know a dozen shitlangs and the "general programming concepts", you will still not become an expert in C++ any time soon, you will not get a C++ game engine dev job or anything like that any time soon

If I'm building a GUI in C++, i need to have one function that does all the work, and then one function that actually updates the screen, yes? Say I want the screen to update at 60fps, would I have two threads running, and in the work thread, have that running Infinitely while the display thread only kicks in every 1/60 seconds and updates then waits/locks until the next 1/60 seconds?
Or is this a retarded design?

Why is JQuery so shitty? I know it's not programming but there's no scripting general.

Exactly no one claimed that, im not sure what is going about, he is attacking claim noone made... bait or misunderstanding

look at the language reference before you even go to stack overflow or look at tutorials, especially youtube tutorials, they are fucking cancer

No that sounds about right. The UI thread needs to be separate so that it doesn't lock up while other things are being processed. Most UI libraries will have some intended design pattern that covers this though.

Just use Qt5

>>/wdg/

anons claimed in several posts that you could easily learn any language, that once you have the general concepts then you just need the syntax and then you've learned the language

But that's still broad strokes

Are all functional languages created the same? You're making wild assumptions.

No one is going to reinvent the wheel with each new language but learning the difference between Scala and prolog in your junior year CS class isn't going to make every language as trivial as learning syntax.

this is original post, i dont see that claim...

ok.

but having that knowledge points you in the right direction because you start to assume, test and try your previous knowledge on a new language.

Its certainly much better than learning each language as if they were completely different from each other.

What helped me when I was starting out was thinking "okay what do I know how to do and what can I do with it". Let's say you've just learned some basic things about variables and control flow (loops, ifs, etc). Then pick something you think you can do given those tools, for example "make a prime factorization program". Then do that. Most of the time you will have missed some detail that you need to figure out and learn. In this case maybe it would be the modulo operator.

fucking read
>Do you have a learning disability that you can't learn multiple languages? Once you know how to program it's really just syntax you have to learn.
how else do you interpret this post?

you don't TRULY LEARN the language if you skip to a new meme language each week. compare it with learning a natural language, at best you will still have an accent after years of learning it.

some people can't help having accents, it doesnt correlate with how well you know the language.

Right idea but in practice not viable.
You should only redraw if something changes, or else your application would consume resources for nothing while idle.

it's an analogy, a C programmer will take quite some time before they can write C++ or java PROPERLY, if they can ever learn it at all.

Sorry, fucked that up.
*Google offers 1000 queries per month for free.

From my experience, the knowledge feels like trivia more than anything else. Core concepts sure, but trying to generalize much further leads you down a deep rabbit hole and all you'll have to show for it is some dick waving "neato" history facts.

Also my original post was for the user claiming "if you learn how to program then it's just syntax to switch". This is a far more nuanced/pointless argument.

>The UI thread needs to be separate so that it doesn't lock up while other things are being processed.
Sorry, the do work/update_program() thread or the display/update_display() thread? Also, presumably I'd need to pass through a class or struct so the two threads could actually work together, yeah?
So in the update_display() thread, check if an update (via a mutex/semaphore) has occured every 1/framerate seconds and THEN update?

Nice!!
I think i will go with them after all.

So how much does it take to learn to do Java PROPERLY after specializing on C++?

The thread that's in charge of updating the display/UI should do only that, nothing else.

I'm not sure exactly how threads communicate with each other in C++. I am sure there are many ways of doing it, like shared memory, events... I don't know anything specific to C++ so I can't help you further.

> inb4 you never stop learning meme

you NEVER stop learning, user

there are many things besides the syntax that you'd have to learn, such as how inheritance works in java, reflection, the java memory model etc, and most importantly you have to get a "feel" for the language before you can consider yourself as an expert or something, they are different languages plain and simple

You never stop learning.

this But if you have learned c++ well java shouldnt be difficult. Syntax is very similiar you only have to learn libraries and some other things.

whats the point of using floats?
cant we just use integers and add commas afterwards?

performance

thats like saying why do we have strings? cant we just concatenate characters together?

also precision.

That sounds incredibly slow.

Why not pass the gui class some sort of object you want updated and then update?

Or if that's too unruly or messes with your current threaded model, make a method solely for updating gui objects and lock that.

Ease of use and performance. For anything where precision matters you would use specialized libraries.

awooo~

poo~

Memes aside, is it even possible to learn all the industry-relevant stuff in programming "by doing"?

Every time I hear actually employed developers talking with each other, they mention tons of stuff I never heard about.

If I never knew that JSON existed, for example, I would have never bothered to read about it.

You dont learn by reading. You take up a project and do it. And you research what you need to do that specific thing. E.g i want to make modable game, i research rendering stuff, imbeding scripting with c++ etc... Add multiplayer to it, you learn networking and so on...

do you really always have to have a thread running that updates the screen 60 times a second?

isnt there a more elegant solution to make UIs?

you can certainly learn a lot of stuff "by doing" however you would certainly learn bad practices and habits along the way, making your journey a whole longer than it needs to be.

Formal education has its place. Dont fall for the CS meme is a waste of time.

>all the industry-relevant stuff
that's very broad

you might never have to deal with neural networks or networking, and you don't need to

but you'll pick things up here and there so you at least have an idea of what they are

yes, event driven UIs.
you only update when you need to update, or better yet update in batches if possible.

Its dirt cheap to do that... It takes no cpu at all

I went to cs uni, and i dont really agree. I learned lots of usable stuff, from math to algortihms, networks and so on. Did i master any specific language? No, but i got very good backround others lack

Lots of wisdom in a short post.

Almost all significant learning comes from having to learn how to do all the little things in a big project.

Follow examples and learn how to learn.
JSON is pretty popular but there are tons of things you'll never even touch and you shouldn't try to learn everything now.

Pick up what's considered "core" and develop on your own a bit. Make a game or a chat server too

exactly, CS is magical that way. I see programming in a different way now than i did when i fresh out of high school.

>do you really always have to have a thread running that updates the screen 60 times a second?
no

whoops i though question was is it expensive to listen for events, ignore first part

if i do a big project in c++, does it make sense do declare every relevant object with a pointer?

Why not? Make that unique_ptr and its even safe...

if you mean allocating everything in heap instead of stack, no.

Why not? Pass by reference is great

to expand, it depends. Its better to avoid allocating large objects on stack. If its small yea stack allocate it. Rule of thumb is to use stack when memory used is limited to scope you are creating it in. So heap allocate when data is to be used outside of scope of a function...

It all depends...

if you are doing performance critical stuff and using only heap allocation, you'll have a lot of cpu cache misses.

pass by reference doesn't need (explicit) pointers

>That sounds incredibly slow.
In terms of performance, as in the design is inefficient?

code::blocks is really good, wish it would support languages other than c++ and c

did you use anything else?
I find code blocks on level with sublime text with couple of plugins. Which is not saying much

Is it generally a good method to learn programming by doing the 100 projects suggested here and asking questions whenever they arise?

better-dpt-roll.github.io/

Or shut I quit the memes and join a proper course?

i used eclipse, albeit an older version.
was extremely dissatisfied with almost everything.

now i downloaded netbeans and it looks a bit bloated, but i might try it out.

many people i know use emacs, but i really dont wanna delve into 100 plug-ins, just to achieve the functionality an IDE already has.

Yes. Some are too hard to be worth it imo.
Combination of course and projects would be even better

for c++ i like in order: Visual studio, QtCreator, CLion. QtCreator is pretty lightweight and its even good for non qt projects.

>i used eclipse, albeit an older version.
>was extremely dissatisfied with almost everything.
there's literally nothing wrong with the latest version of eclipse

+1 for intellij products.

I dont know if there is open source free version of it so i put in on last place. I do have licence and its really good, had some problems with c++1z and template heavy libraries... Its not fully supported yet.

Added an 'inspector' (for lack of a better term) to my hex editor.

c++ and java are both object-oriented ...
is there any need to learn a non object-oriented language for generic dev jobs?

Thats pretty cool. Is there source somewhere?

generic? probably not.
Also c++ is multi paradigm not OOP

...

Thank you but that's an old thread actually.

Oh boy. No friend, set -e only guards against failed commands, and $((1/0)) is a failed substitution which results in an empty and therefore successful command.

You then proceed to run it with two different shells, sh and bash.

In sh, the pipefail command failed because this is not a sh feature. It therefore aborts the program.

Just use true and false to test these things instead.

If having a debugger that isn't as good as VS isn't. a flaw, sure.

>Thats pretty cool. Is there source somewhere?
Not yet, I'm still fixing some of the issues revolving around the undo/redo functions but I plan on uploading it.
I'll keep posting to update you.

n-no one will notice

Great! What language are you using?

different poster here, qt creator is great. i prefer it even to visual studio because of its first-class cmake support and because honestly it's more responsive at this point (it somehow runs better on my $180 chromebook running arch than visual studio does on my gaming machine kek). been meaning to check out clion but i put it off because last i checked it used an integrated but pretty outdated version of cmake, which was a dealbreaker for me at the time. ought to check it out again though

On windows im actually using emacs for smaller project currently, having problems with visual studio as well. But i remember it being great. On linux i use CLion since i cant be bothered with qt dependencies on gentoo and i usually do bigger stuff there. About cmake its actually newer than one in stable portage tree, so thats a plus.

>this monkey has to use a debugger
lol

are you serious?

yes?

just ignore he is baiting you. Even pajeets and code monkeys understand importance of debugger

you're the one who's baiting or you're seriously a shart in mart codemonkey

linuxmafia.com/faq/Kernel/linus-im-a-bastard-speech.html

argument from authority, read up and try again

you're the one not arguing the facts, fucking retard

ad hominem and tu quoqe, read up and try again

enjoy using your debugger to try to fix your retarded sloppy shit code

yeah, the big chunk of qt dependencies is my only real gripe with qt creator since it's the only qt application i use and i'm not using it to make qt applications myself (and my chromebook only has 16gb storage so i actually have to watch my package count), but i suppose there's no avoiding that. and yeah, checking again, it looks like clion supports much more a up-to-date cmake version now. i was used to the version in the arch repos (just the latest stable release), and depended on a couple features from 3.x, and when i first checked out clion (admittedly very early on, soon after its initial release), it only supported something like 2.6. i'll definitely have to check it out now

you made a claim burden of proof is on you, read up and try again also ad hominem

very interesting post my fine gentleman, here's your (You)

Its pretty good be warned tho, c++14 and c++1z are not fully supported (but its good enough support) so it might not be good for that.

It's only Ad hominem if the whole substance of the argument is only an insult

plain old C

Great! I might even contribute if you ever open source it.

Are you sure? I just googled cant find that...

On a scale from 0 to WinAPI, how would you rate your experience with ncurses?

0 being the best?

Yes, as in 0 pain.

yeah, not too surprising, i'll live. i already deal with that with qt creator; i get red squiggly lines sometimes because the integrated parser doesn't recognize the syntax but it builds just fine. kek at least gcc actually supports the features i want, msvc is really lagging behind on some stuff i wanna use but can't in cross-platform projects yet. you'd think that'd be a higher priority for microsoft

msvc doesnt fully implement even older stuff...

oops

For cross builds i have to use mingw... I would love to use g++/clang on linux and msvc on windows and thats it. But naah you have to ship extra .dlls for mingw...

haha yeah, it's getting pretty ridiculous at this point. makes me wonder just how long it's gonna be until they get to the stuff i wanna use. generalized constexpr/auto, generic lambdas, and variable templates have big implications for c++ metaprogramming (among other things of course), and microsoft is holding things back. there's a great new boost library called hana i wanna use that just says "fuck it, i'm using these features, if your compiler doesn't support them, sorry". clearly i'm not the only one losing my patience

yeah, better than nothing. but i really wish microsoft would get it together. they axed or spun off a bunch of their .net technologies because they were convinced that there was gonna be a "native renaissance" as they called it. sounds good to me but how's there supposed to be a native renaissance if they can't keep their standards compliance on par with the compilers for other platforms? kek

It's bliss compared to WinAPI.
There are some weird things, like the ESC key having a 1000ms delay for no real reason.

>like the ESC key having a 1000ms delay for no real reason
Did you dream of that?

no
en.chys.info/2009/09/esdelay-ncurses/

>(Such a delay is necessary to differentiate the ESC key from function keys.)
WHAT THE FUCK IS THIS SHIT FUCKING RETARDED LUNIX TARDS

you shell not fear the linux my son.