[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: 311
Thread images: 25

What are you working on, /g/?

Old thread: >>59982188
>>
nth for hows your day going?
>>
File: 1489089208434.jpg (93KB, 960x600px) Image search: [Google]
1489089208434.jpg
93KB, 960x600px
>OOP
>>
>C
>D
>E

Why are programming languages so uninspired?
>>
I am a coder
>>
>>59988856
Just finish the alphabet then.
>>
>>59988813
my life
>>
>>59988856
You forgot
>B
>>
>>59988891
I wish I could.
>>
Whats the most interesting programming language name?
And what is the most interesting programming language in general?

no brainfuck or any clone pls
>>
How did C# do async networking before async/await?
>>
>>59988930
name: ocaml
interesting: lisp
>>
Asking again because it is important.
I need some help with a program.
I'm running a windows active directory for my business, now we're looking to expand, and I'm trying to create a program where an user with rights can change passwords of other users in their devices. The passwords are stored on a local ftp server, but the user with the rights should use the windows logon to access the program. Is that possible? And how doable is it? I can access the AD, and can see the user and their groups, but don't know which users have which rights.
This is a complex question, but still, I need help, and don't want to hire externals to write it, I'd rather do it myself.
>>
What is man supposed to use when here's just no good statically typed and compiled language.
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
too verbose, also static typing not standardized
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters, also uglier than sepples
> any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros
>haskell
generates garbage 1GB/s
>>
>>59988964
AnimeLang
>>
>>59988964
Most of the community including walter and andre want it gone now.
Its just gonna take forever to strip and convert things.
>>
>>59988964
>good statically typed and compiled language.
C#. Obviously. C++ isn't bad either, if you stick to the good parts.
>>
>>59988813
i love lain
>>
>>59989004
>C#
>typed
>C++ isn't bad
What was he going to mean by this?
>>
>>59988888
wew
>>
>>59988964
[spoiler] Ada [/spoiler]
>>
>>59989050
How is C# not statically typed my dude?
>>
>>59988964
nim
>>
if i already know haskell to a degree and java, how good of an idea would it be to learn scala? i want a good OOP language
>>
>>59989152
>a good OOP language
Such a thing can't possibly exist.
>>
>>59988964
Java, it is literally the only sane choice for a statically typed language.
>>
>>59989181
He said "good"
>>
>>59988888
reality check
>>
>>59989198
no language is good sorry. Java is the best you'll get.
>>
>>59988953
Please help
If you need more info I can give it
>>
File: 1487820620038.jpg (197KB, 1200x900px) Image search: [Google]
1487820620038.jpg
197KB, 1200x900px
>>59989168
Do you have any valid criticisms of OOP or are you just parroting the contrarianism you heard on /g/ because you think it makes you a k3wl special snowflake?
>>
@59989235
>k3wl
Stopped reading right there. Feel free to rewrite your post if you want a legitimate answer.
>>
>>59989152
smalltalk
>>
>>59989249
>@
Fuck off back to twitter, newfag
>>
@59989235
The only real bad thing about POO is a language that supports multi-inheritance.
>>
>>59989265
i don't want to learn greek, i want to learn something that's both used in industry and not terrible. is small talk used in industry? i've only heard of it as a historical language
>>
@59989279
Only an obvious redditor would not know it. Back to your subreddit.
>>
>>59989249
'k3wl' is the exact sort of inane term to describe you and your ilk, so deal with it.
>>
>>59989296
>still failing at quoting
>calling anyone else a redditor
>>
@59989319
Why do you keep denying being a redditor? Fuck off.
>>
>>59989075
I'll add it next time. What do you think about

>Ada
Too good
>>
>>59989285
Kotlin?
>>
>>59989328
>still can't figure out how to quote people
>calling anyone else reddit
Just click the post number, retard, no need for the '@' symbol. I know you're new here but this isn't that hard
>>
>>59989319
Whom are you referencing these statements from?
>>
>>59989360
>>>/s4s/

fuck off
>>
@59989347
I want to see the reasoning why you're not from reddit, which you obviously are.
>>
>>59989347
Who said that?
>>
File: 1490560788546.jpg (270KB, 750x728px) Image search: [Google]
1490560788546.jpg
270KB, 750x728px
>>59989370
>still using twitter-style hyperlinks
>calling anyone else reddit
my sides
>>
>>59989347
>>59989370
>>59989392
i can't tell who's baiting who anymore
>>
>>59989281
Multiple inheritance is great and only brainlets think otherwise.
>>
@59989392
What is "twitter"? Is that what your subreddit is called?
>>
Just dicking around with Common Lisp.
Long term goal is a ebook organizing tool since I do not want to do it by hand since I have several thousands. The idea is to implement a basic management functionality in a non-shit way (inb4 use calibre) such as extracting ISBN, downloading book infos from amazon, displaying the book and remembering where I left of.

So far Im experimenting around with multithreaded file-crawling which proved to be surprsingly easy considering that CL does not natively support multithreading.
>>
>>59989432
single inheritance is bad enough.
multinheratence is an unholy abomination
>>
>>59989443
It's where you came from, now go back there
>>
>>59989446
>code
>>>/g/wdg/
>>
>>59988964
Swift?
>>
@59989477
I don't want reddit stink nearby. Fuck off.
>>
>>59989513
>claims not to be from twitter
>can't figure out how to not use the twitter link style
>>
>>59989562
erlang isn't POO
>>
>>59989562
poll: Pick a POO lang for me to learn that isn't too bad. Want something kinda that can be decently functional, used in industry is a plus, already know Java
>>
>>59989599
>>59989562
http://www.strawpoll.me/12789948
>>
>>59989608
If you absolutely have to choose either of these shitlangs Scala is by far the best choice. And that's saying a lot, considering how trash Scala is.
>>
>>59989562
>http://www.strawpoll.me/12789929
fixed your poll:
https://www.strawpoll.me/12789993
>>
>>59988932
APM

It was horrible.

All hail the async await overlords.
>>
>>59989717
Yet another case of C# being improved by a new monadic construct
>>
>>59989473
Why?
>>
Refinement types are criminally underrated.
>>
>>59989866
dependent types + equality types are better
>>
>>59989898
This
>>
>>59989901
Kore
>>
File: unknown.png (13KB, 941x249px) Image search: [Google]
unknown.png
13KB, 941x249px
So what flavor of regex .net is using exactly?
I'm reading PCRE-esque, but this regex here won't validate properly, it's supposed to enable Next only if string in box matches
>>
File: Untitled.png (47KB, 808x455px) Image search: [Google]
Untitled.png
47KB, 808x455px
for example , in GTA V what does it mean when a car collides with a person, in terms of programming?
an array of integers collided with another array?
>>
>>59989957
You stupid fucking frogposter, this is the dumbest fucking frogpost I've ever had the misery to fucking read. I hate you, I hate your family, I hate your grandparents, go away
>>
>>59989940
>[OutputType([boolean])]
>param([System.windows.forms.tabpage]$tabpage]

fucking cancer
>>
>>59989235
Not that guy but:
>>59983778
>>
>>59989940
The fuck are you writing in? Powershell?
>>
>>59990012
dot Perl
>>
File: real time collision detection.jpg (25KB, 526x648px) Image search: [Google]
real time collision detection.jpg
25KB, 526x648px
>>59989957
I doubt this is a serious question. But most of what's covered in this book likely happens in a big complex game like GTA V. And likely some other things too.

You have something called 'collision geometry' (gamers know of it as hitboxes) and you run comparisons on it to determine if they intersect or not. If they don't nothing happens, if they do there's a response to the collision.
>>
>>59990012
Yes, I never dabbled with it before and it seemed the fastest way of getting up some GUI automation for some tedious tasks that I don't want to do by hand anymore really
>>
>>59988813
http://www.huffingtonpost.com/entry/this-company-is-trying-to-close-the-orgasm-gap-by-giving-away-free-sex-toys_us_58de5b6fe4b0e6ac70944394

>feminist software developers developing software
>oh wait
>>
>>59990119
Excuse me?
>>
>>59990119
Don't bring that junk up here. Go to /v/, /pol/ or something.
>>
>>59989957
>>59989984
>>59990085
Not programming.
>>>/v/
>>
>>59990194
At least point to >>>/vg/agdg
Would you point people to /mu/ for discussion on programming sound mixers?
>>
>>59990207
Yes, I couldn't care less where they go. I just don't want their kind anywhere near me.
>>
So when you call the constructor of a derived class in c++, you automatically call the constructor for the parent class, and you can add additional arguments to the constructor of the derived class that weren't in the constructor for the parent class.

So that means that in reality, a square is a special case of a rectangle with all sides equal, but in c++, the parent class would be the square because the constructor for the rectangle requires an additional argument that the square doesn't require: the length of the other pair of sides. Am I understanding this right?
>>
File: output.webm (2MB, 1920x1080px) Image search: [Google]
output.webm
2MB, 1920x1080px
Mouse over TCP for my raspberry pi, so I can use my phone when I can't find my mouse
>>
>>59990189
wew u bigot enjoy your orgasm privilege
>>
>>59990344
>enjoy your orgasm privilege
I will
>>
>>59990309
Yes and no.
>>
>>59989957
Since GTA V uses the open source Bullet physics engine, you can see for yourself how it is done, frogposter.
>>
>>59990334
you should add more blur, image is still way too clear
>>
File: th.jpg (9KB, 300x300px) Image search: [Google]
th.jpg
9KB, 300x300px
https://youtu.be/_0s69D0bE7o

Latest project, please r8. I'll post code if anyone's interested.
>>
>>59990466
blame /csg/ for talking me into buying a xiaomi
>>
>>59990476
I would have said 7/10 but you used a frog so 1/100
>>
>>59990309
>So when you call the constructor of a derived class in c++, you automatically call the constructor for the parent class

You automatically call the default constructor unless you specify otherwise.

>the parent class would be the square because the constructor for the rectangle requires an additional argument that the square doesn't require: the length of the other pair of sides. Am I understanding this right?

Not necessarily. You could make the Square constructor like this:

Square(float x) : Rectangle(x,x) {} 


Where the Square constructor sends it's single value as both the x and y value of the rectangle. In this specific example, you probably wouldn't even bother making them separate classes.
>>
File: 1481312957264.jpg (44KB, 396x385px) Image search: [Google]
1481312957264.jpg
44KB, 396x385px
>>59990490
35.5/100 so far, not too bad
>>
>>59990532
35.5% is a failing grade
>>
File: 1489011621386.jpg (54KB, 600x796px) Image search: [Google]
1489011621386.jpg
54KB, 600x796px
>>59990548
You overestimate my ambitions anon
>>
>>59990582
Kek
>>
>>59990309
#include <iostream>
#include <sstream>
#include <string>

class rectangle {

public:

rectangle (int l1, int l2);

int l1 () const;
int l2 () const;

std::string str () const;

private:
int _l1;
int _l2;

};

inline rectangle::rectangle (int l1, int l2) : _l1 (l1), _l2 (l2) {}

inline int rectangle::l1 () const {
return this->_l1;
}

inline int rectangle::l2 () const {
return this->_l2;
}

inline std::string rectangle::str () const {
std::ostringstream oss;
oss << this->_l1 << 'x' << this->_l2;
return oss.str ();
}

// strange error message
// error: declaration of ‘operator<<’ as non-function
// std::ostream &operator << (std::stream &os, const rectangle &rect) {
// return os << rect.str ();
// }

class square : public rectangle {

public:
square (int l);

};

inline square::square (int l) : rectangle (l, l) {}

int main (void) {
rectangle rect (10, 3);
std::cout << rect.str () << std::endl;
square sq (7);
std::cout << sq.str () << std::endl;
return 0;
}
>>
>>59990610
You forgot to include <ostream> and the namespace specifier std:: in your argument, which leads into your error.
>>
>>59990630
nope, i found it. It's just I std::stream instead os std::ostream

g++ error messages are the best error messages
>>
I am absolutely stuck on a C++ assignment.

So I have to read in a series of parameters to a class object and then add it to a vector of the same type. Reading in works perfectly, but for some reason it won't add to the vector with .push_back()

Am I missing something? Does it need to be declared as a pointer or something?
>>
>>59990703
>Am I missing something?
Yes.
>>
>>59990703
code or GTFO
>>
scala or ruby?
>>
>>59990735
No thank you
>>
>>59990737
based
>>
>>59990737
No. Thank *YOU*
>>
Moving the cursor with left and right arrow keys and inserting and removing characters at the cursor position now works in my text editor.

It's now essentially usable for writing and editing very small text files.
>>
>>59990765
Can you share the code? Is it free?
>>
>>59990703
>read in a series of parameters to a class object and then add it to a vector of the same type
I don't understand what this means.
>>
>>59990772
>code
It's not "code".
>>
>>59990781
They give you parameters for your objects, then add your new object to a vector.
>>
>>59990798
STFU
>>
>>59990709
class Thing
{
private:
double a;
public:
void setA(const double a);
double getA() const;
}

int main()
{
vector<Thing> list;
double x;
cin >> x
Thing dick;
dick.setA(x);
list.push_back(dick);
}

Is basically what I'm doing and what isn't working. The vector doesn't populate at all.
>>
>>59990772
I haven't really considered that.
I'm just writing it for my own educational purpose and for the satisfaction in getting to use my own software in the future.
>>
>>59990798
Wat?
>>
>>59990819
github? gimme da link anon
>>
File: 1483907140525.jpg (62KB, 873x927px) Image search: [Google]
1483907140525.jpg
62KB, 873x927px
>>59990819
I would like a link too.
>>
>>59990194
implementing solid collision detection is more programming related than anything in this thread.
>>
>>59990870
>>>/v/
>>
>>59990894
>>>/trash/
>>
>>59990851
>>59990859
Sorry. It's not up on github, and i'm too tired to fix that right now.
>>
>>59990085
Hey, i read that book!
It's a good book for collisions detection. Unfortunately, as soon as you want to move on to collision response, you're fucked.
>>
>>59990931
see >>59990194
>>
>>59990894
/v/ is the discussion of games, not programming.

in a sense, /g/ is the discussion of software, yet there's still a programming thread here.
>>
>>59990931

Aren't the best collision responses mechanics problems that would ideally involve kinetic energy and stuff like coefficients of restitution? Obviously, you could simplify it a lot by hand waiving some of it into some number you pick instead of actually understanding the physics.
>>
>>59990958
Yes, which is why I told him to go there.
Discuss your games on a board meant for discussing games. You can fuck off now.
>>
>>59990714
>>59990781
I didn't explain it well

>>59990814
Just isn't adding to the vector at all.
>>
>>59990978
>can't even implement collision
brainlet detected
>>
>>59990978
No fuck you
>>
>>59990814
Here is a working example, I'm assuming you didn't show us all your code? Otherwise classes don't really work like you think they do.
#include <vector>
#include <iostream>
using namespace std;
class Thing {
private:
double a;
public:
void setA(double t){a = t;};
double getA() {return a;};
};
int main()
{
std::vector<Thing> list;
double x;
cin >> x;
Thing dick;
dick.setA(x);
list.push_back(dick);
cout << list[0].getA() << endl;
}
>>
>>59990972
Yes, it's just basically Newtonian mechanics. Not *terribly* difficult. Problem is, to calculate a believable physics response you need some condition parameters from the collision, that most collision detection algorithms don't give you.
They just go
>Yep, that's a collision. What now, motherfucker, what the fuck now?
>>
>>59990814
That works just fine, idiot.
>>
>>59991071
Yeah that isn't all my code by a long shot. Pushing 1000 lines on this retarded assignment.

Problem is I'm not seeing anything that I'm not already doing. The .push_back(x) is nested two functions deep though. Vectors pass by reference by default right? I'm not getting any compiler errors.
>>
>>59991123
>Vectors pass by reference by default right?
Lol, no. This isn't Java.
>>
>>59988813
>What are you working on, /g/?
your mother
>>
>>59990931
>as soon as you want to move on to collision response, you're fucked.
Well that part is entirely game specificthough.
>>
>>59991135
Ok well i have my issue it's working now I'm just gonna kms
>>
>>59991081
But the book covers plenty of algorithms that help you with that.
>>
>>59991123
You might need to clarify what you mean. The default passing scheme is always by value. Passing by reference is only done by explicitly using the & operator in the parameters list
void myFunc(vector<int> myInts) {
//The entire myInts vector is COPIED, changes ONLY occur in local scope (i.e. in function)
}
void myFunc(vector<int> & myInts) {
//You are passed a REFERENCE to an exterior myInts vector, changes inside local scope are seen outside
}
>>
>>59990958
>in a sense, /g/ is the discussion of software
What? no. /g/ -technology
Everything from cutlery to satellites as long as you cake the technical aspects in consideration.
>>
>>59991161
True. And it also depends on the geometric complexity of you collision objects.
But more often than not i'd say you want some kind of facsimile of real world physics. Especially if you're making a real time 3d game.
>>
>>59991187
Not that i recall.
>>
File: RTCD.png (150KB, 427x930px) Image search: [Google]
RTCD.png
150KB, 427x930px
>>59991229
Ok, well it's there. Not the physics stuff but there's more than just collisions here.
>>
>>59991001
Who are you quoting?
>>
>C can't have methods with the same name like Java

public static void foo(int a)
{

}

public static void foo(double a)
{

}
>>
>>59991283
Yeah I like that too.
You'd think more modern languages would be better but they make so many mistakes.
>>
>>59991283
It's called function overloading. And yes, that's one of the big things i miss in C.
>>
I'm reading through the Rust RFC that outlines a plan for adding dependent types to Rust. It's pretty interesting.
>>
>>59991295
Really? That's pretty minor. How about generic functions? Those a billion times more useful IMO.
>>
>>59988964
Who quotest thou?
>>
>>59991339
Literally never going to happen. Willing to bet my penis on it.
>>
>>59991339
>Rust will have dependent types before haskell
Haskelets on suicide watch
>>
>>59991339
>>59991401
It would instantly become my main language if it did, but I'm guessing the situation would be similar to H*skell and * with its GC.
>>
>>59991430
It'd still be a second-rate feature, especially to an already verbose language like rust
DT'ing needs to be included from the start.
>>
just installed ubuntu. need an ide for c++. suggestions?
>>
>>59991455
code blocks.
>>
>>59991448
Sure, that's why I will use a better language as my side language when I don't care about performance or even running the code.
>>
>>59991455
>ide for c++

you only need a text editor (vim ,emacs or sublime text) and a terminal
>>
File: 1460216041968.png (78KB, 416x329px) Image search: [Google]
1460216041968.png
78KB, 416x329px
>>59991339
Let's not tell lies on the internet.
>>
>>59991455
Code Blocks.

But I recommend emacs or vim.
>>
>>59991339
Here's the proposal if anyone is interested. It's split into three subproposals which could be implemented incrementally.

https://github.com/ticki/rfcs/blob/pi-types-2/text/0000-pi-types.md
https://github.com/ticki/rfcs/blob/pi-types-ext-1/text/0000-with-bounds-in-pi-types.md
https://github.com/ticki/rfcs/blob/pi-types-ext-2/text/0000-fully-dependent-pi-types.md
>>
File: unconvinced_lesbian.png (260KB, 800x450px) Image search: [Google]
unconvinced_lesbian.png
260KB, 800x450px
>>59991455
>IDE
>C++
>>
>>59990540
http://i.imgur.com/pW12Qsb.jpg
>>
>>59991455
Visual Studio or KDevelop
>>
>>59991283
>>59991292
>>59991295
And there is a very good reason that C doesn't have it, at least in the form you're thinking of.
You're not able to implement that without name mangling, or some shit, but that would mess with C's simple/stable ABI; one of C's most important features.

However, you can actually get function overloading in C with _Generic. You just have to name the symbols something else.
void foo_int(int a)
{
...
}

void foo_double(double a)
{
...
}

#define foo(a) _Generic((a), \
int: foo_int, \
default: foo_double)(a)

