[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt? Daily Programming Thread alas, the old thread died htt
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 21
File: 004_003_reuben_wu-122.jpg (1 MB, 2500x1667) Image search: [Google]
004_003_reuben_wu-122.jpg
1 MB, 2500x1667
/dpt?
Daily Programming Thread
alas, the old thread died
https://boards.4chan.org/g/thread/54322512#bottom

please stay on topic here
if you have another subject to discuss, please find the appropriate board/thread
thanks
>>
File: GBzPEMQ.jpg (105 KB, 640x640) Image search: [Google]
GBzPEMQ.jpg
105 KB, 640x640
>muh trump
>muh maga
>>
>>54327125
You will not post any of the following outside of /b/: Trolls, flames, racism, off-topic replies, uncalled for catchphrases, macro image replies, indecipherable text (example: "lol u tk him 2da bar|?"), anthropomorphic ("furry") or grotesque ("guro") images, post number GETs ("dubs"), or loli/shota pornography.
>>
File: χωρίς τίτλο.png (90 KB, 963x866) Image search: [Google]
χωρίς τίτλο.png
90 KB, 963x866
Hey /dpt/,
We've started a slack group with the aim of organizing the studying of books related to CS/math/philosophy.
This Sunday we finished past projects and are starting some new ones, namely:
1)SICP
2)Networking
3)Goedel, Escher, Bach
4)Set Theory
5)Logic II
https://docs.google.com/spreadsheets/d/1A_zbRf7YoiY_454INuLXEuSuW3ro0rZtaGJtnIb4XNw/edit?pref=2&pli=1#gid=1817327167 here's the schedule.
If you're interested, then leave your email here (making a fake one is recommended, needed only for an activation) and I'll send an invite.
>>
two part question:

1. knowing what programming language would make me most employable
(assume only one)

2. what combination is best?
>>
I'm thinking of making a photoshop like program for drawing shit. But I'm thinking of using the history of brush/eraser strokes etc as the file format. So that when you open the file, the program can redraw the image that you saved.

Any big issues I'm missing with this?
>>
>>54327258
edit: trying to land job that is well above $50k
aiming for 6 figures
>>
>>54327125
kys
>>
>>54327288
sounds like an add on for gimp
>>
>>54327239
Apw pou eisai re;
>>
How do i get an internship?
>>
>>54327288
see
>>54327312
this - join the GIMP project, it's open source, it needs your help
>>
>>54327312
>>54327336
but GIMP is a massive steamer.
>>
>>54327348
that's why it needs your help!
>>
File: herman cain.gif (2 MB, 360x332) Image search: [Google]
herman cain.gif
2 MB, 360x332
Guys project euler is flipping sweet, just fyi. I'm fucking hooked.

>>54327258
1. Python

2. Python, C/C++, and a good understanding of the x86_64 architecture ad how to write machine code for it

t. 6-figure-earning 22 year old

>>54327288
major performance issue for large projects.
You could store the last save (or blank for new file) and then changes made since that (and autoenforce saves every x minutes)

>>54327331
I know Discord is hiring interns right now
>>
>>54327330
>ellhnes sto /g/ mou
>>
>>54327239
>slack
Doesn't respect my freedoms, buddy
>>
>>54327348
no, it's not
>>
>>54327348
this
>>
>>54327364
>major performance issue for large projects.
it would work like git, and git seems to do fine
>>
>>54327374
kai den feugoume :)
>>
>>54327288
it would eat a shit ton of RAM, unless you utilize virtual memory, but that's slow and clunky.
maybe if you save them as some sort of file, still slow, but would free up RAM.
>>
>>54327440
Fuck of nazists
>>
>>54327360
It's easier to start fresh.

>>54327364
>major performance issue for large projects.
This is true. My main concern is that loading files will take longer the more operations you apply to the image..

But I'd still like to try it. Some advantages would be that it would be resolution independent. Need the image in 4x the resolution? You can redo all the canvas operations scaled up on a x4 canvas. I can also cache the images generated in a temp file folder, so loading a file doesn't always take a long time, if it was loaded recently.
>>
File: descend-startscreen.png (129 KB, 317x563) Image search: [Google]
descend-startscreen.png
129 KB, 317x563
pretty much finished the main menu, added music, sound button works fine, and it's all set up to write the actual game

not that I have an idea for a game yet
>>
>>54327454
Den eimai nazi, filos mou
>>
>>54327453
>it would eat a shit ton of RAM
it wouldn't use any more than just loading a bitmap. Why do you think it would use more ram?
>>
>>54327475
[email protected]
>>
>>54327330
>You will not post any of the following outside of /b/: Trolls, flames, racism, off-topic replies, uncalled for catchphrases, macro image replies, indecipherable text (example: "lol u tk him 2da bar|?"), anthropomorphic ("furry") or grotesque ("guro") images, post number GETs ("dubs"), or loli/shota pornography.
>>54327374
>>54327440
>>54327509
You will not post any of the following outside of /b/: Trolls, flames, racism, off-topic replies, uncalled for catchphrases, macro image replies, indecipherable text (example: "lol u tk him 2da bar|?"), anthropomorphic ("furry") or grotesque ("guro") images, post number GETs ("dubs"), or loli/shota pornography.
>>
>>54327288
congratulations, you just invented vector art
>>
>>54327531
you should have done that when people posted anime and/or traps, too, m8
>>
>>54327533
lots of stuff isn't easy to do with vector art though. I want to make a program that is a lot like Painter. Very realistic, nice to use brushes. Not easy to do that shit with vectors, but easy with bitmaps.

