[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: 315
Thread images: 18

File: 3807208431722048426.jpg (47KB, 637x579px) Image search: [Google]
3807208431722048426.jpg
47KB, 637x579px
What are you working on, /g/?

Old thread: >>59222230
>>
>>59228724
I probably am the best programmer on g. I am not working on anything. Coding is boring.
>>
There is nothing wrong with wearing women's clothes while programming
>>
How to convert Py script into Exe boys?

CX_Freeze and Py2exe seem not to werk.
>>
>>59228740
most women can't program
>>
>>59228741
learn cython
>>
>>59228741

Make a C program that embeds your Python program.

https://docs.python.org/3/extending/embedding.html

Because that's more or less all any Python -> .exe program is going to do.
>>
File: kill me.png (144KB, 485x241px) Image search: [Google]
kill me.png
144KB, 485x241px
>>59228642
>>
>>59228802
Don't know C very well, only know the fundamentals, besides its just a one off thing so i'd prefer to just get my exe and be done with it, already have enough of a headache trying to find some miracle solution as we speak
>>
>>59228837
christ man that comma is out of control
>>
>>59228724
you forgot an "is" there.
>>
>>59228842
>Don't know C very well
Yeah, who would've thought that a python redditor doesn't know C.
>>
File: 1483108846685.png (240KB, 935x720px) Image search: [Google]
1483108846685.png
240KB, 935x720px
>>59228842
>Don't know C very well
>>
>>59228837
would be an international feat to convert this into plaintext
>>
File: tmp_13622-1488504546372-8052173.png (1MB, 1440x1080px) Image search: [Google]
tmp_13622-1488504546372-8052173.png
1MB, 1440x1080px
>no anime pictures for D
>>
>>59228902
Can you stop larping as the bodyguard for the epic hacker known as 4chan? youre seriously fucking gay
>>
What are some GOAT introductory books to parsing text? Or something like marshaling and unmarshaling streams? I want to git gud at network programming
>>
>>59228941
Why would there be anime pictures of POO garbage?
>>
>>59228946
>epic hacker known as 4chan
"epic" reddit meme. now deport yourself back to your home site.
>>
>>59228951
D is the future you heretic pagan mongrel
>>
>>59228977
that may have been true if that piece of trash wasn't stained by POO.
>>
>>59228987
You obviously don't appreciate the value of code reuse
>>
File: d lang.png (909KB, 1280x720px) Image search: [Google]
d lang.png
909KB, 1280x720px
i made this for you anon
>>
>>59229003
anyone who appreciates the value of code reuse is by definition opposed to POO.
>>
Is there a good api to check for image similarities? opencv maybe?
I want to delete duplicate pictures inside my porn folder.
>>
File: god help us all.png (183KB, 402x312px) Image search: [Google]
god help us all.png
183KB, 402x312px
>>59228837
>>59228881
>>59228921
>>
>>59228802
What happens if the Python.h header is not found? (Using windows with VS)
>>
>>59229077
Try making a post on reddit.
>>
>>59229040
what kind of porn are we talking here?
>>
>>59229040
If youre looking exact duplicates, you can probably achieve this by hashing and maybe a few other tricks
>>
>>59229127
>>
>>59229007
rude
>>
>>59229007
/r/ing this to be the next thread's OP image.
>>
>>59229155
it's completely accurate.
>>
>>59229138
?
>>
>>59228842

Just use this:
#include <Python.h>

int main(int argc, char *argv[])
{
const char *filename = "main.py";
FILE *fp = fopen(filename, "r");

Py_Initialize();
PyRun_SimpleFile(fp, filename);
Py_Finalize();

fclose(fp);
}


>>59229077

1. You need to download the Python development libraries
2. Stop using VS you fucking moron
>>
>>59229172
>>
So I just started programming 3 months ago now I have a $80,000 a year programming job

will pay someone 20,000 a year to do my job for me
>>
>>59229155
wrong
>>
>>59229040
If you're using ganoo+loonix you can use findimagedupes.
>>
File: yorokobe.png (83KB, 320x320px) Image search: [Google]
yorokobe.png
83KB, 320x320px
>>59228977
Repent and return to the one true path of C. I'm worried about your soul, anon. D has failed you and will be forgotten.
>>
>>59228741
PyInstaller
>>
>>59229187
This makes me want to kill myself :)
>>
>>59228642
Pretty good.
But I swear I've seen something really similar here on /dpt/ before.
>>
>>59229114
the kind of porn that some people may find degenerate

