Skip to content

Latest commit

 

History

History
632 lines (443 loc) · 26.1 KB

2020-07-25.md

File metadata and controls

632 lines (443 loc) · 26.1 KB

< 2020-07-25 >

1,647,327 events, 921,655 push events, 1,307,804 commit messages, 79,852,369 characters

Saturday 2020-07-25 00:09:14 by Riley Shaw

Add a redesigned 404 / 503 error page (#2840)

  • Add a redesigned 404 / 503 error page

This commit updates and unifies some of our error pages to make them prettier and more informative.

This commit also removes accidental suppression of 404 errors. In the past, visiting a non-existent URL without a locale (eg. https://voice.mozilla.org/this-is-a-bad-url) would silently fail and redirect to a localized homepage. The old 404 page could only be seen when a locale was already included in the URL (eg. https://voice.mozilla.org/en/this-is-a-bad-url).

Now, any bad URL will redirect to //404, locale or not.


Note 1: I'm torn about this decision, but for simplicity I've updated the URL to /:locale/:errorCode whenever a 404 or 503 are encountered. I personally prefer for the old URL to hang around, because it makes wayfinding and refreshing easier. The following reasons made me opt for an explicit error code in the URL:

• We currently assign page-level classNames based on the URL. To get custom page CSS (eg. layout, hiding #help-links) we need a page-level classname. To do this without the help of the URL would require custom Redux work for this page alone, and it seemed like too big of a change for this initial commit. • Our routing happens in several layers due to localization, and makes heavy use of the <Redirect /> component. Following this pattern also requires we keep the error state in the URL.

I kinda hate it, but I don't hate it hate it. Let me know if you hate it hate it and I can make a ticket in Jira, but for now it seems pretty low priority.


Note 2: since the 503 page is shown whenever we hit the top-level componentDidCatch, it might appear for client-side errors. Since componentDidCatch is only triggered, I'd wager client-side errors will usually be the cause.


Note 3: The new design removes the report + reload functionality from our previous barebones error page. I'm fine releasing as-is for now, but very happy to discuss if you've got ideas about whether to re-introduce reports, or flows where the new error page might cause problems.


Note 4: While working on this commit, Prettier and I made some small cleanup fixes (removed unused imports, used CSS variable names, etc). So as not to complicate the review, I'm going to add those in a follow-on commit called "Misc cleanup" – feel free to skip that one during review.


Test plan:

• Navigate to https://localhost:9000/en/this-is-a-bad-url

404 page should appear.

• Navigate to https://localhost:9000/this-is-a-bad-url

404 page should appear.

• Trigger the top-level componentDidCatch handler

503 page should appear.

In all above tests, layout should be responsive and animations performant.

  • Misc cleanup

  • Add custom GA tracking to error pages


Saturday 2020-07-25 02:40:25 by henloboi

temp debloat

Github bully me, deleted my old debloat.sh FFS imma create a new debloat sh later when i have time i hate my life


Saturday 2020-07-25 07:40:30 by Alejandro Batres

Finally, added the AboutPanel class

Not gonna lie, I was struggling quite a pair of hours just trying to figure out how to "properly" append the licenses and terms of use in the program. I mean, yeah, I can put them into a JTextArea but... is it enough? or, is it necessary to do something else? Anyways, I did it in the way I think could be legit-enough so I'm good with it.

Btw, I added a new option to the ViewGamePanel class where the user can go directly to the RAWG's website to see more details about the game displayed in the program.

Now, the next steps are:

  • Create a logotype of the project and add it into the About panel with a brief description
  • Maybe add some icons in the GeneralPanel class
  • Comment the whole project (mmm... maybe at the end)
  • Maybe create a website for the project (this will be complicated 'cause of the time, but maybe I will create some sort of "placeholder" and do it later)
  • Make a video showcasing the use of the program

I don't know if I will add or remove one of these steps... we will see!


Saturday 2020-07-25 09:08:01 by Marko Grdinić

"9:15am. Last night there were thunderbolts shooting all throughout.

9:20am. I had some time to think about what I want to do next. I know I said control flow analysis for editor support, but I do not feel like doing that after all. That sort of thing is very auxiliary and I should just leave it for later. Nobody is going to skip over on Spiral because I do not have that.

What I need to do is this in the following order: prepass, partial eval, codegen, typechecking (without constraints). Once I have that, I have something quite usable as a language even if it would be incomplete.

9:25am. I've decided, once I've done the above I am going to start negotiation to procure those chips. I want to do something real while I work on the language on the side much like in 2018.

9:45am. There some internet troubles recently, so I've been delayed by that.

9:50am. I do not feel like starting right away. I still want to dwell on it a little.

Yesterday I did that as well, but did follow through in the end and completed the sematic highlighting for the language. That was great.

Right now, what I need to do is just find the courage and the will to start work on the prepass. I need to break the ice there. Compiling mutually recursive blocks will take some consideration and effort. But once I am done, I should be in the clear to deal with the partial evaluator.

10am. Agh, prepass. Agh, partial evaluator. I went through this so many times before, I can't believe I am going to go through it again. But I have to.

10:05am. Ok, before I start let me do some things to simplify the parser.

I am going to get rid of the PatOperator. If I think about it, there is no reason why (+) should not be a valid name anywhere.

And apart from that, there is something I want to do.

10:10am. Ok, I got rid of that PatOperator error. The next thing is the way I do functions.

    | RawInl of (Pattern * RawExpr) list
    | RawForall of VarString * RawKindExpr * RawExpr

I've been thinking yesterday and came to the conclussion that this should be like...

10:15am.

and RawExpr =
    | RawB
    | RawV of VarString
    | RawLit of Literal
    | RawDefaultLit of string
    | RawSymbolCreate of SymbolString
    | RawType of RawTExpr
    | RawInline of RawExpr // Acts as a join point for the prepass specifically.
    | RawLet of Pattern * body: RawExpr * on_succ: RawExpr
    | RawMatch of body: RawExpr * (Pattern * RawExpr) list
    | RawFun of (VarString * RawKindExpr) list * Pattern list * (Pattern * RawExpr) list
    | RawRecBlock of (VarString * RawExpr) list * on_succ: RawExpr // The bodies of a block must be RawFun
    | RawRecordWith of RawExpr list * RawRecordWith list * RawRecordWithout list
    | RawOp of Op * RawExpr []
    | RawJoinPoint of RawExpr
    | RawAnnot of RawExpr * RawTExpr
    | RawTypecase of RawTExpr * (RawTExpr * RawExpr) list
    | RawModuleOpen of VarString * SymbolString list * on_succ: RawExpr

Actualyl I am still not sure. I reallized while I was writing this just now that I do not want both RawFun and RawFunction, but now I have this mess here.

Maybe I should decompose RawFunction into plan RawFun and RawMatch.

10:20am.

and RawExpr =
    | RawB
    | RawV of VarString
    | RawLit of Literal
    | RawDefaultLit of string
    | RawSymbolCreate of SymbolString
    | RawType of RawTExpr
    | RawInline of RawExpr // Acts as a join point for the prepass specifically.
    | RawMatch of body: RawExpr * (Pattern * RawExpr) list
    | RawFun of (VarString * RawKindExpr) list * Pattern list * RawExpr
    | RawRecBlock of (VarString * RawExpr) list * on_succ: RawExpr // The bodies of a block must be RawFun
    | RawRecordWith of RawExpr list * RawRecordWith list * RawRecordWithout list
    | RawOp of Op * RawExpr []
    | RawJoinPoint of RawExpr
    | RawAnnot of RawExpr * RawTExpr
    | RawTypecase of RawTExpr * (RawTExpr * RawExpr) list
    | RawModuleOpen of VarString * SymbolString list * on_succ: RawExpr

Let me do it like this. This is enough in terms of primitives.

The reason what I want to fuse RawInl and RawFun into one is because during typechecking I want one place where the typechecker will put in new foralls and constraints. The most sensible thing is to select RawFun as nodes for that. I can easily separate them into individual foralls and inls in a later stage after that.

Also, for patterns, I want to do some extra validation.

10:25am. Ok, let me get this out of the way.

10:30am. No, I am not sure I feel like it.

| RawFun of (VarString * RawKindExpr) list * Pattern list * RawExpr

If I have this, then the first two of these might turn out to be empty which will end up similar to RawInline.

I can't deal with this.

In the typechecker, I think I'll just fuse the RawForalls and RawInl into a single node on my own.

Ok, then, validation.

    loop pat |> ignore
    errors.ToArray()

For this to work, I need to return the errors and pat as they are.

let pattern_validate (errors : PatternCompilationErrors -> unit) pat =
    let rec loop pat =
        match pat with
        | PatDefaultValue _ | PatValue _ | PatSymbol _ | PatE | PatB -> Set.empty
        | PatVar x -> Set.singleton x
        | PatDyn p | PatAnnot (p,_) | PatNominal(_,p) | PatActive (_,p) | PatUnbox p | PatWhen(p, _) -> loop p
        | PatRecordMembers items ->
            let symbols = Collections.Generic.HashSet()
            let injects = Collections.Generic.HashSet()
            let x =
                List.map (fun item ->
                    match item with
                    | PatRecordMembersSymbol(keyword,name) ->
                        if symbols.Add(keyword) = false then errors (DuplicateRecordSymbol keyword); Set.empty else loop name
                    | PatRecordMembersInjectVar(var,name) ->
                        if injects.Add(var) = false then errors (DuplicateRecordInjection var); Set.empty else loop name
                    ) items
            match x with _ :: _ :: _ -> Set.intersectMany x |> Set.iter (DuplicateVar >> errors) | _ -> ()
            Set.unionMany x
        | PatPair(a,b) | PatAnd(a,b) ->
            let a, b = loop a, loop b
            Set.intersect a b |> Set.iter (DuplicateVar >> errors)
            a + b
        | PatOr(a,b) -> let a, b = loop a, loop b in if a = b then a else errors DisjointOrPattern; a
    loop pat

Let me just pass in a function into this.

let patterns_validate pats =
    let errors = ResizeArray()
    match List.map (fun (r,x) -> r, pattern_validate (fun x -> errors.Add(r,x)) x) pats with
    | (_,x) :: y -> List.fold (fun x (r,y) -> Set.intersect x y |> Set.iter (fun x -> errors.Add(r,DuplicateVar x)); y) x y |> ignore
    | _ -> ()
    errors.ToArray()

Here, now patterns should be validated across.

10:50am.

let patterns_validate pats =
    let errors' = ResizeArray()
    let l =
        List.map (fun (r,x) ->
            let errors = ResizeArray()
            let ret = r, pattern_validate errors.Add x
            errors'.Add(r,InvalidPattern(errors.ToArray()))
            ret
            ) pats
    match l with
    | (_,x) :: y ->
        List.fold (fun x (r,y) ->
            Set.intersect x y
            |> Set.iter (fun x ->
                errors'.Add(r,ShadowedVar x))
                y
                ) x y
        |> ignore
    | _ -> ()

No, I got it wrong, but now I am drowning in this.

Let me do it from the top again.

let patterns_validate pats =
    let l = List.map (fun (r,x) -> let errors = ResizeArray() in r, pattern_validate errors.Add x, errors) pats
    match l with
    | (_,x,_) :: y -> y |> List.fold (fun x (_,y,errors) -> Set.intersect x y |> Set.iter (fun x -> errors.Add(ShadowedVar x)); y) x |> ignore
    | _ -> ()
    l |> List.map (fun (r,_,errors) -> r, InvalidPattern(errors.ToArray()))

Ok, this is much better.

        | _, (_, PatVar _), _, _ ->
            match patterns_validate (if is_rec then name :: pats else pats) with

I'll add the name to this. Now if I write something like...

inl rec f f = ...

I should get an error that the variable is shadowed. Though Spiral allows shadowing, in this case it should definitely be an error.

Let me try it out.

Server bound to: tcp://*:13805
Unhandled exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index')
   at System.Char.IsUpper(String s, Int32 index)
   at Spiral.Tokenize.process_error@284.Invoke(String x) in C:\Users\Marko\Source\Repos\The Spiral Language\The Spiral Language v0.2 (typechecking)\Tokenize.fs:line 284

Am getting this exception now.

11:05am. This is strange. Why am I getting an error here?

Server bound to: tcp://*:13805
[|[]; []; []; []|]

These are the ers here.

They are all just empty...

I have no idea. Let me commit here and I'll revert to a previous commit for a bit.

I need to figure out what change was responsible for this."


Saturday 2020-07-25 10:09:16 by Marko Grdinić

"10:10am. Ok, now strange things are happening. I have no idea what is going on.

I really need to learn how to revert properly. Let me just make a damn branch.

let patterns_validate pats =
    let l = List.map (fun (r,x) -> let errors = ResizeArray() in r, pattern_validate errors.Add x, errors) pats
    match l with
    | (_,x,_) :: y -> y |> List.fold (fun x (_,y,errors) -> Set.intersect x y |> Set.iter (fun x -> errors.Add(ShadowedVar x)); y) x |> ignore
    | _ -> ()
    l |> List.map (fun (r,_,errors) -> r, InvalidPattern(errors.ToArray()))

Ah, wait, I get it. This will in fact give me empty patterns. I need to filter them out.

l |> List.choose (fun (r,_,errors) -> if 0 < errors.Count then Some(r, InvalidPattern(errors.ToArray())) else None)

Let me try it with this.

Yeah, now I am no longer getting exceptions. Let me try out the shadowing error.

inl rec f f = x

Ah, whops, no it does not work. The above does, but not if I do...

inl rec f x f = x

I screwed this one up. But it will be an easy fix.

| (_,x,_) :: y -> y |> List.fold (fun x (_,y,errors) -> Set.intersect x y |> Set.iter (fun x -> errors.Add(ShadowedVar x)); x + y) x |> ignore

I'll have to union the variables that came before.

inl rec f x (f, x) = x

Yeah wonderful. It all works now.

    | RawLet of (Pattern * RawExpr) list * body: RawExpr
    | RawInl of (Pattern * RawExpr) list

You know what, let me compromise here. I really do not regular functions to be multi pattern. So even if I have to fuse forall and inls into a single node in the typechecker that is fine, but I should separate these out in the parser.

11:30am.

(skip_keyword SpecFunction >>. clauses |>> fun l -> let pat_main = " main_arg" in inl (PatVar pat_main, RawLet(v pat_main,l)))
<|> ((skip_keyword SpecMatch >>. next .>> skip_keyword SpecWith) .>>. clauses |>> RawLet)

Let me also change RawLet to RawMatch while I am at it.

11:35am. Yeah, done with that.

11:40am. The thing compiles and runs. No unexpected breakages.

...I am thinking whether everything is fine here.

No it is not. I want to distinguish let statements from match expresssions...

But now I am just thinking things too much ahead of time. Forget about the typechecker considerations. I'll redesign the language for it when I need it...

Agh, fuck.

I do not feel like doing that!

How about I do the right thing off the bat?

How about I start work on the typechecker here?

11:50am. Yeah, I should be doing that.

Even if it means I won't get to run any code for a while longer, having typechecking done means I will have a clean runway to do the rest of the language after it.

It is the kind of challenge I would have liked to put off doing, but I do not want to do the prepass, then typechecking only to have to redo them again after that. Getting typechecking done is central to everything that will come later. I have to do it now.

I cannot avoid this challenge.

12:05pm. Let me take a break here.

I need to think of what comes next. I was sure that I would either do the editor support or the prepass. That I am changing directions into typechecking right away is a surprise to me.

I haven't really prepped for it. It is time that I start mentally rehearsing it.

The way to do it is to just start and work until I am done. It is impossible to plan everything ahead of time. I'll just make the typed AST and start targetting it."


Saturday 2020-07-25 12:15:33 by NathanPB

The first real use of xor in my life was a failure. I'm a disaster and I must die.

My history needs to be forgotten and my war crimes will lead my soul through the judges of the underworld. Awake and unafraid, asleep or dead.

Anyway, fixed enderman teleports doing weirdo shit idk


Saturday 2020-07-25 12:22:03 by yellowturban

UOL Community Update (25 Jul 2020)

UOL Community Update (25 Jul 2020)

Deleted messages by original users:

title="Xzester#4520">@Xzester Sorry for replying so late. Glad to hear that. I'm from Bihar, but spent most of my time in Delhi. Hope you are able to get your studies back on track. From Sorry for replying so late. Glad to hear that. I'm from Bihar, but spent most of my time in Delhi.

Cheater Xzester#4520 (also in other cheating groups and admin of this UOL community Discord server (sets bad example for all members in the UOL community), deleted message revealing his location. It is likely he deleted the message so that he hopes no one can track and identify his original location (which is then likely to be true), he is in quoted, "Bihar, but spent most of my time in Delhi", tracked from our updates.


Saturday 2020-07-25 12:25:21 by Marko Grdinić

"1:30pm. I am done with breakfast and am reading vol 5 of GGO in a distracted fashion. I am really anxious about typechecking and am thinking about that on the side.

1:40pm. ...

1:45pm. I do not often feel this emotion while programming. It is fear.

1:50pm. My heart is telling me that starting off with unification is too much for me right now. I just have so much to do that I can't really handle filling in the gaps.

2:05pm. What I am really leaning strongly towards now is to do the initial typechecker via bidirectional typechecking rather than unification. I think I should just leave unification as the very last thing.

I can do the top down without automating inference as much as possible.

That will allow me do deal with all the difficulties apart from inference.

Yeah, this makes the most sense.

I should do a more primitive, but still complete type system for Spiral first before I move to the prepass and the rest.

That will give me a complete language. And then I can work on slimming it down.

2:10pm. Let me go to bed for a while. I need to dwell on this idea.

Right now it feels like my goal is really getting closer. The strain of full type inference is quite high, but now as I imagine all the phases of Spiral, they are starting to come into focus. If I can compromise just a little on typechecking, things will become a lot easier.

2:20pm. I'll start with typechecking and then figure out how to shave yaks from there.

Ok, let me charge up for this. I'll step away from the screen from a while.

Right now I feel quite scared, but I will gather my determination. Right now the weight of the responsibility feels very heavy, but just a single step forward and I will make this my power.

If I can do this, all the pieces will snap into place and at that point v0.2 will be done. I think I can do this by the end of next month. I need to visualize this goal very strongly and make up my mind to run after it.

Before you can climb the mountain, you must first imagine climbing the mountain."


Saturday 2020-07-25 13:03:51 by Davide Fioravanti

ramips: add support for Winstars WS-WN583A6

The Winstars WS-WN583A6 is a wireless repeater with 2 gigabit ethernet ports. Even if mine is branded as "Gemeita AC2100", the sticker on the back says WS-WN583A6. So I will refer to it as Winstars WS-WN583A6. Probably the real product name is the Wavlink WL-WN583A6 because of the many references to Wavlink in the OEM firmware and bootlog.

Hardware

SoC: Mediatek MT7621AT (880 MHz, 2 cores 4 threads) RAM: 128MB FLASH: 8MB NOR (GigaDevice GD25Q64B) ETH: 2x 10/100/1000 Mbps Ethernet (MT7530) WIFI:

  • 2.4GHz: 1x MT7603E (2x2:2)
  • 5GHz: 1x MT7615E (4x4:4)
  • 6 internal antennas BTN:
  • 1x Reset button
  • 1x WPS button
  • 1x ON/OFF switch (working but unmodifiable)
  • 1x Auto/Schedule switch (working but unmodifiable. Read Note #3) LEDS:
  • 1x White led
  • 1x Red led
  • 1x Amber led
  • 1x Blue led
  • 2x Blue leds (lan and wan port status: working but unmodifiable) UART:
  • 57600-8-N-1

Everything works correctly.

Currently there is no firmware update available. Because of this, in order to restore the OEM firmware, you must firstly dump the OEM firmware from your router before you flash the OpenWrt image.

Backup the OEM Firmware

The following steps are to be intended for users having little to none experience in linux. Obviously there are many ways to backup the OEM firmware, but probably this is the easiest way for this router. Procedure tested on M83A6.V5030.191210 firmware version.

  1. Go to http://192.168.10.1/webcmd.shtml

  2. Type the following line in the "Command" input box: mkdir /etc_ro/lighttpd/www/dev; for i in /dev/mtd*ro; do dd if=${i} of=/etc_ro/lighttpd/www${i}; done

  3. Click "Apply"

  4. After few seconds, in the textarea should appear this output: 16384+0 records in 16384+0 records out 8388608 bytes (8.0MB) copied, 4.038820 seconds, 2.0MB/s 384+0 records in 384+0 records out 196608 bytes (192.0KB) copied, 0.095180 seconds, 2.0MB/s 128+0 records in 128+0 records out 65536 bytes (64.0KB) copied, 0.032020 seconds, 2.0MB/s 128+0 records in 128+0 records out 65536 bytes (64.0KB) copied, 0.031760 seconds, 2.0MB/s 15744+0 records in 15744+0 records out 8060928 bytes (7.7MB) copied, 3.885280 seconds, 2.0MB/s dd: can't open '/dev/mtd5ro': No such device dd: can't open '/dev/mtd6ro': No such device dd: can't open '/dev/mtd7ro': No such device

    Excluding the "X.XXXXXX seconds" part, you should get the same exact output. If your output doesn't match mine, stop reading and ask for help in the forum.

  5. Open the following links to download the partitions of the OEM FW: http://192.168.10.1/dev/mtd0ro http://192.168.10.1/dev/mtd1ro http://192.168.10.1/dev/mtd2ro http://192.168.10.1/dev/mtd3ro http://192.168.10.1/dev/mtd4ro

    If one (or more) of these files weight 0 byte, stop reading and ask for help in the forum.

  6. Store these downloaded files in a safe place.

  7. Reboot your router to remove any temporary file from your router.

Installation

Flash the initramfs image in the OEM firmware interface. When openwrt boots, flash the sysupgrade image otherwise you won't be able to keep configuration between reboots.

Restore OEM Firmware

Flash the "mtd4ro" file you previously backed-up directly from LUCI. Warning: Remember to not keep settings! Warning2: Remember to force the flash.

Notes

  1. The "System Command" page allows to run every command as root. For example you can use "dd" and "nc" to backup the OEM firmware. PC (SERVER): nc -l 5555 > ./mtdXro ROUTER (CLIENT): dd if=/dev/mtdXro | nc PC_IP_ADDRESS 5555

  2. The OEM web interface accepts only images containing the string "WN583A6" in the filename. Currently the OEM interface accepts only the initramfs image probably because it checks if the ih_size in the image header is equal to the whole image size (instead of the kernel size) Read more here: https://forum.openwrt.org/t/support-for-strong-1200/22768/19

  3. The white led (namely "Smart Night Light") can be controller by the user only if the side switch is set to "Schedule" otherwise it will be activated by the light condition (there is a photodiode on the top side of the router)

Signed-off-by: Davide Fioravanti pantanastyle@gmail.com


Saturday 2020-07-25 22:33:05 by tabzlock

Yeah I did shit

Changed readme.md to be more stupid


< 2020-07-25 >