[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: 388
Thread images: 26

File: anime_sicp.jpg (66KB, 800x534px) Image search: [Google]
anime_sicp.jpg
66KB, 800x534px
Old thread: >>59147279
What are you working on, /g/?
>>
FIRST FOR EMACS
>>
GCC 7 WHEN?
>>
>>59158401
NANO STRONK
FUCK EMACS
>>
>>59157910
Artificial Intelligence is trash.
>>
>>59158427
>tfw superiour syntax highlighting in nano
https://github.com/YSakhno/nanorc
>>
Learning D. I've finished 13% of the book (760 pages).

Seems like I should revise the array chapter.
>Strings have no slices
>indexOf returns long
>can't implicitly convert a string to char[]
import std.stdio;
import std.string;

void main()
{
write("Enter your string: ");
string str = strip(readln());
write("\nNow enter what character you want to the string to cut by: ");
char cutoff_char;
readf(" %s", &cutoff_char);

long first_index = indexOf(str, cutoff_char);
long last_index = lastIndexOf(str, cutoff_char);

writeln(str[first_index .. last_index+1]);

}

$ ldc2 test.d && ./test
Enter your string: sdjlfegjkh lkc sklurlka flkjsdl;iu es;ek'

Now enter what character you want to the string to cut by: df
djlfegjkh lkc sklurlka flkjsd
>>
http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf

This is fucking bullshit how can anyone manage to understand this without any help
>>
>>59158508
>Learning D.
Good man. D is the language of the future. Anything you want to do in a program, you can do in D. It's even getting the overrated safety features that make everyone praise Rust. You can't go wrong.
>>
>>59158551
I don't dislike Rust. D is just easy to use.
>>
>>59158560
You should dislike Rust. But more importantly you like D.
>>
>>59158550
Why are you so mad about it?
>>
>>59158567
>You should dislike Rust.
I found no reason to. I'm not using it because I gave up on it, it's insanely complex in some parts.

In anyways it probably doesn't matter since it's the software you produce that counts.
>>
>>59158588
That's the point. Rust is antithetical to producing software. Nobody has ever shipped a program made in Rust.
>>
>>59158584
I've implemented some parts of it but the english isn't even written in english, no one can fucking understand anything this paper is saying its just an extremely condensed piece of information not a learning guide, and there are no learning guides online.
>>
>>59158609
True or not, why are you bringing Rust up? I was talking about D,
>>
>>59158623
I was also talking about D. Maybe Rust is just so poisonous that it makes people talk about it when they never wanted to.
>>
>>59158508
Learn UFCS, it can make code look cleaner, particularly on the line where you're reading the string in
>>
red pill me on Python, guys
will it make me love programming again?
>>
i wish someone would just write my parsers and ast for me that shit is boring af
I just wanna start my type checker and code generation
>>
>>59158661
>Uniform Function Call Syntax (UFCS) or sometimes Universal Function Call Syntax is a programming language feature in D, Rust[1] and Nim that allows any function to be called using the syntax for method calls (as in object-oriented programming), by using the receiver as the first parameter, and the given arguments as the remaining parameters.
Nice. Thanks anon
import std.stdio;
import std.string;

void main()
{
write("Enter your string: ");
string str = readln().strip(); //UCFS in action
write("\nNow enter what character you want to the string to cut by: ");
char cutoff_char;
readf(" %s", &cutoff_char);

long first_index = indexOf(str, cutoff_char);
long last_index = lastIndexOf(str, cutoff_char);

writeln(str[first_index .. last_index+1]);

}
>>
>>59158680
No, but Lisp will.
>>
>>59158680
>will it make me love programming again?
What made you stop?
>>
>>59158680
You might want to take a look at Nim, anon
>>
>>59158707
yfw it's literally just a shitty pipe operator :^)
>>
>>59158707
"Enter your string: ".writeln();

It's p. nice
>>59158735
>shitty
No
>>
>>59158751
can't implement UFCS yourself
btw why is every captcha I get something involving "CALLE"
>>
>>59158735
>>59158733
ayylmao I love pipes.

>>59158733
What about the functions that take multiple arguments then? Like readf()?
import std.stdio;
import std.string;

void main()
{
"Enter your string: ".write();
string str = readln().strip();
"Now enter what character you want to the string to cut by: ".write();
char cutoff_char;
readf(" %s", &cutoff_char);

long first_index = indexOf(str, cutoff_char);
long last_index = lastIndexOf(str, cutoff_char);

writeln(str[first_index .. last_index+1]);

}
>>
Started going through K&R again but should I learn C if I've still got tons I could learn in Python?

I think I'm at an intermediate-advanced level with Python.
>>
C++ has proposed UCFS in the 2016 proposal
>>
>>59158763
long first_index = str.indexOf(cutoff_char);

Only works with the first argument
Also don't abuse it, I was having a giggle with the whole "...".writeln() thing
It's nice for chaining shit together tho
>>
>>59158767
Depends. What do you want to do? If you like embedded system and shit like that working with Adrino or Raspberry Pi, yeah go ahead and learn C. If you are just going to do software work, C++ is more up your alley. Beside if you are doing programming as a hobby, you should just experiment with all types of languages and see which you like. Do C for a week. Switch to C++ the next. C# the next. See which one you like the best.
>>
Will putting stuff on my Github like porn rippers and tools that notify me when targeted accounts make posts on social media immediately turn employers away?
>>
>>59158550

I had a similar problem. I just wanted to know how to rasterize a bezier.
>>
>>59158861
No. Go for it anon
>>
>>59158861
Who the fuck cares. Make it a video ripper.
>>
(((struct)))
>>
>>59158864
>rasterize a bezier
My problem is I just want to make it werk.

Fuck it time to use a library, I'm fucking done trying to reinvent the wheel
>>
File: what_is_this_slut_saying.png (132KB, 835x296px) Image search: [Google]
what_is_this_slut_saying.png
132KB, 835x296px
>>59158864
Are you by any chance an idiot? Bezier is a set of extremely basic cubic splines between adjacent points, what's so confusing about it? Once you have one spline figured out the others are extremely analogous.
>>
>>59158903

I ended up making it jest-werk with De Casteljau's algorithm & Bresenham's line drawing algorithm.
>>
>>59158910
>Are you by any chance an idiot?

Yes.
>>
How old are people here? is this thread mostly professional programmers or people that want to learn?
>>
>>59158949
Mostly faggots who can't code and people shitposting about their favorite language
>>
>>59158962
I always thought this thread would consist of 40+ year old men with functional autism working for anoonimiss
>>
>>59158962
If you see a pro-rust post, assume they are about 15. Everyone else is a toss up.
>>
>>59158994

>rust is developed by 15 year olds

dumbfuck
>>
>>59158930
At least you're honest. Any specific questions?
>>
Does anyone else fantasize about fucking all the lisp femboys just to display your languages dominance over them?

I... I can't be the only one
>>
>>59158916
back to /o/ turd
>>
>>59159016
What? Did you get buttblasted by a lisper or something?
>>
Is it possible to force install a library through a python script if the person who runs the script does not have the library installed? what would the command me
>>
okay am I retarded?

I'm trying to step through this 2D array and initialize each element.

        for( Cell[] cellRow : theCells ) {
for( Cell cell : cellRow ) {
cell = new Cell();
}
}


It's not working. What the fuck am I doing wrong?

Also, I'm getting an unused warning for cell. It's clearly being assigned a new instance goddammit!
>>
>>59157910
n steam desktop authentication made in electron

muh cross platform
>>
>>59159011
>rust developers post on 4chan
It's against they code of conduct.
>>
>>59159011
Are you implying the rust developers are shitposting about rust on here? If that's true, that's really fucking embarrassing for them.
>>
>>59159013

No, because I already solved the problem.
>>
>>59159035
Turn your script into an executable.
>>
>>59158550
doesn't even look that bad bro. one dedicated night SLOWLY reading through it, maybe using a pencil and paper to take notes, and you can probably understand most of it.
>>
>>59159045
Mozilla got a really good deal on recently unemployed Correct the Record workers. It's not the actual devs. Unfortunately the workers were really bad as evidenced by losing to a reality tv star who ran as a joke and desperately tried to sabotage himself when the joke backfired. So now they're here shitpost shilling Rust to a bunch of dudes who can't write fizz buzz. How is Rust going to make the anime girl in my wall paper more kawaii?
>>
never seen a language rustle so many jimmies. so much ass pain over Rust. jesus. I don't even get what's so horrible about it.
>>
File: 1488243967666.jpg (27KB, 300x492px) Image search: [Google]
1488243967666.jpg
27KB, 300x492px
>>59158551
>Mad C toddler angry about Rust with literally 0 context
Who knew.

Hourly reminder that
C stands for cancer
C stands of communism
C is crime
and
C is for cucks

Can't make this shit up
>>
>>59159143
To hard for our local C fizzbuzzer
>>
>>59159145
>when you don't actually get anything done in Rust so you spend your days shitposting on /dpt/ instead
>>
>>59159143
D fag here. I wonder why "some" people are so mad about Rust. I liked it and it was pretty nice. However it was pretty complex once you go down the road. Lack of books doesn't help either
>>
>>59159167
How many fizzbuzz have you made, C pajeet?
>>
>>59159183
I don't use C
>>
>>59159195
You don't use any language
>>
>>59159143
Nope
The Rustfags just came in here one day and started shitting the thread up
>>
>>59159066
Wat? I mean cant I go like:

import os
if (!os./some_module/):
pip install /some_module/

?
>>
>>59157910
How many of you have actually read SICP?
>>
>>59159199
Yes I do
>>
>>59157910
All programming languages are just Lisp in disguise.
>>
>>59159202
Aren't you that idiot who approached me with his hateboner against rust since the beginning in this thread? >>59158567

At least this anon here contributed >>59158661
you are just here to announce that you hate Rust.

Is google paying shills against mozilla these days?
>>
>>59159216
Sure you do.
>>
>>59159209
Ask yourself what are you trying to achieve. If you are servicing retards turn it to executable. If you are dealing with people who know what they are doing just tell them to install X module.
>>
>>59159225
I don't dislike Rust either, just this fag >>59159145 who doesn't actually program in Rust but spends his days shitposting on /dpt/
>>
>>59159244
>Turn it into an executable
Using py2exe or something? Is there a standard lib that lets me turn shit into an exe?
>>
>>59159250
If you are not, his "counterpart" is not any better.
>>
>>59159258
pyinstaller
cx_Freeze
py2exe
>>
>>59158427
who the fuck uses nano?

I bet it's mostly guys who feel superior because they're not going to take part in the great emacs vs. vim debate.
>>
File: sosa.jpg (17KB, 366x219px) Image search: [Google]
sosa.jpg
17KB, 366x219px
>>59157910
Can anyone tell me why this exception doesn't work?
>>
Rust or Nim or Go?
>>
>>59159714
Go
>>
Should I be using Python 2 or 3 in 2017?
>>
>>59159733
Neither, you should be using Go.
>>
>>59159670
What is your input to number and why are you expecting an error? NameError happens when a variable is not found in the global or local namespace.

>>59159733
3. There is no reason to learn 2.
>>
>>59159761
if you are pajeet working on google
>>
>>59159764
>3. There is no reason to learn 2.
depends on the industry, most existing projects still use 2. so you could learn 3 to shitpost in /dpt/ while you ll be forced to write 2 in prod
>>
>>59159764
input to number should be a number, i'm expecting a ValueError if someone entered collatz(b) instead of entering a number, but ValueError didn't work so i changed it to NameError
>>
>>59159789
True. But I am speaking from the point of view of a hobbyist or someone looking to try programming. The division between 2 and 3 is one of the reasons I dislike Python.

>>59159794
The correct exception should be ValueError. What happens when you use ValueError and input b?
>>
>>59159845
>>59159794

Alright I figured out what is wrong with your code.

NameError occurs when you try to int(b) because b not defined.
ValueError occurs when you try to int('b') because b is not an integer.

So put both exceptions into your code unless you can account for one of those situations not happening
>>
File: akarin glare.jpg (46KB, 456x461px) Image search: [Google]
akarin glare.jpg
46KB, 456x461px
Is there a python command to set up the default terminal resolution? Would like it to set it a little bigger so my logo that prints can be seen
>>
>>59159714
Rust if you can withstand complexity
>>
File: MobaXterm.png (13KB, 768x443px) Image search: [Google]
MobaXterm.png
13KB, 768x443px
How do I install PIL or Pillow in Python 3 on Windows with MobaXTerm?

I already tried the
python3 -m pip install Pillow
workaround as well as just
python3 -m pip install PIL
and I get an error message saying
/bin/python3: No module named pip. 


Am I just entering the commands wrong or is there something more I have to do to install these libraries on Windows with MobaXTerm?
>>
is anyone here familiar with CC65?

is using the C compiler with nothing but asm directives a viable solution? that way i'd get slightly higher level assembly for the C64
>>
>>59159983
Have you tried killing yourself?
>>
I want to make a website that has very similar code to a chat client+server, but I have no idea where to begin.

What do?
>>
>>59160285
Lmfao what did you just say to me kid?
>>
>>59160305
What is your programming experience?
>>
>>59160314
The things I know that may be relevant are HTML, Javascript, Java, and PHP.
>>
>>59160333
Look into using socket.io. Should be pretty easy.
>>
>>59160355
In a twist of irony, the site's down.
>>
>>59160333
How well do you know them? Have you graduated from uni or just played around with these things by yourself
>>
>>59160402
Playing around by myself.
>>
>>59160419
Do you currently own a server? You're going to need to rent one out if you want this to work between two actual people
>>
>>59160387
>https://web.archive.org/web/20170208024545/http://socket.io/
>https://github.com/socketio/socket.io/blob/master/docs/README.md

The website's sys admin is shit

The API is pretty simple to use. For example sending a message looks like
socket.emit("chat", "Hello Anon");
>>
>>59160218
Install anaconda.
Use conda.
>>
>>59160218
try
pip3.5 install Pillow/PIL
>>
>>59160452

This isn't for data science shit you sperg.
>>
>>59160437
My dad might have one.
Not sure how to program a server though.
>>
File: Screenshot_29.png (9KB, 306x302px) Image search: [Google]
Screenshot_29.png
9KB, 306x302px
Doing real time form validation for password-confirm-password blocks is a nightmare. Holy shit.
>>
>>59160307
I think he said
"Have you tried killing yourself?"
>>
How is Java ME today? What are good sourcew to read about it?
>>
>>59159036
are theCells and cellRows empty?
>>
File: u wot m8.png (260KB, 432x713px) Image search: [Google]
u wot m8.png
260KB, 432x713px
>>59160471
Polling-esque checking is cancer, why are you trying to real time check.

>>59160475
pic related
>>
>>59160471
why not make entering a char an event?
you constantly checking?
>>
>>59160484
I figured it was good way to introduce myself to Angular. I was right. I learned something, but I'm exhausted.
>>
>>59160500
iirc
domElement.oninput = (event) { console.log(event.value); };

fires every time you type a letter
>>
I'm learning C++. Why do I usually see reference declarations like this:
int& x = y;


and not like this:
int &x = y;


However the following is more common:
int  *p;


rather than:
int* p;


As I understand so far int& is not a type by itself nor int* and so these operators belong to the name not the type aren't they?

// As a result the correct way to
// declare these variables should be this:
int *p;
int &x = y;


Can someone explain the reason of this inconsistency to me?
>>
>>59160540
*forgot the =>
>>
>>59160540
>>59160546
yep, whats holding you up then?
>>
>>59160544
Trying to see any line of logic in C++ is a waste of time.
There just isn't any.
>>
File: Screenshot_30.png (54KB, 1464x387px) Image search: [Google]
Screenshot_30.png
54KB, 1464x387px
>>59160540
>>59160500

No, I am doing it with Angular, but it is event based since Angular fires an event every time I type a character as long as I have the ngModel directive inside the <input> element. There's a lot of overhead required to make an event handler, and it gets even worse since I have to look at two inputs, and then it gets even worse, because the code has to handle every possible way that a user could try to "break" the validation.

That's why I say it's an unexpected nightmare. Just look at the HTML. It's ridiculous.
>>
>>59160465
Not a data science, I also use Anaconda
>>
>>59160544
both are the same, just personal preferences
i prefer the symbol at the data type.

int& is the adress where the variable is saved
int* is the pointer to that adress.
>>
Anyone experienced in Unity shader?

Is there a way to get the total length/width of the side of a cube (my model)?
>>
25 pages to go until I finish my daily study goal.

Oh boy, do programmers have to remember this output formatting bullshit? Not comfy at all.
>>
>>59160755
>programmers remembering anything from books
lmao
just google everything everytime until you remember it
>>
https://projecteuler.net/problem=52

My Python solution feels like cheating

def sorted_method():
n = 1
while(1):
x2 = sorted(list(str(n*2)))
x3 = sorted(list(str(n*3)))
x4 = sorted(list(str(n*4)))
x5 = sorted(list(str(n*5)))
x6 = sorted(list(str(n*6)))
if x2 == x3 == x4 == x5 == x6: return n
else: n += 1
>>
So I have been learning Ruby and Lua, I'm passing the beginner level..so what sort of socks should I be wearing ?

Or, is it just compiled langs that wear knee highs ?
>>
>>59160911
Le ebin maymay bro!
XDDD
>>
Self-learner here

We are given the number n, the value v (v = 0 or 1) and the position p. write a sequence of operations that changes the value of n, so the bit on the position p has the value of v. Example: n=35, p=5, v=0 -> n=3. Another example: n=35, p=2, v=1 -> n=39.


I literally reverse-engineered solution form various other problems to:

            Console.WriteLine("Change Bit in position p in Number n, and set the value v");
Console.WriteLine("Insert number: ");
int number = Int32.Parse(Console.ReadLine());

Console.WriteLine("Insert bit position: ");
int p = Int32.Parse(Console.ReadLine());

Console.WriteLine("Insert value to change 1/0: ");
int v = Int32.Parse(Console.ReadLine());

number = number & (~(1 << p)) | (v << p);

Console.WriteLine(number);

Console.ReadLine();


Problem is, how the fuck could i figure that on my own? Seriously this is like those problems in math where there is some special method of solving problems that no one could have figured it on his own
>>
Anime is not real.
>>
File: 100 crack fist of chen.jpg (17KB, 325x221px) Image search: [Google]
100 crack fist of chen.jpg
17KB, 325x221px
>>59160967
WTF FUCK U
>>
>>59160576
well shit...

>>59160731
Yeah, I know what that.
I prefer the * and & operators at the names.

I used
sometype* var;
style when I started to learn C
but then someone explained to me that it's not really correct as it implies
that
sometype*
is also a type so you could declare
two pointers like this:
int* p1, p2;
which is not true since p2
is a simple int variable and p1 is a pointer to an int type.

(I know that it's not recommended to declare two or more variables in the same
line but that doesn't make type* style any more "correct". It's just
kind of misusing the way C/C++ handles whitespace characters, no offence.)

Anyway... I thought I could use the same analogy in C++ but it feels like I'm being
forced to use that clusterfuck of a coding style I mentioned in my previous post.
>>
>>59155016
The reason I wrote it is because I had several Go projects in need of such a library. Previously I used to use pure Go image manipulation libraries, but performance was suboptimal. Cgo is there for better performance and because Go supports a lot less formats than FFMPEG/GM natively.
>>
>>59160967
DELET
>>
>>59160905
never used python
what are you doing there?
str(int) is int as string i guess
what does list(string) and sorted(list) do?
>>
>>59161114
List(string) returns a list of characters, sorted(list) returns a sorted copy of that list.
>>
How do poll() event loops work? If I make a thread for each connection with a poll watch for each of em and in 3 threads poll event happens at the same time, are they handled asynchronously (all at once) or will it cause a delay / clash?
>>
Writing my own GUI library in rust.

Macros are comfy
>>
>>59161130

this, also I didn't need to call list() because sorted works on strings
>>
>>59161130
>>59161151
and how should they ever be the same, except when n = 0?
>>
>>59160956
You'd basically have to learn bit operations first to figure it out, did the material not introduce you to those prior to presenting the problem?
>>
>>59161181
Of course it did, but basic bool logic, plus bit shift << and >>

It didn't teach me to use many bool logic operators to reset the bit and then set the bit to my preferred value.
>>
Orthodox sepples?
https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b

>Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

I have looked a bit in the bgfx source code and that asshole uses templates, virtual methods and stl.
Why are all sepples fags such hypocritical assholes?
>>
>>59161210
That sounds retarded, if you wanted minimal C++ you'd go with lambdas and templates
>>
>>59161188
Sounds like shitty material, just look up the TLDR on Wiki.

https://en.wikipedia.org/wiki/Bitwise_operation#Bitwise_operators
>>
>>59161144
Nice
>>
Since no one answered my question previously, can you change the default terminal size (for either linux/osx or windows) with a python command for a specific script?

something like this:

import os
os./set_terminal_dimensions/
>>
What's the best website for learning webdev stuff? Odin or Free code camp or what?
>>
File: lel.jpg (20KB, 283x189px) Image search: [Google]
lel.jpg
20KB, 283x189px
>>59159362
A lot of sysadmins do.
Pretty handy when you are SSH'ing on a server and you don't want to spend your time autisting aroung using le Vim
>>
>>59161355
But anon, Vim should be already installed, for god sake any OS comes with Vim pre installed

>>59161287
ANSWER PLS
>>
>>59161287
No but if you're using an ANSI terminal you can do something like this:
def set_term_size(width, height):
print('\x1b[8;{};{}}t'.format(width, height))
>>
>>59161390
Woops remove the extra }.
>>
>>59161135
it's funny when once you put a serious question nobody can answer lmao
>>
>>59161135
The idea of poll() is to avoid doing blocking calls to read from descriptors. You can call poll() from multiple threads, but you shouldn't because that's not how it's meant to be used.