>>59229127
the pictures may change in size and sometimes the colors are a bit different too. I think I need something that would do feature matching or something.
>>
>>59229186
Stop
I have enough (You)'s
>>
What do you guys do when you don't have a project you want to do? I've been debating doing stuff like hackerranks/projecteuler, but I'm not sure if that is going to make me improve. At worst I feel it would keep me at the same level and at best, well I'm not really sure what the best case scenario would be. Maybe i'm just being lazy but then again it's only a matter of time till i find an idea.
>>
Lua is good
Prove me wrong
Protip: 1-based indexing is the issue NOT.
>>
>>59229040
http://docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.html
>>
>>59229230
That's not how it works, retard. You have to prove it's good in the first place.
>>
>>59229216
Maybe downscale and resize the images and convert to grayscale to find a rough hash, single out "potentially similar images" and then do higher resolution comparisons (maybe some sort of color distance, find the standard deviation across the entire image) to decide if they are truly similar.
Or you could try opencv if youre so inclined.
>>
How do I synchronize file access across multiple threads if I cannot use the language's internal locks?
>>
>>59229247
implement your own locks?
>>
>>59229259
How? Booleans aren't atomic and there is no volatile keyword.
>>
>>59229269
What shitlang are you trying to do effictive multithreading in?
>>
>>59229269
allocate one bit on the heap and flip it when you are accessing the data you fucking nerd
>>
>>59229289
Plot twist: I'm writing my own.
>>
>>59229298
Add mutex to the standard library then
>>
>>59229182
I dont understand, I'm just missing the Python header file and I don't know where to get it or put it, I don't know where the header files are located in windows

Also whats wrong with VS if you're on windows? I don't know any better alternative (It also just werks with D)
>>
lads, how do i find it in me to finish off this fucking degree? im in my last year, but i feel like ive wasted 4 years of my life acruing debt for a job thats comparible in pay to a skilled trade, and is detrimental to my health. ive 2 months and a resit to go, but in those two months ive got deadlines to meet, and ive been rejected by two companies looking for graduates already. its taking every bit of willpower i have not to simply say "fuck it" and go do something else.
>>
>>59229328
work on your own and make money through clients that need your skill of trade.
>>
>>59229338
how? my lack of willpower resulted in me leaving everything to last minute, and my grades reflect that.
>>
>>59229354
i recommend going to ribbit.
>>
File: testout.png (1MB, 978x1040px) Image search: [Google]
testout.png
1MB, 978x1040px
How do I into content awareness?
>>
>>59229354
get off of 9gag and just DO IT!
>>
>>59228837
>Literal C toddler
>>
>>59229366
Where the hell did you get this image of me?!
>>
>>59229363
why?

>>59229375
im not even sure i really care any more to be honest, i just want it over with
>>
>>59229269
Have a thread that does nothing but okay other threads to use files.
>>
>>59229309

>I don't know where to get it or put it
Where you have Python installed, there should be a directory called include. You should add that to your compiler's search path.

>what's wrong with VS if you're on windows?
The fact that MSVC is a bad compiler. Use MinGW every time.
>>
>>59228724
>C++ for idiots
Funny way of saying "C"
>>
>>59229393

funny
>>
>>59229454
>The fact that MSVC is a bad compiler.
Write a formal proof of this statement.
>>
File: 1415769258931.png (2MB, 1712x2504px) Image search: [Google]
1415769258931.png
2MB, 1712x2504px
>>59228740
>tfw increased my productivity by 10% by just wearing thighhighs
>>
>>59229454
>The fact that MSVC is a bad compiler. Use MinGW every time.
this. i'm done waiting for microsoft to take their sweet-ass time implementing the standards. after spoiling myself on linux with some of the newer features, i've set up my windows system with mingw, qt creator, and cmake, and i've never been happier developing in windows. microsoft needs to get their shit together
>>
>>59229480
What do you find funny here?
>>
Just finished implementing the whole 16550A serial uart thing (http://www.ti.com/lit/ds/symlink/pc16550d.pdf), flow control and all. but I'm not getting any interrupts. what did I forget?
>>
>>59229543
>what did I forget?
Are you retarded? How do you expect anyone to know this without actually seeing your """""work"""""?
>>
File: img_007.png (266KB, 462x628px) Image search: [Google]
img_007.png
266KB, 462x628px
>tfw you realize that there is a natural equivalence between the category of Boolean algebras and the category of sigma algebras
>>
File: 1486916586115.jpg (47KB, 600x291px) Image search: [Google]
1486916586115.jpg
47KB, 600x291px
Today I'll remind them
>>
>tfw it's so hard to make a good web business ap that makes a lot of money
>>
>>59229481

The current C standard is C11.

GCC supports the C standard
Clang supports the C standard
MSVC does not support the C standard

Therefore MSVC is a bad C compiler
QED.
>>
>>59229556
nvm I found it already. forgot to put ~ in front of a destructor that was supposed to enable them.
>>
>>59229584
write a formal proof for the each of the following statements:
1) The current C standard is C11.
2) GCC supports the C standard
3) Clang supports the C standard
4) MSVC does not support the C standard
5) Not supporting the C standard leads to being a bad compiler
>>
>>59229481
>>59229584
if you think that's bad just look at c++. gcc 7 already supports like all of the c++17 working draft proposals and the standard isn't even finalized yet. msvc is still missing half of c++14. i mean christ
>>
>>59229590
wait no that didn't fix anything.
>>
Making a 3d game engine in java

