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

Why browsers are bloated

Name: Anonymous 2014-07-27 0:20

https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/Scrollbar.cpp
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Let's reinvent the fucking scrollbar, which every goddamn platform with a UI already has, and make it behave subtly different from the native one!

Right-click a native scrollbar in some other app:
- Scroll Here
- Top
- Bottom
- Page Up
- Page Down
- Scroll Up
- Scroll Down

Right-click a scrollbar in Chrome:
- Back
- Forward
- Reload
- Save As...
...

Right-click a scrollbar in Firefox and Opera:
Absolutely fucking nothing happens!

What the fuck!? How did these terminally retarded idiots get involved in creating one of the most important pieces of software to the average user?

Name: Anonymous 2014-12-17 0:32

I stole the following code and it tells me >>495 is a LIAR. He didn't get a palindrome as he claims!

module Main

import Decidable.Equality

%default total

data U : List a -> Type where
nil : U (List.Nil {a})
one : (x : a) -> U [x]
two : (x : a) -> (u : U xs) -> (y : a)
-> U (x :: xs ++ [y])

index : (n : Nat) -> Vect k a -> Vect k a -> List a
index Z xs ys = []
index (S Z) (x :: xs) (y :: ys) = [x]
index (S (S n)) (x :: xs) (y :: ys) = x :: index n xs ys ++ [y]
index (S n) [] [] = []

build : (n : Nat) -> (xs : Vect k a) -> (ys : Vect k a) -> U (index n xs ys)
build Z xs ys = nil
build (S Z) (x :: xs) (y :: ys) = one x
build (S (S n)) (x :: xs) (y :: ys) = two x (build n xs ys) y
build (S n) [] [] = nil

postulate eq : (xs : List a) -> index (length xs) (fromList xs) (reverse $ fromList xs) = xs

toU : (xs : List a) -> U xs
toU xs = replace (eq xs) $ build (length xs) (fromList xs) (reverse $ fromList xs)

data Palindrome : List a -> Type where
p0 : Palindrome (List.Nil {a})
p1 : (x : a) -> Palindrome [x]
p2 : (x : a) -> (u : Palindrome xs) -> Palindrome (x :: xs ++ [x])

isPalinU : DecEq a => {xs : List a} -> U xs -> Maybe (Palindrome xs)
isPalinU nil = Just $ p0
isPalinU (one x) = Just $ p1 x
isPalinU (two x u y) with (decEq x y)
isPalinU (two x u x) | Yes Refl = p2 x `map` isPalinU u
isPalinU (two x u y) | No neq = Nothing

isPalindrome : DecEq a => (xs : List a) -> Maybe (Palindrome xs)
isPalindrome xs = isPalinU $ toU xs

partial
main : IO ()
main = do
input <- unpack . trim `map` getLine
putStrLn $ case isPalindrome input of
Just p => "yes"
Nothing => "no"

Newer Posts