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

【Unix】new unix file types (21)

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. (

12 Name: #!/usr/bin/anonymous : 2015-11-29 02:15 ID:C+mJgx35

>How would you change the target program?

Similar to changing other files, probably.

>Perl uses this idea - opening a subprocess is identical to opening a file, but the filename begins with a pipe.

Kinda like the POSIX popen interface, yeah. But having to use special interfaces or languages falls short of transparency.

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

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

All sort of things require low-level programming.

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

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

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]


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

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

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

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


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

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

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



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


mkdir -p html

while read board; do
mv "html/$" "html/$board.old.html"
curl -s -o "html/$" "$board/"
if ! diff -q "html/$" "html/$board.old.html" > /dev/null 2>&1; then
echo "[NEW]$board/"
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

you're welcome to use RSS...

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

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

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

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

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/.

61 Name: #!/usr/bin/anonymous : 2016-07-14 06:43 ID:4ybVfbAa

A wiki

62 Name: #!/usr/bin/anonymous : 2016-07-25 02:40 ID:I+0J1suI

an irc bot in ruby. It's almost done, but right now I'm tired of writing it. The first days were really fun but now the final feature it lacks kinda requires another rewrite of some major components.
Anyway the bot is supposed to be general purpose, easy to configure, and also easy to manage and enhance once it's running.
Then I want to write a packet capture program with batteries included. Something with slightly more features for interactive traffic analysis.
Other futures I might take some time in the future is an interactive debugger for ruby, an Interactive Fiction Z-machine compiler, a BBS engine... maybe a MUD engine.
I have a bunch of ideas.

63 Name: #!/usr/bin/anonymous : 2016-08-14 06:25 ID:Ar0frgQ5

I'm working on a roguelike. It's really tedious, but enjoyable. I kinda burned myself out on my last project because I didn't realize what a large undertaking it would be, but after some rest I'm comfortable with how long this might take. Tackling problems in small bites makes it pleasant, and stops me from feeling like I'm being crushed by how much there is or could be to add.

Right now I have maybe half of a barebones level generator written along with a placeholder UI. You can push an @ around the screen. After I'm done with levels, I'll get around to player/non-player-characters.

64 Name: #!/usr/bin/anonymous : 2016-08-16 21:08 ID:hHP9KTOC

Writing a crash triage tool so I can fuzz at a larger scale.
Want to be able to have all my crashes end up in elasticsearch, so I can have pretty graphs of crashes by type. Writing my tool in python and using lldb's python API. Does most of what I need it to do, just need to get some more useful tests and set up how it gets called.
Was inspired by Ben Nagy's talk from Infiltrate 2015.

65 Name: #!/usr/bin/anonymous : 2016-08-25 11:46 ID:4ybVfbAa

I enjoy hearing about your projects

66 Name: #!/usr/bin/anonymous : 2016-08-26 21:23 ID:CIBpMTtj

What language/libraries are you using? I've been wanting to make a roguelike for a while, but getting it to display nicely would seem to require something like curses or conio.

67 Name: #!/usr/bin/anonymous : 2016-08-29 02:23 ID:Ar0frgQ5

I'm using Racket Lisp. There's not really any need for a curses library if your language has a GUI library, unless you deliberately want to limit yourself to terminal-only play. It took me a little while to get used to basic OOP for frames and windows, but I don't need much except for displaying arbitrary characters/text, and that's very easy to do.

68 Name: #!/usr/bin/anonymous : 2016-10-17 21:00 ID:Qum8m4HS

Racket's GUI stuff is the best I've ever used.
It's also got the standard ncurses bindings somewhere (or maybe not and I had to generate it for myself) or at least some ansi terminal library, if you ever wanted to go curses again. Have fun!

Meanwhile I'm the guy who tried to set up GuixSD. I'm running NixOS very happily now.
I've been laying groundwork and writing the necessary libraries to write a Game Boy Advance game in very-type-safe Haskell.

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

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

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

I love the BASIC languages... (24)

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?)

15 Name: !!+V71xE13 : 2008-05-09 21:02 ID:7CCi9+Ql

QBasic and friends were just magic. imo its like windows today in some way: as long as the user isnt that experienced he wont do anything causing serious problems. its quiet difficult to code errors that arent easy to find or really kill your machine. it took me a while in port programming before i decided to set that alternating bit on port 4 of a 486 to a constant value and after that i needed to reinstall DOS:-)

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

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