this is my progress so far


ublic class Game extends JFrame implements Runnable{
private static final long serialVersionUID = 1L;
public int mapWidth = 15;
public int mapHeight = 15;
private Thread thread;
private boolean running;
private BufferedImage image;
public int[] pixels;
public static int[][] map =
{
{1,1,1,1,1,1,1,1,2,2,2,2,2,2,2},
{1,0,0,0,0,0,0,0,2,0,0,0,0,0,2},
{1,0,3,3,3,3,3,0,0,0,0,0,0,0,2},
{1,0,3,0,0,0,3,0,2,0,0,0,0,0,2},
{1,0,3,0,0,0,3,0,2,2,2,0,2,2,2},
{1,0,3,0,0,0,3,0,2,0,0,0,0,0,2},
{1,0,3,3,0,3,3,0,2,0,0,0,0,0,2},
{1,0,0,0,0,0,0,0,2,0,0,0,0,0,2},
{1,1,1,1,1,1,1,1,4,4,4,0,4,4,4},
{1,0,0,0,0,0,1,4,0,0,0,0,0,0,4},
{1,0,0,0,0,0,1,4,0,0,0,0,0,0,4},
{1,0,0,2,0,0,1,4,0,3,3,3,3,0,4},
{1,0,0,0,0,0,1,4,0,3,3,3,3,0,4},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
{1,1,1,1,1,1,1,4,4,4,4,4,4,4,4}
};

>>
>>59229644
is that minesweeper?
>>
Is D a meme language? It looks so clean.
>>
>>59229644
can you explain this
>>
>>59229584
Are you claiming that "supporting the C standard" -> "being a good compiler"?
>>
>>59229687
Supporting the C standard is a prerequisite of being a C compiler.
>>
>>59229663
>>59229669
raycasting
>>
>>59229687

Well if we consider that MSVC is proporting itself to be a C compiler... YES!
>>
>>59229454
says im missing 'python35.lib' link file, for some reason I can only run visual studios in debug mode (It still persist in debug mode even if I click release) apparently debug mode is the problem according to some people on stackoverflow
>>
>>59229687
if it doesn't support the C standard then it's not a C compiler but rather a compiler for a language similar to C
>>
>>59229722
or perhaps even a language quite dissimilar to C, i should say
>>
>>59229700
>>59229722
That was poorly worded, I should have said "current C standard".
>>59229703
>Well if we consider that MSVC is proporting itself to be a C compiler...
That is currently not relevant.
So you think "not supporting the current C standard" -> "not being a good C compiler"?
>>
msvc and vs is for win fags exclusively
while all sane people use Clion
>>
when did programming all click for you and it finally made sense on how to program everything?
>>
>>59229753
No sane person is ever going to use an IDE.
>>
Anyone know how to get rid of the "cannot open file 'python35.lib' link file for visual studios? I have added the compiler and linker dependencies but for some reason its still not going away
>>
>>59229757
>it finally made sense on how to program everything?
I don't think this is possible for a human.
>>
>>59229731

>That is currently not relevant.
It is in context.

>So you think "not supporting the current C standard" -> "not being a good C compiler"?
Abso-fucking-lutely.

>>59229753

If you must use an IDE, QtCreator is just nice.
>>
>>59229753
clion would be nice if it didn't run like shit

>>59229757
all at once out of nowhere five years in. jk it's a lot of little clicks not one big one
>>
>>59229811
>Abso-fucking-lutely.
So according to you this isn't a fallacy.
P -> Q
therefore, not P -> not Q
Wouldn't expect less from someone with that sort of name.
>>
>>59229811
>QtCreator is just nice
qtcreator isn't just nice, it's mothafuckin straight-up decent. in other words, well above the norm for its category
>>
>>59229813
>clion would be nice if it didn't run like shit
explain

meanwhile, daily reminder that C is God-tier
*(*(*(*abc)())[6])();
>>
>>59229861
>it's mothafuckin straight-up decent
i don't know why you think this and "complete and utter garbage" are somehow even close.
>>
>>59229849

P = is a good C compiler
Q = supports C standard
P implies Q
Not Q, therefore not P.

The inclusion of GCC and Clang is not necessarily part of the proof, but rather, insult to injury. P implies Q is an axiom. A good C compiler supports the C standard by definition.
>>
>>59229849
>your logic is flawed
>also your name is gay
>>
>>59229892
You claimed that something which supports the current C standard is a good C compiler. Then you concluded that something which does not support the current C standard is not a good C compiler. I don't know how retarded does one have to be to say that this is valid.

>The inclusion of GCC and Clang is not necessarily part of the proof
Why did you do it then? Do you also add in random shit for every single """proof""" or is this just some special case?
>insult to injury
You do realize that probably nobody here is retarded enough to claim that MSVC is a good compiler, right?
>A good C compiler supports the C standard by definition.
A good C compiler is by definition a C compiler, which means it supports the C standard.
This doesn't somehow mean that is supports the latest C standard.
>>
File: 1485687413146.jpg (64KB, 582x582px) Image search: [Google]
1485687413146.jpg
64KB, 582x582px
>>59229892
>something which is a line in the proof isn't part of the proof
>>
>>59229866
the number of IDEs (text editors above all else, mind you) that can't even manage to get down the concept that there shouldn't be a half-second pause between pressing a key and the appropriate character appearing oncsreen is astonishing. clion has been one of the worst in this department, out of the editors i've tried. pretty awful startup time, too

>>59229871
qt creator is the only IDE i've used that has reliably had no detectable input latency even on a very low spec machine. others have had much higher latency (to the point of being distracting) often even on a much higher spec machine by comparison. it also allows you to disable virtually any feature you don't need/use for a lower footprint, and has excellent integrated cmake support. it also makes setting up kits for different toolchains/cross-compilation, build configs, and deployments very clean and easy
>>
>>59230050
>the number of IDEs (text editors above all else, mind you) that can't even manage to get down the concept that there shouldn't be a half-second pause between pressing a key and the appropriate character appearing oncsreen is astonishing. clion has been one of the worst in this department, out of the editors i've tried. pretty awful startup time, too

You just need a faster computer.
>>
>>59230030
that was mostly meant to be illustrative of the massive gap in support. but you would be a fool not to use c++17 features once they're adequately supported if you have the option. you don't need c++17 to write good code, per se, but using it allows for better code than was previously possible
>>
>>59230073
>t. black girl lover
>>
File: editor-latency-linux-xml.png (9KB, 580x430px) Image search: [Google]
editor-latency-linux-xml.png
9KB, 580x430px
>>59230050
>that can't even manage to get down the concept that there shouldn't be a half-second pause between pressing a key and the appropriate character appearing oncsreen is astonishing
intellij ides, including clion, reckt vim on linux in typing latency, what are you talking about?
https://pavelfatin.com/typing-with-pleasure/
>>
>>59230050
>clion
Did you try adding
editor.zero.latency.typing=true

to your bin/idea.properties?
>>
>>59230073
i have a faster computer. the fact that clion and visual studio run worse on my gaming machine than qt creator does running on my $180 chromebook running arch is somewhat telling, i think
>>
>>59230121
Windows being slower than Linux. Who would've thought.
>>
>>59230104
is this a fucking joke? why would they not assume this would be the desired default behavior? does it stunt the editor's capability in some way?
>>
>>59230136
i can boot linux on my gaming machine. i was just indicating a much higher hardware spec
>>
File: yunokdevelop.jpg (39KB, 500x500px) Image search: [Google]
yunokdevelop.jpg
39KB, 500x500px
>>59230109
>begging in FAQ because noone uses it
>but i want my ide to constantly innovate though and have solid $ backing so it won't become abandonware and i won't have to support it myself
what do
>>
>>59229983

>Why did you do it then? Do you also add in random shit for every single """proof""" or is this just some special case?
This is very much a special case.

>You do realize that probably nobody here is retarded enough to claim that MSVC is a good compiler, right?
Then why ask me to prove that it is not one?

>A good C compiler is by definition a C compiler, which means it supports the C standard.
>This doesn't somehow mean that is supports the latest C standard.
A good C compiler by definition can compile the latest C standard. Otherwise it fails the "good" part of its definition.

>>59230042

That is correct.

>>59230057

MSVC is commonly used to refer to the C and C++ compiler toolchains provided by Visual Studio. The proper compiler name is cl.

>>59230030

Using an earlier version of a language standard is for morons. If you are programming in C++, you should use at least C++14, if not the experimental C++17. If you are programming in C, you should use C11. If you are programming in Python, you should use Python3, and not Python2.
>>
>>59230121

Not fast enough, evidently.

>>59230092

I don't get it.
>>
>>59229644
>not using an external file as the map
>>
>>59230163
>Using an earlier version of a language standard is for morons.
why?
>If you are programming in C++, you should use at least C++14, if not the experimental C++17
whats the difference? it's still c++?
>>
>>59230150
it is on by default in latest releases
>>
>>59230168
call me crazy, but i'm of the belief that a high-end machine shouldn't be required to effectively edit text
>>
>>59230192

I know, I'm just baiting.
>>
>>59230194
>baiting
wow! cool!
are you one of them 'old' 'fags'?
>>
>>59230182
how did they manage to avoid their performance getting raped by the jvm like their other products? breaking out all the text editing code to C library calls? also forgot to mention before but i'm not thrilled about a jvm dependency in general, considering i sure as shit wouldn't need it for anything else
>>
>>59230192
ide is not a text editor though and most of us aren't stuck with 1999 hardware
do you also compile on 3.50usd chromebook?
>>
>>59230224
https://pavelfatin.com/typing-with-pleasure/
>>
>>59230180
>whats the difference?
Literally deprecating everything that was once holy.
Adding pointless bloat for the sake of adding new stuff.
>>
>>59230200

No, just an idiot.
>>
>>59230256
So basically you're admitting that you're a redditor then.
>>
>>59230260
I browse reddit programming subreddits this is true the content there is more interesting than the typical shitposting here

I find /dpt/ only has very rare gems of useful programming information which you will find at random times skimming through maybe 3 o 4 full /dpt/ threads
>>
>>59230274
I don't want any reddit stink nearby. Fuck off.
>>
>>59230285
what does reddit smell like?
>>
>>59230050
>qt creator is the only IDE i've used that has
I dunno, sounds like you stuck in your comfort zone, unable to conceive there are better alternatives out there
>>
>>59230225
>ide is not a text editor though
it really is

>most of us aren't stuck with 1999 hardware
it was made in 2015, but that aside, are you saying software developers should waste resources just because they can?

>do you also compile on 3.50usd chromebook?
$180, but yes. never been a problem because i tend to write low-dependency code. in fact i've had projects build slower on my other machine because the build process was bottlenecked by HDD read speed compared to the SSD in the chromebook, though i'm sure that could have been remedied with -pipe. still kind of funny, though
>>
>>59230307
Like a singular, non-corporeal entity which contains a mirror of the entire universe but can only see it from one perspective.
>>
>>59228724
Is Swift the language that will make programming great again?
>>
>>59230377
Not a chance.
>>
>>59230260
>>59230274
>>59230285
>>59230307
jesus christ. every thread with this shit
>>
>>59230377
Something which originated in C*lifornia can't possibly do that.
>>
>>59230391

How about discussing an interesting programming topic instead of complaining?
>>
>>59230406
how about discussing an interesting programming topic instead of shitposting about reddit
>>
>>59230406
Static types suck and Haskell is shit.
>>
>>59230385
why not?
>>59230400
where should it come from?
>>
>>59228724
where do you store your application state/data?
somewhere as a singleton?
>>
>>59230419
There is no benefit to using Swift over literally anything.
>>
>>59230433
Continuations.
>>
When do you choose Java over another programming language?
>>
>>59230433
context objects
>>
>>59230453
when you are mentally deficient.
>>
>>59230435
It has a nice syntax, supports oop and functional and is not as bloated as c# and java
>>
>>59230348
if ide was a text editor, it would be called a text editor.

i am saying the resources are plenty and cheap. you sound like a person who grew up during blockade where the only thing you could eat was an unlucky cat. so you got traumatized for life. and now you shun people if they drop bread crumbs when they eat or didn't finish their meal.

if an ide can give me an edge by using more os resources, let it. i didn't buy 64gb ssd hexacore for nothing. if you want low resource usage, why use a power tool, use a hammer. but don't claim hammer is better because it requires no electricity
>>
>>59230453
when your employer gives you no choice and you can't find another employer
>>
>>59230462
>64gb ram
*fix
>>
Anyone have any resources on writing vms? Not a vm like virtualbox or something, but like a language vm like jvm, but obviously much simpler.
>>
>>59229454
MinGW is MUCH worse than VC. I had the pleasure of trying to use std::thread in MinGW. It was literally not supported although MinGW claims to support C++11. I had to download another compiler (TDM-GCC) to get it to work.
>>
>>59230577

TDM-GCC and MSYS2 are just different implementations of the same MinGW-w64 toolchain. It would seem that the implementation you had originally downloaded did not come with winpthread, which is what is used for implementing std::thread.
>>
>>59230453
only someone else makes that choice for you
then you leave
>>
>>59230462
>if ide was a text editor, it would be called a text editor
it is effectively a text editor with a few plugins. editing text is the primary function. all other arguments aside, it should be able to edit text with minimal latency. this is really not much to ask

>i am saying the resources are plenty and cheap
you seem to have a limited worldview. waste for no good reason is simply stupid, but unfortunately is predictably bred by excess. people have a tendency to "live just within their means", so to speak. the more room overhead they think they have, the less they care to optimize. this is bad in general, but certainly also for software. advances in technology should raise the bar for software proportionally, not less so after accounting for developers becoming more lazy

>if an ide can give me an edge by using more os resources, let it
surely, yes. but (1) it should actually be giving you an edge, not giving you the same result at greater cost, and (2) it should be optional, even if not strictly for the case of necessity but rather as a matter of preference
>>
>>59230453
When your only alternative is C++.
>>
>>59229644

Is this for a Wolfenstein-style raycaster engine? It reminds me of something I was trying to learn not too long ago:

http://lodev.org/cgtutor/raycasting.html
>>
>>59228741
By killing yourself, retard.
>>
>>59228837
>>59229055
this isn't too far from my handwriting

don't laugh at me
>>
>>59228917
C is cancer
>>
File: yessssssssssssss2.png (858KB, 1600x1597px) Image search: [Google]
yessssssssssssss2.png
858KB, 1600x1597px
Is D a meme or is it really the language of the future? I've only read the brief documentation on the syntax but it looks BEAUTIFUL.

Can D do everything C can do? Very low level stuff?
>>
>>59230969
You can avoid D's GC and there are clear instruction for that.

I wouldn't design a kernel/driver in D. I see D and Rust as C++, just a step higher level of C.
>>
>>59230987
Whats the benefit of C though? Shits so broken, so many useless broken functionalities in the stdlib
>>
>>59231008
>Whats the benefit of C though?
Not much, older projects are already written in C. C is like the legacy shit that will stay for a while. However I avoid C as much as possible. If you are doing a new project, chances are, there are much, much better, robust and safer options (pick your poison).
>>
>>59231035
>>59231008
Heck I even tell newbies to learn D instead of C
>>
>>59230969
I'm not a fan of D being so closed but from what I hear, absent a lot of nonsense regarding standard library forking awhile back, it's a lovely evolution of C++.
>>
>>59230969
it's nice but if it was gonna be the language of the future it probably would have needed to catch on like ten years ago
>>
>>59231042
As a desktop application developer I can safely say that I will pick D over C++ any day any time. I had a look at Rustlang as well.

No words can describe the horror of C with classes.
Hence C++. I do believe the new kids (D and Rust) of the block are fascinating.
>>
newfag here,
is using switch statement with only 3(2) cases overkill? like so:
switch (number) {
case 1:
isPrime = 0;
break;
case 2:
break;
default:
for (int i = 3; i < (number / 2); i += 2) {
if (number % i == 0) {
isPrime = 0;
break;
}
}
}
.
>>
>>59231252
now I realize I could just put it into a standalone function
>>
>>59231252
you are not using default properly. It should catch non integers
>>
>>59231284
well that's good to know!
>>
>>59230969
>Is D a meme
No. It's a programming language therefore it cannot be a "meme".
It's shit though.
>>
>>59231158
>D
>new kid on the block
D is 15 years old senpai
>>
>>59231252
weak

for (int i = 2; i*i < number; i++) {
if (!number%i) { isPrime=0; break; }
}
>>
>>59231284
I don't quite understand why
Is that the case even if number is declared as an integer (unsigned) beforehand?
the way I understand it 1 and 2 are special cases and anything else is default behavior
also I'm writing C not C++, if that changes anything
>>59231457
damn
>>
Released the first stable version of a faster Hydrus alternative backend. How shit are my docs? https://github.com/bakape/hydron/blob/master/docs/client_development.md
>>
>>59231471
>C user
>dumb
makes sense
>>
So if I want to build a UI application for desktop, will QML suffice?

I want the application to have menubars, dropdown menus, file explorer etc as well.
>>
I am a C learner, and I am currently working on a project with structs that have pointers as its members:
struct Node{
enum NodeType nType;
struct Leaf* elem;
struct Node* g;
struct Node* d;
};


If I have a pointer to one of these struct (let’s call it ptr) and I want to delete it, is free(ptr) enough, or do I need to free first its pointers (such as free(ptr->elem) ) and then free ptr?
>>
=> 59231567
Tip for asking next time. Don't share your personal blog, this ain't plebbit nobody gives a fuck about your personal shit. And don't fill in the name field.
>>
>>59231638
I have a reddit tab open :^)
>>
>>59231567
You should free the member pointers.
>>
=> 59231669
I can tell. Does your mom know you are using her laptop again?
>>
>>59231681
No but your mom does :D
>>
>>59231677
Ok, thank you!
>>
=> 59231696
She's on the spectrum for sure
>>
>>59231709
That's not really a big deal
>>
>>59231705
What book are you reading?
>>
>>59231750
I'm not sure if I can mention the name. I promised not to do so.
>>
>>59231750
«Méthodologie de la programmation en C» and «The C Programming language», but I am only beginning in C and I’m using some of my knowledge from C++ about pointers though I don’t really know how close are these two languages on some topics

