/dpt/ - Daily Programming Thread

Old: Working on?

Other urls found in this thread:

twitter.com/ID_AA_Carmack/status/386899206163554304
twitter.com/ID_AA_Carmack/status/627475252117770240
twitter.com/ID_AA_Carmack/status/383262540551028736
twitter.com/ID_AA_Carmack/status/323866349845770240
youtube.com/watch?v=ydyztGZnbNs
en.wikipedia.org/wiki/MAP_(file_format)
akaribbs.mooo.com/
youtube.com/watch?v=P73REgj-3UE
youtube.com/watch?v=ENdgyD7Uar4
twitter.com/notch/status/783084733622124545
codingame.com/ide/582466342ac6944cd030506c22f5f68cf2376a4
strawpoll.me/11359830
cleveralgorithms.com/nature-inspired/swarm/ant_colony_system.html
github.com/orangeduck/CPP_COMPLETE
youtube.com/watch?v=UgaQCg-0ZoU
youtube.com/watch?v=06x8Wf2r2Mc
twitter.com/NSFWRedditGif

First for better thread.

>Codingame
I'm not 15 user.

Additionally,
the sight of SPJ makes my nipples hard.

>Haskell man

i mean, there is a prizepool for there contests, thats why I do them.

What do you guys use to code?
Currently using Notepad++.

Sublime or Visual Studio

vi

Damn, ten thousand? Too bad everyone here is too dumb to win.

vim

Never use anything starting in "Visual"

Thiswas meant for

I'm just playing around at this point.

Depends on what language I'm using.

My go-to is Visual Studio, but I don't mind firing up IntelliJ or a simple text editor.

i know C++ (been using/learning it for about 4 years now, i just started uni)
lately ive been getting some C cravings, do you think it's worth investing my time into reading K&R? Will it make me a better programmer? (even though i know C already, probably not really well, honestly)

How do I into socket programming? I've never really messed with networking in my code.

Depends quite a lot on the language. If it's in C check out beej's guide. Otherwise I don't have any specific recommendations.

How do I compile without having a main class in java?

I've edited the .java source code for a library I'm using, and I need to turn it into a .class file.

How do I do this?

Whatever you don't, don't do it in java.
Java has a lot of alluringly easy to use networking facilities in the standard library, but they will fuck you in the long run.

What if it's for one simple assignment? I don't mind doing it in C if Java is that bad.

javac MyClass.java to produce MyClass.class file

Java networking tends to lock you into java. If you write a server in java, you tend to have to write the client in java, and vice versa. If you don't care about portability of your network protocol, then sure, do it in java if that's what you're comfortable with.
It is possible to break out of this liblock, but then it's just easier to do it in C from the start.

And also more educational to do it in C.

>tfw your method names can't be retrieved with reflection

Learning based Direct3D.
>tfw Direct3D is vastly superior to OpenGL

>Java networking tends to lock you into java. If you write a server in java, you tend to have to write the client in java,
False, my retarded friend.

>D3D superior to OGL
how so? in what way?

Even OGL developers think D3D is superior to OGL.

it just works

Being object-oriented makes it more sane than OpenGL, especially on C++, although there's still a lot of Win32/COM cruft. And according to Carmack it handles multi-threading much better, manages state better, and has surpassed OpenGL overall.

not really.

Not answering my question.

Maybe i'll have to look into DX then.

How long would it for a scrub like me to code up a probabilistic skip list?

it's not. nvidia proved numerous time that opengl performs better (eg: gdc 2006). today opengl can even be as fast as vulkan.

Beware of the window and device/context setting up code, as DX doesn't have anything like GLFW or GLUT to easily set up a window and a context. It's you and the low-level Win32 and D3D APIs alone. But once you get past that it's alright.

That's why almost all games choose D3D, because OpenGL performs better.

>2006

>2006

>today opengl can even be as fast as vulkan.
???

>That's why almost all games choose D3D
alri pajeet

>I am married to Dorothy, a priest in the Church of England. We have six children (three adopted).
>adopted
KEK

s/KEK/cuck

A vote was held, and it looks like my AI class will be using Java. Welp.

d3d has better tools, but

>almost all games choose D3D

that's one retard thing to say; all games running on ps4, wii u, android, ios, ... don't rely on directx.

yes, search "Approaching Zero Driver Overhead in GL" on google.

>And according to Carmack

twitter.com/ID_AA_Carmack/status/386899206163554304
twitter.com/ID_AA_Carmack/status/627475252117770240
twitter.com/ID_AA_Carmack/status/383262540551028736
twitter.com/ID_AA_Carmack/status/323866349845770240

Figure I'd ask this here, since you probably have more knowledge.

In windows search, it shows up an exact match if the syntax is
filename:~xy

It shows only files and folders starting with xy if you type
filename:~xy
It shows all the files and folders which have xy located anywhere in the name.
Why is the greater than/less than sign so important? I can't wrap my head around it how it works, would anyone be willing to explain?

it feels like you are

My AI class primarily used Java for examples but the professor was willing to accept implementations in any language.

>And according to Carmack
yes, according to Carmack.

None of those tweets contradict that.

What does this AI class involve?

>You can't blame the Linux users, there were not many of them ultil Valve made Steam client for Linux. You underestimate alot.

oh wow

carmack has been compromised

Yep, he's become some kind of meme language king now. Sad.

My professor wanted us to all be using the same language and gave us a few choices. First choice of the class was Java.

