[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: 364
Thread images: 43

File: functional programming.jpg (65KB, 440x389px) Image search: [Google]
functional programming.jpg
65KB, 440x389px
Previously on /dpt/ >>54934593

What are you working on, /g/?
>>
Working on setting up a nice Linux environment to use OCaml to write my language.
>>
>>54944744
Currently learning assembly. More specifically, practicing converting between the 3 number systems used so I can be faster at it.
>>
>>54944776
>assembly
"assembly" doesn't exist
>>
File: alignment-vs-autonomy.png (164KB, 650x455px) Image search: [Google]
alignment-vs-autonomy.png
164KB, 650x455px
>>54944744
Thoughts?

How does your team do software dev?
>>
>>54944808
i like to stimulate my prostate when i fap
>>
>>54944789
Look they're all different dialects of assembly. You wouldn't call southern a different language, no, it's just another way of speaking english. It's still english.
>>
>>54944829
You use your finger or a dildo?
>>
>>54944756
A nice Linux environment isn't possible.
>>
>>54944744
One of my opsec security mates suggested this book: Hacking The Art of Exploitation.

Is this actually a good book?
>>
File: fd.png (3KB, 113x182px) Image search: [Google]
fd.png
3KB, 113x182px
So I have a map file that looks like this:

111111111111
100000000111
101111110111
101000010111
101000010111
101000010111
101100110111
100000000111
100000000111
111111111111
111111111111


and I'm trying to load it into a 2D array in C like this:

char map_data[height][width];
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
c = fgetc(tile_map->file);
if (c == '\n') continue;
map_data[y][x] = c;
}
}


However it seems to be loading in the wrong data.

Help?

pic related is the output i recieve
>>
The
                                                                                                    best                                                                                                    programming                                                                                                    language                                                                                                    is                                                                                                    OCaml
>>
How do I convert an integer character to an actual integer in C?

For example, if I read a file and it contains '3', fgetc won't read 3 but will read the number that corresponds to the character 3, right? How I can I get the number 3 as an integer?
>>
>>54944939
atoi
scan functions
>>
>>54944937
>code tag abuse
>>
Why does every programmer these days have the hipster glasses and goatee? What happened to the image of a programmer being a fat neckbearded basement dwelling autist?
>>
>>54944950
Beard + thick-rimmed glasses + undercut = new programmer chic
>>
>>54944973
What year again did that image begin happening?
>>
>>54944903
Looks like the height and/or width are off. If you write a dummy character instead of leaving the garbage when you read a newline, you'll more easily see what's going on.

You also need to be careful of line endings - it may be more than just a newline.
>>
>>54944973
can confirm, shaved my beard and switched to contacts to avoid association with fuckin nu-male programmers, brogrammer 4 lyfe
>>
>>54944947
>
                                                                                                    implying
                                                                                                    the                                                                                                    obvious
>>
>>54944983
Since about 2012 or so. Maybe earlier.
>>
>>54944903
First of all, in Windows there are two symbols for an end of the line: \r\n
Then, when you read in cycle and say "continue", you skip a cell.
Don't use fgetc.
Try something like this:
FILE *file;
char str[width+2];
fgets(buf, width+2, file);
>>
>>54945142
fuck. I made a mistake
str = buf
>>
>>54945012
Same here. Recently I stopped shaving because finally I can grown a proper beard. Worn it for like 3-4 months (after it grown) and now I'm clean shaving again from the very same reason.
>>
>>54945142
Haha I didn't even know fgets existed. I thought you had to read files character by character.

Thanks!
>>
File: xdmv.webm (1MB, 1920x1080px) Image search: [Google]
xdmv.webm
1MB, 1920x1080px
Wrote a desktop visualizer for X last weekend. Just finished pulse support for it.
>>
>>54945384
>high functioning autism
>>
does c++ have premade tools like java does? do you just #include things like binary search trees etc etc etc or do you have to make them yourself?
>>
>>54945443
yes
>>
I'm back again. This is the last thing I need but I just can't figure it out. I want to make the progress bar show how many of the images are downloaded.

This is in a class called imageboard
int count = 0;
if(filename != "" && extension !=""){
QString link = "https://i.4cdn.org/"+board+"/"+tim+extension;
qDebug()<<link;
downloadFile(link, tim, extension,saveLocation,folderName);
count++;
emit valueChanged(count);
}


I made an object of type imageboard in mainwindow.cpp and then use this
connect(image,SIGNAL(valueChanged(int)),bar,SLOT(setValue(int)));


The issue is that it seems that the signal is only emitted once. It doesn't update again. I can post more code if it's needed
>>
Trying to learn Xlib/Xcb bullshit.
I have opted into no window events at all except WM_DELETE_WINDOW, yet I get a spurious "Event 64" from the window manager (event->response_type is 192) when I minimize the window.

Anyone know what the fuck this event is?
>>
File: ultra crying rage feels.jpg (106KB, 601x601px) Image search: [Google]
ultra crying rage feels.jpg
106KB, 601x601px
>>54945453
i was looking forward to making them myself
>>
>>54945658
you can always implement it yourself for practice. No one is forcing you to include anything
>>
>>54945658
I know that feel. I try and implement a lot myself outside platform abstractions like OpenGL.
>>
how to initialize this 2D boolean array in C++ with size M * N?

 

bool **adjacency;

>>
>>54946041
bump
>>
>>54944939
you have a char x_char
int x_int = int(x_char - '0');


im a c++fag so idk if that's the right type conversion syntax, but that's essentially how u do it
>>
>>54944744
>go to hackathon
>team up with some guy
>theme: file conversion
>set up a flask web server with bootstrap front-end
>allow user to upload photo
>get photo, use microsoft cognitive services API to get a photo description
>use some other API to segment description in small meaningful parts
>use bing API to image search meaningful parts and download one image for each
>put images together into a gif using imagemagick
>return gif to uesr
>user uploads photo and gets back a gif that describes the image
>extend it to text files (txt, docx, doc, pdf, etc) using zamzar conversion API
>win 1st place for hackathon
we just stitched together a bunch of APIs guys
>>
>>54946041
bool **adjecency = new bool[M];
for(decltype(M) i = 0; i < M; ++i)
adjecency[i] = new bool[N];
>>
>>54946244
whats decltype you're using there?

can't you just do:
bool **adjecency = new bool[M];
for(int i = 0; i < M; ++i)
adjecency[i] = new bool[N];



?
>>
File: colour-logo.png (39KB, 2187x601px) Image search: [Google]
colour-logo.png
39KB, 2187x601px
Opinions on OCaml? Is it fun? What kind of things is it good for?

I'm considering dual booting ubuntu to learn it better, windows support seems pretty shit for it.
>>
>>54946293
I meant to learn it, in the first place. No previous exp.
>>
>>54946304
>>54946293
OCaml has some very interesting features which make it useful:

1. It compiles to byte code and is fast. One can write embedded systems and OS in it.

2. Still it has higher level functional constructs and garbage collection, no need to worry about memory leaks.

3. Not sticking to pure functional programming makes it a bit easier (at least for me) as compared to Haskell. Also one doesnt have to worry about lazy evaluation like in Haskell .

4. F# is repackaging of OCaml by Microsoft on its .net platform. One can write apps for Windows platform for F# just like in C#. There seem to be lot of libraries around for F# unlike OCaml.

OCaml like C++, Nim and Rust is a systems language. Just that its functional first. The use cases of all these will be same.

Why you should learn it:
1. To learn Functional Programming.
2. To learn a fast high-level language.
3. for a Finance industry job, if one's company uses it.
>>
>>54946277
You never specified what type M and N are so I used decltype to make it agnostic.
>>
>>54946347
 error: cannot convert ‘bool*’ to ‘bool**’ in initialization



it gives me this error
>>
>>54944808
How my team does software dev:

Team consists of 4 people.
>meâ„¢, the Java/Android code monkey
>herâ„¢, the UI designer from Mexico
>himâ„¢, the project manager/iOS dev/brogrammer
>itâ„¢, the monolithic asshole CEO/boss