poll() works by registering your open file descriptors (as a set of descriptors) and then doing a simple non-blocking call to check if there is any event on that descriptor. In other words, you let the kernel handle all the work. If there is an event, you read from the descriptor and reset the flag.
>>
Ever since I was young, I've always been attracted to smart people. Most of my friends agree with me, they all want a partner with whom they can hold smart conversations or have intelectual discussions. However, philosophy, politics, and literature do nothing for me. In fact, I can't stand guys who want to talk about these things. Instead, I'm very much attracted to the logical-mathematical type. I love programmers.
I am a software engineer myself and whenever someone comes up with a clever solution to a problem, I can't help getting wet. I'm fortunate enough to have a very good developer as a boyfriend. He knows about my fetish, but he's not so comfortable with it. I find myself masturbating to his github repositories or stackoverflow answers. That is like porn to me. I have googled this kind of attraction but so far I haven't found anyone with this fetish. It doesn't bother me to have it but I just wish I could talk to more people like me.
>>
>>59161439
>call a function poll
>idea is to avoid blocking/polling

who did this?
>>
>>59161461
Well this this is place will get you limp and dry
>>
>>59161439
Thank you <3 Now all I have to do is make an asynchronous way to react to the events right?
>>
>>59161482
Polling is not a blocking operation. Polling is to check if something is at the queue head and then return yes if there is and no if there isn't.

