420chan

A FACE

Settings

  • Randy Theme
  • Classic Theme
  • Rainbow Theme
  • Hide NWS Boards
  • Show NWS Boards
  • Help Tooltips Off
  • Help Tooltips On
  • Perma-Party Mode Off
  • Perma-Party Mode On
  • Side Navigation Off

General

  • News
  • Blog
  • Rules
  • Tools
  • Taimapedia
  • IRC Info
  • 420chan FAQ
  • Moderators

New/Trial

  • *Dragonball*
  • Netjester AI
  • Dreams
  • Space
  • Weapons

Drugs

  • Cannabis
  • Alcohol
  • Ecstasy
  • Psychedelics
  • Stimulants
  • Dissociatives
  • Opiates
  • Tobacco
  • Benzos
  • Deliriants
  • Others
  • Jenkem
  • High Stuff

Academic

  • Science
  • Growing
  • Dinosaurs
  • History
  • Guides
  • Law
  • Medical
  • Philosophy
  • Politics
  • Technology
  • Programming

Lifestyle

  • Bawww Blog
  • Fitness
  • Transportation
  • Food
  • Crossdressers
  • Kinky Stuff
  • Adult (Gay)
  • Adult (Straight)

Media

  • Art & Oekaki
  • Comics
  • Flash
  • Gifs
  • Literature
  • Music
  • MMA
  • Movies & TV
  • World News
  • Pokemon
  • Sports
  • Trad Games
  • Video Games
  • Wrestling

Miscellaneous

  • 420chan
  • Random
  • Shenanigans
  • Spooky
  • Animals
  • Gore
  • Hentai
  • Wallpapers
  • Net Characters
General
  • News
  • Blog
  • Rules
  • Tools
  • Taimapedia
  • IRC Info
  • 420chan FAQ
  • Moderators
New/Trial
  • *Dragonball*
  • Netjester AI
  • Dreams
  • Space
  • Weapons
Drugs
  • Cannabis
  • Alcohol
  • Ecstasy
  • Psychedelics
  • Stimulants
  • Dissociatives
  • Opiates
  • Tobacco
  • Benzos
  • Deliriants
  • Others
  • Jenkem
  • High Stuff
Academic
  • Science
  • Growing
  • Dinosaurs
  • History
  • Guides
  • Law
  • Medical
  • Philosophy
  • Politics
  • Technology
  • Programming
Lifestyle
  • Bawww Blog
  • Fitness
  • Transportation
  • Food
  • Crossdressers
  • Kinky Stuff
  • Adult (Gay)
  • Adult (Straight)
Media
  • Art & Oekaki
  • Comics
  • Flash
  • Gifs
  • Literature
  • Music
  • MMA
  • Movies & TV
  • World News
  • Pokemon
  • Sports
  • Trad Games
  • Video Games
  • Wrestling
Miscellaneous
  • 420chan
  • Random
  • Shenanigans
  • Spooky
  • Animals
  • Gore
  • Hentai
  • Wallpapers
  • Net Characters
Options
  • Styles
  • Randy
  • Classic
  • Rainbow
  • Settings
  • Hide NWS
  • Show NWS
  • Tooltips Off
  • Tooltips On
  • Party Mode Off
  • Party Mode On
  • Side Nav Off
  • Side Nav On
  • Staff
  • Login
Icon
Icon
Icon
Icon
Icon
Icon
/prog/ - Programming
/prog/ - Programming
Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the format Name#Password
Insert a URL or E-mail in this field. It will appear in your name.
Subject
Comment
*Italic Text*
**Bold Text**
~Taimapedia Article~
%Spoiler Text%
>Highlight/Quote Text
``Monospace Text`` OR Indent each line 4 spaces
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich
Password
(Password for post and file deletion)

Advertise With Us

File: 1258751833573.jpg -(299401 B, 393x589) Thumbnail displayed, click image for full size.
299401 No.3157 Report Ban Global Ban Sticky Lock Reply

Who can make me a wakaba based chan(imageboard)? for let's say $50-$100



File: 1258117703127.jpg -(19786 B, 200x273) Thumbnail displayed, click image for full size.
19786 No.2967 Report Ban Global Ban Sticky Lock Reply

Hai guise

