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: Anyone here using the Go programming language? (1) 2: Langton's ant (4) 3: [Sharing]Your personal projects[Inspiration] (78) 4: [Perl] CGI Sucks - the next best thing? (18) 5: [4-ch] [sh] Keep Updated on New 4-ch Posts [tools] (7) 6: I love the BASIC languages... (25) 7: 【Unix】new unix file types (22) 8: Agen Bola | Judi Bola | Casino SBOBET (9) 9: Anonymous BBS (18) 10: download lagu terbaru (5) 11: Free SMS/eMail On Anonymously (3) 12: website without protection (4) 13: How do you motivate yourself to learn (9) 14: Preferred Editor(s) (176) 15: Is this board alive? (4) 16: os suggestions (11) 17: Harga Lantai Kayu, Lantai Parket vs Lantai Vinyl (1) 18: Cobaqq.com Agen Judi Poker Online dan Bandar Domino (2) 19: Nissan, Mobil Terbaik Pilihan Keluarga Indonesia (2) 20: [perl] Kareha resources (21) 21: suckless unix tools (19) 22: Beginner programming. (21) 23: HAX MY ANUS (6) 24: Applescript (15) 25: UNIX redone (250) 26: GameBoy Color emulator in JavaScript (19) 27: Tcl/Tk (31) 28: Best language for starting out in functional programming? (22) 29: >EXPERT HTML PROGRAMMER (18) 30: my own "yet another imageboard-script" (116) 31: What is your definition of "freedom" ? (14) 32: Backup tweets (5) 33: Scala thread (4) 34: Live coding tool (5) 35: [Code Help]General code help?[PHP] (12) 36: Is Perl a dead language? (29) 37: How to make my own imageboard (6) 38: Interpreted vs. compiled labguages (30) 39: world4ch's /prog/ Emergency Shelter #4 (9) 40: This is the official /prog/riders thread (11)

Anyone here using the Go programming language? (1)

1 Name: #!/usr/bin/anonymous : 2016-12-03 00:26 ID:HL/XbUHA

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

Langton's ant (4)

1 Name: #!/usr/bin/anonymous : 2009-07-09 13:02 ID:JoKJPP6/

So I thought I'd implement Langtons ant without if, switch or the like:

#include <stdio.h>
#define W 8 //*32
#define H 256
#define CYCLES 12300