Dequeuing is a blocking operation, which is why you want to poll first.
>>
>>59161461
*throws bag of attention*
>>
>>59161498
If the interaction required has low overhead (aka you don't do any other blocking calls when handling the event), you can avoid threads and asynchrony all together.

This is the reason why you would use poll() in the first place.
>>
>>59161525
its a libwebsockets pool loop that accepts connections and monitors them, and I want to make sure I make it as responsive as possible. Would I be ok if I just responded to data receive with a non blocking function that doesn't stick around? thanks
>>
Yeah, standard ml really is the best lang.
>>
As there's always a million different ways to do things in C++... What's the best way to do async network programming in it? With decent performance requirements, for something like game servers. On windows fwiw. Is there a built-in way of doing it or do I have to resort to libraries like boost?
>>
>>59161651
poll() with threads
>>
>>59161651
>game servers
Game servers usually don't do async networking though, they operate on a tick basis where they spend some cycles doing game specific stuff and then some cycles on sending out packets to clients.

There's been several studies showing how game servers suck in that regard. They usually keep an array of connections in memory and then iterate over it when sending out game updates. If your socket happens to be in the back of the array, you'll get position updates and whatnot later than others. These studies show how some clients therefore can experience severe unfairness.
>>
Is it possible to program on a Chromebook or do you have to run Linux on it to do it?
>>
>>59161672
As in one thead per client? What if I want something more scaleable?
>>
>>59161692
See >>59161684

There's no reason to run any more threads than you have (virtual**) cores. Threads don't do much when they're blocked and waiting to be scheduled on a CPU. In addition, you need to handle stuff like memory location considerations (you don't want to invalidate the cache because you're using up all of it for different thread stacks).

Just enable non-blocking socket techniques.

** I said virtual because of hyperthreading
>>
>>59161684
I should have been more specific, I mean something more like an MMO, not a fighting game or MOBA. I know those things run in lockstep, or on a tick basis, but I imagine MMOs run on async sockets as they can handle areas with hundreds of players at the same time... Or do they just use really efficient sharding techniques and a fuckton of hardware?
>>
>>59161720
>Or do they just use really efficient sharding techniques and a fuckton of hardware?
They do. When the number of threads exceed the CPU count, you start losing the benefit of threading and start wasting cycles on concurrency stuff (like spinlocks and whatnot).
>>
>>59161730
>>59161720
>>59161718
>>59161692
The case I'm trying to make here is that try to use as little blocking calls as possible in your code. But where you can't avoid blocking, use threads (so other threads can be scheduled to run while the first thread is waiting for IO).
>>
error :  invalid conversion from 'void (*)(unsigned int) noexcept' to 'irq::interrupt_wrapper::function_ptr {aka void (*)(long unsigned int)}

what the fuck, gcc. it's the same fucking thing.
>>
>>59161785
>long unsigned int
>unsigned int
They're not the same thing. GCC uses the same type for long as long long, whereas Clang interprets long int as int and long long int as long int.
>>
>>59161798
I'm very sure they're the same. 64-bit is a long long int, 32-bit is still a long int.
the function_ptr thing is even defined as
using function_ptr = void(*)(std::uint32_t) noexcept;
>>
>>
>>59161785
>>59161798
>2017
>still using long/unsigned/int/... instead of (u)intXX_t (or the _fast_ or _least_ versions)
>>
Can someone explain to me why all python github projects have a
if __init__ == "__main__":
main()


?

I don't get what this is for/supposed to do
>>
File: 16730488.png (83KB, 866x960px) Image search: [Google]
16730488.png
83KB, 866x960px
>>59161857
>>
>>59161748
According to this, the most performant alternative is events.

https://daniel.haxx.se/docs/poll-vs-select.html

What should I use in terms of libraries to implement socket events in C++?
>>
>>59161857
Main only executes if you launch that program directly. It's so that it can be imported and used as a library as well.
>>
>>59161857
This has to be bait right?
>>
>>59161857
So you can import some program without executing any code directly, as if it were a library.
>>
patchi chaaaan daisuknyaaaa
>>
>>59161870
>What should I use in terms of libraries to implement socket events in C++?
epoll() or kqueue() or some wrapper stuff on top of this.
>>
>>59161879
>>59161881
oh ok thanks, so if you have a lone program that is just run as is- you don't need this parameter right?
>>
>>59161944
I forgot to mention, why is it that if you double click a python script it doesn't execute no matter what the file contents are? Im on windows btw.

e.g

input("hi")


Will not execute if I run by double click on a python script
>>
>>59161944
If you have a lone .py file. A lone program can have multiple .py files.
>>
>>59161837
>32-bit is still a long int
sizeof(long unsigned int) returns 8.

jonas@hobbes:~/prog$ cat sizeof.c; gcc sizeof.c && ./a.out 
#include <stdio.h>

int main()
{
printf("%zu\n", sizeof(long unsigned int));
return 0;
}
8

>>
>>59161952
You gotta be shitting me.
That is cause the python script isn't compiled but interpreted
>>
>>59161954
I'm pretty sure the exact size is not defined by the standard and thus depending on the compiler in use. Hence: >>59161856
>>
>>59161939
On windows I mean. Sorry it's been a long day.
>>
>>59161963
Ok? So why is it not interpreted upon double click
>>
>>59161976
Simply ebin. Please go do your first programming tutorial before coming here.
>>
>>59161987
Why are you even responding to me lmao, you go out of your own way to piss people off
>>
>>59162003
He isn't wrong. It is clear to everyone here you don't know the difference between a compiled or interpreted langauge. I suggest you go read first. All these answers are easily googled
>>
>>59157910
not really programming related, but I figured I'd ask here.

in ffmpeg, is it possible to add audio to a video file, but extend the video to duration of the audio?

for example, if the video is 4 seconds long, and the audio is 30 seconds long, then it'll keep looping itself until 30 seconds is reached.
>>
>>59161964
>>59161954
I'm already using std::uin32_t (>>59161837) and it's a long unsigned int on my platform. I think the error happens because gcc disregards the noexcept specifier in the using declaration?
time to file another bug I guess.
>>
>>59161843
>all those obscure languages but no ocaml, sml or chapel
>>
>>59162016
>It is clear to everyone here you don't know the difference between a compiled or interpreted langauge
Have no Idea how that was inferred

> All these answers are easily googled
Can't find a simple answer on google that says
"The reason a python script when double clicked does not execute by default in the python terminal is because . . ."
>>
>>59161964
>I'm pretty sure the exact size is not defined by the standard and thus depending on the compiler in use
That's literally what I already said in >>59161798

>>59161965
It's been a long time since I've dealt with anything on Windows, but there is a descriptor notification API thing in WinAPI which I used to monitor file system events. I don't think it works on socket descriptors though. Maybe boost has something.
>>
>>59160610
go to /wdg/ with your disgusting shit
>>
>>59162132
He already gave you the answer. Now you just have to use your brains to look it up. Google compiled language vs interpreted language.
>>
>>59161843
Haskell and CLisp the clear winners in terms of features
Shame about the performance and efficiency though
>>
>>59162151
0/10
>>
>>59162167
You can lead the horse to the water but you can't make it drink.
>>
>>59162151
You and the other guy(aka just you) are incredibly autistic and have zero english comprehension.

Its pretty sad that you're so autistic that you can't even answer a simple question and choose to reply with nonsense, how are you not able to understand what the actual issue is.
>>
>>59162132

new responder

>"The reason a python script when double clicked does not execute by default in the python terminal is because . . ."

At the start of every executable file is a "magic" sequence of bytes defined by the OS environment that tells the OS what this file is.

For example (from memory) a .COM file in dos must have an empty first 0x100 bytes. ELF files and Exe files have their own file headers as well.

A .py file is a simple plain-text format. It's saved stored and retrieved as a plain text format. When opened, all your computer will be able to do is treat it as a plain text document. If you fork an interpreter process onto it by typing python helloword.py then the program "python" will be happy to interpret your text as an executable program. However, I should point you that it's the "python" program that's running your text, you didn't write a binary called helloworld.
>>
>>59159036
can you post the cell class/struct and what stores theCells?
>>
>>59162231
http://lmgtfy.com/?q=why+can%27t+i+double+click+a+python+script

Fucking amateur hour over here. Really.
>>
>>59162252
>A .py file is a simple plain-text format.
Thanks this is what I wanted to know, I always assumed .py extensions will have the python interpreter assess the contents of the file by default

>>59162268
Please Kys
>>
>>59161843
There are some arbitrary things here selected to suit a particular language and programming preference.

There are also glaring mistakes that show the author is unfamiliar with some of these languages.
>>
>>59162288
The answer is literally in the first few links if you bothered to google. Kys retard.
>>
File: monitor ball chain.jpg (49KB, 600x450px) Image search: [Google]
monitor ball chain.jpg
49KB, 600x450px
pathetic NEET virgin here
I can traverse a binary tree and I can into RESTful API shit
what's my ETA on some codemonkey $15/hour job?
>>
>>59162304
No one cares about binary trees.

It's good that you can into APIs, though. That can easily get you a job. Go apply to companies in your area, many of them.

What language?
>>
Write a program that exchanges the values of the bits on positions 3, 4 and 5 with bits on positions 24, 25 and 26 of a given 32-bit unsigned integer.


Is this from left or from the right?

How do i find what bit is in specific place without changing it?
>>
>>59162303
Epic dude keep replying with the intent to shit on people and not doing anything useful in your god damned life.

I like the value you provide
>>
>>59162288

If you want to learn more about file headers and how the OS interprets a file access you can write some FASM and interpret it with DosBox/look at it with HxD, It's really fascinating to watch your x86 instructions get assembled into pure numbers, and then watch Dos simply interpret what those numbers are to produce effects on your CPU.
>>
>>59162331
>What language?
kotlin and swift, I wanted to do something with a big market full of hipster startup shit so I'd have a chance with no degree

please r8 my plan
>>
>>59162333
Right to left if big endian.
>>
>>59162355
>kotlin and swift
Sounds like you might get a job with some chai latte drinking fagbaits working on an iOS-only app.

No clue how that holds up in your area. You ought to learn Javascript, Java, or C# (respectively in order of jobs) if you want more job exposure.
>>
>>59162350
Yeah you are a fucking shitter worth shitting on. If you can't google simple shit you want to be a programmer and read through documentation? You are not going to make because you have zero adaption or self-resource skills.
>>
>>59162304

Download Visual studio and make a CRUD app with Entity Framework. Dump this onto a Digital Ocean droplet and consume it in an MVC app or whatever front-end you want.

Show this to your prospective employer and enjoy the fat stacks
>>
>>59162333
1<<x-1 gets you the xth position and & on the compare value(after you go a >> x-1) will either be 0 or 1, 1 will be if there was a 1 in the xth position.

That should get you started
>>
>>59162389
>CRUD app
This stuff is kind of abstracted away with mobile dev. Both Apple and Google have their own libraries for this stuff which make it sort of monkey-friendly...

Should I just publish a CRUD-style app using these ezmode libraries or do I have to do something that would impress other programmers? I assume I only need to check some boxes for HR or some middle manager.
>>
>>59162417

>should I make a thing that does stuff so I can show people that I'm able to make projects?

Yes.
>>
>>59157910
Why did CodeAcademy become Paid?
I learnt Python perfect, and now that I need C++, I'm left with youtube videos.
>>
>>59162429
lol ok
>>
>>59162354
I am somewhat familiar with this concept, however in example I mentioned about .py extensions, how would you know how the file type is treated by the DOS if you didn't look at assembly and therefore machine instruction op code treated it?

It may sound silly but you know how there are proprietary file extensions, how does DOS know how to interpret those? Do the companies who make proprietary files need to ring up microsoft and tell them to include their file extension so that its able to be interpreted by DOS and ran? (assume the guy is using windows)
>>
>>59162417
Just shit out some projects as easily as possible for a pajeet job. Nobody's expecting you to actually know something in those jobs anyway, most of the "software engineers" spend 10% of their time copy pasting from stackoverflow, another 10% actually writing code and the rest 80% they spend masturbating and shitposting.
>>
>>59162436
How about reading the actual fucking standard.
>>
self taught person here
i know c python and scheme
i have knowledge of math, algorithms
i made a compiler(not finished), little machine learning framework and many other smaller programs - both cli and gui, for example a simple query language for a small pornstar database
i started learning about a year and 3 months ago and i think i can program

can i get a job too, what should i focus on?
advice
>>
>>59162478
How long have you been self teaching? Also what were your main resources, just documentation and trial/error or what?
>>
>>59162478
Any job that hires. Go send out your resume.
>>
>>59162478
>can I get a job
Likely not there's really only few jobs that go the people who know the guy in charge of hiring.
>>
>>59162438

Imagine you're an OS author. The primary difference between an OS and a regular program is that nothing can crash your application (users will get annoyed).

Given this, your problem is that your user has just tried to access a file with an invalid header extension that you've never seen before, isn't on any of your lookups and has no obvious code entry point defined on it (i.e. first instruction in the file is not a goto or a magic number). Your options are :

1) crash
2) try to execute (will probably just crash and do nothing, also it's dangerous)
3) use a lookup table (like windows registry)
3) treat it as a default format (plain-text)

