Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Shiitchan can't be shittier

Name: Anonymous 2010-08-31 8:10

Discuss.

Name: Anonymous 2010-08-31 8:14

It could have images.

Name: Anonymous 2010-08-31 8:15

It does.

*.g.o.a.t.s.e.x.*.g.o.a.t.s.e.x.*.g.o.a.t.s.e.x.*
 g...............................................g
 o./.....\.............\............/....\.......o
 a|.......|.............\..........|......|......a
 t|.......`..............|.........|.......:.....t
 s`........|.............|........\|.......|.....s
 e.\.......|./......./..\\\...--__.\\.......:....e
 x..\......\/..._--~~..........~--__|.\.....|....x
 *...\......\_-~....................~-_\....|....*
 g....\_.....\........_.--------.______\|...|....g
 o......\.....\______//._.___._.(_(__;..\...|....o
 a.......\......C.___)..______.(_(____;..|../....a
 t......./\.|...C.____)/......\.(_____;..|_/.....t
 s.....././\|...C______)..()....(___;...|...\....s
 e.....|...(..._C_____)\______/..//._/./.....\...e
 x.....|....\..|__...\\_________//.(__/.......|..x
 *....|.\....\____)...`----...--'.............|..*
 g....|..\_..........___\......./_.........._/.|.g
 o...|............../....|.....|..\............|.o
 a...|.............|..../.......\..\...........|.a
 t...|.........././....|.........|..\...........|t
 s...|........././......\__/\___/....|..........|s
 e..|........././........|....|.......|.........|e
 x..|..........|.........|....|.......|.........|x
 *.g.o.a.t.s.e.x.*.g.o.a.t.s.e.x.*.g.o.a.t.s.e.x.*

Name: Anonymous 2010-08-31 8:32

meta-threads make it shittier

Name: Anonymous 2010-08-31 8:35

/prog/ should have sage filled in in the e-mail field by default.

Name: HAXUS THE DEFAULT FIELD 2010-08-31 9:25

HAXUS THE DEFAULT FIELD

Name: Anonymous 2010-08-31 10:17

I don't understand this hatred for shiichan. I seriously think that you people hate it just because it's written in PHP.

It's pretty much the exact same thing as 2ch's 0ch software except it is in PHP instead of Perl.

Name: Anonymous 2010-08-31 10:44

>>7
Maybe if you tried using it, you would understand.

Name: SHIICHAN 2010-08-31 10:48

>>7
Ignore this OK

Name: Anonymous 2010-08-31 10:51

>>7
http://dis.4chan.org/read/prog/1266433415/1000-
http://dis.4chan.org/read/prog/1220718054
http://dis.4chan.org/read/prog/1277476613
http://dis.4chan.org/read/prog/-2147483648
http://github.com/Cairnarvon/progscrape/commit/ad4f41ff2d4e7aca1d90294ef16c50e19c75dc96 (line 214)

To name just a few. It's incredibly buggy, and even the things that work as intended aren't very good (like the tripcode algorithm). There's more to being ``the exact same thing'' than just copying the stylesheet.

Name: Anonymous 2010-08-31 11:06

>>10
1st thread: So what? Is posting over 1000 replies that bad? I know that it is usually spam but some threads in other boards actually do go to all the way to the 1000 post limit with actual conversation.

2nd thread: That was just a confusing thread altogether.

3rd thread: Just an idiot with a spambot.

4th thread: I'll be honest.. I have no idea how that happened. But it's not even that big of a deal though.

What I meant about it being 66The exact same thing99 is that it controls multiple boards by using one installation and is very close to the original files if you compare to two's code.

Name: Anonymous 2010-08-31 11:07

Try, for instance, to enclose an url between < and >.

Expected:
<http://dis.4chan.org/prog/>;

Shiited:
<http://dis.4chan.org/prog/>;

Name: Anonymous 2010-08-31 11:09

>>12
darn, I failed, however I didn't write the ; at the end.

It used to appear some random target="_blank">

Name: >>12,13-kun 2010-08-31 11:14

Name: Anonymous 2010-08-31 11:35

>>11
Do these really need explaining?

1. 'Over 1000 Thread' posts should mean that you cannot post to the thread any more. It's clear that that is not the case.
2. Look at the thread title. That is what the entry in subject.txt is meant to say. It also contains a newline and the poster's IP. None of that should happen.
3. Again with the thread title, see also the page <title>. Also, try making a thread with nothing in the contents box. That thread should not happen.
4. Perhaps the existence of a negative thread ID is not a big deal to you.

See also the multiple BBCoded threads that entirely fucked up the front page when they were there.

Name: Anonymous 2010-08-31 11:42

I also enjoyed the newline bug, though it's been fixed now. If you put a newline in the name or email field, it wouldn't filter it out. And because Shiichan stores posts in flat files, this created a completely blank post in addition to a mangled regular one.
A lot of shit threads got shut down by a few newlines.

Name: Anonymous 2010-08-31 11:43

Any ideas on how I could make this program run faster?
It's supposed to run under 0.5 seconds.
In some cases it does, in others it fails.
[b]The task : [/b]

INPUT:
From the first line of the standard input read one integer (5 <= n <= 100000). Each of the following n lines will have one of the following two formats:

- 1 a - meaning that Mirko said aloud the number a, (0 <= a <= 65535).
- 2 k - meaning that Mirko asks what is the kth smallest number he has said so far. k will always be less or equal to the number of numbers Mirko has said aloud so far.

The total number of different number will not be bigger than 400, but some of the numbers can repeat!

OUTPUT:
To the standard output write one line for each of the 2 k inputs. Representing the kth smallest number at that moment.


Input:
7
1 0
1 1
1 5
2 1
2 3
1 2
2 3

Output:
0
5
2

My solution :

#include <stdio.h>
int main(){
    unsigned short int * a;
        unsigned int n,j,x,y;
    int m=-1;
    scanf("%u",&n);
    a=new unsigned short int[n];
    while (n>0){
        n=n-1;
        scanf("%u %u",&x,&y);
        if (x==1){
            m=m+1;
            j=m;
            a[j]=y;
            while((j>0)&&(a[j]<a[j-1])){
                y=a[j-1];
                a[j-1]=a[j];
                a[j]=y;
                j=j-1;
            }

        }
        else printf("%u\n",a[y-1]);
    }
    delete [] a;
    return 0;
}


Sadly it doesn't work anymore :-(

Name: Anonymous 2010-08-31 11:45

>>18
You obviously haven't implemented The ABC Programming Language correctly, it would be trivial to use it to solve your problem.

Name: Anonymous 2010-08-31 11:50

>>19
Mr. >>18 didn't post that because he wants help with the problem; he posted it because that's the post that turned everything below it italic, before it was fixed.

Name: Anonymous 2010-08-31 12:10

>>20
I just wanted to mention The ABC Programming Language.

Name: Anonymous 2010-08-31 12:15

>>21
I thought it only worked as the first post in the thread, or something.

Name: Anonymous 2010-08-31 13:30

>>23
I think that if you have italic text spanning the point where it cuts off your post it will work. I would test this theory, but /prog/ is already shitty enough.

Name: Anonymous 2010-08-31 16:25

Name: Anonymous 2010-08-31 20:29

Name: Anonymous 2010-08-31 20:39

>>26
It has been reported in #world4ch:

15:47:42 < Cairnarvon> MrVacBob: http://dis.4chan.org/read/prog/1185503496
15:47:53 < Cairnarvon> That thread exists in subject.txt, but no longer loads.
15:48:01 < Cairnarvon> It used to load in HTML, but not JSON.
15:48:18 < Cairnarvon> Someone was making blank posts, so I'm guessing there's a fairly important bug there.
15:51:32 <@MrVacBob> oh
15:51:50 <@MrVacBob> the bbcode engine doesn't have an output limit

Name: Anonymous 2010-09-01 1:47

Why does /prog/scrape die when it encounters an error like that instead of skipping the thread and continuing?

Name: Anonymous 2010-09-01 4:56

Xarn, my boy.

    if resp.getheader('Content-Encoding') == 'gzip':
        return gzip.GzipFile(fileobj=StringIO(resp.read()))
    else:
        return resp


Why would you do this? You know that the else is being taken by virtue of the control flowing to that point, making the else completely superfluous and unnecessary.

Plus, supposing you decide to change the else to an if (since we've established that else if is utterly pointless), it's possible that there's no return statement at all in the function because both of the return branches won't be taken.

Name: Anonymous 2010-09-01 5:22

>>28
Because simplejson decided the empty string isn't a valid JSON object, for some reason. Which is weird, but a good thing in this case, or nobody would have noticed.

>>29
I don't think you even know how to program.

Name: Anonymous 2010-09-01 5:50

>>30
Implying any language allows the function to finish after a return statement is reached

Name: Anonymous 2010-09-01 7:04

>>31
Of course it could, I'll show an example here (this is in Lisp, but it can just as easily be done in C, C++, C#, Java or any more "traditional" imperative languages):

(defun some-function (signal-error) 
  (block nil
    (ignore-errors 
      (unwind-protect
           ;; the return form is unneeded as
           ;; returns are implicit in CL, but I've
           ;; included it to illustrate the point
           (return
             (prog1
                 (print "In RETURN")
               (when signal-error
                 (error "Oh no. Something bad happened."))
               (print "In PROG1")))
        (print "In protected area")))))

(some-function nil)
; Prints
;"In RETURN"
;"In PROG1"
;"In protected area"
(some-function t)
; Prints
;"In RETURN"
;"In protected area"

As you can see, the function finished just find after a return "statement" was executed, not only that, things located lexically after the return statement were also executed. (In case you didn't figure it by now, UNWIND-PROTECT is like try{}finally{} in more imperative languages. It's code which is ALWAYS executed, regardless if some form of transfer of execution happened or not (like conditions(similar to what you call exceptions) or go(to))).

Name: Anonymous 2010-09-01 8:32

>>32
Thanks for being deliberately obtuse.

Even if an exception does pop up in
    if resp.getheader('Content-Encoding') == 'gzip':
        return gzip.GzipFile(fileobj=StringIO(resp.read()))

the else is still useless and that, in fact, proves my point that there should be a return value outside of any if scope in the function.

Consider:
    try:
        if resp.getheader('Content-Encoding') == 'gzip': return gzip.GzipFile(fileobj=StringIO(resp.read()))
           else: return resp
    except: pass


There is no return value if an exception is thrown there. I'm not sure how Python treats this case (of assignment to a function with no return value), but it probably assigns the value of the variable to None.

The overarching point is that there's never a good reason to do the if return else return idiom; maintainability and clarity both increase (maintainability in multiple ways) when you avoid using that idiom and it doesn't cost anything. In fact, using it costs those things.

Name: Anonymous 2010-09-01 14:44

>>30
So if the server happened to give you a valid json string with a 500 status, /prog/scrape wouldn't notice? That seems like a bad thing. HTTP status codes exist for a reason.

Name: Anonymous 2010-09-01 15:48

>>29,31,33
I don't know what you think that snippet of code does, but your criticism of it is complete nonsense.

>>34
A HTTP status code that isn't 200 will cause httplib to throw an exception.

Name: Anonymous 2010-09-02 2:06

>>35
What it does is irrelevant. Perhaps you could use some additional reading comprehension.
You know that the else is being taken by virtue of the control flowing to that point, making the else completely superfluous
The overarching point is that there's never a good reason to do the if return else return idiom; maintainability and clarity both increase (maintainability in multiple ways) when you avoid using that idiom and it doesn't cost anything. In fact, using it costs those things.
My criticism of it (supposing you're still ignorant of it by this point) is that the idiom completely disregards logic and has costs.

In case you're still missing the point, the criticism is not exclusive to your code. You could have something like
def getval(testval):
    if testval == 10: return 'a'
    elif testval == 21: return 'b'
    else: return 'c'

It would still be just as retarded. The code is much more understandable and maintainable if you do it the logical way:
def getval(test):
    if testval == 0: return 'a'
    if testval == 1: return 'b'
    return 'c'

Name: Anonymous 2010-09-02 2:07

>>36
testval* in the second function definition, but the point stands.

Don't change these.
Name: Email:
Entire Thread Thread List