int main(){
short int x=W*16-1,y=H/2-1,d=2,c,dy,ax,bx,i;
int field[W][H];
for(i=0;i<CYCLES;i++){
x+=d/2+d%2+d%3%2-2;
dy=d%4+1;
y+=dy/2+dy%2+dy%3%2-2;
Post too long. Click to view the whole post or the thread page.

2 Name: #!/usr/bin/anonymous : 2009-07-23 13:56 ID:w+8oa1IK

Does it bite?

3 Name: #!/usr/bin/anonymous : 2009-07-23 20:43 ID:1YJaw5oA

#define DD(d) d/2+d%2+d%3%2-2
dy=d&3;d++;x+=DD(d);y+=DD(dy);
ax=x>>5;bx=(x&31)-1;c=field[ax][ay]>>b&1;
d+=c;d&=3;d++;field[ax][y]^=2<<bx;

4 Name: #!/usr/bin/anonymous : 2016-11-28 21:24 ID:lEKviQWD

dicks out for Harambe

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

[Sharing]Your personal projects[Inspiration] (78)

1 Name: #!/usr/bin/anonymous : 2014-11-08 13:20 ID:p3iUEkWT

What are your (current) hobby projects? What languages or libraries are you using? How usable or complete is it? What makes what you're doing novel or great?
No need to be smug or anything, or get all angry at other people for using <thing you hate>. Just share what you're up to. Add a URL if it's public too, if you want.

I'll start. I'm writing a stack-based language in Racket for use in embedded devices. It's already got Hindley-Milner style type inference, it just needs to actually produce output.
I'm also planning a modal text editor that feels like vim and a music-making program somehow.

But enough about me. Let's get some actual content on the front page of /code/.

69 Name: #!/usr/bin/anonymous : 2016-10-18 18:36 ID:Qum8m4HS

>>64
That's pretty cool. Sounds like you have some pretty beefy machines if you're at the stage of using elasticsearch and writing tools to help fuzz things. What kind of programs are you testing?

70 Name: #!/usr/bin/anonymous : 2016-10-18 19:09 ID:qT1jwscN

dicks out for Harambe

71 Name: #!/usr/bin/anonymous : 2016-10-29 17:24 ID:Ar0frgQ5

>>68
Yes, despite having never done any OOP or GUI work in my life I was able to get it up and running in about an hour. That's also due in part to the very nice documentation they have on their object/class-system and how the GUI system uses it.

72 Name: #!/usr/bin/anonymous : 2016-10-30 12:36 ID:+d2Zo5b2

I am writing a music program where the UI is an AKAI APC MINI and the instruments are the Korg volca beats/bass/keys.
I am using ChucK as the backend for IO and scheduling, via a protocol over OSC/UDP. Low-latency scheduling and input polling are very fiddly to get right, and ChucK does it perfectly.

73 Name: #!/usr/bin/anonymous : 2016-10-30 16:24 ID:/XKYs9lR

#include <stdio.h>

void main( int argc, char *argv[] )
{
printf("    ∧_∧   / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\n");
printf("    ( ´∀`) < "); puts(argv[1]);
printf("     /    |  \________\n");
printf("  /     .|\n");
printf("   /\"⌒ ヽ |.イ |\n");
printf(" __ |  .ノ || ||__\n");
printf("    ノく_つ ∪ ∪   \\n");
printf("__((_________\\n");
printf(" ̄ ̄ ̄ヽつ ̄ ̄ ̄ ̄ ̄ ̄ ̄ | |\n");
printf(" _____________| |\n");
printf("  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| |\n");
Post too long. Click to view the whole post or the thread page.

74 Name: #!/usr/bin/anonymous : 2016-11-02 14:39 ID:Ar0frgQ5

I've been so busy with classes that I haven't had any time for my project. It really sucks. I miss working on it, and I feel like my programming skills might atrophy if I don't use them.

75 Name: #!/usr/bin/anonymous : 2016-11-02 19:06 ID:CCbly2Ll

>>74
don't worry, they wont!

76 Name: #!/usr/bin/anonymous : 2016-11-02 20:16 ID:jdDDUZ5G

>>74
Nah, all you lose is what the hell you were doing on that project more than a week ago.

77 Name: #!/usr/bin/anonymous : 2016-11-11 04:15 ID:LzIwVuAW

dicks out for Harambe

78 Name: #!/usr/bin/anonymous : 2016-11-13 15:36 ID:cfTgRxUb

Just playing with making a very dumb sorta-BBcode-to-HTML converter in flex, just for the hack of it.

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

[Perl] CGI Sucks - the next best thing? (18)

1 Name: #!/usr/bin/anonymous : 2009-11-12 03:09 ID:RDYCNaIm

CGI sucks.

So, in order to make a super-duper fast "web application" big on the catchwords run fast enough that people don't moan about it, I find myself at a crossroad wondering which way to go. Any option if convincing enough will be fine (I'm a cowboy coder), so I want to see if anyone is awake enough to tell me what I should use.

mod_perl
Good News: Production grade, proven, lots of documentation, get the webserver control freak options.
Bad News: Morbidly obese worker processes even with "sharing" modules, need to separate dynamic from static greatly, restricted to Apache

Fast CGI
Good News: More than just Apache, Fast CGI servers need not be on the same machine
Bad News: Aparently Fast CGI is a pain in the ass for designing request flow.

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

9 Name: #!/usr/bin/anonymous : 2009-11-27 06:00 ID:Heaven

>>8
You have no idea what a UNIX system can do. You can't play with the hard limits unless you've got permissions.

10 Name: #!/usr/bin/anonymous : 2009-11-30 21:47 ID:+sZV6d3C

>>9
That, and most hosting providers also provide a Perl option, which isn't much different from C/C++ in terms of limiting and securing. (except for the fact that system administrators can read the source, which isn't quite as easy for compiled languages)

>>1
what >>2 said. I design my webapps for FastCGI, but use plain old CGI when debugging or adding new features (the downside of FastCGI is that code is not automatically reloaded when you make changes to it). Writing code that works in both CGI and FastCGI environments is quite easy.

11 Name: KnowItAll : 2009-12-13 00:29 ID:MZrTDkpY

>>1
Ifn' yer a cowboy yud write your own embedded web server.

12 Name: KnowItAll : 2009-12-13 00:34 ID:MZrTDkpY

Or try this one: http://code.google.com/p/mongoose/ Its actually pretty good.

13 Name: #!/usr/bin/anonymous : 2010-02-17 14:02 ID:dz6XcKsB

You could always use flash/actionscript or JAVA (or haskell, clisp/scheme, python, ruby on rails..) :/

14 Name: #!/usr/bin/anonymous : 2010-03-07 11:28 ID:Heaven

>>13
Haskell is great! Flash needs to die though, seriously.

15 Name: #!/usr/bin/anonymous : 2010-03-19 23:17 ID:Heaven

I use server-side javascript for all of my web development needs.

16 Name: #!/usr/bin/anonymous : 2010-04-05 13:07 ID:Heaven

>>15
Terrible!

17 Name: #!/usr/bin/anonymous : 2016-11-08 21:47 ID:eDs9vJS+

dicks out for Harambe

18 Name: komik hentai dan komik xxx : 2016-11-10 03:13 ID:XxjbYA64

great and thx

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

[4-ch] [sh] Keep Updated on New 4-ch Posts [tools] (7)

1 Name: #!/usr/bin/anonymous : 2016-10-19 12:44 ID:Lop6cfV3

Here's a script to help keep updated on new 4-ch posts since your last visit.

It downloads the HTML of each board and compares against the HTML from last time. If anything changed it lists that board as [NEW].

Makes it easy to look for new posts, you can edit the boards.txt file to only check on boards you are interested in checking.

2 Name: #!/usr/bin/anonymous : 2016-10-19 12:45 ID:Lop6cfV3

boards.txt:

[code]
general
dqn
iaa
img
req
tv
anime
manga
games
music
book
ascii

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

3 Name: #!/usr/bin/anonymous : 2016-10-19 12:46 ID:Lop6cfV3

#!/bin/sh

mkdir -p html

while read board; do
mv "html/$board.new.html" "html/$board.old.html"
curl -s -o "html/$board.new.html" "http://4-ch.net/$board/"
if ! diff -q "html/$board.new.html" "html/$board.old.html" > /dev/null 2>&1; then
echo "[NEW] http://4-ch.net/$board/"
fi
done <boards.txt

4 Name: #!/usr/bin/anonymous : 2016-10-19 17:05 ID:Heaven

How is this more advantageous than using an RSS reader for the boards that you do want to see?

Not that this is a bad exercise, I just don't see it a s too useful.

5 Name: #!/usr/bin/anonymous : 2016-10-20 00:56 ID:Lop6cfV3

>>4
you're welcome to use RSS...

6 Name: #!/usr/bin/anonymous : 2016-10-23 09:54 ID:Heaven

>>4
Every neat idea in the history of programming has a comment like this

7 Name: #!/usr/bin/anonymous : 2016-11-07 15:02 ID:mEnJYcwJ

dicks out for Harambe

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

I love the BASIC languages... (25)

1 Name: #!/usr/bin/anonymous : 2007-05-31 08:02 ID:JyQ2vqhR

There are several reasons....

A) Its fast
B) Its easy
C) Theres MANY variations of it
D) It can be really good depending which BASIC you use
E) One of the first languages =P

Anyone else here a fan of BASIC languages (or RAD such as Delphi?)

16 Name: #!/usr/bin/anonymous : 2008-05-11 23:01 ID:YwRF6IVe

freebasic
its C with basic syntax, just alot harder to learn because you dont have a stupendous amount of tutorials to start with
youll have to learn it the hard way, or not at all :)
i use it, and ive been using C for a long long time

17 Name: #!/usr/bin/anonymous : 2008-05-11 23:03 ID:Heaven

>>16
> just alot harder to learn because you dont have a stupendous amount of tutorials to start with
A lot of inaccurate tutorials written by clueless idiots?
Maybe you don't have these in freebasic, but I don't see this as a bad thing.

18 Name: #!/usr/bin/anonymous : 2008-05-11 23:11 ID:YwRF6IVe

me neither, it was merely a heads up for those who think its a walk in the park just because it ends with "basic"
still, its a refreshing language and its multiplatform
i expect no less though

var t = threadcreate( cast(sub(byval as any ptr), @exit_on_escape), @sock )

var s = !"HTTP/1.0 200 OK\n" & !"Content-Type: text/html\n" !"Connection: Close\n\n"
s += !"<html> <head> <title> empty page </title> </head> <body> Hi. </body> </html>"

dim as socket_info si
do