>>59231766
shut the fuck up
>>
>>59231780
the book with the French title is only available in this language, but lots of experienced people recommended me this book and so far it’s a really good one
>>
>>59231780
>«Méthodologie de la programmation en C»
What kind of subhuman language is that?
>but I am only beginning in C
Yes, you already told us.
>I don’t really know how close are these two languages on some topics
They're pretty close.
>>
>>59231780
What's the point of learning C if you already know C++?
>>
>>59231790
>French
>it’s a really good one
That seems to be quite impossible.
>>
>>59231813
C++ is OOP garbage :DDD
>>
>>59231813
C(ancer)++ is deprecated.
>>
>>59231796
>What kind of subhuman language is that?
The language only nobles and higher society used in England for almost five centuries, as well as the diplomatic language that had been used for over a millennium and that is still pretty much in use today in diplomatic relationships.
Not to mention half of English vocabulary comes from this language. (Sorry, my inner linguistic nerd was tingling)

>They're pretty close.
I guess it’s pretty much “everything that is both in C++ and in C are used the same way”?

>>59231813
I’m learning it for fun

>>59231817
>That seems to be quite impossible.
as surprising as it seems, it is actually true, and I’m the first one to always prefer books in English. It’s the “exception that confirms the rule”
>>
i made some IoT malware in rust running on armv5te
getting rust to work with uClibc is such a pain in the ass though
>>
Building a small RTOS for ARM microcontrollers, currently Cortex-M0.
Might upgrade to an M3, and later on port it to the RPi 1.
>>
>>59231832
Rust is for retards
>>
>>59231832
For something to be deprecated, something has to deprecate it.
Nothing has deprecated C.
>>
Rust: default safety with optional unsafe
C/C++: default unsafe with optional safety
>>
>>59232079
>Nothing has deprecated C.
Which is why my post doesn't mention C.
>>
>>59229965
- It's fairly popular
- It's embeddable in C
- It's claimed to be fast (well, everything is faster than Python)
- It's indentation-independent
- Concatenation doesn't share the same characters, as addition
>>
>>59232044
C is Communism
>>
I'm struggling with C++ linker errors.