I'm studying software engineering and I'd like a good book/resource on modern Java. I'm good in C/C++ and OOP concepts, so I need something a bit more like a Java for C++ programmers. I don't wanna go through what types, arrays, control loops etc. are. Just something that'll get me productive in Java as quick as possible.
Most books I can find, are pretty old, and I have no idea if they're obsolete or not. Please help me /prog/

/Anon

49 posts omitted. Click Reply to view.
>> No.3148 Report Ban Global Ban

>>3147
Right. Since the value of y is unavailable to the programmer, what sets y and the value it represents apart as far as the programmer is concerned?

Tell me why variables are not meaningless. I understand that fundamentally variables and values are very distinct, but in practice in a language like Java they are not. Give me an example where you can't view a variable identically to it's value. Like I said, all you care about a Bar b is the Bar class which b points to, and nothing else -- so in effect b IS the Bar.

Comment too long. Click here to view the full text.
>> No.3149 Report Ban Global Ban

>>3148
because variables in carry a type, and assignment requires that the object assigned be an instance of or derived from that type. furthermore, the compiler checks method calls via the type of the variable, i.e. if you try to call a method implemented in a derived class via a variable of the base class, the compiler will complain. clearly, the programmer needs to understand the difference.

>> No.3153 Report Ban Global Ban

>>3149
No, he doesn't. The programmer just needs to understand that b is a Bar. A subclass of Bar is still a Bar, and anything you can do with a Bar you can do with it's subclasses.

Anyways, as you just described, the variable is clearly treated as an object instance, which is the key point here.

>> No.3155 Report Ban Global Ban

>>3153
But not everything that can be done with a subclass can be done via a base class variable. Duh.

Well done. You trolled me long and hard, but your nature is clear now. Thanks for playing, now fuck off.

>> No.3156 Report Ban Global Ban

>>3155
...yes, that's why b is Bar b, not BarSubClass b.

Like I was saying, as far as the programmer is concerned b is an object of type Bar, irrespective of subclassing.



File: 1256576263041.jpg -(167385 B, 1920x1200) Thumbnail displayed, click image for full size.
167385 No.2694 Report Ban Global Ban Sticky Lock Reply

I know it's just about the simplest programming language out there, but it's what I started with, what about you, /prog/?

Pic unrelated.

22 posts and 1 images omitted. Click Reply to view.
>> No.3138 Report Ban Global Ban

>>3134
See, this is bullshit. Absolute shit.

Java and C++ aren't too advanced for a beginner. They're not what I'd recommend, but kids in the 80's taught themselves motherfucking assembly (though most started with BASIC, to be fair). You'd be amazed what kids could learn. I started on Java in a high school CS class; by the end of the year, my friend and I had spent most of the classes poring over the online API documentation and succeeded in writing tic-tac-toe and a few other things -- and this was in the days of AWT. Remember how shitty AWT was?

Comment too long. Click here to view the full text.
>> No.3140 Report Ban Global Ban

>>3135

> > IGNORE THE GUYS WHO SAID JAVA OR C++, THEY ARE BOTH WAY TOO ADVANCED FOR A BEGINNER.
> My university's computer science department starts off all first-years on Java. Most of them have never programmed before. This is also true of a lot of other universities. Would you like to rethink your argument?

lol ! b/c universities can always be trusted to make the best choice!

>> No.3141 Report Ban Global Ban

Some universities start with C, which is a more difficult language than Java. Really, though, it doesn't matter what language you start with so long as you learn the same stuff.

>> No.3152 Report Ban Global Ban

Starcraft Triggers. I don't even think it counts as a programming language, but it resembles the structure of one so whateva

>> No.3154 Report Ban Global Ban

processing!



File: 1258553862277.jpg -(19635 B, 400x225) Thumbnail displayed, click image for full size.
19635 No.3102 Report Ban Global Ban Sticky Lock Reply

Write a program that ask the user to enter a positive integer. Your program should then count up (starting at 0) to the user’s number and then count back down to 0. Try to write this program using only a single loop.

I can easily make the loop count up, that's simple.

        int number;
int sum = 0;
        Console.Write("Please enter a positive interger: ");
Comment too long. Click here to view the full text.
6 posts omitted. Click Reply to view.
>> No.3119 Report Ban Global Ban

>>3117

Well, I kind of had this before. But, how can you make it only use a single loop? Is there a way?

Should I give up and just have two loops?

>> No.3120 Report Ban Global Ban

>>3117
oops, didn't see the one loop requirement. so this one, then:

        int i = 0;
bool up = true;
while (i >= 0 || up)
{
Console.Write("{0} ", i);
Comment too long. Click here to view the full text.
>> No.3121 Report Ban Global Ban

>>3120

So that's what the other person meant, ok cool. This has opened my eyes a bit for these loop questions.

Thanks /prog/ I'm smoking a bowl for you.

>> No.3128 Report Ban Global Ban

Another way to do it apart from a boolean (not necessarily better though):

for( int x = 0; x < number*2; x++ )
{

if( x < number )
Console.Write( "{0} ", x );
else
Comment too long. Click here to view the full text.
>> No.3151 Report Ban Global Ban

>>3114

Well that depends on when you set the boolean :)

This is ugly as shit, but it does what you're asking:

Console.WriteLine("What do you wanna count to?");
int sum = 0, numberToCount = Int32.Parse(Console.ReadLine());

Comment too long. Click here to view the full text.


File: 1258117702490.jpg -(40268 B, 500x390) Thumbnail displayed, click image for full size.
40268 No.2966 Report Ban Global Ban Sticky Lock Reply

Hey /prog/ I'm 19 and wondering if it is to late for me to start programing? i don't have much computer skill but i would like to learn. Also, where should i start?

14 posts and 2 images omitted. Click Reply to view.
>> No.3105 Report Ban Global Ban

>>3099
You need to change your file-associations, so that a .py file isn't associated with IDLE, but with the Python interpreter. I think you can right click the file -> properties -> open in -> and change it there.

>> No.3109 Report Ban Global Ban

>>3105

thanks ill check it out tomorrow

>> No.3110 Report Ban Global Ban

Learn some assembly then Java, C and Python.

>> No.3131 Report Ban Global Ban

>>2966

I learned HTML when I was like 11 give or take. I started making websites and learned CSS, JavaScript (not very well), XML, XSLT and PHP in a few months a few years later.

If an 11 year old can learn it a 19 year old can

>> No.3150 Report Ban Global Ban

>>3110
Why would he want to learn assembly?



File: 1258661632860.png -(39326 B, 718x574) Thumbnail displayed, click image for full size.
39326 No.3143 Report Ban Global Ban Sticky Lock Reply

Writing my own disassembler for fun. (Just going to work on flat 16-bit binaries in x86 for now, no need to bother with different executable formats) Unfortunately I'm not really sure how to begin translating the hundreds of possible instructions to strings that represent the correct mnemonics. I mean I could do it in an incredibly unsophisticated way, but it would be horribly inefficient and just a big waste of time, and very difficult to maintain.

So my problem is thinking up how I can do this. I already have the Intel IA-32 instruction reference manual and I understand how the opcodes are encoded. I'm just not sure what would be a good method to translate a byte sequence into the correct corresponding string in a manner that isn't embarrassing. Tips? How would you do it?

>> No.3144 Report Ban Global Ban

opcodes / mnemonics in a table
indexed lookup for speed (hash table, map, etc)
input stream of bytes
output stream of text
read bytes until match found
output matching mnemonic
repeat until finished



File: 1258568774811.gif -(351314 B, 127x181) Thumbnail displayed, click image for full size.
351314 No.3123 Report Ban Global Ban Sticky Lock Reply

Hello /prog/

My roomate Andrea is representing our girlsflat in an incredibly fail miss-contest by our students rent-organisation. Whoever gets the most votes wins 3 months rent for free, which we could use immensely for great justice of course. Now, it's a simple php-form with an IP-ban, which i thought would be easy to tune by the use of delicious anonymizer.org etc. - but it seems, i already reached the limit out of all of them (i used lists like the one on encyclopedia dramatica..) because i can't vote anymore. I know there are far more professional ways to tune this contest, but i don't know where to search.
Can anyone of you lead me in the right direction as to what kind of methods are usually used in such a case?

Comment too long. Click here to view the full text.
>> No.3124 Report Ban Global Ban

Also, please excuse my bad english, i always read but do not often write..



File: 1258351633265.gif -(1044299 B, 189x240) Thumbnail displayed, click image for full size.
1044299 No.3028 Report Ban Global Ban Sticky Lock Reply

hay guise. how do proggers prog dis?

#include <stdio.h>
#include <stdlib.h>

int main()
{
int dicks;

Comment too long. Click here to view the full text.
8 posts omitted. Click Reply to view.
>> No.3077 Report Ban Global Ban

oblige him guys

>> No.3078 Report Ban Global Ban

>>3077
fuck I don't know what he's asking for... someone get him his sheen code

>> No.3082 Report Ban Global Ban

MACHINE CODE!!!! :DDDD

>> No.3096 Report Ban Global Ban
File: 1258523614018.jpg -(48005 B, 604x840) Thumbnail displayed, click image for full size.
48005

>>3078
?

>> No.3108 Report Ban Global Ban

>>3096
lol

Sorry guys, I was really just trying to get a laugh out of this. I wasn't trying to troll anyone, I just thought it would get a few laughs here and there.



File: 1258077409013.jpg -(829418 B, 1599x1063) Thumbnail displayed, click image for full size.
829418 No.2960 Report Ban Global Ban Sticky Lock Reply

Is there a program out there that turn a laptop touchpad into a weight scale? I know it can detect how much pressure is applied to it, but I'd like to see this applied to weighting grams-whatever.

>> No.2970 Report Ban Global Ban

There's a scale app for the iphone. It sucks.

And normal touchpads don't measure pressure. Where the hell did you get that idea?

>> No.3098 Report Ban Global Ban

I stumbled upon this and realized wait touch pads don't measure pressure. but tablets do. I would love to know if I could use my tablet instead as it has a MUCH higher surface area than my scale

>> No.3100 Report Ban Global Ban

>>3098

If you're going to use a tablet, get a box, put tablet pen though box until the nib is sticking through.

Put your tablet on the box so it's sticking up a bit. Place stuff on tablet.

The tablet itself don't check pressure, the pressure is checked with the nib and the contraption behind the nib

Comment too long. Click here to view the full text.


File: 1258521051287.jpg -(16796 B, 258x473) Thumbnail displayed, click image for full size.
16796 No.3093 Report Ban Global Ban Sticky Lock Reply

Okay, so I got this question in C#:

Write a program which prompts the user to enter integers repeatedly. The program should stop reading in numbers when the user enters the number 0 or when the sum of all numbers entered is greater than 100.

The Code I wrote for it is this:

        int number;
Comment too long. Click here to view the full text.
>> No.3094 Report Ban Global Ban

You should be using or not and. Should be obvious.

While the number is not zero AND the sum is less than 100, do this.

>> No.3095 Report Ban Global Ban

>>3094
er, sorry, and not or

>> No.3097 Report Ban Global Ban

Enter number: 50 (number = 50, sum = 50) = (true||true) = true
Enter number: 75 (number = 75, sum = 125) = (true||false) = true
Enter number: 0 (number = 0, sum = 125) = (false||false) = false

On the first two cases, the loop condition is satisfied and the loop continues. On the third case, the loop condition is not satisfied and the loop stops.

Do this >>3095



File: 1258512663460.png -(208967 B, 509x380) Thumbnail displayed, click image for full size.
208967 No.3090 Report Ban Global Ban Sticky Lock Reply

Stupid question, but I need to know. Why in C++ must you use doubles with the POW function?

For example:

#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;

Comment too long. Click here to view the full text.
>> No.3091 Report Ban Global Ban

You're not limited to strictly doubles in C++. The following overridden functions are available in math.h:

double pow(double x, double y);
double pow(double x, int y); // C++ only
double pow(int x, int y); // C++ only
float pow(float x, float y); // C++ only
float pow(float x, int y); // C++ only
long double pow(long double x, long double y); // C++ only

Comment too long. Click here to view the full text.
>> No.3092 Report Ban Global Ban

Because if either x or y are doubles the answer will be a double. You couldn't have one that would be (int int --> int) because if y is negative the answer would need to be a double.

Well, I suppose it would be possible but it wouldn't be as useful.



File: 1258493598874.jpg -(42660 B, 1600x1200) Thumbnail displayed, click image for full size.
42660 No.3085 Report Ban Global Ban Sticky Lock Reply

UNIX Help

So i need to make multiple conditions in this case statement and for some reason some of them work and some of them dont...

Heres the code

let CYEAR=$(date '+%Y')
ELAPSED=expr $CYEAR - $AGE

Comment too long. Click here to view the full text.


Advertise With Us

Delete Post | | Password
Pages Next>>
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Report Post
Reason
Note

Powered by Taimaba 0.3.0

© 2005-2009 420chan      Contact    Twitter    Advertise    Policy