dim as socket new_sock
Post too long. Click to view the whole post or the thread page.

19 Name: #!/usr/bin/anonymous : 2008-05-11 23:13 ID:Heaven

>>18
I don't know what you do, but writing a board that's on top of an http is clearly a bad idea.
As for telnet, why not use sshd?
Telnet's not safe...

20 Name: #!/usr/bin/anonymous : 2008-05-11 23:16 ID:YwRF6IVe

it IS the httpd, and yes it will be secure - eventually
first things first.. i just started with fb and i have to look at the keyword list as im going

21 Name: #!/usr/bin/anonymous : 2016-09-19 03:10 ID:VONokSwN

I am a PureBasic user,
Basic is the best programming language for all me because I don't
need to make softwares as a job.

22 Name: #!/usr/bin/anonymous : 2016-10-07 05:55 ID:p/chzj6k

>>5,6
I always found the term "online help" to be confusing back in those days, apparently it's a holdover from the days when documentation was normally a physical book that came with the program.

23 Post deleted.

24 Name: #!/usr/bin/anonymous : 2016-10-18 18:32 ID:Heaven

>>19
Unless you're running a CGI server then that's how it's done.
Also, telnet just sits on top of TCP. You could upgrade to ssh no problem.

25 Name: #!/usr/bin/anonymous : 2016-11-06 03:59 ID:8fTpYQRH

dicks out for Harambe

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

【Unix】new unix file types (22)

1 Name: #!/usr/bin/anonymous : 2015-07-10 22:20 ID:t1CnYWeK

I was thinking of some file types that afaik don't exist.

One is filesystem entries of files stored in memory from disk files, updated when the disk file modification time changes. This would be a big disk-access optimization in some cases.

The in-memory entry permissions would be ignored, and writing to it would write to the disk file.

Another one is dynamic files that (only) have the name of a executable, which when opened would be executed by the kernel, creating a process child of init with its standard output piped to the file descriptor obtained by opening the dynamic file.

Here reading would depend on both the dynamic file's read permission and the named executable's execute permission. The idea is that it's transparent to the reading process.