If I have main.cpp, class1.h, class2.h, class1.cpp, class2.cpp and class1 is supposed to include an instance of class2 in its state, how do I compile the damn thing without getting a linker error? I keep getting these LNK2019 errors.
>>
>>59232111
lua is slower than python
>>
>>59232044
Nice try NSA
>>
>>59232126
It has tail call elimination. Python doesn't.
>>
>>59232140
https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=lua&lang2=python3
>>
>decide to get a meme cs degree
>can't program worth a damn
>don't have the vaguest idea of what half of the code posted here is supposed to do or about the other languages
On a scale of 1 to 10, how badly did I fucked up?
>>
>>59232157
You should have programmed on your own.
CS degrees exist so you don't get filtered by the retards in HR.
I got a nice job without one though with a portfolio and security certs.
>>
>>59232235
>C/C++: requires you not to be a moron
Where does this meme come from?
>>
>>59232235
C users are morons
>>
>>59228741
Just ship the scripts with an interpreter annd create a batch/shell script that spawns the interpreter with the script that has the entry point.
>>
>>59232235
anyone who uses c++ is by definition a moron so your post is wrong.
>>
>>59232235
>>59232044
Fuck off, NSA
>>
>>59232157
Thats normal, you just need experience now.
>>
C people are mentally ill
>>
>>59232261
yup, so are C++ "people"
>>
>>59232147
>Not LuaJIT
Your benchmark is irrelevant.
>>
>>59232255
that would be the CIA, they use Rust themselves but try to subvert it.
>>
>>59232277
>Not Cython
Your argument is invalid
>>
>>59232325
>Java/C#
there is no need to write this when you can just write "POO"
>>
>>59232325
You tried
>>
>>59232339
Why does your post smell like unemployment?
>>
Java and C# is for pajeets xD
>>
>>59232346
How can a post smell like something? Is that what they teach you in india?
>>
>>59232352
They taught me C, does see have POO?
>>
>memory corruption

