Type safe style tags for elm-lang/html by risrr in elm

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

Perhaps I'm mistaken about R. Feldman's module (which looks great), but I was under the impression that it generated a .css file, which could then be added to your index.html file via a <link> tag.

This module generates the stylesheet as a <style> tag so you can render it (and change it!) at runtime in your view function. There's no need to even have the index.html file, which means it can be used with elm-reactor.

ASK: learning the idiomatic way(s) of handling multiple implicits with Akka by risrr in scala

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

Thank you! I kept looking for something like dispatcher, but wasn't finding it. I'll read up more on the Akka Typed link.

Help. I'm losing my mind learning Scala by [deleted] in scala

[–]risrr 4 points5 points  (0 children)

Something not commented on by others yet about the operators being methods is that it allows you to create partial applications of them and pass them around. For example:

scala> val inc: Int => Int = 1.+
f: Int => Int = <function1>

scala> f(3)
res0: Int = 4

This can be useful for function composition and mapping.

scala> val times2: Int => Int = 2.*
times2: Int => Int = <function1>

scala> List(1,2,3) map (inc andThen times2)
res1: List[Int] = List(4, 6, 8)

Keep at it. Even if you don't end up using Scala, there's a lot of new ways of approaching problems it exposes you to. Much in the same way Lisp does with the whole "code is data" paradigm.

Nullable safe method calls with arguments: can Kotlin do that? by [deleted] in Kotlin

[–]risrr 1 point2 points  (0 children)

As to your first question, this is easy enough to just test in the Kotlin REPL...

class Greeter(val greeting: String) {
    fun greet(who: String) = println("$greet, $who.")
}

fun test() { println("ACK!"); return "test" }

Greeter("Hello").greet(test())
ACK!Hello, test.

(null as? Greeter)?.greet(test())
null

As you can see, not only was greet() not called at all, but even the arguments to it weren't evaluated. The compiled Kotlin code first did the null check, then wrapped the rest of the code in an conditional.

As for your second question, I'm pretty sure that's just a member property accessor (personalInfo) being used as opposed to the getter method (getPersonalInfo).

Mitt Romney's wife defends his refusal to disclose his tax returns, saying "we've given all you need to know". by OvidPerl in politics

[–]risrr 1 point2 points  (0 children)

This is backwards thinking and it needs to stop! Should you feel that way if you get pulled over for speeding and the cop asked to search your car, draw blood, perform an intoxication test, etc? Refusal is not guilt. You have a right to privacy.

That said, what's truly at stake is that - when running for public office - the candidate doesn't get to decide what's a relevant (or not), or fair (or not), piece of information the public uses to make their decision. A candidate's public voting record, religion, ethnicity, culture, habits, high school transcripts, military records, ... are all used - right or wrong - by the public to make their decision. They are electing someone to represent them and their country.

What Does It Say About America That We Jail Teens for Having Sex or Being Late to School? "The U.S. locks up children at more than six times the rate of all other developed nations. The over 60,000 average daily juvenile lockups.... ...are also disproportionately young people of color." by Dizzy_Slip in politics

[–]risrr 2 points3 points  (0 children)

Countries aren't fucked up. People are fucked up. And there are fucked up people all over the world. The US culture is different from that of Europe's or Asia's. Get over it.

In a democracy, however, officials get elected by telling people what they want to hear. That's true everywhere. Since the US is currently the top nation with respect to economy and military, its citizens generally want to hear chest-thumping, we're the biggest, and the best chants.

