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
1: [Code Help]General code help?[PHP] (3) 2: world4ch's /prog/ Emergency Shelter #4 (9) 3: This is the official /prog/riders thread (9) 4: Interpreted vs. compiled labguages (29) 5: Is Ruby as inefficient as they say (6) 6: Coding Challenge #2! (114) 7: Operating Systems vs Artificial Intelligence (3) 8: 6.034 (6) 9: How to make my own imageboard (4) 10: my own "yet another imageboard-script" (106) 11: Best language for starting out in functional programming? (20) 12: [SICP] LEARNING TIME [PY] (4) 13: HAX MY ANUS (2) 14: OOP vs functional (11) 15: Active (6) 16: Introduction to complexity and the idea od quantum computers (3) 17: Opinions of Codecademy? (8) 18: Programming languages with fast matrix operations (15) 19: [JS] Help me find out the correct speed to sync up with the song 太陽いわく燃えよカオス (5) 20: "4tran"? (52) 21: Spoilers in Wakaba (16) 22: Which one? (4) 23: Backup tweets (4) 24: I reproduced an error I found in safari. (3) 25: Google app engine (2) 26: Is Perl a dead language? (25) 27: lol (2) 28: Shitpostan (2) 29: What is the diff between RSS and Atom feeds? Is one better? (2) 30: Scala thread (2) 31: GameBoy Color emulator in JavaScript (11) 32: Excessive file access in a perl script? (10) 33: Common useful applictions of Perl? (10) 34: How does one put AA art into HTML? (4) 35: Starting With C - good idea? (39) 36: My I.R.C (3) 37: Beginning Java EE (5) 38: Unorthodox Scripting Language (10) 39: zend framework barcode (2) 40: Executables (5)

[Code Help]General code help?[PHP] (3)

1 Name: #!/usr/bin/anonymous : 2014-04-16 17:06 ID:tTTThWto

I was running a textboard that has custom software. It has gone down due to reasons beyond my control (got a new router, AT&T won't let me port forward like I was able to do before). Anyways, in the event I can open ports again, I would like to add something to the script. How could I add an Eternal September post date like on DQN? Would I have to play with date()?

2 Name: #!/usr/bin/anonymous : 2014-04-17 00:53 ID:Heaven

You probably would have to write your own date function based on PHP's date(). For example if you wanted to stay on 2000 and we have 2014 then you'd have to add (2014-2000)*12 months to your month count. But since you want an eternal september you'd have to calculate 14*12*30 days instead. It's actually really easy.

3 Name: #!/usr/bin/anonymous : 2014-04-17 06:10 ID:Heaven

php is shit

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

world4ch's /prog/ Emergency Shelter #4 (9)

1 Name: Shrine Maiden of Hakurei : 2013-07-06 00:00 ID:BeoV+edZ

This shelter has been designated by the local government for the purposes of temporary protection from the spam storm.

Links of interest:

Please sign the petition!

Kabbalah and other Jewish spells

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

2 Name: #!/usr/bin/anonymous : 2013-08-26 20:29 ID:xQcaql+m

don't sign the petition!!!!!

3 Name: sage : 2013-08-27 04:28 ID:Fgop11xL

we back, without the ability to report threads, like here.

4 Name: #!/usr/bin/anonymous : 2013-08-29 19:22 ID:BeoV+edZ

I thought this had been deleted!

Also, goddamn captchas.

5 Name: #!/usr/bin/anonymous : 2013-09-02 01:52 ID:Fgop11xL

Waiting on a response:
https://boards.4chan.org/q/res/757463#p757464
If some can, please bump to catch the mods attention.

6 Name: #!/usr/bin/anonymous : 2013-09-02 02:17 ID:BeoV+edZ

>>5
What? No.

7 Name: #!/usr/bin/anonymous : 2014-04-08 14:13 ID:Heaven

rest in peaches

8 Name: lol jk : 2014-04-09 07:22 ID:Heaven

>>7
;_;

9 Name: #!/usr/bin/anonymous : 2014-04-13 15:41 ID:eyFmI2A5

bumperu

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

This is the official /prog/riders thread (9)

1 Name: #!/usr/bin/anonymous : 2014-04-12 16:34 ID:YCpP//24

2 Name: #!/usr/bin/anonymous : 2014-04-12 17:45 ID:slOHyfc7

Hey >>1-san, in case you're unaware, we're waiting for you over at http://bbs.progrider.org/prog/ !

3 Name: #!/usr/bin/anonymous : 2014-04-12 18:19 ID:YCpP//24

>>2
thank you

4 Name: #!/usr/bin/anonymous : 2014-04-13 15:51 ID:Heaven

>>2
I get the feeling that he was the ``go back to /g/'' guy

5 Name: #!/usr/bin/anonymous : 2014-04-13 16:43 ID:Heaven

>>4
I too noticed a suspicious increase in shitposting since yesterday. I sort of feel bad for letting him know about /prog/riders now.

6 Name: #!/usr/bin/anonymous : 2014-04-14 13:29 ID:Heaven

>>2,4
I've seen you posting on DQN and other boards. Shut the fuck up, I've known you for years now. You don't feel bad for telling a friend where the new /prog/ is, surely?

7 Name: #!/usr/bin/anonymous : 2014-04-14 18:24 ID:Heaven

>>6
This is my first time posting on 4-ch [i]faggot[/i]

8 Name: #!/usr/bin/anonymous : 2014-04-14 20:33 ID:Heaven

>>7
TEH BAIT

9 Name: #!/usr/bin/anonymous : 2014-04-15 08:25 ID:Heaven

redundancy is fault tolerance.

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

Interpreted vs. compiled labguages (29)

1 Name: #!/usr/bin/anonymous : 2011-03-07 12:48 ID:Aep/pjix

Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?

20 Name: #!/usr/bin/anonymous : 2012-10-09 13:52 ID:hKPHxe0D

>Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?

I would say it depends on what are you like/want to do more.
I'd recommend starting with PHP and continuing with C. Because it's easy.

21 Name: #!/usr/bin/anonymous : 2012-10-20 13:39 ID:77BK0eUh

>>19

I dare to object. Every self-respecting C compiler should spill warnings about UB, until you bend over. To top it off for a bit, stronger typing of C++ treats some UB as hard errors (while creating plethora of new ones in it's wild-west approach to OO).

22 Name: #!/usr/bin/anonymous : 2012-11-24 14:31 ID:/vjq3rnG

>>20
Please don't start with PHP, for the love of God. That is the worst thing anyone could do.

23 Name: #!/usr/bin/anonymous : 2012-11-24 22:29 ID:Heaven

>>22
I mean, feel free to learn it at some point as I fully understand it is necessary to know in some lines of work, but to learn it as a first language will give you bad habits that are hard to drop if they're the first things you learnt.

I recommend learning Scheme while reading SICP. It will start you off with a nice, high standard. Python is okay too if you would rather.

24 Name: #!/usr/bin/anonymous : 2012-11-29 18:32 ID:7Bu9YmDM

>>20
No, oh my god no. PHP is no. Just no.
Is you want to pick up an actual language that is easy, go with Python or Ruby.

25 Name: #!/usr/bin/anonymous : 2012-12-06 19:55 ID:Rm+oYDsT

PHP is an actual programming language. It is, however, not a general-purpose programming language.

26 Name: #!/usr/bin/anonymous : 2013-07-11 19:01 ID:seY6nZns

>>21
Okay then, is there a static code checker that is programmed to detect [b]every[/b] possible UB there is?

27 Name: #!/usr/bin/anonymous : 2013-08-03 10:45 ID:2RNh0GIN

>>20

PHP is a bad language for a beginner. It is far too difficult to find mistakes and the semantics are confusing. A beginner should take a language, which is clean and strict, so he will learn some discipline he needs for more loosely defined languages.

Look for strongly typed languages. Check if they don't have erratic behaviors like:

0 == "0" && 0 == "" && "0" != ""

Look how errors are handled. If these things look sane, it is useful as first language.

Paradigm doesn't matter. You can choose whatever style you want.

28 Name: #!/usr/bin/anonymous : 2013-10-16 12:49 ID:GkO8z4RU

Sure, interpreted languages may seem easier at first, but if you want to get into advanced computer programming and computer science, you'll probably be using compiled languages.

29 Name: #!/usr/bin/anonymous : 2014-04-12 09:46 ID:4xxaYzhl

Sure, interpreted ani may seem easier at first, but if you want to get into advanced anus penetration and penetration science, you'll probably be using compiled ani.

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

Is Ruby as inefficient as they say (6)

1 Name: #!/usr/bin/anonymous : 2013-05-04 05:49 ID:pe6UtPea

I'm looking into mobile development, and Ruby looks really nice, but I heard it's fairly slow. Is it really as bad as they say? If I don't use Ruby, and I absolutely hate Java, what's a good language for developing software for Android?

2 Name: #!/usr/bin/anonymous : 2013-05-09 22:49 ID:Heaven

Ruby is fairly slow, but much of what you see on the internet about it is exaggerated.

> If I don't use Ruby, and I absolutely hate Java, what's a good language for developing software for Android?

Clojure or C.

3 Name: #!/usr/bin/anonymous : 2013-10-17 22:02 ID:4C81U/b9

SCALA!

4 Name: #!/usr/bin/anonymous : 2013-11-10 00:59 ID:bqCiCcd7

これはアメリカのゲームです。1度やってみてください。
これは、たった3分でできるゲームです。試してみてください。
驚く結果をご覧いただけます。
このゲームを考えた本人は、メールを読んでからたった10分で願い事が
かなったそうです。このゲームは、おもしろく、かつ、あっと驚く結果を貴方にもたらすでしょう。
約束してください。絶対に先を読まず、1行ずつ進む事。
たった3分ですから、ためす価値ありです。
まず、ペンと、紙をご用意下さい。
先を読むと、願い事が叶わなくなります。
①まず、1番から、11番まで、縦に数字を書いてください。②1番と2番の横に好きな3~7の数字をそれぞれお書き下さい。
③3番と7番の横に知っている人の名前をお書き下さい。(必ず、興味の
ある性別名前を書く事。男なら女の人、女なら男の人、ゲイなら同姓の名
前をかく)

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

5 Name: #!/usr/bin/anonymous : 2014-03-10 02:10 ID:9nctplly

No, it's worse

6 Name: #!/usr/bin/anonymous : 2014-04-12 09:42 ID:VIwy/2Tw

2 bad wuby es sloww as fukkk!!! XDDDDDD

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

Coding Challenge #2! (114)

1 Name: Yaranaika Daddy!K./5Izeg0I 05/01/08(Sat)11:21 ID:Heaven

Alright people who know how to tell there computer what to do and how to get there... I bring you a challenge from the interweb.

THE 4K CODE CHALLENGE

Objective: To create the most productive/useful code that as source code is no larger than 4 kilobytes (4096 bytes). There is no restrictions as to what your code does, or what language it is used in.

Rules:

  • The code must be yours, and you must be willing to give your code out to the public domain.
  • You must state EXACTLY what your code does. If it is malicious you must state what it does/exploit.
  • There is no restriction on what language, however markup languages are not allowed. Javascript/VBScript are, and any HTML required to perform the task is not counted towards the byte tally however objects calling to Javascript/VBScript do.
  • Common standard libraries (.h files, javabeans, perl modules etc) are allowed and dont count towards the byte tally.
Post too long. Click to view the whole post or the thread page.

105 Name: #!/usr/bin/anonymous : 2008-04-23 18:26 ID:6rn5Nb8P

reposting this from /prog/ (hi guys!) to compete in the 4K challenge:

<html><head><title>CBC using Mersenne Twister</title><style>body { color: white; background-color: black; }</style><script type="text/javascript">
N = 624;
M = 397;
MATRIX_A = 0x9908b0df;
UPPER_MASK = 0x80000000;
LOWER_MASK = 0x7fffffff;
var mt = new Array(N);
var mti = N+1;
function unsigned32 (n1) { return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1; }
function subtraction32 (n1, n2) { return n1 < n2 ? unsigned32((0x100000000 - (n2 - n1)) & 0xffffffff) : n1 - n2; }
function addition32 (n1, n2) { return unsigned32((n1 + n2) & 0xffffffff) }
function multiplication32 (n1, n2) {var sum = 0;for (var i = 0; i < 32; ++i){if ((n1 >>> i) & 0x1){sum = addition32(sum, unsigned32(n2 << i));}}return sum;}
Post too long. Click to view the whole post or the thread page.

106 Name: #!/usr/bin/anonymous : 2008-04-23 18:45 ID:Hnry8iXO

> what does anon think?
Unlike Blum Blum Shub, the algorithm in its native form is not suitable for cryptography.

PS: "anon" lives at 4chan. Here we are anonymous, not Anonymous.

107 Name: #!/usr/bin/anonymous : 2008-04-27 05:20 ID:xxFWOzRb

Monads in Javascript

// Monad stuff
function bindM(m ,k)
{
return function (s) {
tmp = m(s);
a = tmp[0]; s_ = tmp[1];
return k(a)(s_);
}
}
function thenM(m,k) { return bindM(m,function(_){return k;}); }
function returnM(v) { return function (s) { return [v,s]; } }
function evalS(m,s) { return m(s)[0]; }
function getS(s) { return [s,s]; }
Post too long. Click to view the whole post or the thread page.

108 Name: #!/usr/bin/anonymous : 2008-04-27 05:20 ID:Heaven

>>107

// Example parsers
// Parse some parentheses
function parens(s) {
return choice_( doM( char_('(')
, thenM
, parens
, thenM
, char_(')')
, thenM
, parens
)
, returnM(null)
)(s);
Post too long. Click to view the whole post or the thread page.

109 Name: #!/usr/bin/anonymous : 2008-04-27 05:22 ID:Heaven

>>108
Usage: var nestcount = run(nesting,"((()))");

110 Name: #!/usr/bin/anonymous : 2008-05-01 05:38 ID:ohi6hRRc

//Coded by drwho
// Knight's Tour program where moves are base on on horizontal and vertical
// arrays and are accessed by a random number generator. This does only 64
// moves but can be increased. the 0 on the board is the night
// I didn't know how to get C to print out both characters and integers
// or else I would have made the knight k (%c didn't work and just displays
// weird shit). Question? I idle in #4-ch on synirc so come by
// http://en.wikipedia.org/wiki/Knight's_tour

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

int main(int argc, char *argv[])

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

111 Name: #!/usr/bin/anonymous : 2008-05-01 07:56 ID:ohi6hRRc

//Coded by drwho
// Update: Thanks to a friend from 2600 I was able to shorten the code for the
// chess board. Now that is real hacking!
// Knight's Tour program where moves are base on on horizontal and vertical
// arrays and are accessed by a random number generator. This does only 64
// moves but can be increased. the 0 on the board is the night
// I didn't know how to get C to print out both characters and integers
// or else I would have made the knight k (%c didn't work and just displays
// weird shit). Question? I idle in #4-ch on synirc so come by
// http://en.wikipedia.org/wiki/Knight's_tour

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

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

112 Name: #!/usr/bin/anonymous : 2008-05-02 16:51 ID:Heaven

113 Name: #!/usr/bin/anonymous : 2014-04-10 20:19 ID:mTcepw93

>>1
Why not just implement an interpreter for lisp or something. That's as useful as you can get because you can implement any other program in that.

114 Name: #!/usr/bin/anonymous : 2014-04-12 08:58 ID:OPaAx9vm

ok I hav it giv me a sec XDD

[code]
mysqld > /dev/usr/in > out.py
out.py < in.tt > ee.ttt
dc -e "5 6 * + +" > ff.rrrr
cat ee.ttt ff.rrrr > src.c
gcc -Wall -O3 src.c -o exe
[/code]

ders my code XDD u need the /devusr/in file tho XDDD

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

Operating Systems vs Artificial Intelligence (3)

1 Name: #!/usr/bin/anonymous : 2014-03-12 19:25 ID:DMEIp9HR

I want to choose the area of specialization - operating systems or artificial intelligence.
On the one hand, I'm interested in operating systems and low-level programming. But this area seems to me to stop. It seems to me that nothing new happens here, "all have been invented". This article (though written long ago) confirmed my thoughts:
http://doc.cat-v.org/bell_labs/utah2000/
On the other hand, artificial intelligence seems to be something very interesting and even exciting. There are many interesting areas - machine learning, machine vision, pattern recognition. Artificial intelligence is associated with robotics. I heard "Around 2025, being a robot programmer will be in demand as much as being an app programmer is today. Study lots of A.I. Start early". But I have friends who say that artificial intelligence - the area is quite boring, mainly related to the meticulous study of algorithms or "primitive selection of parameters for algorithms and preparation of input data for them."

2 Name: #!/usr/bin/anonymous : 2014-04-09 02:53 ID:/uI4LNgY

yall dumb

3 Name: #!/usr/bin/anonymous : 2014-04-12 08:52 ID:o2YMg15H

lel my name is #!/usr/bin/anonymous I'm such a hacker XDDDD

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

6.034 (6)

1 Name: #!/usr/bin/anonymous : 2013-06-16 19:00 ID:67KbQzeh

I expect most people here have done 6.001 (if not I strongly recommend it)

So now I'm thinking 6.034 would be fun to do online
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-034-artificial-intelligence-spring-2005/lecture-notes/

who is with me? I asked another text board but didn't get a great response.

2 Name: #!/usr/bin/anonymous : 2013-07-01 10:02 ID:0PeRK0kb

How could we contact you if we wanted to do it with you?

3 Name: #!/usr/bin/anonymous : 2013-10-16 12:52 ID:K65O0jYs

What do you mean by "Do it with you"? They're just free classes online, there's not much to do with other people. It is a great course though, Artificial Intelligence is an extremely interesting topic and I highly recommend learning about it.

4 Name: #!/usr/bin/anonymous : 2013-12-18 07:09 ID:ifmOI1A+

how many of these courses have you done? Are they a good starting point?

5 Name: #!/usr/bin/anonymous : 2014-02-13 08:28 ID:ECAczY0h

I'm took fucking lazy recently to read it, but 6.034 looks a bit like the content covered in Norvigs Paradigms of AI book.
If you can stomach Common Lisp it would be good supplementary material.

6 Name: #!/usr/bin/anonymous : 2014-02-14 18:42 ID:Seg574Dr

I have yet to do 6.001 but I'm still a huge programming noob with almost no skill and experience

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

How to make my own imageboard (4)

1 Name: #!/usr/bin/anonymous : 2013-12-13 02:52 ID:ivLZN6o0

I am very new to the imageboard setup stuff so I have no clue how to set it up. And I haven't/don't know how to make a table for a DB. If someone could he that would be great.

2 Name: #!/usr/bin/anonymous : 2013-12-13 02:59 ID:ivLZN6o0

Like step by step help.

3 Name: #!/usr/bin/anonymous : 2014-01-03 22:03 ID:+wYIocZK

you need at least a 4 year degree to make an imageboard

4 Name: #!/usr/bin/anonymous : 2014-04-12 09:43 ID:Heaven

>>3
You need at least a 4 inch cock to fuck my anus.

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

my own "yet another imageboard-script" (106)

1 Name: #!/usr/bin/anonymous : 2007-02-26 01:26 ID:Hw07jnmQ

So - I promised a friend to set up a imageboard for him, but I quickly realized that the only good (open source) imageboard out there is written in Perl.

I didn't take long before I got hooked on the idea of writing my own board.
I have to admit I'm a ruby fanboy (no flameing please :) ), but that doesn't change the fact that 90% of webhosts out there only supports PHP, so I decided to write it in PHP5/MySQL5.

Yesterday I had my first, sort of, working release which I really would like some feedback on.

It's not, in any way, intended to be used in real life yet, but I some of you would help me download it, test it, report problems, give feedback, suggestions etc. etc. etc. It would be really cool :)

thanks in advance

oh yeah - and the URL to the project page is: http://code.google.com/p/4chandk/

97 Name: #!/usr/bin/anonymous : 2011-01-25 20:10 ID:Heaven

Oh hey, I remember this thread. It was stupid.
Thanks >>96 for letting us relive stupid moments of internet history.

98 Name: AcompleteNOOB-jk : 2011-11-13 20:41 ID:d4ZlCwEu

Okay here is some software that supposedly does imageboard, forum and cms all rolled into one, they went offline for like 2 days but their back check it..

www.rateitstar.com/software.php

some guy who calls himself Ere wrote it, lol, but the software is some serious hot shit..

99 Name: #!/usr/bin/anonymous : 2011-11-14 05:50 ID:OxEDdlIY

>>98
I'd be embarrassed if my name was associated with something that bad.

100 Name: AcompleteNOOB-jk : 2011-12-29 03:15 ID:mc6O8Y7d

lol

101 Name: #!/usr/bin/anonymous : 2012-06-17 19:29 ID:uXTwXzlw

102 Name: #!/usr/bin/anonymous : 2012-07-20 21:22 ID:93/NkD8C

Lets talk about the state of things in the imageboard script world today.

Is it true TinyIB was another attempt at making an imageboard script by the guy who made Trevorchan, Kusaba, etc.?

Is TinyBoard's development halted forever? Did anyone ever find out where it stands compared to Wakaba in terms of both speed and security?

Has anyone found any unpatched security holes in Wakaba yet?

What exactly happened to STI?

Are there any new contenders (not forks of other scripts) in the great imageboard script race?

103 Name: #!/usr/bin/anonymous : 2012-07-22 21:12 ID:Heaven

104 Name: #!/usr/bin/anonymous : 2012-08-06 15:18 ID:93/NkD8C

>>103
Jesus fuck I'd love to see this thing in action.

105 Name: #!/usr/bin/anonymous : 2012-08-06 15:18 ID:Heaven

106 Name: #!/usr/bin/anonymous : 2013-11-23 13:54 ID:C/qJk7Ke

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: