Flexbox breakpoints not responding for two columns

Question: This is actually a Udacity assignment but you guys respond sooner. I'm starting to work on my understanding of flexbox and for the life of me can't figure out how to get the '.hero' and '.content' classes on the same line in two columns. For whatever reason it's just not responding even though I set up a media query with breakpoints and put an extra container around both both classes. Nothing I'm trying is working, the width for both elements stays at 100%. Can someone help me out? I'm so confused.

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: Roboto;
    font-size: 12px;
    color: #424242;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
}

header,
nav,
footer,
section,
article,
div {
    box-sizing: border-box;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/*
 *
 * Common
 *
 */

.news__more {
    float: right;
    font-size: .8em;
    color: #333;
    text-decoration: none;
}

/*
 *
 * Header
 *
 */

.header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
    min-height: 56px;
    transition: min-height 0.3s;
}

.header__inner {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.header__logo {
    height: 72px;
    margin-right: 1em;
    vertical-align: top;
    margin-top: 12px;
}

.header__title {
    font-weight: 300;
    font-size: 4em;
    margin: 0.5em 0.25em;
    display: inline-block;
    color: #212121;
}

/*
 *
 * Top Level Navigation
 *
 */

.nav {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.nav__list {
    width: 100%;
    padding: 0;
    margin: 0;
}

.nav__item {
    box-sizing: border-box;
    display: inline-block;
    width: 24%;
    text-align: center;
    line-height: 24px;
    padding: 24px;
    text-transform: uppercase;
}

.nav a {
    text-decoration: none;
    color: #616161;
    padding: 1.5em;
}

.nav a:hover {
    text-decoration: underline;
    color: #212121;
}

/*
 *
 * Main
 *
 */

main {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/*
 *
 * Content
 *
 */

/*
 *
 * Hero
 *
 */

.hero {
    width: 100%;
    position: relative;
    background-image: url("./images/dog.jpg");
    background-size: cover;
    height: 300px;
}

.hero article {
    box-sizing: border-box;
    background-color: #000;
    background-color: rgba(0, 0, 0, 0.7);
    position: absolute;
    bottom: 0;
    height: 40%;
    width: 100%;
    color: #fff;
    padding: 1em;
}

/*
 *
 * Top News
 *
 */

.top-news {
    height: 300px;
    border-bottom: 1px solid #E0E0E0;
    padding: 1em;
}

.news__title {
    font-weight: 300;
    border-bottom: 1px solid #E0E0E0;
    line-height: 24px;
    font-size: 16px;
}

.top-news__item {
    border-bottom: 1px solid #E0E0E0;
    padding: 1em 0;
    line-height: 19.2px;
}

.top-news__item:before {
    content: "» ";
}

.top-news__item:last-child {
    border-bottom: none;
}

.top-news__item a {
    text-decoration: none;
    color: #666;
}

.top-news__item a:hover,
.top-news__item a:active {
    text-decoration: underline;
}

/*
 *
 * Sport Scores
 *
 */

.scores {
    padding-top: 1em;
}

.scores__table {
    width: 100%;
    border-collapse: collapse;
}

.scores__table th,
.scores__table td {
    padding: 1em;
}

.scores__table th {
    color: #fff;
    font-weight: 300;
    background-color: #78909C;
}

.scores__table tr:nth-child(odd) td {
    background-color: #fff;
}

.scores__table tr:nth-child(even) td {
    background-color: #eceff1;
}

.scores__table td.winner {
    font-weight: bold;
}

.scores__table td:nth-child(3) {
    text-align: right;
}

.scores__table td:nth-child(2),
.scores__table td:nth-child(5) {
    text-align: center;
}

/*
 *
 * Weather
 *
 */

.weather {
    padding: 1em;
}

.weather__location {
    display: block;
    font-weight: 300;
    font-size: 1.5em;
}

.weather__desc {
    display: block;
    font-size: 1.2em;
}

.weather__today {
    width: 60%;
    vertical-align: middle;
}

.weather__today__image {
    vertical-align: middle
}

.weather__today__temp {
    font-size: 3em;
}

.weather__today__deg {
    font-size: 2em;
    display: inline;
}

.weather__next__item {
    display: inline-block;
    width: 20%;
    text-align: center;
}

.weather__next__item span {
    display: block;
}

.weather__next__image {
    width: 100%;
}

/*
 *
 * Recent News
 *
 */

.recent-news {
    clear: both;
    padding: 1em;
}

.snippet {
    clear: both;
    margin: 24px 0;
}

.snippet__thumbnail {
    width: 100px;
    float: left;
    margin-right: 1em;
}

.snippet__title {
    font-weight: 500;
}

.snippet__title a {
    text-decoration: none;
    color: #666;
}

.snippet__title a:hover,
.snippet__title a:active {
    text-decoration: underline;
}

/*
 *
 * Footer
 *
 */

footer {
    border-top: 1px solid #E0E0E0;
    padding: 1em;
    width: 100%;
}

footer li {
    display: inline-block;
    margin: 0 1em;
}

footer a {
    text-decoration: none;
    color: #333;
    padding: 1.5em;
}

/*
*
* media queries
 *
 */

@media screen and (min-width: 660 px) {
    .container-main {
        display: flex;
        align-content: center;
    }
    .news {
        width: 200px;
        float: right
    }
    .hero {
        width: 200px;
    }
}
<!doctype html>

      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <title>Brighton Times</title>
      <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" type="text/css">
      <link rel="stylesheet" type="text/css" href="main.css">

                        The Brighton Times

                        News

                        Events

                        Culture

                        Blog

Absolutely astonishing breaking news!

Organic raw denim Vice keffiyeh lomo Kickstarter art lomo Kickstarter art four loko.
                                          Organic raw denim Vice keffiyeh lomo Kickstarter art lomo Kickstarter art four
                                          loko.

Top news
                                    + more

                                          Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache.

                                          Squid lomo Kickstarter art lomo Kickstarter art party cronut scenester.

                                          Organic raw denim lomo Kickstarter art Vice keffiyeh four loko.

                                          Organic raw denim Vice keffiyeh lomo Kickstarter art lomo Kickstarter art four
                                                loko.

                                    date
                                    team
                                    score
                                    team

                                    Friday
                                    Bears
                                    95
                                    109
                                    Cubs

                                    Friday
                                    Otters
                                    3
                                    1
                                    Cubs

                                    Saturday
                                    Wolves
                                    7
                                    0
                                    Panthers

                                    Sunday
                                    Hawks
                                    11
                                    12
                                    Capons

                                    Sunday
                                    Stags
                                    6
                                    2
                                    Foxes

                  Brighton, UK
                  Sunny

                        13
                        °C

                              Mon

                              13 °C

                              Tues

                              13 °C

                              Wed

                              13 °C

                              Thu

                              13 °C

                              Fri

                              13 °C

Latest news
                        + more

                                    Gastropub distillery Marfa farm-to-table

Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache. Squid lomo Kickstarter
                                    art party cronut scenester. Organic raw denim Vice keffiyeh four loko. Squid lomo Kickstarter
                                    art party cronut scenester. Organic raw denim Vice keffiyeh four loko.Vice keffiyeh four
                                    loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh
                                    four loko.Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester.
                                    Organic raw denim Vice keffiyeh four loko.

                                    Organic raw keffiyeh four loko.

Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim
                                    Vice keffiyeh four loko.Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut
                                    scenester. Organic raw denim Vice loko.

                                    Kickstarter art party cronut scenester.

Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache. Squid lomo Kickstarter
                                    art party cronut scenester. Organic raw denim Vice keffiyeh four loko. Squid lomo Kickstarter
                                    art party cronut scenester. Organic raw denim Vice keffiyeh four loko.Vice keffiyeh four
                                    loko.

                                    Squid lomo Kickstarter art party cronut

Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache. Squid lomo Kickstarter
                                    art party cronut scenester. Organic raw denim Vice keffiyeh four loko. Squid lomo Kickstarter
                                    art party cronut scenester. Organic raw denim Vice keffiyeh four loko.Vice keffiyeh four
                                    loko.

                              Contact us

                              Follow us on Twitter

                              RSS

Comment: I made your code into snippet, also my question here is - .hero is a child of .content class and what are you trying to achieve?
Comment: Thanks for responding, I appreciate you adjusting my code. I'm trying to make it so that the news and hero sections of code are side by side.
Comment: You forgot to add flex-container class and connecting style, check my answer, hope that is what you are looking for.
Answer: You missed to add flex-container. Also adjust your height, position for hero class as required.
Hope this helps!!

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: Roboto;
  font-size: 12px;
  color: #424242;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
}

header,
nav,
footer,
section,
article,
div {
  box-sizing: border-box;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/*
 *
 * Common
 *
 */

.news__more {
  float: right;
  font-size: .8em;
  color: #333;
  text-decoration: none;
}

/*
 *
 * Header
 *
 */

.header {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
  min-height: 56px;
  transition: min-height 0.3s;
}

.header__inner {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.header__logo {
  height: 72px;
  margin-right: 1em;
  vertical-align: top;
  margin-top: 12px;
}

.header__title {
  font-weight: 300;
  font-size: 4em;
  margin: 0.5em 0.25em;
  display: inline-block;
  color: #212121;
}

/*
 *
 * Top Level Navigation
 *
 */

.nav {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.nav__list {
  width: 100%;
  padding: 0;
  margin: 0;
}

.nav__item {
  box-sizing: border-box;
  display: inline-block;
  width: 24%;
  text-align: center;
  line-height: 24px;
  padding: 24px;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  color: #616161;
  padding: 1.5em;
}

.nav a:hover {
  text-decoration: underline;
  color: #212121;
}

/*
 *
 * Main
 *
 */

main {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/*
 *
 * Content
 *
 */

/*
 *
 * Hero
 *
 */

.hero {
  width: 100%;
  position: relative;
  background-image: url("./images/dog.jpg");
  background-size: cover;
  height: 300px;
}

.hero article {
  box-sizing: border-box;
  background-color: #000;
  background-color: rgba(0, 0, 0, 0.7);
  position: absolute;
  bottom: 0;
  height: 40%;
  width: 100%;
  color: #fff;
  padding: 1em;
}

/*
 *
 * Top News
 *
 */

.top-news {
  height: 300px;
  border-bottom: 1px solid #E0E0E0;
  padding: 1em;
}

.news__title {
  font-weight: 300;
  border-bottom: 1px solid #E0E0E0;
  line-height: 24px;
  font-size: 16px;
}

.top-news__item {
  border-bottom: 1px solid #E0E0E0;
  padding: 1em 0;
  line-height: 19.2px;
}

.top-news__item:before {
  content: "» ";
}

.top-news__item:last-child {
  border-bottom: none;
}

.top-news__item a {
  text-decoration: none;
  color: #666;
}

.top-news__item a:hover,
.top-news__item a:active {
  text-decoration: underline;
}

/*
 *
 * Sport Scores
 *
 */

.scores {
  padding-top: 1em;
}

.scores__table {
  width: 100%;
  border-collapse: collapse;
}

.scores__table th,
.scores__table td {
  padding: 1em;
}

.scores__table th {
  color: #fff;
  font-weight: 300;
  background-color: #78909C;
}

.scores__table tr:nth-child(odd) td {
  background-color: #fff;
}

.scores__table tr:nth-child(even) td {
  background-color: #eceff1;
}

.scores__table td.winner {
  font-weight: bold;
}

.scores__table td:nth-child(3) {
  text-align: right;
}

.scores__table td:nth-child(2),
.scores__table td:nth-child(5) {
  text-align: center;
}

/*
 *
 * Weather
 *
 */

.weather {
  padding: 1em;
}

.weather__location {
  display: block;
  font-weight: 300;
  font-size: 1.5em;
}

.weather__desc {
  display: block;
  font-size: 1.2em;
}

.weather__today {
  width: 60%;
  vertical-align: middle;
}

.weather__today__image {
  vertical-align: middle
}

.weather__today__temp {
  font-size: 3em;
}

.weather__today__deg {
  font-size: 2em;
  display: inline;
}

.weather__next__item {
  display: inline-block;
  width: 20%;
  text-align: center;
}

.weather__next__item span {
  display: block;
}

.weather__next__image {
  width: 100%;
}

/*
 *
 * Recent News
 *
 */

.recent-news {
  clear: both;
  padding: 1em;
}

.snippet {
  clear: both;
  margin: 24px 0;
}

.snippet__thumbnail {
  width: 100px;
  float: left;
  margin-right: 1em;
}

.snippet__title {
  font-weight: 500;
}

.snippet__title a {
  text-decoration: none;
  color: #666;
}

.snippet__title a:hover,
.snippet__title a:active {
  text-decoration: underline;
}

/*
 *
 * Footer
 *
 */

footer {
  border-top: 1px solid #E0E0E0;
  padding: 1em;
  width: 100%;
}

footer li {
  display: inline-block;
  margin: 0 1em;
}

footer a {
  text-decoration: none;
  color: #333;
  padding: 1.5em;
}

/*
*
* media queries
 *
 */

@media screen and (min-width: 660 px) {
  .container-main {
    display: flex;
    align-content: center;
  }
  .news {
    width: 200px;
    float: right
  }
  .hero {
    width: 200px;
  }
}

.flex-container {
  display: flex;
}
<!doctype html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Brighton Times</title>
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" type="text/css">
  <link rel="stylesheet" type="text/css" href="main.css">

        The Brighton Times

        News

        Events

        Culture

        Blog

Absolutely astonishing breaking news!

Organic raw denim Vice keffiyeh lomo Kickstarter art lomo Kickstarter art four loko. Organic raw denim Vice keffiyeh lomo Kickstarter art lomo Kickstarter art four loko.

Top news
            + more

              Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache.

              Squid lomo Kickstarter art lomo Kickstarter art party cronut scenester.

              Organic raw denim lomo Kickstarter art Vice keffiyeh four loko.

              Organic raw denim Vice keffiyeh lomo Kickstarter art lomo Kickstarter art four
                                                loko.

            date
            team
            score
            team

            Friday
            Bears
            95
            109
            Cubs

            Friday
            Otters
            3
            1
            Cubs

            Saturday
            Wolves
            7
            0
            Panthers

            Sunday
            Hawks
            11
            12
            Capons

            Sunday
            Stags
            6
            2
            Foxes

      Brighton, UK
      Sunny

                        13
      °C

          Mon

          13 °C

          Tues

          13 °C

          Wed

          13 °C

          Thu

          13 °C

          Fri

          13 °C

Latest news
        + more

            Gastropub distillery Marfa farm-to-table

Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh
            four loko.Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh four loko.Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh four
            loko.

            Organic raw keffiyeh four loko.

Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh four loko.Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice loko.

            Kickstarter art party cronut scenester.

Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh
            four loko.Vice keffiyeh four loko.

            Squid lomo Kickstarter art party cronut

Gastropub distillery Marfa farm-to-table, Etsy Truffaut fingerstache. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh four loko. Squid lomo Kickstarter art party cronut scenester. Organic raw denim Vice keffiyeh
            four loko.Vice keffiyeh four loko.

          Contact us

          Follow us on Twitter

          RSS

Comment: sorry, I actually forgot to add that I need it to be one column on mobile devices, not two, hence the breakpoint at around 600px. it's actually good on mobile devices. atm.


Iterate over a list of objects and return a child list if condition is met

Question: Is there a cleaner way to iterate over a list of things and return the list of stuff if a condition is met without needing to iterate over the list twice?
Please see the code below.
void main() {
  final x = [Stuff("a"), Stuff("b")];
  final y = [Stuff("x"), Stuff("y")];
  final things =  [Thing(x), Thing(y)];

final res =  things.where((thing) => thing.stuffs.any((x) => x.x == 'y')).first;
  print(res.stuffs);
  // return list y [Stuff("x"), Stuff("y")]
}

class Thing{
  List<Stuff> stuffs;
  Thing(this.stuffs);
}

class Stuff{
  String x;
  Stuff(this.x);
}

I can use this to find the correct Thing object, but then I still have to iterate over the list of stuff to find the correct list.
final res1 = things.where((thing) => thing.stuffs.any((x) => x.x == 'y')).first;

Comment: Your current implementation does not iterate over the list twice. The [where](https://api.dart.dev/stable/3.3.2/dart-core/Iterable/where.html) method returns a lazy iterable.
Answer: Try this, no dramatic change but a little bit cleaner:
final res = things.firstWhere(
  (thing) => thing.stuffs.any((x) => x.x == 'y'),
);


EV NEMA 14-50 / Ground in Conduit, Gauge / Future Proofing GFCI?

Question: I'm out in Chicago and everything is piped in conduit, and my electrician ran 3/4" conduit (100ft run... from one end of my house to other end for an EV outlet).  This was 2 years ago, I asked him to install 1" or larger and he doesn't work on larger conduit and I needed to get him out of my basement, so I agreed to 3/4" conduit with a whole bunch of bends.   (Guy is a conduit wizard, not an electrical engineer but great price for conduit work and putting in boxes.   10 times faster than me!).
Anyway...  I looked up on my phone and I thought I could only put in two, 6 gauge wires in 3/4" conduit, and pulled my two hots through (which much swearing and unhappiness, took me 2 separate pulls in between boxes, and the missus got involved pushing cable.  What a pain!).
I'm looking right now, and I guess the fill chart is actually 4, 6 gauge wire....  I took my 3rd 100ft white coil which I thought I would use as a neutral with the NEMA 14-50 plug.
My EV came with a portable EVSE NEMA 14-50 plug, so I put in the NEMA 14-50 plug with no neutral.  (Yes, I get why that could be bad for the next guy if he hooks up his RV and expects some 120V lines there; I will change it to a NEMA 6-50 before I leave the house so somebody else knows there isn't a neutral at the plug -- I actually wish I had read the fill chart correctly and pulled the neutral line).
ANYWAY, I get things buttoned up have 6 feet of extra wire on each end of the circuit, and connect everything (safety first) to trial run before I cut the lines.
The EVSE detects I don't have a GND line (since we have conduit), and I add in 6 gauge whip and just touch the metal box (which is tied back to the panel / earth GND).  EVSE is not happy with just two hot lines, and evidently does a GND check when it boots up.  I did not expect the EVSE to be this smart!  Honestly, it is a very good safety decision to make sure there is a valid GND before you can charge 50A.  So good on the EVSE company.

What size GND wire would you use for a 50A circuit like that?  I have a proposed GND screw + 8 gauge copper wire for the GND?  What is code on that...?
In Chicago, electrician/s and code evidently do not require GND wires from 120V outlets to the box (I've been around a bunch of different electricians and houses, and they just don't require GND connections which as an EE seems really strange to me).  I guess the assumption is that if something shorts in the box / pipe the breaker will go off.
The EV outlet is in my garage and sure seems like it would require a GFCI (like all the other outlets).   I don't really know if the Harry Home Inspector when I go to sell the house would catch this but is the GFCI breaker the right way to have the NEMA 14-50 plug setup?)
Just the way the garage is piped in, the outlet is a bit low, and now the wires are pulled, I'm really set on keeping the 50A line a plug since I spent a Sunday pulling this wire (and 200 ft of 6 gauge is not cheap either).
It wouldn't work to direct wire a wall charger. I'd have to blow out the wall a bit and pipe things in  (totally finished garage, etc).
Is the reason people are direct wiring the wall chargers is that your EVSE messes with your 50A breaker?  But code is mandating that outlet should be GFCI since it is in your garage?
(I think the moral of the story is I didn't pay very much for the Conduit Wizard, but he didn't really plan this out very well either.  Get what you pay for!  Having the experience of understanding the plugs and dimensions of the components I would have made sure mounted these boxes at eye level and just done a direct wire for an EVSE, and had him pull 4 conductors with his buddy and save myself a Sunday of misery... ).
Comment: Quite a few places require garage receptacles to be GFCI protected.  Most GFCI breakers that size are expensive and maybe hard to get, so direct wire EVSE is recommended to bypass GFCI requirements.  EVSE's also usually have better GFCIs built in.
Comment: Do you have to go with a plug-in? If you can hardwire the neutral becomes totally unnecessary. Hardwire EVSEs don't even have a connection for it, since the J1772 plug doesn't have a neutral either.
Answer: Wow, just wow... this is a mess of misconceptions on top of all the normal misconceptions circulating in the EV community.  I don't even know where to begin. At least the 3/4" EMT is correct.
14-50 is an RV socket not an EV socket

My EV came with a portable EVSE NEMA 14-50 plug,

Imagine you are "on the open road" and you need charging.  Let's say it's 2012 when EVs are still rare and there isn't yet built-out charging infrastructure. Where do you find the biggest power that is readily accessible to the public?  RV parks.  They have fat 14-50's for large RVs.
So if they're tossing in a travel unit to be kept in your trunk for opportunity charging on the road, they'll give you the normal one and the RV socket. They never imagined people would use it as a daily charger; it's not that tough!  They expected you'd use a wall unit.
The 14-50 IS NOT an EV socket. It is an RV socket. You should not install a 14-50 simply because travel chargers come with that dongle free and other dongles are $35.
SMH it's not even saving money. The 6-20 dongle + #12 wire is cheaper than #6 wire!
There is nothing wrong with level 2 charging at 15-30A.  You do not need to replace 250-300 miles a night, and on that one night you do, there is DC fast charging.
Don't overload your service either
Many people make a lot of fuss to install that giant 50A circuit, but precious few stop to ask "can my house actually handle this?"
The correct way is doing a Load Calculation per NEC Article 220. That will tell you the reserve power available for your house and how much can go to EV charging. Lunging forward and slapping in a 50A circuit in Pavlovian fashion is a good way to damage your panel.
It pays to ask experts before doing/buying

Anyway... I looked up on my phone and I thought I could only put in two, 6 gauge wires in 3/4" conduit

Harper's Law: Buy the wire last.  (after asking around for advice). We would have cheerfully told you that THHN in conduit allows 50A on #8 wire.
And those travel units assume 40A anyway, since 40A circuits use the NEMA 14-50 socket.  So you could have that + 2 other circuits in the conduit too (derating the #8 to 44A).
The smarter ones would've also told you that 50A is bonkers and set your sights higher than using the free dongles that came with the free travel unit, and that 20A is perfectly adequate... and you wouldn't have believed us and split the difference and gone 30A, and been happy as a clam just like Alec in the above video. (ten years owning three?four? EVs and never used DC fast charging til now).   Easy pull and save some coin.

and pulled my two hots through (which much swearing and unhappiness, took me 2 separate pulls in between boxes, and the missus got involved pushing cable. What a pain!).

Well that's inexperience and lack of adequate pulling tools. You'll get better at both. But you also seem to feel you were inconvenienced by having to pull at an intermediate box.  Um yeah, you have to use EVERY intermediate access point! (with rare exception you can drag through an access point where it goes straight through not offset; pulling around a curve is out of the question, it'll trash the wire!)
And there can't be more than 360 degrees of bend between access points, the less the better. I aim for 90 (180 if unavoidable). If you were trying to pull around 6 or 8 nineties, no wonder.

My EV came with a portable EVSE NEMA 14-50 plug, so I put in the NEMA 14-50 plug with no neutral. (Yes, I get why that could be bad for the next guy if he hooks up his RV and expects some 120V lines there; I will change it to a NEMA 6-50 before I leave the house

It's illegal to do that. Change it now. Buy the 6-50 dongle. (or just make a 14-50 to 6-50 1-foot-long cheater cord; 1-foot long assures nobody mistakes it for an extension cord and will think before using it).  Cheater cords must never cross amp ranges, because an embedded microchip in the dongle tells the EV the safe amperage!
Grounding in EMT-land

ANYWAY, I get things buttoned up have 6 feet of extra wire on each end of the circuit, and connect everything (safety first) to trial run before I cut the lines.
The EVSE detects I don't have a GND line (since we have conduit)

EMT does provide proper ground. The socket didn't have ground because it was dangling; you hadn't mounted it onto the box so it couldn't get ground via the mounting screws.  You didn't install a ground jumper wire because you don't need that with EMT.
Just attach it to the mounting box via 1 screw, doesn't even need to be in the box. Or use alligator clip jumper, whatever.

What size GND wire would you use for a 50A circuit like that? I have a proposed GND screw + 8 gauge copper wire for the GND? What is code on that...?

EMT provides the proper ground and no ground wire is required.  End of conversation.
If you wanna run a ground, #6 THHN is 65A wire. For 61-100A wire, you need a #8 copper ground. It must be green, yellow w/green stripe, or bare. "But it's a 50A circuit" -> NEC 250.122(B) says you go by the wire size (not directly).
Also it's not "GND".  "GND" is a term from low voltage DC electronics, and refers to the common "current return" also called Vss, the negative in most setups.  That has bad connotations in AC power, since safety ground is solely a safety shield and should never have current on it.  That Vss equivalent is neutral.

In Chicago, electrician/s and code evidently do not require GND wires from 120V outlets to the box

Yes, they do. They certainly do.  They only don't require a ground wire if the outlet is able to pick up ground another legal way.

it has hard, flush clean-metal contact between metal receptacle yoke and metal box.  (so you must get those little "capture the screw" squares outta there).
it is UL-listed as "Self-Grounding" meaning it has a wiper to pick up ground off the mounting screw. This applies to the $4-tier "spec grade" receptacles.
it is a switch, where the mounting screws are presumed good enough.

But a sharp installer will use one of these methods almost everytime.
GFCI in EVSE-land

The EV outlet is in my garage and sure seems like it would require a GFCI (like all the other outlets). I don't really know if the Harry Home Inspector when I go to sell the house would catch this but is the GFCI breaker the right way to have the NEMA 14-50 plug setup?)
Is the reason people are direct wiring the wall chargers is that your EVSE messes with your 50A breaker? But code is mandating that outlet should be GFCI since it is in your garage?

That thing you call a charger? That's not a charger, it's an EVSE.  It has 3 jobs. #1 Be a "smart GFCI". #2 have a relay. #3 send a square wave telling the EV the allowed amps on that circuit.
Do you need a GFCI on a GFCI? No, of course not. That's dumb, and defeats the smart GFCI (auto-retry, and alert user if problem).
But you do need a GFCI on a socket if that socket is in NEC 2020 territory (Chicago isn't yet) and the state hasn't deleted that rule (most have).
So the only reason you would ever need GFCI is because you're insisting on it being a socket. A wall-unit EVSE can be hard-wired, and that will never need a GFCI because it is one.
Hardwired could work though.

It wouldn't work to direct wire a wall charger. I'd have to blow out the wall a bit and pipe things in (totally finished garage, etc).

That's naysaying, you just are worried that you want the ability to rapidly swap EVSEs. That's silly since you perfectly well know how to hardwire.  Even if your wall socket is flush-mount, you can stack an extension box on that and then continue with EMT or Legrand Wiremold to a wall-unit EVSE.  It's easy to do.
"But it's unsightly" -> No moreso than the cord it would require. The conduit can be painted wall color.  Cord can't.

(I think the moral of the story is I didn't pay very much for the Conduit Wizard, but he didn't really plan this out very well either. Get what you pay for!

Are you kidding, Conduit Wizard is the best part of this. Have that guy back. Nobody ever regretted running 3/4" EMT instead of something less.
Comment: @Leroy105 Ground size from NEC 250.122. Assume every single thing they tell you on EV forums is wrong. My expertise is electrical - while I adore EVs and have been waiting 30 years for this tech to arrive, I'm coming at it *from a Code electrical* perspective.  I have no quarrel with running big wire to the garage - heck I advise #2 aluminum (it's cheaper than #8, and 90A). But then I will turn around and say "commission your EVSE to 20A breaker" if that's all the Load Calc will support.  I'm not OCD... I just want insurance to pay.
Comment: @Leroy105 ILSCO Mac Block Connector is a cheaper Polaris that maxes out at #6. With dual EVs, please use Share2 or equivalent *power sharing* set to circuit max (65A or less).  Two cars charging at "30A" each, guaranteed one will finish by about 2AM, then the other car gets the full 65A or whatever max the EVSE allows.   You will need to use a subpanel to split the power to two EVs, since both NEC and UL forbid two EVSEs on 1 circuit, and it's not like they don't know about Share2 - UL *specifically approved* it.
Comment: The tricky thing with ground faults @Leroy105 is a rare edge condition where the EV is having a problem and leaks DC current on an AC line.  In that case, the DC current will saturate the sense coil on the GFCI, and it won't sense anymore. Some EVSEs (Zappi) will detect DC leakage.  Of course a GFCI breaker has no chance of dealing with this.  They're pretty limp when it comes to EV protection. On Share2 problems, the "do not overdraw the allocation" must be dog simple and well designed, *or UL would not have approved it*.
Comment: That's interesting on the outlet making box contact for the ground.   Never thought of that.   Disagree on the wiring 6 vs 8 gauge and amperage,   my time is worth more than the wire costs.  I'd rather pull once and have the amperage.   Depends on your EV, mine is a baby so 8 gauge and 30amp would be a wash today.   Portable evse came with car and a wall mount, that's what I'm using and saving $700 vs a wall mount.  Not planning on moving it, I'd DC fast charge out on the road. If conduit wizard had suggested a hardwire I'd have had him layout the boxes.   Appreciate the gnd insight!
Comment: Where do you find this 'For 61-100A wire, you need a #8 copper ground'?  -  I bought a 5ft bare copper #8 gauge based on some rando Tesla EV forum to put into the box on the outlet side.
Comment: We did do a load calc and there is an electric heater in that garage and 50a + electric heater, and the rest of the house on is basically 80% of the service limit.   So I think the future would be a two ev wall charger and hardwire it in.  I hear you on the external vs keeping it flush with pipe on the wall vs external cord.   Just my 2 cents, I have a collection of Porsches and nice gas cars, the ev is here to save money and if avoiding a $700 wall charger is an option, more gas money for the 911...
Comment: This is my point on the 6#;  Tesla is fifty thousand pound gorilla in the USA, and they have wall chargers supporting 48amps.  https://www.tesla.com/support/home-charging-installation/wall-connector  Some future home buyer comes to my garage or I buy a Tesla... and I put in 8#....?  To save $40 on wire costs?  Worse case, 6# Polaris splice, inside the wall cavity, 1" flexible EMT (which Chicago allows up to 6' for emergency runs) to another box, and you wall mount your Tesla charger.  Meanwhile... My Nissan EV, charges max speed with their provided EVSE.
Comment: Nice on the ILSCO Mac Block Connector, that's really helpful to know!  (I'm not up on the hardware whatsoever).   Conduit wizard did a bunch of 20A circuits in the unfinished basement and outdoor electrical outlets and this garage run (new house for us in 2020) and I asked for the EV run without planning on using it in my ownership (I should have had him just pull the wires then but I thought copper prices would go down in 2 years).   On the 2 EVSE's on 1 circuit, are you saying something like the Share2 would not be NEC compliant?  I personally, am not certain we would ever be a 2 EV family.
Comment: (I wish I had pulled the neutral and not misread the fill chart on my phone....  I actually have owned an RV in the past, and having that plug in the garage would have been useful.  The $90 of extra wire is nowhere as painful as the pull is.  I'm not certain I could get the third conductor in the 3/4" pipe now with two other conductors in there).  I took a look at a few of the wall chargers and their cable punch outs and screw positions and I think you could probably pull flex metal conduit in the cavity bay and keep it really clean, possibly no drywall work needed.
Comment: I do get the code point on the GFCI, and in my scenario in my garage it seems like a far stretch to ground fault yourself to death (you basically would have to grab the 12" cable from plug to portable EVSE), but I get if people are daily unplugging their portable charger the $12 Home Depot NEMA plug ain't designed for that and you could have some freak ground fault scenario, where you are wearing no shoes, your garage is wet since you washed your car, or are you really sweaty and somehow manage to electrocute yourself.  Honestly I would not unplug that charger without turning off the circuit.
Comment: I was reading this over lunch on GFCI design and UL standards (I do EE on circuits like this, more RF though than anything): https://www.westernautomation.com/wp-content/uploads/2016/03/GFCIs_For_AC_DC_Systems.pdf

This OSHA right up is a really interesting thought exercise in practical electrocution in damp environments:  https://www.osha.gov/sites/default/files/ElectrHaz_ActivityOptAB.pdf

(Never really considered this from user perspective on how you could actually electrocute yourself.)
Comment: @Leroy105 Share2 has never been multiple EVSEs on one circuit.  It's always been separate breakers but **sharing a single current allocation**, and will continue to be so until rules change.  But that's no big deal, subpanels are cheap and you don't need GFCI breakers for Share2 EVSEs, because they are hardwired by definition.  It's a wiring detail, but the principle of Share2 works fine.
Comment: I see.  I was thinking more like the, https://grizzl-e.com/grizzl-e-duo/.  But point taken, it's also UL rated.  The one thing that gives me pause on the external wall charger is that all of these EVs are coming out and if you read the reviews on the Grizzle-E you'll see weird edge cases where it works on certain EV brands and other brands it's a little flakey.  There's just a bunch of protocol mis-match issues that need to get ironed out for the dual EV chargers I think.  It's hard to just not buy the Tesla chargers and be done with it since they seem to have the market cornered.
Comment: Oh, that thing. That uses Share2 internally (but has no ports so you can't share an allocation with two of them).  But you can also do Share2 with a row of standalone Tesla Wall Connector v2 or v3, *and boy, talk about elegant - best features in the industry and great price too*.  Most other manufacturers offer at least one unit with the feature, and then Span will integrate it with your whole house!  Really guys, this is no time for patent wars and trademarking.  To get the 3rd wire in there, pull the 2 wires and pull all 3 back in.
Comment: I was thinking the same thing on pulling the 2 out too.  I feel like a putz because that is the (4th!) trip to hardware store.  I really don't wan to repull that cable.  It'll go faster since I have experience now, but 2 was bad, 3 is only worse!!!  (This is my beef with Conduit Wizard, I wish he knew more about the EV Charger state of affairs and just did this from day one.  HOWEVER... what he charges is beyond reasonable, so my beef is very small.  He didn't want to come out for this pull and hasn't gotten back to me, so I got stuck pulling the lines).


How do I properly size a 120v inline power relay to control a small air conditioner with my home automation system?

Question: I have a 5,000 BTU, 115 volt, 4.8 amp, window-unit air conditioner I'd like to control from my home automation system.
I think easiest thing to do would be to plug the unit into an inline rely module that switches its power on and off.
How do I go about determining the load rating needed for such a relay module?
For example, I have an extra module here that says it's rated for 600W incandescent, 1/2 HP motor load, or 15 Amps resistive. Too small, right?
Comment: Does the AC Unit have any kind of remote control? You will be better off hotwiring a spare remote from ebay to turn it on and off instead of trying to put the entire unit on a relay.
Comment: Unless your AC has entirely physical controls, this isn't going to work well - it will lose it's settings when it loses power.  Many also don't come on automatically after losing power (which helps prevent problems from everyone's AC coming back on at once after a blackout).
Comment: IDK if you're looking for this level of hack, or if it's even doable, but... If the built in thermostat switches low voltage, maybe you could replace the thermostat with the output from the home automation system.  That may have some advantages, there may be internal controls to prevent the unit from starting / stopping too frequently when the temperature hovers above and below the setting.  Again - just a thought, don't know a thing about window AC controls.
Answer: @ 80% efficiency is just above 1/2 horsepower.  The relay is just slightly too small in my opinion.
Answer: That relay should be fine: AC watts = Power Factor x Volts x Amps. In this case we don't know the power factor, but 115 volts x 4.8 amps = 552 watts. Your unit probably draws somewhat less than that in reality. Does the AC unit mention power factor, or watts?
Comment: A motor is much harder on a relay than a purely resistive load - they draw far more starting current than when they are running (and can also throw some interesting voltages when you shut them off.)


Java file structure encryption

Question: I've been reading up on how encryption works more or less and have used some in Java, but I've never seen people talk about encrypting a structure of a file. Mostly the contents.
For example:
This is a simple JSON file.
{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}

From what I understand, when you encrypt the data in the file, this happens (no actual encryption, just random letters for the sake of argument):
{"menu": {
  "id": "Alxqpowekjmzkx23aOSP",
  "value": "oaksdpmxzPOADPwAPSDl",
  "popup": {
    "menuitem": [
      {"value": "AOPSDKPQPOASKdpxzlmmcvkds", "APOwpoqdxzmdas": "AQPOWKDpoAKsdmxz"},
      {"value": "OPWEkPAskpdkPAodAodkapdsk", "APOSkdpoaKpadkAP": "XpzZOpxdkapKDAPkd"},
      {"value": "OQIWdOmlzxmLZKmdAd", "AOPKSpokdASK": "PAOSKdpoasdkaposdkpzxl"}
    ]
  }
}}

Basically, you don't know what the values are, but you can still see the structure and what types of data there is.
Is there a way to convert the whole file contents (including the structure) into a single string looking, for example, like this?
AposdkPAdkPAOsdkPAOWKpo2kdpoaKD2od1dkSAOd9asdkPAOskd93kaoldkPA92dkPAOSdk92
Or perhaps something of this sort? But with Java, because most of the time to produce it like this, I've read that people use external tools, a la VeraCrypt and the sort, but I'd like to know how it's done/what tools are used in Java and do it myself programmatically.
Comment: "From what I understand, when you encrypt the data in the file, this happens" - that entirely depends on how you encrypt it. The most common ways of encrypting a file *do* just encrypt everything in it, leaving no sign of the structure visible.
Comment: What method of encryption are you using that just encrypts certain values in a JSON file?
Comment: @khelwood Well, usually just encrypt a value, convert it to Base64 (so I have it as a string) and write that in the file. I'm fairly new to doing this properly, but it is what I've been thought, which is why I'm trying to find a way to do the whole content.
Comment: @DoombringerBG If you were to google _how to encrypt a file in Java_ you would find lots of links to get you started.
Comment: @khelwood I've already done that and keep doing it. Problem is, I keep finding useless information and examples where people only encrypt the values but not the whole structure/content of a file.
Comment: read file data as byte array(in your case all the whole of them!, not just the parts which would be corresponding to some values if you json parse them) , feed them to the encryption algorithm then write the resulted data to a file. and unless you're using some weird file system standard which only allows strings to be written to disk base64 wouldn't be necessary.
Answer: You must be Googling for encryption/decryption far too specific towards JSON rather than towards Text File. If you want to encrypt a Text File which just so happens to contain JSON content then the internet is full of examples including SO. Never the less, here are some method that will carry out the task.
The file content encryption provided here utilizes Java 8's Base64 Class encoding and then a Caesar Cipher (which is a shift cipher) is applied to each file line. By no means is this considered a Secure Encryption but it is enough to confuse most (at least for a wee bit).
The concept here is to read in the JSON text file one line at a time. As each line is read in it is encoded, ciphered then saved to a Destination File Path until the end of file is reached. When finished you will see that in no way is the destination file legible towards what type of file the original may have been, at least not until is is Decrypted. All text is ciphered including format indentation. File Decryption is done in the very same fashion.
There are four simple methods provided here which requires Java 8+ to carry out the task of encryption/decryption:

To Encode and Cipher a string:

/**
 * *** THIS METHOD BY NO MEANS PROVIDES A SECURE ENCRYPTION ***

 *

 * This is an extremely easy String encryption algorithm that encodes the
 * supplied string to Base64 then applies a Caesar Cipher (which is a shift
 * cipher). See: https://en.wikipedia.org/wiki/Caesar_cipher

 *

 * You MUST use the provided easyDecrypt() method to decrypt a string that
 * has been encrypted with this method.

 *
 * @param inputString (String) The string to encrypt.

 *
 * @return (String) The encrypted string.

 */
public static String easyEncrypt(String inputString) {
    try {
        String b64encoded = Base64.getEncoder().encodeToString(inputString.getBytes("UTF-8"));

        // Reverse the string
        String reverse = new StringBuffer(b64encoded).reverse().toString();

        StringBuilder tmp = new StringBuilder();
        final int OFFSET = 4;
        for (int i = 0; i < reverse.length(); i++) {
            tmp.append((char) (reverse.charAt(i) + OFFSET));
        }
        return tmp.toString();
    }
    catch (UnsupportedEncodingException ex) {
        ex.printStackTrace();
    }
    return "";
}

To Decode and Decipher a string:

/**
 * This method is used to decrypt string that have been encrypted with the
 * provided easyEncrypt() method.

 *

 * Simply supply the encrypted string.

 *
 * @param inputString (String) The encrypted string which was created by the
 *                    easyEncrypt() Method.

 *
 * @return (String) The original string decrypted.

 */
public static String easyDecrypt(String inputString) {
    StringBuilder tmp = new StringBuilder();
    final int OFFSET = 4;
    for (int i = 0; i < inputString.length(); i++) {
        tmp.append((char) (inputString.charAt(i) - OFFSET));
    }

    String reversed = new StringBuffer(tmp.toString()).reverse().toString();
    return new String(Base64.getDecoder().decode(reversed));
}

To Encrypt A File:

public void encryptFile(String sourceFilePath, String destinationFilePath) {
    try {
        try (Scanner reader = new Scanner(new File(sourceFilePath));
            BufferedWriter writer = new BufferedWriter(new FileWriter(destinationFilePath))) {
            String line;
            while(reader.hasNextLine()) {
                line = reader.nextLine();
                String encryptedLine = easyEncrypt(line);
                writer.write(encryptedLine + System.lineSeparator());
            }
        }
    }
    catch (FileNotFoundException ex) {
        ex.printStackTrace();
    }
    catch (IOException ex) {
        ex.printStackTrace();
    }

}

To Decrypt A File:

public void decryptFile(String sourceFilePath, String destinationFilePath) {
    try {
        try (Scanner reader = new Scanner(new File(sourceFilePath));
            BufferedWriter writer = new BufferedWriter(new FileWriter(destinationFilePath))) {
            String line;
            while(reader.hasNextLine()) {
                line = reader.nextLine();
                String decryptedLine = easyDecrypt(line);
                writer.write(decryptedLine + System.lineSeparator());
            }
        }
    }
    catch (FileNotFoundException ex) {
        ex.printStackTrace();
    }
    catch (IOException ex) {
        ex.printStackTrace();
    }
}

To use the above methods:

encryptFile("SimpleJSON.txt", "NewEncryptedFile.txt");

With the sample JSON content you provided within your post, the desitnation file content will look like:
AA{iksnM59[^xN}i
wMW^wpq^mEmSmU[emEGM
wMW^wpqVmEmSmY[hwJqhmEGM
;FmSmE\h{=KgmEGM
AwJM:MWfpV\e59[^xNGMkEGM
AAEP=NWOsQ6fIh\^SZKhlZqgHNGM:M}enpKfn96fmEGPmg\^SNGM:MW^5|[]6N}ikEGMkEGM
w4rMtk}]zVofpF7XmEmSmw6]t|6]y=qMk{mMyZKgTNGM:MW^5|[]6N}ikEGMkEGM
AAUjmoGOn=KVpR7fwRoMksnMvR[ewRqfzNGMwMW^~=KfHNGM:MW^5|[]6N}ikEGMkEGM
A4JMkEGM
=FGM
A4\j

And now to Decrypt this file:
decryptFile("NewEncryptedFile.txt", "DecryptedFile.txt");

The decrypted destination file will look like:
{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}

Comment: Thank you! I was looking for something like this! I think I'll mix this with Google Tink as well. It should be pretty safe. <3

Java file structure encryption


How to return a line from the action method in Struts2?

Question: I want to return a line from the action method. My JSP is below
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

    <sj:head/>

Div 1

    <s:url id="ajaxTest" value="/test.action"/>

    <sj:a id="link1" href="%{ajaxTest}" targets="div1">
      Update Content
    </sj:a>

The action:
@Action(value="test")
    public String jquery() throws IOException
    {
       System.out.println("hello");
        return SUCCESS;
    }

Currently, I am getting the output as success and I think it's due to the return SUCCESS. What I need is to popup some custom text sent from the test action. How can I achieve that?
Comment: I think your action method needs to be mapped to jsp/template/view, you would also need to specify an object/model from which your view will be rendered.
Comment: can i do it by just getters and setters, will try n post back
Answer: Classically to return something from the action you need to put the result annotation on the action or method
@Result(location = "/pages/success.jsp")

in the result you write the markup that will be inserted in the targets. You may need to supply http headers to turn off cache-control while the page is not reloaded.
Doing with the response you need your action to implement ServletResponseAware.
Comment: k. so i changed my action to @Action(value="test", results = { @Result(location="/jquery.jsp")
    })
    public String jquery() throws IOException
    {
       System.out.println("hello");
        return SUCCESS;
    }    now the result jquery.jsp is above code so its adding an extralink instead. See i used to write some text to response in a servlet and call that servlet from the jquery ajax. But how to do same in struts2, can i write some text in action method and get at client side? If so how to do that using struts2-jquery plugin. Thanks for your support
Comment: You can write to the response output in the action but then you need to return NONE result.
Comment: K thats done, your the boss :) last think is i want to get that text in a popup, the way my jsp is written(copied from google) I cant see any wat to get the response text, the text is being set to a div, I want the same in a popup, thankyou so much.


Why are (a), (c), (d) true?

Question:
Let $z_1$ and $z_2$ be two distinct complex numbers and suppose $z=(1-t)z_1+tz_2$ for some real number $t$ with $t \in (0,1)$. If $\arg w$ denotes the principal argument of a nonzero complex number $w$, then:
(a) $\ |z-z_1|+|z-z_2|=|z_1-z_2|$
  (b) $\ \arg(z-z_1)= \arg(z-z_2)$
  (c) $\ \det \begin{bmatrix}z-z_1 & \bar z- \bar z_1\\ z_2- z_1& \bar z_2-\bar z_1 \end{bmatrix} = 0$
(d) $\ \arg (z-z_1)=\arg (z_2-z_1)$

The answer is given (a), (c), (d) . I am a beginner in complex numbers and would appreciate some help in learning how this answer was derived.
Comment: The given condition tells you that $z$ lies between $z_1$ and $z_2$ on the line joining the two points
Comment: Related: https://math.stackexchange.com/questions/2243476/complex-number-with-determinant
Answer: Hints: $\require{cancel} z-z_1=(\bcancel{1}-t)z_1+tz_2-\bcancel{z_1}=-t(z_1-z_2)\,$, and $\;z-z_2=(1-t)(z_1-z_2)\,$, then:

(a) $\;|z-z_1|+|z-z_2|= t\,|z_1-z_2|+(1-t)\,|z_1-z_2|=(\bcancel{t} + 1 - \bcancel{t})\,|z_1-z_2|$
(b)  see (d) below, but mind the signs
(c)  either work out the expansion, or note that the 2nd row is proportional to the first by (d)
(d) $\;\cfrac{z-z_1}{z_2-z_1} = \cfrac{-t(z_1-z_2)}{-(z_1-z_2)} = t \in \mathbb{R}^+ \;\;\implies\;\;\arg(z-z_1) = \arg(z_2-z_1)$

Why are (a), (c), (d) true?


chrome download attribute not working in plain html?

Question: I'm currently building an internal website for my office. I want to include a button that downloads an image on click.
After doing some research, I've learned about the new HTML5 download attribute and seemed like a simple solution. However, when clicking on the link in chrome, it behaves like a normal link despite having the download attribute within the  tag. I checked firefox and it seems to work as intended.
I know there are a few similar topics discussed here on this forum, but the caveat in my specific problem is that the internal site I am building is not actually hosted for security reasons, and is instead a folder placed in a shared drive that my coworkers can access.
Because it is not connected online, I suspect this may be the reason behind it not working, but have yet to find anything online to support my theory. Is there a way to get the download attribute to work in an offline, plain HTML site? Are there javascript alternatives I can use to add this functionality?
P.S. I've added some sample code just in case I'm overlooking something. I'm using vue to manage all of the content on the site, plus have some animation styles for the download button that may unknowingly contribute to my issue.

/*
  Used to trigger button animation.
  Possibly a factor in the download attribute not working.
*/

$('.animated-button').click(function() {
  $target1 = $('.animated-button');
  $target1.removeClass('animate');
  setTimeout(function() {
    $target1.addClass('animate');
  }, 100);
});
/*
  Used to style button and animation for the button.
  Possibly a factor in the download attribute not working.
*/

.button {
  font-family: 'Montserrat', Helvetica, Arial, Sans-Serif;
  display: inline-block;
  margin: 0;
  padding: 10px 15px;
  width: 200px;
  background: #036CE2;
  border: 2px solid #036CE2;
  border-radius: 5px;
  color: #FFF;
  font-size: 20px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  outline: none;
}

.button:active {
  transform: scale(0.9);
}

.button:hover,
.button:focus {
  background: #004CA3;
  border-color: #004CA3;
  color: #fff;
}

.animated-button span {
  display: block;
  padding: 10px 0;
  width: 100%;
  height: 100%;
  color: white;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
}

.animated-button.animate {
  -webkit-animation: success 2s ease;
  -moz-animation: success 2s ease;
  -webkit-animation-iteration-count: 1;
  -moz-animation-iteration-count: 1;
}

.animated-button.animate span {
  -webkit-animation: success-text 1.5s ease;
  -moz-animation: success-text 1.5s ease;
  -webkit-animation-iteration-count: 1;
  -moz-animation-iteration-count: 1;
  -webkit-animation-delay: 0.2s;
  -moz-animation-delay: 0.2s;
}

@-webkit-keyframes success {
    0% {}
   15% { background: #62E03C; color: #62E03C; border-color: #62E03C; }
   85% { background: #62E03C; color: #62E03C; border-color: #62E03C; }
  100% {}
}

@-moz-keyframes success {
    0% {}
   15% { background: #62E03C; color: #62E03C; border-color: #62E03C; }
   85% { background: #62E03C; color: #62E03C; border-color: #62E03C; }
  100% {}
}

@-webkit-keyframes success-text {
    0% { opacity:0; transform: translateY(20px)}
   15% { opacity:1; transform: translateY(0)}
   85% { opacity:1; transform: translateY(0)}
  100% { opacity:0; transform: translateY(-20px)}
}

@-moz-keyframes success-text {
    0% { opacity:0; transform: translateY(20px)}
   15% { opacity:1; transform: translateY(0)}
   85% { opacity:1; transform: translateY(0)}
  100% { opacity:0; transform: translateY(-20px)}
}

Download Img Downloaded!
Answer: Download Img Downloaded!

try out this thing with exact path to your file to be downloaded


Load jquery function upon completing a text input

Question: Is it possible to load a jquery function right after the user has completed a text input (not on form submission)?
This doesn't seem to work:
<code><?
if (isset($_POST['textinput'])) {echo "loadjqfunction()";}
?>
</code>
Thanks.
Comment: You are mixing server and client processing. What is telling you that a text input has been completed? Blur?  $(function() { $("#textinput").on("blur",loadjqfunction) });
Comment: Any idea how can I accomplish this in another way?
Comment: what do you mean/consider by "has completed a text input" ? a focus on next element or on the click of a button/link?
Comment: When the input value changes, I want to load a function.
Answer: This should be done entirely in Javascript:
<code>$("#textinput").change(loadjqfunction);
</code>


Exponential generating functions counting

Question: How many $10$-digit numbers use only the digits $0, 1, 2$ with each digit appearing at least twice or not at all?
I know I need the coefficient of $\frac{x^{10}}{10!}$ in:
$$\left(1+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots \right)^3=(e^x-x)^3$$
but what do I do here?
Comment: Expand the RHS.
Comment: I expanded it but I don't see what to do from here. I don't see how to get an x^10 term when my highest term I have is x^3.
Comment: What did you get when you expanded the RHS?
Comment: http://i.gyazo.com/1791ce24af112318199c6d8bdcdfc8d8.png
Answer: You correctly expanded the RHS as $$(e^x)^3-3x(e^x)^2+3e^xx^2-x^3$$
Now write this as
$$(e^{3x})-3x(e^{2x})+3e^xx^2-x^3$$
We look to the Taylor series of $e^{3x}$, found by substituting $y=3x$ in the Taylor series of $e^x$:
$$e^{3x} = 1+3x+\frac{3^2x^2}{2!} + \frac{3^3x^3}{3!} + \cdots + \frac{3^{10}x^{10}}{10!} + \cdots $$
Can you find those form $e^{2x}$ and $e^{x}$ yourself? If not, just leave a comment and I'll help you.
Comment: I wonder if the question implies that the first digit cannot be a 0 (since it asks for the number of 10 digit NUMBERS).  In this case I think we need the coefficient of x^9/9! in 2*(exp(x) - 1)*(exp(x) - x)^2. which is 29306.
Comment: It took a little bit of algebra, but I got it. Thanks!


Are Radio Buttons or a Drop-down more appropriate to scope a search?

Question: Below are Mock-ups of the two choices to scope the search.  The radio buttons would expose all choices initially.  The drop-down search pattern I've seen more often, and I think users would be more familiar with it.

download bmml source – Wireframes created with Balsamiq Mockups
Comment: Think we need a little text to provide just a bit of context and also so that this question is searchable...
Comment: IMHO: It depends more on the number of options. Drop-down can more comfortably support a larger number of options, but is a nuisance when it becomes an extra step to see what your only 2 or 3 options are. However that said, dynamic context would be first prize. ;)
Comment: I agree with @LisaTweedie: - How many options are there to choose from? Only two? What type of site is this? What do you know about your *users*?
Answer: Keep it simple, make the search parse both datasets simultaneously and use a single input

download bmml source – Wireframes created with Balsamiq Mockups
Comment: Indeed. Besides, it should be easy to figure out if the input represents an SSN or not anyway.
Answer: I think you should put them under "Advanced" search options. By default, you should search both options without forcing the user to choose either one (or select one from many). A good example is Google, there's one text field and a"search" button, that's it... advanced users can drill down themselves.
Answer: Dropdowns with just two values are an abomination (unto Nielsen). It's pretty hard to think of a use case where they would be justified. It is extremely frustrating to open a dropdown just to see that there's one more value in it. The reason you're usually seeing dropdowns in these contexts is that usually you have more than two options.
EDIT OK, it just occurred to me that maybe you didn't mean that there's only two options. In that case a good rule of thumb is to have a dropdown for 4 or more values. With three you can do it in either way, if you can arrange the layout for the radio buttons (it may be challenging).
Answer: If you only have these two options then this could be one way to do it (with the limited amount of context available). It mimics airline flight check-in forms I've seen.
The rationale I used: Give the user custom fields for each input type so they are less prone to making mistakes. For the SSN field it is also important to look "grown up" so that people trust you (unless they already completely trust your brand)

download bmml source – Wireframes created with Balsamiq Mockups
Edit
Instead of tabs you could also use radio buttons, if you wanted to.
Comment: Please don't abuse radio buttons to switch pages like you are proposing.
Comment: Too complex, classic image is appropriate to rembmber http://noisydecentgraphics.typepad.com/design/images/2008/03/11/yourproduct.jpg :)
Comment: @André, the radio buttons are not recommended and if used should not switch "pages", but simply toggle the input field. There are many more ways than tabs and radio buttons to toggle these fields. My idea of using tabs might not be the best :)
Comment: @ADOConnection, I agree, I think that even a simple search would also work. But that was already suggested and the question provided little context, so this was simply another alternative for the question author to consider :)


Which home improvement projects produce the highest return on investment when selling?

Question: I am looking to put my home on the market in the next few months (in Ohio). Which home improvement projects produce the highest return on investment when selling?
Should I invest in exotic landscaping? A modernized bathroom? Granite counter-tops?
My home is only about 9 years old to begin with.
Comment: I'd take pictures of what you have and post them on an image-hosting site -- tinypic.com or something similar.  There's no sense in replacing what might already look good.
Comment: Are you thinking about improvements solely as a way to earn a profit, or are you wanting to benefit from them directly?
Comment: **Related question** at money.stackexchange.com:  http://money.stackexchange.com/questions/1412/is-home-renovation-ever-a-good-investment
Answer: Having sold a home last year, I can say based on recommendations from our Realtor and the feedback we got from showings...
The BEST thing you can do is to declutter your house.
First, scout out a local storage unit. Get a 10'x10' unit or bigger (we had two). You'll use lots more space than you'd think.
Then, start filling it:

Pack up all clothing you won't be wearing during the time you're selling (out of season clothes, stuff that doesn't currently fit, out of style, etc.). Even things hanging in closets; people will see all the unused space (where you removed things) and see it as much bigger when empty. If your closet is packed with stuff, it'll look tiny.
Pack up your linen closet (except for a couple extra sheets, towels, and blankets). Most people accumulate way more than they'll use. Leave an item or two on each shelf, max.
Pack up most/all knick-knacky things from counters, shelves, etc. that are in normal view around the house. Many Realtors will tell you to remove photos of your family/friends as well -- it helps potential buyers to visualize THEIR family there instead of yours.
Pack up kitchen utensils, pots, pans, etc. that you don't use often.
Pack up all the holiday decorations (from garage, basement, attic, etc.) you won't be using this spring.
Within reason, try to remove a piece of furniture from each room. Especially things like that extra lamp, chair, couch, or end table you couldn't part with and just found somewhere to keep it.

Feel free to donate or sell items instead of storing them.
Also use the occasion as a chance to get rid of any expired food from the back of your pantry shelves or fridge. If you have storage shelves in your garage or basement, getting rid of old paint cans, yard chemicals, scrap lumber, etc. is also a good idea (do NOT put them in a storage unit).
If you're still motivated to do a project or two, continue with these cheap projects that make a big impact:

Paint rooms. Tend to go for an off-white neutral color. Also, use the same color on all the walls; don't use an accent color on one wall. Bold colors or accent walls can be extremely polarizing as people either love them or hate them and typically have a hard time envisioning a room in a different color. As @Tester101 mentioned in a comment (and other answer), you may want to avoid bright white.
Get any stains out of existing carpeting.
Make sure all window blinds are in good condition. If they're bent, broken, or extremely faded then replace them.
Wash your windows (inside and out).
Repair any screens that have holes.
Remove any hard water deposits from your sinks and tubs (CLR works great for this).
Comment: Don't paint rooms white!!!  It might make them appear larger, but they will also not feel as warm and welcoming.
Comment: If you're about to sell your house, this answer is really really helpful.
Comment: Some flowers, plants, etc. will help, too, and is a quick, cheap upgrade. I don't mean $10,000 in professional landscaping, but you can pick up a planter or 2 and put some fresh flowers for under $100.
Comment: @Tester101, that's probably sound advice. I was generalizing. We had a solid red wall in an otherwise white/eggshell room. Our Realtor made the point that a bold color scheme (whether on one wall or all of them) can be extremely polarizing. People can't seem to see past it and either love it or hate it. If they hate it, it doesn't matter that they loved the rest of the house. But if they love it, they still need to love the rest of the house. @JBRWilkinson, thanks!
Comment: Look at the money shots in some of the Reno-porn on tv.  You'll notice that closets tend to have 4 mens' shirts hanging in them, not 40. Women tend to own only 3 pairs of shoes, not 50. The typically overflowing box of hats and gloves is nearly empty. The ultimate goal is to have just enough stuff in a space define it's purpose and to help the potential buyer visualize their stuff in your space, not to see how much of your stuff can fit in.  The only exception appears to be fresh fruit.  Realtor's seem to love seeing industrial quantities of lemons and pears in bowls in odd places.
Answer: This blog post lists 10. I don't necessarily agree with them all, but the three key ones mentioned are:

Update your bathroom. A bathroom with a white suite will please the most people and more importantly displease the least. Make sure you have a shower as well as a bath.
Update your kitchen. Again you need something "modern" that won't date. You can just replace fitted unit doors and taps (say) which will go a long way down the road without costing the earth.
Adding more rooms. People always want more space, but don't use up all your garden.

Finally, don't forget to decorate any shabby rooms. Some people can see past the current decor, but most can't.
These tend to come up time and again in surveys.
Don't forget that (as Doresoom points out) you'll never get 100% return, so do the cheapest things first.
Comment: +1 I've heard bathroom and kitchen in that order have the highest ROI. However, you're probably not going to get 100%. It helps to do little things like paying attention to decor like Chris mentions, rather than tackling a huge project that you may or may not get your money back from when you sell the house.
Comment: +1 I agree with @Doresoom.  There's a big difference between updating the look of something and fixing known problems.  The latter is pretty much expected and doesn't necessarily translate into extra $$$ (but is absolutely necessary).
Answer: I don't think there are very many things you can to that will bring >100% payback.  That said, a lot will depend on the neighborhood, the price range, and the market.
Personally, I'd go for a fresh coat of paint, some landscaping (not sure if that would apply in Jan. in Ohio, but if you're going to wait until spring it might make a bit more sense), and finding a good stager - even if you think you're a good decorator, someone who does it for a living will probably have a lot of ideas you wouldn't think of yourself.
Comment: +1 for paint.  No crazy colors, but also don't go all white!
Answer: You might want to take the money you are willing to spend on a project and hire a home stager, depending on your market and the average price of homes in your area you may find this to be very helpful in getting the best price for your home.
One of the best ways to get people to pay more for a house, is to sell them a home.  You want the potential buyer to be able to picture themselves living there, and most people do not have the imagination to turn a large white room into a living space in their mind.
If you are living there while selling the house, make sure you clean, clean, and clean.  Potential buyers do not want to see your mess, and do not want to see your things in their house.
Final note:
DO NOT paint every room WHITE!  You want to make the home feel warm and inviting, not harsh and empty.
Comment: good point on white not being warm and inviting. I edited to incorporate your comment in my answer. That said, even a white room can be warm and inviting if the furniture, window coverings, lighting, and other decorations make it so. But you would need to pay attention to that stuff more so. If the house will be empty rather than furnished during showings, there's nothing that'll make bright white look anything but sterile.
Answer: I recently redid the kitchen in my house, and when it was reappraised the kitchen renovation payed 120% back.
I understand this is dependent upon outside variables, geography, market... but what I added changed the feel of the kitchen entirely. I live in a neighborhood which was all made by one contractor. While every house is not identical, there are 6-7 different home styles in the neighborhood. You never see two identical homes next to each other and you would never see it unless it was pointed out to you. Ergo, my kitchen variety in the market was small.
The initial motivation occurred when the electric stove top died, so instead of replacing it, I took apart the oven/microwave unit and expanded the counter top space next to the stove by 24".
I took out the Corian island and counter tops and replaced them with granite, with a new 2" bull nose overhang. Then added a  Kenmore elite gas range, re-tiled the back splash with a new style tile, added light yellow/white splashed wallpaper and removed the soffit over the new range to put in the necessary exhaust fan. The key to getting back the investment occurred because of the added counter space and open feeling from removing the prefabricated oven microwave unit. Also the kitchen went from a "kitchen" to gourmet kitchen.(something to do with the larger stove, gas range, and faucet over the stove).
The new style matched the house better and the light yellow wall paper added a clean feeling associated with white walls but without the stark contrast mentioned above in these answers.
Comment: Caution: Appraisal, and what it will actually get on the market at the time you sell it, are different things.
Answer: Your apartment is your home, and the way your home looks not only reflects your personality, but actually impacts how you feel about yourself.
So how can you quickly improve the look of your apartment without spending a fortune on new decorations, buying random trinkets that'll only add clutter to your life, or bringing in an interior decorator for hundreds of dollars per hour?
5 Cheap, Creative Ways to Make Your Apartment Look Amazing
Presented in order from quickest / easiest to requiring the most effort, here are five ways to completely transform the look and feel of your living space:

Add flowers to add life
But flowers are impermanent and expensive! Well, the very fact that flowers are impermanent is the point: they bring a freshness and vitality to your living space. And really, how hard is it to stop by your local florist or corner grocer to pick up a bouquet?
As for cost, at approximately $10 for a bouquet, flowers are actually one of the most affordable tricks for changing your apartment's feel on a regular basis.
Well-placed mirrors can make a cramped apartment with low ceilings feel spacious and warm. You don't have to be a swinging bachelor or bachelorette to appreciate the effect of a well-placed mirror. Depending on the effect you'd like to achieve, here are a few suggestions on using mirrors to great effect while remaining super lazy about the whole thing:

•   "Double" your best window by placing a mirror across from it: This will give the psychological impression of there being an additional window, and the natural light from your actual window will bounce off the mirror and fill up your apartment -- giving the entire space a more open, airy feel.
•   Create coziness: position a mirror behind a lamp, a candle, or other soft light source to bathe your apartment in a glow of "warmth" that so many apartments in the city seem to lack.
•   Elongate a wall: take a lengthy, skinny mirror, turn it on its side, and place along any wall in your apartment. You should notice the wall-lengthening visual effect immediately.

Temporary wallpaper offers customization with no strings attached
So you're either a renter or just the commitment-phobic type. We can't help your relationship issues, but temporary wallpaper was created for you!

Once a niche product with little variety, the temporary wallpaper category has exploded with options. Today almost any color or pattern you could want is available.

Garbage bags and The Container Store are your new friends
This one is pretty simple: city living is a lesson in cramped living, and clutter is the cruelest teacher of them all. Clear out some space and your apartment will feel renewed (plus, post-cleanup all the other suggestions in this list will see their positive effects boosted).

•   Begin by ruthlessly tossing out anything you don't believe you could reasonably sell
•   Take anything you believe you could sell and stop kidding yourself: bag it and take it to a shelter or goodwill, or else put it up on Craigslist to be given away for free (the time and mental anguish you'll save from getting rid of this stuff is more valuable than the few bucks you'll find yourself haggling over with random internet people).
•   Use modular bin systems (The Container Store!) to store away seasonal wear (winter coats, ski pants) under your bed.
•   Install some basic wall shelving to display any knick-knacks, items picked up during your South American adventure, etc. that you can't bear to give away but you can't figure out another place for in your apartment. (If you recoil at the thought of using basic tools, you can hire a handyman off Craigslist to bring their own tools and do a gorgeous shelf-mounting job for less than $50).

Pick up a paintbrush or roller
You knew this one was coming. But it's true: the fastest and most impactful way to transform the entire look and energy of your apartment -- short of buying new furniture or breaking up with your significant other -- is to paint your walls and major surface elements.
Answer: As @ChrisF said, additional rooms can help, but especially, as far as I've seen, additional bedrooms and additional bathrooms (up to a point).  If you only have a single bathroom adding another can add a lot of value (but as everyone else has said, probably not 100% return).
In older houses and cold climates energy efficiency improvements (better insulation, new windows) can also add value, but probably not for a house as new as yours.
Answer: 1 - Always perform deferred maintenance or you will be inviting offers knocking off morethan it would cost in reality to bring up to standard. Perform the maintenance, i.e. replace garage door, update outdated kitchen appliances (if they are) and flooring, mid-to late century but original bath or kitchens: update as much as your neighborhood will let you get a return on your investment (do not over improve in a neighborhood that would warrant making your home the highest priced). And I shouldn't have to say it, but replace the worn toilet seats and throw out the dead house plants.
2 - My personal deferred maintenance of my home for 14 years near Annapolis, MD included a new dishwasher, roof, garage door, kitchen and hallway flooring, clean carpets, removal of wallpaper, touching up paint and pulling out all of the foundation plants in the front of the home and replacing them with pleasing but correct foundation plantings (the former owner thought planting forsythea across the front of a 30 x 8' front porch was appropriate - not! - plantings should differ in texture, size, but mature to so large that the house is overgrown in one season, let alone say, 10 years). We also power-washed the house, walk, drive & outdoor patio furniture and replaced the shutters, painting them & the new garage door to match. Additionally, I pre-packed non-essentials of our "stuff" that pegged a)our religion, b)collections of pottery and china, handmade items such as quilts (one might display their collections proudly - but remember you want the buyer to look at the house, not your collections because you will not be selling those). Additionally, coin & stamp & all valuable collections, and firearms need to go bye bye!!! Pack up all family photos, framed certificates from schools and professional accomplishments and even if with the president of the US (which we frequently found in the Annapolis area) pack them up. Storage lockers and moving PODS are not that expensive if you have things you wish to keep but will streamline your home to being sold.
THINGS THE BUYER SHOULD NOT BE ABLE TO TELL WHEN WALKING THROUGH YOUR HOME: your sex (if single add in some items of the opposite sex), if there is a divorce happening (uncared for house plants and homes are the usual tip-off), your ethnicity, who your family and friends are, which country club you belong, and if possible which age range you are.
(Children closing down parents' homes have a challenge: the home will be dated in all likelihood: if not in a high end neighborhood, remove paneling, wall to wall carpet, window treatments that block sunlight & replace flooring if it will bring a more appealing look. For my mother's 48 year residence coated in nicotine we removed all window, carpet & wallpaper; painted one wall of paneling to antique white which was also used on all the walls to seal in the nicotine stain and painted the long lived but wonderfully functioning Sears metal cabinets that mom had painted brown, to white. On the exterior, we hired someone to remove about 15' of vines and invasive plants that had grown around the perimeter of the back yard. It was unbelievable the amount of yard reclaimed to make it look like the largest lot in the neighborhood - which it was! Work was started in June but not finished until Sept 1, thus I bought planters and plants for front stoop and deck and maintained them the entire summer as no plants would have been available to dress up these areas. Some furniture which had not fit into my parents' apartment was left behind. Thus, we used it to stage where possible. The cost was $7500 for the deferred interior maintenance. Had this not been done it would have sold for $80,000. With the investment and a list price of $129,900 (it's absolute rock bottom selling price - others were listed ten & thirty thousand more), but as a Realtor [sorry, I didn't mention that before] I wanted competing buyers. The first day brought three contracts 1 to $3,000 over list price. You have no idea how far that equity contributed to my parents' quality of life. With no other bills, but medical challenges in the wind, I was able to capture some of the money that frankly not only paid for special extras for them, but even the flowers for their funerals. (Attorneys specializing in elders are worth their weight in gold).
3 - As a Realtor, I always advised updating kitchens, removing light stealing window "sheers" - upping the wattage in their lighting, skirting the tall trees with limbs lower than the roofline. (One would be surprised how much light is stolen by these large leaf laden limbs. Oh! Absolutely remove dead & or rotting trees including stumps and of course old stumps. Frequently I was met with resistance on staging, but buyers like to think one thing: this home was loved by the homeowners and its maintenance was always seen to promptyly, even if that floor with the gouges in it was only replaced the week before or the front door's paint was barely dry, it says "loved!" "maintained!"
     A boss once told me if you see one cockroach in a house, what do you think: oh my, what else is looming in places I cannot see?  You want the potential buyer to think, wow, it's so clean and well maintained. "I'm comfortable that there won't be any big surprises on down the road."
Comment: This answer is really difficult to read due to the lack of formatting
Answer: This all depends on the home. There are some homes which you simply cannot fix all the problems.
If you have serious issues such as plumbing, electrical, roofing, and structural problems, then these should be addressed first. Minor cosmetic issues can be overlooked by the buyer as long as the home is in tact and does not need any major work.
Your home should appear to be well maintained, and indeed be well maintained. All surfaces should be clean and there shouldn't be any unnecessary clutter around your home.
Your furnace and chimneys should be cleaned. The lawn should be mowed, and plant beds weeded, etc.
A few things that can help is new carpeting and/or refinishing the floors. Touch up the paint, or repaint rooms. Replace the caulking around the tub, replace switch plate covers.
Basically if you see anything that appears to be an "eye sore", then you should remediate it.


ACF repeater sort multiple dates

Question: I have a minor problem, I need to solve the following:
<code>$today = current_time('Ymd');

$args = array(
    'post_type'      => 'event',
    'posts_per_page' => 3,
    'meta_query'     => array(
        'relation' => 'OR',
        'datumOd'  => array(
            'key' => 'datum_od',
            'value' => $today,
            'compare' => '>=',
        ),
        'datumDo'  => array(
            'key' => 'datum_do',
            'value' => $today,
            'compare' => '>=',
        ),
        'datumy'   => array(
            'key' => 'datumy'
        )
    ),
    'orderby'        => array(
        'datumOd' => 'ASC',
        'datumDo' => 'ASC',
        'datumy'  => 'ASC'
    ),
);

$events = new WP_Query( $args );
</code>
"datumy" are the acf repeater with the date picker in which the dates are. I need to think of something that I can check if the date in my repeater has already occurred and that is still happening and what happens to add them to the loop.
Example:
<code>current day: 10.8.2018

"datum_od" = 13.08.2018 - post with one date
"datum_od" = 20.08.2018 - post with one date
"datum_od" = 15.09.2018 - post with one date
"datumy" = array (1.8.2018, 26.8.2018, 2.9.2018) - post with multiple dates
</code>
and the "datumy" I need to check, 1.8.2019 has already been so hiding the date, and to see the date 26.8.2018 plus place it in the correct order where it should be with the date.
Would something like that be possible? Would anyone know how to help me? Or maybe direct me to the right path?
Thank you very much
Comment: I did not understand what you want to achieve - if `datumy` is ACF Repeater, then what are `datum_od` & `datum_do`? Can you explain little bit clear?
Comment: sorry, yes `datumy` is ACF Repeater, and `datum_od` & `datum_do` is only simple date picker fields. And in WP you have option to set only date from - to, or more dates, some custom posts have only date from - to and some have 5 dates, and i need sort it from closet date. Its something like calendar.
Answer: Thanks for interest, i solved this problem here is my solution for this if someone get same problem:
<code>            $second = array();

            for ($i = 1; $i <= 10; $i++) {
                $datumy = ( 'Datumy' . $i );
                $datumDB = ('datumy_' . $i . '_datum');
                $second    += array(
                    $datumy => array(
                        'key'     => $datumDB,
                        'value'   => $today,
                        'compare' => '>=',
                    ),
                );
            }

            $args['meta_query'] = array_merge( $args['meta_query'], $second );
</code>

ACF repeater sort multiple dates


Mouse event Button onclick need to be run escape keycode = 27

Question: When Mouse event Button onclick  need to be run escape keycode = 27,

Brav1Toolbox.addListener(window, "keyup", onKeyUp);
function onKeyUp(e) {
//code
 switch (e.keyCode) {
          case 27 : // esc
            _toggleOverview(true);
            break;
          case 33 : // pag up
          //code
          }
}

Above is esc key press function, I need to mouse down event the same function

function change_screen(e){
  if(e==27){
    //keycode = 27 is clicked
  }
}

Click

It is possible to run, kindly suggest
Comment: I don't get what you're asking... When clicking the mouse there is no keycode...
Comment: what is `change_screen` function? you havne't shown it
Answer: Very hard to understand the question but:
If you had a keyup and keydown listener then you could set an isEscapePressed variable based on the state of the escape key.  You could then use that variable inside the mouse event listener.
Comment: This should be a comment at best, how can you answer a question you do not understand?
Comment: @KobyDouek Because I think I do understand it. If OP clarifies and I'm wrong then I'll delete the answer.


Generate Java bindings for TinyB

Question: I need to use the TinyB library which is a C library. As a Java programmer, I'm just used to Jar files. When I build TinyB with CMake, no Jar files are generated. How can I create Jar files for TinyB?
Comment: Actually he just has to set a build option. TinyB provides Java bindings in a JAR if you ask their build to do so. ;-)
Comment: jar files are _Java_ Archive files. Compiling a C or C++ program won't create a jar as they're two completely different languages. To use C or C++ libraries, you'll need to use the JNI.
Comment: @ColinShewell Do you mind commenting why the answers were not helpful  (and how you did it instead) or otherwise accepting one? The other question indicates, you figured out how to tell CMake to build the Java Bindings. http://stackoverflow.com/q/41483380/2799037
Comment: @usr1234567 that question was asked within the last few minutes, I have not yet had time as I am busy trying to solve the problem that I have in that question.
Answer: That library is not a Java library, but a native library written in C. You cannot directly use it in Java directly as you are used to so that it works platform independently wherever Java runs.
You can use the library, but you bind yourself to the operating system for which the native library is built. If this is no problem for you as you just write your program for your RaspberryPi, you can use JNI or JNA to use that native library.
If this is actually about http://iotdk.intel.com/docs/master/tinyb/, you should maybe read the instructions fully and not blindly execute commands without knowing what you are doing. Those people already provide Java bindings that probably use JNI or JNA to talk to the native library, but you have to enable the generation of the Java bindings (the JAR) by a build switch.

Generate Java bindings for TinyB


How to set correctly boundaries in canvas breakout game?

Question: I'm making a game breakout in canvas tkinter but when I set condition to do baundaries the pallet doesn't move. How to write a statement correctly that it moves?
from tkinter import *
root = Tk()
root.title("Move Objects in canvas")

root.resizable(False,False)
height = 500
width = 700
x = width//2
y= height//2
can = Canvas(height = height, width=width,bg = "blue")
can.pack(pady = 30,padx=50)

rect = can.create_rectangle(height//2,700,width//2,490,fill = "green")

def keypress(event):
    x,y = 0,0
    if event.char == "a" and x > x:
        x= -10
    if event.char == "d" and x < 700 - width -x:
        x= 10
    can.move(rect,x,y)

root.bind("<Key>", keypress)
root.mainloop()

Comment: `x > x` is never going to be true.
Comment: To make the paddle move it has to be `x >= 0` and `x <= 700 - width -x`
Comment: Ok it moved but it still goes out of canvas field
Answer: To achive that, take the coords of your rectangle and check for the bounderies:
from tkinter import *
root = Tk()
root.title("Move Objects in canvas")

root.resizable(False,False)
height = 500
width = 700
x = width//2
y= height//2
can = Canvas(height = height, width=width,bg = "blue")
can.pack(pady = 30,padx=50)

rect = can.create_rectangle(height//2,700,width//2,490,fill = "green")

def keypress(event):
    x1 = can.coords(rect)[0]
    x2 = can.coords(rect)[2]
    if event.char == "a" and x1 > 0:
        x= -10
    if event.char == "d" and x2 < 700:
        x= 10
    try:
        can.move(rect,x,0)
    except UnboundLocalError:
        print('out of bounderies')

root.bind("<Key>", keypress)
root.mainloop()

I also added an try and except block to show when its out of bounderies. Let me know if any questions or error.
Comment: It is because **if** the conditions arent met, x wouldnt be defined. Thats why I added the try and except block, like stated in the answer.
Comment: You also can add x=0 in the beginning of the function *keypress* like you had before. Its maybe better
Comment: That's great but it reaises an error UnboundLocalError: local variable 'x' referenced before assignment
Comment: I just added after try/except: pass to silent this error
Answer: Found it! I fixed it, make - x, y = 1.0 or more, to start moving <3
Photo of fixed

Moving

If you want to move btw, to right and left, you should to this:
Fix
Comment: Even now it will move outside the canvas.
Comment: ok great it also moved but the paddle still goes out of canvas field
Comment: Fixed it! Check out the fix - https://i.stack.imgur.com/ICBiT.png


frozen screen after Upgrade from 13.10 to 14.04

Question: I have just upgraded to 14.4 ubuntu version.
it boots fine, but the screen immediately freezes.
I booted from live CD and navigated to my Documents and tried to copy them to an external hard drive but got error that, I haven't got permission to copy the directory.
How can I gain access to finish this task before doing anything?
Comment: Welcome to AU! Can you open/read the files you intend to copy? Can you create a new (empty) file in the destination directory? Please [edit] your question to improve it with additional info.
Comment: Thanks David, Yeah I can do all of that, and select / copy, but when I come to paste to the destination, then I have got the error that, I don't have permission.
Answer: I sometimes have inexplicable permission issues with Nautilus too – especially on file systems that aren't unixoid (NTFS or CIFS). In these situations I usually resort to the command line. To copy a whole directory tree recursively, you need to issue:
<code>cp -R [SOURCE] [DESTINATION]
</code>
Alternatively you can try other file managers like Thunar  or Dolphin .


SANE on Ubuntu 18.04 LTS not working (using Kodak Scanner, working on Ubuntu 16.04 LTS)

Question: this is my first question on askubuntu, if i did a mistake, please tell me.
The Problem: I want to use my Kodak i2400 scanner on my PC with Ubuntu 18.04 LTS (x64) installed.
I downloaded the official drivers from the manufacturer-page and installed it. During the installation there is the first inconsistency i noticed that the setup - the script says that SANE is not installed (but it is).
So if i continue the installation despite the SANE is not recognized, it tells me the Software installation is complete and indeed in the folder /etc/sane.d/ there is a new file called kds_i2000.conf.
Now when i connect my scanner, nothing happens, i tried:
scanimage -L -> it tells me "No scanners were identified ..."
sane-find-scanner -> it tells me "... No USB scanners found ..."
starting xsane or gscan2pdf -> a popup shows "no devices available" and "no devices found"
So i tried using the same scanner on my notebook with Ubuntu 16.04 LTS installed and everything worked as expected, i was able to scan and none of this problems occur.
Has anything changed at the sane driver? i dont know why sane is not recognizing the scanner.
I would be very thankful for help,
regards
Comment: According to the scanners driver page, the driver was tested on Ubuntu 16.04. Until they come out with an updated driver, I don't think there is much you can do unless you revert back to Ubuntu 16.04.

Maybe others here will have an idea or two, however.
Comment: Ok, i sent a message to the support. They said they would forward that to the appropriate department.
Answer: Sorry for late reply. This was my solution:

Disconnect scanner.
Download the official driver
Open terminal and install the driver (./setup)
run this command: sudo ln -sfr /usr/lib/sane/libsane-kds* /usr/lib/x86_64-linux-gnu/sane
Connect the scanner and scan

This solution was provided to me by kodak support.
Tested by me with Ubuntu 18.04 LTS and the program "simple scan".
Answer: Hi I had the problem that the XSane scanner did not show the pre-scan immage. Was all messed up. After deleting and re-install it refuses. Some library clash with N-Vidia driver. However simple scan keeps on working after the move to 18.04LTS


FluentAutomation + scriptcs not working

Question: I am trying to get scriptcs + FluentAutomation to work having read Scott Hanselmans blog post: http://www.hanselman.com/blog/NuGetPackageOfTheWeekFluentAutomationForAutomatedTestingOfWebApplications.aspx
Thing is, the demo code on the fluent automation website simply doesn't work:
http://fluent.stirno.com/docs/#scriptcs
And the code on Scotts blog is closer but still not there:
This for instance:
<code>var Test = Require<F14N>()
    .Init<FluentAutomation.SeleniumWebDriver>()
    .Bootstrap("Chrome")
    .Config(settings => {
        // Easy access to FluentAutomation.Settings values
        settings.DefaultWaitUntilTimeout = TimeSpan.FromSeconds(1);
    });

Test.Run("Hello Google", I => {
    I.Open(http://google.com);
});
</code>
Yields this:
<code>  --------------------------------------------------------------------------
  F14N - Fluent Automation Console
  -------------------------------------------------------------------------

  1) Hello Google

  ----------------------------------------------------------------------
  Unable to resolve type: OpenQA.Selenium.IWebDriver
  --------
  An unexpected exception was thrown inside WaitUntil(Action). See
  InnerException for details.
     at FluentAutomation.BaseCommandProvider.<>c__DisplayClass9.<WaitUnt
  il>b__8()
     at FluentAutomation.BaseCommandProvider.Act(CommandType commandType
  , Action action)
     at FluentAutomation.BaseCommandProvider.WaitUntil(Expression`1 cond
  itionAction, TimeSpan timeout)
     at FluentAutomation.BaseCommandProvider.Act(CommandType commandType
  , Action action)
     at FluentAutomation.CommandProvider.Navigate(Uri url)
     at FluentAutomation.ActionSyntaxProvider.Open(Uri url)
     at FluentAutomation.ActionSyntaxProvider.Open(String url)
     at Submission#0.<.ctor>b__2(IActionSyntaxProvider I)
     at ScriptCs.FluentAutomation.F14N.Run(String name, Action`1 action)
  ----------------------------------------------------------------------
</code>
Has anyone got this working? I am really interested in using scriptcs to build up these specs.
Answer: I ran into a similar issue. You may need to install ChromeDriver (http://goo.gl/yH3jNq)
Be sure to setup the location of the driver .exe in your PATH
Answer: I ran into this exception when I didn't have the specified browser installed.
It was a virtual machine that I thought had Chrome/Firefox/IE but it only had IE... oops. Installed Chrome and Firefox and everything worked just fine.

FluentAutomation + scriptcs not working