420chan now has a web-based IRC client available, right here
Leave these fields empty (spam trap):
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
[*]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


Community Updates

420chan now supports HTTPS! If you find any issues, you may report them in this thread
Returning a String Java by Phyllis Clinnershit - Mon, 15 Feb 2016 01:01:23 EST ID:9GNL65xE No.35160 Ignore Report Reply Quick Reply
File: 1455516083471.jpg -(33118B / 32.34KB, 300x300) Thumbnail displayed, click image for full size. 33118
I have a class called Model, which has one enter in data for a particular model.
I want a method that takes height in inches and converts it into feet and inches using a static instance variable and then returning it as a String. The instruction state to return it as a string.

class Model
//instance variables
private int height;
public static final int IN_PER_FOOT = 12;

public int getHeight(){
return height;

public void setHeight(int modelHeight){
height = modelHeight
Comment too long. Click here to view the full text.
Cyril Driggleket - Mon, 15 Feb 2016 17:27:07 EST ID:FZqsCuoJ No.35171 Ignore Report Quick Reply
Why is your code obviously incorrect?
Because your method doesn't take in height as inches?
Walter Hedgenod - Wed, 04 May 2016 10:51:19 EST ID:TBTemjoO No.35551 Ignore Report Quick Reply
You are missing a " on the end of the line

String feetAndInches = feet + "feet" + inches + "inches;
Stphan Floffingbridge - Fri, 06 May 2016 08:43:49 EST ID:SWJfiJ9j No.35566 Ignore Report Quick Reply
Cyril is correct, however you should also get into the habit of cleaning up your code. Instead of declaring a new String try:

return String feetAndInches = feet + " feet " + inches + " inches ";

It's also never too early to get in the habit of handling data in strings properly. Your method works for a display method but outside of software-dev 101 you'll want to do this:

return "feet="+feet+",inches="+inches;
This will allow you to easily process the data OR use it in a display method, i.e:

public void displayFeetInches(){
String data = convertHeightToFeetAndInches();
for(String line : data.split(",")){
Comment too long. Click here to view the full text.
Reuben Brookstock - Sat, 07 May 2016 11:41:52 EST ID:9QSfnS0r No.35568 Ignore Report Quick Reply
>return "feet="+feet+",inches="+inches;
> This results in your desired output but increases cohesiveness while reducing coupling.
lol no quite the opposite there is no coupling when dealing with local variables and it's way more useful to be able to change the return value of a function.

SOLID is a bad idea even for a mature software developer but of a bloody newbie it's probably the one thing that can lead to discouragement at this stage.
Stphan Floffingbridge - Sat, 07 May 2016 20:39:12 EST ID:SWJfiJ9j No.35577 Ignore Report Quick Reply
Yes, you are absolutely correct... There are certainly multiple ways to handle this.
My answer, however, is in the context of Java which OP is using (and returning a String, which OP is trying to do).
Following Java's default toString format is ideal when you are passing multiple data values as a String. (Imagine the chaos if every developer on a large scale project was just making up their own format for returning toString data)

C++ ifstream by Edwin Pittcocke - Thu, 05 May 2016 16:16:15 EST ID:jD7NTaOL No.35559 Ignore Report Reply Quick Reply
File: 1462479375725.jpg -(11449B / 11.18KB, 320x240) Thumbnail displayed, click image for full size. 11449
I have already #included <fstream>
and am running this
std::ifstream dictionary;
dictionary.open (filename);
the filename is correct and the file is in the same folder as the program on linux using a g++ compiler. I have no idea why this is not working or reading the file
Fanny Chashbury - Thu, 05 May 2016 19:36:52 EST ID:JhIhwAJD No.35560 Ignore Report Quick Reply
Are you reading the file after you open it?

What is the error message you are getting?

JQuery VS Javascript For the Web? by Priscilla Sunkinwell - Mon, 28 Mar 2016 19:51:10 EST ID:tSOrTy4O No.35414 Ignore Report Reply Quick Reply
File: 1459209070082.png -(112393B / 109.76KB, 1366x768) Thumbnail displayed, click image for full size. 112393
I am starting to dig JQuery but it will always be JS at it's core. What do you all think?
1 posts omitted. Click Reply to view.
Walter Feffingshaw - Tue, 29 Mar 2016 00:46:45 EST ID:dw4jEIU+ No.35419 Ignore Report Quick Reply
I think a mod told you to keep to one thread.
Matilda Blaffingville - Tue, 29 Mar 2016 01:15:45 EST ID:tSOrTy4O No.35420 Ignore Report Quick Reply
this is a question bro
Eugene Tootshaw - Tue, 12 Apr 2016 04:16:11 EST ID:hFDFtj8J No.35472 Ignore Report Quick Reply
I spent 3 years having to support ie8 for work, for some apparently super "important" internal facing legacy garbage. Jquery is the only reason I could do that without hanging myself from a highway overpass.
Walter Hedgenod - Wed, 04 May 2016 10:45:51 EST ID:TBTemjoO No.35550 Ignore Report Quick Reply
When you learn to properly code frontend, you don't want to use Jquery. For data binding you should use a library designed for it, such as knockout.js. For manipulating DOM-elements you can use plain JS or a library/framework designed for it.
Wesley Smallwater - Wed, 04 May 2016 16:18:02 EST ID:9QSfnS0r No.35553 Ignore Report Quick Reply
That's because most people don't work at a fortune100 company.
So no time to code fronted "properly" because there are also backend and business logic they have to take care of. And that's more important than if some ancient browser only stupid people use crashes.

Amateur Game Development by Hugh Hublingfadge - Tue, 03 May 2016 22:51:33 EST ID:LroNL5Dp No.35548 Ignore Report Reply Quick Reply
File: 1462330293650.png -(37592B / 36.71KB, 341x170) Thumbnail displayed, click image for full size. 37592
So, the near mythical amounts of shitposting on 4butt's amateur gamedev general has caused some to seek refuge in the cozy, moderated arms of 420chan. But I think maybe it's a bad idea to try and migrate, and a better idea to try and start a new community.

I'm more of a math person but I do like programming, and I think gamedev provides a great canvas for working on programming skills. Some of my first programming as a kid was the turtle shit, and much later, I had fun just making a box bounce around and change colors based on some code.

So besides just shilling >>>/vg/664016 I also think we will see more gamedev in the early classroom. (wouldn't be surprised if it's in the classroom now, I have no part of that world though) What do you think?
Clara Blammerbanks - Wed, 04 May 2016 01:21:52 EST ID:4AC8OQBZ No.35549 Ignore Report Quick Reply
It's in the classroom now. Most classrooms actually. My niece in San Francisco is learning Scratch at school now to make simple little games, and she's loving it!

Java noob here... how do i android studio? by Phineas Dodgetork - Sat, 02 Apr 2016 23:58:13 EST ID:SWJfiJ9j No.35433 Ignore Report Reply Quick Reply
File: 1459655893980.png -(66269B / 64.72KB, 1130x720) Thumbnail displayed, click image for full size. 66269
wtf is this xml shit? Where do I put the java to make it do things?
9 posts and 1 images omitted. Click Reply to view.
Matilda Blackwell - Sun, 10 Apr 2016 17:49:09 EST ID:5q2tULje No.35459 Ignore Report Quick Reply
I always wondered one thing: Do you lispers actually type all those parenthesis, or does the programming environment do it for you.
I even get light headed when I have a more than three nested procedural function calls in c like syntax, I can't Imagine how it would be with Lisp.
Simon Creffinghot - Sun, 10 Apr 2016 20:28:38 EST ID:GbHobBfJ No.35462 Ignore Report Quick Reply
Python lists are very powerful and you can actually implement Lisp with them ( http://docs.hylang.org/ ) but no, not at all.

Highlighting and indentation go a long way. The real cognitive load is I think inherent to functional programming.
Matilda Blarringbanks - Sat, 16 Apr 2016 00:09:31 EST ID:vIbiteGg No.35494 Ignore Report Quick Reply
fuck you for asking me to endure that. What the flying fuck was that corporate nonsense?

It seems AndroidStudio switched to gradle which would be fine but all the projects I want to contribute to are on ant/maven and there is no clear way to run those in Gradle studio.

Also why the fuck cant i cli this shit? WHY MUST I USE AN IDE?
IDE - Sat, 16 Apr 2016 15:13:59 EST ID:tSOrTy4O No.35499 Ignore Report Quick Reply
I don't know enought about droid os to answer your question about why. I can tell u about AIDE an Android based IDE That is IMO very Easy to use and understand than ADS!!
Cornelius Sobberhun - Mon, 02 May 2016 15:16:42 EST ID:8gl+mZ4G No.35542 Ignore Report Quick Reply
> want to contribute to are on ant/maven
Calm down and make a new branch ffs

I could use some help by Sidney Hozzleson - Mon, 25 Apr 2016 19:12:17 EST ID:bcf8kw7H No.35526 Ignore Report Reply Quick Reply
File: 1461625937131.png -(163487B / 159.66KB, 1366x768) Thumbnail displayed, click image for full size. 163487
Hey guys, I'm in a CS course on understanding operating systems. I have this code assignment that I'm pretty confused about and the class is all online. We haven't really even learned about coding in the class (I've already taken classes that teach code, but not this kind of thing), just the various aspects of an OS. Could any of you guys give me some suggestions on how to go about this assignment? I'm okay at coding but this has me a bit confused. I can do this in any language. I plan to just use Python, but I also know a bit of Java and C++. I'll be really grateful for any guidance. Pic related, it's the assignment.
5 posts and 1 images omitted. Click Reply to view.
George Bunderfag - Tue, 26 Apr 2016 22:28:50 EST ID:lSbxvUCI No.35532 Ignore Report Quick Reply
lolwut? How the fuck would you even propose that OP find such a version, if it indeed exists?
David Cloddlewell - Thu, 28 Apr 2016 19:00:56 EST ID:G5UQTlPX No.35535 Ignore Report Quick Reply

>lolwut? How the fuck would you even propose that OP find such a version, if it indeed exists?
Version control?
Isabella Surrydale - Thu, 28 Apr 2016 20:35:15 EST ID:5q2tULje No.35536 Ignore Report Quick Reply
Barnaby Smallridge - Thu, 28 Apr 2016 23:01:02 EST ID:CPIPn/RL No.35537 Ignore Report Quick Reply

Cool. Now just track down a particular version that may or may not have the code OP needs but almost certainly can't read because he "knows a bit of C++".
Isabella Surrydale - Fri, 29 Apr 2016 02:46:36 EST ID:5q2tULje No.35540 Ignore Report Quick Reply
something about the lines of
# wget -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories
# for a in `ls -1 *.tar.gz`; do gzip -dc $a | tar xf -; done
# grep -Rin "FCFS" .

MIPS Instructions by Rebecca Greenson - Thu, 28 Apr 2016 18:37:21 EST ID:tWqw3xwf No.35534 Ignore Report Reply Quick Reply
File: 1461883041958.png -(270309B / 263.97KB, 300x345) Thumbnail displayed, click image for full size. 270309
Does anyone know an easy way to memorize how many bits are in each section of an R-Type, I-Type, and J-Type instruction, and how to differentiate between them when given a bare MIPS instruction ie 34110000?
Doris Murdman - Fri, 29 Apr 2016 02:18:45 EST ID:4AC8OQBZ No.35538 Ignore Report Quick Reply
Perhaps this will help:

RecursionFX by Buttz McButterson - Mon, 18 Apr 2016 05:53:27 EST ID:rPpNgdEP No.35504 Ignore Report Reply Quick Reply
File: 1460973207629.png -(1955B / 1.91KB, 448x224) Thumbnail displayed, click image for full size. 1955
Trying to teach a friend about Events using Towers Of Hanoi, and he's using JavaFX, wondering if anyone's got any useful examples I could show him? So far he's got the pieces made and stacked up but having trouble with the Event side of things.
Clara Pockbanks - Mon, 18 Apr 2016 16:15:28 EST ID:lP2HGMzK No.35507 Ignore Report Quick Reply
I don't understand how events are particularly suited to this game?
What sort of events do you have in mind, aren't click events and mouse over better choices?
Priscilla Pimblepack - Thu, 21 Apr 2016 00:52:15 EST ID:tSOrTy4O No.35514 Ignore Report Quick Reply
You can use functon Collided(Imga, Imgb){
and encapsulate that within the event change thats urually the best one or mouse move/up/own/keypress/leyup/keydown ...ect what lang?

New small programming ebook by George Chaddleway - Sat, 16 Apr 2016 16:07:45 EST ID:2j/vWnYO No.35500 Ignore Report Reply Quick Reply
File: 1460837265352.png -(93953B / 91.75KB, 900x1200) Thumbnail displayed, click image for full size. 93953
The Ultimate Question of Programming, Refactoring, and Everything - http://www.viva64.com/en/b/0391/

PDF: https://yadi.sk/i/u11TL5ccr2cSf
Alice Drettingbanks - Sun, 17 Apr 2016 02:26:32 EST ID:W/zS63TD No.35501 Ignore Report Quick Reply
i report yu

how do you ''import'' classes from additional source folders? by Hedda Binningkit - Sun, 10 Apr 2016 22:18:23 EST ID:SWJfiJ9j No.35466 Ignore Report Reply Quick Reply
File: 1460341103195.png -(36306B / 35.46KB, 814x379) Thumbnail displayed, click image for full size. 36306
So I'm trying to get the hang of working with resources in Java.
the res folder is in my buildpath, but I don't seem to be able to access the ResourceLoader class from my src folder.
How do I do I make this work while keeping my res folder seperate from src?
Hedda Binningkit - Mon, 11 Apr 2016 00:51:47 EST ID:SWJfiJ9j No.35467 Ignore Report Quick Reply
UPDATE: found my answer after harassing a guy on Stack Overflow for a while.
Martha Clindlefuck - Mon, 11 Apr 2016 01:10:22 EST ID:JhIhwAJD No.35468 Ignore Report Quick Reply
I'm not sure what the guy on Stack Overflow said, but you probably want to keep all your source code in your src folder.

Make a package in src called utilities or something and put it in there.

Also, res should just be a regular folder, not a source folder.
Hedda Binningkit - Tue, 12 Apr 2016 21:01:40 EST ID:SWJfiJ9j No.35481 Ignore Report Quick Reply
He kindly pointed out to me that if I wanted to use this method, the resource loader can't be in a default package.
As for making a res a regular folder w/ ResourceLoader in a utilities package, from what I understand that won't work for 2 reasons:

1.) the res folder won't be included in the jar if it's not in the buildpath, making the creation of OS specific installers necessary.

2.) if the ResourceLoader class is not in the same source-folder as the resources it's loading, the getClass().getResource() method ceases to work, making managing resources much more complicated.

Yes, I could move the resPkg package within res to src... but all it adds is a bunch of mostly irrelevant visual clutter to the src folder.
I fail to see the benefit, considering Java doesn't distinguish between the folders in it's build-path when it comes to import statements.

I'm pretty new to programming so I'd be more than happy to hear if there's a simpler way to do this in Java than with than solutions I've managed to find.
Graham Chinnerwad - Tue, 12 Apr 2016 22:40:47 EST ID:JhIhwAJD No.35482 Ignore Report Quick Reply
Here's a method from my last project, i'm not saying it is good, but it may help you:

I have my ResourceManager class in a package called support and I have all my images in a folder called res/images/

It starts by trying to read the file in at "res/images/"
If running the project from your IDE it will look into your res folder that is at the root of your project directory
If running the project from a jar file it will look in the same directory as the jar file
If that fails, it will use the system class loader to try and get the resource as a stream
This will look inside your jar file for the requested resource
If that somehow fails, it just returns a default image

This has the added effect that people can change the images and sounds and whatever they want by placing a res folder with the items just outside of your jar file.
If you don't want that, you could do the check inside the jar file first.
Charles Nashway - Thu, 14 Apr 2016 22:08:46 EST ID:vIbiteGg No.35488 Ignore Report Quick Reply
Stop using java.io.File, OP. Use java.nio.file.Path for files on the local system and java.net.URL or URI for files in your jar or local system or network.

Proxying with VPNs by Hugh Pibbleshit - Mon, 15 Feb 2016 01:09:31 EST ID:UJlFtb13 No.35161 Ignore Report Reply Quick Reply
File: 1455516571314.gif -(44928B / 43.88KB, 250x190) Thumbnail displayed, click image for full size. 44928
There's some web stuff I want to scrape and I want to use some reliable on-demand proxies. PIA is a dirt cheap VPN provider which lets you use five simultaneous VPN connections. That's great except I don't know much about networking in general and I know nothing about configuring multiple VPNs for use on one host. What I'm envisioning is using one virtual machine with a bridged network adapter that will have five network interfaces and five proxies bound to those interfaces and then some custom API for scraper clients to start/stop/change connections. Or alternatively, a similar set up but one VM per scraper client. Before I go banging my head against a wall, I thought I should ask: is there an easy-mode solution?
Alice Clayfoot - Thu, 24 Mar 2016 03:55:04 EST ID:9Rjcnadv No.35372 Ignore Report Quick Reply
First of all what the fuck?
I have PIA and the application is super easy to configure. you just put in your username/password then choose a server. Also it's based on OpenVPN so if you wanted to add scripts into it you could use the actual openvpn application.
Faggy Haffingdodge - Thu, 24 Mar 2016 13:02:42 EST ID:/Pyyujzg No.35373 Ignore Report Quick Reply
>simultaneous VPN connections

Routing can be a bitch.
Wesley Fivingdotch - Mon, 11 Apr 2016 19:19:34 EST ID:MIT/8+2O No.35469 Ignore Report Quick Reply
Tor isn't really designed for it and it's abusing the resource BUTTT: http://blog.databigbang.com/distributed-scraping-with-multiple-tor-circuits/

It does make scraping very easy if you spin up a bunch of tor instances...

General Programming by Frederick Fendledadge - Tue, 22 Mar 2016 15:52:36 EST ID:91ylubZX No.35358 Ignore Report Reply Quick Reply
File: 1458676356502.jpg -(1395657B / 1.33MB, 4640x2784) Thumbnail displayed, click image for full size. 1395657
Where can I learn how to program my android tablet to do speacialized things like respond to my voice (i.e. "Ok Google"). The current "version" of my OS doesn't allow it except for when I hit the app button but I wanna be able to do this from afar.
I also want to learn a way where the tab can read me entire pages so that I can listen to documents while I run, play guitar, drive without having to be reading them.
Simple (probably not) little things like that.
Where should I start /prog/? I only have basic knowledge of programming like HTML (Myspace img src codes) and MATLAB that I took in college.
JS Embed Custom Canvas SS SRC CRSH - Tue, 22 Mar 2016 20:08:31 EST ID:tSOrTy4O No.35359 Ignore Report Quick Reply
Download AIDE From The app store learn java first tho if u want then move on to Android Studio for WIndows. I have some basic Android Example Codes Below- BrU
Here is a Droid Random Location Gen That uses the geo: protocol in the browser enjoy - Tue, 22 Mar 2016 20:12:45 EST ID:tSOrTy4O No.35360 Ignore Report Quick Reply
package com.mycompany.WBV2;
import android.content.Context;
import android.content.Intent;
import android.app.Activity;
import java.util.Random;
import java.util.*;
import android.app.*;
import android.os.*;
import android.content.*;
import android.widget.Button;
import android.net.Uri;
import android.net.*;
import java.net.*;
import android.view.*;
import android.view.animation.*;
Comment too long. Click here to view the full text.
Here is somethin some other idiot wrote idk who - Tue, 22 Mar 2016 20:40:28 EST ID:tSOrTy4O No.35361 Ignore Report Quick Reply
package com.mycompany.WBV2;
import android.content.Context;
import android.content.Intent;
import android.app.Activity;
import java.util.*;
import android.app.*;
import android.os.*;
import android.content.*;
import android.widget.Button;
import android.net.Uri;
import android.net.*;
import java.net.*;
import android.view.*;
import android.view.animation.*;
Comment too long. Click here to view the full text.
Nathaniel Hunningkidge - Fri, 25 Mar 2016 05:57:59 EST ID:Qf+zQsjx No.35374 Ignore Report Quick Reply
1458899879407.jpg -(1420233B / 1.35MB, 4640x2784) Thumbnail displayed, click image for full size.
Does it matter which of the 3 Aide apps available?
Albert Bardridge - Fri, 01 Apr 2016 21:37:43 EST ID:1LXegojn No.35432 Ignore Report Quick Reply
Came across this link the other day looking up specs, not read more than the headline.

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