[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: 324
Thread images: 53

File: 1504463951083.gif (156KB, 500x364px) Image search: [Google]
1504463951083.gif
156KB, 500x364px
Old thread: >>62336769

What are you working on, /g/?
>>
File: 1504010159102.jpg (81KB, 480x800px) Image search: [Google]
1504010159102.jpg
81KB, 480x800px
Post crypto trading bot gainz
>>
File: 1503802310848.jpg (91KB, 629x667px) Image search: [Google]
1503802310848.jpg
91KB, 629x667px
post some resources so we can actually stop shitposting and start programming
>>
>>62343175
http://exercism.io/
>>
>>62343175
quit being a lazy fuck
there's no amount of "resources" that will help you if all you do is ask for more resources
>>
File: 1505014776882.png (2MB, 3840x2160px) Image search: [Google]
1505014776882.png
2MB, 3840x2160px
>>62343175
Your post number is 75. For the interests of this challenge, post numbers start at 01 and go up to 00, which counts as 100.
75 / 100 = 0.75
0.75 * 145 = 108.75
Congratulations, you're doing programming challenge 109: Pac-Man with different behaviors for each ghost.
>>
>>62343222
>>>/b/
>>
>>62343222
You again
Fuck off, no one wants your project roller garbage
>>
File: 1504625047268.gif (4MB, 525x388px) Image search: [Google]
1504625047268.gif
4MB, 525x388px
>>62343228
Thanks for your input, buddy, but I haven't been on /b/ since I was 15.

>>62343234
>post some resources so we can actually start programming
>no one wants your project roller garbage
What did he mean by this?

By all means, keep shitposting instead of programming, but let's not pretend I'm the problem here. :^)
>>
>>62343267
>What did he mean by this?
He means nobody wants your roller trash
>>
So I'm working on a webpage, and I need to execute a perl script through a web browser to actually build the HTML.
Problem is that I cannot get apache to execute it for the life of me.
I've made sure that perl-mod and cgi-mod are loaded, I've set "options +execcgi" and "addhandler cgi-handler .cgi .pl" for the sites directory in apache2.conf, and I set chmod 755 for the script.
Every time I try to launch it apache just serves the perl script as a regular file, and Firefox downloads it.

What do I need to do?
>>
>>62343302
>What do I need to do?
You need to fuck off to the webshit general
>>
File: 1503287876137.png (357KB, 741x772px) Image search: [Google]
1503287876137.png
357KB, 741x772px
Friendly reminder that you should return reference to an object iff:
1. The object itself is passed to the scope as a non-const reference
2. If the object is created within the scope, it is static
3. In no other situation

Reminder that you don't also need multi-return functions, create the expected values first and pass them as non-cost references into the function. These are called out params.
>>
File: 1503149151209.png (68KB, 208x251px) Image search: [Google]
1503149151209.png
68KB, 208x251px
>>62343316
Friendly reminder not to use objects
>>
>>62343373
Eat shit. Everything is an object
>>
>>62343373
>Tfw the more you learn the more you go back to structs and loose functions

>>62343384
- t. brainlet
*implements abstract base virtual move constructor observer pattern factory*
>>
>>62343384
wrong
>>
objects aren't even the problem
inheritance is the problem
just don't use that and you're good to go
>>
>>62343467
Idiot.
>>
File: lines.mp4.webm (249KB, 1280x720px) Image search: [Google]
lines.mp4.webm
249KB, 1280x720px
Hello /g/,
I made my raspberry draw lines (in pure ARM asm)

Where do I get hired now?
>>
Has anyone thought about replacing
;
 with akari buns?
>>
File: lines.mp4.webm (2MB, 1280x720px) Image search: [Google]
lines.mp4.webm
2MB, 1280x720px
>>62343503
top kike. Better watch the webm before uploading it. Here have higher bitrate.
>>
So I want to learn python and was looking around and found the O'Reilly books. Are they any good? Or should I learn somewhere else? Does it teach good practices, scaling projects, python standards etc?

I was also looking to properly learn frontend as i college was pretty shit about that. Where can i learn html/css properly and some meme popular framework to go along? I tried django but making the website pretty was no good.

