Find position of an Imageview inside listview

Question: I have a List view that I fill the rows via mysql database.
This is a view of what I have done:

This names that you saw are coming from my database and the PLAY ImageView is from my layout list that appears in each row(when I add a name into my database).
Now my problem is when I set a click listener to that play button, (purpose is switching it into pause ImageView and etc.) It changes another play buttons from another rows too,but not all of  them. Hence I think I'm not getting the position, right? Can you help me with this please!
This is my Fragment :
public class XXXUpdatesFragment extends Fragment implements AsyncResponse
,AdapterView.OnItemClickListener{

    View view ;
    private ArrayList<Product> productList;
    private ListView lvProduct;
    private FunDapter<Product> adapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.xxx_updates_layout, container, false);
        ImageLoader.getInstance().init(UILConfig.config(getActivity()));

        lvProduct = (ListView)view.findViewById(R.id.lvProduct);

        PostResponseAsyncTask taskRead = new PostResponseAsyncTask(getActivity(), this);

        taskRead.execute("http://symphonyrecords.6te.net/product.php");

        return view;
    } //onCreate

    @Override
    public void  processFinish(String s) {
        productList = new JsonConverter<Product>().toArrayList(s, Product.class);

        BindDictionary<Product> dict = new BindDictionary<Product>();
        dict.addStringField(R.id.tvName, new StringExtractor<Product>() {
            @Override
            public String getStringValue(Product product, int position) {
                return product.name;
            }
        });

        dict.addStringField(R.id.tvDescription, new StringExtractor<Product>() {
            @Override
            public String getStringValue(Product product, int position) {
                return product.description;
            }
        });

        dict.addStringField(R.id.tvQty, new StringExtractor<Product>() {
            @Override
            public String getStringValue(Product product, int position) {
                return "" + product.qty;
            }
        });

        adapter = new FunDapter<>(getActivity(), productList, R.layout.d_layout_list_d, dict);

        lvProduct.setAdapter(adapter);
        lvProduct.setOnItemClickListener(this);

    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Product selectedProduct = productList.get(position);
        Toast.makeText(getActivity(),selectedProduct.name+"", Toast.LENGTH_SHORT).show();
       }

    }

This is my Product class :
public class Product implements Serializable {
@SerializedName("pid")
public int pid;

@SerializedName("name")
public String name;

@SerializedName("qty")
public int qty;

@SerializedName("price")
public String description;
}

And this is my Adapter :
public class FunDapter<T> extends BaseAdapter implements Filterable {

private boolean paused = true;

protected List<T> mDataItems;
protected List<T> mOrigDataItems;
protected LongExtractor<T> idExtractor;
protected final Context mContext;
private final int mLayoutResource;
private final BindDictionary<T> mBindDictionary;
private int oddColorRes;
private int evenColorRes;
private FunDapterFilter<T> funDapterFilter;
private Filter mFilter;

public FunDapter(Context context, List<T> dataItems, int layoutResource,
                 BindDictionary<T> dictionary) {
  this(context, dataItems, layoutResource, null, dictionary);
}

public FunDapter(Context context, List<T> dataItems, int layoutResource,
                 LongExtractor<T> idExtractor, BindDictionary<T> dictionary) {
    this.mContext = context;
    this.mDataItems = dataItems;
    this.mOrigDataItems = dataItems;
    this.mLayoutResource = layoutResource;
    this.idExtractor = idExtractor;
    this.mBindDictionary = dictionary;

}

public void updateData(List<T> dataItems) {
    this.mDataItems = dataItems;
    this.mOrigDataItems = dataItems;
    notifyDataSetChanged();
}

@Override
public int getCount() {
    if (mDataItems == null || mBindDictionary == null) return 0;

    return mDataItems.size();
}

@Override
public T getItem(int position) {
    return mDataItems.get(position);
}

@Override
public boolean hasStableIds() {
    if(idExtractor == null) return super.hasStableIds();
    else return true;
}

@Override
public long getItemId(int position) {
    if(idExtractor == null) return position;
    else return idExtractor.getLongValue(getItem(position), position);
}

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    View v = convertView;
    final GenericViewHolder holder;
    if (null == v) {
        LayoutInflater vi =
                (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(mLayoutResource, null);
        holder = new GenericViewHolder();
        holder.root = v;

        holder.playPause=(ImageView)v.findViewById(R.id.playPause);
        holder.playPause.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {

                        if (paused) {
                            holder.playPause.setImageResource(R.drawable.ic_pause);
                            paused=false;
                        }
                        else {
                            paused = true;
                            holder.playPause.setImageResource(R.drawable.ic_play);
                        }

            }});

        FunDapterUtils.initViews(v, holder, mBindDictionary);

        v.setTag(holder);

    } else {
        holder = (GenericViewHolder) v.getTag();
    }

    final T item = getItem(position);
    showData(item, holder, position);

    return v;
}

private void showData(T item, GenericViewHolder holder, int position) {

    if (oddColorRes > 0 && evenColorRes > 0) {
        if (position % 2 == 0) {
            holder.root.setBackgroundColor(mContext.getResources().getColor(evenColorRes));
        } else {
            holder.root.setBackgroundColor(mContext.getResources().getColor(oddColorRes));
        }
    }

    FunDapterUtils.showData(item, holder, position, mBindDictionary);
}

public FunDapter<T> setAlternatingBackground(int oddColorRes, int evenColorRes) {

    if (oddColorRes <= 0 || evenColorRes <= 0) {
        throw new IllegalArgumentException("Color parameters are illegal");
    }

    this.oddColorRes = oddColorRes;
    this.evenColorRes = evenColorRes;

    return this;
}

public void setIdExtractor(LongExtractor<T> idExtractor) {
    this.idExtractor = idExtractor;
}

@Override
public Filter getFilter() {
    return mFilter;
}

public void initFilter(FunDapterFilter<T> filter) {

    if (filter == null)
        throw new IllegalArgumentException("Cannot pass a null filter to FunDapter");

    this.funDapterFilter = filter;

    mFilter = new Filter() {

        @Override
        protected void publishResults(CharSequence constraint, FilterResults results) {

            List<T> list = (List<T>) results.values;

            if (results.count == 0) {
                resetData();
            } else {
                mDataItems = list;
            }

            notifyDataSetChanged();
        }

        @Override
        protected FilterResults performFiltering(CharSequence constraint) {

            FilterResults results = new FilterResults();
            if (constraint == null || constraint.length() == 0) {

                results.values = mOrigDataItems;
                results.count = mOrigDataItems.size();
            } else {

                List<T> filter =
                        funDapterFilter.filter(constraint.toString(), mOrigDataItems);

                results.count = filter.size();
                results.values = filter;

            }

            return results;
          }
      };
  }

  public void resetData() {
      mDataItems = mOrigDataItems;
     }

  }

It has been a week that I'm struggling with this, I would be so grateful if you help me with this.
Comment: check this http://stackoverflow.com/questions/20611123/listview-subobject-clickable-confilct if it helps
Comment: @rabhis answer will likely work (and may be the fastest way to solve your problem) but the answer in Raghunandan's link would be a better way to do it.
Answer:     holder.playPause=(ImageView)v.findViewById(R.id.playPause);
    holder.playPause.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {

                    if (paused) {
                        holder.playPause.setImageResource(R.drawable.ic_pause);
                        paused=false;
                    }
                    else {
                        paused = true;
                        holder.playPause.setImageResource(R.drawable.ic_play);
                    }

        }});

This block must appear in both if and else condition. Now the listeners are correctly attached only when view is created and code fails to attach the listeners when view is reused.
    if (v==null) {
        //that code
    } else {
        //that code
    }


laravel 5.4: Undefined property: Illuminate\Validation\Validator::$errors

Question: I have here a code in email validation wherein users register and upon registering he would accept a registration confirmation email. I'm using laravel make auth with modification to include sending tokens to valid email. Upon successful registering a confirmation message should appear but it wouldn't.
here's the code:
RegisterController
<?php

namespace App\Http\Controllers\Auth;

use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use Mail;
use Illuminate\HTTP\Request;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'password' => 'required|string|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return \App\User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
    protected function register(Request $request){
        $input = $request->all();
        $validator = $this->validator($input);

        if ($validator->passes()){
            $data = $this->create($input)->toArray();
            $data['token'] = str_random(25);

            $user= User::find($data['id']);
            $user->token=$data['token'];
            $user->save();

            Mail::send('mail.confirmation', $data, function($message) use($data){
                $message->to($data['email']);
                $message->subject('Registration Confirmation');

            });
            return redirect(route('login'))->with('status','confirmation email has been sent');
        }
        return redirect(route('login'))->with('status', $validator->errors);
    }
    public function confirmation($token)
    {
        $user = User::where('token', $token)->first();
        if(!is_null($user)){
            $user->confirmed=1;
            $user->token='';
            $user->save();
            return redirect(route('login'))->with('status','complete actibeyt');
        }
        return redirect(route('login'))->with('status','something is wrong');
    }
}

Answer: There isn't a property on the Validator called errors, however, there is a method.
Simple change:
return redirect(route('login'))->with('status', $validator->errors());

Answer: First one replace your return function with this:-
return redirect()->route('login')->with('status','confirmation email has been sent');

Answer: It looks like you've already solved the immediate problem, but I created a web service to solve this particular pain point with no server-side code at all:  clicktoverify.net. It just takes a single JS include and a few lines of code:
<form method="POST" action="whatever" id="my-form">
  <input type="email" name="email" />
  <input type="submit" name="sign up!" />
</form>


Angular controller in separated files does not work

Question: Why a controller does not work in separated files?
Application structure:
See app structure here
store.html:
<!DOCTYPE html>

{{user.firstname}}

app.js:
var app = angular.module("myApp",[]);
   app.controller("myContoller",["$scope",function ($scope) {
}]);

userController.js
app.controller("userController",["$scope",function ($scope) {
    $scope.hello= "john doe";
    $scope.user = {
        id:1,
        firstname:"Wojciech"
    }
}]);

Comment: if you haven't solved the problem yet, check out my answer (updated ). that should work now
Answer: Edit: Based on the comment of @Claies, I updated the answer for future reference.

You have to change the order of your script tags in the store.html like this:

store.html
<!DOCTYPE html>

{{user.firstname}}

And you need to declare app in userController.js as well, the same way you did in app.js.

userController.js
var app = angular.module("myApp"); //locate the module first
app.controller("userController",["$scope",function ($scope) {
        $scope.hello= "john doe";
        $scope.user = {
            id:1,
            firstname:"Wojciech"
        }
    }]);

Comment: @user7437694, Are you getting any errors in console? If it doesn't work there must be some traces somewhere. Please take a look at the dev tools in your web browser and share it with us.
Comment: Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.5.7/$injector/nomod?p0=myApp
    at angular.js:38
    at angular.js:2075
    at b (angular.js:1999)
    at Object.module (angular.js:2073)
    at userController.js:1
(anonymous) @ angular.js:38
(anonymous) @ angular.js:2075
b @ angular.js:1999
(anonymous) @ angular.js:2073
(anonymous) @ userController.js:1
Comment: Error: [ng:areq] http://errors.angularjs.org/1.5.7/ng/areq?p0=userController&p1=not%20a%20function%2C%20got%20undefined
Comment: Well, this can many things. I think, maybe there is a problem with the inclusion/declaration of either your modules/files in your project or some resource (as ngRoute, for instance). (See some questions about this on http://stackoverflow.com/questions/18287482/angularjs-1-2-injectormodulerr, http://stackoverflow.com/questions/21045416/angular-js-uncaught-error-injectormodulerr, http://stackoverflow.com/questions/34144661/angular-uncaught-error-injectornomod-module-controllers-is-not-available, http://stackoverflow.com/questions/21673404/error-ngareq-from-angular-controller).
Comment: @user7437694, also make sure you have all required resources loaded into your project. How are you including the resources (controllers, services, etc) in your project?
Comment: @user7437694 based on the code in the original question, this answer won't work, because you are declaring your `userController.js` script **before** your `app.js` script, so the `userController` can't find `app` since it isn't declared yet.  This answer would be correct, if the order of your scripts were changed as well.
Comment: @Claies, thanks. You're completely right!. I updated the answer for future reference.
Answer: source app.js before userController.js
In case you want to define controller in separate file, you can do so. You just need to get your app reference.
userController.js
/*
   angular.module call without "[]" returns the app object
   rather than creating a new app.
*/
var app = angular.module("app");
app.controller("ControllerName", ["$scope", function($scope){
    // controller code here.
}]

Answer: app.js should be refered in the html first before the controllers.
Instead of:

Do this:


Swipe up and Swipe down in javascript or jquery

Question: I am trying to do swipe up and swipe down like in the uploaded image using Javascript or Jquery for mobile
.
$('#swipe').on('anyevent', function(e) {
   console.log(e);
   // take x,y detail from the e
   // assign height based on the x, y position
});

I use this code to try the swipe. But that event itself is not triggered. How to achieve this and what event I need to use for this?
Answer: for swipe down
$('#mydiv').on('swipedown',function(){alert("swipe down triggered..");} );
for swipe up
$('#mydiv').on('swipeup',function(){alert("swipe up triggered..");} );
Click on the fiddle to see the whole code for the above two functions written.
Fiddle
Comment: is this JQuery mobile?
Comment: Did you check the fiddle?
Comment: Jquery Mobile doesn't support swipeup / swipedown. Instead it support horizontal or vertical swipe .Try this plugin: https://github.com/blackdynamo/jquerymobile-swipeupdown
Comment: How to use that above plugin?
Comment: Could you please share me the jsfiddle link
Comment: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/216348/discussion-between-asfandyar24-and-gmv).
Comment: JavaScript does not have an `swipeup` or `swipedown` event


Hot water tank only has warm water after bath

Question: We have a new 60 Gallon (US) gas hot water tank. After running a bath, water coming out of it is warm instead of hot. Is this normal? Precisely, here is the experiment I performed:

Temperature outside hovering above freezing (not crazy cold for these parts)
Tank satisfied
Filled bath (hot and cold) to ~120L to get 109F bathing temperature
Drained bath (~2 minutes).
Filled again with just hot to ~100L and got 100F
Checked temperature of hot water running out of faucet now: 88F

Is this normal? Is there a better experiment to determine what is normal/ok?
Note: When tank is satisfied the water that first comes out of it is very hot (close to scalding).
Addendum: It's UG60-50MF1-N2U at https://giantinc.com/wp-content/uploads/docs/GI-FT-UG60ATM-En.pdf
Thank you!
Comment: The outdoor temperature isn't particularly pertinent unless the cold water source is a tank sitting outside at ambient.  What is the cold water temperature entering the tank?  What is the thermostat setting?  What is the thermal output of the heater (BTUh or kW)?
Comment: **60 gal at 50,000 BTU cannot fill a bath tub *twice*.** Fill it once, then go time how long the burner is lit afterwards. That's how long you have to wait for the next bath. Which is probably less then the length of a bath. - "If you have a gas water heater, plan to wait 45 minutes for the water to get hot after the heater has drained its capacity. If you have an electric water heater, double that to 1.5 hours." – [waterheaterhub.com](https://www.waterheaterhub.com/how-long-water-heater-heat-up/)
Comment: What is the tank temp set at? If it is only set to 120 or 130 you used more than 1/2 the volume it refilled with cold water lowering the temp in the tank so sure this sounds correct with the information provided.
Comment: It is 50,000 BTU. I will measure the temperature of the water since the tank doesn't have an exact thermostat, but as I say, it's quite hot; almost scalding.
Comment: Does the label on the water heater indicate the _recovery rate_? That's the specification you are looking for. Suggested reading: [Residential Sizing](https://www.hotwater.com/lit/sizing/aossg88150.pdf).
Answer: This is normal.
Your tank has 60 litres. You took 120 litres of cold+hot. So, let's assume you took 60 litres of hot and 60 litres of cold water. What went in? Cold water. Heating up this cold water will take time.
The only thing anormal, to me is :

We have a new 60L gas hot water tank.

That's small. Where do you live ? I live in a place with both abundant hydro electricity and abundant water, so a water heater would be more like 60 gallons.
After edits:
Is the dip tube installed correctly ?
https://www.discovercabrillo.com/what-is-a-dip-tube-in-a-hot-water-heater/#:~:text=A%20dip%20tube%20is%20a,the%20bottom%20near%20the%20burners.
Comment: Woah! I just edited my post. I meant 60 Gallons! Sorry about that!
Comment: If the dip tube was broken you would get luke-warm water *very* soon after turning on the hot water because cold water entering the tank would be immediately mixed with all outgoing flow from the tank. This does not sound like your issue. Your issue is not an issue, it is normal.
Comment: That changes things. Is the dip tube correctly installed ?
Comment: I had suspected that the dip tube is broken and called the plumber who installed it to say so. They told me (without checking the unit) that me that what I was observing was totally normal and that it's working well. I have my doubts, hence my question. :)
Comment: If the dip tube was broken or not installed the first bath would have run hot for a while then cooled off without the tank set point any guess is just that. What's the recovery time?
Comment: @EdBeal well, that's what happens, if I'm understanding you. By the time we get to the end of running the bath, there's only warm water coming out, no longer hot. Are you asking me to measure the recovery time, or what the spec says?
Comment: I was asking for the set point. But the recovery time would be helpful the first bath full bath hot and cold 120L of water 109 degrees, now you have added <120L of cold water to a tank of water what do you think is going to happen? It will be colder but the actual temp will be based on the set point and the groundwater temp since you just mixed ?more than 50% of the tank volume with let's say 50 deg F water we would to know what the set point was to know the temp and do the calculation it's not rocket science and the formula is on line but 100 sounds like a good number to me.
Answer: You've taken 26.4 gallons (first, 100 liter bath) out of your heater, followed immediately by 31.7 gallons (second, 120 liter bath) for a total of 58.1 gallons out of the 60 gallon capacity.
How long does it take to fill the tub, drain it, then fill it again, 10 minutes? You now expect to find that the 60 gallon heater is still full of full hot water? It takes time to heat water, even with a gas water heater.
If you really need to take 2 baths back to back like that (you really don't, do you, this was just an experiment, wasn't it?) you'll need to also install an on-demand water heater right after your brand spankin' new 60 gallon heater. That's probably the only way you'll add 40°F to water that quickly. The good news is that if you can find a gas-fired one, you'll already have all the gas plumbing right there, so you can easily plumb in the second heater so it's ready for the next time you need to non-real-world-situation stress test your hot water system.
Comment: Except that those on-demand heaters do need a significant gas supply, so depending on gas piping, there may not be enough gas supply capacity at this location to feed both the normal water heater, as well as the on-demand.  So there might need to be additional capacity added, or even a meter change out to a higher WC pressure, then pressure reducers at each appliance.
Comment: Good point, @Milwrdfan. I was hand-wavy and somewhat sarcastic with that suggestion. My _main_ point is that you can't take 58 gallons out of a 60 gallon tank and still expect to get much in the way of _hot_ water.
Answer: As others pointed out - this seems to be nothing wrong with the tank, it's doing it's job as designed. A much cheaper solution than new on-demand tank heater would be to ask a plumber to install a mixing valve. You can then raise the temperature of the tank to let's say 140F and set the mixing valve to 120F giving you all the hot water you want.
Comment: This isn't a bad idea, but it still won't provide "all the hot water you want". A somewhat lower water flow due to the mixing valve will _slow_ the rate of water consumption, but it still won't guarantee "unlimited" supply. It will also cost more over time keeping 60 gallons at 140°F vs 120°F when the hotter temp isn't needed.
Comment: I agree. I exaggerated "all the hot water" part, and also agree on cost, however it would be pretty hard to calculate exactly when is the breakeven point in 140F in well insulated tank vs brand new on-demand. Interesting exercise though, if the OP wants to go through the calculation.


Can an implication and its converse both be false?

Question: Is the statement "Every implication or its converse must be true" correct, or is it possible to have both implication and converse be false?
If $A$ stands for "$x$ is a prime number" and $B$ stands for "$x$ is greater than $100$", then both $(A → B)$ and $(B → A)$ are false. Is this a counterexample to the quoted statement? How does this make sense with respect to the truth table of $(A → B) ∨ (B → A)$ showing that it is always true?
Comment: @CrSb0001 that's clearly false. The post is more than intelligible and asks a specific question.
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: Because "$x$ is a prime number" is not an absolute statement until you tell me what $x$ is.  Basically, your statement has a quantifier in it.
Comment: Note that your example is implicitly quantified, which changes how it would be analyzed in this context.

Either way, $(A \to B) \lor (B \to A)$ is a Classical tautology as you mention, and even Intuitionistic Logic can't have both an implication and its converse as false. However, an implication and its converse can both fail to be *true* in Intuitionistic Logic.

There are weaker logics where both an implication and its converse can be false.
Comment: Related: [Proving an implication by disproving its converse](https://math.stackexchange.com/a/4222929/21813)
Answer: Put $Px$ for $x$ is prime, and $Gx$ for $x > 100$.
Now distinguish

$\forall x(Px \to Gx) \lor \forall x(Gx \to Px)$

from

$\forall x((Px \to Gx) \lor (Gx \to Px))$

The first I think properly captures the thought that you say is false (for yes, the generalization $\forall x(Px \to Gx)$ is false, and likewise $\forall x(Gx \to Px)$ is false). But (1) is not a logical theorem.
On the other had (2) is a classical theorem, but is not obviously false, once distinguished from (1). Take any $n$ you like. Then either $Pn$ is false, in which case the supposition that $Pn$ is true leads to contradiction, and anything goes, so we get in particular $(Pn \to Gn)$. Or $Pn$ is true, in which case $(Gn \to Pn)$. So either way we get $((Pn \to Gn) \lor (Gn \to Pn))$. But $n$ was arbitrary so we can generalize.
Comment: I would say that it could be/is  misleading to use "converse" in a way that makes those two converses.
Comment: Is $\forall x(Px \to Gx),$ *strictly speaking*, not the converse of $\forall x(Gx \to Px)$? ([Many sites](https://storm.cis.fordham.edu/zhang/cs2100/slides/PredicateLogic.pdf) consider them the converse of each other.)


question on nilpotent group.

Question: Question- If $G$ is a finite group, $N$ a normal nilpotent subgroup of $G$ such that $G/[N,N]$ is nilpotent. Prove that $G$ is nilpotent.
How i did it in my exam today- (I know my solution had to be faulty because it didn't make any use of $N$ being normal and nilpotent)
Denote $[N,N]=N'$ i.e. commutator of $N$
I tried to prove that any maximal subgroup of $G$ is normal.
To see that, first note that $G/N'$ is nilpotent and let $K/N'$ is some maximal subgroup of $G/N'$ then $K$ is maximal in $G$ w.r.t containment of $N'$ and we know every subgroup is contained in some maximal subgroup of $G$ implies $K\subseteq P$ where $P$ is some maximal subgroup of $G$ but $N'\subseteq P$ also then, and $K$ is maximal w.r.t containment of $N'$ implies $K=P$. so every maximal subgroup of $G/N'$ gives a maximal subgroup of $G$.
Next using canonical homomorphism $\eta: G\to G/N'$ showed that any maximal subgroup of $G$ goes to a maximal subgroup of $G/N'$ and thus we now have a $1-1$ correspondence between maximal subgroups of $G$ and $G/N'$ and as  $G/N'$ is nilpotent each of its maximal subgroup is normal and thus each maximal subgroup of $G$ is also normal as there is also a 1-1 correspondence between normal subgroups of $G$ and $G/N'$.
Now tell me what did I do wrong or what did I miss. I didn't have time check my solution again in exam today. so now i was thinking on it.
what can i expect with this solution if it was a 10 marks question?
Comment: Note that the exam question is answered here: http://math.stackexchange.com/questions/113894
Answer: There is no 1-1 correspondence between the maximal subgroups of $G$ and $G/N'$. Now see Prove: If $N\lhd G$ and $N$ and $\frac{G}{N'}$ are nilpotent, then $G$ is nilpotent.
Comment: Same reference as Derek Holt gave
Comment: A slightly different argument for finite groups, also using the Frattini subgroup and Frattini argument, runs as follows. For this you have to know that if a group $G$ is nilpotent, then $G' \subseteq \Phi(G)$, and if $N \unlhd G$, then $\Phi(N) \subseteq \Phi(G)$. Now let $P \in Syl_p(G)$, then $PN'/N' \in Syl_p(G/N')$, so $PN' \unlhd G$, since $G/N'$ is nilpotent. But $P \in Syl_p(PN')$, so the Frattini argument yields $G=N_G(P)PN'=N_G(P)N'$. But since $N$ is nilpotent we have $N' \subseteq \Phi(N) \subseteq \Phi(G)$, and it follows that in fact $G=N_G(P)$, that is $P$ is normal in $G$.

question on nilpotent group.


Does Mona's Transmutation ability let you earn duplicates of Unique cards?

Question: In Shovel Knight: King of Cards, there are one-of-a-kind Unique cards that can normally only be earned by beating their owner in Joustus and picking the card as a prize. However, I noticed that Mona's Transmutation ability could copy unique cards, letting her play a second copy of a unique card you own.
If you beat Mona after she copies a card with Transmutation, what happens if you select the copied card as a prize? Does this let you earn multiple copies of Unique cards?
Answer: No. Transmuted cards are returned to their original form once a match is completed. This prevents you from getting duplicates of unique cards.


Connecting portable generator with L6-20P to house with L14-30R

Question: I have been spinning my wheels reading on this trying to figure out what to do.
I have a 5000W Portal generator that is NG bonded
The generator has a 250V output with a L6-20R connector.
I have a Square D generator interlock installed by an licensed electrician
The power inlet on my house is an L14-30R.
I bought a generator cable but both ends are L14-30 (4 prong).
I bought a L6-20P connector and plan on installing this on Plug side of the generator cable (i'd cut off the 4 prong).
The question is how I wire the new L6-20P on the cable:
The L14-30R has X,Y,Neutral and a Ground.
The L6-20P has X,Y and G.
When I put the L6-20P on the end of the generator cable, should I hook G of L6-20P up to G of L14-30R? This would give me two NG points in the system since the generator is NG bound.
The other option is to not connect the G to anything and just hook up X/Y?
Thanks for any help,
- Mike
Comment: Ok, so you're **really, really gonna need** that neutral, otherwise you will have an "open neutral" situation and your appliances will blow up.   The 6-20 lacks a neutral.   Now you need to consult with the generator manufacturer and find out whether they support what you need: **split-phase power**, and how to cable that if they do.
Comment: Look at the seller, "sold by and ships from ", that is the **Amazon Marketplace**, which is akin to eBay or AliExpress.  There, *somebody* will sell you *anything*. It's the wild west. I'm not saying it can't be done, I'm saying only the manufacturer can say whether or how they support this.  If it's a no-name generator, you might have to take it apart and see how it's wired, and add that to your question.
Comment: Apparently they make several models which meet that description, and the one I spot-checked had an L14-20 and stated vey plainly that it supported 120/240 right on page 2 of the manual.   If your manual says 120/240, then this can be done. http://www.powermate.com/productmanuals.php?cat_id=3 Otherwise we'd need to see how the receptacles (120 and 240) are wired on the back.
Comment: Its sounds like you're fine then, connect those 2 neutrals (both) to both the neutral on the NEMA 14-20 and the neutral on the NEMA 5, then tie generator chassis to all the ground pins, then finally tie neutral to ground somewhere Don't let any neutrals be disconnected or you'll have lost neutral problems, your two 120V sides will total 240 but they won't be 120 each!
Comment: Yes, since it's already so on the 120V plug.
Comment: Do you have any 110V or 120V loads in your house, or are all the loads 240V?
Comment: just plan on running only 110v when generator is connected. I'd flip air handlers, hvac off at breaker before flipping to generator
Comment: I guess how does this exist then? i was just trying to basically wire what this thing is: https://www.amazon.com/NEMA-L6-30P-L15-30R-Plug-Adapter/dp/B00DM7F0IA
Comment: What is the make and model of the generator?
Comment: Yea I know what you mean about that. I did call support but the person was not sure and directed me to a reseller of who I have not been able to be in contact with. It's a Coleman/Powermate powerbase 5000W generator. Non-GFCI (just a circuit breakers) with 2 standard 110V receptacles and 1 L6-20R (240V).
Comment: Thanks @Harper, definitely appreciate guidance. I was just out there disassembling because I think the best thing to do might be to replace the L6-20 with a 14-20 introducing a neutral. The main output wires of the generator has 2 black (hot) and two (neutrals). One black goes to one breaker, the other to a 2nd breaker. The blacks then go to to L6-20. The whites feed to neutral on standard 110v Rs. Ground is jumpered on the 110 from ground to neutral. I'll remove the jumpers as well making it a floating neutral
Comment: Ah you think i should keep the neutral bonded to ground?
Answer: Forgot to come back here since there was no answer posted. Appreciate @Harper's help, I wish they would have put an answer so I could accept!
So I ended up buying an L14-30R and replacing the L6-20R in the generator. I wired neutral over to the 240V and wired up the two hots to it. I wired ground over to one of the 120V that had ground on it but I REMOVED the jumper from ground to neutral.
Since I only have a interlock and a inlet plug for the house, neutral is NOT switched over to the generator. If you have a proper transfer switch neutral MIGHT be switched to the generator. Since neutral was not switched, I'm using the house's NG bond and therefore I want neutral to float in the generator. If you do this, you should label the generator as Neutral floating in case you sell it or need reminding.
Everything worked well when I was running on generator power for 3 or 4 days after an ice storm.


Zfdatagrid 0.8 adding elements to CRUD-forms

Question: I'm using ZendFramework 1.11 and Zfdatagrid 0.8.
I've created a grid and a CRUD-form using my own db-model as source. Then I added some extra elements to the CRUD-form like this:
$element = new Zend_Form_Element('element', array('label'=>'new element:'));
$grid->getForm(1)->addElement($element);
The new element is added to the form properly, but whereas all other form elements are within a table, the added element is placed as a list element above the actual form. Instead of this, i would like to have the added element as a part of the table to achieve a proper look of the form. Has anybody faced this issue before or an idea of how to do it? Any help is appreciated!
Thanks in advance!
Answer: <code> $elementDecorators = array(
            'ViewHelper',
            'Errors',
            array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')),
            array('Label', array('tag' => 'td', 'class' => 'form_label')),
            array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
        );

$this->_grid->getForm(1)->addElement('select', 'group', array(
            'required' => true,
            'value' => 'rtrt',
            'label' => 'Group',
            'multiOptions' => $list_contactgroup,
            'order' => 5, 'decorators' => $elementDecorators
        ));
</code>
Comment: You should explain what you are doing and why this code will help, rather than just posting undocumented code.
Comment: Thank you for your submission, you where absolutely right! I have already tried to set the decorators in the past but I failed at some point... now i defined the decorators your way and set the decorators for the desired element like this: $element->setDecorators($elementDecorators); I dont know if this is a good solution but it is very simple and works for me at least ;) Thx again for your help!


Can I sacrifice the old and weak, or is a graveyard necessary in Black and White?

Question: In Black and White, I've always heard that graveyards are necessary so villagers don't waste too much time mourning the dead. Advice I've newly read suggests, however, that building a graveyard is a waste of time and the old, the dead, even children can be sacrificed with great benefit.
I've always thought that it hurt my society to sacrifice villagers, and settled for giving food instead. If I consistently sacrifice the weak and dead, however, can I save resources and do without a graveyard as well? Or, will my villagers still notice and mourn?
Answer: Villagers mourn only when there are skeletal remains left. Since sacrificing old villagers won't leave any they won't mourn, but it makes you more evil.
Comment: so does picking up the remains, although I think it's slightly less evil...


Access SQL Query to display the most recent date only for duplicate records

Question: Below is my current MS Access SQL that displays all records.  However, If there is a duplicate account record, it should only display the record with the latest date ComputationPeriodStartingDate
Dataset example.  All non duplicates should be returned, Account 1005 is the only duplicate of which only the one dated 12/1/2021 should be included in return

Account
ComputationPeriodStartingDate
LastName
Categories

10001
12/1/2021
Kent
Active

10005
12/1/2021
Nashton
Active

10005
6/1/2021
Nashton
Active

10011
1/1/2022
Steele
Active

10015
12/1/2021
Rich
Active

I dont know how to get my current SQL to filter properly.
SELECT [TDS LOANS].Account, [TDS Escrow Projections].ComputationPeriodStartingDate, [TDS LOANS].LastName, [TDS LOANS].Categories
FROM [TDS Escrow Projections] INNER JOIN [TDS LOANS] ON [TDS Escrow Projections].LoanRecID = [TDS LOANS].RecID
WHERE ((([TDS LOANS].PrinBal)<>0))
ORDER BY [TDS LOANS].Account, [TDS Escrow Projections].ComputationPeriodStartingDate DESC;

Expected Result

Account
ComputationPeriodStartingDate
LastName
Categories

10001
12/1/2021
Kent
Active

10005
12/1/2021
Nashton
Active

10011
1/1/2022
Steele
Active

10015
12/1/2021
Rich
Active
Answer: Try using sub-query:
SELECT a.Account, a.ComputationPeriodStartingDate, a.LastName, a.Categories
    FROM
      (
SELECT [TDS LOANS].Account, [TDS Escrow Projections].ComputationPeriodStartingDate, [TDS LOANS].LastName, [TDS LOANS].Categories
    FROM [TDS Escrow Projections] INNER JOIN [TDS LOANS] ON [TDS Escrow Projections].LoanRecID = [TDS LOANS].RecID
    WHERE ((([TDS LOANS].PrinBal)<>0))
    ORDER BY [TDS LOANS].Account, [TDS Escrow Projections].ComputationPeriodStartingDate DESC
)
    as a
        INNER JOIN
        (
SELECT Account, MAX(ComputationPeriodStartingDate) as max_date
        FROM
    (SELECT [TDS LOANS].Account, [TDS Escrow Projections].ComputationPeriodStartingDate, [TDS LOANS].LastName, [TDS LOANS].Categories
    FROM [TDS Escrow Projections] INNER JOIN [TDS LOANS] ON [TDS Escrow Projections].LoanRecID = [TDS LOANS].RecID
    WHERE ((([TDS LOANS].PrinBal)<>0))
    ORDER BY [TDS LOANS].Account, [TDS Escrow Projections].ComputationPeriodStartingDate DESC
)
        GROUP BY Account) as b
        ON a.Account=b.Account AND a.ComputationPeriodStartingDate = b.max_date

The sub-query will return max of ComputationPeriodStartingDate for each Account. Then we join it with the table on Account and max_date.
Note: Table name was not mentioned by you. Hence update the table name accordingly.
Comment: I did provide my query with table names.  This is the part I am having trouble comprehending in any samples I reviewed such as the one you are providing.
Comment: This would be my sub-query SELECT Max([TDS Escrow Projections].ComputationPeriodStartingDate) AS MaxOfComputationPeriodStartingDate, [TDS Escrow Projections].LoanRecID
FROM [TDS Escrow Projections]
GROUP BY [TDS Escrow Projections].LoanRecID;
Comment: I have just updated the query. I just have replaced TABLE with your entire query. Let me know if this works.
Comment: Thank you so much!  It returns exactly what I need.  It will take me some time to comprehend it, but I am going to try!
Comment: I can help you with the logic of my query: Firstly, I am using your query as a table. Next, I am calculating max(ComputationPeriodStartingDate) for each Account in the sub-query. Then joining the table with the table returned by sub-query on Account and max(date). Query may look confusing since I am using your query as table.


Is there a limit to how many people you can block on Steam?

Question: Steam limits the number of friends you can have, but I am uncertain if there is a limit on how many people you can block.
I tried to google it, but information I found was conflicting. Some said it was infinite, others said it was 500, again others said it depended on the Steam Level. However, none of those were from official sources and merely sounded like best guesses.
So is there a limit on how many people you can block on Steam?
Comment: I am not entirely certain but I believe Steam running on a 64-bit system would allow for 9,223,372,036,854,775,807 blocked users.
Answer: An official response from Steam Support:
Comment: To support Lemon's answer, they answered me too today. Here is a screenshot saying "There is no limit to the number of users you can have blocked at the same time." https://imgur.com/a/tLlTR
Answer: There is no limit to how many you can block. I have blocked over 500 people.
Comment: Dude, chill with those run-ons.
Comment: Same question as the last person who said it's infinite: How do you know? Is there any reliable source for this claim?
Comment: "or how many friends you can get" I think that one is limited by your Steam level. I forget what the base level is, but you get 5 more for ever level. Unless you are talking about (unanswered) friend requests.


Generating the whole sigma algebra with two independent sigma algebras

Question: Let $(\Omega,\mathcal A,\mathsf P)$ be a probability space. Let $\mathcal B\subset\Omega$ be a sub-$\sigma$-algebra of $\mathcal A$. Does there always exist a sub-$\sigma$-algebra $\mathcal C$ of $\mathcal A$ such that $\mathcal B$ is independent of $\mathcal C$ and such that $\sigma(\mathcal B\cup\mathcal C)=\mathcal A$ ?
This question is motivated by the Definition of causal graphs, where a random variable $X$ is said to "cause" another random variable $Y$ if there exists a measurable function $f$ and a random variable $E$ independent of $X$ such that $Y = f(X, E)$. I was wondering if any two random variables always "cause" each other.
Comment: A weaker converse of the original question holds: Assuming $X$ and $Y$ are real-valued, there exist random variables $X',Y',E$ on another probability space such that (1) $X'$ and $E$ are independent, (2) $Y'=f(X',E)$ for some Borel-measurable function $f$, and (3) $(X',Y')$ has the same distribution as $(X,Y)$.
Comment: You may refer to Proposition 4.1 of *Elements of Causal Inference* by Peters *et al.*, but the proof is actually very simple if we ignore some technicality issue about measurability: Let $X' \perp\hspace{-0.5em}\perp E$ be such that $X'\sim X$ and $E\sim\operatorname{Uniform}(0,1)$. Then consider the conditional CDF $F_{Y\mid X=x}(y)=\mathbf{P}(Y\leq y\mid X=x)$ and then define $f(x, e)=F_{Y\mid X=x}^{-1}(e)$. Using [inversion sampling](https://en.wikipedia.org/wiki/Inverse_transform_sampling), it is easy to check that $Y':=f(X',E)$ satisfies $Y'\sim Y$.
Comment: @SangchulLee That is highly interesting: Do you have a reference for this?
Comment: In other words, we first (1) simulate the distribution of $X$, and then (2) simulate the conditional distributions $(Y\mid X=x)$ for any $x$ using the same "noise" $E\sim\operatorname{Uniform}(0,1)$. Then their composition has the distribution identical to that of $Y$.
Comment: @SangchulLee that is very helpful, thanks!
Answer: The answer is no: As a simple counter-example, consider
$$(\Omega,\mathcal A,\mathsf P)=(\{1,2,3\}, \mathfrak P(\{1,2,3\}), \text{Uniform}(\{1,2,3\})),$$ where $\mathfrak P(\{1,2,3\})$ denotes the power set of $\{1,2,3\}$ and $ \text{Uniform}(\{1,2,3\})$ denotes the uniform measure over $\{1,2,3\}$.
Choose now $\mathcal B=\{\emptyset,\{1\},\{2,3\},\Omega\}$. Then any sigma-algebra $\mathcal C$ such that $\sigma(\mathcal B\cup\mathcal C)=\mathcal A$ must contain either $\{2\}$ or $\{1,2\}$ so that $\{2\}\in\sigma(\mathcal B\cup\mathcal C)$. But such a $\mathcal C$ cannot be independent of $\mathcal B$, since we then have either $$\mathsf P(\{1\}\cap\{2\})=0\neq \mathsf P(\{1\})\mathsf P(\{2\})$$ or $$\mathsf P(\{1\}\cap\{1,2\})=\frac 13\neq \frac 29 = \mathsf P(\{1\})\mathsf P(\{1,2\}).$$


How hard would it be to merge Unity & Gnome-Shell?

Question: I don't think that it's good for the Linux desktop to be too fragmented, forks should rejoin the main projects and thus make Linux a better experience.
So if at some point in the future the community / Canonical has to decide between Unity and Gnome-Shell how hard would it be to merge the two projects?
Answer: Consider that Unity and Gnome Shell (aka Gnome3) share almost the entire operating system stack. The part that is vastly different is the shell part, the visual elements. I'm afraid when it comes to the shells, they are impossible to consolidate.

Gnome Shell is based on JavaScript and the developers are strictly rejecting any code that isn't javascript.
Unity is based in Python, C and Vala, it used to use the same compositor as Gnome Shell, but moved to Compiz because it was too slow.

More likely there will be a feeding of ideas between projects. Each project will get some things right and some things wrong. The project with the better sense of design, humility to accept what users want and ultimately the team with better economics (more developers) will develop faster and better over time.
Answer: They certainly have plenty of differences both on a technical and functional level. They're also focussed on separate (though similar) creative directions and they're both very much in development and not final. It could easily be years before either settles with something that proves itself to work well.
At any point, ideas might traverse the void. This has clearly happened several times over already, nothing wrong with it and while it helps an on the interface-ideological-level, it does nothing to help developers unite behind a common programming language or compositor.
I think it'll probably end with one solution "winning" (through progress on helpful features) and being adopted by the other camp but then again, there are few types of developers more stoic than FOSS developers. This might even take something like Wayland (essentially a replacement for X with its own compositing layer) coming along to mix things up.
I wouldn't put a bet on either breaking far away from the other. At least, not until the underlying tech changes.
Answer: Seems unlikely.
Most of unity is based upon compiz, while GS has built itself a new toolkit (based upon Mx) and stack, along with a new WM.
GS could more easily emulate Unity than the reverse, and I wouldn't  be surprised to see skins that did this, but they probably aren't going to integrate.
Fundamentally this is an issue of Window Managers. Gnome built its own WM (really a port of Metacity to Clutter with many improvements improvements) and GS is a plugin to Mutter. JS is used for pretty much all of the interface elements while C is used in the libraries (Mutter is in C). JS is integral to the experience (not a bad idea considering how much effort is being put into JS research so things should rapidly improve, not that they NEED to).
Unity took an existing WM and extended it and built an interface around it (very similar to GS) but used existing toolkits hence it is more difficult to create gl contexts in Unity unless you use Qt (I assume they will eventually move to it completely). Unity is a good choice for Canonical since they want to create a unique environment since it reuses so much but by not following upstream closely they risk always being behind the tech curve in gnome (again, another reason they will probably move to Qt).
So, if you could convince Gnome or Canonical to give up one of their WMs you might be able to get a merge, but what's the point? Let them create 2 different desktops and lets see which is better.


Ruby - Sinatra: Asynchronously calling method with form input as parameter

Question: I am currently trying to build a little widget that will retrieve a list of artists based on a username.
The Ruby method requires a username parameter after which an API call is made that retrieves the actual array of strings.
The web page has an input field where the user can fill out his/her username. My goal is to immediately call the ruby method and display the list of artists. My problem is being able to use the actual form input as the parameter. I figured this would be relatively easy with params[:user], in the same way it's done in a Sinatra post method. Alas, turns out it isn't.
I tried both a JS approach and directly calling the method after :onkeyup.
Javascript:
userChanged = function() {
    var user = document.getElementById("username");
    if (user.value.length != 0){
    artists = #{RFCore::get_artists(:name => params[:user]).to_json};
    art_list.innerHTML = artists
    };
};

:onkeyup
:onkeyup => "art_list.innerHTML = #{RFCore::get_artists(:name => params[:user])[0]}"

I have substituted params[:user] with all variations I could think of such as "#{user}" and user.
The errors returned are undefined method []' for params[:user] and undefined local variable or methoduser' for "#{user}" and user.
Perhaps there is an easy solution to this; but the feeling is starting to creep up on me my approach is wrong to begin with. I am open to any other way of achieving this.
Answer: As far as I understood, you are generating that JavaScript dynamically. So when your Ruby code produces it, it evaluates that RFCore::get_artists expression when you are generating the JavaScript code, not when the user interacts with the web page.
If that's the case, I recommend:

Use jQuery. It makes your life much easier.
When there's some user interaction (e.g., a key press), use Ajax to communicate with your server to get back a list of artists.

Here is a small Sinatra application that demonstrates this approach:
require 'sinatra'

get '/' do
  <<html

User: <input id="username" type="text">
<button onclick="userChanged();">Look up</button>

html
end

get '/get-artists' do
  "Generate here list for user #{params[:username]}"
end

Please notice that the above code is just an example. The HTML generated is all wrong, no template language is being used, etc.
Comment: That really should have worked; jQuery is particularly good at finding elements. With jQuery, when you say `$('#username')`, you mean that you want to find the element whose id is `username`. If the element  you're trying to find has only a `name` attribute, it won't work.
Comment: Thanks for the response. Works perfectly, aside from:

     {username: $('#username').val()}

I had to edit that to include a document.getElementById. For some reason it wasn't receiving the username properly... Maybe something to do with different name and id tags?


Blank Allure report

Question: I'm using Allure report tool with Maven+TestNG, but get an empty template. Can't understand what's wrong. Could someone explain why is this happened?

There is my pom file:
<code>   <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>SeleniumTest</groupId>
    <artifactId>SeleniumTest</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
    <aspectj.version>1.7.4</aspectj.version>
    <allure.version>1.5.4</allure.version>
</properties>

<dependencies>
<dependency>
    <groupId>ru.yandex.qatools.allure</groupId>
    <artifactId>allure-testng-adaptor</artifactId>
    <version>${allure.version}</version>
</dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-chrome-driver</artifactId>
        <version>3.5.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-maven</artifactId>
        <version>2.8</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-testng</artifactId>
        <version>2.0-BETA14</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.21</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.14</version>
        <configuration>
            <testFailureIgnore>false</testFailureIgnore>
            <argLine>
                -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
            </argLine>
            <!--only for 1.3.* TestNG adapters. Since 1.4.0.RC4, the listener adds via ServiceLoader-->
            <properties>
                <property>
                    <name>listener</name>
                    <value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
                </property>
            </properties>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
        </dependencies>
    </plugin>
</plugins>
</build>
        </project>
</code>
I do clean test site and after that io.qameta.allure:allure-maven:serve.
There are console output:
first command results

second command result
Answer: Seems like a misconfiguration. You've mixed up 2 different versions of Allure, including adaptors. Check the official Allure docs.

Blank Allure report


Python Pandas replace NaN with data from another row

Question: I have two dataframes. Dataframe A contains course information, including the ISBN number for required textbooks:

Course Abbreviation
Course Number
Section Number
Course Name
Course Instructor
Course Seats
ISBN No

ACCT
205
101
Intro Financial Accounting

30
 9780357617977

ACCT
205
102
Intro Financial Accounting
Grant
30
 9780357617977

ACCT
205
901
Intro Financial Accounting
Grant
35
 9780357617977

Dataframe B contains book purchasing info and also includes the ISBN number:

Title
ISBN
Binding
Edition
US_List

7 HABITS OF HIGHLY EFFECTIVE TEENS: THE ULTIMATE TEENAGE SUCCESS GUIDE.
9.78148E+12
Paper

17.99 USD

7 HABITS OF HIGHLY EFFECTIVE TEENS: THE ULTIMATE TEENAGE SUCCESS GUIDE.
9.78148E+12
eBook

ADOBE AUDITION CC: CLASSROOM IN A BOOK: THE OFFICIAL TRAINING WORKBOOK FROM ADOBE.
9.78014E+12
Paper
2ND ED.
59.99 USD

I am able to merge the two dataframes so that the course info is available along with the book purchasing info. However, Dataframe B contains many different listings for the same book. I would like to bring the course info over to matching titles where the ISBN isn't the same. So in the example below, even though the ISBNs are different, the course info would appear for both versions of the title:

Course Abbreviation
Course Number
Section Number
Course Name
Course Instructor
Course Seats
ISBN No
Title

CTEC
107
825.0
Skills for IT Success
Lott
20.0
9781476764665
7 HABITS OF HIGHLY EFFECTIVE TEENS: THE ULTIMATE TEENAGE SUCCESS GUIDE.

NaN
NaN
NaN
NaN
NaN
NaN
NaN
7 HABITS OF HIGHLY EFFECTIVE TEENS: THE ULTIMATE TEENAGE SUCCESS GUIDE.

What would be the best way to do this? The rows that need course info filled in are not always in the same location in relation to the rows that do have course info, so I don't think ffill or bfill will work.
Answer: Sorting by ISBN No will push the nulls to the bottom, then you can groupby title and ffill the data.
df.sort_values(by='ISBN No').groupby('Title').ffill()


JBoss EAP 7.3 Error while trying to locate WSL

Question: I am trying to deploy a basic web service, my wsdl is located as shown in the following beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

        <import resource="classpath:META-INF/cxf/cxf.xml" />

        <jaxws:endpoint
          id="helloWorld"
          implementor="com.tsdevelopment.HelloWorldImpl"
      wsdlLocation="src/main/resources/wsdl/HelloWorld.wsdl"
          address="/HelloWorld" />

</beans>

When i deploy with mvn wildfly:deploy i get the following error:
Caused by: java.io.FileNotFoundException: C:\Users\codereadystudio\jboss-eap-7.3\bin\src\main\resources\wsdl\HelloWorld.wsdl (The system cannot find the path specified)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:211)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:153)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:108)
    at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
    at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:189)
    at firstname.lastname@example.com//org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:1009)
    at email@example.com//org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:144)
    at email@example.com//org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:832)
    at firstname.lastname@example.com//org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
    at email@example.com//org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
    at firstname.lastname@example.com//org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
    at firstname.lastname@example.com//org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
    at deployment.soap-cxf-wsdlfirst-jbosseap73-1.0-SNAPSHOT.war//com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)
    ... 56 more

Why is it searching for the WSDL in the jboss installation folder and not in the code?
Answer: It seems the reason that it was unable to find the WSDL was that while in pom.xml the wsdl paths were as following:
<wsdlOptions>
  <wsdlOption>
    <wsdl>
      src/main/resources/wsdl/HelloWorld.wsdl
    </wsdl>
    <wsdlLocation>wsdl/HelloWorld.wsdl</wsdlLocation>
  </wsdlOption>
</wsdlOptions>

The java class that the cxf cxf-codegen-plugin generated did not include the wsdlLocation parameter in the @WebService annotation. Also please note that the parameter path must contain only the folders under your build path. That said, while my pom.xml location was /src/main/resources/wsdl/HelloWorld.wsdl, my parameter was wsdl/HelloWorld.wsdl, because i had already included the /src/main/resources folder on the build path.


What is the development list for?

Question: When interacting with youth players there's an option to add them to the "development list". What does that do?
Answer: From the in-game manual:

The final list, the 'Development List', will likely feature a number of your most
  talented youngsters at the club. By placing them on this list, you will effectively be asking your Director of Football (or other member of staff responsible for this) to look to loan them out to suitable clubs to further their development.

You can use the staff screen (in full mode, not Classic) to assign responsibility for youth development to another member of staff (eg. Director of Football, Assistance Manager or Youth Coach). That member of staff will try to find loan opportunities for players that you place on the list.

What is the development list for?


Use main function in R

Question: I've been using R for 4 months now, and I really hope there is a way to use main function as in other languages (C++, Python...)
The main reason I want to do this is that all the variables I use in a R script are global variables that can potentially pollute the namespace of the functions I defined in the same script:
f <- function(x) {
  x + a
}
a <- 50
f(5)

For me, this is just a personal preference. I'm a sloppy programmer and I want to prevent myself from making silly mistakes.
I can surely define main <- function() {}, but I want to know if there is anything similar to this:
if __name__ == "__main__":
    main()

(In this Python script, if the function name is main, then run main() to call the main function.)
Comment: For those that don't know python, what does `if __name__ == "__main__":
    main()` do?
Comment: It sounds like the reliance on global variables is the problem. Might I suggest reconsidering this? Alternatives are setting global options, when appropriate, and passing values in function arguments.
Comment: @Alex: when I'm collaborating with others, I don't expect them to take the time to read every line of my code carefully and take precautions in their code. -- in other words, I can't count on everybody else to be less sloppy and I don't blame them because they shouldn't have to do this. I don't consider R to be a very object oriented programming language... For now, I can make sure I only use local variable and passed parameters in my function. I hope I could do better than this
Answer: So, it's not quite the same as __name__ == "__main__", but you might find the interactive function interesting here. Which returns TRUE if you are in an interactive mode.
So you can do something like this:
main <- function() {
    ....
}

if(!interactive()) {
    main()
}

This is a bit different though because it will always run if it's required from a script.
Comment: This will not work if I use source("..") from interactive mode.
Answer:
but is there anything similar to
if __name__ == "__main__":
    main()

in python?

There is indeed!
But you need to use the package 'box' instead of source/packages. Then, inside your module, you can write
if (is.null(box::name())) …

… which is equivalent to Python's if __name__ == '__main__'.
Or you can even use the klmr/sys module. Then you can write the following:
box::use(klmr/sys)

f = function(x) {
    x + a
}

sys$run({
    a = 50
    sys$print(f(5))
})

If you execute this script on the command line (via Rscript or R CMD BATCH), it will execute the main function specified by sys$run. Conversely, if you import this script as a module into another script, the main function won't be executed, but f will still be defined and exported.
Comment: @NoName More "not thought of" than "not intended". This is a clear deficiency in the built-in R mechanisms. 'box' merely fixes these deficiencies. It's worth noting that Hadley Wickham (of 'tidyverse' fame, and one of the R Foundation members) commented on the original release of the 'box' module system, saying that if we could design the R package mechanism all over again, this is (something like) what it should look like.
Answer: Answering your exact question (I'm not addressing whether it makes sense in the context of R. I'm only starting to dig deeper into R and finding it ill suited to write non-interactive programs so I'm blaming it on me). You can create a main function and pass to it the input arguments.  However, note that for this work you don't call it via R. It seems that you need to use Rscript instead.
main <-function (argv)
{
  if (length (argv) < 3)
    {
      cat ('usage error: requires at least 3 arguments\n',
           file=stderr ());
      return (1);
    }

  cat (sprintf ('This program was called with %d arguments\n',
                length (argv)));

  return (0);
}

if (identical (environment (), globalenv ()))
  quit (status=main (commandArgs (trailingOnly = TRUE)));

Comment: R may be a GNU project but it doesn't follow GNU code style. I'm calling out the formatting because Stack Overflow answers teach programming and it's generally a bad idea to teach nonstandard or questionable techniques unless there's a good reason.
Comment: The spacing in your code isn't clutter, but it *is* highly non-idiomatic. The virtually unanimous convention is to have two spaces around operators, no spaces between the function call and the opening parenthesis, and the opening brace on the same line as the previous statement, and the closing brace intended At the same level as the parent block. (For operator spacing, the GNU coding standards says the same). The GNU standards are also pretty much unused outside of GNU projects, and are generally seen as seriously whacky.
Comment: Elegant hack. However, it should be noted that the use of semicolons as statement delimiters is strongly discouraged in R, as is the spacing.
Comment: @KonradRudolph why is it discouraged? Does it behave weird? Or it just a matter of style?
Comment: Since it fulfils no purpose, it's syntactic [visual clutter](http://www.infovis-wiki.net/index.php?title=Visual_Clutter), i.e. it decreases the signal-to-noise ratio of code and therefore makes it slightly harder to read and more error-prone. It's discouraged for similar reasons that [chartjunk](https://en.wikipedia.org/wiki/Chartjunk) is.
Comment: @KonradRudolph I think that the spacing makes it less cluttered. For what is worth, I follow the GNU standards for style. That's just a matter of style. I get the point for semicolons, but their number is so small and they feel so common that they don't feel out of place.
Comment: @KonradRudolph [R is a GNU project](https://www.r-project.org/about.html). But anyway, all of that doesn't matter because it boils down to a matter of style. The question was about calling a specific function when called as a script, which I hope my answer does address.
Comment: The second `cat` call and `return(0)` are only called if `length(argv) >= 3`, hence I think your function might benefit from an `else`-statement to make it clearer what happens. I would not call that *visual clutter*; rather the contrary but it is, of course, just a stylistic preference.
Answer: Not sure what the point of your function is, but perhaps a solution is to use a default argument
f <- function(x, a = 45) {
  x + a
}
a <- 50
f(5)

Then if you need to change the a term, change it within the function rather than rely on the context in which it is called.
Answer: The simplest solution that I have found that will work even when running source("..") from the interactive terminal (unlike Leif Andersen's solution) is:
if (sys.nframe() == 0) {
    # ... do main stuff
}

sys.nframe() is equal to 0 when run from the interactive terminal or using Rscript.exe, in which case the main code will run. Otherwise when the code is sourced, sys.nframe() is equal to 4 (in my case, not sure how it works exactly) which will prevent the main code from running.
source
Answer: You can try the below... Place the below block in your R script as part of the global environment and it will invoke the main() method when the script is executed.
if(getOption("run.main", default=TRUE)) {
   main()
}

Hope this fits in with your stated requirement
if __name__ == "__main__":
    main()

Use main function in R


What do you call a heuristic evaluation?

Question: One of Nielsen's famous heuristics is "The system should speak the users' language, with words, phrases and concepts familiar to the user, rather than system-oriented terms".
With no disrespect to Mr Nielsen, of course, I can think of no less familiar a term with the people I work with than "heuristic."
I'm trying to introduce heuristic evaluations as a tool in our toolkit, but no one is going to have the faintest idea what I'm talking about without more explanation.
The only idea I keep coming back to is "Usability checklist".
Comment: So, what exactly is your question?
Comment: What do you call a heuristic evaluation when you're talking to an average human being?
Comment: What if you add a subtitle to the title. For example "Zip compression algorithm" (title) with "makes things smaller" (subtitle). Sure, it's redundant for someone who knows what the title means - they can ignore the subtitle. But this also affects how the user experiences the application. "Makes things smaller" sounds really inprofessional and personal. I wouldn't chose this wording for a finance application. Maybe I would choose this language for an for-everybode tool such as an easy-to-use image crop tool.
Answer: Teach them
Call it a heuristic review, since that's what the industry calls it. If you pick up and leave, they'll know what to ask the next guy or the consultant.
Technically, "heuristic" is rooted in finding things. In application, it's about how naturally a system can be learned and it's features discovered.
Or
Usability Review
Comment: I definitely explain what it is and what the industry calls it when I get the opportunity, but for that one-liner, that email subject line or elevator pitch to the uninitiated it would be nicer to have something more intuitive. And isn't that what we do all day anyway, find intuitive solutions?
Comment: I get it. I also think teaching is what we do much of our day (organizationally, at least). Answer updated.
Comment: Unfortunately, the folks who sell projects don't always understand what HE's are. By the time this UX guy gets to talk with the client, they've already got expectations. So I agree with you that we need a better name for HE's for the pitch and sales process.
Answer: We call them Expert UX Reviews. That helps clients understand that this is something done internally by our own UX people. (We had a client get upset becaue we didn't do them with users.)
Answer: Whats about:
"Inspection by experts based on ten golden usability rules" or in case of ISO 9241-110 seven usability rules


why a code inside tableview is repeating 4 times for each row?

Question: I have a variable called "conteggio" in my code, you can see it below... this variable have to increase of 1 at every row of my tableview... when i try to do this i receive a result like: 4,8,12,16,etc. multiples of 4 for each row... it seems that it repeat the code 4 times for each row.
And if i scroll back and forth my table those numbers become multiples.
HERE IS MY CODE:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID"];

if (cell == nil){
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"cellID"] autorelease];
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cellID"];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
}

NSString *alphabet = [fevIndice objectAtIndex:[indexPath section]];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] %@", alphabet];
NSArray *fv = [fev filteredArrayUsingPredicate:predicate];

conteggio++;

NSString *string = [NSString stringWithFormat:@"%d", conteggio];

cell.detailTextLabel.text = string;

if ([fv count]>0) {

    NSString *cellValue = [fv objectAtIndex:indexPath.row];

    cell.textLabel.text = cellValue;

    //indexPath.section; //[fv count] numero di elementi in una section;
    //cell.detailTextLabel.text = [fevMesi objectAtIndex:conteggio];
    //cell.imageView.image = [UIImage imageNamed:[fevIcona objectAtIndex:]];

}

cell.detailTextLabel.numberOfLines = 3;
cell.detailTextLabel.font = [UIFont systemFontOfSize:11.0];

return cell;

}
Answer: Use indexPath.row to get the row number that it's calling for. Like Jonathan said, the method could be called any number of times so don't try to keep track of the row yourself.
Answer: There's no contract concerning how many times that method will be called for each render. Just ask indexPath for its terminal index.
Answer: As the others have already mentioned, cellForRowAtIndexPath can get called multiple times for each row whenever the table view needs to display the cell (eg. when it scrolls into view).
Do you have multiple sections in your table view?
Is conteggio supposed to be the "absolute" unique row number regardless of the section?
If each section has the same number of rows, then it's a simple formula to calculate the absolute row number.
However, if every section has a differnt number of rows, you can calculate the absolute row number by doing something like the following:
conteggio = 0;
for (int s = 0; s < indexPath.section; s++)
{
    conteggio += [tableView numberOfRowsInSection:s];
}
conteggio += indexPath.row + 1;

If possible, it might be better for you to redesign fevMesi so the objects in there can be retrieved using row and section instead of having to calculate an absolute row number every time.
Comment: I have sections but i don't have the same number of rows for each section.. in fact this is the problem... your solution seems to be the right for me... i'm going to try it and then i let you know!
Comment: GREAT!!! It works fine. Thanks for the answer. With this i have finished my application, so i really thank you so much!!
Comment: I'm glad it worked.  Please click the check to mark this as the answer.  Thanks.


Endomorphism of Algebraic Closure

Question: This is a homework problem and I have some questions regarding it (not looking for solution):

Let $\tau$ be an endomorphism of a field $F$ that is algebraically closed.
  i.e. $\tau: F\rightarrow F$
  If $F$ algebraic over $\tau(F)$, show that $\tau$ is surjective.

Initially, I contemplated a direct approach of assuming $u\in F$, such that $u$ satisfies
$a_0+a_1u+\dots+a_{r-1}u^{r-1}+u^r=0$, where $a_i\in\tau(F)$.
But I was unable to show that $u\in\tau(F)$ in the end.
Is it possible to solve the problem this way?
My current proof:
Let $K$ be the fixed field under $\tau$.
Let $u_1\in F\setminus K$.
Since $F$ is algebraic over $\tau(F)$ and $K\subseteq\tau(F)$, we have $F$ algebraic over $K$.
Then there exists an irreducible polynomial $f$ of $u_1$ over $K$.
Let deg $f=n$. Since $F$ is algebraically closed, the roots are $\lbrace u_1,\dots,u_n\rbrace\in F$
Hence the splitting field of $f=K(u_1,\dots,u_n)$.
Under $\tau$, we have $\tau(f)=f$, whence the roots are still $\lbrace u_1,\dots,u_n\rbrace$.
This shows that $\tau(K(u_1,\dots,u_n))=K(u_1,\dots,u_n)$.
i.e the splitting field of $f$ is isomorphic under $\tau$.
This may happen only if $\tau(\lbrace u_1,\dots,u_n\rbrace)=\lbrace u_1,\dots,u_n\rbrace$, a bijection.
Hence $u_1\in\tau(K)$, i.e. $\tau$ is surjective.
Is the proof correct?
I am also wondering if the problem is intended to illustrate some properties of an algebraically closed field that I think is not captured by my approach.
My only observation is that since a field homomorphism is necessarily injective, this problem shows that any endomorphism of an algebraically closed field is an automorphism.
I appreciate if someone can give me a hint on how to solve the problem in a way that gives more insight to the structure of an algebraically closed field. (If this makes sense)
Answer: Since $a_i\in\tau(F)$, select $b_i\in F$ such that $\tau(b_i)=a_i$.
Let $v\in F=\bar F$ be a solution of $b_0+b_1v+\cdots+b_nv^n=0$.
Then $\tau(v)$ is a solution of $a_0+a_1X+\cdots+a_nX^n=0$
hewnce $X-\tau(v)$ is a linear factor of $a_0+a_1X+\cdots+a_nX^n$ in $\tau(F)[X]$. Thus if $a_0+a_1X+\cdots+a_nX^n$ was the minimal (hence irreducible) polynomial of $u$ we conclude ($n=1$ and) $u=\tau(v)$.
Comment: Thank you for the answer. Since $b_0+b_1x+\dots+b_nx^n$ has $n$ solutions, how do you know that $\tau(v)=u$ and not the other roots? I am guessing that I need to extend this and show that there are $n$ roots before and after $\tau$, so the bijection ensures a preimage. Am I right?
Comment: @YongHaoNg It is enough for $a_0+\cdots + a_nX^n$ to have *any* root in $\tau(F)$ because we may assume the polynomial irreducible. I'll edit accordingly.
Comment: This is a very clear explanation, thank you!

Endomorphism of Algebraic Closure


The last Spring boot validation not working

Question: I'm a beginner in spring boot and I found a problem with validation It doesn't work and I tried spring validation also hibernate dependency. I have the last version of spring boot 2.7.2
I add
<code> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency></code>
to my pom.xml but when I add @NotNull to my bean gave me an error, and showed me there's not a @NonNull Annotation.
Comment: What specific problem do you have? Can you show an example of what the problem looks like in code? What are your expectations for your code?
Answer: I faced the same issue. In my case, there was a problem with my pom. I had a dependency on the hibernate-validator. So I removed and worked for me.
Comment: Thanks for the reply, I will test it and I will reply to you.


Dockerfile giving error with distroless image

Question: I am trying to run this Dockerfile with distroless image (gcr.io/distroless/static:nonroot). docker build is happening successfully, but docker run -it image_name is giving me error:
2021-07-13T18:16:11.441Z   ERROR   controller-runtime.client.config  unable to get kubeconfig    {"error": "could not locate a kubeconfig"}
github.com/go-logr/zapr.(*zapLogger).Error
  /firstname.lastname@example.com/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/client/config.GetConfigOrDie
  /email@example.com/pkg/client/config/config.go:146
main.main
  /workspace/main.go:63
runtime.main
  /usr/local/go/src/runtime/proc.go:203

Debugging findings

Keeping distroless image if I am removing last line ENTRYPOINT ["/manager"] then docker run -it image_name giving error as-: docker: Error response from daemon: No command specified. See 'docker run --help'. This same docker run command working for distroless(with ENTRYPOINT line) but not working with distroless(without ENTRYPOINT line)
I replaced distroless image with alpine:latest. Here with ENTRYPOINT ["/manager"] (& without USER nonroot:nonroot) I am seeing same error as above ERROR controller-runtime.client.config  unable to get kubeconfig... BUT without ENTRYPOINT line, I am able to login to container with docker run -it image_name.

Someone please let me know how to resolve this, so that I can make this dockerfile run with all required configs as in Dockerfile.
NOTE: I am afraid that my egress-operator pod might not run by changing image name, as it can lead to miss any configuration in dockerfile in order to make it run.
Comment: Inside that image, there's an operator which wants to interact with Kubernetes? It is probably expecting a KUBECONFIG env var which located the kubeconfig file to connect to Kubernetes
Comment: The error message you quote seems like an error from your application (as @AandD suggests, a Kubernetes controller, perhaps?), which implies the Docker-level wiring is probably more or less right.  Is your problem about how to inject Kubernetes credentials into the container?  Or something else?
Comment: @David-: I want to fix this error so that dockerfile runs successfully.
Comment: What is ENTRYPOINT[/manager] command doing ? Will it cd to /manager folder or it will ( ./manager ) file? Just want to confirm its correct or not
Answer: Short answer:
If you want to run your image, just do this:
you have 2 options for it:

Run your image inside a Kubernetes Cluster
Place your kubeconfig inside your image as $HOME/.kube/config

If you are trying to debug your image, try this:
docker run --rm -it --entrypoint bash image_name

replace bash with sh if command not found happened.

Explanation
Dockerfile part
According to the Dockerfile Docs about entrypoint,

An ENTRYPOINT allows you to configure a container that will run as an executable. Command line arguments to docker run <image> will be appended after all elements in an exec form ENTRYPOINT

Your command is docker run -it image_name without any arg, so that docker will treat it as:

Run it in the image env
Run entrypoint which is /manager

the /manager is built with kubebuilder, it will try to load the kubeconfig and die if not thing found.
If you do not want to run the /manager when execute docker run, you have to replace it by using --entrypoint arg.
Kubebuilder part
As I noticed you mentioned you afraid of missing the kubeconfig for your pod, appending this edit.
kubebuilder would try to find kubeconfig in 2 place by default:

$HOME/.kube/config: the configuration file in the file system.
in-cluster: a pod running inside kubernetes can get an in-cluster kubeconfig.
/
Comment: @solveit obviously, it is not the same error, it is kubeconfig not found in the question, now that you got manager not found, it could be something related to the libc if you can sure you have added the manager. Do you use alpine as base image now? If so, try not to
Comment: @solveit look into my answers, you could also do 'docker run xx bash' when using entrypoint, just try the '—entrypoint' flag for docker run. It is not the main problem here
Comment: If I am running this in Kubernetes cluster then the same dockerfile giving error as:  OCI runtime create failed: container_linux.go:380: starting container process caused:  exec: "/manager": stat /manager: no such file or directory: unknown. Therefore I was running this dockerfile separately to see which line is failing. I raised a separate que for it as well https://stackoverflow.com/questions/68360450/kubernetes-pod-failing-because-of-incorrect-container-command
Comment: Now I am trying to build the dockerfile in kubernetes cluster with ubuntu:18.04 image (i know it is heavier than alpine & distroless, but want to verify whether image causing issue or not) and replaced ENTRYPOINT["/manager"] with CMD["/manager"]. FYI , ubuntu image with CMD is working separately with docker run -it image_name /bin/bash. I am able to login in container and found manager file in "/" location. So now trying same combo in Kubernetes cluster.


How to reduce white space in the task stream?

Question: I have obtained task stream using distributed computing in Dask for different number of workers. I can observe that as the number of workers increase (from 16 to 32 to 64), the white spaces in task stream also increases which reduces the efficiency of parallel computation. Even when I increase the work-load per worker (that is, more number of computation per worker), I obtain the similar trend. Can anyone suggest how to reduce the white spaces?
PS: I need to extend the computation to 1000s of workers, so reducing the number of workers is not an option for me.
Image for: No. of workers = 16
Image for: No. of workers = 32
Image for: No. of workers = 64
Comment: I'd recommend generating a performance report: https://distributed.dask.org/en/latest/diagnosing-performance.html#performance-reports In the report you can observe the administrative charts for workers and the scheduler.  Perhaps there is something which jumps out and helps explain why no work is happening (long writes to disk/serialization/etc).  If you don't see anything post the html to http://raw.githack.com/ paste the link here
Answer: As you mention, white space in the task stream plot means that there is some inefficiency causing workers to not be active all the time.
This can be caused by many reasons.  I'll list a few below:

Very short tasks (sub millisecond)
Algorithms that are not very parallelizable
Objects in the task graph that are expensive to serialize
...

Looking at your images I don't think that any of these apply to you.
Instead, I see that there are gaps of inactivity followed by gaps of activity.  My guess is that this is caused by some code that you are running locally.   My guess is that your code looks like the following:
<code>for i in ...:
    results = dask.compute(...) # do some dask work
    next_inputs = ...  # do some local work
</code>
So you're being blocked by doing some local work.  This might be Dask's fault (maybe it takes a long time to build and serialize your graph) or maybe it's the fault of your code (maybe building the inputs for the next computation takes some time).
I recommend profiling your local computations to see what is going on.  See https://docs.dask.org/en/latest/phases-of-computation.html
Comment: Hi.. thanks for the answer.. Within the loop, I use 'submit' for distributed computing and compute the final results only outside of the loop using 'gather'. The loop size is quite big (eg 10000). When I use smaller number of workers eg. 8, the white space occur after less frequently eg. after 100 loops, however when I use large number of workers eg 64, the white spaces appear more frequrently eg. every 10 loops.
Comment: It turns out that the garbage collection was the problem. I added gc.disable() at the beginning of the code and now the white spaces are gone! :D


Common practices for splash screens

Question: I have a "splash screen" in the sense that when I launch my app, a dummy activity splashActivity which has no UI is launched. In this activity, I validate some settings and if they are valid, I show the main view. If they are not valid, I show the login view.
The implementation of this makes sense and I kind of get the idea of a dummy splash screen to handle the logic of showing which activity.
But my question comes from the fact that the transition from launch to the intended activity is abrupt and not smooth. I notice that the screen goes white, and then black, and then goes to my intended activity. Is there a way to make this transition smoother? Maybe this dummy activity approach is not correct? Coming from iOS development, we have an AppDelegate class which handles this logic before any view is displayed and the transition is quite smooth.
TLDR: How do should I approach starting which activity based on some logic? In a dummy activity like I have now, or is there another way? If using dummy activity, how do I make the transition as smooth as possible.
Answer:
how do I make the transition as smooth as possible.

Simple, just add a flag to your intent like this:
Intent newIntent = new Intent(getBaseContext(), OtherActivity.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(newIntent);

Or override the pending transition right after starting the new activity and before any other lifecycle calls:
overridePendingTransition(0, 0);

How do should I approach starting which activity based on some logic? In a dummy activity like I have now, or is there another way?

To be honest I would not use 2 activities but compensate with one main activity and multiple fragments (say, a login and a content fragment) to accommodate your needs. You can read more about Fragments here.

Common practices for splash screens


Looped Flexible Adapter

Question: I want to get endless (looped) RecyclerView. But I use custom library for Adapter - FlexibleAdapter:
I find here the correct answer for usual RecyclerView.Adapter:
But I can't modify getItemCount() method
Do you have any alternative ideas?
Comment: Couldn't you create a new Adapter extending the FlexibleAdapter and override the getItemCount() method?
Comment: No, because getItemCount() is final. After fork and override this method, I get new issues
Answer: Endless / Loading More feature is part of library since January 2017. Top Endless from June 2017.

Looped Flexible Adapter


HttpClient GetAsync taking ~2 seconds

Question: My wpf program reads commands from a text file, and then sends those commands out over HttpClient.
Each GetAsync response takes about 2 seconds to complete.  This seems excessively long, especially when I have 50 commands to send.
Is this a normal amount of time for HttpClient to send/receive a GetAsync Message?  Is there a faster way to do this?
static readonly HttpClient client = new HttpClient();
        public MainWindow()
        {
            InitializeComponent();
        }

        private async void Register_ClickAsync(object sender, RoutedEventArgs e)
        {

            int counter = 0;
            string line;

            System.IO.StreamReader file = new System.IO.StreamReader(@"C\path.txt");

            while ((line = file.ReadLine()) != null)
            {
                try
                {
                    var watch = Stopwatch.StartNew();
                    HttpResponseMessage response = await client.GetAsync(line);
                    response.EnsureSuccessStatusCode();
                    string responseBody = await response.Content.ReadAsStringAsync();

                    watch.Stop();
                    var elapsedMS = watch.ElapsedMilliseconds;
                    RequestTextBox.Text += "\n" + elapsedMS;

                }
                catch (HttpRequestException ex)
                {
                    Console.WriteLine("\nException Caught!");
                    Console.WriteLine("Message :{0} ", ex.Message);
                    this.RequestTextBox.Text += ("\n" + "Message: {0} ", ex.Message);
                }
            }
            file.Close();
        }
    }

UPDATE:
This original program is a .net Core WPF app.  I created a .net framework WPF app with the exact same code.  The .net framework app takes 2000 ms to send the first HttpClient GetAsync command, and then <10 ms for subsequent commands.  This is a massive performance increase.  Does anyone have an explanation?  I have been unable to find any articles explaining this.
Comment: How much time does the request take when you execute it using postman?
Comment: It seems quite long. I'd put Fiddler in the middle, see what exactly is taking the time
Comment: @HirasawaYui About 500ms
Comment: @canton7 I'm looking into Fiddler, never used it before
Comment: Does the issue persist when you use HttpWebRequest instead?
Comment: Could be anything. Server is slow, your wifi is spotty, the responses are huge, who knows? But there is no issue in your code. If you can't get these to run faster, consider running them in parallel.
Comment: @JohnWu  Thank you.  I found that running the same code in .net Framework instead of .net Core ran the program significantly faster.  But I could not determine why.
Answer: Your code is awaiting for each request.
You can create many tasks by calling GetAsync and then wait them all with Task.WhenAll(). It will be more faster.
Answer: You are not using the async paradigm correctly. You are awaiting an async call immediately, and as a result it acts the same as a synchronous method. The idea of an async method is that it starts work and runs in the background, while not blocking other threads from executing. This allows you to run many threads at once and then return them when you are ready to use them. I would highly recommend the msft docs in this case. They use the example of making breakfast, in this example they are doing it incorrectly, as you are in your question:
Coffee cup = PourCoffee();
Console.WriteLine("coffee is ready");
Task<Egg> eggsTask = FryEggs(2);
Egg eggs = await eggsTask;
Console.WriteLine("eggs are ready");
Task<Bacon> baconTask = FryBacon(3);
Bacon bacon = await baconTask;
Console.WriteLine("bacon is ready");
Task<Toast> toastTask = ToastBread(2);
Toast toast = await toastTask;
ApplyButter(toast);
ApplyJam(toast);
Console.WriteLine("toast is ready");
Juice oj = PourOJ();
Console.WriteLine("oj is ready");

Console.WriteLine("Breakfast is ready!");

To fix it you must call Task.WhenAny() or Task.WhenAll(). This allows you to run all of the tasks at once and return them after they have finished (or as they finish). This will greatly improve your performance.
static async Task Main(string[] args)
{
    Coffee cup = PourCoffee();
    Console.WriteLine("coffee is ready");
    var eggsTask = FryEggsAsync(2);
    var baconTask = FryBaconAsync(3);
    var toastTask = MakeToastWithButterAndJamAsync(2);

    var allTasks = new List<Task>{eggsTask, baconTask, toastTask};
    while (allTasks.Any())
    {
        Task finished = await Task.WhenAny(allTasks);
        if (finished == eggsTask)
        {
            Console.WriteLine("eggs are ready");
        }
        else if (finished == baconTask)
        {
            Console.WriteLine("bacon is ready");
        }
        else if (finished == toastTask)
        {
            Console.WriteLine("toast is ready");
        }
        allTasks.Remove(finished);
    }
    Juice oj = PourOJ();
    Console.WriteLine("oj is ready");
    Console.WriteLine("Breakfast is ready!");

    async Task<Toast> MakeToastWithButterAndJamAsync(int number)
    {
        var toast = await ToastBreadAsync(number);
        ApplyButter(toast);
        ApplyJam(toast);
        return toast;
    }
}

HttpClient GetAsync taking ~2 seconds


How to remove glass from old door and replace it with wood?

Question: I have an old door that has glass panels and is covered with an ugly coating of white film. I would like to replace it with a wooden door. the problem is the door is a custom size and I can't just buy a new standard sized door. My plan is to remove the glass panels and replace them with wood, then paint the whole door to a nice brown wooden color.
What is the best way to remove the glass? After that, how should i replace the holes with wood? (having the old wood in the door and the new wooden inserts line up with the same width is not important)
Close up picture of the glass panel and the plastic film covering the door
Comment: I would cover the glass or the whole door with wood. Maybe prefinished so no painting required . I covered a paneled door with rough sawn cedar plywood to match a shed , just a matter of several screws ,then paint.
Comment: Do you hate glass doors? Removing the plastic film is totally doable.
Comment: @Harper-ReinstateMonica I would like to have a non-transparent door. And I love wooden doors:D
Answer:
What is the best way to remove the glass?

It looks like the glass is held in by 1/4-round wood molding, so I would do this:

score the paint around the molding with a knife, both where it meets the glass and where it meets the door rabbet/rebate
use a variety of small tools (e.g. small prybar, cat's paw, hammer, putty knife, etc.) to remove all molding around the glass
carefully look for and pull any glass retaining clips (if any) around the perimeter of the glass, and any glazing putty that may be there (typically the glass pane would be bedded in putty prior to installation of the molding)
remove glass pane carefully
thoroughly clean and prep the rabbet/rebate to prepare it for wood panel install

how should i replace the holes with wood?

cut a piece of "A" grade exterior 3/8" plywood to size
install in a similar fashion to how the glass was installed but no putty required and use brand new paint-grade 1/4-round molding that fits the reveal left after the plywood is inserted
Comment: Also: don't nail or glue the new panels to the door. Let them float behind the new 1/4-round molding. - The panels and the door will probably expand and contract at different rates with changing temperature and humidity.
Comment: There's a possibility the glass is being held in solely by glazier's points and putty. If so, smashing the glass (deliberately or inadvertently) usually happens. Put a tight crosshatch of packing tape on the non-filmed side and wear gloves/eye protection while working.
Comment: @AloysiusDefenestrate thanks for the warning!
Comment: "Signboard" aka MDO plywood might be a good choice for the panels, since you're painting. Info, not a recommendation: https://www.capitolcitylumber.com/product/mdo-medium-density-overlay-signboard/
Comment: Thank you for the comprehensive answer, helped me a lot!
Comment: The vinyl stickers on the glass will likely do to hold the glass should it shatter, so extra tape as recommended by @AloysiusDefenestrate may not be necessary. Though, it wouldn't hurt.