Learning algorithms, intelligent agents, some other stuff.

>not liking haskell
pleb

>Not ditching C++ for Racket

Is it worth starting with python 2 and moving up to python 3 eventually or should I just start with python 3?

How different is it?

>meme language king
His Racket demo for mobile vr was pretty cool though.
I hope he gets to focus on PC soon.

All meme language demos are cool. As if normie developers are going to learn something like racket to do something as standard as UI. Would have been way better off using Java or JavaScript if they wanted to make some brain dead easy way of making UI shit that every developer could jump into.

No that I like either of those langugaes particularly.

@c macro gods

how can i make this better?
#include

#define TYPE int
#include "define_generic.h"
#undef TYPE

#define TYPE float
#include "define_generic.h"
#undef TYPE

int main(void)
{
int arr_int[2] = { 0, 1 };
printf("Minimum int is %i\n", get_minimum_int(arr_int, 2));

float arr_float[2] = { 0.2, 1.5 };
printf("Minimum float is %f\n", get_minimum_float(arr_float, 2));
return 0;
}

source?

youtube.com/watch?v=ydyztGZnbNs

thanks!

#define STACK_ARR_LEN(x) (sizeof(x)/sizeof(x[0]))

int main(void)
{
int arr_int[] = { 0, 1 };
printf("Minimum int is %i\n", get_minimum_int(arr_int, STACK_ARR_LEN(arr_int)));

float arr_float[] = { 0.2, 1.5 };
printf("Minimum float is %f\n", get_minimum_float(arr_float, STACK_ARR_LEN(arr_float)));
return 0;
}


:^)

MAKE WAY FOR THE SHITTER:

I'm listening for a submit event on a form using jQuery:

$('#voteForm').submit(function(e) {
// code
});

Will the code in my function be executed before or after form submission? If it is executed before form submission, do I need to explicitly submit the form myself, or will it do so automatically after executing the code in my callback?

srs tho, why won't something like

#define DEFINE_MIN(T) \
#define TYPE T \
#include "define_generic.h" \
#undef TYPE

DEFINE_MIN(int)
DEFINE_MIN(float)


work? can you point me in the right direction, is something like this possible with macros?

no

I'm not 100% sure but I think it gets executed before submission. If you want to stop the submission you can add e.preventDefault(); anywhere in the function.

pls respond

Where'd you learn makefiles Cred Forums?

internet

Lua Development Tools

How'd you beat depression and laziness Cred Forums?

Exercise helps a lot imo.

I didn't ask for something that actually takes effort user

Adderall

public class Main {
public static void main(String[] args) {
Vector ints = new Vector(0, 1);
Vector floats = new Vector(0.2, 1.5);

System.out.println("Minimum int is " + ints.minimum());
System.out.println("Minimum float is " + floats.minimum());
}
}

public class Vector {
private T[] numbers;

public Vector(T ... numbers) {
this.numbers = numbers;
}

public T minimum() {
if(numbers.length == 0) {
throw new IllegalArgumentException();
}
T min = numbers[0];
for(int n = 1; n < numbers.length; n++) {
if(numbers[n].compareTo(min) < 0) {
min = numbers[n];
}
}
return min;
}
}

Can always stop breathing then. Death is an excellent sure for depression.

#define get_minimum(list, size, min) { \
min = list[0]; \
int i; \
for (i = 1; i < size; i++) { \
if (list[i] < min) { \
min = list[i]; \
} \
} \
}

int main(void)
{
int ia[] = {2, 3, 1};
int im;
get_minimum(ia, 3, im);
printf("%d\n", im);

float fa[] = {2.0, 3.0, 1.0};
float fm;
get_minimum(fa, 3, fm);
printf("%f\n", fm);

return 0;
}

How did i not think of this before

racket is great and all when you dont have a real job

Have any of you used processing? what do you think?

>having a real job
wwwwwwwwwwwwwwwwwwwwwwwwww

Lua has spoiled me, I can't write in any other language without feeling disgust anymore

555555555555555555555

Disgust was what i felt when i was working in Lua.

What did you dislike?

define(DEF_MIN,
$1 get_minimum_$1($1 *arr, int `len')
{
$1 min = arr[0];
for (int i = 1; i < `len'; i++)
{
if (arr[i] < min)
{
min = arr[i];
}
}

return min;
}
)

DEF_MIN(int)
DEF_MIN(float)


m4 test.c.m4 > test.c
gcc test.c


whats wrong with this famalams?

I used to program a bit in C in early 00's but haven't really touched it since and I'm now looking to get back into it.
Can anyone recommend a book that would (re-)introduce me to (modern) C?
I'm not looking for a book that's mostly a grammar reference (I have a pretty good grasp of that, plus I can always open K&R), I'm more interested in something that covers modern practices and tools (writing makefiles, all the gcc flags, differences between C standards, using gdb etc.)
Anything worth reading?

