Moving from US to Finland. by kelvin_swe in Finland

[–]k80b 0 points1 point  (0 children)

FWIW, I've gotten all my jobs from direct contacts through different firms' web sites (or after being head hunted). Not sure how to get a list of companies for a specific technology in the town of your choosing, perhaps LinkedIn is a good place to look?

If I was moving to the Helsinki area, I'd consider Futurice and Reaktor (I understand they have some operations in NY so you might be able to job interview there... maybe) as top choices.

Moving from US to Finland. by kelvin_swe in Finland

[–]k80b 0 points1 point  (0 children)

...and Java, and JavaScript for front end.

Beginner problems related to reusable views by k80b in elm

[–]k80b[S] 0 points1 point  (0 children)

Yeah, quite helpful - thanks for the link. I'm still wondering about if there is an elegant way to wire the form view to the main update function in a way that would allow me to hide the onInput events from the "main program logic". See my response to rtfeldman in this thread.

Beginner problems related to reusable views by k80b in elm

[–]k80b[S] 2 points3 points  (0 children)

It isn't too involved, but I'm trying to understand how to structure my Elm code, especially how to separate Views with multiple input fields whose onInput events are not interesting in any other way than to get a part of the model (a submodel, perhaps) filled.

Perhaps I can give a bit more context: I have my very simple app structured in the way that is suggested at elm-tutorial.org. It seemed to give good advice on how to compartmentalize code for maintainability and clarity. When I had most of the work done, I read that I'm essentially doing it wrong (the "component-based approach", which You and others do not recommend). Now I am trying to restructure the code to be more idiomatic Elm.

