Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 199 KB, 844x1200, tohru's magic code!.jpg [View same] [iqdb] [saucenao] [google] [report]
62502372 No.62502372 [Reply] [Original] [archived.moe] [rbt]

old thread: >>62496199

What are you working on, /g/?

>> No.62502401

what's the easiest language to learn to become employable?

>> No.62502403
File: 29 KB, 588x721, fff.png [View same] [iqdb] [saucenao] [google] [report]
62502403

>>62502372

https://gist.github.com/anonymous/c4344a67d179c5e96bea70f5a4d76b32

So I just got this to work all the way, but now the issue I'm running into is that when it's under 20 guests, the number of servers returns 0 instead of 1. Should I use a floor function for that?

>> No.62502405

guys amazon wouldn't accept a hole in the ground as my mailing address pls help

>> No.62502425

>>62502401
>what's the easiest language to learn to become employable?
Javascript and Python

What's the best language to learn for shitposting on /g/?
Haskell.

>> No.62502430

>>62502401
You don’t even need to learn programming to become employable.

>> No.62502441

>>62502430
Not everyone was born into a protected class, anon.

>> No.62502449

>>62502401
prolly english or chinese

>> No.62502460 [DELETED] 

>>62502403
Does it return 2 for 21 guests?

>> No.62502470
File: 134 KB, 1200x1800, le ebin C maymay.jpg [View same] [iqdb] [saucenao] [google] [report]
62502470

Is there ever a reason to use struct assignment instead of memcpy?

>> No.62502519

>>62502403
When dividing 2 integers, the / operator performs integer division.
When you need fractional amounts, store the result as a float and cast as follows
numberOfServers = (float) GuestNumber / guestsperserver;

>> No.62502602
File: 164 KB, 837x761, sdfw3.png [View same] [iqdb] [saucenao] [google] [report]
62502602

i'm a code artisan

>> No.62502621

>>62502602
A E S T H E T I C

>> No.62502626
File: 174 KB, 720x950, 1480640313203.jpg [View same] [iqdb] [saucenao] [google] [report]
62502626

My IDE has support for Vim bindings. Is it a meme or worth taking the time to get used to?

>> No.62502633

>>62502626
use vimtutor

>> No.62502652

>>62502470
easier to read
easier to write
harder to break
compiler can still optimize it to be as fast or faster than memcpy

>> No.62502654

19:05 gcc args.c
19:05 ./a.out
0
19:05 ./a.out 3
3
19:05 ./a.out 5
5
19:05 cat args.c
#include <stdio.h>

int main(int argc, char* argv[]){
int x;
if (argc == 2){
sscanf(argv[1], "%d", &x);
}
printf("%d\n", x);
return 0;
}
19:05



what's the point of atoi?

>> No.62502670

>>62502626
The only vim emulator kind of worth using is evil-mode for emacs. Everything else is generally trash that is missing most of the keybindings you would use on a daily basis.

>> No.62502684

>>62502654
to convert a string to an integer

>> No.62502706

>>62502602
so this is what it feels like, to poo, without the loo

>> No.62502711

There is Visual Studio Code and there is Visual Studio Community (among other versions, of course). What is the difference between them and is it important for a programming newbie?

>> No.62502719

Why is it so fucking difficult to compile my shitty C++ program using a shitty external library. Fuck CMake fuck C++

>> No.62502725

>>62502706
pajeet poos in code

>> No.62502747

>>62502719
back to css

>> No.62502749
File: 44 KB, 636x616, 1474325315193.jpg [View same] [iqdb] [saucenao] [google] [report]
62502749

Employed Haskell programmer here

>>62502401
Haskell

>> No.62502755

>>62502749
Why not Agda?

>> No.62502767

>>62502719
>CMake
found your problem.
the hand-craft makefile (not autogenerated ones from ganoo autotools) is the best build system ever made.

>> No.62502772

how do i create an array of ArrayDeques in java?

>> No.62502777

>>62502719
Because you didn't setup your system.
You need to learn how to compile stuff.

>> No.62502779

How much less energy consumption does a raspberry pi require than say a macbook for simple tasks, such as if I want to constantly fetch statistics from the net with my bot?

>> No.62502788

>>62502684
thats not orthogonal to sscanf though

>> No.62502794
File: 216 KB, 700x700, 1485646993134.jpg [View same] [iqdb] [saucenao] [google] [report]
62502794

>>62502749
you are one of my favourite posters behind akari poster

>> No.62502808