there goes my day
>>
>>59232363
Yes.
>>
>>59232379
Did your hard drive fail?
>>
File: 1465579273723.jpg (270KB, 1180x874px) Image search: [Google]
1465579273723.jpg
270KB, 1180x874px
>tfw switching from C++ to C#
>>
>>59232399
>Not ascending past C# and moving to Rust
>>
>>59232393
? no
>>
>>59228736
>I probably am the best programmer on g.
COOL!½
>>
>>59232424
I thought your file system got corrupted. What happened?
>>
What is the K&R of Python? I learned C last semester and I'm looking for a book exactly like K&R. Every one I seem to look at seems to be about teaching programming using Python, but since I already have those fundamentals down they aren't necessary.
>>
>>59232414
are you implying absolute garbage like c++ and c# and even on the same scale as rust?
>>
>>59232437
Because he's a human*. Bugs happen.
>>
>>59232454
Nice.
>>
>>59232454
le ebic vim C hacker mastertrole
>>
>>59232466
what kind of mongrel "slang" is that? is this some kind of reddit meme?
>>
>>59232440
prenticehall's book is pretty nice as far as i remember
>>
>>59232458
>Because he's a human
Only if he isn't writing Cancer++
>>
>>59232469
Yes, I like reddit too :DDD
In fact I have reddit bookmarks right beside /gee/
>>
>>59232429
No, my program has some sort of memory corruption, or at least I believe so, gotta fire up the debugger.
>>
>>59232482
What do you suggest?
>>
>>59232485
Rust doesn't have this problem
>>
>>59232484
>Yes, I like reddit too :DDD
don't liken me to your subhuman kind.
>In fact I have reddit bookmarks right beside /gee/
I'm glad for you
>>
>>59232496
oh boy here we go
>>
>>59232489
anything which isn't Cancer++. Just Cancer is fine.
>>
>>59232500
Umm, I already did. I placed both /gee/, HN and reddit into my "meme" bookmark category ...
>>
>>59232496
Neither does it have a mature library ecosystem for scientific data.
>>
>>59232508
Enjoy your C(ancer)
>>
>>59232520
What are you working on, anon?
>>
>>59232532
Only if you set No use to no problems
>>
>>59232531
Work related research for a presentation in SK later this year (chemistry/protein folding).
>>
>>59232526
It's not mine since I won't be using it. It's for the other guy
>>
>>59230104
Seriously, why is this an option? What's the downside?
>>
>>59232796
I think it sends some additional diagnostics data if you do that, not sure though.
>>
>>59232546
>= for set variable value
extra pleb
>>
>tfw switched from dark to light theme
Holy shit, the text looks much sharper now.
>>
>>59232916
enjoy your destroyed retina.
>>
>>59232889
why do most languages do that? it's fucking retarded when you think about it.
>>
>>59232971
>acceptable
x = y
>shit tier
x := y
set x = y
>>
>>59232971
let x = 98;
Just makes sense
>>
>>59230969
>I've only read the brief documentation on the syntax but it looks BEAUTIFUL.