By recording the canvas operations i get the advantages of both vectors and bitmaps, but a few disadvantages I think i can live with.
>>
>>54327509
>>>/pol/
>>
>>54327569
i wasn't here then
>>
>>54327572
you can use bitmap brushes in inkscape IIRC
>>
File: 1461528655252.png (378 KB, 1450x1080) Image search: [Google]
1461528655252.png
378 KB, 1450x1080
Guys, how do I go from mediocre SE student, that can barely write simple programs to a great programmer?

I'm going into my senior year, and my programming skills are embarrassing. I haven't written anything substantial outside of class in a long time.

This picture for example, I wouldn't know where to begin with ~75% of the "easy" challenges. Of course I can do FizzBuzz, and implement sorting algorithms, but anybody can do those.

Advice?
>>
>>54327603
and?
>>
>>54327597
you could have too, senpai
>>
File: moldova001-25.jpg (491 KB, 666x1000) Image search: [Google]
moldova001-25.jpg
491 KB, 666x1000
I'm a beginner in C programming. If I'd like to periodically read & store values from four sensors in a small microcontroller system, which way would be better:

unsigned char VALUES[4];

void Adc_ReadSensor(unsigned char channel) {
/*...read value into "cur_val"...*/
VALUES[channel] = cur_val;
}


unsigned char VALUE_S1;
unsigned char VALUE_S2;
unsigned char VALUE_S3;
unsigned char VALUE_S4;

void Adc_ReadSensor(unsigned char channel) {
/*...read value to "cur_val"...*/
switch (channel) {
case 1:
VALUE_S1 = cur_val;
break;
case 2:
/*...continued...*/
}
}
>>
>>54327616
rawlin
>>
>>54327619
literally what is the difference?
>>
>>54327616
write what you know
not just good for novelists, works for programming too
what are your passions?
baseball cards? write an app to catalog them
porn? write some code to rip all images from a page of thumbs
etc...
>>
is it retarded to jump straight into c++ for somebody who has no programming experience whatsoever
>>
>>54327616
All the green problems from #10 and below are really simple, and shouldn't take more than a half hour each.
Did you take a look at those?
>>
I was looking into bug bounty hunting as a hobby and was interested in developing my own scripts to search for web app exploits. I know some basic python what the things I should study? Is bug bounty hunting fun? I enjoy programming and solving puzzles and I figured it could be nice if it also paid off once and a while, not to supplement income though I have a good job.
>>
>>54327649
Between what? I want to use bitmaps, not vectors. You're telling me InkScape supports bitmap brushes. I'm not sure what you're trying to convince me of.
>>
>>54327684
basic programming methods using java 106A
https://www.youtube.com/playlist?list=PL84A56BC7F4A1F852
Programming Abstractions using C++ 106B
https://www.youtube.com/playlist?list=PLFE6E58F856038C69
>suggest you do both
>>
>>54327684
not necessarily, but most likely.
>>
>>54327509
>you and me have been here for years, m8

And in true communist fashion, you've learned nothing about. The only thing you've learned is that I'm not useful to the revolution, so you'd probably have me killed.

>YOU HAVE DEFENDED THE MILITARY

If I ever did anything of the sort, it was most likely satire. I'm not a statist, lad. Nor am I a temporarily embarrassed millionaire, or Christian conservative, or anything else you'd have me pegged as.

>underhanded tactics

Underhanded doesn't mean rigging. Her media force is something to be reckoned with. I doubt she's involved in election fraud.
>>
>>54327717
using bitmap brushes in inkscape accomplishes the same goal.
if you think it's different, go make it and come back
>>
>>54327749
>you've learned nothing about me.

Fixed that for myself.
>>
>>54327757
I'm already using bitmap brushes. What are you on about?
>>
>>54327239
>organizing the studying of books related to CS/math/philosophy.
BOOOOOOOOOOOOORINNNNNg
>>
>>54327864
see Global Rule #3
>>
R U S T
U
S
T

The best language ever invented.
>>
wpf takes a shitton of time to just do ANYTHING, it looks nice tho
>>
>>54328029
R U S T
U S T R
S T R U
T R U S
>>
>>54328034
hmm?
>>
>>54328034
Doesn't respect my freedom.
>>
>>54327462
It's a cool idea. Will you post a demo when you have something working?
>>
>>54328107
You shouldn't be on 4chan then, you shouldn't be in society then, you should leave the planet and live on pluto.
>>
File: 1359080855264.png (252 KB, 511x428) Image search: [Google]
1359080855264.png
252 KB, 511x428
How do I stop comparing myself to other devs in completely separate fields? Two guys from high school went into CS with me. One got his masters in security at works at a gov contractor, the other has been at unicorns since graduating and is currently a Swift dev on an app that gets used millions of times a day.

Meanwhile I'm just here shitting out ruby code as an systems engineer. I'm good at this niche but I look at their careers and understand none of it, thus feeling like shit.
>>
>>54328108
I won't be working on it for awhile. It's just a "some day" idea in my head right now. Some day I'd love to make it though.
>>
>>54328139

Do you make good money? If so, then stop worrying about it and learn what you can in your free time.
>>
>>54327630
I prefer the first one because it looks nicer.
>>
>>54328107
open source cross platform WPF:
https://perspex.github.io/
>>
Just started Python programming, was it a good choice for a beginner? i've already made one script which is a UDP dos attack
>>
>>54328238
No. Even php is a better designed language.
>>
>>54328139
are you happy where you are?
you don't need to understand other people's work
>>
>>54328245
Lol?

>>54328238
Well that's what you started with, so stick with it.
>>
>>54328277
i was thinking that, i might as well complete and master the language
>>
>>54328285
>I might as well waste a decade of my life mastering the most retarded and useless language ever made
>>
>>54328238
dunno, download a wiki page and try to rearrange the words and count how many of them there are and how many start with XYZ ect.
>>
>>54328285
Yeah, changing is only going to hurt you. As a second language I'd learn something less abstract. C, C++, assembly or similar.
>>
>>54328277
>Lol
fuck off
>>
File: Scissors-outlet-electrocuted.gif (2 MB, 385x473) Image search: [Google]
Scissors-outlet-electrocuted.gif
2 MB, 385x473
how do i find local programmers to meet up with?
kinda need a mentor because videos and books are good, but not interactive. occasionally need to ask a Q and sometimes /g/ and reddit/r/programming are kind of hostile and stack overflow doesn't know the difference between my specific Q and some similar Q which has answers that don't fit my situation.
>>
>>54328049
>Then you've been talking nonsense. The problem isn't that Hillary is rigging the election.
there are a shitload of reports claiming vote rigging and bias in favor of Clinton.
http://www.vice.com/read/the-democratic-party-hillary-clinton-bias-goes-way-beyond-data
http://www.zerohedge.com/news/2016-04-21/additional-evidence-mind-boggling-fraud-emerges-new-york-primary

>noo, I'm not defending democracy in the US, you are just a conspirancy nut!!!1

>>54327899
you won't tell the tripfag to stop the off-topic? I'll continue, then

>>54328348
>hurr durr leave my sekrit forum and gb2 reddit!!1
>>
>>54328348
Lol!
>>
>>54328372
i reported his shit, mods are sleeping i guess
>>
>>54328390
>assblasted
>>
>>54328372

I'm not defending democracy, I already told you it's the tyranny of the majority. That is why I absolutely 100% detest it.

>there are a shitload of reports claiming vote rigging and bias in favor of Clinton.

Eh, maybe there are. I haven't looked into it, too much. I have my doubts that Sanders would have won, anyway. He was simply never as popular a candidate as Clinton.

I'm still perplexed by your support for Sanders. Really mindboggling stuff.
>>
>>54328357
you don't need a fucking mentor. google and stackoverflow has the solution to 99% of your problems.
>>
>>54328419
it's the 1% that i'm hung up on
>>
>>54328357
You don't. Get a job and get to know the guy who knows what he's doing. OR go on IRCs specific to that problem area. They don't depend upon archived pages to function so nobody tries to pull that "lol answered already. Don't you know how to Google retard?" shit.
>>
>>54328411
>I'm still perplexed by your support for Sanders. Really mindboggling stuff.
you seem to see all communists as extremists, and not as opportunists that try to improve the lives of those that need it the most. sure some communists have been brutal, but even if you put stalin as a terrible human being, you can't deny how much the soviets did for the SU. many of their social advances were taken by western nations, as opposed to, say, the US, that still had slaves and racism some decades ago.

>>54328357
books are your mentors. also, what >>54328483 says. go to freenode, look for some specific topic (language, framework, etc) and ask there. IRC is really nice for learning. plus, mailing lists, and so on.
>>
>>54328554
>>54328357
btw, this is freenode's web interface:
https://webchat.freenode.net/?channels=
beware that most people there are real aspies.
>>
File: giphy (1).gif (359 KB, 500x250) Image search: [Google]
giphy (1).gif
359 KB, 500x250
>>54328585
>>54328554
>>54328483
thanks /g/ays!
>>
>>54327468
Make a game where you need to fly a bird through pipes. That would be so great!
>>
writing a code generation tool i will use in my distribution backend
basically you define all the data models you need in one single location and then the tool takes it from there, generating code for multiple langauges with support for serialization and writing to file/socket out of the box

on an unreleated note, anyone have the manga with the two lolis fishing from a bridge and a monster who talks like an australian?
>>
>>54328554
>you can't deny how much the soviets did for the SU.
Uprooted a 250 year dynasty that had done very well by it's people by reforming traditional ways and accepting more liberal European political ideas and making Russia a global superpower? Plunged them into abject poverty through mismanagement and killed millions of them either deliberately of through starvation due to mismanagement. And eventually gave up and accepted a modern capitalist economy that has grown what the country should have during its 50 years as a communist nation during the 25 years since its downfall.

Sounds like they did a lot of good.

>the US, that still had slaves and racism some decades ago.
Are you by chance Chinese? It's obvious your source of information lies to you.
>>
>>54328357
fake
>>
>>54328419
he just wants to met someone so he can suck dick, don't ruin his wetdreams
>>
>>54327239
Hey, if you're still here, I'd like to be part of the slack group

Here's my email:
[email protected]
>>
>>54329190
sent ;)
>>
Can anyone recommend a good resource on understanding quicksort? Fundamentally, I feel like I get it, but I obviously don't because I don't know how to sort everything up to the median value.
Example: [4 3 9 6 7], 6 is the median value the sorted array would end up being something like....[3 4 6 9 7].
I'm supposed to modify this http://lpaste.net/162064 to do so. I've tried watching Pajeet's videos:
https://www.youtube.com/watch?v=COk73cpQbFQ
but I'm still not sure how I know when I found the median, or when half the array is sorted.
>>
maybe a stupid question.
how to merge to int variables?
i have int a=2 and int b=4
how do i get 24?
>>
>>54327239
>that disgusting font rendering
>>
>>54329258
temporarily on my 10 year old winxp pc, shut up.
>>
>>54329236
Convert to string and concatenate to another string
>>
>>54329236
trying to print 24
println: a + b
>>
>>54329294
but those are int values.
wouldnt i get 6?
>>54329285
hm iam trying it with an vector now. if that wont work i will go for string.
>>
>>54329236
a * 10+ b
lol
>>
>>54329236
a*10 + b
>>
>>54329218
thanks!
>>
>>54329334
>>54329337
oh this makes so much sense.
was easier than using an vector with pushback
>>
>>54329379
hint: 3675 % 1000 = 675
675 % 100 = 75
75 % 10 = 5

3675 - 675 = 3 * 10
675 - 75 = 6 * 100
75 - 5 = 7 * 10
5 - 0 = 5 * 1
>>
>>54329223
http://visualgo.net
>>
File: pic_3.jpg (192 KB, 680x1020) Image search: [Google]
pic_3.jpg
192 KB, 680x1020
almost no one uses cobol
but some companies NEED cobol
so cobol jobs pay BIG$$$
but they are so very far and few between

should i learn 2 COBOL and hold out for top pay job?
or go with more common stuff like Java/C++ for a larger job pool and almost guarantee i don't starve?
>>
>>54329487
my guess is companies pay big money to *experienced* cobol programmers, and there are more of those around than there are jobs.
>>
https://www.youtube.com/watch?v=ViNnfoE56V8
is this good tuts or just a brief overview of assembly?
>>
>>54329487
go fucking kill yourself
>>
>>54329549
>?
>>
>>54329223
The way I was taught was that you didn't find the median, you just picked a random pivot point and put all elements lower than that pivot into one array and the rest into another. Then you sorted each array with a recursive call and patched the sorted arrays and pivot together before returning.

Finding the median is a bit of an optimization. His video probably left it out.
>>
>>54329437
Ahh, thank you!
This is exactly what I need.
>>
>>54329536
gross
Step by Step Assembly is good
>>
>>54329549
What are you gonna do, arust me?
>>
>>54329536
I like this one for intro to x86 asm:
http://www.drpaulcarter.com/pcasm/
>>
>>54329571
Yeah, his example seems convenient where the pivot ends up being the median.
What I'm doing is specific to a homework assignment. I'm supposed to make the algorithm only sort the top K indexes, leaving the rest unsorted. Then implement it to sort only the bottom K indexes, leaving the rest unsorted. Then implement it again where it sorts everything up to the median, leaving everything after the median unsorted.
>>
>>54329487
crazy eyes holy shit
>>
>>54329653
wtf? I don't understand what the point of that is. But you can find the median of a list in O(n) steps. The algorithm I know is related to quicksort.
https://en.wikipedia.org/wiki/Quickselect
>>
>>54327125
I recently watched the first series of The Man in the High Castle, and you know what stuck with me afterwards?

It's possible (if not down right probable) that the world would be a more peaceful place if that version of history played out.
Everything just looks so damn efficient and comfy in the GNR.
>>
File: 240973.jpg (389 KB, 1024x768) Image search: [Google]
240973.jpg
389 KB, 1024x768
>>54327009
Is there anything that shows how to use boost asio from a procedural standpoint?
I'm new to C++ and I would like to write a procedural asynchronous client and then abstract it into objects and so forth, but the docs only show synchronous clients and asynchronous servers.
There is an example of an async client (http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/example/cpp03/http/client/async_client.cpp) but the code is so OOP-heavy that I can't really understand what's going on.
Also in the docs I can't really find detailed info on how boost works internally, or maybe I just don't understand how C++ libraries work in general.
For instance aiso uses things like binding and iterators and queries, resolvers etc.
This is so radically different from bare unix sockets that just reading the docs isn't enough to make me understand.
>>
>>54329487
MOAR!
>>
>>54327239
The set theory part better include galois fields.
>>
>>54327630
The first way is preferred but if I were you I'd leave plenty of comments.
Also maybe an enum would work better if the naming of the array seems ambiguous.
>>
>>54328432
you're hung up on your own dick. you're the same guy who asks useless questions to a lecturer all the time, and then walks up to him after class to ask even more useless questions.
nothing beats research.
>>
>>54329258
the fag who posted that image is at his parents home with a memey 1280x1024

keku
>>
File: lisp-programmers.jpg (155 KB, 800x864) Image search: [Google]
lisp-programmers.jpg
155 KB, 800x864
Why is Forth the unabomber in this?
>>
>>54328357
The best I've been able to find as far as a mentor is people on IRC.
Sometimes you can single out a person who will help you with stuff.
>>
>>54329966
Accurate pic/10
>>
>>54329487

https://rosettacode.org/wiki/Caesar_cipher#COBOL

This is what COBOL looks like. Tell me if you'd be okay with writing in that.

>>54329523

Average COBOL programmer is in his 50s. They're not going to be able to be so picky soon enough.
>>
>>54329784
asio*
>>
>>54330026
>They're not going to be able to be so picky soon enough.
They'll probably be more willing to transition off of cobal than try to hire unexperienced cobol programmers.
>>
>>54328790
Not him, but in truth slavery is alive and well in the US, it's just been renamed as "for-profit prison industry".
>>
seems every language i've heard of is free to learn, free to use

are there any private languages?
like some DoD outfit that programs their puters in some unknown secret code, so that even if stuff is lost it can't be reverse engineered
or maybe a financial firm doing similar?
>>
>>54329966
Have any tuts on Forth. And any tips on how to get emacs to not throw a fucking fit when I try to install it?

>>54330066
>He gets his opinions from nu-metal songs.
>>
RIP NGT
>>>/sci/8043775
>>
>>54330173
wtf is this shit
>>
>>54330173
except that the monkey is a meme. he'll become a bigger meme now desu
>>
>>54330060

You still need a COBOL programmer to transition away from COBOL.

>>54330109

There are certainly proprietary programming languages out there (I think Cold Fusion was one of them). If you're referring to in house stuff... there's probably a few private languages floating around, but I don't think the reason is to prevent reverse engineering. If you want to do that, there's more advanced techniques.

With regards to the DoD, they've used Ada on a lot of projects in the past, and these days I think they use C++.
>>
>>54327125
muh diversity
muh kumbayah
>>
>>54330204
>You still need a COBOL programmer to transition away from COBOL.
They'll get the old fags to do that before they retire.
>>
>>54330066
>https://www.youtube.com/watch?v=6lIqNjC1RKU

THATS WHY THEY GIVIN DRUG OFFENDAS TIME IN DOUBLE DIGITS
>>
>>54330125
I'm actually in favour of the death penalty instead of wasting taxpayer money keeping shitters alive in jail for the next 60 years.
For-profit prisons however, are nothing but a racket. The second you give an authority incentive to keep you locked up for longer than necessary, you will experience problems.
>>
>>54330209

And how long do you think it will take to transform decades of COBOL code into a language that doesn't suck?
>>
>>54330223
Unfortunately I'm not actually tinfoil material.
The idea that a conspiracy so widespread would even allow publication of such "mind-blowing" revelations, it's like these faggots haven't even read 1984.
>>
>>54330310
who knows. I'd guess a lot of it could be wrapped up in a run time or some shit, so new programmers didn't need to look at it. If something needs changing it can be written fresh.
>>
>>54327009
Why doesn't this work? I can do this stuff in my sleep in Java.

prog17.cpp
#include <iostream>
#include <algorithm>
#include<string.h>
#include "GradeBook.h"
using namespace std;

int main()
{
GradeBook *myGradeBook = new GradeBook[1];

myGradeBook.getGrades();

sort(myGradeBook.marks);

display(myGradeBook.marks);

system("PAUSE");

return 0;
}

void sort(myGradeBook.marks)
{
// function display has been created for you.
// Create the function sort to sort the marks in ascending order
sort(myGradeBook.marks, myGradeBook.marks + 10);
}
void display(myGradeBook.marks)
{

cout <<"Displaying marks in Ascending Order " << endl;

for (int i = 0; i <10; ++i)
{
cout<< myGradeBook.marks[i] << " " <<endl;

}

}



I will post the header file next.
>>
>>54330363
Most COBOL programs run on mainframes that supply a lot of the functionality. Good luck emulate multiple entire mainframes in a runtime.
>>
>>54330310
Actually not that long. As your example showed, thousands of lines of COBOL can be condensed into only hundreds of lines of C or equivalent.
Due to the declarations being so fucking verbose, there's not that much functioning code to actually work through the logic with.

It's a boring job, but certainly not that difficult.
It does however mean paying someone an awful lot of money just to "translate" it without adding a single new feature.
Also, it's not really the software that's the problem, it's the hardware running it that expects to see (and in fact was built purposefully for) programs written in COBOL.

The industries still using COBOL are just not comfortable giving someone their shekels to do a little spring cleaning, they'll wait until it is absolutely necessary.

Of course, the longer they wait, the higher the cost. But since when have financial industries ever been good at doing things in a timely manner.
>>
>>54330401
GradeBook.h

// GradeBook class definition in a separate file from main so that we may use this in all the programs now
#include <iostream>
#include <string> // class GradeBook uses C++ standard string class

// GradeBook class definition
class GradeBook
{


public:

int marks[10]; // grades for the grade book.

// constructor initializes courseName with string supplied as argument
explicit GradeBook( std::string name )
: courseName( name ) // member initializer to initialize courseName
{
// empty body
} // end GradeBook constructor

// function to set the course name
void setCourseName( std::string name )
{
courseName = name; // store the course name in the object
} // end function setCourseName

// function to get the course name
std::string getCourseName() const
{
return courseName; // return object's courseName
} // end function getCourseName

// display a welcome message to the GradeBook user
void displayMessage() const
{
// call getCourseName to get the courseName
std::cout << "Welcome to the grade book for\n" << getCourseName()
<< "!" << std::endl;
} // end function displayMessage
void determineClassAverage() const; // averages user-entered grades

void getGrades()
{

for (int i=0; i<10; i++)
{

std::cout << "Enter marks : ";
std::cin >> marks[i];
}

}

private:
std::string courseName; // course name for this GradeBook

}; // end class GradeBook

>>
>>54330403
>Good luck emulate multiple entire mainframes in a runtime.
That doesn't sound remotely difficult.
>>
>>54330401
>Why doesn't this work?
i'm asking myself that question right now.
>>
>>54330401
Every thought to check compiler errors? Like holy shit, you decided to come here and post that without putting forth ANY effort on your own part?
>>
>>54330432
You are the worst trip on here BY FAR.
>>
>>54330430
These are the error messages.

Error messages:
||=== Build: Debug in COMP 3141 Module 6 (compiler: GNU GCC Compiler) ===|
\prog17.cpp||In function 'int main()':|
\prog17.cpp|9|error: no matching function for call to 'GradeBook::GradeBook()'|
\prog17.cpp|9|note: candidates are:|
\GradeBook.h|16|note: GradeBook::GradeBook(std::string)|
\GradeBook.h|16|note: candidate expects 1 argument, 0 provided|
\GradeBook.h|7|note: GradeBook::GradeBook(const GradeBook&)|
\GradeBook.h|7|note: candidate expects 1 argument, 0 provided|
\GradeBook.h|7|note: GradeBook::GradeBook(GradeBook&&)|
\GradeBook.h|7|note: candidate expects 1 argument, 0 provided|
\prog17.cpp|11|error: request for member 'getGrades' in 'myGradeBook', which is of pointer type 'GradeBook*' (maybe you meant to use '->' ?)|
\prog17.cpp|13|error: request for member 'marks' in 'myGradeBook', which is of pointer type 'GradeBook*' (maybe you meant to use '->' ?)|
\prog17.cpp|15|error: request for member 'marks' in 'myGradeBook', which is of pointer type 'GradeBook*' (maybe you meant to use '->' ?)|
\prog17.cpp|15|error: 'display' was not declared in this scope|
\prog17.cpp|22|error: variable or field 'sort' declared void|
prog17.cpp|22|error: 'myGradeBook' was not declared in this scope|
\prog17.cpp|28|error: variable or field 'display' declared void|
\prog17.cpp|28|error: 'myGradeBook' was not declared in this scope|
||=== Build failed: 9 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
>>
>>54330460
I'm always right though
>>
File: cdrMadness.png (38 KB, 512x340) Image search: [Google]
cdrMadness.png
38 KB, 512x340
>>54327009
your /dpt? messed up my regex search for dpt
>>
>>54330443
Stop being rude. I did read the compiler errors. Every time I changed stuff, I just got more errors.
>>
>>54330430
>>54330401
>
int marks[10];


>
std::chrono::system_clock::now();

>not using std::vector


Also try using the dereference operator on pointers next time.
>>
>>54330467
That's funny.

>>54330461
>>54330475
How about you should read the error messages then?
>>
>>54330533
I know right?
>>
File: 1459375543142.jpg (914 KB, 1200x1600) Image search: [Google]
1459375543142.jpg
914 KB, 1200x1600
I'm writing an implementation of Conway's Game of Life in Rust.
>>
>>54329784
yeah asio is quite complicated at first but simple once you figure it out, it took me like 2 days shuffling through examples and documentation until I actually understood how it works and managed to write a client
>>
How do I learn R and hadoop for data science if I know next to nothing about statistics?
>>
>>54330637
In Soviet Russia...
>>
>>54330691
you learn statistics

Idk why programmers don't know math. You don't even need to know the hard stuff, just up to linear and stats
>>
>>54330691
>how to put as many memes as possible in one sentence.jpg
>>
new to IRC
trying to use freenode in browser client
want to join java channel

keep getting:
##java Cannot join channel (+r) - you need to be identified with services

even though i registered email and all
>WTF?!
>>
>>54330841
>>>/reddit/
>>
>>54330860
fuck off,i was told in this very thread to use IRC, faggot
>>
>>54330637
pigeons are flying rats
>>
>>54330893
You're a land pigeon.
>>
>>54330430
comments are supposed to make the program easier to follow, not harder

>>54330401
on cursory examination:

Why
new GradeBook[1];
?
The parameters in the definitions of your functions should be (int* marks) or (int[] marks), not (myGradeBook.marks).

If you define the functions in the prog17.cpp, you need to add prototypes at the top, or else main can't see them.

add
void sort(int* marks);
void display(int* marks);

right before int main
>>
>>54330962
>The parameters in the definitions of your functions should be (int* marks) or (int[] marks), not (myGradeBook.marks).


If they're using int marks, then how do i get the data from the GradeBook class?

>If you define the functions in the prog17.cpp, you need to add prototypes at the top, or else main can't see them.

They were like that before, but I removed them because myGradeBook.marks wasn't declared yet.

How is the program going to know that marks is from myGradeBook?
>>
>>54330430
>>54330401
also, use a cleaner header:

 #ifndef HEADER
#define HEADER

#include <iostream>
#include <string>
#include <algorithm>
#include <string.h>
using namespace std;

...

#endif

and just #include "header.h" in each file. What you're doing now will be an absolute nightmare on larger projects.
>>
If you include “pls” in your request because it’s shorter than “please”, then expect to get told “no” because it’s shorter than “yes.”
>>
>>54331006
But "nope" is longer than "yup"???
>>
>>54330994
Because you're going to pass marks in as an argument when you call the function. The definition just defines what types of data are available for use; they don't care if the integer array comes from an object, from another int array in main, or from a static global constant integer array.

Also, since your GradeBook is dynamically allocated, you need to use myGradeBook->marks instead of .marks.

And delete it before you return 0. Your program leaks memory.
In int main:
>>
>>54330996
I'm no sepples fag, but even I know that
using namespace std;
, especially inside a header, is terrible practice.
Only include the things you're going to use in each file. There is no point in polluting your namespace.
>>
>>54331106
I just copied from his headers. Using namespace std; in everything is fine when that's the only namespace you're working in: there's no need to confuse beginners with what namespaces are and why they need to std::cout or std::string and not std::void or std::int[];
>>
>>54331148
>I can do this stuff in my sleep in Java
if they're so retarded that they get confused by namespaces they should just give up on programming
>>
File: pamela-anderson-01-660.jpg (85 KB, 660x495) Image search: [Google]
pamela-anderson-01-660.jpg
85 KB, 660x495
>>54331148
all those std references
>>
feel when you used all day to fix something and then completely forget what it was
>>
If a job application asks if I'm disabled (which I am) should I say so? I don't know if companies use those as social justice brownie points or if they use them to screen out "undesirables"
>>
File: 1424757359401.jpg (81 KB, 638x960) Image search: [Google]
1424757359401.jpg
81 KB, 638x960
>>54331214
Until like last year C++ was probably the most commonly-taught first programming language, and since even normie STEM majors take at least a year or so of it, they want to coddle them.

>>54331227
what's this mean
>>
>>54331255
if you said you weren't disabled and you show up, then they won't want you because you lied to them.
on the other side, what do you care if they use you for points, you'll get the job
>>
>>54331255
What kind of disabled?
>>
>>54331269
>>54331299

Aspergers. it's listed on every disability list and it's not immediately apparrent. In interviews I come off as a little awkward. I have the option to decline to answer or say no if I don't consider it a disability
>>
>>54331330
>don't consider it a disability
you're mentally disabled
>>
>>54331330
aspergers doesn't count, just say no, programmers tend to be awkward anyway doesn't matter if they have a diagnose or not
>>
>>54331330
no idea. If it was me then I'd not answer it. Job applications are often about highlighting your strengths and not so much your weaknesses. I'm guessing aspergers is not what they have in mind when they ask about disabilities.

>>54331341
He's not denying that anon.
>>
>>54331371
if it comes out later he could be in trouble or if he needs to take time off because of it
>>
>>54331341
>>54331371
Not him but it does "officially". So some companies may hire a normal disabled person that works instead of a potato that barely does. And still get governmint monies/less tax/not getting ass fucked deppending on what country he is.
>>
>>54331414
+1
>>
>>54331434
>>>/leddit/
>>
>>54331439
lurk moar
>>
>>54331405
It's a possible employer, not his health insurance.