>int `len'

From what i remember, block delimitation, non-enforced semicolons, a decent standard math library. And 1-indexing. 1-indexing makes sense semantically, but everyone's just so used to 0-indexing.

Basically, i'm a sepplesfag and everything that takes me out of that groove looks disgusting to me.

emacs m4 mode highlighted len, so i thought it was a builtin macro so i escaped it. it works like this

>it works like this
>whats wrong with this famalams

was c++ a mistake?

>block delimitation

Sorry, I didn't learn programming in English, and google just turns up some geography bullshit, what mean

Anyways, the C api, LuaJIT and the table/metatable system and the code looking so damn neat are what keep me on the language

Your mom told me you were a mistake.

>All this shit when _Generic exists

Yes
Praise D

Means how the language marks the beginning and end of different code blocks.
Writing 'end' to mark the end of an if or while block was annoying and ugly. That WAS Lua that did that, right?

>what are templates

i meant it in the sense that c++ is useless because you can have generic code in C. the code in the pic is C

if true then
yeah it was
end

But then again, which scripting language has gotten the block delimiters right?

ugly, messy and verbose

you can metaprogram tho

python. Yeh, i said it.

Well, js does it c style, like i'm used to.

Oh, and that 'then'. Also annoying.

Any ideas for a relatively low level project? Preferably something practical to do with either operating systems, exploit or malware implementation/analysis that will take some time.

>sizeof(int *)
hmm

You could write a driver

Whenever I compile a C program, it also makes a .map file with the same name. What is it for?

What's a good book to learn C?

dont be sexist

If that's an IDE you're using, it might be inserting that itself. Compilers don't output a .map file
C Programming: A Modern Approach

could always make a packet sniffer or keylogger

Lisp, there no blocks, only nested expressions.

I didn't lol.

Okay Cred Forumsents if you were to write a text to brainfuck generator how would you go about it in C#.
inb4
>not a homework thread
It's not homework it's just a personal project I wanted to do initially I thought it was going to be easy until I started doing it.
Well I've been at it for about a week now and I get stuck on pretty much everything, so how would you guys go about solving this problem.
I have a general format for the BF that goes something like this
++++++++++
[
>++++++++++
>>add more blocks if there's an ascii code that is greater than or less than 100 by 10 or more

Nevermind, it's something the linker outputs
en.wikipedia.org/wiki/MAP_(file_format)

Considered it, but can't think of a device I'd want to write it for. Any suggestions?

Packet sniffer sounds interesting, though I'm not that much into networks.

kek

lmaooo tru

Haha Kill(Myself) amirite?.

that's not at all what _Generic does
even though it could be used in conjunction with this so you don't need to type foo_type(x), you could just type foo(x), but that only works nicely for 1 parameter functions, it turns into a mess of macros when you have 3 parameters for example

> new to programmig
> week 4

enjoying it but wondering if its for me long term ?
When a solution is found its not joy but relief, a moment of pleasure and then on to the next part of the problem.
Its like a fap but the fapping is painful and the cum is just the pain stopping for a bit.
Does it get better ?

Source on that anime? is it Yuru Yuri?

If you're competent to do that, you could write a gamepad driver, and then write up a tutorial on how to do that, for me to read.

How is that anything like fapping. Please see a doctor.

Programming is a roller coaster that eventually becomes a pleasant and calm ride with the occasional hiccup.

Stay at it m8.

Inu x Boku SS I believe.

What kind of gamepad driver? Any specific device?

Contribute to D and write a native gamedev library.

Thanks

size_t retard

I have an old GameCube to usb converter to use a GameCube gamepad on the pc, but it stopped working when i moved from WinXP to Win7. The only game that it still works with is Flight Simulator X.
I've been wanting to learn how to write drivers so i might get that functioning again. And i'm thinking a gamepad is a simple enough device for a noob like me to learn how to write drivers.

But you know, a driver for Xbox360 pad would be fine, or whatever you feel like and is convenient for you.

odd, would the controller not show up as a HID device?

Just pushed some changes to akari-bbs!
akaribbs.mooo.com/

I made [tags] more robust and added spoilers.
Do you think there's a use case for code blocks with spoiler tags?
Doesn't matter, added it anyway.

vim or atom. It depends, really...

It was some time since last i used it, but as i remember it windows doesn't detect it at all, but it still work fine in FSX, and only FSX.

>akari-bbs
I was expecting a blank page

I want to make an application that does API calls via HTTP to retrieve, send and modify data on another website. I want to store information about the calls it will make. Think of it as a bot. Is PHP+MySQL a good approach for this?

you need to be more specific
what causes it to make the calls

MySQL might be overkill. Sqlite3 would be the better choice for database.

PHP would work but PHP also sucks ass to write but thats really up to you.

You need to implement hover over reply links, next, akari-kun~

It's been a long time since I've had to use PHP so it may have changed somewhat but I wouldn't recommend it.

Does anyone have any good books or links for C++, finally taking Data Structures and I can't for the life of me grasp Nodes and how to incorporate them into Lists. I'm actually struggling for once.

config files are meant to be static

>"I'm actually struggling for once"
>with nodes and lists
What have you been doing up to this point, hello world?

you mean making a linked list? I'd just google it. There's a million articles about it. What are you having trouble understanding?

It's a virtual shop. I want my application to periodically check prices, find good deals of items I want and buy them accordingly. I also want it to manage my sales and adjust prices for the items I'm selling.

I never understood the PHP meme. Why exactly is it bad? It can do everything I need in this case: make HTTP requests, insert rows in a db table, display the information nicely in a small backend. What are the alternatives?

Actually, scratch that. I dug it out and tried it, and it does show up as a HID-compliant game controller in the device maneger, but it doesn't show up in the Game Controller Setting list.

What programming in C feels like: youtube.com/watch?v=P73REgj-3UE

What programming in python feels like:
youtube.com/watch?v=ENdgyD7Uar4

>rainbow cake
yep, it's for phallic obsessed homos

literally imagine it as people being nodes and pointing to the next person. you just have to set where they're pointing

most languages can do everything you need. the issue is how easy it is to write and maintain

if you're comfortable with php then that's fine. look up "cron job"

Playing around with vector clustering because I had an idea. Curious how it will work out.
I still need to optimize it for speed, though.

a learning algorithm?

i wonder how many years forcing stuff like c++ and java has set back cs education

Yeah. But currently I just want to get "good" clusters and kill noise.

>mfw got 40 stars on github for a 100 LOC python tool

Trying to fucking switch modes in a 32bit pmode kernel, now contemplating suicide.

>BIOS VGA interface
Unable to drop back to rmode, also I prefer high resolution and true color.

>VBE
Unable to drop back to rmode.

>VGA hardware
Too complex and still limited to the same resolution and color depth as the bios interface.

>VBE3 PMID
No VM supports it (at least not qemu, but I heard others don't support it either), I have verified this myself, qemu bios does not contain the VBE3 PMID table.

>VBE2 PMID
Qemu does support it, but i heard it's horribly gimped and hardly fucking works/hard to use.
Anyone know if it can switch video mode? it might be my only chance.

>UEFI
Can't use boot services after calling ExitBootServices (including video mode switching).
Also doesn't support any of the fucking interfaces above except for VGA hardware.

>Fuck off multiboot and grub in order to write my own bootloader so that I can switch back to rmode.
There is a good chance that I could miss an important interrupt while in rmode, which is bound to cause trouble, so switching back to rmode is pretty much out of the question anyway.

>Why drop multiboot just to switch back to rmode?
I think grub is clobbering the rmode IVT, because this is what happens when I try to drop back to rmode:
>reset PIC back to bios defaults
>cli
>paging already disabled
>setup 16bit flat gdt
>far jump to 16bit pmode code
>load segment registers
>load rmode IVT via lidt with limit 0x3ff, base 0x0
>disable pmode
>far jump to 16bit rmode code
>reload segments
>set stack pointer
So far so good, no problems, can write to vga buffer to confirm working.
>sti
Suddenly faults and boot loops.
And trying bios interrupts without enabling interrupts (not sure if this works) also faults.

[cont]

You're right that it can do those things well, and if you know the language well enough and keep your scope very limited it'll be fine.

In my experience the problems with PHP come when you have to depend on a flawed function from its (gigantic) core library and the documentation is poor or muddled. That's when it starts to go downhill fast.

finally starting the programming project I was assigned 2 weeks ago for my Advanced C++ class and learning the mistake I made as I know diddly squat

also fairly unfortunate the first C++ class I had taught file io using the standard library functions and not these io meme streams

Color me jealous. I have 0 stars.

>v86 monitor
I have not looked into this much, but I heard it's hard to setup.
I heard you have to emulate the int instruction, how does that work? wouldn't I need to drop back to rmode for that anyway?
if v86 solves the interrupt missing problem above then so far my two choices are:
1. v86 monitor
2. VBE2 PMID
Which one?

If neither fucking work, then I guess I am forever stuck on VGA mode 3 text mode. and UEFI doesn't even fucking support text mode causing grub to "unable to find appropriate video mode" leaving my kernel without a framebuffer.
So I'm also stuck on BIOS systems.

>Just set the video mode once in the bootloader and leave it on that
No, I want to be able to switch the mode at any time, this isn't fucking TempleOS.

>Just put the desired video mode in the multiboot header.
Bootloader is free to completely ignore it, so I have zero control over it, so I am not going to rely on it.

I guess there's also a third choice:
>Write my own sane virtual machine and fuck off x86 and the PC platform forever
But then there's the problem of writing my own compiler and toolchain which is a massive fucking problem considering I'm using C++ (yes, I'm using C++ in a kernel, fucking deal with it).

I can't believe it is twenty fucking sixteen and this is still somehow a problem.

>post a show hn
>get on first page
>watch the stars pour in

How do you mean, user? I can sort of see it with Java but surely you can teach CS with C++?

>these io meme streams
I don't care if they're meme. I love them.

The iostreams are the standard library functions.

The standard C pre-processor isn't recursive. You only get one level of definition. It's a crying shame.

>eclipse-based
eww

Why are you dealing with video modes in the kernel and not in an external executable/driver/module/...?
Also, how fleshed out is it (the kernel I mean)?

>fuck off x86 and the PC platform
The most sane answer, I'd say. At this point, writing a kernel from scratch on an architecture as complex as x86(_64)/PC is almost impossible unless you settle for underwhelming results.
Note however that NT had this exact thing done to it during its development process, as it was originally designed for the i860 (or was it the i960?): so be cautious.

>It's a crying shame
I would prefer to have decidable compile times.

>he's never heard of a maximum recursion limit
lol?

anyone know linear algebra? i have to prove that

If columns of A span R^3, then AX = B has a solution for every B.

where A = [U V W] and X = [x y z]. and U, V and W are elements in R^3

i'm lost

this is not really Cred Forums but i won't point you to /sci/ because it's awful
tell me what it means for the columns of A to span R^3

did /wdg/ croak again

i asked sci anyways how i understood it, the book says that if a vector spans R^3, it's a set of 3 real numbers, but i wrote that on part of the test and he marked it incorrect. his definition is that v1, v2, and v3 span R^3 if every vector in R^3 is a linear combination of v1, v2, and v3

R^3 is 3 dimensions of real numbers. His explanation is correct.

Use that definition to apply to your problem. What do you know about columns and linear separability?

you are wrong and he is right. this is just a definition. in particular what you can do is write B = xU + yV + zW for some x, y, z in R

Because I'm not making a micro kernel, and that doesn't solve my problem at all, in fact it complicates it further.

>How fleshed out is it
Not very, I started it like a few days ago. All I've got is some nice printing abstractions and a text mode VGA "driver" that just reads the multiboot framebuffer info.

twitter.com/notch/status/783084733622124545
How do you feel about the greatest programmer of all time buying Cred Forums.
For anyone interested

Meant for

i prefer shkreli

so would the proof be correct to say:
AX = B doesn't have a solution for every B if there is a column that doesn't have 3 real number. If the columns of A span R3, then all columns have 3 real numbers. Therefore If columns of A span R3, then AX = B has a solution for every b. ?

For a class I need to write a super simple program in Bash. It needs to accept five numbers, square them, sort them, then print them. Not hard, right? Except Bash is fucking incomprehensible to me. I've learned C/C++, Java, and Python just fine, but literally nothing about Bash seems even somewhat sensible to me.
Any help? I'd rather get an explanation than an answer, but I'll take either really.

All hail nootch

Look at this hack I made

Not even close...

Where I think you are getting the vector length of 3 thing from is that to span any space of N dimensions you need at least N vectors. It has no relation to your problem.

can someone help me here?
codingame.com/ide/582466342ac6944cd030506c22f5f68cf2376a4
they give an example :
>For example, if the card distribution is the following:
>Player 1 : 10D 9S 8D KH 7D 5H 6S
>Player 2 : 10H 7H 5C QC 2C 4H 6D
>Then after one game turn, it will be:
>Player 1 : 5H 6S 10D 9S 8D KH 7D 10H 7H 5C QC 2C
>Player 2 : 4H 6D
in this example, the game ends in tie (i.e., "PAT"), right?

also, how much should this take? I've been trying to solve this one for ~6 hours... well, not really, but... yeah

You'll need xargs, bc (for squaring), and sort. That's all I'll give you because that's all I know. Fuck bash, no one in their sane mind would use that horrible language in $CURRENT_YEAR.

If the columns of A span R3, then no vector in the set can be defined as a linear combination of another, and they aren't zero vectors. Therefore, there can't be a pivot in the last column of augmented form of AX = B, so AX = B has a solution for every B.
>am i getting closer?

But as far as I can tell it's not possible to use one function as an argument for another with Bash. How is it even possible that fucking C is a more user-friendly and convenient language than anything?

haha I really like you content. how long have you been programming for? is there any place I can follow you for more memes like this?
I've done this before. ended up with ~900 stars on some vaporware project that wasn't even interesting,
fucking tarded redditors posting in the comments. they've probably all visited Cred Forums once and they were offended so they want it dumbed down to their level with more minecraft.

every command just pulls a fucking file out and runs the instructions. The keywords call hooks and forks, the hooks into buffers already in use, the forks into threads that run a function then return or terminate.

Loops function just like in other languages but you don't have type safety problems since its all just binary, I think. Though, since it's asm you have to recognize the possibility that you are not "canning" or encapsulating things due to the nature of efficiency as brought by asm. Think of it like a pre-processor directive that let's you create different kinds of loops by examining the signature with a different kind of parser than the programming language parsers.

Maybe that sounds weird.

Basically, it's all ASM wrapped in a file system that supports the execution of different file types already instated.

If you mean the design then you probably should actually work on something and look to see how the tools most tend relate to on another. There maybe implementations for higher level functions that comprise a combination of lower level functions.

Anyway, bash is mostly about handling files as they are. Text editing can be done on a terminal but should be considered optional unless it's to do with concatenating existing files.

Take this with a grain of salt, of course, I'm only a babby basher.

use two tildes to block in the nested function call

I don't know what that even means. Can you give an example?

>no one in their sane mind would use that horrible language in $CURRENT_YEAR
I've written several bash scripts to automate some of my shit in the last year alone.

Almost. You are missing a step in your assertion that the rows are linearly separable where you must state that the column rank = row rank. Additionally, note that A spans R^3 and there are three vectors in A when you say there are no spare rows. You're on the right track.

Not him, but why? Wouldn't it be far simpler to use Python or something?

I've never seen a use for bash except for tiny 4 line programs, or just piping commands together which one could hardly call using the language.

ls `pwd`

a better example might be:

ls -l `pwd -a`

I don't like python.
Also a lot of my scripts just involve some variable substitutions and calling curl and sed a bunch of times.

Several of my scripts are a about 50 lines long (with whitespace).
Much more beyond that, then I would probably pick something else.

it would be that if there was a row [0 0 0 b], then the columns wouldn't span R3. because they would only form a 2 dimensional plane instead of the entire 3d space as they would if they spanned r3. is that right? i watched a video no youtube that visualized things. if its right how do i turn it into being acceptable in a proof?

head -n 5 | awk '{print $1 * $1}' | sort -n

Let me interject for a moment. What you call tilde is in fact backtick / backquote / grave accent. Tilde looks like this: ~.

Anywhere I can find a crash course to writing application (and maybe later some gaymes)? I downloaded Unity and I have no clue what the fuck I'm even doing.

Ah, alright, I see what you mean. I was thinking of tilde as ~ instead of `.
I managed to stumble my way through to getting the values down, but now when I try sorted=$(sort

fucking crap, a single friggin stupid rule (no matter who wins, put the cards of the first player first) had me debugging this shit for an hour
anyway, I got it. it was actually easy, but kinda tedious

Someone told me
_isIt = !_isIt;
Is the best way to have a bool toggle, it works well and looks good, but I'm not sure I understand what it is doing, can someone help me understand?

m8 what do you think the ! operator does

You know what the ! operator does?

It sets the bool to false I guess, but how can it set a bool that is already false to true?

Learn what the NOT operator is m8

So I heard Java received tons of improvements since Java 6. Is it more comfortable to develop in nowadays?

I guess it actually means the opposite of the current value??? I do have the C# reference open, I'm just retarded, sorry.

Update: Changing it to sorted=$(sort

Oh shit, you're right.

Disregard me, I suck cocks.

sort is a void function

I guess the type stuff is minimal. Sorry I won't be much help for a few minutes, I'm both eating and doing something.

>eating is not doing something
phew, that changes a lot.

best language poll
strawpoll.me/11359830

>sort is a void function
Wait, how is it useful then? It doesn't modify the input so wouldn't it just be a waste of CPU cycles if it doesn't return anything?

It modifies the input.

>C++
>Java
what are you doing

Alright DPT, what's a good build system for Java? I don't want to use Ant or Maven, because the syntax is way too fucking verbose. I am thinking of just doing CMake for Java anyways, but the support is... limited.

Are you sure? Because when I input an array it doesn't modify it at all.

Whenever I have to use pooinlang for a University assignment, I just write a makefile.

Fucking Ruby.
>looking up how some AI algorithms for TSP work
>Ant Colony Optimization
>basic example is in fucking Ruby
>"Jesus Christ, what the fuck is this syntax?"
This is the stupidest fucking language I have ever seen.
I've spent more time trying to interpret the programming language concepts than actually reading the algorithm.

What kind of retard subjects themselves to this garbage?

>literally any contact with an unfamiliar language in a nutshell

just post it and we'll see

Please, if it's any imperative language, then the language concepts should be familiar enough that the syntax doesn't totally throw you off.
I've experienced C, C++, C#, Java, JavaScript with Node.js, Python, F#, Clojure, and none of them were this stupid.

cleveralgorithms.com/nature-inspired/swarm/ant_colony_system.html
It took me a while to figure out that
foo[:vector] = ...
foo[:cost] = ....

were actually ways of assigning to dynamically created members of objects and not a goddamn array
and what the fuck is
perm

Gradle.

Fuck, I've solved it. Sort still doesn't modify the input at all, but I was missing -n, because apparently without -n it doesn't sort the array in any reasonable way, instead opting to alternate between the first and last numbers in the array.
Fuck this language, and fuck that one user for even liking it.
Pure C is easier and far more powerful.

Spyder

日本語は必勝!

Just use python 3. It's not that much different but it has some better features and it's the future so better get used to it. And if you ever need to use a library that only runs on 2.x then and only then you'll need and will be able to install 2.x as well

日本語tueee

>it doesn't sort the array in any reasonable way, instead opting to alternate between the first and last numbers in the array
It sorts them lexicographically by default, idiot.

The guy saying exercise is right. It destroys most fundamental causes of depression. It makes you productive again and have a feeling of accomplishment after every session. It boosts your self-confidence. It releases endorphin into your brain, which basically how your brain makes you feel good. Sport is a hell of a drug, and it's a good one.

You can be lazy. You don't actually have to go out. Just use a jumping rope, do push-ups and abs every 2/3 days and you're good to go.

thanks. yeah, symbols are weird. it seems like he's using it as a dirty struct there
the last one is just an append
it seems like a weird choice of language, really. ruby is slow and doesn't have a lot of libraries for this sort of thing as far as i know

it interacts really well with shell commands. for me that makes putting up with its anachronisms worth it

why dis no work on C. Also is there a way I can use VS Studio without have to put _CRT_SECURE_NO_WARNINGS in the preprocessor definitions for every C project.


#include
#include
#define PI 3.14159

int main(void)
{

double radius; /*input - radius of a circle*/
double area; /*output - area of a circle*/
double circum; /*output - circumference*/

/*Get the circle radius*/

printf("please input the radius of your circle");
scanf("%lf", &radius);

/*Calculate the area*/

area = PI * radius * radius;

/*Calculate the circumference*/

circum = 2 * PI * radius;

/*Display the area and cirumference*/

printf("The area of your circle is %lf\n", area);
printf("The area of your circle is %lf\n", circum);

return (0);
}

Python ofc.

>why dis no work
Please don't type like a fucking retard.
Also, please be more specific with how it's not working.

>Visual Studio
Don't use that garbage.

Compiles & works just fine with gcc here.
Does it come with any errors?

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) ConsoleApplication10 c:\Users\Mello\documents\visual studio 2015\Projects\ConsoleApplication10\ConsoleApplication10\MSVCRTD.lib(exe_winmain.obj) 1

Because longs and doubles are not the same thing

>#include
wait a sec

What do you recommend over VS then

%lf is correct for double

Yea, you're right, sorry. Anyway, this compiles/runs successfully for me with VS2010.

C:\>cl test3.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

test3.c
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.

/out:test3.exe
test3.obj

C:\>test3.exe
please input the radius of your circle5
The area of your circle is 78.539750
The area of your circle is 31.415900

C:\>

Unfortunately I have no clue.

but Once your done solving, replace that "area" in your last printf
>pic related

looks nice user.
pls link your .vimrc

I think I set it as a windows application instead of a console application cuz now it works.Anyone recommend a C IDE. IS codeblocks good?

>every new functions produces increasingly more errors
Well, I guess this is my last build for today. Off to bed I go.

best is
int i = 0
i = 1 - i

>creating an n-dimensional array in Java at runtime
>operating on that n-dimensional array at runtime
shieeet

why should anyone use golang now that std::async exists?

>Java

not really

>assignments
I'd be using C++ or C# otherwise senpai

That's shit. The best way is
bool a = 0;
log(a);
a = fetestexcept(FE_DIVBYZERO);
feclearexcept(FE_DIVBYZERO);

Because it's not sepples.

damn your right

Okay Cred Forums so I'm learning C after I stopped being a python faggot and I'm also learning about search and sorting algorithms, the thing is, do I really need to learn most of them? Won't I be able to do everything I need with just quick/selection sort and sequential/binary search?

github.com/orangeduck/CPP_COMPLETE
Oh no.

>do I really need to learn most of them
They're good as a learning tool so that you can understand algorithms better, but you probably don't need to know the details of most of them.

do you have first class channels and coroutines in C++?

>do I really need to learn most of them
The point of learning data structures and analyzing algorithms isn't so that you can use them.

Analysis of Data Structures and Algorithms is designed to build a foundation for you as a programmer. It's supposed to teach you critical thinking skills, and strategies on how to think as a programmer.

In a sophomore or junior DS&A class, you'll learn about various data structures and algorithms that humanity has developed that are VERY good at solving problems that we have.
Namely, they're things like Min-Max heaps, Quicksort (and the reason it's better than Merge Sort), dynamic programming (0-1 Knapsack, Fractional Knapsack), graph theory, and balanced trees.