She sends a .psd to Him and he approves the design. I never have direct contact with her, because she is a woman and must be protected from monkey. He throws the .psd into my cage, and I extract the assets and start a nice day of Android Brogrammingâ„¢. When I am finished, I push my code out of the cage and he looks at it. If it is good, I am awarded 2 bananas and one CrackRockâ„¢. If he is unsatisfied, he opens my cage and slaps me, leaving me vulnerable and crying on the ground. But I deserved it, I am just a monkey, I should have known better than to try to add unit tests to our codebase and waste valuable resources. Sometimes, when I am smoking a good monkey CrackRockâ„¢, it will come to the cage. No matter what I have done for the day, it will berate me and belittle my intelligence. However, it is the one that provides our company with bananas, allowing me and my other two treemates to keep living. When the day is over, I find the juiciest monkey bum and go nanners over my raging monkey cock. I wake up in a haze of cum and CrackRockâ„¢, and after getting myself together I begin another day at the zoo.

My job is bananas.
>>
Doing some shit in python for a summer class.

>tfw done with hardest C++ CS classes and I'm just cruising through with fun classes now

Also, Python is cool as shit.
>>
File: laptop_chimp.jpg (103KB, 369x325px) Image search: [Google]
laptop_chimp.jpg
103KB, 369x325px
>>54946412
>>
>>54946395
Woops the first new needs to be:
new bool*[M];
>>
I just graduated and don't have a job yet
Where can I find some ideas for projects to work on in the mean time to keep my mind sharp and possibly pick up a few more programming languages for marketability
>>
>>54946578
in your head you stupid monkey
>>
>>54946332
>Also one doesnt have to worry about lazy evaluation like in Haskell
Nota bene, it has support for lazy evaluation in the stdlib, but it's not as nice as Haskell.
>>
>>54946591
I'M NOT STUPID
RAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaa... ._.
>>
>>54944937
It's actually rust.
>>
>>54946573
new bool [M][]
you forgot to make it look cool
>>
>>54946293
Shit libraries, have to use a 3rd party standard library to get anything done, there are 3 competing standard libraries, 1 is incomplete but works for web stuff, 1 is complete but massive and can't be used for web stuff, 1 is buggy and broken.
Programming support on windows leaves to be desired.
Type system isn't as powerful as I'd want, but the module system is fantastic.
>>
>>54946332
Ocaml is as much of a systems language as haskell or go.
>>
>>54945384
>Beyond the wind - Taishi Remix -
>Shibayan
>CYTOKINE
Fucking fantastic taste
>>
File: Untitled4902.png (125KB, 1920x1080px) Image search: [Google]
Untitled4902.png
125KB, 1920x1080px
Not programming, but setting up a Gogs/git server for internal use in our organisation.
It will also contain router configuration and several deploy scripts for virtual machines.
>>
what's a nontrivial project i can work on thats doable as a rising junior in csci?
>>
Guys is lama book actually good to learn perl?
anybody knows good tutorials?
>>
File: MyNextLaptop.png (98KB, 1065x411px) Image search: [Google]
MyNextLaptop.png
98KB, 1065x411px
>>54946878

>Not programming, but...

Not programming, but this is my next programming rig. I hate most laptop brands; even Lenovo is turning into shit. Might as well try something new, and also built for Linux with no driver conflicts.
>>
>>54947029
>Ubuntu
>>
>>54947029
What's that?

Also what's wrong with Lenovo? I've had my Thinkpad X201 for a few years and it's holding well
>>
 
#pragma once
class point
{
public:
point();
~point();
};


what does this stuff mean? i googled about creating an object in c++ and it doesn't say. idk what pragma once is, or what point(); and ~point(); are
>>
>>54947055
#pragma once

compiler specific pragma that tells the compiler not to include the file more than once

point();
constructor declaration

~point();
destructor declaration
>>
>>54947055
Do you know anything about OOP?

pragma is like c style header guards.
#ifndef LONG_STUPID_LOOKING_HEADER_NAME
#define LONG_STUPID_LOOKING_HEADER_NAME
>>
>>54947110
>Do you know anything about OOP?
no i don't, because it's bad and for codemonkeys like you
>>
>>54947159
Yeh I can clearly see that after being overwhelmed by constructor.
>>
>>54947051
System76 only sells their machines with Ubuntu on them, but it should be compatible with all modern Linux distributions. I plan on installing OpenSuSE Leap on it, since it's the distro that has always just worked for me.

>>54947053
It's a System76 Kudu. System76 is a company that specializes in Linux laptops. I knew I needed to get a new laptop because the keyboard on my Thinkpad T440p is now dead (half the keys, including the spacebar and enter key do not produce any response; I am now typing this using a cheap USB keyboard), and since I've been finding programming on Windows to become increasingly annoying, I figured I'd get a Linux machine. With System76, I get no driver conflicts guaranteed. I also considered ThinkPenguin, but what ultimately sold me on System76 was more or less that there were less options for higher end machines with ThinkPenguin, and also, that they don't support the new AC band on Wifi, whereas System76 does out of the box.

>>54947159
There's nothing wrong with OOP, or with Functional Programming, or with combining the two. What is bad is taking either to their logical extremes. In OOP, this might be creating overly complex patterns for simple problems, and in FP, this might be making unnecessary copying to avoid state changes.
>>
>>54947110
pragma once is it, pragma is a non-standard compiler instruction and can do a variety of things.
>>
>>54947223
Why would you need higher end machines? Can't you do your computations on a rented server/VPS if you need this type of resources? Surely with the advent of cloud computing there are more important criteria when considering a laptop, no?
>>
>>54947279
Btw I don't mean to criticise your choice, I totally have a lot of things I find unpleasant with my Thinkpad, but just curious
>>
How do people work with laptops without trackpoint? Losing my track point would definitely cut into my productivity quite a bit
>>
>>54947224
ye that's what i meant, my bad for not stating once clearly. I was just refering to THE pragma in his code block.
>>
>>54947319
I have a trackpad and it's enough to use my computer.
>>
is there any version of java's this for c++? or do i have to name setter arguments something different than the object's variable?
>>
>>54947279

1. I don't do and won't do "cloud computing". I refuse to depend on another person's computer to get my work done. Using the cloud for backups is okay, but my files should be located on machine as much as possible.

2. It's name is Android Studio and it is a resource whore like no other.

3. Also, virtual machines. Something I have an interest in is kernel development, and I would like QEMU or VirtualBox to not run like dogshit.
>>
>>54947376
yes its called this.
but it's a pointer so u need to use this->
>>
Learning Java, not much else. I know C/C++/Javascript to an extent so it's been easy to pick up so far, there's a lot more overlap than I was expecting.
>>
>>54947399
How did you do kernel development on Windows?
>>
>>54946472
length s - (maximum $ map length $ group s)

Learn Haskell.
>>
>>54947453
You don't. You can try, but just don't.
>>
File: 1458069487920.jpg (769KB, 2040x1244px) Image search: [Google]
1458069487920.jpg
769KB, 2040x1244px
>>54947494
what is, in your opinion, the advantage of learning Haskell?

i see you solve simple problems quickly.

i might consider learning it
>>
>Haskell