They'll possibly be annoyed that you left it out, but they can't really fuck you over for it.
>>
Is it okay to be frequently issuing git reset --hard HEAD?
>>
>>54331446
>health insurance
? oh yeah, that's an american thing.
>>
>>54331341
Aspergers is an anomaly among mental disabilities in that many of its behaviors seem to be evolutionarily selected for, and in many situations its symptoms have highly beneficial sides to them, such as obsessive specialized interests, increased sensitivity to stimuli and overly logical thought processes

Some evolutionary psychologists believe that prehistoric aspies would have been the people horde food obsessively and work for days at turning a rock and a stick into a tool

>>54331371
it's on the list and some people consider it a boon for programming
>>
>>54331266
>what's this mean
STD = sexually transmitted disease
Pamela Anderson is famous slut and ex-wife of Tommy Lee who is a walking container of diseases
>>
>>54331466
are you saying anon is autistic?
>>
>>54331484
aspergers is an autism spectrum disorder

i think the latest DSM removed aspergers and equated it to high-functioning autism
>>
>>54331466
Evolutionary psychology is laughable. Go to /x/.
>>
>>54330430
Does this need a default constructor?
>>
>>54331503
so anon IS autistic
>>
>>54331504
laughable how?
>>
Guy's how do I start programming? I don't mind reading from a book but that's not really the issue.

Like where do you start? I can enter code and stuff all day long but I feel like there should be some sort of like process you should go through right?

Like in Math you don't just start off doing multiplication or algebra you have to start with counting then addition, subtraction, etc. so exactly where do you begin with programming and where are you supposed to to go?

I've been wanting to learn C# and have experience reading code (i learned some c++ from a book in high school) and I've been helping my friend design levels in unity recently but I'd like to just get into the language and be able to actually know what I want to do instead of just terribly understanding the syntax and copying from something else.
>>
>>54329813
>galois fields
>set theory
How can someone be so pretentious while obviously having no idea what they're talking about?
>>
>>54331567
pick a language and solve problems, that's the easiest way, books can teach you stuff but you'll forget it easily without using it
>>
File: CUxsRsdWUAAxmFP.jpg (48 KB, 599x668) Image search: [Google]
CUxsRsdWUAAxmFP.jpg
48 KB, 599x668
May be going a bit off topic here but I'm starting a 6 month internship at IBM tomorrow, any anons with experience that could give me some pointers as to what to expect?
>>
>>54331567
Just get a book on C#. It will teach you all you need to know to get started.
>>
>>54331466
>Some evolutionary psychologists believe
stopped reading there.
okay, i actually read the whole thing. but seriously, evolutionary psychologists literally make shit up. be more skeptical.
>>
>>54331592
>IBM
>what to expect
when the ship sinks, grab all the highend server shit you can and run!
>>
>>54331592
>any anons with experience that could give me some pointers
0x0FAC8EFA
0x0A93028C
>>
>>54331600
>be more skeptical.
He didn't say he believed it either.
>>
>>54329966
It's very old school yet sophisticated. The language is stack based and there are character limits for how limits your code (eg. a function definition) can be.

In a sense, if you write in Forth then you're kind of saying "fuck all of this new shit, the old ways are best".

That said, I recommend everyone read Thinking Forth. It's aimed at programming in Forth but the ideas apply pretty much everywhere.
>>
>>54327239
[email protected]
>>
>>54327684
Honestly yes. Not because it's necessarily "so hard" that a new programmer wouldn't be able to pick it up, but that you'd have no sense of what you can or ought to do in a programming language, and C++ will leave you with a whole bunch of poorly implemented features that it has crammed together which you won't have the experience to evaluate or judge for what they are.

That's why I'd recommend starting with something else first.
>>
>Heap implementation via linked-list
How the fuck am I supposed to do this?
>>
>>54331658
Ah, that makes sense.

What about Factor being a jedi, then?
>>
>>54331595

What's considered the best C# book out there? I have the gentooman library but I'm sure there's newer editions out now that are better?
>>
>>54328029
Implying it's more practical than D.
>>
>>54331720
It really depends. There seems to be plenty of good ones.

This seems like a good one for beginners: https://www.amazon.co.uk/C-Players-Guide-2nd/dp/0985580127/ref=sr_1_1?ie=UTF8&qid=1462148794&sr=8-1&keywords=C%23
>>
>>54331592

IBM where in Columbus?
>>
>>54331051
Okay, I rewrote the program, and it compiles now, but it's printing garbage. I entered the numbers 1 through 10, and it's printing huge negative and positive numbers along with 0.

output:
Enter marks : 1
Enter marks : 2
Enter marks : 3
Enter marks : 4
Enter marks : 5
Enter marks : 6
Enter marks : 7
Enter marks : 8
Enter marks : 9
Enter marks : 10
Displaying marks in Ascending Order
-905122650
0
4199072
4199072
4201088
6422240
6422296
6422476
1996649322
1996673520
Press any key to continue . . .


prog17.cpp:
#include <iostream>
#include <algorithm>
#include<string.h>
#include "GradeBook.h"
using namespace std;

void sort(int marks[10]);
void display(int marks[10]);

int main()
{
int marks[10];

GradeBook *myGradeBook;

myGradeBook = new GradeBook("Course");

myGradeBook->marks;

myGradeBook->getGrades();

sort(marks);

display(marks);

system("PAUSE");

delete myGradeBook;

return 0;
}

void sort(int marks[10])
{
// function display has been created for you.
// Create the function sort to sort the marks in ascending order
sort(marks, marks + 10);
}
void display(int marks[10])
{

cout <<"Displaying marks in Ascending Order " << endl;

for (int i = 0; i <10; ++i)
{
cout<< marks[i] << " " <<endl;

}

}


The header is the same.
>>
>>54331697
>C++
>poorly implemented features

such as?
>>
>>54331538
In being telltales desguised as science. It cannot be proved or falsified and serving no purpose other than attracting mediatic attention or popular "science" bullshit.
>>
>>54331766
Does it claim to be anything else? Seems to be an interesting way to reason if aspergers is purely a defect, or if it is some natural part of being human. Obviously not hard science, but in absence of better understanding of some of these conditions, it sounds like interesting stuff.
>>
>>54331721
(You)
>>
>>54331702
Flatten the tree. Each level has a predefined number of nodes on it (it doubles), so you can easily find the index of children of some node with i += 2*n and i += 2*n+1. You should probably start paying attention in class.
>>
Can't wait for mozilla to die so that rust can finally be coc-free.
>>
>>54331754
marks[10] is a single, out of bounds, element. You passed it an integer instead of an int array. It should be:

void display(int marks[]);
not
void display(int marks[10]);
In the definitions of both functions.
When you call the function, you need to pass the array. The array can be found at myGradeBook->marks

so when you call sort and display, give them the argument:

sort(myGradeBook->marks);
>>
>>54331852
>telling me to use index values when I'm using a linked list
Do you misread the question?
>>
>>54331816
>Does it claim to be anything else?
Yes. And there lies the problem. It's the same thing as using astrology for something diferent than entertainment. I could say that pre-historic aspies where shit-eating little bitches used as cumdumpsters by others of their tribes, now what? The same arguments have equal values as they have no proof or reasoning.
>>
>>54331456

Ask yourself why you are frequently doing this. You are probably doing something wrong.
>>
>>54331852
>>54331884
*Did you
And I understand what a heap is just fine. I just don't understand how I'm to implement it with a linked list, which according to very limited information concerning this implementation that I've found online, involves excessive complexities and defeats the purpose of the Heap itself.
>>
>>54331702
Linked list with pointers to two children.
>>
>>54331863
Okay that worked. Thanks.
>>
>>54331905
I know that much myself. I already wrote the node class.

Certain cases in which I'd have to traverse the Heap are confusing me, though. Like, suppose I'm at the end of a level. I'm confused as to how I'd traverse to next available node position on the opposite side of the tree, bottom level, in a single recursive statement.
>>
>>54331884
No. You can index a list. It has an order. Yes it's inefficient. Most non-retarded profs would have you do it with an array.

I can think of some other ways to make it with a linked list, but they are all retarded when you can just use an array.
>>
>>54331964
maybe you can record movements into a bool vector, write a function to traverse from the start in opposite movements until it hits a nullptr
>>
>>54331899
>It's the same thing as using astrology
hardly. It is a science. Simply a weak one. Hardly much weaker than psychology or sociology in general. Not every science get's to be as testable as math and physics.

>I could say that pre-historic aspies where shit-eating little bitches used as cumdumpsters by others of their tribes, now what?
Now that theory gets peer reviews. What evidence is there to support it based on what we know about prehistoric humans. Could it of happened? If it did what other things would we expect to see in modern humans as a result. Would we expect to see less aspies in certain races? If so, why? Might there be a measurable gene we might be able to find that relates to aspergers? What might its nature be?

Obviously this stuff is very difficult to test, but that's the nature of some of these very weak science fields.

It's not like astrology at all which is not at all a science because it is trivially disprovable as a fundamental concept. The idea that the evolutionary path that humans took might inform the psychological profile of many modern humans is a sound concept. Simply because it is difficult to find supporting evidence for these theories does not stop it from being a science.
>>
>>54331905
>Linked list with pointers to two children.
A tree...?
>>
>>54331966
I suppose you're right. So in addition to the key value, I give it an index value and treat it like a much less efficient arraylist?

I'm pretty sure she's only making us implement it with a linked list because of the added difficulty.

>>54332003
I suppose that could work to...
>>
>>54332036
A heap...?
>>
>>54332011
Fuck off to /x/ namefag. Your theory is either falsifiable or not. Debating the semantic value adds nothing to the nothingness of Evolutionary Psychology. This is not the place for this just as /lit/ is no place for ayn rand.
>>
>another tripfag
oh yay
>>
>>54332068
>Your theory is either falsifiable or not
I agree. And claiming:
>>I could say that pre-historic aspies where shit-eating little bitches used as cumdumpsters by others of their tribes
is a falsifiable theory.
>>
>>54332060
A heap is a special binary tree. Prof said linked list.

>>54332047
>So in addition to the key value, I give it an index value and treat it like a much less efficient arraylist?
I'm assuming this is Java? The LL class has an index method. If you are implementing your own LL just count the nodes as you go through them. Otherwise you'd have to update all the indexes every insert.
>>
>>54332096
>he does not only can detect the nuances through time and history of homosexual pre-historic bdsm but can prove it never existed
>>
>>54332149
>he does not only can detect
>>
>>54332117
Then don't bother, because you can't emulate a heap with your definition of a linked list
>>
>>54332170
>english
>>
>>54331759
On a basic level C++ has problems such as:

- Poorly defined grammar. Meaning it takes ages to compile because of the need to resolve potential ambiguities and it's difficult to make tools for it compared to C, C#, Java etc.
- Safety features which require you to add a whole chain of more features to get them to work, each of which only adds complexity, makes the program more difficult to reason about and ultimately offers no 'right' way of doing things that isn't atrociously complex.
http://yosefk.com/c++fqa/defective.html
This gives an overview of some of the issues that C++ will likely present you. Keep in mind that the most up to date version of the language has additional features that solve a subset of these, but the biggest problems are fundamental to it and cannot be fixed.
Thread replies: 255
Thread images: 21

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.