> 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

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

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

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

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.

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

Anonymous BBS (17)

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?

8 Name: #!/usr/bin/anonymous : 2011-02-09 16:02 ID:Heaven


My point was that the language of a tool is not reason for it to be considered bad. Your reasons against shiichan are due to poor coding practices, not simply because it was written in PHP. You could find a poorly coded application in any language, but that in itself is not a reason to dislike that language. You shouldn't dislike well written applications simply because of the language that they were written in either.

Personally, I don't like PHP and no longer use it for new projects. Is that going to stop me from using a PHP application if it is the "best" tool for the job? No.

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.

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


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 (what bienvenidoainternet uses)

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


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

care to elaborate?

17 Post deleted.

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

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...

Free SMS/eMail On Anonymously (3)

1 Name: Anonymous : 2016-04-10 19:46 ID:UsRG3pZ6

Please anyone describe here the process of sending SMS on any mobile phone anonymously or sending emails anonymously.

2 Name: Anon : 2016-04-11 22:08 ID:jCQZPiwH

you can use twilio. but your privacy is protected

3 Name: #!/usr/bin/anonymous : 2016-10-12 21:44 ID:Heaven

  1. ask to borrow a stranger's phone
  2. send SMS and/or email
  3. destroy phone
Name: Link:
Leave these fields empty (spam trap):
More options...

website without protection (4)

1 Name: anyone : 2016-03-24 15:17 ID:zj0nyDOS

found a website without protection

user & pass: admin

how to fix this bug ?

admin link :

2 Name: #!/usr/bin/anonymous : 2016-03-24 17:31 ID:Heaven

Send them a condom in the mail

3 Name: #!/usr/bin/anonymous : 2016-03-29 04:18 ID:VsZwb3MW

Use it first before sending

4 Name: #!/usr/bin/anonymous : 2016-04-03 10:27 ID:Heaven

On its way.

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

How do you motivate yourself to learn (9)

1 Name: #!/usr/bin/anonymous : 2015-09-14 11:00 ID:ravr0/GJ

I want to be a professional programmer because I'm under the impression programmers don't have to speak that much. The only programming language I know is Java because I took a few classes. I liked learning Java, and it came easy to me, but even though I want programming to be my job, I don't want to learn any more-- I prefer drawing manga pictures (which I'm bad at). What should I do?

2 Name: #!/usr/bin/anonymous : 2015-09-15 06:07 ID:eVO8uri8

remove your ribs and try to get your own penis into your mouth :)

3 Name: #!/usr/bin/anonymous : 2015-09-15 15:18 ID:wlWuGn/k

speaking is fun nigga

4 Name: #!/usr/bin/anonymous : 2015-12-19 00:32 ID:yPYCmGLs

yo will need to remove some spine and muscle too
or soak them in vinegar to make them more flexible
or just do yoga goddamn

5 Name: #!/usr/bin/anonymous : 2016-02-02 03:12 ID:4bT9fuRi

Get better at drawing manga and hope for the best. Programming as a job involves working in teams and lots of communication.

6 Name: #!/usr/bin/anonymous : 2016-02-03 18:36 ID:9fLlvazV

Along with this question on motivation, how can you motivate yourself to program for multiple hours straight?

7 Name: !EwEZeQwchU : 2016-03-09 21:58 ID:loUawEK0

have a grand plan in your head, when you get bored take a look at the bigger picture and think about what to do next, your interest in the subject will grow

8 Name: #!/usr/bin/anonymous : 2016-03-22 03:15 ID:9fRP4I+C

Yeah, I agree with >>5. If you are going to get programming as your job, you will communicate alot. As you need to explain your code to your team, and explaining the functions of your program to your client/boss.

As for >>6, I'm motivated to program for multiple hours when I know that I am getting progress at coding the program.

9 Name: #!/usr/bin/anonymous : 2016-03-22 19:26 ID:wcj6jE3J

Give yourself a sequence of small, defined goals that you know you can easily achieve and that follow on from each other. I'm talking less than half an hour for each thing; you want to be able to know you can do it soon, but don't bother planning any smaller than that - tedium isn't fun.
Make sure that you can tell whether the thing works once you've done it for the sense of achievement, and the "Cool, now I've got that working, I can do this!" that follows.
Do this plan for a couple of different areas of your project so you have more to work on if you get stuck.
Optional: drink coffee and booze alternately. YMMV.

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

New thread

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