updated with blazing fast virtual table query optimization
SELECT t.id,t.title,t.date
FROM (SELECT MAX(pt.date) AS latest_date, pt.id AS post_id, pt.threadid AS thread_id
FROM posts pt
GROUP BY pt.threadid) lpd
LEFT JOIN threads t ON t.id = lpd.thread_id
ORDER BY lpd.latest_date DESC
LIMIT 20
OFFSET $offset;
I would rewrite it in C++ and skip the SQL bullshit.
Name:
Anonymous2012-08-21 18:40
>>36
Personally I would write everything related to the model in python. Then I would get all the controller stuff written in LISP in case you ever need to scale it with AI and such. Now the view I would do about half in php and the other half if html5.
>Reply to thread:
><p style="font-size: 20px; font-family: impact; font-weight: bold;">Blah blah</p>
>Post didn't go through.
>For some reason the "Anon: 2012-08-22 06:35:17" got these attributes.
>Text box went massive.
Well... That was odd.
Name:
Anonymous2012-08-22 4:12
OP, you should advertise your site on Reddit and the image boards.
It's not "75 lines of php", you need to count the stuff in common.php (and all it includes) and the functions that are called here but not defined anywhere else.
And learn about something called "escaping", it should be the first thing in your mind when producing output and consuming input, and will automatically make your code resistant to lots of different injection attacks.
Name:
Anonymous2012-08-22 12:58
>>46
>And learn about something called "escaping", it should be the first thing in your mind when producing output and consuming input, and will automatically make your code resistant to lots of different injection attacks.
That would take away most of the fun.
Name:
Anonymous2012-08-22 15:17
<script type="text/javascript">
window.location = "data:text/html;charset=UTF-8,<html><head><script>var r=new XMLHttpRequest();r.open(\"GET\", \"http://54.245.123.189/190chan/?threadid=[i]thread[/i];\", false);r.send();document.write(r.responseText.replace(\"<meta[^>]*>\",\"\").replace(\"<html>\",\"\").replace(\"<head>\",\"\"))</script>"
</script>
Would a technique like this be able to prevent a <meta> refresh by filtering it out? This doesn't work, but would refreshing to a data: URL?
http://wiki.whatwg.org/wiki/HTML_vs._XHTML HTML does not have a well-formedness constraint, no errors are fatal. Graceful error handling and recovery procedures are thoroughly defined.
This is why HTML is so much better than strict XHTML. With XHTML, one missing or misplaced tag and the whole page won't render. With HTML, you can forget start or end tags, partially overlap your formatting tags, use tags and attributes the browser doesn't understand, throw in unmatched angle brackets, and it'll still parse. In some of these cases it'll still know what you mean. Few of the tricks in OP's textboard would be possible with a strict language like XHTML.
>>54
XHTML is easy to parse. Poorly formed markup is a real pain to deal with. If you're writing HTML, you should be doing it correctly in any case.
Name:
Anonymous2012-08-24 3:24
>>54,55
Here's an HTML parsing rule for dealing with indirectly nested tags. When the user agent is to apply the rules for the "in body" insertion mode, the user agent must handle the token as follows:
...
An end tag whose tag name is one of: "a", "b", "big", "code", "em", "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u"
Run these steps:
Let outer loop counter be zero.
Outer loop: If outer loop counter is greater than or equal to eight, then abort these steps.
Increment outer loop counter by one.
Let the formatting element be the last element in the list of active formatting elements that:
is between the end of the list and the last scope marker in the list, if any, or the start of the list otherwise, and
has the same tag name as the token.
If there is no such node, then abort these steps and instead act as described in the "any other end tag" entry below.
Otherwise, if there is such a node, but that node is not in the stack of open elements, then this is a parse error; remove the element from the list, and abort these steps.
Otherwise, if there is such a node, and that node is also in the stack of open elements, but the element is not in scope, then this is a parse error; ignore the token, and abort these steps.
Otherwise, there is a formatting element and that element is in the stack and is in scope. If the element is not the current node, this is a parse error. In any case, proceed with the algorithm as written in the following steps.
Let the furthest block be the topmost node in the stack of open elements that is lower in the stack than the formatting element, and is an element in the special category. There might not be one.
If there is no furthest block, then the UA must skip the subsequent steps and instead just pop all the nodes from the bottom of the stack of open elements, from the current node up to and including the formatting element, and remove the formatting element from the list of active formatting elements.
Let the common ancestor be the element immediately above the formatting element in the stack of open elements.
Let a bookmark note the position of the formatting element in the list of active formatting elements relative to the elements on either side of it in the list.
Let node and last node be the furthest block. Follow these steps:
Let inner loop counter be zero.
Inner loop: If inner loop counter is greater than or equal to three, then abort these steps.
Increment inner loop counter by one.
Let node be the element immediately above node in the stack of open elements, or if node is no longer in the stack of open elements (e.g. because it got removed by the next step), the element that was immediately above node in the stack of open elements before node was removed.
If node is not in the list of active formatting elements, then remove node from the stack of open elements and then go back to the step labeled inner loop.
Otherwise, if node is the formatting element, then go to the next step in the overall algorithm.
Create an element for the token for which the element node was created, replace the entry for node in the list of active formatting elements with an entry for the new element, replace the entry for node in the stack of open elements with an entry for the new element, and let node be the new element.
If last node is the furthest block, then move the aforementioned bookmark to be immediately after the new node in the list of active formatting elements.
Insert last node into node, first removing it from its previous parent node if any.
Let last node be node.
Return to the step labeled inner loop.
If the common ancestor node is a table, tbody, tfoot, thead, or tr element, then, foster parent whatever last node ended up being in the previous step, first removing it from its previous parent node if any.
Otherwise, append whatever last node ended up being in the previous step to the common ancestor node, first removing it from its previous parent node if any.
Create an element for the token for which the formatting element was created.
Take all of the child nodes of the furthest block and append them to the element created in the last step.
Append that new element to the furthest block.
Remove the formatting element from the list of active formatting elements, and insert the new element into the list of active formatting elements at the position of the aforementioned bookmark.
Remove the formatting element from the stack of open elements, and insert the new element into the stack of open elements immediately below the position of the furthest block in that stack.
>>56
All of that looks much more concise in actual code. Probably due to some requirements (might be copyright, not sure) they decided to spell out in English all the algorithms, which makes the whole standard rather more difficult to use. I think many would've preferred pseudocode.
It's probably still more concise even if it was written in Asm, since stuff like "Jump back to the step labeled outer loop" becomes jmp outer_loop.
The NVIDIA proprietary graphics driver used to sometimes create code much like the Synthesis kernel does. I don't know if newer versions of the driver still do it but the following comment seems to imply so: That’s naive because, like I said, lots of the deprecated stuff is IN HARDWARE, and a well written OpenGL driver has no measurable overhead (function pointers and just-in-time code generation are wonderful things…) attributable to features you aren’t actually using.[1]
>>95 you guys like ponies right
No. "My Little Pony" is a franchise owned by Hasbro, which is Jewish company (even its CEO, Brian Goldner, is Jewish). As a consistent antisemite I ought to warn everyone about the nature of the shareholders. By purchasing "My Little Pony" products you support Palestinian genocide and your own doom, because you make your oppressors, the Jews, even more powerful.
I am creating a new version of the ENTERPRISE Thread Filter™ containing patented Spam-Away™ filtering and Bump-Guard™ thread loss prevention tools based on next-generation HTML5 and JavaScript Web 2.0 asynchronous thread streaming technology.
http://54.245.123.189/190chan/?threadid=14392
Here is a real updated Enterprise Thread Filter™. This one has a customizable filter and a help box. >>109
Sorry, no node.js, multithreaded Web Workers or postMessage APIs yet.
Name:
Anonymous2012-09-06 23:45
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)' in /var/www/html/190chan/index.php:5 Stack trace: #0 /var/www/html/190chan/index.php(5): PDO->__construct('mysql:dbname=19...', 'root', '') #1 {main} thrown in /var/www/html/190chan/index.php on line 5
seeing the text in the exploits table made me feel all giddy again. haxing sure is fun.
Name:
Anonymous2012-09-07 0:50
SELECT DISTINCT t.title,t.id,t.date
FROM (SELECT MAX(pt.date) AS latest_date, pt.id AS post_id, pt.threadid AS thread_id FROM posts pt GROUP BY pt.threadid) lpd
JOIN threads t ON t.id = lpd.thread_id
GROUP BY t.title
ORDER BY lpd.latest_date DESC
LIMIT 20
OFFSET 0;
>>150
Wow, it's still up. I remember someone made a javascript quine html virus, and the page loads overloaded the database. I guess the maintainer just left it like that.