File types are either standardised (.pdf) or proprietry (.mp3) In order to interpret a proprietry extension you need to either pay a license (buy windows) or pay for the software that can interpret it (adobe photoshop)

I hope that cleared it up
>>
>>59162411

REEEEEEEE why doesn't this work

            Console.WriteLine("Exchange bits in position 3,4,5 with postitions 24,25,26");
Console.WriteLine("Insert number: ");
int number = Int32.Parse(Console.ReadLine());

int bit3 = number & (1 << 3 - 1);
int bit24 = number & (1 << 24 - 1);

number = number & (~(1 << 24-1) | (bit3 << 24));
number = number & (~(1 << 3-1) | (bit24 << 3));

Console.WriteLine("New number is: {0}", number);

Console.ReadLine();


Note that only changes bit 3 and bit24. I insert number 8388609 which is only bits 24 and bit 1, after exchange it should be 5, but my program writes 1
>>
>>59162515
>muh nepotism

Yes, it exists. No, it's not as prevalent as you think, and blaming nepotism for the existence of NEETs is dishonest at best.
>>
>>59162505
since september 2015
so a year and a half actually

mit ocw for almost all of it, coursera for ml, and g for ideas on what i should be doing - both openly asking and reading through the '/g/'s challenges' images for things i might like

i should probably polish what presentable things i have and make a github?
>>
>>59162478