foo(10); // foo_int
foo(3.0); // foo_double
>>
>>59991463
>>59991511
Code Blocks is garbage for anything that has more than 1 .cpp file. Learn emacs or buy CLion. Otherwise, try Qt Creator.
>>
>>59991501
>>59991531
>C++
>not using an IDE
Oh, now i get why people feel C++ is a clusterfuck.
>>
>>59991563
>However, you can actually get function overloading in C with macro magic
>>
>>59991517
What are the chances of this actually getting implemented though?
>>
File: 3uyfaon66psy.png (827KB, 702x992px) Image search: [Google]
3uyfaon66psy.png
827KB, 702x992px
>>59991582
t. brainlet babby who needs eternal handholding
>>
>>59991563
But C's preprocessing language is evil!
>>
>>59991587
literally every useful thing in C requires shitty macro hacks.
>>
my intro to machine learning class really killed my motivation for machine learning after we spent 3/4 of the class time on linear regression, logistic regression, and other really basic/boring stuff. i was starting to feel a sense of dread regretting my upcoming internship which deals with machine learning, but right in the last 2 weeks our class has gotten into using trees and bagging/random forest, and now support vector machines. so now i'm pretty excited about it again
>>
>>59991621
Sad but true.
>>
>>59991629
C lacks generic.
>>
>>59991580
How?
I used it on windows and it managed dozens of files each with tens of thousands of lines long just fine. No lagging or temporarily freezing when switching either.

I genuinely think this CB is shit meme came from people who used it years and years ago.
>>
>>59991614
I've been doing it all wrong! I should write all my applications in Code with Anna and Elsa!
>>
>>59991641
Did you reply to the right person?
>>
>>59991658
Yes.
>>
>>59991712
I don't see the correlation, tbqh.
>>
>>59991727
That's the only reason to use macros.
>>
>>59991784
Tell all the c libraries that use them. The cpp was a mistake.
>>
>>59991614
I know you like the idea of being hardcore but you gotta wake up to the fact that you're not.
>>
Just dloaded Visual Studio for Ubuntu. How do I run programs? I'm debugging and I get this error message
Please install [clang](http://clang.llvm.org/) or check configuration `clang.executable`

I don't know what it's trying to tell me.
>>
Project for assembly language class.

Is there a quick way to take a swap two different chunks for two different "strings"?

Or just got through a loop swapping byte by byte?
ie:
Parents
 0000111100001111
xxxxyyyyxxxxyyyy


Child
 000011110000yyyy
xxxxyyyyxxxx1111
>>
>>59991859
>>59991859
It wants you to install clang
>>
>>59991804
>The cpp was a mistake
Yes m4 is the only valid preprocessor.
>>
>>59991859
How braindead are you honestly?
>>
File: 7102012232216iwsmt.jpg (82KB, 574x606px) Image search: [Google]
7102012232216iwsmt.jpg
82KB, 574x606px
>>59991628
>>
>>59991885
>m4
why does evry big C project has this "m4" folder?

even linux on github has
>>
>>59991903
It some shit that autotools produces.
>>
>>59991600
The first subproposal will be in nightly some time this year(source: https://internals.rust-lang.org/t/lang-team-minutes-const-generics/5090 ). The other two will wait until the first one is stable iirc.
>>
>>59991890
>>59991880
I need help installing Clang. How do I do it?
>>
>>59991979
Holy crap. So the Rust devs are serious about adding dependent types in the long term?
>>
>>59992038
just
#include boost
>>
>>59992052
what does that do?
>>
>rust is unironically going to make haskell irrelevant soon
wew, this is like some bizarro dream.
>>
>>59992047
What does this have to do with dependent types?
>>
>>59991582
With an IDE its also very apparent.
Inspecting a vector in the debugger is just dumb.
>>
>>59992069
What goes through the mind of a rust shill?
They here baseless rumours about things they know nothing and suddenly yet another reason to use Rust
>>
>>59992066
installs clang, gcc and intelij
>>
>>59992116
i dont even use rust.
Theyre both memelangs 2bqh
>>
>>59992069
>irrelevant language gonna make irrelevant language irrelevant
>>
>>59992132
So you were just making up baseless accusations that some idiot is going to fall for

Great, now there'll be a similar post like that tomorrow
>>
I can has job nao?
>>
>>59992179
old meme
>>
>>59992109
besause C++ == stl
>>
File: 250px-079Slowpoke.png (46KB, 250x250px) Image search: [Google]
250px-079Slowpoke.png
46KB, 250x250px
>>59992188
Sorry. Must have missed it during my winter depression.
>>
Why clang?
>>
>>59992179
Missed opportunity to put an Indian name
>>
>>59992229
why anything?
>>
>>59992231
But i'm Anon.
>>
>>59991859
>Visual Studio for Ubuntu
Visual Studio Code != Visual Studio
>>
>>59992272
big if true
>>
>>59992194
Now this is a stupid defense. std::vector is a very simple templetized class. That's why it's a fine example. It's stupid how complicated everything surrounding it gets just because it uses a template.
If you consider yourself a C++ programmer you're likely writing way more unreadable shit.
Alternatively you're doing some very limited C++ and should probably not consider it C++ for the sake of clarity.
C++ as a language is a clusterfuck. Just because you're smart enough to avoid most of it doesn't change that.
>>
>>59991859
You need to install clang. A good compiler unlike gcc.
>>
>>59992377
>A good compiler unlike gcc.
explain your reasoning.
>>
>>59991891
how's this related to my post at all?
>>
>>59992420
if you fail to see why, you're beyond saving
>>
>>59992427
1. the class is machine learning, not theory of automata
2. i was disheartened because the class was too easy, not too hard
3. i don't want to program video games

there's 3 ways it's dissimilar from my post, give me 1 way it's similar
>>
I'm scrapping a Retailers website for all their SKU's and the price of each item. I want to create a historical price tracker similar to camelcamelcamel. I'm just not sure should I setup my DB tables.I plan on using SQLite for now to store my data.
>>
>>59992372
Every C++ programmer is doing some limited C++. No one uses the full capabilities of the language.

I'm fine with not considering it C++ except there's nothing better to call it. It' sure as hell ain't C.

Bottom line is: C++ paired with Visual Studios is my comfy language. If you want to call me babby who needs hand holding, that's fine by me.
>>
>>> minute = 0
>>> seconds = 2252.8
>>> while seconds > 60:
minute += 1
seconds -= 60
>>> minute
37
>>> seconds
32.80000000000018


Where the fuck did the .00000000000018 come from?
>>
>>59992707
From computers working in base 2 (fractions are 1/2^n) and you feeding it base 10 (fractions are 1/10^n). Then you tried to use decimals.
>>
>>59992707
Float point precision.
Now go away.
>>
>>59992707
>Not using fixed point
>>
>>59992707
hola reddit
>>
File: not-comfy.jpg (87KB, 409x409px) Image search: [Google]
not-comfy.jpg
87KB, 409x409px
just noticed where the research internship i got says "Java proficiency preferred"

i know Java, i just thought i'd be able to pick what language i'd use
>>
>>59992880
Enjoy cleaning up 10k lines of hardcoded pajeet quality
>>
>>59992904
the name of the game is software testing and analysis so you're probably right. now i'm disheartened, was going to start learning ruby since i have a course next semester about it. but idk if i should brush up on java. which i dont want to
>>
I'm literally being cucked right now, at this very moment.

Will programming help me get over my sad excuse for a life?
>>
>>59992949
you're not getting cucked if you're not dating anymore, it just makes you a sadcase. so you're mental a cuck, but not getting cucked
>>
>>59992949
story pls, so i can learn from your mistakes
>>
how would you call a function that checks if there are repeated elements in a table?
>>
>>59992949
>Will programming help me get over my sad excuse for a life?
Hasn't worked for me. Programming just makes your sad excuse for a life even sadder.
>>
>>59992971
>Move across country for girl I met online
>Known her for years
>I move in with her
>Going great
>She turns out to be bipolar and we are completely incompatible
>Split up but still living together because finances
>Still care a lot about her
>She's out with her FWB tonight

Enjoy, /g/
>>
>>59992971
3d are womemes
2d are pure.

No exceptions.
>>
>>59993001
ouch
>>
>>59993002
cant fuck a 2d woman
>>
>>59993048
cant be happy with a 3d woman for long
>>
>>59993048
not with that attitude.
>>
>>59993001
>Incompatible
>Still have feelings for
>Split up
You are a true cuck, tbqh.
>>
>>59993048
soon. we just need to build the right peripherals
>>
>>59988930

Factor is a really interesting language IMO.
>>
>>59993071
What's your issue with the phrase "split up"?
>>
>>59988964

Pony
>>
>>59993095
 USE: io
IN: hello-world

: hello ( -- ) "Hello world" print ;

MAIN: hello


What exactly is the ( --) for?
>>
>>59993101
Pining for a girl you don't already had a go with and broke up with because you were incompatible, is kind of pathetic.
>>
>>59993071
I just said that.
>>
>>59992996
len(set(X)) == len(X)
>>
>>59993189
thats not a name, bucko
>>
how the eff do I stack panels on top of each other in c# without them becoming a part of each other.

trying to create 3 different menus that are all controlled by 3 buttons so the panels make it easy to configure all the controls at once
>>
>>59993204
Would you care to tell us what framework you're using?
Winforms?
WPF?
Xamarin?
>>
>>59993217
winforms
>>
>>59989152

Skip Scala and go to Elixir/Erlang or Go.

Or if you insist on conventional OOP (vs. the pure OOP of Elixir/Erlang), just suck it up and learn C++.
>>
>>59993224
Okay then it should be easy.
I don't actually understand your question, but I do know that if it were in WPF the first step is "weep uncontrollably"
>>
What things or subjects should I know before I even start learning how to program? Any recommended books?
>>
I'm doing some programming homework and I have no idea how to implement a function in C.
NODE* insert_node(NODE *ptr, NODE *new)
{
int num;
printf("Enter an integer: ");
scanf("%d", &num -> data);
struct node *temp;
temp = (struct node *)malloc(sizeof(struct node));
temp->data = num;
if (NODE == NULL)
{
NODE = temp;
NODE->next = NULL;
}
else
{
temp->next = NODE;
NODE = temp;
}

return ptr;
}

That's what I have so far, but shit doesn't work. Please don't flame, I'm just a beginner.
>>
>>59993240
:(
I want 3 panels with different text boxes/labels on the same location. The problem is if I put them right on top of eachother they join together as a panel inside a panel, panelception.
>>
>>59993242
1) Structs should never be uppercased like that. You should only uppercase #define macros like that.
2) &num -> data isn't...a thing. It's just
scanf("%d", &num);

-> or dot notation is for usage with structs. int isn't a struct.
3) You're mixing variable names. It shouldn't be
if (NODE == NULL)
with all the assignments involved, NODE should be ptr because ptr is the name of the NODE you passed.
4) Your entire function is effectively handing in a pointer, doing absolutely nothing with it, and then handing that pointer back.
>>
>>59993242
I think instead of NODE you want ptr in your if/else statements, NODE is a type. Also, no meme you really don't need to cast the return of malloc, it's void * type.
>>
>>59993262
...can you draw a picture? 3 different panels with different items but on the same spot?
>>
File: 1490761562480.png (372KB, 954x768px) Image search: [Google]
1490761562480.png
372KB, 954x768px
>>59993242
>scanf("%d", &num -> data);
>>
>>59993152