>>62502711
VSCode is basically just a text-editor (imo it's a good one) that's heavily extensible, but can't compile your programs, at least not out of the box.

VSCommunity is an IDE, meaning in addition to the amenities of VSCode, you can build and run projects.

>is it important for a programming newbie
If you're on Windows, save yourself the headache and use an IDE

>> No.62502809

>>62502747
no u

>>62502767
GNU build tools are cash. I'm forced to use CMake because the Wt library uses it

>>62502777
I know. I've been tracking down where the include files are located since I was stupid and installed the library from the repo instead of building from source

>> No.62502821

>>62502779
from googling around a bit, raspberry pi peaks at 4W and macbooks peak at ~30W

>> No.62502833

when do i stop feeling like a badass hacker every time i start tossing around pointers in c/c++, and recognize myself for the smug brainlet i truly am

>> No.62502864

>>62502788
>I'm literally retarded
we know

>> No.62502865

>>62502833
Make a self-balancing binary search tree in C with dynamic memory that works with all possible inputs and operations, without using a reference.

Do that and you are justified in feeling like a badass hacker.

>> No.62502866

>>62502772
>>62502772

ArrayDeque[] Queues = new ArrayDeque[AlphabetLength];
Queues = {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z};

send help, netbeans and stack overflow isn't telling me how to do this

>> No.62502881

>>62502711
community is just the free version of the regular visual studio ide, which is the big heavy-duty tool with 80000 bloated features you'll never use, and 4 or 5 that are really cool helpful, providing you play along and let it manhandle your build

code is a lightweight, open-source text editor styled after visual studio. it can do some ide-like things with third-party plugins, which is nice, but those a. are third-party and not necessarily reliable, b. tend to still require you to follow the not-really-but-really-official ms-approved build setup, which defeats half the purpose of this sort of thing

let big daddy vs baby you, and then just switch to vim when you actually know what you're doing

>> No.62502883

>>62502772
ArrayList<ArrayDeque<>> a = new ArrayList();
them a.add(new ArrayDeque()) in a loop.

>> No.62502892

Thoughts/opinions on this book:
>>62501575

>> No.62502902
File: 130 KB, 387x328, 1501025367734.jpg [View same] [iqdb] [saucenao] [google] [report]
62502902

>web semantic class
Shit is so boring. I wish every day I could find, pass interview and keep a job in any shit language instead of pretending to be useful with this.

>> No.62502907

>>62502866
nm got it

>> No.62502908

>>62502892
More difficult than you think

>> No.62502916

>>62502883
wouldn't work for this situation anyways. thanks though

>> No.62502925

>>62502892
Knuth's books all have a similar feeling to me. Also, I don't think that book covers topics in the best order. Discrete Mathematics and Its Applications is what I used in school and it was fine.

>> No.62502941

>>62502892
quantum mechanics is the future so don't waste your time. learn linear algebra instead

>> No.62503018

if posting on 4chan required government-issued ID and verification that the poster is both 18 or older and has an IQ over 99, would this thread have the same number of contributors?

>> No.62503055

>>62503018
Not the same number, no.

>> No.62503068

What is your opinion on Kotlin?

>> No.62503156

>>62503068
it's good for android

>> No.62503200

>>62502833
When you can use C++ without using any raw pointers anywhere because unique_ptr and shared_ptr are more suitable for 95% of your needs.

>> No.62503251

How in the fuck does Eclipse use more memory than fucking VS?

>> No.62503263
File: 63 KB, 567x699, 1499205373933.jpg [View same] [iqdb] [saucenao] [google] [report]
62503263

Finally made a functioning game of blackjack in python
it's barebones, and doesnt properly list face cards, instead counting them as their value, so I can end up having two different "ten of clubs." and aces are listed as elevens of whatever suit.
Still though, the numbers are correct and it works.
Took me a while but I'm proud of myself.

>> No.62503278

>>62503263
Way to go, anon. Have a (You) :3

>> No.62503286

>>62503263
Congrats, anon

>> No.62503354

Do your programs work on ARM, /dpt/?

>> No.62503377

>>62503354
Yes, why wouldn't they?

>> No.62503389

>>62503251
Eclipse was written in Java, that's why

>> No.62503390

>>62503263
console or GUI? if GUI im jelly.

>> No.62503398

>>62503377
You might have been one of those people who only use asm.

>> No.62503413

>>62502372
How do you calculate average/best/worst cases for algorithms?

>> No.62503425
File: 1.00 MB, 871x1079, 1504503267411.png [View same] [iqdb] [saucenao] [google] [report]
62503425

I ended up doing multiple inheritence today :(

#include <iostream>

class Point {
public:
int x{0}, y{0}, z{0};
Point(int a, int b, int c = 0) : x{a}, y{b}, z{c} {};
friend std::ostream& operator<<(std::ostream& os, const Point& p) {
os << "(" << p.x << ", " << p.y;
if (p.z != 0)
os << " " << p.z;
os << ")";
return os;
}
};

class Shape {
protected:
Shape() {}

public:
friend std::ostream& operator<<(std::ostream& os, Shape& shape) {
return shape.print(os);
}
virtual std::ostream& print(std::ostream& os) = 0;
virtual ~Shape() {}
};

class Circle : public Shape {
protected:
Point p;
size_t radius;

public:
Circle(const Point& p2d, size_t r) : p{p2d}, radius{r} {}
std::ostream& print(std::ostream& os) {
os << "Circle(" << p << " " << radius << ")";
return os;
}
};

class Triangle : public Shape {
protected:
Point p1, p2, p3;

public:
Triangle(const Point& a, const Point& b, const Point& c)
: p1{a}, p2{b}, p3{c} {}
std::ostream& print(std::ostream& os) {
os << "Triangle( " << p1 << " " << p2 << " " << p3 << ")";
return os;
}
};

int main() {
Circle c(Point(1, 2, 3), 7);
std::cout << c << '\n';

Triangle t(Point(1, 2, 3), Point(4, 5, 6), Point(7, 8, 9));
std::cout << t << '\n';

return 0;
}

>> No.62503456

>>62503389
so was Netbeans and IntelliJ, both are excellent IDEs and have a much lower memory footprint than Eclipse. Just because some program has some shitty code it doesn't mean that the language is the culprit.

>> No.62503457

>>62503398
>You might have been one of those people who only use asm.
No, I enjoy getting things actually done

>> No.62503475
File: 16 KB, 351x329, 1460163753219.jpg [View same] [iqdb] [saucenao] [google] [report]
62503475

#Blackjack
import sys
import random
A, J, Q, K = 11, 10, 10, 10
spades = [A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K]
clubs = [A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K]
diamonds = [A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K]
hearts = [A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K]


deck = [spades, clubs, diamonds, hearts]
psuits = range(len(deck))
for suit in deck:
random.shuffle(suit)
player_cards = []
dealer_cards = []
player_score = 0
dealer_score = 0
player_nums = []
dealer_nums = []

def deal(recip, indiv):
csuit = random.choice(psuits)
if csuit == 0:
plscore = deck[csuit].pop()
indiv.append(plscore)
interim = str(plscore)
recip.append(interim + " of spades")
elif csuit == 1:
plscore = deck[csuit].pop()
indiv.append(plscore)
interim = str(plscore)
recip.append(interim + " of clubs")
elif csuit == 2:
plscore = deck[csuit].pop()
indiv.append(plscore)
interim = str(plscore)
recip.append(interim + " of diamonds")
elif csuit == 3:
plscore = deck[csuit].pop()
indiv.append(plscore)
interim = str(plscore)
recip.append(interim + " of hearts")
deal(player_cards, player_nums)
deal(dealer_cards, dealer_nums)
deal(player_cards, player_nums)
deal(dealer_cards, dealer_nums)


I'll post my code so you all can laugh at how inefficient it is.
unfortunately its too big to be posted all at once, so i have to fragment it.
>>62503390
just console. I'm not good enough to make stuff in a GUI yet.

>> No.62503495 [DELETED] 

>>62503475
player_score = player_score + int(player_cards[0][0:2]) + int(player_cards[1][0:2])
dealer_score = dealer_score + int(dealer_cards[0][0:2]) + int(dealer_cards[1][0:2])
if dealer_score > 21 and A in dealer_nums:
dealer_score -= 10
if player_score > 21 and A in player_nums:
player_score -= 10
showdown = False
cardnumber = 2
dealcardnumber = 2
while not showdown:
if player_score > 21 and A in player_nums:
player_score -= 10
A = 1
elif player_score > 21:
print("You bust with a hand of " + str(player_cards) + "and a score of " + str(player_score) + " You lose.")
break
hors = input("You have " + str(player_cards) + " dealer has a " + dealer_cards[0] + " will you hit or stay?")
if hors == "hit":
deal(player_cards, player_nums)
player_score = player_score + int(player_cards[cardnumber][0:2])
print("you draw " + player_cards[cardnumber])
cardnumber += 1
elif hors == "stay":
if dealer_score < 16:
while dealer_score < 16:
deal(dealer_cards, dealer_nums)
dealer_score = dealer_score + int(dealer_cards[dealcardnumber][0:2])
if int(dealer_cards[dealcardnumber][0:2]) == A and dealer_score >= 11:
dealer_score -= 10
print("dealer draws " + dealer_cards[dealcardnumber])
dealcardnumber += 1
if dealer_score > 16 and dealer_score <= 21:
showdown = True
elif dealer_score > 21 and A in dealer_nums:
A = 1
elif dealer_score > 21:
print("dealer busts with " + str(dealer_cards) + "! You win.")
sys.exit()
else:
showdown = True
else:
showdown = True
else:
print("try again")

>> No.62503502

I implemented Linear Conflict into the priority function of my program that solves sliding puzzles today and my program can finally solve 15-puzzles with greater than 50 moves in a reasonable amount of time.

It still completely halts on puzzles with very high number of moves (60+) so I tried learning IDA* and how to use a pattern database but I got stuck.
Do any of you know how to implement IDA* correctly? I know it's supposed to be way faster than A* for 15-puzzles yet my version is slow as shit

>> No.62503513

>>62503475
player_score = player_score + int(player_cards[0][0:2]) + int(player_cards[1][0:2])
dealer_score = dealer_score + int(dealer_cards[0][0:2]) + int(dealer_cards[1][0:2])
if dealer_score > 21 and A in dealer_nums:
dealer_score -= 10
if player_score > 21 and A in player_nums:
player_score -= 10
showdown = False
cardnumber = 2
dealcardnumber = 2
while not showdown:
if player_score > 21 and A in player_nums:
player_score -= 10
A = 1
elif player_score > 21:
print("You bust with a hand of " + str(player_cards) + "and a score of " + str(player_score) + " You lose.")
break
hors = input("You have " + str(player_cards) + " dealer has a " + dealer_cards[0] + " will you hit or stay?")
if hors == "hit":
deal(player_cards, player_nums)
player_score = player_score + int(player_cards[cardnumber][0:2])
print("you draw " + player_cards[cardnumber])
cardnumber += 1
elif hors == "stay":
if dealer_score < 16:
while dealer_score < 16:
deal(dealer_cards, dealer_nums)
dealer_score = dealer_score + int(dealer_cards[dealcardnumber][0:2])
if int(dealer_cards[dealcardnumber][0:2]) == A and dealer_score >= 11:
dealer_score -= 10
print("dealer draws " + dealer_cards[dealcardnumber])
dealcardnumber += 1
if dealer_score > 16 and dealer_score <= 21:
showdown = True
elif dealer_score > 21 and A in dealer_nums:
A = 1
elif dealer_score > 21:
print("dealer busts with " + str(dealer_cards) + "! You win.")
sys.exit()
else:
showdown = True
else:
showdown = True
else:
print("try again")

>> No.62503540

Scripting a porn batch downloading engine for a dude who torrents all of them as soon as they are released. Remove fetch sessions, download either from a stream or a real file, meta data removal as much as I can (though most is done recontainering it...) , and then sort it to another directory and instant torrent creation.

>> No.62503545
File: 164 KB, 286x621, 1461021755770.png [View same] [iqdb] [saucenao] [google] [report]
62503545

>>62503513
else:
print("Showdown! player has " + str(player_cards) + ", dealer has "+ str(dealer_cards))
print(player_score)
print(dealer_score)
if player_score > 21:
print("You bust with a hand of " + str(player_cards) + "and a score of " + str(player_score) + " You lose.")
if player_score <= 21 and player_score > dealer_score:
print("you win")
elif player_score == dealer_score:
print("it's a draw")
elif dealer_score > 21:
print("dealer busts with " + str(dealer_cards) + "! You win.")
else:
print("You lose")

this isnt your regular average everyday pajeet code
this is advanced pajeet code

>> No.62503603

>>62502372

Typically how to AAA game devs go about developing engine tool GUIs? Looking at Frostbite and Bungie's engine tools they looks similar to something you'd get in WPF, which is C#. But I imagine their engines are written in C++. I'm just confused how they're probably using XAML/WPF for GUI and C++ for backend and how that all connects?

>> No.62503617

So I can do node->value in C but can I do node->anothernode->value?

>> No.62503637

>>62502401
Python pays good and is really easy to learn.

>> No.62503663

>>62503513
What the actual fuck is this shit?

>> No.62503685

>>62502755
You're not supposed to run Agda code, only typecheck it.

>> No.62503709

going from java to c# what are the big things i need to change with my brain

ive been doing embedded java for 2 years now and im watching c# shit and it seems so close to java stuff right now that im starting to get things mixed out between them

>> No.62503754

Remember not to use C# or any .NET technologies.

>> No.62503798

>>62503709
delegates (first-class function types) exist. look them up, and also the "event" keyword

you can define your own value types if you use struct {} instead of class {}. this has its own inherent uses; on top of that, they're better and more performant for smaller, short-lifetime objects

yield return is a really nice feature

>> No.62503824

>>62502654
What's the point of using sscanf over atoi if you're not error checking?

atoi is for dirt nasty, fast conversions.

strtol and friends are for robust error checking.

sscanf is a slow, jack of all trades, with somewhat okay error checking.

>> No.62503833

>>62503754

t. jobless NEET

>> No.62503853

>>62503833
If only.

>> No.62503901

>>62503617

Yes. This is valid.

>> No.62503909

C++ or Rust for new projects?

>> No.62503948

>>62503754
this

>> No.62503949

>>62503909

Pick whatever you want. Rust isn't mature enough for something serious IMO, but if you're curious there's no harm in working with it.

>> No.62503956
File: 610 KB, 1291x3600, 1503569064620.jpg [View same] [iqdb] [saucenao] [google] [report]
62503956

>>62503833

>> No.62504060

>>62503909
java

>> No.62504183

>>62503956
if youre using Indeed to find a job than your skill level isnt high enough to actually apply for any senior level positions

if youre ACTUALLY a senior level programmer than you would be getting at minimum 5 offers from recruiters every week via linkedin

>> No.62504186

>>625039
There's tens of thousands of smaller companies hiring C# developers. Programmers working for the top 15 are still a minority overall.

Also, C# might not be popular in the US, but it is popular in the UK and Europe.

>> No.62504218

>>62504183
>it hurts

>> No.62504232

>>62503603
somebody or some small team builds the tool
some other guy or some other small team builds the GUI
then somebody or some team connects the two

>> No.62504237

Trying to expand my knowledge on python. I just written a syntax cheat sheet for the language and I'm not sure what to do next.

Are there any projects I can do to get used to python?

>> No.62504300

>>62504237
>Are there any projects I can do to get used to python?

Literally anything you want

Someone please post the /dpt/ roll v4.1+

>> No.62504357

>>62503603
C# can interface to C and C++, so it's certainly possible to write most of your game as a library and invoke what you need from a C# application.

There's plenty of people using http://www.noesisengine.com/ though, which is effectively WPF for C++.

>> No.62504445

>>62504237
>syntax cheat sheet
>python
Is this your first time programming?

>> No.62504446
File: 302 KB, 1920x1080, 1498090245826.png [View same] [iqdb] [saucenao] [google] [report]
62504446

>>62504300
Something like this?

>> No.62504454
File: 8 KB, 284x177, images.png [View same] [iqdb] [saucenao] [google] [report]
62504454

some guy in another board said

>i've been developing software for a cc/contactless company

what's a contactless company?

>> No.62504512

>>62504445
Not really. I have some experience in Java and a general knowlege in web based stuff.

I looked up a video on how to learn python quickly and they went over the syntax. Thats why I made this cheat sheet sort of thing.

>> No.62504564

>>62504454
>cc/contactless
credit card and contactless payment

>> No.62504779
File: 308 KB, 1750x2300, the mark of an artisan.jpg [View same] [iqdb] [saucenao] [google] [report]
62504779

What would you recommended for someone that is doesn't know the first thing about programing?

What language should I try to learn first?

After I choose one, how should I go about learning it?
Should I just find a guide study it completely try to replicate what I read or should I do it step by step?

I'm really lost

>> No.62504787

So what's the best way to go about programming something with a GUI using C++? Is Qt any good?

>> No.62504887

>>62504779
You could try going through a tutorial of some language, like https://docs.python.org/3/tutorial/

>> No.62504952

>>62504887
Thanks, i'll try that.

>> No.62504960

In C++, how do you evaluate an expression to a variable and then check condition on it?
size_t getLargestRadius(const std::vector<Shape*> v) {
size_t result{0};
for (Shape* shape : v) {
Circle* c = dynamic_cast<Circle*>(shape);
if (!c)
continue;
else if (c->getRadius() > result)
result = c->getRadius();
// I want something like: else if (auto r = c->getRadius() > result) {..}
}
return result;
}


The comma operator(,) returns 1, not r

>> No.62504965

Can someone explain why /g/ keeps shilling haskell? Is there some benefits to this language? What's good about it?

>> No.62504982

>>62504779
If you don't like technical reading don't be ashamed to watch some youtube videos to get you started, there's no shame in it. But if you're serious about programming reading technical documentation will be something that you do a lot, so don't brush it off entirely.

>> No.62504984

>>62504965
It's pretty expressive but at the same time it's a big paradigm shift and the produced binaries are slow

>> No.62504992

>>62504965
https://wiki.haskell.org/Why_Haskell_matters

>> No.62504995

>>62504965
It follows the functional programming meme

>> No.62505033

>>62502719
Use Visual Studio

>> No.62505049
File: 993 KB, 1182x1581, 1484699914718.jpg [View same] [iqdb] [saucenao] [google] [report]
62505049

>>62505033
Good goy

>> No.62505054

>>62504960
((auto r = c->getRadius()) > result)

>> No.62505084

>>62505054
Doesn't work

>> No.62505090

anybody know how to hack a Instagram for a good cause?

>> No.62505164

>>62505090
Yes. You have to delte system32 first

>> No.62505224

>>62505164
I don't know how this shit keeps appearing on my pc. I delete it like once a month, and it pops up again. Must be getting this folder from online or something

>> No.62505280

I'm learning the basics of programming. I need some help..

First off, how do you enter code into the reply box so that it looks like how >>62504960 wrote it? Can't get help if I cant format my code properly..

>> No.62505383

>>62505280
Read the sticky
>>51971506

>> No.62505430

I've got a programming problem for you dpt. All you have to do is write a function, fcomp, that takes two functions, a and b, and returns true if they are equal, or false if they are not equal. The functions a and b are of the type `int -> int`. You cannot cheat by comparing their memory addresses or names. You cannot assume anything about them other than their names (a and b) and their type (int -> int).

Good luck! I will buy a 20 dollar steam game for the first person to post a correct answer.

>> No.62505481

How come my program does not stay open after I input the intownmiles and highwaymiles. It closes even though I'm trying to pause the program with cin.get();

If I pause the program with system("pause"); then it works, but cin.get doesn't.

Why is this?

#include <iostream>
using namespace std;

int main()
{
double inTownMiles;
double highwayMiles;
double inTownGallons;
double highwayGallons;
double totalGas;
cout << "Please enter the number of miles driven in town: ";
cin >> inTownMiles;
cout << "Please enter the number of miles driven on the highway: ";
cin >> highwayMiles;
inTownGallons = inTownMiles / 23.5;
highwayGallons = highwayMiles / 28.9;
totalGas = inTownGallons + highwayGallons;
cout << "The total number of gallons required is " << totalGas;
cin.get();
return 0;
}

>> No.62505500

>>62505430
>The functions a and b are of the type `int -> int`. You cannot cheat by comparing their memory addresses or names.
dropped

>> No.62505534

Writing a MIPS 1 virtual machine.
Going to extend it with my own instructions and platform, and write a kernel for it.

I just didn't want to write a compiler, otherwise I would've designed my own ISA.

>> No.62505575

>>62503018
>would this thread have the same number of contributors?
No. You wouldn't be here.

>> No.62505665

1,000 regulars than you to the same core compute cases too, of that you mean aside from here on some shit. Can't you can easily injured little chunk of the whole thread.

>> No.62505698

>>62505481
take the training wheels off your OS

>> No.62505713

>>62504237
That's why I'm having to a decent camera? I'd buy it. If you might dazzle you are going to be the same result's. any new iso is one in my point in the website as well, faggot.

>> No.62505862
File: 2.03 MB, 590x756, kill_me.webm [View same] [iqdb] [saucenao] [google] [report]
62505862

>>62502372
Trying to implement snake in python with curses

>> No.62505920

>>62505698
what the hell does that even mean? I just want to learn how program. I'm not here for a Linux/windows debate.

>> No.62505933

>>62504183

What if you don't have a linkedin account?

>> No.62505976

>>62505933
This. That site is glorified social media. They datamine as per their privacy policy - why should I be obligated to use such service to be considered employable?

>> No.62506022

ok /dpt/ we have to admit that the AI meme is here to stay. neural engine (for face recognition etc) in apple A11, self driving cars, dota 2 bots and so on. meme learning algorithms will be able to replicate all kinds of human behavior and improve upon it.

>>>/pol/142047623

>> No.62506117

>>62504960
if (auto r = c->getRadius() > result)

As is that will make r a bool. There's no clean way to do this that's not more work than just writing a second line, but if you want you could write a function for it.

float check_radius(float f1, float f2)
{
if(f1 > f2)return f1;
else return 0.f;
}

if(auto r = check_radius(c->getRadius(), result))
{
//do stuff with r
}


Also you can write that dynamic_cast check in the same manner.

if(Circle* c = dynamic_cast<Circle*>(shape))
{

}

>> No.62506135

>>62502401
English.

It allows you to prove you aren't completely autistic during an interview.

>> No.62506189

>>62504965
It's a meme, you dip.

>> No.62506194
File: 930 KB, 460x197, Oo04a.gif [View same] [iqdb] [saucenao] [google] [report]
62506194

>>62502833
>Implementing a splay tree in C where each node stores the sum of its subtree to efficiently compute a range sum
>Six cases of possible tree rotations
>Support find, insert, delete, split, merge operations
>Mfw drawing pointer diagrams on a whiteboard to diagnose all possible edge cases and chasing segfaults in gdb

It took me 2 weeks to solve that problem and made me feel like king of the brainlets.

>> No.62506232

>>62506022
Fuck off and stay there
>>>/po/

>> No.62506360
File: 62 KB, 628x308, Screen_Shot_2016-03-24_at_10.46.22_AM.0.png [View same] [iqdb] [saucenao] [google] [report]
62506360

>>62506232
t. assblasted microshart shill

>> No.62506387
File: 118 KB, 1042x486, Screen Shot 2017-09-18 at 9.04.43 PM.png [View same] [iqdb] [saucenao] [google] [report]
62506387

Trying to learn Haskell through the Real World Haskell book (really liking it so far! I found Haskell Programming from First Principles to be a bit too abstract starting at around the Monoids chapter).

How the fuck do I write a palindrome maker?
Turn a list into a palindrome.
--Input: [1,2,3], Output: [1,2,3,3,2,1]
toPalindrome :: [a] -> [a]
toPalindrome list = case list of
[] -> []
(head : tail) -> head : (toPalindrome tail) : head : []


I don't understand how It's expecting a [[a]] type.
Basically, all I want to do is append "head" to the beginning and end of the list, and insert the palindrome of the rest of the list recursively in the middle

>> No.62506421

>>62506360
I'm not. As I said, go back to your autism echo chember.

>> No.62506492

>>62506387
Try:
(head : tail) -> head : (toPalindrome tail ++ [head])

>> No.62506568

>>62506492
Hm... That seemed to work. Thanks!!
If you don't mind me asking, what's the difference between
(head : tail) -> head : (toPalindrome tail) : head : []

and
(head : tail) -> head : (toPalindrome tail ++ [head])


There might be some funky precedence thing going on, but I want to know what's actually happening so can I avoid this error in the future...

>> No.62506632

>>62506568
It's not precedence. The return value of toPalindrome is a list rather than a single element, and concatenating a list to another list is a different operation from sticking a single element on the head of a list.

Some examples might help:
1 : [2, 3] -> [1, 2, 3]
[1, 2] : [[3, 4]] -> [[1, 2], [3, 4]]
[1, 2] ++ [3, 4] -> [1, 2, 3, 4]

>> No.62506664

>>62506632
Oh duh...
That makes a lot of sense. Thanks anon!

>> No.62506673

How many hours a day should I devote to becoming proficient in C++ by the next six months to a year? And what books/videos do you recommend?

>> No.62506693

>>62506673
are you proficient in another language that involves memory management already?
couple hours per week
are you proficient in another language that doesn't involve memory management?
5 hours per week
have you never programmed before?
3 hours per day

>> No.62506742

>>62506693
Ok thanks, can you recommend any books or videos series? I have the C++ book by D.S. Malik already.

>> No.62506789

>tfw first k&r chapter in
I wonder how things are displayed in a terminal without scrolling. cleaning is easy, so is positioning a character in an arbitrary coordinate.
// Attempt at positioning a letter at a specific coordinate in a 80x24 terminal

#include <stdio.h>

int clearScreen(int screen[80][24])
{
int x,y;
for (y = 1; y <= 24; y++) { // clean the garbage
for (x = 1; x <= 80; x++) {
screen[x][y] = ' ';
}
}
}

int printScreen(int screen[80][24])
{
int x,y;
for (y = 1; y <= 24; y++) { // clean the garbage
for (x = 1; x <= 80; x++) {
putchar(screen[x][y]);
}
if (y == 24)
getchar(); // wait for enter key to be pressed
putchar('\n');
}
putchar('\n');
}

int main()
{
int screen[81][24]; // overflow happens if it is set to 80

clearScreen(screen); // unwise to clear all content every printScreen()
screen[4][1] = 'A'; // insert A at fourth column, first line
printScreen(screen);
}

>> No.62506818

>>62506742
I would recommend spending a limited amount of time reading (maybe 10%-20% of your time?), spend the bulk of your time programming and trying things out
getting compiler errors and fixing them, then realizing why it works is the fastest way to learn and retain the knowledge

if you follow that strategy, it doesn't really matter which book you get as long as it covers all the main topics

>> No.62506851

>>62506818
Ok, appreciate the advice.

>> No.62506900

Is C++ the best language for making desktop applications?

>> No.62506915

>>62506900
yes, currently

>> No.62507011

>>62506900

Arguably yes if you're willing to put up with it.

>> No.62507103

>>62505430
Are they pure and total? If not, it can't be done. If so, it's easy, just try every integer.

>> No.62507143

>>62505430
sounds like a more difficult halting problem, lad

>> No.62507295

>>62506900
yes

>> No.62507323

>>62505534

>I just didn't want to write a compiler
sudo apt-get install gcc-mips-linux-gnu

>> No.62507336

>>62505430
fag. it's easy to do if you're allowed to read the source code without running it. if the functions are to be treated as black boxes and you're forced to actually run the functions for some contrived reason you fall for the halting problem meme.

>> No.62507361

>>62505862
I don't why cursing would be relevant

>> No.62507362

>programming 101
>can't even figure out how to make a program that prints a pine tree

I should just quit, right?

>> No.62507366

>>62506789
terminal control codes exist for this

>> No.62507467

>>62507362
>a program that prints a pine tree
you mean one of those fucktarded "print a design using ascii characters in the terminal" problems?
yeah, those are retarded, don't worry

>> No.62507480

>>62507467
;; t-thanks anon....

>> No.62507483
File: 38 KB, 500x607, 1473876049532.jpg [View same] [iqdb] [saucenao] [google] [report]
62507483

Can some one un-brainlet that last print statement for me?

import re

k = ['Alice eats apples.','Bob pets cats.','Carol throws baseballs.','Alice throws Apples.', "BOB EATS CATS.",'RoboCop Eats apples.','ALICE THROWS FOOTBALLS','Carol eats 7 cats.']


Onemoretime = re.compile(r'(Alice|Bob|Carol) (eats|pets|throws) (apples|cats|baseballs)(\.)',re.I)

for v in k:
kik = Onemoretime.findall(v)
if kik:
print((''.join([' '.join(kik[0][0:-1]),kik[0][-1]])))



I just wanted to add the period from the end of the sentence without just + "." or some other cheat. But this looks way to convoluted to be correct.

>> No.62507529

>>62507362
print(''' /\\
/\\/\\
/\\/\\/\\
||''')



Is this what your talking about?

>> No.62507555
File: 122 KB, 534x800, Choki, Eishosai (Japanese, active approx. 1780-1800)1.jpg [View same] [iqdb] [saucenao] [google] [report]
62507555

What is the most efficient way to scan for proxies?

>> No.62507615

>TA'ing intro java course at my uni (first actual programming class for CS majors here)
>at least 5 people in the class are 35+ year olds that have been professionally programming for 5+ years
>they're constantly asking questions that are way too advanced for the class
>pretty sure they're doing it on purpose

why are programmers so autistic

>> No.62507669

>>62507483
>I just wanted to add the period from the end of the sentence
I'm sorry, I don't understand what you're asking

>> No.62507685

>>62507615
Of course programmers are autistic, but they don't have to be trolls like your professional friends. It's probably boredom.

>> No.62507711

>>62507615
>Java
>Advanced

>> No.62507837

>>62507483
import re

k = ['Alice eats apples.','Bob pets cats.','Carol throws baseballs.','Alice throws Apples.', "BOB EATS CATS.",'RoboCop Eats apples.','ALICE THROWS FOOTBALLS','Carol eats 7 cats.']

Onemoretime = re.compile(r'(Alice|Bob|Carol) (eats|pets|throws) (apples\.|cats\.|baseballs\.)',re.I)

for v in k:
kik = Onemoretime.findall(v)
if kik:
print ' '.join(kik[0])

>> No.62508073

>>62504960
C++17

https://skebanga.github.io/if-with-initializer/

>> No.62508101

>>62508073
this is literally the best thing they've added in a decade

>> No.62508232

>>62507615
I do this in all my econ classes.

What else am I gonna do? Watched the professor slow the class to a crawl for the 25 buisness majors who thought they could just take a upper division elective without the prereqs because you can do that in buisness classes and still get an A+.

Brainlets need to be shown their place daily.

>> No.62508527

Is it possible to be into esoteric programming languages and have a gf at the same time?

>> No.62508603

The most reasonable C style guide:
https://www.kernel.org/doc/html/v4.10/process/coding-style.html

>> No.62508640

Was wondering if I could get a bit of help.

This pastebin is a skeleton of a tetris game we have been working on for class that someone else has posted, I haven't used any of their code as it parts seemed incorrect and I would not have learned anything anyway. The exercise has passed but I would like to get it working.

https://pastebin.com/s3edh57S (embed) (embed) (embed)

I'm posting it for reference on structure of classes, etc.

What I'm having trouble with is on line 475, I'm having trouble figuring out is how to call the functions associated with my models correctly to get the following piece of code working.

I am currently getting:

Uncaught TypeError: this.active.moveDown is not a function - Line 515
next = this.moveDown()


else if (action === Action.Down) {
if (this.active !== null) {
next = this.moveDown();

if (!next.active.Visible() && !next.hasCollisions()) {
this.active = this.moveDown();

} else if (!next.active.Visible() && next.hasCollisions()) {
this.gameOver = true;

} else if (next.active.Visible() && next.hasCollisions()) {
this.active = this.moveDown;
this.activeToGrid();
this.clearLines();
}
}



I'm confused because in my Action.left, next.moveLeft() was not throwing an error before I wrote this function.

Any tips would be appreciated

>> No.62508652

>source file starts with license thats over 20 lines
>source file doesn't have any other comments
Fuck

>> No.62508689

>>62508527
2d gf yes

>> No.62508707

>>62508073
>>62508101
I am not seeing how this is useful yet, but maybe.
Why store it in a variable if you are not using it?

>> No.62508722

>>62508707
you are using it you retard

>> No.62508777

>>62508722
using it more than once then.
In the example, you would just write
if( !(map.insert({ "hello", 3 })).second )

and in the case of >>62504960
you would just store the radius in a variable so you don't have to calculate it twice.
if (!c)
continue;
else
size_t radius = c->getRadius();
if (radius > result)
result = radius;

Or even better, handle the nullptr in the getRadius function.

>> No.62508831

>>62508777
if (!ret.second)
std::cout << "hello already exists with value " << ret.first->second << "\n";


>ret.first->second

>> No.62508838

Why the fuck do sepplesfag write only classes.
Don't they know that in sepples you can also just write functions? It's not fucking java.

>> No.62508848

>>62508838
Most sepples courses are taught with classes in mind.

>> No.62508864

>>62508838
it's not fucking haskell either. non-trivial code tends to have non-pure functions.

>> No.62508869

>>62508838
It is easier.
A class is a function ready to be used.

When people write a function in the constructor instead of writing a function, it is just stupid.

>> No.62508925

I have structure with lock and 2 threads, both threads have reference to the struct.
struct state { struct lock lock; };
void fn(struct state *s)
{
wait_random_time();
lock_lock(&s->lock);
// ...
unlock_lock(&s->lock);
// ...
}

int main(void)
{
struct state *state = state_new();
thread_new(fn, state);
thread_new(fn, state);
thread_sync();
}


Is dereferencing same pointer in 2 threads wrong?

>> No.62508957

>>62508925
no it's fine

>> No.62509010

>>62508838
Because they're manufactured javababbies. POD structs have their place and there's nothing more infuriating than a class with only static members.

>> No.62509039

has fast can I learn SQL for my interview tomorrow?

t. programming brainlet

>> No.62509046

>>62508925
It's fine, as long as one of them isn't modifying it.

>> No.62509063

Anyonehre who knows xaml? I am making an app in uwp and i am seriously struggling with a grid. I need to make a grid which is 8x8 and all cells are same width and height and also the grid is visible (simple white line)

Anyone can give me some idea?
Coming to xaml from web dev is a nightmare, in html and css i can do this shit so easily in like 30 seconds, but in xaml even the most simple shit is super complicated

>> No.62509087

>>62509039
>has fast can I learn SQL for my interview tomorrow?
SQL is dead simple, but it's a declarative language and you probably don't know any other declarative languages
and nobody can learn a new language in a new paradigm in a day, no matter how simple it is
so you're fucked

>> No.62509125

>>62509039
Just learn the syntax for creating a table (create table poop{id int not null auto_increment ... etc}
and syntax for pulling shit out of a table (SELECT id FROM poop WHERE id='5') this is literally 70% of shit you do in sql.

>> No.62509350

Hi anons,
I started coding with C and C++, now I want to get into python it seems so concise and fast which is werid.An books recommandations for me?
Im currently reading "starting out with Python-Person"3rd edition
>anything helps me im rather new

>> No.62509414

>>62509350
The official documentation is quite good.
https://docs.python.org/3/tutorial/index.html

>> No.62509530

rolling

>> No.62509599 [DELETED] 

>game over
>voting screen
>jaina who was total shit but had a grill user name got 6 votes
holy shit, how thirsty are those virgins? to they really thing she will whisper them after a match and offer them secks because they upvoted her?

>> No.62509615

>>62509599
what

>> No.62509633

>>62502372
Getting started with 3ds homebrew. How is the scene doing nowadays? Is it as big as the Vita and PSP scene?

>> No.62509695

With an unrelated bachelor, if i want to work in software, should I get an MS in CS or a 2nd bachelor in CS?

>> No.62509781

Explain pointers to me like if I were a retarded nigger

>> No.62509801

>>62509781
A pointer is just an address of some location in memory.

>> No.62509907

>>62509781
yo baby sum da fuck wid a kfc ho

>> No.62509922

>>62509781
http://cslibrary.stanford.edu/104/

>> No.62509977

>>62505430
As int is not further specified, I'm assuming ints as of the C programming language. The solution is easy:
https://pastebin.com/g6R7htQm

There's a finite set of inputs and a finite set of outputs.

Account https://steamcommunity.com/id/looooooooooooooo/
Game
http://store.steampowered.com/app/569480/Kingdoms_and_Castles/

thx

>> No.62509994

Not a programmer yet, but I figured this is the best place to ask.
Say I have about 9 months to learn a single language in order to enter the work force with it, what language would be the most optimal in this case?

>> No.62510002

>>62509994
FORTRAN

>> No.62510022

>>62509781
Literally just an address.

>> No.62510025

>>62509994
Java, C# or JavaScript.

>> No.62510028

>>62509994
Depends what your goal is. If your goal is to get a job, then maybe Java or C#. But FYI a single language almost definitely won't cut it. Bare minimum, most of the time you have to know SQL and a programming language. Though keep in mind that once you learn the fundamentals of one programming language, it's a lot easier to learn other programming languages and even just markup languages.

Alternatively, learn front-end web dev, which means CSS, HTML (not actual programming languages, so they should be a lot quicker to learn), and Javascript. Heck, if you learn Node too (not a programming language - your javascript skills will transfer) you can be full-stack.

>> No.62510066

>>62510028
I'm already a first year student of CS, so they're teaching as all of those things, but I want to move out so I need a part-time job for the next year.

>> No.62510121

>>62509994
Figure out what you like doing.

I thought I wanted to go into mobile development since it was "the next big thing", then I thought I wanted to be a web developer and I started learning Node and JS, but after a couple years of learning I realize that what I really enjoy is things related to network security and cryptography

>> No.62510321

How do I set poo to the loo?
&poo = const &loo?

>> No.62510577
File: 134 KB, 340x340, 729.gif [View same] [iqdb] [saucenao] [google] [report]
62510577

>when your highly specialized library has zero competition, so you write zero documentation, not even comments in your source code, because users have no choice
t. libelf author

>> No.62510705
File: 507 KB, 595x639, 1502289725200.png [View same] [iqdb] [saucenao] [google] [report]
62510705

>>62510577
you're doing God's work, anon

>> No.62510706
File: 41 KB, 1280x1483, tfw-way-too-intelligent.png [View same] [iqdb] [saucenao] [google] [report]
62510706

When did you first realize that monads are the Haskell version of babby-tier metaprogramming? All they do is let you redefine how binding and sequencing works for in a small subprogram.

>> No.62510729

>>62510706
>monads are metaprogramming
fuck off
at least post the copypasta, that's better bait

>> No.62510734

>>62506387
toPalindrome xs = xs ++ reverse xs

>> No.62510757

fuck opengl though

>> No.62510782

>>62510729
Not an argument. My post does explain why they can be considered that.

>> No.62510820

>>62510782
monads are not and will never be programming
you can do metaprogramming using monads, like the Q monad from th, but monads are not innately related to metaprogramming

>> No.62510836

>>62510820
>repeating your assertion
>still not addressing the original point
Not an argument.

>> No.62510854

>>62505481
put a cin.ignore before the get
You still have something in the buffer, probably your \n from entering the miles

>> No.62510858

>>62510836
>addressing the original point
what point? the fact that you think binding means metaprogramming?

>> No.62510890

>mfw C# and .Net core are actually nice
lesson: if /g/ hates something it means its good.

>> No.62510907

>>62505862
what the hell is going on here?

did the snake lay egg ??

>> No.62510911
File: 299 KB, 843x3218, linq.png [View same] [iqdb] [saucenao] [google] [report]
62510911

>>62510890

>> No.62510913

Using tinycthread

>> No.62510920

>>62510890
just use whatever suit your need dude, no need to care about the circlejerk

>> No.62510967

>>62510858
The fact that it lets you treat the steps of a program (and yes, that's what that chain of functions actually is) as data and transform them into a different program (by changing how binding and sequencing works). This is especially obvious in Haskell do notation.

>> No.62510969

>>62510911
good post

>> No.62510994

>>62510967
you are simply looking up the chain of abstraction and seeing that your notion of programming has been abstracted over and calling it metaprogramming

do you think C programmers used to think of generics as metaprogramming?

you are using imperative concepts to try to constrain haskell
what about lists? (->) a? both monads, both ill defined by imperative "steps"

monads are not metaprogramming in the same way that generics are not metaprogramming, they are simply a higher abstraction on things you are used to

>> No.62511012

>>62503425
That's not multiple inheritance.

>> No.62511017

>>62510967
>>62510994
more to the point, binding (and return) define a monad
for you to call this "babby tier" (already using reddit terminology) is silly
a monoid has a 0 and a + operation with a few rules

is a monoid a ""babby tier"" number, because you can't multiply it or take the sine of it?

>> No.62511028

>>62511012
Who says it was?

>> No.62511035

>>62503754
I'll do what I want.

C# is comfy, and I get paid to use it.

>> No.62511045
File: 40 KB, 405x650, 1500300378365.jpg [View same] [iqdb] [saucenao] [google] [report]
62511045

>that one fucking faggot in r/cpp_questions who answer half of the question and never comes back

>> No.62511051

>>62511028
Fuck off with your bullshit 16-year-old word games. That post clearly implied with the first sentence that it was being illustrated with the code.

I'm not replying to anything else you post, jerk.

>> No.62511062
File: 84 KB, 1000x928, 1456205750415.jpg [View same] [iqdb] [saucenao] [google] [report]
62511062

>> No.62511068

>>62510911
Am I being trolled, or did this article completely accidentally glaze over the built-in functionality that directly addresses the central complaint it brings up?

>> No.62511071

>>62511051
There is no need to be upset.

>> No.62511089

>>62510994
>>62511017
>still ranting
>still not actually addressing the point
A program is a sequenced series of computational steps.
Metaprogramming is the act of treating a program as data and transforming it into a new program.
Any usage of bind amounts to chaining together a series of computational steps.
Bind can (potentially) redefine the way binding works and the way computational steps are sequenced, effectively producing a different program from the one implied by the original sequence of computational steps.
Therefore monad usage is a form of metaprogramming.

Good luck actually addressing this argument instead of making futile attempts to override it with more angry assertions.

>> No.62511093

>doing Android development
>using a fair number of external libraries (~15-20)
>assets already in place
>apk size still around ~5mb
>remember there are apps on the store around ~15mb-20mb that only seem to do basic data display
I'm starting to wonder what the fuck they're putting in there to get to that size

>> No.62511110

>>62511093
they use more libraries than you do because they cant write code

>> No.62511115

>>62511089
>A program is a sequenced series of computational steps.
Says you

>> No.62511119

>>62511093
Images and/or huge libraries like Guava.

>> No.62511132

>>62511089
And you could apply your backwards logic to virtually any abstraction.

>> No.62511141

>>62502401
learn a few web frameworks + javascript + PHP and you got yourself a web dev job making 45k a year. just don't ever try to go outside of web dev because you'll have no idea what you're doing

>> No.62511170

>>62502372
I was working on an image Pager for 4chan some anon on /wsr/ requested (sorta like cool Iris that was popular for firefox a decade or so ago, to eyeball all images of a board at once), then before I even got the foundation done, his thread went up and got archived, now I don't feel like completing it.

>> No.62511191

>>62502401
php

>> No.62511237

>>62511115
>denying the meaning of a program
If a program is not a sequence of computational steps, then what is it?

>> No.62511240

will a few months of random personal projects + open source contributions look decent enough to help me get a job? I'm about to graduate and my github is pretty much empty.
or should I not waste my time and instead focus on algorithms and solving programming problems?

>> No.62511247

>>62511237
things to be done or to occur

>> No.62511252

>>62511132
>And you could apply your backwards logic to virtually any abstraction.
And yet you fail to show how there's anything wrong with this logic, or how it applies to abstractions that it shouldn't apply to (according to you).

>> No.62511254

>>62511115
Does haskell not compile to machine code?

>> No.62511269

>>62511252
>all forms of abstraction are metaprogramming
Nice fucking logic, jackass

I guess I "failed to explain why that's a problem", looks like I'm the irrational one! Everything but hand cranked machine code is just shitty metaprogramming

>> No.62511273

>>62511247
>things to be done or to occur
Even if I accept this broad definition, chaining together computational steps falls under it, and therefore, the usage of bind also falls under it. Congratulations, you've achieved nothing.

>> No.62511283

>>62511273
That's a subset you fucking moron

>> No.62511284

>>62511269
>having to lie so brazenly because you can't address the argument
So me where (>>62511089) states or implies that "every form of abstraction is metaprogramming", retard.

>> No.62511299

>>62511284
Are you saying C style procedures AREN'T metaprogramming?

Don't they abstract over variable input and types and such?
It's metaprogramming!

>> No.62511304

>>62511283
>repeats what i said
>acts like i said otherwise
>acts like it doesn't work against him
Truly subhuman.

>> No.62511305

>>62502401
Lots of bad advice. Even with the pajeets java will basically guarantee you a job in the US right now and for the next decade. If you're inexperienced just go to a recruiter and start with a shitty contract. It'll still be better than anything none software related and pay decently in most regions

>> No.62511321

>>62511299
Show me where I said or implied that "abstracting over variable input and types and such" (whatever this incoherent string of words even means) is metaprogramming, or that C procedures are metaprogramming. Spewing your schizophrenic delusions and pretending that they originate with me is not an argument.

>> No.62511328

>What are you working on, /g/?

Been working on the name for my next project the last couple of days. Can't wait to get some inspiration so I can finally mkdir and start programming

>> No.62511331

>>62511304
There are programs that AREN'T imperative
In fact you say binding?
Well there's no binding in assembly, just registers and instructions, and all of your "low level" (high level) C code compiles down to it.

>> No.62511348

>>62511331
>still not addressing anything i said in any way, shape or form
Why are you so subhuman?

>> No.62511350

>>62511321
>show me where I said
Holy shit you are fucking retarded if you cannot understand what the fuck I am saying

You come up with this inane bullshit about binding which is not only false (monads are not "just about binding") but ridiculous (programs are not inherently about binding), and not only ridiculous but has no basis in reality (machine code does not do that kind of variable binding), and I show you some basic fucking examples of where your retarded logic leads, and suddenly I need to be fucking quoting you explicitly

>> No.62511360

>>62511350
And the worst part is in 5 minutes you'll be crying that you were just trolling and that you really aren't this stupid, honest!

>> No.62511366

I don't get the difference between const and constexpr (in C++).
Could anyone explain?
Constants in general when applied to pointers and references are pretty confusing, will it just get easier with practice or am I a retard?

>> No.62511376

>>62511366
const = doesn't change
constexpr = can be evaluated at compile time

>> No.62511377

>>62511350
But you are literally making shit up continually. You are not actually addressing any part of my argument because you're a schizophrenic subhuman and you don't know how to do it.

>> No.62511390

>>62511376
>can be evaluated at compile time
But isn't that the case with const as well?

>> No.62511392

College student here, can't figure out how to make a diamond with nested for loops and print statements. Is it normal to get logically stuck on little things? Does it get any better? Is struggling on simple programs a sign that I'm not cut out? Any advice for getting past hurdles. I passed my python class with no trouble even left out of there with an A. OOP stuff was not difficult but I struggle so hard with any kind of recursion or Nested looping. I'm starting to lose hope anon.

>> No.62511400

>>62511377
>you are not actually addressing my argument
Yeah, after all, nothing you said had anything to do with monads, or binding, or programming
Turns out you can just respond "you're not addressing my argument" to literally any fucking response to your argument and suddenly you are smart

>> No.62511452

What do you /g/irls do when your generic class interface delegate factory in C# doesn't work?

>> No.62511465
File: 1.06 MB, 640x360, 1467131735909.gif [View same] [iqdb] [saucenao] [google] [report]
62511465

>>62511452
>Microsoft Java

>> No.62511489

>>62511465
>anime reactions
what a sissy girl you are anon~

>> No.62511492

>>62511400
>nothing you said had anything to do with monads, or binding, or programming
Why do you have to keep lying and spewing schizophrenic delusions? Since you didn't like my original definition of "program", and your IQ is too low to see why your objection is completely irrelevant, let me rephrase it slightly:

A sequence of computational steps is a program.
Metaprogramming is the act of treating a program as data and transforming it into a new program.
Any usage of bind amounts to chaining computational steps.
Bind can (potentially) redefine the way binding works and the way computational steps are sequenced, effectively producing a different program from the one implied by the original sequence of computational steps.
Therefore monad usage is a form of metaprogramming.

(Note that by "bind" I mean the monad bind operator.)
Any schizophrenic rants that aren't supported by the text of the above argument will be called out as such and ignored.

>> No.62511494
File: 338 KB, 1140x813, programming socks.png [View same] [iqdb] [saucenao] [google] [report]
62511494

>>62511452
You're probably wearing the wrong socks.

>> No.62511499
File: 258 KB, 549x560, 1465333395741.png [View same] [iqdb] [saucenao] [google] [report]
62511499

>>62511489
>girl (female)
>sissy

>> No.62511518

>>62511452
>generic class interface delegate factory
>in C#

Did you time travel from the past when people used C# in a similar way to Java?

>> No.62511533

>>62511492
>accept my base premise or be ignored
Fuck off Marx you aren't a real intellectual and don't deserve a response.
You are lucky I entertained you by pointing out that binding is itself an abstraction in terms of machine code, and to argue that monad abstracts binding is metaprogramming demands you argue that binding abstracting registers, instructions and memory is metaprogramming.

>> No.62511544

>>62511533
>lmao i am paranoid szhico
wtf paranoid schzo
guess i'm ignoring this post! it has nothing to do with what i said

>> No.62511558

>>62511518
No, I am from the present where C# works like java.
>>62511499
>biological female
gross

>> No.62511566

>>62511533
>implying i demand that you accept my premises
No, just quote the ones you disagree with and explain what's wrong with them.

>to argue that monad abstracts binding is metaprogramming
Didn't I just tell you to not spew schizophrenic delusions unless you can back them up using the text of the actual argument? You really can't even begin to address it, so you'll keep doing this and always fail to quote what part of it in any way implies what you're saying.

>> No.62511579

>>62511566
>accept my base premise or be ignored
0
SELF
AWARENESS

>> No.62511584

>>62511544
>the schizo subhuman samefags to provide himself with support
Doesn't get any sadder than this.

>> No.62511590

>>62511392
That's a sign of lack of methodology you're showing, but don't be afraid it can be learned, for any problem, start small, solve the problem for the smallest possible n, observe what changes from n to n+1, can the change be genralized to any given n? Can you prove it? if so you have solved the problem if not why, lather, rinse, repeat.

Algorithms is the "stuff" of cs, it only gets worse from there, arm yourself with the best resources you can, I personally love Robert Sedgwick's lectures, but there are countless other free lectures on the net, take your pick.

>> No.62511602
File: 33 KB, 493x386, 1496998730043.jpg [View same] [iqdb] [saucenao] [google] [report]
62511602

>>62511579
>"quote the ones you disagree with and explain what's wrong with them"
>YOU'RE SAYING I HAVE TO ACCEPT YOUR PREMISES!!
Okay. You've just exposed yourself as a complete subhuman in a glaringly obvious way. Moving on.

>> No.62511605

>>62511584
I was just inb4'ing your post here >>62511566
It was supposed to get you to stop doing that stupid shit but you did it again so clearly I'm wasting my time here.
You are too stupid to understand.
You project by calling arguments from absurdity "rants", while you are the one rambling nonsense.

>> No.62511619

>>62511605
>still not quoting the parts of the argument you disagree with
>still not explaining what's wrong with them
Simply subhuman. You really can't help being one.

>> No.62511620

>>62511602
>troll face reaction image
Should've fucking guessed, I'm retarded for trying to explain shit to a redditor. Continue to believe that monads are metaprogramming, you'll never fucking use them anyway.

>> No.62511631

>monads are somehow metaprogramming even though bind is a function just like anything else in Haskell
maeks u think

>> No.62511644

>>62511631
Anything that isn't braindead C/C++/Java programming must be metaprogramming since you have to fuck with the language to do anything beyond subhuman

>> No.62511653

>>62511620
>>62511631
>still not quoting the parts of the argument you disagree with
>still not explaining what's wrong with them
Every time you do this, you make it clearer that you just can't address the argument. Surely even a cretin like you should have enough self-awareness to understand this fact.

>> No.62511660

>>62511644
>still being subhuman
>still not addressing the argument
I think this was your 20th attempt by now?

>> No.62511670

meta>>62511653
meta>>62511660
Metareally metamakes metame metathink

>> No.62511686

i imagine my programs in my mind and execute them, also in my mind

>> No.62511693

>>62511686
Those programs have a right to live, what right do you have to execute them?

>> No.62511704

>>62511670
>still being subhuman
>still not addressing the argument
Keep it up, kid.

>> No.62511719

>>62502372
>html
lel

Also which do you prefer, lower-case or upper-case parameters?

>> No.62511721

>>62511704
You're still going on about that?
That conversation started with you posting some r9k meme and ended with you posting a reddit image.
You tried to argue a stupid point, you were proven wrong in multiple areas, and you responded with "nanana i cant here you! you're just rambling!".

Stop replying.

>> No.62511733

>>62511494
this just makes me sad

>> No.62511735

>>62511721
>still not quoting the parts of the argument you disagree with
>still not explaining what's wrong with them
>still lying
Keep it up, kid.

>> No.62511737

>>62511721
And you're probably desperately typing up some post about here vs hear, not realising it's yet more bait to draw in your stupid and asinine responses since they show you for what you really are

>> No.62511761

>>62511733
How so?

>> No.62511764

>>62511737
>m-m-muh bait
Reminder that the argument still stands and has not been addressed:

A sequence of computational steps is a program.
Metaprogramming is the act of treating a program as data and transforming it into a new program.
Any usage of bind amounts to chaining computational steps.
Bind can (potentially) redefine the way binding works and the way computational steps are sequenced, effectively producing a different program from the one implied by the original sequence of computational steps.
Therefore monad usage is a form of metaprogramming.

>> No.62511823

>>62511764
>Bind can (potentially) redefine the way binding works
Binding doesn't exist in machine code

>> No.62511849

>>62511823
>Binding doesn't exist in machine code
And this is relevant how, brainlet?

>> No.62511857

>>62511849
Is binding metaprogramming?

>> No.62511868

>>62511857
>Is binding metaprogramming?
Can you quote the part where I said binding is metaprogramming, brainlet?

>> No.62511869

>>62511764
>Lists are fucking programs now because they're monads

>> No.62511871
File: 4 KB, 275x183, dad.jpg [View same] [iqdb] [saucenao] [google] [report]
62511871

>>62503663
Looks like code to me, champ. When are you going to quit posting on that "dee pee tee" and get yourself out there in the job market? It's not hard, champ. Just walk into the company you wanna work for, ask to speak to the manager. When he comes out, just give him a firm handshake, look him in the eye, and tell him you wanna work there. It's as simple as that, champ.

>> No.62511888

>>62511868
Can you quote the part where I asked whether or not you said that?
As I recall, I did not ask whether or not you said that, I asked whether or not you believed it.

Sorry, but my brainlet understanding of my native tongue has not given me sufficient words to explain such a basic concept to a master such as yourself.

>> No.62511896

>>62511869
Quote the part where I say monadic values are programs, brainlet.

>> No.62511906

>>62511888
No one said that binding is metaprogramming, so why bring it up, brainlet? The answer to your irrelevant question is "no".

>> No.62511916

>>62507711
maybe they're asking about Python

>> No.62511917

has anyone used mariadb's connect engine for json? i was wondering how well it works in practice

>> No.62511953

>>62511917
no

>> No.62511965
File: 252 KB, 544x960, 1492904173512.jpg [View same] [iqdb] [saucenao] [google] [report]
62511965

>>62511871
That's not how it works nowadays, Dad, jeez. No one is impressed by that trick anymore. If I really want the job, I need to wear my programming socks and sneak into the manager's office. Then I'll wait for him under his desk. When he comes back with his morning coffee, I'll give him a bro job under the table to show him that I know how to have fun with the dudes. Then I'll have him finish on my resume. After that, he'll have to take responsibility and hire me.

>> No.62511970

new thread
>>62511967

>> No.62511985

>>62511896
A program is just a list of instructions (ints).
Manipulating lists of ints = manipulating programs.

>> No.62512027
File: 9 KB, 275x183, sad_dad.jpg [View same] [iqdb] [saucenao] [google] [report]
62512027

>>62511965
Son, nobody likes a faggot. These "pro-grammar" socks that you ordered are for sissies, champ. You don't wanna be a sissy, do you? Your mother and I are very concerned about your well-being. Please take down all those posters of your friend Linus and try to get a job the normal way. It's not hard, champ. Just walk into the company you wanna work for, ask to speak to the manager. When he comes out, just give him a firm handshake, look him in the eye, and tell him you wanna work there. It's as simple as that, champ. Once you do that, you might even get yourself a girlfriend. Women are attracted to success, champ. Please, champ, I want to see my grandchildren before I die.

>> No.62512037

>>62511985
Quote the part of my argument that states or implies that a list of ints is a program. If you can't do it, you are not addressing the argument.

>> No.62512046

>>62512037
I don't understand, I'm not allowed external facts? You are the only one allowed facts?

>> No.62512070

did you guys ever got a mental block on starting bigger projects from the ground up? I feel like it's stopping me from progressing.

I read about programming a lot, I know the fundamentals of the languages I wanna use, I'm always trying to practice stuff like data structures and alghoritms in small chunks, but I can't actually do bigger, marketeable projects that I could put on a repository to show off for possible employers, for instance.

>> No.62512078

>>62512046
>I'm not allowed external facts?
Your facts aren't facts (a list of ints is not necessarily a program because ints are not, in and of themselves, computational steps). Either way, this assertion don't address the argument in any way.

>> No.62512104

>>62512078
>ints are not, in and of themselves, computational steps
yes they are, you can execute them

>> No.62512122

>>62512104
Cool assertion, but it has nothing to do with the argument, so it's ignored.

>> No.62512156

>>62512122
do you have friends?

>> No.62512219

>>62512070
> marketeable projects that I could put on a repository to show off for possible employers

does peple actually do that?

If you have a "marketeable" project why you need a job?

>> No.62512233

>>62512219
It is marketable in the sense of marketing your skills, not necessarily marketable as a product.

>> No.62512246

>>62512233
hey boss let me show you this sudoku i made, now raise my wage.

>> No.62512261

>>62512246
What was the purpose of this post? If you want to mock someone, distancing your satire so far from the target isn't very effective.

>> No.62512408

>>62507362
ASCII art problems are made for retards. What is your problem?

>> No.62512420

>>62507529
Does python really not use \n?

>> No.62512781

>>62511273
>Congratulations, you've achieved nothing.
His thought process must be a pure function.

>> No.62512877

>>62512246
>hey potential employer, let me show you this CRUD app that employs all the standard functionality of 99% of web apps

>> No.62512972

>>62512420
Triple quotation marks lets you format it without newlines.
Single quotes needs \n.

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action