In a senior DS&A class, you'll learn strategies for producing solutions to instances of intractable and NP-complete problems. These are problems that humanity cannot solve in polynomial time (but we have to anyway), so we create algorithms that produce solutions that may or may not be perfect, but are usually good enough for our purposes.

For any programmer that is not a street shitter, these will be the types of problems you will solve in the workplace. And yeah, I implied that most programmers are indeed street shitters.

Hola senoritas
pls r8
def count_letters(strng, char, countrepeat = False) :
count = 0
part = strng
if countrepeat == False and strng.find(char) != -1 :
return 1
while countrepeat == True and part.find(char) != -1 :
if char == "" :
return "Infinite"
count += 1
part = part[part.find(char)+1:]
return count

Friendly reminder that if you don't SIMD-ize your code, you're a shit programmer.

Aside from boring math shit like matrix multiplication, what else is SIMDizable?

Branches can be SIMDized with masks. Considering most programs just iterate through, copy to and from, and then branch on arrays, the overwhelming majority of non-IO code can be SIMDized.

I need to use an java applet (This is really important) but fucking java won't let me run it eventhough I have already given the security exceptions to that site

i got so fat :/

and ate so muuuuuuuuuch

Reminder that if you are hand optimizing your code instead of using ISPC, you might be retarded.

youtube.com/watch?v=UgaQCg-0ZoU

>imperative programming

PLS HELP ME

HOW DA FUG DO I DISPLAY JUST THE WIDTH AND JUST THE HEIGHT!!!?!?!?

public class Rectangles {

double width = 1;
double height = 1;

public static void main(String[] args)
{
// create 2 rectangle objects
Rectangles rectangle1 = new Rectangles(4, 40);
Rectangles rectangle2 = new Rectangles(3.5, 35.9);

// displays rectangle information
System.out.println("The width of the first triangle is: " + rectangle1);


}

// no arg constructor that creates a default rectangle object
Rectangles()
{

}

// constructor used to create rectangle with specified height & width.
Rectangles(double newWidth, double newHeight)
{
width = newWidth;
height = newHeight;
}

double getArea()
{
return width * height;
}

double getPerimeter()
{
return (width *2) + (height *2);
}

double getDiagonal()
{
return (width * width) + (height * height);
}
}

>t. functional cuck

Who Are You Quoting?

rectangle1.width
rectangle1.height

Did you not learn about accessing class members?

U R THE KAWAIIEST DUDE, TRIPS CONFIRMS

I learned now

>using pOOP in the current year

OOPs I DID IT AGAIN

public class Rectangles {

double width = 1;
double height = 1;

public static void main(String[] args)
{
// create 2 rectangle objects
Rectangles rectangle1 = new Rectangles(4, 40);
Rectangles rectangle2 = new Rectangles(3.5, 35.9);

// displays rectangle information
System.out.println("The width of the first rectangle is: " + rectangle1.width);
System.out.println("The height of the first rectangle is: " + rectangle1.height);
System.out.println("The area of the first rectangle is: " + rectangle1.getArea());
System.out.println("The perimeter of the first rectangle is: " + rectangle1.getPerimeter());
System.out.println("The diagonal value of the first rectangle is: " + rectangle1.getDiagonal());
System.out.println();
System.out.println("The width of the second rectangle is: " + rectangle2.width);
System.out.println("The height of the second rectangle is: " + rectangle2.height);
System.out.println("The area of the second rectangle is: " + rectangle2.getArea());
System.out.println("The perimeter of the second rectangle is: " + rectangle2.getPerimeter());
System.out.println("The diagonal value of the second rectangle is: " + rectangle2.getDiagonal());



}

// no arg constructor that creates a default rectangle object
Rectangles()
{

}

// constructor used to create rectangle with specified height & width.
Rectangles(double newWidth, double newHeight)
{
width = newWidth;
height = newHeight;
}


// various methods used to get area, perimeter, and diagonal value.
double getArea()
{
return width * height;
}

double getPerimeter()
{
return (width *2) + (height *2);
}

double getDiagonal()
{
return (width * width) + (height * height);
}
}