It's Factor's way of "typing". It's the stack effect.

( -- ) means it takes nothing off the stack and it won't put anything back on the stack. ( str -- ) would mean it takes a string off the stack and puts nothing back. ( str -- n ) would mean it takes a string off and puts an int back on.
>>
>>59993283
>no meme you really don't need to cast the return of malloc
Seriously?
Why the fuck have I been writing (char*)malloc(however fucking long I want+1) this whole time?
>>
>>59993322
You have to in sepples
>>
>>59993331
I haven't been writing in sepples, just see
>>
>>59993242

First of all, don't do interactive I/O inside the function.

The prototype should be:

NODE *insert_node(NODE *ptr, int data);


And then do the printf/scanf outside the function.

Also, you didn't use the "new" parameter. Use it or get rid of it.

You also have a test for if (NODE == NULL). That makes no sense, because NODE is a (assumedly) a data type, not a variable.
>>
>>59993304
dumb redditposter
>>
>>59993342
I was just explaining why you might be
>>
>>59993319
Ah, will have to look further into it and all the other one like it, seems interesting for a side-project.
>>
File: thing.png (5KB, 800x600px) Image search: [Google]
thing.png
5KB, 800x600px
>>59993289
yes, the panels are all invisible at the start and the 3 buttons toggle which panel is visible. Its supposed to be a database entry form where each panel corresponds to a different type of user in a database
>>
>>59993368
If I'm remembering winforms correctly, it's going to look like dogshit in the editor. But you should be able to make each panel, with all the respect elements inside of it (strictly related only to its own panel), and then on init have all of them with each element be set to non-visible.