Whether they could change the file to which they point to without deleting it would depend on the implementation, I think. (https://en.wikipedia.org/wiki/Symbolic_link#Variable_symbolic_links)

13 Name: #!/usr/bin/anonymous : 2015-12-31 12:39 ID:Heaven

RAM is really expensive though.

14 Name: #!/usr/bin/anonymous : 2016-07-23 04:37 ID:3Yvi0TSj

>>4
OS development is a major undertaking, it's not the sort of thing you can do in a weekend, especially considering it requires low-level programming techniques that are avoided in modern application development. The appeal of things like Linux and BSD is that the hard work is already done for you, but unlike Windows or Apple operating systems you have the freedom to modify the user interface (which is all most people really care about, messing around "under the hood" is really only called for when working with embedded systems or mainframes, where you need to get every last bit of performance out of the machine - and only low level programming specialists really have the ability to effectively optimize in those areas, anyway). And the UNIX architecture, although rather old, wasn't really made for "mainframes", one of its main advantages at the time was that it could run on lower-end systems.

15 Name: #!/usr/bin/anonymous : 2016-07-23 23:33 ID:r1UKj3cT

>>14
All sort of things require low-level programming.

16 Name: #!/usr/bin/anonymous : 2016-07-25 02:31 ID:5UP++Rz8

>>10
I think I understand your idea.
How about a daemon that handles that stuff? You give the daemon the name of a script and of a fifo. Your daemon calls inotify on the fifo and waits. When one of the registered fifos is open, the daemon triggers the script with it's output descriptor directed to the fifo.

17 Post deleted.

18 Name: #!/usr/bin/anonymous : 2016-10-05 03:09 ID:VgjjOm7C

>>16
It is an idea that has already been implemented at the socket level: inetd[1]. It is a system that spawns a specified process when a connection to a port/socket has been opened. No fancy inotify crap.

Also, systemd supports all of this, including FIFOs.[2]

1: https://en.wikipedia.org/wiki/Inetd
2: http://0pointer.de/public/systemd-man/systemd.socket.html

19 Name: #!/usr/bin/anonymous : 2016-10-05 04:07 ID:Heaven

>>18
Also, inetd can work with unix domain sockets, as well as TCP and UDP sockets.
> Unix domain sockets use the file system as their address name space. Processes reference Unix domain sockets as file system inodes,

20 Name: #!/usr/bin/anonymous : 2016-10-05 08:35 ID:QkyVH69a

[b][o][u][i]Meta-Circular Evaluation[/i][/u][/o][/b]

21 Name: #!/usr/bin/anonymous : 2016-10-23 04:12 ID:ICqxOM/F

dicks out for Harambe

22 Name: #!/usr/bin/anonymous : 2016-11-06 20:21 ID:Heaven

>>15
Is that supposed to make it any simpler?

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

Agen Bola | Judi Bola | Casino SBOBET (9)

1 Post deleted.

2 Post deleted.

3 Name: #!/usr/bin/anonymous : 2016-10-20 22:31 ID:vhfNbg/0

`like so`

4 Name: #!/usr/bin/anonymous : 2016-10-20 22:32 ID:vhfNbg/0

like so

5 Name: #!/usr/bin/anonymous : 2016-10-20 22:36 ID:vhfNbg/0

like so

6 Name: #!/usr/bin/anonymous : 2016-10-20 22:36 ID:vhfNbg/0

7 Name: #!/usr/bin/anonymous : 2016-10-20 22:37 ID:vhfNbg/0

<!---->

8 Name: #!/usr/bin/anonymous : 2016-10-20 22:37 ID:vhfNbg/0

<!---->

9 Name: #!/usr/bin/anonymous : 2016-10-20 22:42 ID:vhfNbg/0

:<!eee

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

Anonymous BBS (18)

1 Name: #!/usr/bin/anonymous : 2011-02-05 15:50 ID:oTmDGJqD

Hello /code/.

Shiichan sucks and is written in PHP. Kareha sucks, is written in Perl (which causes more issues than anything else ever could when trying hard to do so) and doesn't scale well at all, seeing how a board of just the size of 4-ch needs to use archiving scripts in order to keep things running smoothly.

Is there any sane BBS software out there or do I have to try and do it myself, despite not being too much of a coder?

9 Name: aabb : 2016-04-09 07:45 ID:dh64D7m9

AOMEI Backupper is the simplest FREE backup software with system/disk/partition/file backups and system/disk clone. http://www.backup-utility.com

10 Name: Anonymous : 2016-04-10 18:36 ID:p2f3F9Ip

helpme

11 Name: #!/usr/bin/anonymous : 2016-05-30 04:06 ID:Heaven

I only use BBS written in Go... heh

12 Name: #!/usr/bin/anonymous : 2016-07-18 02:58 ID:VdxdaZg+

Have you considered <del>converting to Scientology and discovering what Lord Xenu wants for you</del> I mean Re-writing it in Rails?

13 Name: #!/usr/bin/anonymous : 2016-09-30 11:57 ID:Heaven

Use textboard mode in TinyIB and edit CSS so it looks more like a traditional textboard.

Other than that you're absolutely fucked anon. Try making one yourself.

14 Name: #!/usr/bin/anonymous : 2016-10-10 12:51 ID:rNt4oZLT

guys what do you think of weabot.py (what bienvenidoainternet uses)

https://github.com/z411/weabot

15 Name: #!/usr/bin/anonymous : 2016-10-16 01:17 ID:Heaven

>>14
sucks

16 Name: #!/usr/bin/anonymous : 2016-10-16 06:03 ID:YO1c9e+2

>>15
care to elaborate?

17 Post deleted.

18 Name: #!/usr/bin/anonymous : 2016-10-30 13:37 ID:Heaven

>>16
sucks ass

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

download lagu terbaru (5)

1 Post deleted.

2 Post deleted.

3 Name: #!/usr/bin/anonymous : 2016-05-19 22:49 ID:9dccbNEn

Welcome to...Anal

4 Name: #!/usr/bin/anonymous : 2016-07-03 03:23 ID:JKtBY3LW

Welcome to die

5 Post deleted.

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: