420chan now has a web-based IRC client available, right here
Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the float Name#Password
A subject is required when posting a new thread
Subject
Comment
[*]Italic Text[/*]
[**]Bold Text[/**]
[~]Taimapedia Article[/~]
[%]Spoiler Text[/%]
>Highlight/Quote Text
[pre]Preformatted & Monospace text[/pre]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


Community Updates

420chan now supports HTTPS! If you find any issues, you may report them in this thread
Learning post code academy by Archie Craffingback - Wed, 11 Jan 2017 20:20:36 EST ID:AtsFlC7n No.36450 Ignore Report Reply Quick Reply
File: 1484184036841.jpg -(2518328B / 2.40MB, 2240x1604) Thumbnail displayed, click image for full size. 2518328
Looking for something to do after code academy

Can't find anything.

I just finished the lessons of Javascript, Python. Should I learn another before moving on?

what do I move onto?

Thanks,
7 posts and 1 images omitted. Click Reply to view.
>>
Simon Greenville - Thu, 19 Jan 2017 00:04:41 EST ID:W/zS63TD No.36473 Ignore Report Quick Reply
>>36468
I think it'd be better to learn the more modern problem solving methods, then only after that, maybe learn C to understand how it's happening behind the scenes.
>>
Fucking Suzzlebanks - Fri, 20 Jan 2017 03:44:22 EST ID:AtsFlC7n No.36475 Ignore Report Quick Reply
>>36467
besides algorithmic theory, Ive done a good part of that already

I like the delve into whatever

every CS person loves helping me, its neat
>>
Fucking Suzzlebanks - Fri, 20 Jan 2017 03:45:45 EST ID:AtsFlC7n No.36476 Ignore Report Quick Reply
>>36468
I enjoy it because its like a puzzle
and its more engaging than doing suduko everyday

I am replacing physical puzzles with this because its a skill that may or may not make me feel less lame for wearing two nintendo powergloves while blasting new wave retro wearing ray bans
>>
Charlotte Crullerfuck - Sat, 21 Jan 2017 14:42:03 EST ID:sGFR0zid No.36479 Ignore Report Quick Reply
>>36475

If your goal is just to challenge yourself, and you want to explore algorithms, I really recommend codingame.com . There is a large set of challenges that range from straightforward to extremely difficult, and there are also open-ended challenges like designing AIs to beat other AIs in races. And then every few months they have online hackathon type events.
>>
Henry Clibblehall - Mon, 23 Jan 2017 19:44:33 EST ID:AtsFlC7n No.36480 Ignore Report Quick Reply
>>36479
that sounds fun, thanks


silly java question by Nicholas Pondleman - Wed, 18 Jan 2017 04:54:58 EST ID:zKC23xNi No.36465 Ignore Report Reply Quick Reply
File: 1484733298660.jpg -(83487B / 81.53KB, 480x600) Thumbnail displayed, click image for full size. 83487
Hi sorry if the question may sound dumb but i must do a for each in a class, with an arraylist which is placed in another class and i am unable to do that because it seems that arraylists are visible only in their class and if i do a get method i can't do the for each
thanks in advance
2 posts omitted. Click Reply to view.
>>
Esther Brookham - Wed, 18 Jan 2017 12:09:00 EST ID:sGFR0zid No.36470 Ignore Report Quick Reply
>>36469

Note this is a horrible practice but if you want direct access to the instance variables from different classes (not subclasses) you only get it with public access modifiers.
>>
Shit Maffingteck - Wed, 18 Jan 2017 16:45:54 EST ID:9QSfnS0r No.36471 Ignore Report Quick Reply
>>36470
This entirely depends on preference and/or the language you're programming in.
If it's necessary to observe some state of your object that can not be changed in the same manner it's fine imho.
>>
Shit Maffingteck - Wed, 18 Jan 2017 16:56:18 EST ID:9QSfnS0r No.36472 Ignore Report Quick Reply
>>36471
s/can not be changed/can be changed/
>>
Charles Blazzlekotch - Thu, 19 Jan 2017 17:10:57 EST ID:VE+xmvqo No.36474 Ignore Report Quick Reply
>>36472
You type like a fag and your shit's all unix.
>>
Charlotte Crullerfuck - Sat, 21 Jan 2017 14:38:35 EST ID:sGFR0zid No.36478 Ignore Report Quick Reply
>>36471

This is a Java thread, we're only talking about Java.


Help me with Java by Albert Focklewill - Wed, 11 Jan 2017 08:49:00 EST ID:VyheDnFA No.36448 Ignore Report Reply Quick Reply
File: 1484142540583.jpg -(14021B / 13.69KB, 259x194) Thumbnail displayed, click image for full size. 14021
I must learn java and i study it since october but i really didn't understand much
i have some skills with assembly (IJVM) and C but i find Java really hard
do you have any tips or books to suggest me?
>>
Hedda Dundlepan - Wed, 11 Jan 2017 14:45:20 EST ID:sGFR0zid No.36449 Ignore Report Quick Reply
If you want an "intro to programming book that is also a good introduction to Java" you could try "Java: An Introduction to Problem Solving and Programming," which was not bad except for the dozens of weird typos my copy had. If you want a "I am already decent at programming and I want something that talks to me at my level" book, I'd suggest "Core Java."
>>
Lydia Blythebanks - Sat, 21 Jan 2017 11:36:47 EST ID:QFj3NJQM No.36477 Ignore Report Quick Reply
>>36448
Create an Android app, doesn't matter if idea exists already. I recommend gang of four design patterns book.


Data Visualization Project by Hedda Socklelutch - Mon, 16 Jan 2017 16:41:51 EST ID:RzCYRoD4 No.36458 Ignore Report Reply Quick Reply
File: 1484602911804.png -(244522B / 238.79KB, 789x477) Thumbnail displayed, click image for full size. 244522
I'm interested in doing a small data visualization project in python, processing, R or whatever for a local hackathon that's coming up in 2 months.

I've taken a bunch of 'introductory' courses in programming (nothing past data structures) in c++, python syntax and fucked around with an arduino a bunch in the past, but other than that i do not have a CS background though i'm not terrible at math. i want to enter this hackathon to gain more exposure to development, hopefully contribute to something cool, and have fun

what can I do in 2 months to prepare, so I don't show up and just sit there and not have anything meaningful to contribute? what should i practice?
>>
Simon Blackstock - Mon, 16 Jan 2017 17:54:06 EST ID:9QSfnS0r No.36459 Ignore Report Quick Reply
  • Processing is better to get stuff on the screen fast, batteries included.
  • Python has the best easy to learn libraries: numpy, scipy, pandas, etc..
use Anaconda if you don't know what to install, there is also pygame if you want to get to the level you get with processing but that is quirky.
  • You could also use javascript and three.js

  • If you want to do something innovative write your own OpenGL fragment shaders for everything related to displaying stuff.
>>
Lydia Povingwell - Mon, 16 Jan 2017 21:16:56 EST ID:j4Mgcfd3 No.36460 Ignore Report Quick Reply
It's hard to advise if you don't have a clear idea of what you'll be doing, but forget the visualization part for a minute. Make sure you can do the basics like ingesting and munging data.
>>
Polly Fonnerridge - Tue, 17 Jan 2017 02:06:30 EST ID:XSh2pMMH No.36462 Ignore Report Quick Reply
Try TouchDesigner. It's node-based but you can run python scripts. It's super fun
>>
Frederick Nondershaw - Tue, 17 Jan 2017 14:42:28 EST ID:9QSfnS0r No.36463 Ignore Report Quick Reply
>>36460
>Make sure you can do the basics like ingesting and munging data.
ie learn numpy, python list-comprehensions (and dict- & generator-)

What you can also do if you decide to use python do the data mangling in python and use something like flask to create a cheap webservice for the visualization part that you can do in javascript & three.js

However if you aren't as familiar with python, let alone javascript just do everything in C++. The point of hackatrons is using the language you already familiar with not learn a new one imho.


Some sort of virus by Clara Clayshit - Fri, 18 Mar 2016 15:59:37 EST ID:kvn5FzQz No.35325 Ignore Report Reply Quick Reply
File: 1458331177571.png -(5015B / 4.90KB, 418x66) Thumbnail displayed, click image for full size. 5015
I need this program away entirely.
>>
Hamilton Dommlesuck - Fri, 13 Jan 2017 21:23:37 EST ID:EeZuEFCh No.36452 Ignore Report Quick Reply
>>35325
lmao its just freeware
>>
Cedric Grimcocke - Sat, 14 Jan 2017 00:23:26 EST ID:YL0YFsWq No.36453 Ignore Report Quick Reply
>>35325
Do you use QQ?
You can stop the service from running services.msc and set it to manual only, then find a way to delete it.
>>
Nell Darthood - Sat, 14 Jan 2017 01:56:36 EST ID:cpPd0VLJ No.36454 Ignore Report Quick Reply
>>35325
It looks like a Chinese program. What makes you think it's a virus?
>>
Esther Shakeworth - Sat, 14 Jan 2017 21:24:20 EST ID:4edaUUL5 No.36456 Ignore Report Quick Reply
It looks like you need to format your drive and install a Linux distribution.


Storing lists as the factorized form of single numbers by Sophie Navingmag - Wed, 04 Jan 2017 17:30:26 EST ID:zu3jfUuo No.36440 Ignore Report Reply Quick Reply
File: 1483569026042.png -(30588B / 29.87KB, 317x332) Thumbnail displayed, click image for full size. 30588
I was dealing with a SQL database earlier today and I was frustrated because I couldn't make a column hold a list of values in every possible row. I ended up just doing one-hot encoding (and adding 20 columns full of sparse binary data in the process) but I had a thought: what if you use all prime numbers as index values, then simply multiply them together to produce a single BIGINT value. Then, when retrieving data from the database, you simply factorize the value and the prime numbers it yields will tell you what members of the list are present in that row's entry. Like:

userID | movelist
1 -------| 1914

When I want to retrieve the move list for user 1, I'd just:
>SELECT movelist FROM db WHERE userID 1;
which yields 1914. Then I take this number and factorize it yielding [2, 3, 11, 29]. My movelist table looks like this:

index | move
2 ------| jump
3 ------| punch
5 ------| kick
7 ------| eat
11 ----| slash
Comment too long. Click here to view the full text.
1 posts omitted. Click Reply to view.
>>
Molly Woblingwill - Wed, 04 Jan 2017 20:22:12 EST ID:ztur2YT8 No.36442 Ignore Report Quick Reply
I agree that your solution sounds somewhat similar to bit-fields. Additionally, factoring (expensive) long composite numbers at lookup-time is much, much slower than the special-case of bit-fields (which basically uses powers of 2 from OEIS A000079 instead of prime numbers from OEIS A000040) where you can use simple bit-shifts, ANDs, and ORs to quickly test up to 64 bits in one CPU clock-cycle versus expensive loops and division operations for factorization.
>>
Archie Bubblegold - Thu, 05 Jan 2017 11:02:58 EST ID:zu3jfUuo No.36443 Ignore Report Quick Reply
1483632178501.jpg -(115916B / 113.20KB, 391x608) Thumbnail displayed, click image for full size.
>>36441
Lol I see. That makes a lot more sense to use.

I dub my invention "Cool Guy Database Compression" (CGDC)
>>
Edward Blommlefedge - Thu, 05 Jan 2017 22:03:09 EST ID:ztur2YT8 No.36444 Ignore Report Quick Reply
>>36443
That's a pretty awesome name.
>>
Oliver Fandock - Tue, 10 Jan 2017 11:04:16 EST ID:9QSfnS0r No.36446 Ignore Report Quick Reply
Using prime factorization this way is borderline retarded.

Srsly use bitfields.
1 ------| jump
2 ------| punch
4 ------| kick
8 ------| eat
16 ----| slash
32 ----| talk
64 ----| scream
128 ----| cry
256 ----| crush
512 ----| fly

People back in the day would have hit you over the head for that, now cpu cycles are cheap, but not that cheap.
Comment too long. Click here to view the full text.
>>
Oliver Fandock - Tue, 10 Jan 2017 11:11:11 EST ID:9QSfnS0r No.36447 Ignore Report Quick Reply
Also your method won't save any space versus bitfields because of the pigeonhole principle.


free video editors by Primus Mud - Sat, 26 Mar 2016 10:37:10 EST ID:6MSbhuhv No.35385 Ignore Report Reply Quick Reply
File: 1459003030988.gif -(2772899B / 2.64MB, 500x281) Thumbnail displayed, click image for full size. 2772899
can you suggest a good free video-editing software
(thats not too full of itself like Vegas or Adobe)
for Windows?
4 posts and 1 images omitted. Click Reply to view.
>>
George Hupperfoot - Tue, 29 Mar 2016 17:16:44 EST ID:UiZwZAHx No.35427 Ignore Report Quick Reply
It's not widely used for this purpose, but Blender is the only open source cross-platform video editing software that's worth a damn.
>>
Esther Crindleridge - Wed, 06 Apr 2016 18:52:40 EST ID:EK8FLl12 No.35441 Ignore Report Quick Reply
>>35385
Just torrent Adobe premiere and watch like 10 minutes of tutorials.
>>
Hollunder Velvetglie - Sun, 10 Apr 2016 13:08:23 EST ID:ZGfcy/cU No.35457 Ignore Report Quick Reply
1460308103380.png -(883500B / 862.79KB, 1600x900) Thumbnail displayed, click image for full size.
>>35405
try Hitfilm.
It's free and can do everything the big ones can.
Runs much faster in my experience
and has even 3D-effects and every little plaything you'll need for prefessional editing.

But you'll have to register to get a free key.

(Key will be provided to your hitfilm-account. Just so you don't go insane like I did, while trying to unlock it!)
>>
Henry Pittbanks - Sat, 07 May 2016 17:13:13 EST ID:UGUCRnOo No.35576 Ignore Report Quick Reply
>>35427
>
>It's not widely used for this purpose, but Blender is the only open source cross-platform video editing software that's worth a damn.
>

Seconding this. Linux user here, I used to use Kdenlive, eventually got mighty sick of it crashing. Blender is rock solid.
>>
Fermented Sodapops - Sun, 08 Jan 2017 09:02:54 EST ID:YoqtmZw1 No.36445 Ignore Report Quick Reply
1483884174446.jpg -(170616B / 166.62KB, 1920x1080) Thumbnail displayed, click image for full size.
>>35457
best idea!

Makes me wonder why schools and univerities in this area keep wasting their money
on Vegas, Corel and other expensive and clunky crap!

Only thing that REALLY pisses me off about HF is the terrible way Hitfilm uses Slow-Mo-Effects!


Scrape a Web Page Help by Matilda Sommletore - Sun, 25 Dec 2016 21:54:57 EST ID:W/zS63TD No.36409 Ignore Report Reply Quick Reply
File: 1482720897775.jpg -(15813B / 15.44KB, 365x137) Thumbnail displayed, click image for full size. 15813
Okay I don't care how inefficient the solution is, but my situation is complicated because here is my page:
https://www.numbeo.com/cost-of-living/rankings_current.jsp

And you type a city into that search bar, and assuming you type something that matches exactly their entry -> you hit enter -> it takes you to a different URL page.

So if it was simple, I would just do it by url, but now I need to actually simulate typing and hitting enter, as well as handing that url direct
8 posts omitted. Click Reply to view.
>>
Fuck Nicklelock - Fri, 30 Dec 2016 03:14:26 EST ID:F+scHBch No.36433 Ignore Report Quick Reply
>>36429
id rather yahoo answers before I resort to indian youtube tuts
>>
Basil Grimbanks - Sat, 31 Dec 2016 01:19:53 EST ID:yjl33h3f No.36434 Ignore Report Quick Reply
>>36426
it's json. you can use most any language to convert it to an associative array.
>>
Phineas Crabbleforth - Sat, 31 Dec 2016 14:20:20 EST ID:tZM6suYH No.36435 Ignore Report Quick Reply
>>36433
While you're being a stuck up cunt, why don't your greasy edgelord fingers and crack open a fucking book?
>>
Phineas Crabbleforth - Sat, 31 Dec 2016 14:20:51 EST ID:tZM6suYH No.36436 Ignore Report Quick Reply
>>36435
*you use
>>
Thomas Fanville - Mon, 02 Jan 2017 12:10:40 EST ID:tMBsUfyx No.36439 Ignore Report Quick Reply
>>36433
>implying that's what you get if you search it on youtube


software engineers by Ian Fonningfield - Mon, 31 Aug 2015 21:30:52 EST ID:L/We2WuN No.34527 Ignore Report Reply Quick Reply
File: 1441071052066.jpg -(51758B / 50.54KB, 960x774) Thumbnail displayed, click image for full size. 51758
is anyone hear a software engineer or studying it? im starting collage and am think about studying it because of the high pay. an i have some questions.

>what skills do you need
>what was the biggest surprise about your work, something you did not expect.
>how are bonuses earned
>whats the shittest part about your job.
>what do you do day by day, like whats your day at work look like.
32 posts and 5 images omitted. Click Reply to view.
>>
Shitting Gudgecocke - Fri, 15 Apr 2016 02:24:02 EST ID:oZPR2pbJ No.35490 Ignore Report Quick Reply
>>35489
>You mean type errors?
I'm not sure you understood what I said... but, basically, I mean I'd rather have a compile-time error (Type errors are (usually) one such error of this kind.) than a run-time error. I'm not saying that it's a silver bullet, but only that it's better than what it came before it.

>I'm convinced that persistent programming problems are intractable.
I hope that you don't think that confusing feet with meters is an intractable problem.
>>
Frederick Peblingbutch - Wed, 23 Nov 2016 15:12:27 EST ID:QFj3NJQM No.36310 Ignore Report Quick Reply
shittiest part is the fucking meetings

fun part is not finding a solution from stackoverflow or github and building it yourself
>>
Eugene Sickleridge - Mon, 28 Nov 2016 15:56:10 EST ID:o7NpBz5X No.36336 Ignore Report Quick Reply
>>35486
So I'm kind of surprised to see someone trying to sell functional programming on here. Maybe you just haven't been around much yet, but "software people" do not want to use a functional programming language. Yes it would make them better programmers for learning it and would solve (or allow the automated solution of) many of their problems, but there is not an ice cube's chance in hell that anything other than Java, Microsoft's languages, C++, and other related atrocities will be used in the vast majority of applications. The reasons for this are social and political. Is it terrible that formal program verification is not being used on vehicles and in implants where program failure could cost human lives? Yes, but you would be better off not wasting your own life in trying to save all those lives lost to memory leaks.

There are limited real-world uses of functional languages in finance and in academia they are much more prevalent. Mathematicians and computer scientists do that stuff all the time. I do use Python for a lot of things myself, so I'm not a total fanatic when it comes to functional programming, but even Python would be an improvement over the state of things in commercial software development right now.
>>
Samuel Dadgenine - Sun, 01 Jan 2017 16:56:09 EST ID:e7bTcYy7 No.36437 Ignore Report Quick Reply
>>36336
Idk man, Scala hits a nice sweet spot for a functional language in a production environment because its compatible with existing java libraries. My employer switched to it a long years ago.
>>
Matilda Hassleham - Sun, 01 Jan 2017 18:55:03 EST ID:D7/rI9fU No.36438 Ignore Report Quick Reply
>>36437
Yeah but you still have to touch Java and are therefore living in sin.


where to start? by Edward Hepperforth - Tue, 15 Nov 2016 21:01:50 EST ID:fItQgQqz No.36297 Ignore Report Reply Quick Reply
File: 1479261710490.jpg -(32631B / 31.87KB, 447x456) Thumbnail displayed, click image for full size. 32631
i have no experience with programming besides basic ugly HTML and would really like to get deep into it (not for career purposes, just curious) and was wondering what are good resources that you used/wish you had when you started? i'm really really trying to grasp this stuff but i feel like it keeps slipping right though my fingers
10 posts and 1 images omitted. Click Reply to view.
>>
Shit Benderspear - Sat, 24 Dec 2016 18:59:01 EST ID:9QSfnS0r No.36406 Ignore Report Quick Reply
>>36404

Look the meme programmer is back this isn't the old textboard /prog/, which is still around, so join your fellow outlaws from the future.
>>
Fanny Clongerstock - Sun, 25 Dec 2016 08:02:41 EST ID:nBZoNZP6 No.36407 Ignore Report Quick Reply
>>36404
Implying you even did any of this you scrub.
lisp is a meme, fuck functional programming
>>
George Fiblingchut - Mon, 26 Dec 2016 03:50:03 EST ID:mfkLzG/S No.36412 Ignore Report Quick Reply
>>36407
>a meme

There are 2 languages.

Fortran based and LISP based.

If you learn one of them you know them all, Clojure, Java, C, Haskell, guess which lang they are from?
>>
Charlotte Hundlewell - Wed, 28 Dec 2016 11:43:57 EST ID:FNUGTkco No.36418 Ignore Report Quick Reply
1482943437588.jpg -(60780B / 59.36KB, 529x529) Thumbnail displayed, click image for full size.
>>36412

Scotty, give me maximum pretentiousness.
>>
Henry Pickspear - Thu, 29 Dec 2016 20:39:18 EST ID:29ygicdt No.36432 Ignore Report Quick Reply
>>36307

was expecting you to say "practice", made me lol


Makefile problem by Hannah Drummlewill - Wed, 28 Dec 2016 13:47:24 EST ID:677AANqx No.36419 Ignore Report Reply Quick Reply
File: 1482950844378.png -(5817B / 5.68KB, 225x225) Thumbnail displayed, click image for full size. 5817
Hello,
I`ve been trying to make a project on unix, but yesterday I ran to a problem I just simply cannot solve.
I work on windows mostly and am Makefile noob.

I have everything installed up. But makefile yields: ".lib/arduino.a" no file or directory.
I figured out it must be some logical mistake in makefile; that it wants arduino.a before it is compiled.

Could anyone help me out?

Makefile: http://pastebin.com/QNGT1XNm
Readme: http://pastebin.com/ZtEA3SqW
Directory structure: http://pastebin.com/JLe8XNRB
5 posts omitted. Click Reply to view.
>>
Hannah Drummlewill - Wed, 28 Dec 2016 15:53:02 EST ID:677AANqx No.36425 Ignore Report Quick Reply
Guys that`s it I guess.

.lib/arduino is not valid unix path, as far as I know.

I changed it to "lib/arduino" and it got further. I still get error, but different one.

Thank you very much for your help.
>>
Hannah Drummlewill - Wed, 28 Dec 2016 16:16:04 EST ID:677AANqx No.36427 Ignore Report Quick Reply
Ok, it seems I`m wrong anyway.

I left only arduino build section and tried to make:
lib/arduino.a:
make: lib/arduino.a:: No such file or directory
make: *** [all] Error 1

What is the reason?
  1. The build needs aduino.a but they did`t send me the file with the rest of the project.
  2. The makefile includes BUILDING the static library "arduino.a" but it is not able to build it because I do something wrong.

Is there any possibility it caused by the reason no. 2?
>>
Molly Casslelock - Wed, 28 Dec 2016 16:52:35 EST ID:kEUrK4GZ No.36428 Ignore Report Quick Reply
>>36427
If you read through the makefile and did everything you were told to do, one likely possibility is that you're using the wrong version of something. The makefile is copyrighted 2013, so look into that.
>>
Thomas Greenhood - Wed, 28 Dec 2016 19:10:25 EST ID:9QSfnS0r No.36430 Ignore Report Quick Reply
If you are tired of writing your Makefile by hand try out platformio.
It creates project files based on imported libraries via a few command line commands.
>>
Nathaniel Dradgework - Thu, 29 Dec 2016 14:21:32 EST ID:sGFR0zid No.36431 Ignore Report Quick Reply
1483039292221.jpg -(166021B / 162.13KB, 1332x1776) Thumbnail displayed, click image for full size.
>>36425

>I changed it to "lib/arduino" and it got further. I still get error, but different one.

tfw PROGRESS :)


c++ by Dont hack meh - Thu, 22 Dec 2016 14:24:32 EST ID:Jf4pElwU No.36392 Ignore Report Reply Quick Reply
File: 1482434672770.jpg -(6913B / 6.75KB, 182x251) Thumbnail displayed, click image for full size. 6913
Anyone that can explain how to return the value after the change?

#include<iostream>
#include<conio.h>
#include<algorithm>
using namespace std;
class Pyre
{
public:
float width;
float depth;
float height;

float change(float, float);
};
Comment too long. Click here to view the full text.
7 posts omitted. Click Reply to view.
>>
Trustred - Fri, 23 Dec 2016 04:01:29 EST ID:Jf4pElwU No.36400 Ignore Report Quick Reply
>>36399

what can i use instead of swap then if i need to change the base (50,50) with the height (100) with just calling one method. the base still needs to be a square after the switch and only one called method is allowed.
>>
Trustred - Fri, 23 Dec 2016 04:57:58 EST ID:Jf4pElwU No.36401 Ignore Report Quick Reply
>>36399

thx alot!

i ended up doing this

Pyramid Pyramid::change(float &side1, float &side2)
{
side1 = side2;
return *this;
}

and called three times

pyr.change(pyr.depth, pyr.height);
Comment too long. Click here to view the full text.
>>
Hannah Soblingwater - Fri, 23 Dec 2016 10:47:44 EST ID:9QSfnS0r No.36402 Ignore Report Quick Reply
>>36401
If you just use assignment instead of std::swap you'll override the left hand side but leave the right hand side as it is.
Be aware that using Pyramid Pyramid::change(float &side1, float &side2)
will just use the memory location of whatever you pass into that function, even it doesn't belong to the current instance of Pyramid.
This defeats the purpose of making it a method.

you could as well use
pyr.depth = pyr.height;
pyr.height = pyr.width;
pyr.width = pyr.depth;

for the same result.


>>36400
Comment too long. Click here to view the full text.
>>
Hannah Soblingwater - Fri, 23 Dec 2016 10:54:35 EST ID:9QSfnS0r No.36403 Ignore Report Quick Reply
it should be

float Pyramid::constantAreaSide() {
return (float)pow(Pyramid().baseArea(), 0.5);
}
>>
Archie Duckbanks - Sun, 25 Dec 2016 19:24:22 EST ID:9QSfnS0r No.36408 Ignore Report Quick Reply
Check out these youtube playlists:
https://www.youtube.com/user/1kingja/playlists?shelf_id=6&view=50&sort=dd

Most channels related to c++ are highly autistic and that guy actually is watchable, highly recommend it. It doesn't cover everything you have to learn but it explains the whole brain-cancer inducing stuff c++ exhibits in a digestible way.


Pages Next>>
0 1 2 3 4 5 6 7 8 9 10 11
Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.