Any wew lad can review my code and offer suggestions to make it neater/ efficient?

underrated post

es dat rinuby

public void printRectangle(Rectangles r) {
// ???
}

main ...
rect1 ...
rect2 ...
printRectangle(rectangle1);
printRectangle(rectangle2);

Look up toString() methods

Well I think I should have specified a bit more my first question, what I meant to ask is if I really need to learn them now, because while I used some of them for a long time I feel like I should spend at least a week to learn them and I'd probably just forget some of them after not using them for another week, I feel like trying to learn 5 different sorting algorithms is slowing me about learning more about the C language itself. Should I just move one with the algorithms I know and come back to learning the other ones some months later or should I really learn them now, I don't think I need them for the kind of stuff I'm currently programming and I don't have in mind to work as a programmer for the next 4 years so I think I'll have time to learn more about algorithms.

Can someone post those hilarious programming textbook cover edits?

public static void Main(string[] args)
{
Rectangle rectangle1 = new Rectangle(4, 40);
Rectangle rectangle2 = new Rectangle(3.5, 35.9);

Rectangle[] rectangles = new Rectangle[]
{
new Rectangle(4, 40),
new Rectangle(3.5, 35.9)
};

for (int rectangle = 0; rectangle < rectangles.Length; rectangle++)
{
Console.WriteLine(String.Format("The width of rectangle {0} is: {1}", rectangle, rectangles[rectangle].Width));
Console.WriteLine(String.Format("The height of rectangle {0} is: {1}", rectangle, rectangles[rectangle].Height));
Console.WriteLine(String.Format("The area of rectangle {0} is: {1}", rectangle, rectangles[rectangle].GetArea()));
Console.WriteLine(String.Format("The perimeter of rectangle {0} is: {1}", rectangle, rectangles[rectangle].GetPerimeter()));
Console.WriteLine(String.Format("The diagonal value of rectangle {0} is: {1}", rectangle, rectangles[rectangle].GetDiagonal()));
}
Console.ReadLine();
}
public class Rectangle
{
public double Width { get; private set; }
public double Height { get; private set; }
public Rectangle(double width, double height)
{
this.Width = width;
this.Height = height;
}
public double GetArea()
{
return this.Width * this.Height;
}
public double GetPerimeter()
{
return (this.Width + this.Height) *2;
}
public double GetDiagonal()
{
return Math.Pow(this.Width, 2D) + Math.Pow(this.Height, 2D);
}
}