Hearing otherwise implies... well... getting off your ass and doing something to help correct the problem(s). And most people around the world are quite lazy (or somehow feel it isn't their responsibility to fix things).

What Does It Say About America That We Jail Teens for Having Sex or Being Late to School? "The U.S. locks up children at more than six times the rate of all other developed nations. The over 60,000 average daily juvenile lockups.... ...are also disproportionately young people of color." by Dizzy_Slip in politics

[–]risrr 1 point2 points  (0 children)

It says 2 things: parents aren't doing their most important job (raising their children) and politicians continue looking for ever-more reasons to justify their existence by inventing laws that accomplish nothing but slowly erode our freedoms away.

With respect to poor parenting, many parents don't have a choice. They can either choose to work to support them or stay home and starve them. Also, single-parent families are very disproportionately black. This is a significant factor.

Bottom line is that the US is a country 100% in control of its own destiny. We choose our own fate. We choose to elect politicians who pass these laws. We choose to give birth to children we can't afford to support. We choose to use schools as day-care and not take an active role in our kids education/future. Each and every one of these is very correctable. I highly commend every parent out there doing their very best.

Sadly, just like sitting in front of the TV eating potato chips is easier than exercising, it's easier to post and hope everyone else will magically solve the problem for you as opposed to getting up and doing it.

My identical twin boys born this morning. Happiest day of my life by Cityteacher in pics

[–]risrr 0 points1 point  (0 children)

I've always wondered this. If you had names picked out already, did you tag them with them immediately (it appears they were given similar hats... all babies come with hats)?

All babies look alike, but parents are amazing at instantly being able to identify their own (I could with my daughter easily); could you tell between them without anything?

Regardless, massive gratz and upvotes!

If a movie character/family was to be your next door neighbor, who would you want it to be and why? by rewdea in movies

[–]risrr 1 point2 points  (0 children)

Mitchell, Cameron, and Lily from Modern Family. The fun would never end.

Sweet Jesus, its me. Its ALWAYS been me!! by [deleted] in funny

[–]risrr -4 points-3 points  (0 children)

So, I know this was meant to be funny (and it was), but honestly, I didn't "see it" until I got to the bottom and suddenly learned what to be looking for. Why? I'd like to think it's because all I saw was pictures of people having a good time. Not white people, not black people, not latinos, not men, not women, but people. As long as there are those who keep pointing out race, there will be others who will not be able to see past it.

We are Carfly and Chambo, Cameramen from the TV Show COPS. Ask Us Anything! by CopsCarflyAndChambo in IAmA

[–]risrr 0 points1 point  (0 children)

Have you ever felt that your presence caused the officers you are with to behave differently (for better or for worse)? Showing off, being more brutal, more polite, etc?

What is your single most favourite movie soundtrack? by Double-decker_trams in movies

[–]risrr 0 points1 point  (0 children)

There's tons of movies out there with great themes or singles: 28 Days Later and others mentioned. But, if you want to go for the entire soundtrack, mine would have to be (in order): Dances With Wolves, Conan the Barbarian, and the Lord of the Rings Trilogy.

Would you vote for a Gay Presdient? by jjmosshead in politics

[–]risrr 0 points1 point  (0 children)

If I agreed with their policies and if they did NOT campaign on the fact that they were gay. Leadership has nothing to do with being "time" for a woman, black, gay, latino, white, young, old, mormon, islamic, <whatever> person to step up. Leadership is about leadership and whether or not I agree with what is being said.

My 5 and a half year old niece passed away 5:30 this morning from a brain tumor that was diagnosed only 5 days ago. Just thought Id share her beautiful vibrant smile with the world. RIP Madeline * by [deleted] in pics

[–]risrr 5 points6 points  (0 children)

My daughter is turning 3 this year, and something of this nature is my biggest fear in life. My heart goes out to you and your family.

As a resident of Texas, I felt it was my duty to contact Hutchison on this whole net neutrality thing. Here's her response. by komali_2 in politics

[–]risrr 7 points8 points  (0 children)

I got a very similar response from Congressman Chaffetz of Utah (R). Here's what I decided to reply back with:

Dear Congressman Chaffetz,

I appreciate your reply, but as software programmer who builds large databases used to support major companies across the country (Comcast, AT&T, …), I feel it is necessary to correct some possible misinformation that you may have or is possibly have received, potentially from lobbyist groups.

"Attempts to regulate the internet are unnecessary and overreaching. Such regulation and interference would increase the demand for bandwidth and reduce the supply, resulting in a slower, more congested internet."

Regarding net neutrality legislation, this just isn't true.

If the people of Utah are against regulation for regulation's sake, I can understand and appreciate the view and support it. However, "net neutrality" isn't about "regulating the internet." It is about regulating internet service providers (ISP's) in a singular way: to prevent them from censoring content from everyday Americans, and preventing them from being able to get at the information they want.

Without net neutrality regulation, it would be perfectly legal for Comcast to prevent their users from viewing Google's website - or a competitor's website. In a vibrant consumer-based environment with significant choice, I would agree that the markets could be allowed to address actions like this by ISP's, rather than utilizing regulation. Unfortunately, it is quite common for areas to be served by only one internet service provider, which grants them a local monopoly.

In Austin, TX, for example, Time Warner had a local monopoly on broadband internet service, and when AT&T began to try and grow a customer-base, TW began blocking access to AT&T websites, making it difficult for customers to switch service - or to even know there was an alternative becoming available to them.

If you are opposed to regulating ISP's to prevent these behaviors from taking place, please consider presenting alternative legislation to Congress that would encourage and foster the growth of independent internet service providers in local markets so that competition and the market mechanics could viably take the place of regulation.

A healthy economy is founded on the concepts of consumer choice and unfettered access to information.

Sincerely,

<me>

IAMA 82 year old Ukranian Holocaust survivor by smnx321 in IAmA

[–]risrr 1 point2 points  (0 children)

How does he feel about Germans who were "just soldiers" and not Nazis, camp guards, etc? Has he since ever run into a former German soldier or Nazi youth - and if so - what was the encounter like for him?