Go to developer meetups in your area. The ones I go to generally have talks by tech leads who end with "By the way we're hiring"
>>
>>59162535
Cool thanks
>>
>>59162017
Nevermind I figured it out myself no thanks to you stupid motherfuckers.

@ECHO OFF
CD /D "Z:\[MAIN]\.recent\.output"
echo \033[33m Enter Video filename(Drag and Drop)| cmdcolor.exe
set /p img=

echo \033[33m Enter Audio filename(Drag and Drop) | cmdcolor.exe
set /p sound=

echo \033[33m Enter Scale(IE,1280:-1) | cmdcolor.exe
set /p scaling=

For %%A in ("%sound%") do (
Set Name=%%~nA
)

ffmpeg -y -i %img% -filter_complex "loop=70:250,setpts=N/25/TB,scale=%scaling%" -i %sound% -threads 8 -c:v libvpx -fs 3M -shortest -pix_fmt yuv420p -c:a libvorbis -b:a 128k output.webm
>>
>>59162456
>Just shit out some projects as easily as possible for a pajeet job
I'm actually working on an open source native 4chan client for iOS since there are no good ones available without root. Has some decent features already, lazy loading, async and such, nice UI / follows the design guidelines, some nifty features which give it some edge over the web browser gonna add ffmpeg for muh webums pretty soon

it's just for fun/experience, should I show it to employers? it's in a private repo atm because I didn't want spergs here to shit all over me before it was finished
>>
>>59162569
Are you a neet currently or something? Thats pretty impressive for 1.5 years.

I'd say publish pretty much anything on github, its free after all and you can delete shit you don't like.

If you don't have a degree its gonna be much harder obviously.

Shit... really makes me think what the fuck I've been doing in Uni though, a lot of wasted time..

Good job anon you've motivated me
>>
>>59162470
the what now?
>>
>>59161482
Well, there is a timeout argument in poll(), so it's definitely polling when timeout is non-zero.

If timeout is zero, poll/select are still very useful within periodic tasks. You get both non-blocking calls and multithreaded I/O (which is handled by the OS in this case).
>>
>>59162559

Idiomatic C# would be to create a Bitfield class that takes a number in its constructor and turns it into an array of 1's and 0's. You can then do your swapping and reinterpreting in a really easy to understand way.

>inb4 performance

nigga you're running on a VM anyway who cares.
>>
>>59162623
DA STANDARD
>>
Why do people use C# and act as if its not a meme? Why the fuck would you use a proprietary programming language based on a company that shills their own bullshit thats ran own their own shitty compiler (lmao visual studios)

>Microsoft fails
>Goodbye wasted time learning C#.

>Inb4 someone mentions intel and x86_64
Yeah no its not the same thing
>>
Help me /g/.
For learning arrayList, i just want to write a program that creates random rectangles in JFrame when you press space but nothing happening :/ . What am i doing wrong?

package ArrayLists;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;

public class array extends JPanel implements KeyListener{

private ArrayList<Rectangle> rec_list;
private Rectangle r;
private int rnd_1, rnd_2;
Random rnd = new Random();

public array(){
rec_list = new ArrayList<Rectangle>();
rec_list.add(r);
}

public void Add_array(){
rnd_1 = rnd.nextInt(200);
rnd_2 = rnd.nextInt(200);
r = new Rectangle(rnd_1, rnd_2, 25, 25);
rec_list.add(new Rectangle(r));
}

public void draw_array(Graphics g){
g.drawRect((int)r.getX(),(int)r.getY(),
(int)r.getWidth(),(int)r.getHeight());
repaint();
}

public void PaintComponent(Graphics g){
draw_array(g);
}

public void keyPressed(KeyEvent k) {
int key = k.getKeyCode();
if(key == KeyEvent.VK_SPACE){
Add_array();
}
}

public void keyReleased(KeyEvent arg0) {
}
public void keyTyped(KeyEvent arg0) {
}

public static void main(String[] args) {
JFrame frame = new JFrame();
array a = new array();
frame.addKeyListener(a);
frame.add(a);
frame.setSize(400,400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
>>
>>59162657

>Microsoft fails
>Google just takes over all the lucrative IP that everyone is using and profits

I use C# because fat stacks. Have fun writing your LISP interpreter or whatever
>>
>>59162646
oh that clarifies that.
>>
What should I make for my project in my programming class? I need to only use C# and console exclusively. I was thinking sorting algorithms and displaying how they sort in the console window.
>>
>>59162657
The compilers and debug tools built around .NET are open-source.
https://github.com/dotnet/roslyn

.NET Core (lightweight, cross-plat .NET) is open-source.
https://github.com/dotnet/core
https://github.com/dotnet/standard

Mono is a cross-platform, open-source implementation of the full .NET Framework.
https://github.com/mono/mono

Xamarin and its various libraries/UI components are open-source.
https://github.com/xamarin

The only major aspect of the C# ecosystem that is closed source is Visual Studio and the full .NET Framework. However, you are free to access the reference source which provides implementations of all major aspects on the standard library.
http://sourceof.net/

There are plenty of people using the open-source VS Code or other editors on non-Windows platforms.
https://github.com/Microsoft/vscode
http://www.omnisharp.net/

C# has the most jobs right now after Java (ignoring Javascript and SQL), so it's not like it's going anywhere anytime soon.
>>
>>59162618
i am studying something completely unrelated that's 90% memorization and i'm very good at memorization so a lot of free time is left for me to fill
thanks for the kind words
>>
>>59162705
That's not a bad idea. Did they give examples of past projects?
>>
>>59162705
Make a fishing game where the user has to throw a fishing line into a pond and catches different fish based on what beach/river he decided to fish at.
>>
>>59162623
JTC1.22.32 - ISO/IEC 14882
>>
>>59162691
Jesus christ im getting ptsd from my Java class

Also I don't think you're actually calling anything to paint it onto the frame

God that code looks like shit (not you just the language)
>>
>>59162705
make a dinosaur game like when the internet goes out and you load google and you press spacebar to jump except everything is drawn with #'s
>>
>>59162775
how am i going to do that? repaint() doesn't work.
>>
>>59162691

A few things,

-r should not be a private field of your JFrame. Refactor so you only use it within the methods and take rec_list.add(r) out of the constructor. You're adding null to your rec_list
-the last line of add_array should be rec_list.add(r)
-you don't call draw_array anywhere but that has the repaint method in it

Use a debugger in something like eclipse to try and debug this for yourself. Your goal is to hit the repaint line.
>>
>>59162806
Like >>59162812

Mentioned, the draw_array function (as well as other functions) are not being called anywhere
>>
>>59162751
Not really, they just posted criteria which is basically silly. You're supposed to use try catch, a method from a different file, a menu, and that's it.

They also grade complexity and difficulty of a project.

>>59162756
>>59162786
I would prefer to not make a game, since most of the code is dedicated to draw things in console, and not to actually program.
>>
>>59162853

Instructors like games.

Also I didn't mention graphics. I imagined something that was purely text based. A description engine and an input parser are the major components that you need to come up with.
>>
>>59162515
>Likely not there's really only few jobs that go the people who know the guy in charge of hiring.
>t. butthurt NEET from small town USA
>>
>>59162853
Well what are you being marked on? if its C# then making some GUI application would be pretty easy cause of win forms and such.

So maybe some interactive GUI that does something? Perhaps queries a database and adds/removes entries? idk
>>
>>59162812
>>59162846
But draw_array has graphics paremeter. How can i call the method?
>>
>>59162890
That anon already said they must use the console.
>>
>>59162902

You will have to make one out of an array of rectangles.
>>
>>59162853
Maybe a Conway's Game of Life with a configuration option menu so the user can play with behavior parameters.

Or an infection/prey-predator simulation.
>>
>>59162915
Make a roulette simulator then, with all possible bet combinations, draw up a simple grid using characters using a 2d array?
>>
>>59162902
>>59162929
forgive my ignorance actually. It looks like you just pass in a blank one.

So in your key handler something like :

 draw_array(new Graphics())


I'm not a java guy though so YMMV
>>
how does parsers/lexers handle whitespaces correctly?
for example, in this case whitespace does not matter: 5+5 vs 5 + 5
but here they do matter: int index vs intindex

oh, and is using regex a good or bad idea?
>>
File: Screenshot_2017-02-28_09-05-33.png (207KB, 959x1050px) Image search: [Google]
Screenshot_2017-02-28_09-05-33.png
207KB, 959x1050px
I'm figuring out parsing languages using the kaleidoscope tutorial for LLVM.
>>
>>59162982
the lexer runs through it and tokenizes it
>>
>>59162982
You split text into tokens, and return a token containing the value of non ascii character and forget the space.
>>
>>59162559
Someone please explain, it's driving me nuts

i went through debugging and bit3 is correctly set to 0 (in my number 8388609 which is just bits 24 and bit 1) and bit24 is correctly set to 1

When i try exchanging bits bit3 is correctly exchanged but bit24 does nothing...
>>
File: 1485969365272.png (836KB, 1000x986px) Image search: [Google]
1485969365272.png
836KB, 1000x986px
>>59162929
with arraylist? Sorry for that i am so dumb can you give me a code example please :3

>>59162979
it's not working ;_;
>>
My bud told me that he completely ditched sh and writes "scripts" in D/dmd
>>
>>59160967
What the fuck is wrong with you?
>>
>>59163018
kill yourself
>>
int number_of_divisors(int i) {
int n = 0;
int j=i;
while(j--)
if(i%j==0)
n++;
return n;
}


I am seriously starting to doubt my compiler. There is no way this function should crash, right? If I remove the n++, it terminates without problem.
>>
>>59163186
Maybe you're dividing by zero?
>>
File: 1488265211467.jpg (27KB, 407x617px) Image search: [Google]
1488265211467.jpg
27KB, 407x617px
>tfw no bf to teach me programming
>>
File: anal beads.png (6KB, 659x113px) Image search: [Google]
anal beads.png
6KB, 659x113px
>>59163186
delete this
>>
>>59163196
he is
>>
>>59163181
pls be nice :/ I am noob and i have to learn it by myself.
>>
>>59163186
>not using a for loop
>modulo by 0

you asked for it
>>
>>59163211
>>59163196

Thanks, replaced j-- with --j, now it works.
>>
>>59163204
I'd do it, but only if you're around and let me poke your boipussi.
>>
>>59163247
M-My boypussy?
But...But that would be l-lewd...
>>
>>59163247
>>59163261
Can you at least post a line of pseudocode describing gay sex to be somewhat on-topic?
>>
>>59163268
reminded me of the toddler kidnapper simulator game maker from this thread
wonder if he's still working on that game
>>
>>59163342
what the fuck
>>
>>59163342
Wasn't it a simulator where you could reproduce the children and they and a unique genome and shit like that?
>>
>>59163356
I remember that "game", he put incredible effort into making that shti
>>
>>59163342
The gaemdev that kept stats for vaginal and anal torsion of every loli?
>>
>>59163374
yes
>>
>>59163268
man mount
>>
File: 1478728918015.jpg (156KB, 1000x990px) Image search: [Google]
1478728918015.jpg
156KB, 1000x990px
>>59163374
that's the one
>>
>>59163385
jesus christ what the fuck
>>
>>59163342
I remember he wrote his own engine.
>>
>>59163406
First day on 4chan?
>>
>>59163452
no? that's just a little surprising for /dpt/
>>
what programming lang should I learn first?

https://strawpoll.com/3srb577
https://strawpoll.com/3srb577
>>
>>59163467
sml you scrublord
>>
>>59163459
We are all degenerates on 4chan. It just happens that we are degenerates that know how to program.
>>
>>59163406
>>59163459
I'd play it if it has a decent gameplay
>>
>>59163467
>SQL
>First programming lang
Hehehehehe
>>
>>59163467
haskell
>>
>>59163342
last I remember he had a board on atechan
>>
>>59163496
>>59163482
i know it's funny but i'd rather you vote or just honestly say what would be ok to start with
>>
>>59162955
This and the fishing idea aren't that bad actually.
How would I make the "wheel" spin though?
>>
>>59163506
haskell
https://en.wikibooks.org/wiki/Haskell
>>
>>59163467
C(ancer) -> Based Assembly -> Haskkek
>>
>>59163506
You should learn SQL in tandem with an actual programming language, not instead of.

Virtually everyone should know SQL fairly early in their career, unless they're doing systems programming.
>>
>>59163506
Any language is fine for your first programming. Your first language is going to teach you the concepts and logically thinking that is required for programming. That is it. Doesn't matter if it is Python, C, C#, C++, Haskell or Rust.

Each of course has their own learning curve but for the first 50 or so hours programming, they will all teach the same things. Afterwards, you can pick and choose which language suits your goals the most.
>>
>>59163532
thanks a lot man
>>
>>59163542
Don't learn Python
>>
File: answer_wrong.png (36KB, 200x200px) Image search: [Google]
answer_wrong.png
36KB, 200x200px
>tfw
>>
>>59163532
>logically thinking that is required for being an adult
ftfy
>>
>>59163508
The roulette wheel can just me represented by a visually represented array with constantly moving numbers like a slot machinei.e

<--- --->
[ 5black ] [ 2red ] [ 000green ]

Make the numbers colored if its possible or just do 5B / 5R

>>59163547
Wrong
>>
>>59163542
see >>59163547
anything you do, avoid a dynamically typed """""language""""" as your introduction to programming (assuming it isn't lisp)
>>
>>59163542
There is absolutely nothing wrong with starting with Python. Don't listen to >>59163547 this guy. Python has its own flaws for sure but it is an incredibly easy language to start with. Once you have move passed being a beginner, then you might find python restrictive.
>>
>>59163564
You will be surprised that most adults can't comprehend how loops work.
>>
>>59163577
Upvoted! Nice troll attempt mate
>>
Ignore >>59163577
Everyone who starts out with Python thinks it's great
Everyone who doesn't, and learns it later after learning a lot of other languages does not
>>
>>59163577
if it's only good for beginners why do so many programmers who have used Java/C/C++ use Python?
>>
>>59163593
>>59163602
I started with Python but I now program in C++ and C cause I prefer working with a bit of hardware. I turned out just fine.
>>
>>59163567
Wouldn't the "movement" be too fast? How would I make it slow down after x seconds?
>>
>>59163609
>if it's only good for beginners
Wrong. it's fucking garbage.
>>
>>59163609
What Python lacks in control, power and speed, it makes up in terms of being easy to code in. People use it cause if they can do their job easier, they will 100% pick the language that makes their job easier.
>>
>>59163628
>code
opinion discarded.
>>
>>59163624
Why is it garbage? I am honestly interested in knowing.
>>
>>59163624
I agree. I'm still trying to understand why people switch to it. The only thing I can think of is that they're either still beginners or they don't realize that not every language is Java
>>59163628
other languages can make jobs even easier. Python requires more thinking than say Ruby (since it has less abstractions) but also less learning, which I believe is the appeal to beginners (and a terrible trade off if you ask me)
>>
MIT teaches CS6.001 with Python.
I think MIT knows programming better than any of you fucking NEETs.
>>
>>59163659
MIT is reddit level trash.
>>
>>59163665
Is this the programmer's equivalent of 2/10 pointy elbow won't bang?
>>
File: 1459081435614.jpg (81KB, 720x720px) Image search: [Google]
1459081435614.jpg
81KB, 720x720px
What's the best language to learn for Australians?
>>
Where the fuck is new thread?
>>
>>59163643
not him but it's slow as fuck and python2 and python3 are two completely different languages
I wouldn't use it for any real program, but if you need to write a quick script why not
>>
>>59163684
Emu speak
>>
>>59163682
No, it's just the truth. MIT is fucking garbage.
>>
>>59163689
Yeah I already said you might find Python restrictive pass the beginner stage but for your "first" language it is as good as any other language since you learn the same stuff at the beginning.
>>
>>59163684
Australian English, bro. Most people speak that language there.
>>
>>59163696
>MIT is fucking garbage
So you are saying you are better qualified than the people teaching and studying at MIT?
>>
>>59163723
Where did you get that from? I said "MIT is fucking garbage". Which it is
>>
>>59163623
I guess if you leave it to a regular console.out function, just make it Sleep more and more for each iteration then, base the sleep timer on a function thats something like Root x
>>
>>59163734
I like to see you explain why the most prestigious engineering and computer science school is garbage.
>>
>>59163750
>that pajeet level English
>thinks MIT is somehow "the most prestigious engineering and computer science school"
I can't say I'm surpised
>>
File: Untitled.png (7KB, 500x330px) Image search: [Google]
Untitled.png
7KB, 500x330px
Hi guys, I don't usually come to this board, but I'm stuck and need some help.

I'm working on an assignment for class using linked list, structures, and arrays.

Everything is working except for outputing the char array. I am getting pic related

Any ideas? When I build it says there's no errors, and I don't really know where to begin since my instructor is useless.
>>
>>59163766
Forgot, it's C++
>>
>>59163766
>Hi guys, I don't usually come to this board, but I'm stuck and need some help.
Yes, we can see by your reddit formatting. Back to your subreddit.
>>
>>59163765
>Thinks
No it is objectively ranked as the most prestigious. You can easily google it.

>that pajeet level English
Did you attend MIT? How would you know?
>>
>>59163777
>reddit formatting
Why is this all of a sudden a thing to sperg about in the last few weeks? I'm going to go ahead and filter this phrase, because it literally never adds anything useful to the conversation.
>>
>>59163766
>windows
>this font
>this font size
>shit tier text interface for your program
>that pleddit formatting
gtfo you pleb
>>
>>59163777
I'm don't exactly get the whole reddit typing thing, and while overuse of line breaks can be a bit annoying, it helps to break up text walls.
>>
>>59163778
>No it is objectively ranked as the most prestigious.
If that is the case you would have no problem showing me a formal proof, correct?
>Did you attend MIT?
Why would I be attending literal garbage such as MIT?
>How would you know?
How is this related? Why would me attending or not attending MIT change my inherent understanding of English?
>>
>>59163814
>he literally admits to being here for just a few weeks
How could anyone be any more blatant in his redditry?
Reddit formatting is a well-documented phenomenon.
>>59163831
>I'm don't exactly get the whole reddit typing thing
Of course you don't, you're from plebbit.
>>
>>59163688
hey you

new thread spam here
>>59163844
>>59163844
>>59163844
>>
>>59163847
I'm not though.
>>
>>59163831
>usingspacesbetweenwords
nicetryredditscumwedontusespaceson4chanitstimetogoback
>>
>>59163847
>Reddit formatting is a well-documented phenomenon.
Wrong, and I can almost guarantee I've been on 4chan much longer than you have.

You have been sperging out about it on /dpt/ relatively recently, in any case.
>>
>>59163383
:^)
>>
>>59163859
You are though.
>>59163872
>Wrong,
This alone is enough for anyone to conclude that you are indeed a redditor.
>I've been on 4chan much longer than you have.
Yeah, that's another thing your kind likes to say a lot.
>You have been sperging out about it on /dpt/
Are you using the special /g/ interface to see my name?
>>
>>59163834
https://en.wikipedia.org/wiki/Massachusetts_Institute_of_Technology#Rankings

Must be sad being you. And because your rebuttal will be
>Wikipedia
Let me cite all the sources for you

https://news.mit.edu/2010/undergraduate-rankings
https://www.bloomberg.com/news/articles/2011-03-10/harvard-mit-ranked-most-prestigious-universities-study-reports
https://www.timeshighereducation.com/world-university-rankings/2017/subject-ranking/computer-science#!/page/0/length/25/sort_by/rank/sort_order/asc/cols/stats
http://www.encyclopedia.com/social-sciences-and-law/education/colleges-us/massachusetts-institute-technology#2
https://global.britannica.com/topic/Massachusetts-Institute-of-Technology

Don't worry I will be near when you nitpick about how it wasn't consistently #1 for all the years. Like being #3 or 4 makes it according to you "garbage". My bet is you never even attended college and is salty at everyone.
>>
>>59163896
Feel free to assert that, just know that's going to abort.
>>
>>59163901
>your retarded links
Is this considered a "formal proof" in your shitty "country"?
>>
>>59163923
Is this the part where you just lose all pretense and straight up troll? What do you consider formal proof and what is the problem with those links?
>>
>>59163896
You've specifically used the phrase "well-documented phenomenon" multiple times in your autistic complaints about doublespacing lines.
>>
>>59163934
>Is this the part where you just lose all pretense and straight up troll?
This question is unanswerable. It doesn't even make any sense.
>What do you consider formal proof
Is this level of education considered normal in your shithole of a country?
>what is the problem with those links?
They aren't a formal proof of the statement "MIT isn't fucking garbage".
>>
File: 1374344866952.png (67KB, 625x626px) Image search: [Google]
1374344866952.png
67KB, 625x626px
>>59163992
You never had formal proof of your statement "MIT is fucking garbage" either.

Please cite sources aside from your asshole that MIT is fucking garbage. And that they use Pajeet english.
>>
>>59163935
>doublespacing lines
Now it's clear beyond a doubt that you are indeed a redditor. Nobody else could possibly think that's what "reddit spacing" refers to.
>>
>>59164006
>You never had formal proof of your statement "MIT is fucking garbage" either.
This is self-evident, true by definition. It doesn't require a proof.
>Please cite sources aside from your asshole that MIT is fucking garbage.
Refer to my first post.
>And that they use Pajeet english.
Where did I ever say that? American English isn't as good as Australian English, but by no means is it "pajeet English". Or did you assume I wasn't talking about you when I said "pajeet English"?
>>
>>59164072
Anything in the southern hemisphere might as well be India.
>>
>>59164089
By what property does a country become India when moved to the southern hemisphere? If I move a single island, is it also India? What about a single rock?
>>
>>59164119
Countries don't move you fucking idiot.
>>
>>59164129
Assuming I wanted to move a country rock by rock, when does it become India?
>>
>>59164153
Never, because you can't move a country. It stays where it is.
>>
>>59164171
>you can't move a country
What a retarded claim to make.

Assuming I have the technology to teleport a large amount of matter, if I use it to move an arbitrary country which is not India to the southern hemisphere, at what point does it become India?
>>
>>59164226
If I had such a technology I'd teleport your ass into the fucking sun you retard
>>
>>59164271
You didn't answer my fucking question.
If I teleport you to the southern hemisphere, do you become India?
>>
Okay, I have a followup question to my previous ideas about sorting algorhitms in C# console.

How would you actually draw them to the console? I'm thinking bars, looking through the array, assigning the biggest bar to the biggest number, with each lower number representing a bar one step lower.

https://www.youtube.com/watch?v=kPRA0W1kECg

Video related is what I want to do in console, only if you get an array of integers, lets say 3,7,20; you would only get three bars of height 1,2 and 3.
>>
>>59165079
Your life will be easier if you start with making those bars horizontal, a value on each line.

Also, migrate to the active thread: >>59163844
Thread posts: 388
Thread images: 26


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