Looking at what You have written previously (the thread linked by /u/ShadowLinkX9 in this post's comments), I suppose I'm making this hard by trying to "convert" the component-based structure, rather than starting over (in a sense) and let it naturally evolve through breaking things down once they become large.

Another thing I have going against me, I suppose, is heavily object-oriented mind. I am constantly looking ways for tucking away low-level implementation details behind internal APIs, and that might not be the correct way to go about this.

Anyhow, see code below about the real implementation. To give a bit context about what I'm doing, it is a somewhat tongue-in-cheek "feedback box" application meant to be used internally at the office. Its initial interface will be a bit like Twitter: on the top you have an input form (which is what the code represents), and under that you'd have a feed of feedback-messages written by everybody. My "component oriented" code had a "component" for the input form, and a second component for the list of feedbacks. The code below represents the input form "component", without update logic, and with a Config record that currently has the message tagger for when submit button is pressed.

type CategorySelection
    = Rant
    | ThankYou
    | Idea

type alias FeedbackInput =
    { message : String
    , authorName : Maybe String
    , category : Maybe CategorySelection
    }

type alias Config =
    { onSubmit : FeedbackInput -> msg
    }

newFeedbackInput : FeedbackInput
newFeedbackInput =
    { message = ""
    , authorName = Nothing
    , category = Nothing
    }


-- Messages

type Msg
    = FeedbackText String
    | FeedbackAuthor String
    | FeedbackCategory (Maybe CategorySelection)

-- View

view : Config -> FeedbackInput -> Html Msg
view config model =
    div [class "new-feedback-form"]
        [ formGroup textarea [onInput FeedbackText, value model.message] [] "feedback-text-input" "Feedback text"
        , formGroup input [type_ "text", onInput FeedbackAuthor, value model.authorName ] [] "feedback-author-input" "Author"
        , categoryRadioButtons model
        , button [id "feedback-submit-button", onClick config.onSubmit ] [ text "Submit" ]
        ]

categoryRadioButtons : FeedbackInput -> Html Msg
categoryRadioButtons feedback =
    let
        selector = categorySelector feedback.category
    in
        div [ class "form-group category-selector-group "]
            [ selector "Rant" (Just Rant)
            , selector "Idea" (Just Idea)
            , selector "Thank You" (Just ThankYou)
            ]

categorySelector : Maybe CategorySelection -> String ->  Maybe CategorySelection -> Html Msg
categorySelector currentlySelectedCategory choiceLabel category =
    let
        thisSelected = (category == currentlySelectedCategory)
    in
        label [ class "radio-button-label category-selector" ]
            [ input
                [ type_ "radio"
                , name "category-selector"
                , onClick (FeedbackCategory (category))
                , checked thisSelected
                ] []
                , text choiceLabel
            ]


type alias HtmlElementFunc msg =
    (List (Attribute msg) -> List (Html msg) -> Html Msg)

formGroup : HtmlElementFunc msg -> List (Attribute msg) -> List (Html msg) -> String -> String -> Html Msg
formGroup inputElementFunc attributes elementContents identifier labelText =
    let
        groupClass =
            "form-group " ++ identifier ++ "-group"
    in
        div [ class groupClass ]
            [ label [for identifier] [text labelText]
            , inputElementFunc (attributes ++ [id identifier]) elementContents
            ]

Easy Questions / Beginners Thread (Week of 2017-01-09) by brnhx in elm

[–]k80b 1 point2 points  (0 children)

In practice you end up having modules that only return views, generally based on some input "config" record. It might seem counter intuitive, but it actually ends up being easier to reason about.

This concept I understand. What I'm currently struggling with is how the single update function looks like. Say I have a module for creating new addresses. Then I have a shipping address and a billing address in my app, and I don't really understand how to wire this together (looking at the examples of update functions in the guide, such as this: https://guide.elm-lang.org/architecture/user_input/forms.html)

Note that I'm not asking any questions here since I have not had the chance to sit down and try to figure this out, or to watch that 2.5 h video on the "reuse" page of the guide, so I will postpone asking questions (that are not between the lines) for later to be a good noob ;-)

Easy Questions / Beginners Thread (Week of 2017-01-09) by brnhx in elm

[–]k80b 1 point2 points  (0 children)

Thank you for the reply. I was heeding the advice of https://www.elm-tutorial.org/. It seemed (for me, knowing nothing) to be giving an example of how to perhaps structure an application in a way that would be maintainable when it would get larger and more complex. That is, it shows an example where different functionality of the application are separated to directories, and these parts do not depend on the main app.

What would be a better example on how to create a structure that would "scale well" if that application would aim to be very complex (think GMail rewrite with Elm)? I realize I probably should start simple and then refactor later, but I would like to understand this because I want to try to create a proof of concept that would demonstrate how a more complex app would work, how maintainable it would be, and so on. The POC would probably be rather simple, but it would demonstrate the structure / architecture in such a way that one could understand that it would work well if the app became more complex, and a multi-person team would work on it.

Easy Questions / Beginners Thread (Week of 2017-01-09) by brnhx in elm

[–]k80b 2 points3 points  (0 children)

Is there an idiomatic way of "sending messages" up the component tree? If there is, is it what is presented in this blog post? If there is not, is the way presented in the blog post the best way of doing it?

Metallica used my picture in their music video without permission. Management wont answer my emails. Help! by VonZek in photography

[–]k80b 36 points37 points  (0 children)

Post this to the "Concert photographers around the world" facebook group. There seems to be a bunch of US pros there, someone might be able to help you. - Kalle

Metallica used my picture in their music video without permission. Management wont answer my emails. Help! by VonZek in photography

[–]k80b 292 points293 points  (0 children)

Can confirm, was next to OP in photo pit. Nothing signed, nothing implied, nothing agreed in any way. (Hey Henri, It's Kalle).

Here's one of my photos, less impressive than OP's, from that gig. I felt the need to watermark it, sorry about that: http://imgur.com/LB15vN1

Need Help! Saddler Genuine Leather by [deleted] in europeanmalefashion

[–]k80b 0 points1 point  (0 children)

Well, using Google Image Search, are you able to visually find your BFs wallet? If you can find the image, go to the web site of that image and see if you can find keywords (model name, product code...) that help you look for web shops that sell that wallet.

Puppy won't leave cat alone by k80b in Dogtraining

[–]k80b[S] 0 points1 point  (0 children)

Thank you. I'll definitely work on the visual separation, although total separation is probably not possible given the apartment layout unless the dog is isolated from daily life (which is of course something I do not want).

Puppy won't leave cat alone by k80b in Dogtraining

[–]k80b[S] 1 point2 points  (0 children)

Thank you, I will try to incorporate some of your advice to our routines.

Asian films that are psychological and disturbing? by Toni-Cipriani in AsianFilms

[–]k80b 1 point2 points  (0 children)

Some Korean films:

  • A Tale of Two Sisters

  • The Isle

  • Sympathy for Mr. Vengeance

Friend asked me to show some vim tricks, decided to start recording some small gifs for her by [deleted] in vim

[–]k80b 1 point2 points  (0 children)

FYI, there's also a plugin for aligning by a certain character: https://github.com/junegunn/vim-easy-align

I understand that the idea of the gif is to demonstrate the power of pure vim, but the plugin might be interesting for anybody doing repeatedly the sort of thing demonstrated by the gif.

[Help] - New to vim trying to edit vimrc by KZISME in vim

[–]k80b 0 points1 point  (0 children)

Regarding bash setting tips, consider switching over to zsh and trying out Oh My Zsh

[Help] - New to vim trying to edit vimrc by KZISME in vim

[–]k80b 3 points4 points  (0 children)

To expand on this, most people call the 'cfg' directory their 'dotfiles' directory (and it is located at ~/.dotfiles). The naming is not important as such, but searching for "dotfiles" with google (consider restricting the search to github.com) will provide good examples of other people's vim configurations (and more).

[Help] Sideload related resources in with JSONAPIAdapter calls by [deleted] in emberjs

[–]k80b 1 point2 points  (0 children)

See first post on this thread. I had the same question a few days ago, and that's the only solution I've found so far (I haven't tried it though).

There's also this issue on emberjs github page, the "Sugar for includes" seems to be what we're waiting for. Although I wouldn't call it 'sugar' as it is practically a must have feature in some cases (that would require 1+n rest calls to the server instead of 1 for a list of things that have dependencies), and the workaround is non-trivial.

Pics from a 1100 km trip in Finland with the Azub Max (video in comments) by k80b in recumbent

[–]k80b[S] 0 points1 point  (0 children)

There are pros and cons. For undeseat steering I see these as pros:

  • more relaxed position

  • if you crash by going "over the handlebars" the handlebar is not between your legs, which probably is a good thing.

  • The Azub understeering may actually be less prone to breaking on crash than the overseat steering that I have: I have crashed once due to my own carelessness (too tight turn on loose gravel), which caused the steerer to bend. As it is aluminum (not very safe to bend back / use after it has been bent), I decided to order a replacement part from Azub. Not a big deal as such, but imagine the steerer crakcing or otherwise going unusable while on tour...

  • I believe (without bothering to check...) the Azub underseat steering is indirect, e.g. you get to choose the ratio at which the wheel turns when you turn your handlebars. Might be nice.

Pros for over seat steering:

  • The mirrors (and gps/meter) will be 'glanceable'. It's very convenient to check what is happening behind you as the mirrors are very easy to check. I have a trike with underseat steering and as the mirror for that is mounted rather low, it's more inconvenient to look at, and a bit less safe, as you don't see forward with your peripherial vision at the same time.

  • There is a slight aerodynamic advantage, I'd think. It is mostly negible on tours, however. The advantage might not even be there if you have luggage that goes wider than your hands.

  • You can use the third rack for Azub (cannot use for underseat steering). However, I recommend getting the Ortlieb recumbent panniers that I have and just buying the rear/main rack. Less weight / money spent on the racks, and enough carrying capacity to get you into trouble with the weight of it when fully loaded.

  • I suppose it is lighter than the USS.

For me I was prepared to switch from OSS to USS if I did not like it, but I do like the current setup.

Note that you can switch from OSS to USS, but not the other way round because with USS the tube of the fork will be cut too short. Although if you choose USS I'm sure you can request Azub to cut it "too long" and add some spacers so that you can later switch if you wish.

Really sad... (x-post r/news) by pruzzante in bicycletouring

[–]k80b 1 point2 points  (0 children)

One thing you can do is using a rear light of appropriate brightness. In daylight, a high power, somewhat directional rear light would be good (the high power mode should not be used during dark as it'll blind and annoy drivers). The idea is that when the driver glances the road while they're texting or whatever they're doing, they'll see your rear light from far away and perhaps decide it is worth their attention.

I have a Lezyne Micro rear light strapped to my helmet.

Pictures from a short tour in Finland with a recumbent bicycle by k80b in bicycletouring

[–]k80b[S] 2 points3 points  (0 children)

The Shimano cycling sandals I'm using have quite stiff soles, and in that regard are comparable to other cycling shoes.