{-# LANGUAGE TemplateHaskell, OverloadedStrings, OverloadedLists, GADTs #-}
{-# LANGUAGE MonadComprehensions, ParallelListComp, TransformListComp, RecursiveDo #-}
{-# LANGUAGE UnicodeSyntax, LambdaCase, MultiWayIf #-}
{-# LANGUAGE BangPatterns, ViewPatterns, PatternSynonyms, TupleSections #-}
{-# LANGUAGE RankNTypes, TypeFamilies, MultiParamTypeClasses, ExistentialQuantification #-}
{-# LANGUAGE DeriveFunctor, DeriveGeneric, DeriveFoldable, DeriveTraversable, DeriveTraversable #-}
>>
>>54947519
It's sufficiently different to be (a) interesting and (b) mind-expanding.

I find myself thinking 'applicatively', if that's a word, and less imperatively these days.
>>
>>54947402
ty, also how do i do what im trying to do here
 string x("(" + x + ", " + y + ", " + z + ")");

correctly?
>>
File: 1438020484791.gif (2MB, 350x197px) Image search: [Google]
1438020484791.gif
2MB, 350x197px
>>54946412
this was surprisingly accurate
>>
>>54946472
std::string::size_type getmin(const std::string &str)
{
std::vector<std::string::size_type> elems{};
elems.reserve(str.size());

foreach(const auto &ch: str)
elems.push_back(std::count(str.begin(), str.end(), ch);

return str.size() - std::max_element(elems);
}


Wonder if you could somehow do a simple list comprehension in C++.
>>
>>54946412
I never got the TM thing? I know it means trademark and stuff, but what do people use it for in this kind of context?
>>
>>54946412
kek
>>
>>54944808
Good goyim.
>>
>>54946952

Llama book? Yes. Camel book? Not unless you're already an experienced programmer.

I learned with the camel book, and was not an experienced programmer. It was painful. But at least the camel book is still useful when I need to figure out the odd areas of perl, whereas the llama book wouldn't be.
>>
>>54947624
It adds a flavor of ironic coolness.

You have to be a supreme meme connoisseur to understand.
>>
>>54947679
But like how does it relate to the initial meaning? I kind of get that it mocks the fact that big corporations feel the need to trademark everything, but not sure if this is all
>>
>>54947694
you're right, he used the meme poorly
>>
>>54947708
But i'm not saying that... I was just trying to understand not accuse them for misusing a meme lol
>>
>>54947453

I actually took an old beige box desktop that's been collecting dust in the corner of my living room (it's basically from 2000 or 2001 or so), and installed Debian on it. I've done some basic boot level programming on it with i386 assembly and a floppy. That said, I'd like to work in architectures other than just 32-bit Intel, and QEMU doesn't always like to play nice on Windows... and even when it does, cross compilers don't play well on Windows at all.
>>
File: 1439903195165.png (536KB, 776x840px) Image search: [Google]
1439903195165.png
536KB, 776x840px
Imagine you receive an android body by mail.

It has a 48 degrees of freedom (DOF) with 12 hrs of battery life (avg physical activity) with all necessary sensors (eye CMOS cameras, microphones, gyro/accel, tactile sensors, speech dynamic) and 10-core ARM CPU inside (there is a wifi as well, so offloading computation to the cloud is possible), and a microcontroller for precise motion control linked to main CPU.

You have a full access to software and firmware, you can use standard dev tools (compilers, runtimes) and OSes for main CPU and the microcontroller.

How would you program it?
What are the main technical problems in this project?
Which approaches/methods/algorithms would you use?
Which software would you use?
>>
>>54947787
I'd like to write an OS for my own simple 32-bit RISC architecture, but I have better projects to do. Maybe later.
>>
>>54947787
Why use Windows at all
>>
>>54947836

Because drivers are a bitch, and sometimes I like to play games. That said, I've rarely had time for games these days, and since I'm into older shit, a lot of it probably works in Wine these days anyways.
>>
#include "stdafx.h"
#include <string>
#include <sstream>
#include <iostream>
using namespace std;


class Point {
public:
void setX(double x);
void setY(double y);
void setZ(double z);
double getX(void);
double getY(void);
double getZ(void);
string str(void);
Point();
Point(double x, double y, double z);

private:
double x;
double y;
double z;
};

void Point::setX(double x) {
this->x = x;
}

void Point::setY(double y) {
this->y = y;
}

void Point::setZ(double z) {
this->z = z;
}

double Point::getX() {
return x;
}

double Point::getY() {
return y;
}

double Point::getZ() {
return z;
}

string Point::str() {
ostringstream os;
os << "(" << x << ", " << y << ", " << z << ")";
return os.str();
}

Point::Point(void){
setX(0);
setY(0);
setZ(0);
}

Point::Point(double x, double y, double z){
setX(x);
setY(y);
setZ(z);
}

int main(){
Point a(1, 2, 1.5);
cout << a.str() << "\n";
}


i never realized how retarded OOP is until i had to write the getters and setters myself without eclipse making them automatically
>>
>>54947864
I just have two PCs for these purposes. Bought one 100$ one for old games. Plays skyrim and stalker fine, good enough for me. I also use it to fool around with Unity.

Primary PC is linux.
>>
>>54947889
>2016
>Still bother with copypasted getters and setters
>Not making them inline
>>
>>54947889
template <typename T>
struct Point3 { T x,y,z; }

>muh OOPs
>>
>>54947889

Just make x, y, and z public.

>>54947900

Yeah, personally I'm a fan of the idea of "one laptop to rule them all." So I get something big enough for all of my development purposes, as well as my day to day usage.
>>
>>54947948
>Just make x, y, and z public.
>>
>>54947974
>posting /sci/ cancer in /dpt/
>>
>>54948002
>>>/pol/
>>
File: 1464723576745.jpg (38KB, 362x346px) Image search: [Google]
1464723576745.jpg
38KB, 362x346px
>>54948014
>>
File: dont bully the anime girls.jpg (174KB, 900x630px) Image search: [Google]
dont bully the anime girls.jpg
174KB, 900x630px
>>54948023
>>
>>54947889

Yeah, when I started learning C++ the first thing I did was go out and find an emacs package that would generate them for me.

I understand why getters and setters are a good idea, but damn it gets repetitive.
>>
>>54944744

Where can I find this pdf?
>>
>>54947974
If it's literally just
double x, y, z
, then you better make it just public. It's absolutely retarded to make it private, just because that's how you did OOP in school. It makes sense if your class contains something like
double *x
which contains a three dimensional array or something. Then getters and setters are important to prevent/debug segfaults and whatnot. For simple classes it's just obstructive.
>>
>>54948160
libgen
>>
>>54948160
libgen.io
>>
>>54948168
but then you have to keep track of which classes you gave private variables and which ones have public ones
>>
>>54947948
>one laptop to rule them all
>tfw 4 thinkpads remove the need for VMs
>>
>>54948237
>private
got something to hide?
>>
>>54948221
>>54948219

Thanks I always forget this address.
>>
>>54948219
>>54948221

>tfw no "let's read serious book X and discuss it" threads

Libgen has every tech book existing, even obscure soviet ones. It also has access to sci-hub database which means all published scientific knowledge.

Why don't we read it more?
>>
>>54948298
>Why don't we
because you are retards
>>
>>54948298

Random question but is there a story behind libgen? Why does it exist? It's saved me hundreds on books for college.
>>
File: jew parenthesis lisp sicp.png (627KB, 1012x798px) Image search: [Google]
jew parenthesis lisp sicp.png
627KB, 1012x798px
>>54948298
>>54948323
let's start now. first book: SICP. read it by friday and we'll talk about it then
>>
>>54948298
I'm the guy who asked for the OS book. We got assigned that and this as a supplement because I don't think my professor is actually going to spend lecture time on teaching C.

Is this ancient book even worth downloading or do is there anything better.
>>
how is the human consciousness a thing

the behavior of the brain could perhaps be modeled as a computer that does nerve impulse and hormone I/O

if you simulate a brain well enough, have you created a consciousness? if not, what is it that makes us special?

to what degrees are animals conscious? a lot of them demonstrate fairly complex behaviors which require non-trivial thoughts and not just instincts

what about the most primitive animals? what about plants?
>>
>>54948237
I never quite understood what the exact reasoning is in categorically making all attributes private like most schools/universities teach. If you have literally just a static sized class with attributes that you can freely change anyway, it makes absolutely no sense. If you have more complex data structures like trees or linked lists, then changing attributes such as the pointer to the next element would fuck up the complete data structure, so you want to prevent this from happening ever. In most other cases it's absolutely okay to make many of them public, you just need to think about what you are doing for like five seconds.
>>
Why is X11 so fucking shit?
>>
>>54948465
You could try 'C Programming: A Modern Approach' by K N King, if you aren't interested in K&R. Its about 5 times the length though and spends the first fifth of the book on basic printing.
>>
>>54947889
>getters and setters
wew lad, your point shouldn't be set after construction. It should only be changed by adding vectors to it. Likewise, you're supposed to used initialization list when constructing so that your fields will have values on initialization. For somethign as simplistic as a point in space you can just have the coordinates public anyway.
>>
>>54948501
That's all cool when you're the only person ever interacting with your code, but what happens when people are using your library and you go from having no sanity checks anywhere because they're not needed, to actually needing sanity checks all over the place? Either you break your API and everyone hates you or you prefer delivering a buggy as shit library. Either way, everyone hates you.

Instead, you could use proper getters/setters by default so that the API never breaks no matter what tests you need to put or what the underlying representation of the object is (for example, maybe you want to change the backing store from a native array to a C array with operations bound via FFI).
>>
I want to learn Python and found these courses, which should I use?

https://www.udacity.com/course/intro-to-computer-science--cs101
https://www.codecademy.com/learn/python
https://developers.google.com/edu/python/
>>
>>54948491
humans are capable of moral thinking, they can differentiate right and wrong. animals that are incapable of moral thinking aren't "people" so it's ok to use them in ways using people would be considered immoral. if you made a computer capable of moral thought then you would have to respect it as a person. you're coming across as a brain slave whose intelligence is looping around on itself instead of being made use of
>>
>>54948378
>Random question but is there a story behind libgen? Why does it exist?

Originally it was a collection of technical books scanned by ex-soviet comrades. It was distributed on DVDs by mail. Then they added a web interface with search and expanded the collection until it has grown to the present size. They also published full collection as a set of torrents.

Looks like ex-ussr collectivism and disregard for copyright law (both on personal and on legal levels) contributed to development of libgen. Russians love free stuff and like/need technical literature.

>>54948465
It's ok, I'd go with http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf
>>
>>54948140
>>54947889
if you have a getter AND a setter, it should be public!!
>>
what should you do?

A
#define N_MAX 100

int array[N_MAX];

memset(array, -1, sizeof(array)


or

B
#define N_MAX 100

int array[N_MAX];

memset(array, -1, N_MAX * sizeof(int)
>>
What are some programming bugs that have killed people?
>>
>>54948553
Because

l e g a c y
>>
>>54948647
is should be public anyway
>>
>>54948465

Libraries change all the time, but C itself doesn't change much, so yeah, it's fine.

If your course is dealing with anything POSIXy, maybe check out The Design and Implementation of the FreeBSD Operating System.
>>
>>54948650
they're both equally shit
>>
File: cousin snapchatted me this.png (2MB, 1035x1841px) Image search: [Google]
cousin snapchatted me this.png
2MB, 1035x1841px
>>54948647
lol you're right. idk university courses beat you over the head with private for literally everything
>>
>>54948624
>animals that are incapable of moral thinking aren't "people" so it's ok to use them in ways using people would be considered immoral
>if you made a computer capable of moral thought then you would have to respect it as a person
weak argument imo

and i'm not talking about morals, i'm talking about what it is that makes us have a perception, why are we seeing/hearing/feeling things and having conscious thoughts, why is this
>>
File: 1372739721317.gif (2MB, 196x235px) Image search: [Google]
1372739721317.gif
2MB, 196x235px
>wanted to do embedded development
>end up java codemonkey

my dreams...
fading before my eyes...
>>
>>54948650
Unfortunately, it's not scalable. The first one handles changing the type of array but won't handle a case if you change array to pointer, the second case handles changing to pointer but not changing the type.

Also people will bitch here about using function syntax with sizeof because of autisms
>>
>>54948739
It's not too late to pick up C and learn about the wonders of pointers
>>
what else should i do now that i've got a point object made? i'm just bored and doing stuff teaching myself c++
>>54948716
it's may be a weak argument but just bc its a concise one. you could go read a bunch of philosophy textbooks if you want a stronger one
>i'm talking about what it is that makes us have a perception, why are we seeing/hearing/feeling things and having conscious thoughts, why is this
because you exist. this is what i'm talking about your brain looping around itself, you're like a guy wondering why 1 + 1 makes 2
>>
>>54948553

It's old, and a lot of the stuff it does was groundbreaking when it was implemented. They got some stuff wrong. Add to the fact that it was designed for a multiuser environment (i.e. one minicomputer/mainframe and several graphical terminals) instead of a desktop. Trends in programming and computing have changed, so thinks like Intrinsics are only used by old programs like xterm, while everything else runs GTK or Qt.

It all works, though, which is more than you can say for most of its supposed "replacements." I like the fact it's a protocol-based design, and I used it for remote applications a lot back in the day.
>>
>>54948777
lol k
>>
>>54948763
>But "sizeof()" really *is* a function.
>>
File: Clayman78.jpg (401KB, 1224x1397px) Image search: [Google]
Clayman78.jpg
401KB, 1224x1397px
>>54948491
That's an interesting question.

I tend to mostly disregard consciousness as a concept because we have no good empirical definition of consciousness for which one can design an experimental test.

There is a property of self-awareness which can be demonstrated with a mirror test. It 's hypothesized that this weird behavior in mirror tests results from animal's brain containing a simplified self-model which reacts to seeing itself. This is much more down-to-earth concept.

I think intelligence and learning can be achieved without any (humanlike) consciousness. Strictly speaking, machine learning has already created systems that demonstrate intelligence and learning (for example, see arxiv.org/abs/1602.01783 )

This is my (biased) perspective as a person which prefers machine learning to philosophy.

>the behavior of the brain could perhaps be modeled as a computer that does nerve impulse and hormone I/O
You don't even need special IO, you just need a big enough cluster of conventional CPUs (or GPGPUs), enugh RAM and right simulation software (for a more detailed look at this problem look at http://www.fhi.ox.ac.uk/brain-emulation-roadmap-report.pdf

>>54948656
toyota "unintended acceleration" bug
>>
>>54948769
I did though, and I studied C and systems programming extensively in university.

Wrote a few emulators and parts of an OS in my own time.

I didn't pursue career stuff much in college, and focused on classes and cool CS stuff instead.

As a result, I couldn't be too choosy when it came time to get a job, and java codemonkey jobs are far more abundant than interesting low-level work, so I got whatever I could and got to work.
>>
>>54948647

For simple things, and where you don't need to check for valid values, sure.

Of course, if you make it public and then end up refactoring, you're stuck with 'em if you don't want to break the API.
>>
>>54948716
>and i'm not talking about morals, i'm talking about what it is that makes us have a perception, why are we seeing/hearing/feeling things and having conscious thoughts, why is this

I think this is either:
* An illusion. Humans delude themselves all the time. There is a experiment that shows that human action selection can be predicted ~200ms before the person becomes aware of it.

* A property that is shared by all physical matter, maybe with some dependence on surrounding conditions.
>>
>>54948656
therac-25
that one plane
that one shuttle (retarded muriburgers used imperial units on a scientific measurement task and assumed all numbers were in imperial while they were actually SI)
>>
>>54948839
Hope you make some big $ at least
>>
>>54948656
https://en.wikipedia.org/wiki/Therac-25
>>
>>54948777

Create a line object that contains two points, then a polygon object that contains a vector of line objects, then draw them on the screen using Cairo or SDL or OpenGL or whatever.
>>
>>54944744
just a blackjack game in javascript with the ui obviously being html and css but Im gonna use it to help me learn how to count cards. After im gonna do one to help me learn how to find percentages of winning in poker
>>
File: canvas.png (21KB, 800x600px) Image search: [Google]
canvas.png
21KB, 800x600px
>>54948777
Draw random triangles.
>>
>>54948911
>The defect was as follows: a one-byte counter in a testing routine frequently overflowed; if an operator provided manual input to the machine at the precise moment that this counter overflowed, the interlock would fail.
>The feeling was described by patient Ray Cox as "an intense electric shock", causing him to scream and run out of the treatment room.
neat
>>
>>54944939

type casting
 num = (int) '1'; 
>>
>>54949000
This.
>>
>>54948911
>Leveson notes that a lesson to be drawn from the incident is to not assume that reused software is safe: "A naive assumption is often made that reusing software or using commercial off-the-shelf software will increase safety because the software will have been exercised extensively. Reusing software modules does not guarantee safety in the new system to which they are transferred..."
B-B-BUT MUH DON'T REINVENT THE WHEEEEEEEEEEEEEL
MUH NOT INVENTED HERE
PREMATURE OPTIMIZATION IS THE ROOT OF ALL EVIL XDXDXD
>>
>>54949014
>MUH NOT INVENTED HERE
>PREMATURE OPTIMIZATION IS THE ROOT OF ALL EVIL XDXDXD
What the fuck does do these have to do with this at all?
Why are you shitposting so forcefully?
>>
>>54949049
reinventing the wheel and NIH are equivalent
premature optimization is the root of all evil is the hottest stackoverflow codemonkey meme
>>
How the fuck do I install GHC 8?
>>
>>54949371
Install Gentoo
Seriously though, what OS are you using
>>
in C++ what am i supposed to put in the header and what am i supposed to put in the cpp? visualstudio creates both whenever i create a class
>>
>>54949417

You put your declarations in the header, and any inline functions.

Put your definitions in the cpp file.
>>
>>54949417
only a trashman uses .cpp files

>>54949371
It's out?
>>
Will work for 15$/hr

plz hire
>>
>>54949442
ok i understand, for some reason the tutorial i looked at put both the header code and the body in the cpp file one after another
>>
>>54949453
pajeet will do it for $2/hr
>>
>>54949521
Ivan >>> Pajeet
>>
>>54949530
will they be able to deport you if you don't work extra hours without pay?
>>
i fucking hate myself
>>
>>54949516

Here's the idea:

The header file contains anything other files need to know about your class. That way, when you're compiling a file that uses your class, you can #include your .h and the compiler will know everything it needs to know about the class (how much memory it needs to reserve, what methods or properties are available and what their types are, etc.).

But you don't want actual implementations in the .h file because you'd be compiling them again every time you #include the header file. You put the implementation of your class (methods, etc.) in the .cpp file, and only compile it once.

You compile your .cpp file into an object file (.o on UNIX, dunno about VS), then when you link your project all the .o files are linked together into one executable or library or whatever.
>>
>>54949590
>>>/r9k/
>>
>>54949560
I don't even consider immigration. Just plain old remote work.
>>
File: Steve Jobs.jpg (27KB, 793x233px) Image search: [Google]
Steve Jobs.jpg
27KB, 793x233px
>>
>>54949753

Steve Jobs was kind of a fag, 2bh.
>>
>>54949771
Steve Jobs invented GUIs
>>
>>54949753
>>everybody should learn to program a computer
>died of PC
>>
>>54949784

The Xerox guys left your mom all GUI last night.
>>
>>54949784
Steve jobs invented operating systems
>>
>>54949753
>>54949784
Such a visionary
>>
File: 1398230075058.jpg (39KB, 640x475px) Image search: [Google]
1398230075058.jpg
39KB, 640x475px
I want to create an oil company/peak oil simulator, for starters I just want to create a main menu window and another window with a hubbert curve and a "next turn" button that progresses through time, as you click the next button the curve will grow then peak and fall back down. I have no experience besides making a fizz buzz and hello world. Am I going in too deep for a noob? What would be the best language to use, I was thinking about java or C++.
>>
>>54949784
Steve Jobs invented programming
>>
>>54949753
>teaches you how to think
maybe if you're a retard
>>
I want the programming field to become so saturated people only do it because they enjoy it. Will this happen?
>>
>>54949897
i doubt it, the barrier of entry is really high to become a top tier programmer, it's not like art where any retard can bullshit their way and call themselves an artist
>>
>>54949897
i want to be able to have a paying career with the computer science degree i'm in school for
>>
>>54949833
>I want to create an oil company/peak oil simulator

LOL that's actually a nice idea!

>Am I going in too deep for a noob? What would be the best language to use, I was thinking about java or C++.

Just use javascript/canvas
>>
>>54949923
Found the shitter.
STEAM needs to replace STEM
Abstract thought is necessary to be more capable than Pajeet.
>>
>>54949956
>Just use javascript/canvas
KYS

just because JS is what you're familiar with doesn't mean it's what everyone should be using
>>
>>54949897
I want the programming field to become so saturated people will start automating their day to day tasks everywhere and we end up in the post-work society.

Imagine a world where you can buy a cheap robot with standard OS and program it in easy to learn but fast language like JS. Web changed the world of information, and such robots could change the physical world.
>>
>>54949968
and womens studies too because knowing the importance of diversity is strength and is more important than just being good at writing a bunch of code
>>
>>54949968
what the fuck you retard?

>Abstract thought is necessary to be more capable than Pajeet.
so programming won't get saturated obviously because people can't even do it

RETARD
>>
>>54949977
>just because JS is what you're familiar with doesn't mean it's what everyone should be using

I'm familiar with C and assembly as well, and many other languages.

See my C/SDL2 game: http://pastebin.com/AcmcNzMX

JavaScript/Canvas is just good tool for the job.

Rage is bad for your health, rage-kun (^:
>>
>>54949833

Figure out the math first, and then write a simulation for it. It doesn't matter what language, really. Python would be a safe bet - lots of people use it for math and statistics related stuff, so there's plenty of information online about it.

Once that's working, learn to work with graphics and GUIs in something like Java, C#, Python, or VB.NET for all it matters and then port your simulator to it. Porting from one language to another is easy, since the logic is already there.
>>
>>54949987
kill yourself

>>54950016
kill yourself
>>
>>54949968
autists with zero capability for art are the most capable in STEM though
>>
I want to make a a UWP music player that supports encoding like Foobar
>>
>>54950024
Prove it.
>>
>>54950020
>rage-kun: the post
>>
>>54949987
in a post-work society everyone would literally be completely dependent on the government. the more leverage the government has over you the less liberty you have. subversive speech could result in your stipend being docked
>>
i'm a 140+ IQ autist with artistic ability

i'm such a fucking genius fuck you plebs
>>
>>54949833
Python is THE language for modelling data. Don't quote me on that.
>>
>>54950057
>in a post-work society everyone would literally be completely dependent on the government.

Depends on robot ownership structure. In a good outcome goods-producing robots and factories will be owned by large enough portion of population.

>>54950064
Feynman had 125 IQ, you will probably never achieve 1/10th he did.
>>
>>54950074
R
>>
>>54950107
lol ok js fag
>>
File: smile_with_a_carat_nose.gif (2MB, 500x500px) Image search: [Google]
smile_with_a_carat_nose.gif
2MB, 500x500px
>>54950116
O.K.
>>
wow lmao people who have strong opinions need to kill themsleves
>>
for(int i=0; i < 100; i++){
if (i % 15 == 0)
System.out.println("Fizzbuzz");
else if (i % 3 == 0)
System.out.println("Fizz");
else if (i % 5 == 0)
System.out.println("Buzz");
else
System.out.println(i);
>>
>>54950107
maybe but even then you can't honestly think the population's just going to be allowed to idly sit at the same level with 90% people unemployed. just by virtue of existing people take up resources. UN's already aiming for something like an 80% world population reduction by 2060. shit's creepy, not cool at all. i'd rather humanity be at 99% employment with everyone working their asses off but doing cool shit like colonizing mars and venus and expanding than just sitting on earth having robots make us dorito chips
>>
File: 1416886161408.png (94KB, 1600x900px) Image search: [Google]
1416886161408.png
94KB, 1600x900px
>>54950134
>le golden mean meme
>>
>>54950180
>UN's already aiming for something like an 80% world population reduction by 2060
source? and do they have any realistic plans for achieving it like genocide
>>
File: 14125992.png (186KB, 528x498px) Image search: [Google]
14125992.png
186KB, 528x498px
>>54950180
wake up sheeple :DDD
>>
How do you structure your C projects? I wrote a linked list and now I want to use it in a project. Should I put the source and header in a lib/ folder within my project folder?
>>
>>54950107
>In a good outcome goods-producing robots and factories will be owned by large enough portion of population.

Subtly advocating socialism, I see. I'd prefer that everyone (myself included) starves to death before we debase ourselves with such a vile ideology.
>>
>>54950203
>>54950216
http://www.un.org/popin/icpd/conference/bkg/wppa.html
>>
>>54950017
>Python Java C# VB.Net

Aren't you the little fucking carcinogen? Jesus
>>
>>54950180

>maybe but even then you can't honestly think the population's just going to be allowed to idly sit at the same level with 90% people unemployed
Depends on what to count as "allowed". Yes, elites want us to be hardworking good goyim (so we don't revolt) while they live their comfortable ultra-rich lives. But what do I as a middle class citizen want?

>UN's already aiming for something like an 80% world population reduction by 2060.
Haven't seen such stats, [citation needed]
Official extrapolation was 11 billion @ 2100.

> i'd rather humanity be at 99% employment with everyone working their asses off but doing cool shit like colonizing mars and venus and expanding than just sitting on earth having robots make us dorito chips
I think that choice is a false one. It looks like a real choice is having people working mcjobs or having people live semi-comfortably from basic income. Basic income world looks happier than a mcjob one.

We have quite high employment now and people work mostly bullshit jobs.
>>
>>54950245
only one of those are worse than js
>>
>>54950230
It really is a vile ideology. To accept "post scarcity" socialism where no human labor is needed is to accept stagnation. You can always create more work where there are no factories built and develop/build products that man has yet to learn to manufacture. When a robot takes your job, you don't ask for a new job, you find a place for a new job.

>2016
>no fast food clerks ever
>you are now supervising the robotic colonization of mars and carrying out basic emergency repairs
>>
>>54950245

Whatever gets the job done. Those are languages that are either a) easy to create GUIs in or b) there is plenty of help and sample code available.

Granted, I haven't used VB.NET, but if it is anything like VB6, my grandmother could create a GUI program in it.

The guy is new, I'm not going to recommend something like C++.
>>
File: 1459566805282.jpg (33KB, 640x640px) Image search: [Google]
1459566805282.jpg
33KB, 640x640px
>>54950238
>1974
>>
>>54950248
the elites will not allow you to have 12 children when too many people doing that means they don't get their yacht. the less people they have to support is better for them
>>
Is programming a good career path? Is computer science a good degree choice?
>>
>>54950230
On the contrary, having widespread ownership of productive assets is quite capitalistic. Socialism would be society/state owning everything.

Current status quo is neither capitalism nor socialism, it's a kind of crony capitalism with strongly tied big corps and government.
>>
File: c44ch.png (128KB, 505x864px) Image search: [Google]
c44ch.png
128KB, 505x864px
>pic related

Android programming:

It's a form where an 'sales guy' can submit a car 4 sale.

How would I approach this?

First question:

Is it possible to do everything (sending the file to a folder on my server, inserting the path to my 'Car'-table in phpmyadmin, same with the details).

Is the following database structure ok?
- CarID
- CarBrand
- CarType
- CarFuel
- CarPrice
- ImagePath

?

In a later stage, I would have to show all the available cars in a layout for the viewers to see what cars are available for sale.

Thx
>>
>>54950320

Do you want to learn to program with a bunch of SJWs or do you want to learn to program and how that program works on the metal?

CS for the former, CE the latter
>>
>>54950320
>Is programming a good career path?
yes if you're not retarded

>Is computer science a good degree choice?
not really, having a degree helps when searching for a job but it doesn't have to be computer science and you still need to be mostly self-taught and be experienced to have a real chance of landing a good programming job
>>
>>54950350
>to do everything
*
... In one database insert query?
>>
>>54950320
>Is programming a good career path? Is computer science a good degree choice?
yes and yes, as long as you're not mediocre in either.
>>54950352
CS isn't about codemonkey shit it's about time complexity and k-means. SJWs only get as far as JS and Ruby cause they only care about the internet.
>>
>>54950284
>It really is a vile ideology. To accept "post scarcity" socialism where no human labor is needed is to accept stagnation

Funny how you talk about it while living in literally stagnating crony capitalist society. Even venture capitalists say this: https://medium.com/conversations-with-tyler/peter-thiel-on-the-future-of-innovation-77628a43c0dd

>PETER THIEL: Yes, I think there are, those three separate things. There’s the question of stagnation, which I think has been a story of stagnation in the world of atoms, not bits. I think we’ve had a lot of innovation in computers, information technology, Internet, mobile Internet in the world of bits. Not so much in the world of atoms, supersonic travel, space travel, new forms of energy, new forms of medicine, new medical devices, etc. It’s sort of been this two-track area of innovation.
>>
>>54950392
>time complexity and k-means
this is really basic stuff that you could learn on your own in the first weeks of programming
>>
>>54950330
>On the contrary, having widespread ownership of productive assets is quite capitalistic.

What you are describing is, more or less, communally owned means of production. This is socialism, or communism, or whatever you'd like to call it.
>>
>>54950284
Barring the existence of a soul, robots will eventually be more adept at everything, with less energy input needed. So what reason will there be for humans to exist?
>>
>>54950352
Well it's funny you say that. Whenever I look at computer science courses, like literally look at the people on them, they seem more like Chavs. Maybe this is how it is in Britain compared to the US. It looks more like the degree that people take because they know that compewturs are the future and they don't want to work in McDonald's like their 7 siblings. That's actually what's putting me off.
>>
>>54950284
>When a robot takes your job, you don't ask for a new job, you find a place for a new job.

When cars replaced horses, horse population declined (presumably, by starvation). Do you want for all unnecessary people to follow the same fate?

It is becoming harder and harder to contribute to society, the ratio of people that are able to do it is beginning to shrink.
>>
>>54950352
Looks like I'm doing CS :-)
>>
>>54950307
On the other hand:

1) More people = more tax paying slaves
2) More people = more raw material from which a tiny fraction of new elites can emerge via a fierce competition.

We are biological robots for them.
>>
>>54950411
what reason is there for humans to exist now?

you're not making sense
>>
>>54950403
You can learn anything on your own since kahn academy and wikipedia exist. Degrees usually breech deeply into those topics and having a bachelor's/master's in it is like a testament that you're knowledgeable in it. Might be archaic but just the way society is.

>>54950417
This is true, but a lot of those people get weeded out of the system before 3rd year, and they don't take up employment positions anyway since they can't do fizzbuzzes on the off chances that they somehow graduate.
>>
>>54950411
time to swallow the biggest redpill of them all
https://www.youtube.com/watch?v=FFWAQJDKcvs
global elite is going to exterminate humanity to pave way for artificial intelligence to be the new face of "humanity" just like out of that AI movie with the 6th sense kid, where the far future humans weren't humans at all
>>
>>54950485
>alex jones
>rich fuck who lives in a mansion
heh
>>
>>54950479
>Degrees usually breech deeply into those topics
>deeply
not really
>>
>>54950404
Communally owned means everybody and nobody owns a factory.

Having a big class of small property owners is different. Many families own land and houses (note that in many countries including US owning a house is politically and economically (via low mortgage rates) encouraged) . Why shouldn't they own productive robots?
>>
>>54950512
not an argument
>>
What about specific game dev courses? They seem like total novelty things.
>>
>>54946412
copypasta-worthy
>>
>>54950462
There should not be reason to exist. Let people live a happy life and that's it. If someone wants to party all her life - so be it. If someone wants to colonize mars - so be it.
>>
>>54950512
are you one of the guys who associates being successful with being bad? do you want him to live in a trailer park and be on welfare in order to be credible?
>>
>>54950530
they're complete and utter bollocks
>>
>>54950462
So they can all aspire to meet me. When I'm dead, well, that's different.
>>
>>54950485

>NWO to replace your job

ermehgerd MY JOBBBBB OMG NOT MY JOBBB

Why do right winger retards cling to this soul sucking work society?
>>
>>54950530
Why do you need a course to start slapping together shit in unity?
>>
>>54947800
>Imagine you receive an android body by mail.
does it have a vagina?
>>
File: bernie sanders donors.jpg (638KB, 2720x1845px) Image search: [Google]
bernie sanders donors.jpg
638KB, 2720x1845px
>>54950569
>>
>>54950530

Why pay for something you can get for free on Youtube?

There's a million "design a game" series out there. You learn by actually doing it, not by sitting in the classroom being told how to do it.

More complex subjects are a different story, of course.
>>
>>54950581

I read that as "received an unlocked android device in the mail," as in a tablet.

Makes more sense now.
>>
>>54950530
Limiting yourself to video games sells you short. Any good programmer cna learn APIs, but a video game developer that only uses APIs won't know how to program anything else.
>>
>>54950632
>More complex subjects are a different story, of course.
*tips*

game dev as a whole has a ton of depth to it
>>
>>54950350
bump

any programmers here or just autistic faggs with a forehead that looks like a pizza margherita?
>>
>>54949092
What the fuck does this have to do with premature optimizatoin? I bet you're one of the fags who does ++a instead of a++ because HURR IT SAVES A CYCLE
>>
>>54950697
>please do my homework you autists
f u c k
o
f
f
>>
>>54949977
Actually, you should KYS yourself.

JS + canvas is the most portable and reliable graphics environment there is unless you're doing some heavy ass 3d rendering.
>>
>>54950675

Are you suggesting those game dev courses offer the kind of depth you are referring to?

Because from what I've heard, they don't.
>>
for finding the distance between 2 points in 3D space, do i use the pythagorean theorem to find their 2 dimensional distance, and then use that as one of the legs in pythagorean for the next dimension?
>>
>>54950569

Being unemployed is awful. It's incredibly unfulfilling.
>>
>>54950743
>asking for an effective approach regarding a DB-insert

>please do my homework you autists

Yeah exactly, because my teacher who's even more retarded than you all asked for:

>tthink about an approach on uploading an object in android

how retarded are you?
>>
>>54950632
>>54950574
>>54950661
I was wondering if they also gave easier pathways to industry experience and other advantageous perks like that.

I want to do a degree that's actually relevant to a job - not necessarily game development. I want to avoid what some people I know did; a fucking philosophy degree and then be unemployed (mainly) for 7 years before ending up in a shit office job they could've got half their life ago.

For me an English degree would be easiest, going off my previous academic history, but (a) I don't have much faith in that leading to a career other than teaching (b) I don't know if I could stand being around the sort of people you'd get on that kind of degree.
>>
>>54950770
if the time comes where we're in a post-scarcity society and we're stuck on earth and not colonizing mars, do you want to start an anti-government libertarian terror cell with me?
>>
>>54950770

You need better hobbies, then.

I could be unemployed the rest of my life, just writing code and making stuff in the wood shop.

If you need someone else to give you purpose in life, you need to reevaluate your life.
>>
>>54950795

http://tips.fbi.gov/
>>
>>54950134
Fucking tripcuck the only person here who needs to kill himself is you you pathetic little cunt who feels like he needs to have a fucking name on an anonymous vietnamese horse racing image forum little cunt get raped faggot
>>
>>54950769

Pythageorean distance is essentially the same in 3D dimensions. All you need to do is add the difference in Zs squared.
>>
File: post scarcity.jpg (290KB, 1435x597px) Image search: [Google]
post scarcity.jpg
290KB, 1435x597px
>>54950804
>(You)
>>
>>54950770
Our society made it so. If we had a culture of unemployed people volunteering to help those in need and fix infrastructure there wouldn't be such a problem. Instead we shame them and they run away to /r9k/.
>>
>>54946412
>Berates you regardless of intelligence
It's just a way to keep you servile and cheap/stay with the company.
Look for a new job immediately.
>>
>>54950722
fuck off ++a is obviously better for style reasons, it expresses intent more clearly, a++ should only be used when you evaluate the initial value of a
>>
>>54950770
Yeah right on wage cuck, I hope you're enjoying your menial existence.
>>
>>54950786
not retarded enough to help someone whose insulting me
>>
>>54950839
t. guy who spends all day on 4chan
>>
File: 1439903334301.jpg (226KB, 850x1201px) Image search: [Google]
1439903334301.jpg
226KB, 850x1201px
>>54950801
This. I can be unemployed and build robot waifus for a hobby.
>>
>philosophy and history graduates have a higher rate of employment than CS or physics graduates
How is this possible? Please explain, wise men of /g/.
>>
>>54950795

It's already happening. There is a national community of III percenters.

>>54950801
>You need better hobbies, then.

I already have a ton. Hobby programming, cars, guns, etc.

These are fun, but they don't exactly give purpose to life.
>>
>>54950838
>for style reasons
Using ++a as its own statement is pants on head retarded. Otherwise fine.
>>
>>54950762
fuck off and die idiot

>>54950767
no, but most other courses don't have much depth either you delusional moron, just that it's more obvious to see that a game dev course lacks substance because any fucker can see that a javascript flappy bird clone is a trivial lazy hackjob of a game
>>
File: tumblr_njw1vysmVQ1qd479ro1_1280.jpg (291KB, 1000x1265px) Image search: [Google]
tumblr_njw1vysmVQ1qd479ro1_1280.jpg
291KB, 1000x1265px
>>54950815
>posthumanity
>>
>>54950843
>asking for code

>asking for advice

learn the fucking difference faggot. It's not my fault that you're too retarded to get a degree.
>>
>>54950853
>These are fun, but they don't exactly give purpose to life
Yeah because all those are shitty hobbies you faggot

>>54950861
>fuck off and die idiot
haha do you say this everytime you get told? cuck
>>
>>54950878
stay delusional fag
>>
>>54950878
>those are shitty hobbies you faggot

They're fine, actually. I also enjoy gardening.
>>
>>54950883
You're the fag my man, now kill yourself like I told you to.
>>
>>54950788
You won't get a job if you don't like it and instead prefer English, it's a competitive market and the employers want the cream of the crop. Now if you do enjoy it then it'd be worth your while. You should try out actually programming though if you haven't already.
>>
>>54950853
>These are fun, but they don't exactly give purpose to life.
Whereas moving boxes full of items you don't own from one place to another is? Or warming up food for others to eat? Or sitting in an office and staring at your screen so mindlessly and so bored that it takes 10 minutes before you've realise the screensaver is on?
>>
>>54950889
You truly are a good little goy aren't you
>>
>>54946472
>python
I get the feeling people who like python have never dealt with real software problems.

Because that's a prime example of trivial code which you've likely written elsewhere already or could implement using the standard library. When you have real problems I don't quite see what difference there'd be really. Except you could maybe rely on the speed in C++ to do solutions that'd be unfeasible in python.

My trivial python applications run like shit and I don't know why. Can it really not just search a tree structure that's maybe 10 folders deep and 5 folders each in less than 5 seconds? Suppose it could be the OS but I'm suspicious.
>>
>>54950895
>Or sitting in an office and staring at your screen so mindlessly and so bored that it takes 10 minutes before you've realise the screensaver is on?
I dunno what kind of office you've been in (or if you've even been in one), but usually I can just fuck around when I have nothing else to do
>>
>>54950861

I've had courses with depth. Classes that gave me good insight on complex topics and challenged me to tackle problems that I wouldn't have considered before.

If you haven't, then you've had the wrong courses.
>>
>>54950795
In post-scarcity society nobody would stop you from colonizing mars. They just give you training and spaceship. Resource-wise spaceships are cheap.
>>
File: 1422284780226.png (164KB, 498x497px) Image search: [Google]
1422284780226.png
164KB, 498x497px
Does being bilingual and bisexual make me more employable as a programmer?
>>
>>54950895
>sitting in an office and staring at your screen so mindlessly and so bored that it takes 10 minutes before you've realise the screensaver is on?

I preferred checking my e-mail 100 times a day, drinking excessive amounts of coffee, and committing one-line fixes as it became necessary.

Working as a programmer isn't so bad.

>>54950910

I guess so, my man. The jews tricked me into racemixing and wagecuckery.
>>
>>54950926
Then you may as well be at home unemployed.

>>54950930
No, but it does make you 65.4% more likely to contract AIDS (mainly the bilingual part).
>>
>>54950889
>also enjoy gardening.
based
>>
>>54950944
>Then you may as well be at home unemployed.
I wouldn't get payed then
>>
>>54950924
>Can it really not just search a tree structure that's maybe 10 folders deep and 5 folders each in less than 5 seconds?
post code
>>
>>54950944
>Then you may as well be at home unemployed
one gives you money one doesn't.
>>
I want to start learning C++. I already have some programming knowledge from Java and PHP. Is it as hard as people say it is?
>>
>>54945384
Nice anon
>>
>>54950963
>Is it as hard as people say it is?
No. It's not hard at all. It's not a beginner language but there's nothing inherently difficult about it.
>>
>>54950927
Self study NEET here who is noticing how much time was wasted in the first two years of CS masters (yes we decide year one). I've covered the course literature on my own they have and I'd be at year 4 now. I can't be sure I covered everything they have. I'm missing some team projects and such. But I'm really wondering what people think college gave them aside from the diploma (or whatever you call it in English).

I dropped out because severe depression so I've covered two years in one year and I'm a little bit ahead. Assuming I'd pass, but I know the stuff. Certainly better than I suspect most of them would.

It just doesn't feel like a good idea to go back to college anymore. Even if I can just take all the tests how much does that really help me?
>>
File: 1463591641559.png (532KB, 790x938px) Image search: [Google]
1463591641559.png
532KB, 790x938px
>>54950930
Yessss
>>
>>54950927
good luck in the real world academiababby
>>
>>54950963

Not really.

It can be confusing, and learning to deal with pointers can be a challenge for someone from garbage collected languages, but if you follow C++11 and beyond style that's minimized anyway.

There's a lot of dark corners and a ton of older code that uses the older, less safe style, but modern C++ isn't bad. Kind of like Java, really, but it doesn't force you to make every fucking thing a class and you're not using things like Sun.Lib.ReallyFuckingLongCamelCaseLibrary.Foo.Bar().

But then again, I mostly work in C and Perl, so take that for what it's worth.
>>
Okay, so CS query Anon here again.

I'd be doing an access course before the main degree (long story short: I fucked up and have been a NEET for over a decade). What topics would you advise I look at now to be the most prepared I can? What maths subjects, what programming languages? I'll do whatever.
>>
in C++ i made a "tools" class to put a pythagorean function in and i included it in my Line class but its telling me the function definition isn't found. what am i doing wrong?
>>54951004
that doujin was weird
>>
>>54951021
nm forgot the tools:: in the function definition
>>
>>54950950
>based

I think so, too. This coming cold season, I'm going to start some tobacco indoors and see if I can actually grow the stuff. Pretty difficult, I hear, so I'd like to challenge.
>>
>>54951003

The diploma is the important part, really.

The advantage of the classes is that they make you do things you normally wouldn't do. You've got that if you're following a course and doing the homework.

What you're not getting is support from your peers and faculty and the networking. Networking is important - it'll get your foot in the door at places that otherwise wouldn't look twice at you.
>>
>>54951003
For me it's about actually being part of society. I am fucking sick of being a NEET and feeling like a ghost drifting around day to day. The whole reason I'm doing this is to get back on the wagon, self-study from home wouldn't help with that at all, at least not for 3-4 more years. I want to work with other people, to have to get up and go somewhere each day. All that stuff.
>>
>>54950960
Not at computer. I think I used os.walk.
I don't think my implementation would be better given how unfamiliar I am with python. It should be noted there's A LOT of filed involved. But I don't see how that matters honestly. I've made similar implementations on bigger stuff and it wasn't that bad. Also I'm pretty sure there's some windows API call to list folders.
>>
>>54951016
>>54950997
Thanks, I'm going to start with Bjarne Stroustrup's book, is that a good choice or...?
>>
>>54951018

Depends on your school. Some schools require little more than Calc I and Discrete Math. Some require more. You lose math if you don't use it, so make sure you're up to snuff at least with college-level algebra.

Otherwise, just code. That's how you learn, and that'll give you a head start in your classes.
>>
>>54951042
I have two software parents. Networking won't be much of an issue I think not for the first job.
>>54951047
Yeah, that period was really bad. But honestly that's just depression (in my experience). Part of the reason I stopped was because of college requirements on social life. So that doesn't apply to me.

Thanks for sharing.
>>
>>54951018
>What maths subjects, what programming languages?
math: Linear Algebra, Discrete Math, 2d/3d vectors and stuff. You'll probably have to do calculus as well in your degree but the others are more significant.
Languages: any language really. Python, C, Lisp. You should aim for languages that are NOT OOP since OOP concepts are more for software development and less about the whole art itself (but of course you should end up knowing at least C++ or Java eventually).

>>54951081
When I started I read Accelerated C++ by Andrew Koenig but with the langauge I got thrown into it with school so I ended up learning the hard way through stackoverflow
>>
>>54951081

He's written several, but if it's the one I'm thinking of, I've heard it doesn't coddle you. Other than that I've heard good stuff about it.
>>
File: 001704801-hq-168-80.jpg (11KB, 168x253px) Image search: [Google]
001704801-hq-168-80.jpg
11KB, 168x253px
>>54951126
This one
>>
>>54951178

Yeah, that's not it. Sorry, no idea.

I can't remember the exact title of the one I'm thinking of, and I'm too lazy to look it up, but a friend of mine who has it likes it.
>>
File: cpp 3d points.png (19KB, 672x411px) Image search: [Google]
cpp 3d points.png
19KB, 672x411px
we did it reddit!
>>
File: whyy.png (80KB, 500x421px) Image search: [Google]
whyy.png
80KB, 500x421px
How do I stay motivated to program?
>>
Wo ist der neue Faden?
>>
Is java the ideal language for a beginner?
>>
>>54951018
Start with the bach or applied CS as a start.
>>
>>54951052
i think i remember using os.walk once, it's known to be very slow. looks like someone is trying to improve on it but hasn't been accepted yet.
https://www.python.org/dev/peps/pep-0471/#os-scandir

python is slow but os.walk is slow even for typical python funtions
>>
>>54944789
Being a pedantic fucktard doesn't increase your perceived intelligence
>>
File: DAAN8yB.jpg (72KB, 480x270px) Image search: [Google]
DAAN8yB.jpg
72KB, 480x270px
>>54951244
>>
>>54951312
maybe not as perceived by you :&)
>>
>>54951272

I find having a woman dressed in leather hit me with a riding crop offers good motivation.

That's why I do web design for an equestrian academy.
>>
>>54951342
>web dev into domination
Why am I not surprised
>>
File: test.jpg (224KB, 612x612px) Image search: [Google]
test.jpg
224KB, 612x612px
>>
>>54951284
absolutely

check out https://docs.oracle.com/javase/tutorial/

also the book by daniel lang
>>
>>54951352
New
>>
>>54951284
C# is better and almost identical to Java
>>
>>54951409
Fuck off
>>
>>54951360

Test of?
>>
>>54951409
This is you're on windows, it's basically Java with better syntax.

Ultimately it depends on what your goals are though. If you're serious about programming I wouldn't recommend either as a first language. C/C++ will give you better fundamentals, but will be much harder starting out.
>>
>>54951293
Ok thanks that's good to know.
>>
>>54951409
>>54951449
no

C# is a completely ruined version of java it's like a mishmash of java, C++ and python

java is much simpler and sticks to it roots (C++), so it's a lot better for preparing you for C++ or C and programming in general, C# has a shit ton of language-specific features that don't apply to e.g. C++
>>
File: what.jpg (25KB, 600x512px) Image search: [Google]
what.jpg
25KB, 600x512px
>>54951409
>>54951449
>>54951481
>>
>>54951496
Let them squabble amongst themselves and just go here
http://tour.dlang.org/
>>
>>54951496
just learn java or if you really want to learn C++ or C# go ahead, just whatever you do don't fall for the python meme
>>
>>54951481
what? I would argue that C# is more c-like that Java, considering it has pointers, structs, c-like enumerations, string characters by array indexing, etc.

Both Java and C# have a ton of language features that don't apply to C/C++.

Ultimately the anon should just do some research and decide for himself.
>>
For the folks programming C++ with vim, what are some must have plugins every programmer should have?
>>
>>54950924
Then you have the wrong feeling. Why do you feel that way?
>>
>>54951439
1337 h4xxor skillz
>>
>>54951681
i prefer using vim in an IDE. but surround.vim is good.
you complete me is too brittle and ugly.
dont listen to the people who say you need 1 million plugins.
>>
>>54950762

>most portable
C++ with QT (actually, any language with QT) and Java with Swing are both just as portable.

>reliable
Not necessarily. Javascript's poor type system actually opens itself up to quite a few bugs.

>unless you're doing some heavy ass 3d rendering
What is it with people thinking that performance only matters if you're working on the extreme end of computing requirements? There is a massive problem with this mentality, and it's mainly that there is an assumption that your application is going to be the only application running on the machine. You think, "well, computers these days have at least 4 GB of RAM on them, and CPU power is doubling every 2 years or so, so it's perfectly fine for my application to use as much of these resources as possible!" But the problem is everyone starts thinking like this, and CPU performance gains aren't happening as regularly. So we're going to start seeing computers become slower, not faster as time goes on, as moore's law dies out and software developers start switching everything to Javascript, not out of its technological superiority, but out of convenience.

Beyond this, we're starting to see a greater demand for energy efficiency. How do you make a program more energy efficient? You do the job as fast as possible so the OS can make the CPU idle for longer.
>>
>>54951681
emacs
Thread posts: 364
Thread images: 43


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