Superior language of C#

>no toString()
Sad!

>needing ToString() when you have String.Format

You can still use String.Format inside toString() you fool. If you're going to use OOP, you mind as well use all its features

data Rectangle = Rectangle {
width :: Double, height :: Double,
area :: Double,
perimeter :: Double,
diagonal :: Double
}
deriving (Show)
-- do not export Rectangle constructor
rectangle w h = Rectangle w h (w * h) (w + w + h + h) (sqrt (w^2 + h^2))

>explicitly using ToString when String.Format already handles that
Unless you're being autistic about the number of decimals returned, you have no excuse to do this

Enjoy your toy language

I am enjoying it

Which both are about to be replaced by vulkan so have fun developing on a closed platform

...

String.Format doesn't do what toString does at all, what the hell are you high on?

Are you retarded? Please give code snippet showing what you're on about

I bought wincuck10 because my bootmgr busted and I couldn't find my live usb ( also no friends and pc cafe doesn't allow downloads ) and l downloaded VS because why not.

45 FUCKING GIGS

Vulcan was a mistake

He looks like Woody harrelson and Matthew mconaheys grandchild sent back from the future old as fuck

Ignore this faggot. You keep talking like a retard. Keep it fun for as long as you can. Once the steel starts to get tempered, these guys disappear and all that are left are the ones that know how to have fun with it.

youtube.com/watch?v=06x8Wf2r2Mc

vim of course

vim, with plugins and extensions to hell and back.

seconding beejs guide, recently read it and managed to make a small multiplayer game thanks to it

>no emacs

Sure is /reddit/ here tonight.

I can't even fathom what they could include which takes up that much space.
Is that the effect of Meme++'s object code bloat?

>I can't even fathom what they could include which takes up that much space.
iostream is probably at least 40 GB

>Working on?

Working on a site that captures Youtube channels and videos and displays them in an easy to use manner, sortable by country, gender and tags, i.e. Youtube without the slop.

I'm pretty sure atom and sublime are the redditor's go to text editors.

New thread:

but vi is short for visual editor...

template
T get_minimum(const T *arr)
{
if (!arr)
return T{};

T min = arr[0];
for (int i = 1; i < sizeof(arr) / sizeof(T); ++i) {
if (arr[i] < min) {
min = arr[i];
}
}

return min;
}

does anyone have a gimp extension that simulates image degrade from screenshotting/cropping instagram pictures over and over again? pic related