Then, on button press, you make that panel visible and set its coordinates to the appropriate spot in the main panel so that it lines up correctly.
Then when you hit another button, you make sure to hide the other panels, then make the desired one visible, and set its position to etc etc.

Basically you can't do it logically with drag and drop. You're going to have to do some programmatic shenanigans to hide panels that aren't in use on init and then make sure when you unhide them that you've positioned the visible panel correctly inside the window.
>>
>>59993355
If Factor interests you and you want a fun side project, consider rolling your own jonesforth and building your own OS/system on top of it. Forth actually makes that possible and it's awesome to understand your system from the machine level to the top.
>>
what is the reality of a typical, east coast, average salary C# / Java job? about to graduate soon and literally 90% of the jobs within 500 miles of me are C# / Java.
>>
>>59993275
Sorry I got confused
instead of
scanf("%d", &num -> data);
, I meant to write
scanf("%d", &NODE -> data);
. Thanks for pointing it out.

>>59993344
NODE is a struct (linked list), I added the check in case this was the first node being created
>>
>>59993242
Almost every single line is incorrect. Start anew.
>>
>>59993242
node* insert_node (node *ptr, int data)
{
struct node *temp = (struct node*)malloc(sizeof(struct node));
temp->data = data;
if(ptr->next == NULL) {
temp->next = ptr->next;
ptr->next = temp;
} else {
ptr->next = temp;
temp->next = NULL;
}
return temp;
}