>::
>beautiful
Haha what?
>>
How bad is
using namespace std;

It's very annoying to std all the fucking time, and it decreases readability significantly. Especially when dealing with templates, shit gets so messy.
I'm talking about practical cases.
>>
>>59233173
The practical case is to prefix all your calls to the standard library with std:: because otherwise you'll quickly get lost.
C++ is not a very readable language, this is true.
>>
>>59233001
>good tier
x <- y
>god tier
(setq x 'y)
>the ancients tier
MOV X, [Y]
>>
>>59233198
Rfags please go and stay go
>>
>>59233173
It's pretty bad in header files, it's kinda bad in file scope (i.e. outside functions) and it's pretty much ok inside a scope.
>>
>>59233215
>he doesn't know about monads
>>
>>59233233
you've entirely missed the point of his example but even if we ignore that fact I believe Rustfags have something like that:
let x: i32 = 69;
>>
>>59233233
Type inference is not exclusive to Rust, that being said serious projects explicit the type.
>>
>>59233233
>type inference is bad
>immutability by default is bad
It's like (((C)))ucks have been asleep for the last 20 years.
>>
>>59233301
>I have no idea what I'm talking about: the post
>>
>>59233301
false
>>
New thread:

>>59233370
>>59233370
>>59233370
>>
>>59233233
>const int x = 69;
>more readable than let x = 23;
You've never even took math, dumb CS toddler
>>
>>59229182
>>59229182
3. Stop using Windows you fucking moron!
>>
>>59228740
Boys make the better girls.
>>
>this thread isn't at 310 yet
embarassing
>>
not
dead
yet
>>
>>59237573
We persevere!
>>
>>59233198
>asigning a symbol as a value of another one is the same thing as setting the variable to VALUE of another variable
You are showing something that can be used like pointers, and not just copying a value of variable to another one.
>>
thread
>>
File: 1469489031861.png (53KB, 441x424px) Image search: [Google]
1469489031861.png
53KB, 441x424px
>>59229187
I learned too late in my EE degree I like programming. How do I get a job doing it? Do I have to go back to school for CS? I'm bored with my current work.
>>
>>59229187
What's wrong with it?
>>
>>59239016
>EE
Enterprise?
>>
>>59239306
That usually stands for Electrical Engineering.
>>
>be confused about programming problems
>decide to vent on /g/
>there are TWO /dpt/ threads
>even more confused now
>>
>>59239533
oh nvm
>>
>>59239534
There were three when I arrived. The next one was already past bump limit.
>>
>>59228736
>I probably am the best programmer on g. I am not working on anything. Coding is boring.
this is my sentiment as well, honestly.
i'd much rather work on actual computer science than program...
>>
>>59229040
https://en.wikipedia.org/wiki/Structural_similarity
is a good starting point
>>
progrider is down wtf
>>
>>59239730
Then fucking do it.
As an excercise, please make an algorithm that can actually train deep CNNs, not cheating like using Residual connections with which the effective depth, as defined by https://arxiv.org/pdf/1611.10080.pdf, is pretty fucking limited.
>inb4 you only know Calculus 1
>>
>>59239016
but EE is just embedded programming? I'm just finishing EE and I've only had one course that wasn't about embedded/programming (some analog stuff, didn't really pay attention).
>>
>>59239810
i said id rather do CS work than program.
that statement does not imply im not doing either
>>
This thread...
All these posts will be lost in time like... tears, in rain.
Time to 404.
Thread posts: 315
Thread images: 18


[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.