Also, I have experience as a developer.
>>
File: IMG_1377.jpg (133KB, 750x846px) Image search: [Google]
IMG_1377.jpg
133KB, 750x846px
>>62343140
>he doesn't use the Whitesmith style of bracket placement
Quickest way to detect a pleb
>>
>gtk_icon_view
>no icons
aaaaaaa
i gave ittt the pixbufffff
>>
>>62343316
you forgot about when the object referenced is not (explicitly) passed in as a parameter but still has naturally greater scope/lifetime than the function, like a member function returning a reference to a data member or member array value from the containing object. or a member function returning a reference to the containing object itself, like an operator+= overload returning *this
>>
>>62343591
allman is the only logical style there.
>>
>>62343651
I think you mean K&R
>>
>>62343682
if K&R had you put align the body contents with either the ( or the following char, it'd be okay.
But how it is normally is just ugly, illogical and not very readable.
>>
>>62343707
it's perfectly readable and wastes the least whitespace
>>
>>62343707
if you have e.g.

if (x) {
...
}

you already get the 2 "separators" - one is the if
>>
>>62343720
>wastes the least whitespace
Oh god, how will i survive not having my source files be the max optimized they can be at the expense of readability.
>>62343728
I just think you need a newline or else things are just too scrunched up. Which is why allman is so good.
>>
>>62343707
>>62343682
>>62343651
I used to do allman as I was introduced to programming with C#. However, when I started doing Swift recently, I realised that allman is fucking horrible and wastes so much space. An entire line for a single { when you know where it starts anyway? Stupid. Really bad design. Looks bad once you are used to K&R.
>>
>>62343595
kek
>>
File: k&r v allman.png (8KB, 542x348px) Image search: [Google]
k&r v allman.png
8KB, 542x348px
>>62343756
I disagree, I think you end up with too much pointless space, which makes it harder to read.

You get a look of the layout but having pointless space just confuses you
>>
File: 1504279676034-r9k.jpg (25KB, 536x536px) Image search: [Google]
1504279676034-r9k.jpg
25KB, 536x536px
>what are you doing /g/
lmaoing @ lisp since it cant do method/function overloading
>>
>>62343783
Man the left is so much better. Only change I would make would be the else would start on a new line.
>>
>>62343783
>You get a look of the layout but having pointless space just confuses you
Wrong. Our eyes are really good at parsing shapes, and symmetry is inherently pleasing.
>>
>>62343591
I personally believe Mozilla style is superior in every single aspect.
#include "mainwindow.h"

#include <QVBoxLayout>

#include <DTitlebar>
#include <QApplication>
#include <QCheckBox>
#include <QDebug>

MainWindow::MainWindow(QWidget* parent)
: DMainWindow(parent)
{
setMinimumSize(1050, 850);

m_topToolbar = new TopToolbar(this);

titlebar()->setCustomWidget(m_topToolbar, Qt::AlignCenter);
titlebar()->setMenu(m_topToolbar->mainMenu());

m_titlebarWidth = titlebar()->width();
m_topToolbar->setFixedWidth(this->width() - m_titlebarWidth);

m_mainWidget = new MainWidget(this);
m_mainWidget->setFocusPolicy(Qt::StrongFocus);
setContentsMargins(QMargins(0, 0, 0, 0));
setCentralWidget(m_mainWidget);

connect(m_topToolbar,
&TopToolbar::openImage,
m_mainWidget,
&MainWidget::setImageInCanvas);

connect(m_topToolbar,
&TopToolbar::initShapeWidgetAction,
m_mainWidget,
&MainWidget::initShapesWidget);

connect(m_topToolbar,
&TopToolbar::rotateImage,
m_mainWidget,
&MainWidget::rotateImage);

connect(m_topToolbar,
&TopToolbar::mirroredImage,
m_mainWidget,
&MainWidget::mirroredImage);

connect(
m_topToolbar, &TopToolbar::saveImage, m_mainWidget, &MainWidget::saveImage);
}

void
MainWindow::resizeEvent(QResizeEvent* event)
{
DMainWindow::resizeEvent(event);
m_topToolbar->setFixedWidth(this->width() - m_titlebarWidth);

this->update();
}

void
MainWindow::keyPressEvent(QKeyEvent* event)
{
DMainWindow::keyPressEvent(event);
}

MainWindow::~MainWindow() {}
>>
K&R cuz that's the cleanest and the way C was meant to be. Fuck y'all snowflakes doing other fancy tacky shit
>>
>>62343595
nvm im a retard
>>
>>62343800
You're wrong, what you're imagining is just getting in the way. The shape you see is hindered by needless detail. The symmetry is indentation symmetry, which ISN'T shared by allman since it means you have two lines at the start and one at the end (on either side of indentation)
The complaint that the different length of the lines is an issue is nonsense.
>>
>>62343787
C can't either which is also a popular language. I don't see your point.
>>
>>62343161
Currently in possession of a bot that detects large amount of Volume in a short amount a time.

It's good to use to find whales in the markets.
>>
>>62343821
bullshit
QCefGlobalSettings::QCefGlobalSettings()
: p_(new QCefGlobalSettingsPrivate())
{
// TODO(LiuLang): Initialize default values.
}

QCefGlobalSettings::~QCefGlobalSettings()
{
delete p_;
p_ = nullptr;
}

void
QCefGlobalSettings::setSingleProcess(bool enabled)
{
p_->single_process = enabled;
}

bool
QCefGlobalSettings::singleProcess() const
{
return p_->single_process;
}

void
QCefGlobalSettings::setNoSandbox(bool enabled)
{
p_->no_sandbox = enabled;
}

bool
QCefGlobalSettings::noSandbox() const
{
return p_->no_sandbox;
}

void
QCefGlobalSettings::setDisableCommandLineArgs(bool enabled)
{
p_->disable_command_line_args = enabled;
}

bool
QCefGlobalSettings::disableCommandLineArgs() const
{
return p_->disable_command_line_args;
}

void
QCefGlobalSettings::setCachePath(const QString& path)
{
p_->cache_path = path;
}

const QString&
QCefGlobalSettings::cachePath() const
{
return p_->cache_path;
}

void
QCefGlobalSettings::setUserDataPath(const QString& path)
{
p_->user_data_dir = path;
}
>>
>>62343651
>Not GNU

KYS
>>
>>62343839
lol I was just trolling :D
>>
why, when instantiating, does each object in java have to have parent objects created too, all the way up to Object?

>>62343839
>C
>popular
pick one
>>
Quick Python style question.
Which one of these would you write:

if not some_condition:
return None
return something

or
if not some_condition:
return None
else:
return something

?
>>
>>62343872
None
>>
>>62343872
I don't speak snek but a way to do this is a ternary
return cond ? something : something_else;
>>
>>62343842
Wtf is this senseless crap, good job getting a good job with that code styling lmfao
>>
>>62343872
if some_condition:
return None
elif not some_condition:
return something
else:
return 5;
>>
>>62343907
Oh yeah, I forgot about the ternary operator. Not really a fan of it in Python, but it fits for me right now.
>>
>>62343872
if not some_condition is an error condition, the first.
if not some_condition is a "typical" condition, the second.
>>
>>62343909
That's one of the oficially recognized formats, also available in clang-format
>>
>>62343911
Python Bullshit. Gtfo
>>
Beginner Programmer/Comp Sci freshman here, what would be the best skills for me to have for the field in the future? I'm thinking about having a concentration in information assurance but I was told that would be near-impossible to get a job in
>>
>>62343787
wrong
>>
>>62343952
Hmm, sounds like a good rule of thumb. Thanks!
>>
>>62343955
Whoever created that format needs to be banned from using computers
>>
From the Zen of Python: "flat is better than nested"

Therefore you should try to nest as rarely as possible, so omitting the else branch is the correct choice.
>>
File: 1445379315046.jpg (25KB, 255x255px) Image search: [Google]
1445379315046.jpg
25KB, 255x255px
>>62343787
>implying you need it in a dynamically typed language
>implying you know shit about Lisp's methods or CLOS
>>
>>62343972
All of them, quit being an idiot, your ideal company probably won't even accept you because the market is flooded.

Your best bet is when all the High level Visas user get deported, along with the dreamers.

If you're a minority, you're fucked as well.
If you're white, you better be good looking.

Why are you even programming for companies?
Learn Programming for yourself

>Program something
>Sell to idiots
>????
>Profit.
>>
>>62343995
spotted the new fag. Mozilla style is probably the best style
>>
>>62344020
You mean GNU
>>
>>62343535
awesome work anon
>>
>>62344017
I got into programming because I had an interest in cybersecurity and making videogames, but I know trying to make a living off of making videogames would be suicide.
I'm thinking of also getting involved in research, specifically at my college maybe? Coding in and of itself has always caught my interest but it feels like if I go into a jack-of-all trades and learn everything I won't be "good enough". I keep getting told to specialize, specialize, specialize, but it makes more sense to be flexible and adaptable so I'm not stuck trying to find one job out of hundreds under the degree.
>>
Nth for C#
>>
File: computer_science_major.png (99KB, 561x595px) Image search: [Google]
computer_science_major.png
99KB, 561x595px
>>62344066
>>
>>62343587
anyone?
>>
File: 1482464371365.jpg (156KB, 430x720px) Image search: [Google]
1482464371365.jpg
156KB, 430x720px
>>62344081
Take that to >>>/trash/, oniichan
>>
>>62344066
Anon, if you live anywhere in the U.S, go into business. It's a capitalist country.

Everyone here codes for fun. Only a selected few in here probably have a job in programming and that's in Fiver, Upwork or an actual Salary based job.

Truth is, Whatever language you're being taught is probably the most flooded and can be done better than you by others.

Now you said something about Cybersecurity. Same. I'm doing the same thing. Except my dumb ass is currently attending a college that has Cybersecurity under the College of Business. Which means I won't learn Jack shit of programming/networking, except for my final year here.

I know C++, Python, HTML, CSS, learned by myself. If I could do it, holy shit imagine how many others could.

Trying to learn Networking through Cybrary dot it so I can get CompTIA A+ and Networking Certificate.

I have a list of other useful links given to me from an internship with the Department of Homeland Security in case you're interested. Just sit tight.
>>
>>62344121
kek
>>
>>62344066
learn everything to talk about it in interviews. once you get hired somewhere, there you will be able to become really good at a particular thing

it's amazing how good you become at a language/framework when doing it for 40 hours for a few weeks
>>
>>62343222
rollan
>>
>>62344152
Been there done that, rerollan
>>
>>62344121
>NEET thinks he has an opinion
thanks for the hearty kek anon
>>
File: Helpful Links for Younglings.jpg (195KB, 951x773px) Image search: [Google]
Helpful Links for Younglings.jpg
195KB, 951x773px
>>62344066
>>62344127
Image

Tip: Cybersecurity isn't Hacking and shit btw. If you want to learn that, it's Information systems, with a focus on Networks.

>>62344109
>>62343587
HTML and CSS I learned easily through this website, and I know several IT employees who use this immediately as a resource

W3schools dot com

For Python, I open a code that someone gave me and just used common sense and referenced it with C++

It's almost similar, so I can't guide you on that
>>
>>62344081
how hard is it to learn c# if I know plenty of java and hate it.
>>
>>62344066
Flexibility is good, but if you know one Programming language, you basically know them all.
>>
>>62344176
>NEET thinks he has an opinion
Yes, to get a job, winch C# toddlers tend to have less than Java fags. Fuck off lmfao
>>
>>62344187
thanks for replying. Do you think w3schools is better than freecodecamp.org? I used the website a lot during college for reference in html, but never as a complete experience.

Also I dont want to just open some python code and read it as I'm scared I'll miss some python good practices or may just come with shit code in general.
>>
>>62344198
Easy. The transition vice versa is more difficult because of how shit java is.

>>62344215
More than whatever language you use though. Please tell me you're not a haskellfag.
>>
>>62344215
C# is probably the weakest race imaginable
>Cucked by Micropenis
>Slower than Java
>Less job than Java

Why do they even try?
>>
decided to get my feet wet and wanted a small project that I would actually want to complete.
I want to create a bot for a crappy web browser game. (In the same category as like neopets)
Should I learn python or is there something better for this type of project?
Can anyone help me with any tutorials/useful links I should look into?
>>
File: 16387944.jpg (32KB, 552x446px) Image search: [Google]
16387944.jpg
32KB, 552x446px
>>62344246
>Everyone I don't like is a hasklelfag
>>
>>62344253
Microsoft fanboys are a bunch of sad, brainwashed cult
>>
>>62344229
I learned CSS and HTML in less than a week.

Go to Github
pick up any Python code
Try to "reverse engineer" and you'll understand how easy it is.

Programming is just "PC, do this if this and this and this and this, except if this and this and this and this, while doing this and this and this and this, also if this and this and this and this, do this and this and this, except if this and this and this."

Follow the code, if you can't understand a variable or function, google it.

Also, Python and other languages work in a way where you can't create everything, so people create libraries so you can get the job faster.

The first few lines of code is just accessing that library. Instead of writing 100 lines of code to create a square, you could just grab a library and create one in 2 lines.

Here's the list of many libraries
https://pypi.python dot org/pypi
>>
File: We_Can!.png (1MB, 1280x738px) Image search: [Google]
We_Can!.png
1MB, 1280x738px
I made a quick script to fetch urls from crunchy roll and the url I get is used with mpv to stream full hd with no f*ing flash, and no comercials, who wants to contribute so it's not hardcoded to the anime One piece

#!/bin/bash

episodenum=$1

episode="$(googler --nocolor --np crunchyroll one piece $episodenum | ack --lines=2 $episodenum $episode)"
echo $episode
>>
>>62344331
What do you mean no commercials?
You'd have to be a premium member for that, how would you "find a specific link" without it?
>>
>>62344355
crunchy roll does the job for you, the first result is always the chapter url, nope commercials work with flash, that's why you need flash player so they can pause your video an insert the ads, if you stream to another player with no flash, it's just the full video
>>
>>62344370
wow, that's even worse than 4chans implementation of recaptcha
>>
the world would be a better place if windows never existed
>>
>>62344370
84fMYFS

Join my discord, I want to talk more about this.
>>
>>62344253
>Cucked by Micropenis
Define cucked. C# is the best OOP language out there wether you liked it or not (if you try to deny this you have either never used C# or work at a pajeet tier job). And the insane freedom and ease of use provided by microsofts visual studio (desu comfiest IDE currently) with it's nuget packages is a huge bonus, while maven gave me ass cancer.
>Slower than Java
In what world do you live?
There is a reason why Java hosting is this expensive. (inb4 some autistic benchmarks tested under linux from 7 years ago with some irrelevant shit)
>Less job than Java
Yet it's twice as well payed and in the next 3 years Java will probably die to the hands of .NET completely. There are almost no new projects wrtiten in Java. The only Java jobs are about mainting existing projects. Stay pajeet, pajeet.
>>
>>62344381
lucky us
>>
>>62344253
not that anon
>Slower than Java
Silly claim. Too many things to consider.

>Less job than Java
Both in high demand, got a job a month after graduating last year. There's a few things to consider. Android/xamarin and how they affect listings, listing comparisons should be Java vs .NET not Java vs C#, how many Javascript listing are included when you search Java, location, etc.. I agree Java is in higher demand in general, but it's pretty close with all things considered.

>Why do they even try?
Better language, better tools, better frameworks.

You're right on the first part. It's getting better though.
>>
>>62344387
sure
>>
>>62344261
Waiting on the language.
>>
>>62344389
>>62344396
MS shills out in full force, arrives just in time to correct the record
>>
>>62344396
>Too many things to consider.
And yet slower than Java

>Both in high demand
And yet less jobs than Java

>Better language, better tools, better frameworks.
Only for micropenis os
>>
>>62344411
Not an argument
>>
File: 1490213164540.png (216KB, 1712x944px) Image search: [Google]
1490213164540.png
216KB, 1712x944px
>>62344389
>(inb4 some autistic benchmarks tested under linux from 7 years ago with some irrelevant shit)
lmfao it hurts, doesn't it?
>>
>>62344387
ummmm I can't find anything with that code where do I put it D: not used to discord sorry
>>
>>62344427
>And yet slower than Java
It's not though.
>>
>>62344009
all I need to know is that methods must have the same number of parameters as their generic function

also, &optional and &rest dont count
>>
>>62344459
>testing irrelevat shit
There is no way for Java to beat C# in web development enviorment and it's gets worse for java the bigger the project gets. Not the mention Javas OOP design itself forces you to write shitty unmaintainable code if you are not that experienced which is bound to happen when to happen at some time when working with other people.

P.S. Amazons entire backend is written in C# and yet it's lightning fast.
>>
>>62344472
http://discord DOT gg/84fMYFS
>>
>>62343973
okay, moron, how about you show an example to prove me wrong
>>
>>62344459
wtf I thought go was supposed to be fast
>>
>>62344459
C++ BTFO
>>
>>62344525
Just because you hardly have any features to compile, doesnt make you fast.
>>
>>62344525
This benchmark is retarded. People here are not even aware what it tests and for some reason it gets posted here all the time.
>>
>>62343827
what are you working on
>>
File: 1443564565234.jpg (32KB, 600x619px) Image search: [Google]
1443564565234.jpg
32KB, 600x619px
>>62344459
.net core
>>
File: 1502820322331.png (6KB, 321x321px) Image search: [Google]
1502820322331.png
6KB, 321x321px
>>62344565
>.net
>>
>>62344561
image tagger that used iptc metadata, and then it can rank the tags using microsoft trueskill based on lots of manual image comparisons by user; plus it can rip the tags from danbooru based on the image md5

everything works already just need to finish the gui
i want to be able to search and browse the images as well as tag and rank them
>>
>>62344585
Pajeet - the post
>>
>>62344459
>this kills the Stroustrup
>>
>>62344610
Why would not it. It must be the most irrelevant benchmark there is.
>>
File: 1486403872071.png (174KB, 962x543px) Image search: [Google]
1486403872071.png
174KB, 962x543px
>>62344600
Thanks for doing the needful and correcting the record, sir
>>
>>62344625
wow you really proved him wrong. how's that android app coming along rajeev?
>>
>>62344599
it looks pretty "aesthetic"
Are you working with raw Xlib?
>>
File: the most pajeeet thing ever.png (343KB, 500x744px) Image search: [Google]
the most pajeeet thing ever.png
343KB, 500x744px
>>62344599
c-cute! :3

>>62344625
I have no actual arguments so i must shitpost - the post
>>
File: 1474500624058.png (163KB, 653x892px) Image search: [Google]
1474500624058.png
163KB, 653x892px
>>62344643
>>62344653
Hello pootella? yes it's going rather great my team and rajesh are working hard for it
>>
>>62344646
haha ive tried that before but no its just bad gtk2

getting the images to display with their proper aspect ratios is a stupid hack i should replace it with my own cairo surface or something
>>
File: sanjeep.png (114KB, 1000x1000px) Image search: [Google]
sanjeep.png
114KB, 1000x1000px
>>
>>62344677
>It's actually real
I'm not surprised
>>
>>62344653
where's the beautiful and cleanly designed language? is it behind the C# logo?
>>
Can we just accept that both C# and Java are pajeet languages? There's 1.3 billion poos on this planet and they're bound to end up using all languages. The only non-pajeet languages are NEET meme languages like haskell and lisp.

PHP is undeniably the most pajeet though.
>>
>>62344515
>P.S. Amazons entire backend is written in C# and yet it's lightning fast.

Amazon employee here. No idea where you got this idea about C# being ubiquitous.
>>
>>62344747
Both of them are pajeet languages, one of them are self aware, the other one is a misguided pajeet that think he's white
>>
>>62344747
I agree
>>
>>62344760
>the other one is a misguided pajeet that think he's white
Every C++ programmer on /g/
>>
>>62344747
I worked with a bunch of pajeets, actually living in India, who programed exclusively in PHP and Perl. They seemed to favor Perl for whatever reason.
>>
>>62344760
I'd genuinely like to see pajeets using haskell.
>>
>>62344812
please do the mapfull
>>
File: 1504367059116.png (220KB, 900x800px) Image search: [Google]
1504367059116.png
220KB, 900x800px
How much bloat is not bloat?
People seem to not care about tens of megabytes, taking them for granted.
>>
File: 1485652958941.jpg (131KB, 591x800px) Image search: [Google]
1485652958941.jpg
131KB, 591x800px
Have you loved Lain today, /dpt/?
>>
File: 1474074445126.gif (295KB, 700x704px) Image search: [Google]
1474074445126.gif
295KB, 700x704px
>>62344852
>>62344846
lainmind
>>
File: 1489479247277.jpg (34KB, 720x480px) Image search: [Google]
1489479247277.jpg
34KB, 720x480px
>all this shitposting
It's a step up from talking about cocks and getting laid but not by much.
Lain is ashamed of you anons who shitpost.
>>
File: 1487081711929.gif (232KB, 500x388px) Image search: [Google]
1487081711929.gif
232KB, 500x388px
>>62344873
W E A R E A L L P A R T O F L A I N
>>
>TFW not confident enough to contribute to Open Source projects
>>
>>62344929
It'll come to you, anon
>>
File: 20108233.jpg (47KB, 640x677px) Image search: [Google]
20108233.jpg
47KB, 640x677px
Why is everyone posting BBC everywhere?
>>
>>62344949
Because /g/ died 10-11 years ago and what remains is a husk constantly being raped by retards.
>>
>>62344936
But when I find the strength to contribute my contributions are ignored anyway. I have a year old pull request open in Vim's repo and bram hasn't done anything, didn't even comment to tell me my code was shit ;_;
>>
>>62344971
Don't give up, anon
>>
File: 1478141418312.jpg (118KB, 500x500px) Image search: [Google]
1478141418312.jpg
118KB, 500x500px
>>62344971
Fuck them. Start your own project and have fags come crawling to you to approve their PRs.
>>
>>62344121
audible kek
>>
>>62343827
That was not the Mio I expected.
>>
>>62344427
>what is .net core
>>
>>
>>62345579
Tanlines are a miracle of the universe.
Also which language are you working with?
>>
>>62345628
cpp but not using gtkmm
mainly because i couldnt find a metadata library for C, well I did but it was way too complicated I think I was almost doing it manually
>>
File: 1503930995777.jpg (20KB, 540x540px) Image search: [Google]
1503930995777.jpg
20KB, 540x540px
crt0_c.c:(.text.startup+0x25): undefined reference to `WinMain'
>>
>>62345658
>cpp but not using gtkmm
How's this GTK library you're working with?
>mainly because i couldnt find a metadata library for C, well I did but it was way too complicated I think I was almost doing it manually
I think I know which one you're talking about. Last time I checked it was pretty bare bones and was lacking other metadata formats.
>>
>>62345524
A stub of .NET framework.
>>
>>62345884
just plain gtk/gtk.h gtk-2.0
>>
>>62345916
Ah, I assume you're using C++ almost exactly as you would use C then.
>>
>>62345943
im using oop and stl for non-gtk things. i need to get better at cpp for my job
>>
Why is C++ so weird
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
std::vector<std::string> v;
char delim{';'};
string current;
// read cin and store them into current
while (getline(cin, current)) {
// for each character in current,
for (char c : current) {
if (c != delim) {
current += c;
} else {
v.push_back(current);
// announce what you are doing
cout << "\nAdded " << current << "\n";
current = "";
}
}
}
cout << "\n";
// for each string in the vector v,
for (string& s : v) {
// print out what you have added
cout << s << endl;
}
}


Posts the weirdest shit imaginable
>>
>>62344127
>why do you guys hide your links like
> this dot com
>>
>>62344127
>cybersecurity
>except for my final year here
Exactly same with my uni.
What jobs can cybersecurity offer anyway? Aren't you just glorified pole guard on computer unless you're some kind of genius and actually get bigboy cybersecurity positions?
>>
>>62346018
this looks pretty sensible to me
>>
>>62346018
$ c++ main.cc -std=c++1z && echo "abc;def;ghi" | ./a.out

Added abc;def;ghiabc

Added def

abc;def;ghiabc
def
>>
>>62346039
dont compile this it deletes your home folder and emailes your doujins to CIA
>>
>>62346018
http://alexpolt.github.io/type-loophole.html

That's fairly recent.
>>
>>62346072
I can't even tell what the fuck I'm looking at.
>>
File: 1468882928057.png (199KB, 439x392px) Image search: [Google]
1468882928057.png
199KB, 439x392px
Little Anime girl here
>>
>>62346091
http://talesofcpp.fusionfenix.com/post-20/eggs.variant---part-ii-the-constexpr-experience
Things like this are amusing to read as well.
>>
>>62345984
Well good luck, anon. I hope to see more progress on cuteGrab!
>>
>>62346018
I still don't understand why this gives weird shit
Where did I go wrong?
>>
File: 1496711169003.png (1MB, 1200x900px) Image search: [Google]
1496711169003.png
1MB, 1200x900px
>>62346105
Baka here
>>
>>62346018
>>62346039
>>62346072
>>62346120
>C++ wasn't a mistake
>>
>>62346141
>pic unrelated
>>
>>62346126
thanks
>>
File: 1501345987050.jpg (250KB, 704x904px) Image search: [Google]
1501345987050.jpg
250KB, 704x904px
>>62346105
>>62346141
>>
>>62346120
>>62346072
man cpp is a rabit hole
>>
>>62346018
current += c;


That's a potential reallocation, and you're invalidating what current points to. I guess.
>>
>>62346151
>/pol/ nigger at charge of anything
>>
>>62346167
>weeb antifa in charge of grammar
>>
>>62346143
>>62346160
just don't use templates and don't use inheritance
that's it
just avoid those two things and C++ goes from garbage to amazing
>>
>>62346210
Templates are awesome though.
>>
File: thatfeel.jpg (53KB, 450x600px) Image search: [Google]
thatfeel.jpg
53KB, 450x600px
>tfw valgrind clean
>>
>>62343222
Absolutely no idea how to even begin writing an equalizer, so reroll
>>
>>62343222
roll
>>
File: ....jpg (18KB, 200x256px) Image search: [Google]
....jpg
18KB, 200x256px
Use D.
Now.
>>
>>62346235
you are fired.
>>
>>62346243
remove gc and we'll talk
>>
>>62346258
it is optional
>>
>>62346262
in theory, not in practice
>>
>>62346262
if you pay someone to clean the shit from the pavement and they tell you to just side step it, have they done their job?
>>
>>62346222
they're cool to dick around with and for writing silly papers
but I mean for production code and things you actually care about
>>
>>62343222
88 Turing Machine Simulator should be green or yellow
>>
>>62346018
import std.stdio;

void main()
{
const char delim = ';';
string[] v;
string current;
while ((current = readln()) != null){
string segment;
foreach (c ; current){
if (c != delim){
segment ~= c;
} else {
v ~= segment;
segment = "";
}
}
v ~= segment;
}
foreach (s ; v){
writeln(s);
}
}
>>
>>62346018
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
std::vector<string> v;
char delim{';'};
string current;
while (cin >> current) {
string segment;
for (char c : current) {
if (c != delim) {
segment += c;
} else {
v.push_back(segment);
segment = "";
}
}
v.push_back(segment);
}
cout << "\n";
for (string& s : v) {
cout << s << endl;
}
}
>>
>>62346254
Not like I were employed in the first place.
>>
>>62346293
>>62346312
Who did it better?
>>
>>62346312
#include <iostream>
#include <string>
#include <vector>
#include <utility>
using namespace std;

int main() {
std::vector<string> v;
char delim{';'};
string current;
while (cin >> current) {
string segment;
for (char c : current) {
if (c != delim) {
segment += c;
} else {
v.push_back(std::move(segment));
}
}
v.push_back(std::move(segment));
}
cout << "\n";
for (string& s : v) {
cout << s << endl;
}
}
>>
>>62346345
>Now with some extra power of autismâ„¢
>>
>>62346345
is there a difference between using push_back and emplace_back here?
>>
>>62346360
Rude. :c
>>
>>62346365
Nope, both will work the same way.
>>
File: 1491602798269.png (817KB, 1554x1500px) Image search: [Google]
1491602798269.png
817KB, 1554x1500px
>>62346262
That's true to an extent, but some of D's features are disabled by doing so. Thankfully the people working on the language are slowly making progress towards making the GC optional without any downsides.

>>62346272
It has has been done in practise. Go read up on dlang before posting your ignorant opinions.

>>62346366
This picture's for you, anon!
>>
>>62346392
>This picture's for you, anon!
Cheers, Anon. :3
>>
File: 2017-09-10-131525_627x951_scrot.png (25KB, 627x951px) Image search: [Google]
2017-09-10-131525_627x951_scrot.png
25KB, 627x951px
Trying to make a common interface for managing sockets with epoll on Linux and ioctl on Windows.
>>
VMWare fell for the Rust meme
https://research.vmware.com/files/attachments/0/0/0/0/0/2/0/balasubramanian_bbprr_17.pdf
>>
Wait subtracing same type of pointers handle the size corrently?
so
int ints[10];
int *i0 = ints;
int *i1 = i0 + 1;
int diff = i1 - i0; // diff is 1, instead of sizeof(int)
>>
>>62346494
Yeah, that's one of the nice things that C handles for you.
>>
>>62346494
Yes, pointer arithmetic works basically the same as array indices (array[0], array[1]...)
>>
>>62346512
make sense.
>>
>>62346493
>/0/0/0/0/0/2/0
>>
File: 21371281.jpg (51KB, 666x960px) Image search: [Google]
21371281.jpg
51KB, 666x960px
Nothing

I'm very tired and watching random youtube videos. Then I found out about "The Amazing World of Gumball"
Absolutely got hooked at this 1 minute song
https://www.youtube.com/watch?v=l7G5RDFyxFc
>>
>>62346648
Nice blog, faggot.
>>
>>62346691
Nothing wrong with being a faggot
>>
>>62346648
wow that's good
wonder who they hired to write it
>>
>>62343187
This actually looks like a really good resource just going by the home page, but what does everyone here actually think of it?
>>
>>62346648
that pic
>Friend: cute, but that number won't save you from this number
>Me: What number is that?
>Friend: .44
>>
>>62346648
that kid actually did pretty good, in fact I'm not sure if it's actually an adult's voice pitched higher
>>
>>62346779
the way that the person fails to finish the last syllables of sentences and can't pronounce the word "drenched" leads me to believe it's a kid
>>
>>62346436
Wut color scheme?
>>
>>62346436
That's pretty cool, anon.
>>
>>62346842
Its Tomorrow-Night-Bright
>>
Is there any way to make a GtkImage from a cairo surface in gtk 2? I'm getting tempted to switch over to gtk 3 because it has a function to create one easily, but I don't want to support that shitty toolkit by writing software in it. I'm still salty over that update that broke themes.
>>
>>62345893
which runs on linux and puts "muh crossplatform" java cucks on suicide watch
>>
File: 1477653414078s.jpg (4KB, 250x250px) Image search: [Google]
1477653414078s.jpg
4KB, 250x250px
>>62346930
>which runs on linux
And performs worse than Java
>>
>>62346345
this one will attempt to move from segment twice if the last character of an input is the delimiter, but segment will have been invalidated by the first move
>>
circleci or travisci
>>
>>62346699
>>>/int/79319125
>>
>>62343222
saved for future reference.

Currently cannot do anything on this list.
>>
>you have 2 weeks to write something in C# to impress us
Your move?

(Company is neat and hr girl is hot as shit, I need to succeed)
>>
>>62347221
a dht crawler
>>
>>62347221
an operating system
>>
>>62347221
Make an improved version of their product.
>>
>>62347268
kek
>>
>>62346983
How is that even possible when Java's generic containers are just shitty cast macros?
>>
What language is the dark souls of programming languages?
>>
>>62347338
Malbolge
>>
>>62347338
C++
>>
>>62347338
Rust
It's harder than it should be, edgy and a waste of time and effort.
>>
>>62347372
Rust is many things but none of those
>>
>>62347380
>harder than it should be
Vec<Rc<RefCell<Box<Trait>>>>
>edgy
pink haired trannies
>waste of time and effort
#49 on the TIOBE index (which is most likely boosted by Rust zealots)
>>
>>62347409
>Vec<Rc<RefCell<Box<Trait>>>>
please post actual code next time
bonus points if it's less clear than equivalent C or C++
>>
>>62347469
https://www.reddit.com/r/rust/comments/33jv62/vecrcrefcellboxtrait_is_there_a_better_way/
>>
>>62347286
https://en.wikipedia.org/wiki/Singularity_(operating_system)

>>62347338
Haskell
>>
>>62347476
I agree with one of the commenters: being forced to spell out the exact semantics of what you want is a good thing. Bad verbosity is having unnecessary indirection just to fit a "design pattern".
>>
>>62347476
no bonus points for you
>>
>>62343175
If you can't even find your own resources trivially you shouldn't even start programming honestly.
>>
>>62347559
verbosity is not elegancy
Being verbose adds noise to the code which makes it hard to read.
Haskell is a good example how elegant code should look like: as little noise as possible.
>>
>>62347653
Haskell is not a systems programming language, it has a GC. Deterministic lifetimes matter in Rust, so the type system must represent that.
Post better examples in C, C++ or other languages with similar goals.
>>
>>62347338
>the dark souls of programming languages
You're looking for Forth.
>>
>>62347369
>C++
That's the Castlevania II: Simon's Quest of programming languages, if anything.
>>
>>62347338
>What language is the dark souls of programming languages?
What does this even mean?
>>
>>62347663
There's no excuse for a modern programming language to be verbose. It doesn't matter if the programming language has a GC or not.
C is an elegant systems programming language, but it lacks compile time safety. C++ is bad in every aspect. Rust has bad syntax.
Rust might be good for actual systems programming, but it's too much a hassle for user space software.
>>
>>62343222
>2: elastic queue
What the fuck is an elastic queue anyways? Every site I look up describes it with a meme word salad or synergistic management solutions tier rambling.

Is it just a message queue with multiple consumers and producers?
>>
File: c.jpg (13KB, 540x45px) Image search: [Google]
c.jpg
13KB, 540x45px
When you do pic related does it store values in trans_unit, quarter and trans_amt or just checks them without storing?
>>
>>62347812
It evaluates the function as it would in normal code and sets the "status" to the return value of the function.
The actual storing happens inside the function anyway. It doesn't matter how you call it.
So yes, it stores the value.
I don't know what you mean by "check" in this context.
If you have questions like these I suggest you step through the code.
>>
>>62347734
Hard to master but rewarding, I assume.
>>
>>62347883
Sepples fit there. It's just very hard to master.
That Scott guy makes a living just knowing the language so clearly very rewarding.
>>
>>62347763
>C is an elegant systems programming language
Which of these is worse?
Vec<Rc<RecCell<Box<Trait>>>>

// no generics lol
// this would be even more hellish without void* but let's assume I never want to reuse this code for anything elsea
struct Vector
{
struct Rc
{
struct Box
{
void *data; // impls trait;
struct TraitVtable *vtable; // let's assume this is already defined
}
*data;
int *refcount;
}
*data;
int size, capacity;
};

struct Vector vector;

A good type system costs nothing, but C's type system is trash. Safety is secondary - expressiveness and conciseness is what matters.
>>
>>62347911
I agree with you in principle but the end goal here is horrible. Nobody should ever write code like this. Especially not concerning highly utilized components like vectors and representations of geometric shapes.
And reference counting on top? Lord have mercy.
>>
>>62347911
Only a retard would write C like that.
You just want an linked list of void pointers.
>>
>>62347905
>It's just very hard to master.
Mainly on account of its poor and extremely bloated design.

>clearly very rewarding
It has very little to offer as compensation for all the difficulties it poses, so no. C++ is not a powerful language by any stretch.
>>
>>62348006
Plebbit poster wanted a vector of reference counted runtime-dispatched trait implementations.

What does a linked list have to do with that?
>>
>>62346910
Still waiting for anyone to even look at my question…
>>
Is there a preprocessor-like tool for C which lets me do Java-style compiletime checked generics which just compile down to regular old void* with casts?
>>
>>62348084
cfront
>>
>>62348052
There are no traits for C, so you should look for an alternative solution.
>>
>>62348325
That's what the
struct Box { void *data; struct Vtable { /* function pointers */ } vtable; };
is for.
The same thing except more boilerplate.
>>
>>62348366
That's more readable than Vec<Rc<RecCell<Box<Trait>>>> IMO.
>>
File: Untitled.png (3KB, 467x189px) Image search: [Google]
Untitled.png
3KB, 467x189px
Write a function that receives the points M1, M2, and N, and finds out whether N is between the other two in 3D space.
No, this isn't my homework.
>>
>>62346766
It looks interesting. I'll try it out and report my experience at some point.
>>
>>62348432
Where did you get that from? I got that question during a code assessment.
>>
>>62348459
Friend of mine is making a game and needed this.
>>
>people want better C
Literally just C with better standard library, like define the fucking API for threading and and compiler flag for platforms that supports it. Now do it for utf8, directories and file paths, basic data structures.
Maybe smarter compiler like, recursive macros and maybe some kind of modules instead of headers.
Saner types without the _t ending so every faggot doesn't have to rename uint32_t to u32.
>Solutions proposed
GC
Uglier syntax than ATS
Name mangling
nonstandard ABI
Anything but C what people want from C
>>
>>62348387
That's because you're only seeing the Box part. You still need to have a Vector struct and a Refcount struct
struct Vector
{
void *data;
int size, capacity;
};

struct RefCount
{
void *data;
int *refcount;
};

struct Vector my_vector;
/* init shit */

// now each time you want to use something
Box box = (((Box*) ((RefCount*) my_vector.data).data);
box.vtable->traitImpl(box.data);
>>
>>62348517
refcouting is evil and kill the performance, though.
Operate on vectors and free blocks of memory once.
>>
>>62348534
Refcounting is evil and shouldn't be used often, but that's what was asked for so that's what I'm demonstrating.
>>
Actual programmers who really understand your field of work, could you please post:
>your choice of OS
>your choice of text editor/IDE
>>
>>62348573
work computer: windows 10, visual studio 2017
home computer: ubuntu, code::cocks
>>
>>62348573
windows
notepad ++
>>
>>62348573
>your choice of OS
Linux
>your choice of text editor/IDE
vim/IntelliJ

android dev
>>
>>62348432
>how do i find out if 3 points are colinear
Google is your friend, buddy.
>>
>>62348610
Nah ,I want to see /g/ do it
>>
Can I use pointers in macro's?
I need to check the system endianness, and I want to know if I can do it in a macro,before main.

Thanks.
>>
>>62348674
You can utilise the asterix
>>
>>62348674
Funny that there's no existing compiler flag for that
>>
>>62348613
Take one component of the point you're testing, see how far along it is on the line. Calculate the other two components for a point that far along on the line. See if this point is close enough (for your liking) to the point you're testing.
>>
>>62348495
The problem is that people want memory safety. With GC or affine-types, you can prove that your type system ensures that no memory will be corrupt etc. But as soon as you allow pointer arithmetic, all those proofs go out the window and every operation has the capability of being completely undefined.
Its difficult to make a language today with the same level of unsafety as C and be taken seriously, but the problem is that fixing that unsafety causes the aforementioned problems.
e.g., putting the language in a memory safe VM makes the language less efficient, usually removes any chance of an ABI (because the language lives in a VM world that is not the same as the linux C world).
Trying to do without a GC and still maintain memory safety requires introducing a lot of extra things to the type system. Rust actually does a good job of making the borrowing system easy to use; a naive approach that didn't value "ergonomics" would be twice as awkward and three times as unreadable. Then introducing things like generic requires name mangling etc
>>
>>62348758
Alternative: find the plane such that the vector M1->M2 is its normal and M1 is a point on said plane. Project N onto this plane. If the projection has a length close enough to 0, N can be said to be on the line (M1,M2).
>>
File: Capture.png (12KB, 485x313px) Image search: [Google]
Capture.png
12KB, 485x313px
Could I just ask why C++ is so ugly?
Why are there so many -> operators?
Why can I violate scope with ::?
#include "Pizza.h"

#include <list>
#include <algorithm>
#include <string>
#include <iterator>

using namespace std;

Pizza::Pizza() {
;
}

void Pizza::makeDough(string dough) {
this->dough = dough;
}

void Pizza::addSauce(string sauce) {
this->sauce = sauce;
}

void Pizza::addCheese(string cheese) {
this->cheese = cheese;
}

void Pizza::addTopping(string topping) {
toppings.push_back(topping);
}

void Pizza::addToppings(string* toppings, int n) {
for (int i = 0; i < n; i++) {
this->toppings.push_back(*(toppings + i));
}
}

void Pizza::print() {
cout << "A nice-a pizza with ";
cout << this->dough + " dough, ";
cout << this->sauce + " sauce, ";
cout << this->cheese + " cheese, ";
cout << "with ";
list<string>::iterator iter;
for (iter = toppings.begin(); iter != --toppings.end(); iter++) {
cout << *iter + ", ";
}
cout << "and " + *iter;
}

Pizza::~Pizza() {
;
}
>>
File: 1504905893631.png (311KB, 652x669px) Image search: [Google]
1504905893631.png
311KB, 652x669px
How ugly/retarded is this?
 
if (tic_tac[1][1] == 'o' && tic_tac[0][0] == 'o' && tic_tac[0][2] == 'o' && tic_tac[2][0] == 'o' && tic_tac[2][2] == 'o')
winner = 'o';
if (tic_tac[1][1] == 'x' && tic_tac[0][0] == 'x' && tic_tac[0][2] == 'x' && tic_tac[2][0] == 'x' && tic_tac[2][2] == 'x')
winner = 'x';

I couldn't come up with a loop that check diagonals in 3x3 board for a winner in tac tac toe. Rows and columns were easy
>>
>>62349040
>Why are there so many -> operators?
Because that's how pointers work. use references if you don't like it.
>Why can I violate scope with ::?
That's not violating scope, that's just entering a scope.
>>
>>62348839
Horrible.
Hint: use vector colinearity
>>
>>62349045
Examine a three by three board:
[ ][ ][ ]
[ ][ ][ ]
[ ][ ][ ]


With a 2d board, there are only two diagonals; Forward slash and Backslash.
You could model these with this:
for (int i = 0; j = board.length; i < board.length; i++, j--;) {
board[i][j] == 'x' || board[i][j] == 'o';
}

for (int i = 0; i < board.length; i++) {
board[i][i] == 'x' || board[i][i] == 'o';
}
>>
>>62349066
>muh opinions
>hint: solve the problem you're trying to solve
Typical /g/ brainletism.
>>
File: 1449592383375.gif (2MB, 380x214px) Image search: [Google]
1449592383375.gif
2MB, 380x214px
>>62349045
Just check if they are similar, then set winner = turn;

>pic related is how I made tic tac in c++
>>
>>62349124
Finding a plane alone requires gauss elimination and potentially parametrisation.
Returning the negated bool value of the sum of the length of M1N and M2N would be simpler.
>>
Reminder to define your functions to handle vectors and then add function to handle the single item case.
Instead of first defining function that operates on single item and then making function that calls that single item handler on vector of inputs.
>>
>>62349058
References look almost as bad as ->.
I understand that most of C++ is just definitions over C, and I know that most objects are really just pointers to structs, but my god, it feels like a clusterfuck.

I'm coming to this from two ends: nice and fancy java and the barren wastes of C, and it feels really wrong.
>>
>>62349045
>>62349151
woooops, that was Hitler
>>
>>62349158
>Finding a plane alone requires gauss elimination and potentially parametrisation.
>t. i don't know how to project a point onto a plane given its normal and a point on the plane
As I said, typical brainletism.
>>
>>62349161
C++ has many faults, but it also has RAII.

>nice and fancy java
anon wtf
>>
>>62348573
Debian GNU plus Linux
Vim (C, C++, Python)
Netbeans (Java)
Qtcreator (Qt C++)
>>
>>62349261
Java's especially shit about this
>muh reference types
C and to a lesser extent C++ make it easy to see what's a value and what's a reference.
>>
>>62349170
>>62349121
I will study these, thanks
>>
>>62349290
It's not ambiguous in Java. You just need to remember that primitives are values, objects are references, and what the set of primitives is.

Of course this has horrible implications for performance because you can't pass objects by value.
>>
>>62349241
Okay, how would you project it withoutvector multiplication
>>
>>62349326
It's especially shit when it comes to generics, because then you have to start boxing things.

Still, better than C# with its struct bullshit. Or D.
>>
>>62348573
Got Manjaro at home atm, also use Debian
vim
>>
File: consider.jpg (29KB, 600x600px) Image search: [Google]
consider.jpg
29KB, 600x600px
new thread, though
>>62349370
>>
>>62348084
M4 but why would you do that?
>>
>>62349045
>>62349121
Both are ugly.

int c = m[1][1];
if(c == m[0][0] && c == m[2][2] || c == m[1][0] && c == m[0][2])
winner = c;
>>
>>62348573
Any flavor of Linux with Neovim is fine.
>>
>>62349426
m[2][0]*
>>
>>62346210
>>62346284
t. retard
>>
>>62348432

return dot(normalize(n - m1), normalize(m2 - n)) == 1;
>>
>>62346436
Why do Ctards like to make all their type names snake_case and append _t onto it?
>>
>>62349336
>withoutvector multiplication
What do you mean by "vector multiplication"? You can do it with a dot product, if that's what you mean, and I see no problem with that. Not saying it is the best solution, but it's not "horrible".
>>
>>62349158
>>62349637
Implementation of (>>62348839):

n = unit(m2 - m1)
v = p - m1
v2 = v - n * dot(v, n)
return dot(v2, v2) < epsilon

This solution uses only one square root, and it has the advantage that the normal can be reused to test against multiple points.
>>
Wanted to learn functional programming and downloaded Haskell.

Right now, I'm having trying to something trivial like finding the largest 2 of 3 number, but I'm having a hard time structuring the function to do so. There's just something about it that isn't clicking with my brainlet mind.
>>
>>62351343
How would you do it in an imperative programming language? I don't see how it would be much different for this specific task.
Thread posts: 324
Thread images: 53


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