Get the data before calling this.
>>
>>59993468
if(ptr->next != NULL)

I've been drinking too much
>>
>>59993435
No offense, you could solve almost all these problems with your code by looking at the errors generated by a compiler.
>>
>>59993504
almost nobody asking C-based questions here understands the errors their compiler spits out
which is why they're asking anonymous retards for help
>>
how proficient should I be in one language before moving on to another one
>>
>>59993539
when you can rewrite the compiler
>>
>>59993539
as proficient as you are when you have a reason to use another one
>>
>>59993539
When you can name 3 limitations and 3 superior aspects that are valid and defendable.
>>
>>59993598
That's not a retarded meme, you need to go back.
>>
>>59993673
pajeet pls
>>
>>59993200
Yeah, Why would you need to put something like that into a function on it's own?

ArrayMembersAreUnique

so that you can write
if (ArrayMembersAreUnique(arr)) {...
>>
>>59993598
how would you POSSIBLY know how a language is good or bad when it's the only one you know?
>>
>>59993748
By using your brain and seeing how something should be done better or how it does exactly as you would want. Are you this creatively bankrupt?
>>
>>59993913
Not creatively bankrupt, since i don't need to conjure up things out of my ass, i just have a basic grip on common sense
>>
>>59993943
Obviously not, since you apparently interpreted what I said as what does language X do better than Y. I'm saying you should be able to criticize the language. You don't need to compare to others for that.
>>
I'm a few days into learning Common Lisp. I made myself a little IDE in vim since I hate emacs to run whats in the current buffer into sbcl. It's genuinely fun to write and approach problems with. It's beautiful and expressive.

One of the cool things about it is the fact it's homoiconic. I haven't really gotten a chance to leverage this in a meaningful way yet. wondering if anybody out there had a cool proof of concept snippet demonstrating?
>>
I'm looking for help with some Python. I have the logic written, but I don't know the language. If there's a student or someone who could use some extra cash for a few hours' coding, hit me up.

[email protected]
>>
>>59994093
go ahead and post it here if it's not sensitive. (if it's sensitive you're making a bad choice coming here.) We can all help out. only some of us are awful
>>
>>59994093
what is it about?

might be interested
>>
First time arduino user here.
I have to do some basic coding for measuring shit from a sensor. I've done a basic code using serial for communication, and gathering the results on MatLab.
However, the real application will run with an SD card attached. And I can't get this shit to work at all. I think I'm really skipping something in here.
What i've first done is to try using SD.begin. However, that gives no answer at all (my program has some basic coding to analyze wtf is going on). So I tried with some numbers I found on the internet (SD.begin(4), SD.begin(10) and a few other random ones) and most give no answer, while SD.begin(10) just returns false.

Here's how I know wtf is going on BTW
 while (!SD.begin(10)){ 
if (ledState == LOW) {
ledState = HIGH;}
else {
ledState = LOW;}
digitalWrite(led, ledState);
delay(1000);}



Easy stuff, just flashes the LED while it can't read. For SD.begin() and the other few numbers I tested, it doesn't even flash the LED, which makes me believe the begin function fails to return a value at all.

Anyone can shed some light on what to do? the arduino is a uno r3 btw, and the SD adapter is the thing in the picture (it has no writings on it, but a google search gives me the name w5100 ethernet shield, so I guess that's it)
>>
>>59994069
Circular lists are fun.
#1=(1 . #1#)
>>
>>59994111
>>59994114
It's an API read-and-return script for a trade platform. It's not what I'd call sensitive, it probably won't even work. But I want to at see it fail if that's the case.
>>
>>59989898
Refinement types can be done with dependent types. I just mean using an efficient representation with refinements down to your specification instead of constructing a less efficient but ideal representation.
>>
>>59994147
Read the data sheet from the arduino. Your answer should be there.
>>
>>59994337
Maybe "perfect" is better than "ideal". I just mean a type that, by construction only, fits your specification.
>>
File: kanye west.png (135KB, 273x351px) Image search: [Google]
kanye west.png
135KB, 273x351px
>attempt to rice my editor
>i'm not used to the new colors
>pussy out and revert them back
>>
>>59994420
you win
>>
>>59994420
>count words in a string
again
>>
NEW THREAD!

>>59994465
>>59994465
>>
>>59989999
Not him but
>Not him but message passing/receiving is a great way to reduce how malleable your program is.
>This is why OOD doesn't concern itself with incomplete programs. They do upfront development because that's all they can do comfortably.
Genuinely don't understand what anon means by this in regards to problems with OOP
Thread posts: 311
Thread images: 25


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