Android - Issue with AutoCompleteTextView element, setOnItemClickListener not working

Question: I have the following Activity code which ref. the R.layout.pool_details_new_layout (code below)
The Adapter ref. the number_of_players_dropdown_layout (code below)
Everything works fine, the view loads the AutoCompleteTextView dropdown box populates and when i click on it is shows all the entires in it
BUT
when i select an item, I am expecting for the numPlayersSelected.setOnItemClickListener to execute and log to the logcat and show a toast on the screen but nothing happens!?
Does anyone know what i am missing!?
Activity code:
public class PoolDetailsActivity extends AppCompatActivity {

    ArrayAdapter<SkuItem> numPlayersAdapter;
    private AutoCompleteTextView numPlayersSelected;
    public static Activity activity = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.pool_details_new_layout);

        activity = this;

        numPlayersSelected = (AutoCompleteTextView) findViewById(R.id.numOfPlayersAddSelected);

        numPlayersAdapter = new IAPSkuAdapter(activity, R.layout.number_of_players_dropdown_layout, numPlayersArray);

        numPlayersSelected.setAdapter(numPlayersAdapter);

        // NOT WORKING!?   <-------------------------------------
        numPlayersSelected.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                String selectedItemText = (String) parent.getItemAtPosition(position);

                Toast.makeText(getBaseContext(),selectedItemText + " selected!", Toast.LENGTH_LONG).show();
                Log.e(TAG, "<< SELECTED >> : " + selectedItemText);

            }

        }

    }

}

number_of_players_dropdown_layout code:
<?xml version="1.0" encoding="utf-8"?>

<androidx.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:cardCornerRadius="15dp"
    app:cardElevation="10dp"
    app:cardUseCompatPadding="true"
    card_view:cardCornerRadius="5dp">

    <LinearLayout
        android:id="@+id/adminLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <LinearLayout
                android:orientation="horizontal"
                android:padding="3dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:text="Add Players"
                    android:layout_marginStart="10dp"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    android:layout_gravity="center"
                    android:textColor="#605E5E"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

            </LinearLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/numPlayersDropdown"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
 style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
                android:hint="Select"
                android:labelFor="@+id/numOfPlayersSelected"
                android:background="#EAE7E7">

                <AutoCompleteTextView
                    android:id="@+id/numOfPlayersAddSelected"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="none"
                    android:layout_weight="1"
                    android:padding="14dp"
                    android:textSize="16sp" />

            </com.google.android.material.textfield.TextInputLayout>

        </LinearLayout>

    </LinearLayout>

</androidx.cardview.widget.CardView>

pool_details_new_layout code:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_gravity="center"
    android:background="@color/black"
    tools:context=".PoolDetailsActivity">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fadeScrollbars="false">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <LinearLayout
                android:id="@+id/admin_support_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <include layout="@layout/pool_details_admin_layout" />

            </LinearLayout>

        </LinearLayout>

    </ScrollView>

</LinearLayout>

-------------- UPDATE ----------------
Adapter Class Code:
public class IAPSkuAdapter extends ArrayAdapter<SkuItem> {

    public IAPSkuAdapter(@NonNull Context context, int resource, @NonNull List<SkuItem> skuItemList) {

        super(context, resource, skuItemList);

    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {

        if (convertView == null) {

            convertView = LayoutInflater.from(getContext()).inflate(R.layout.number_of_players_dropdown_layout, parent, false);

        }

        TextView skuTitle = convertView.findViewById(R.id.skuTitle);

        TextView skuPrice = convertView.findViewById(R.id.skuPrice);

        SkuItem skuItem = getItem(position);

        skuTitle.setText(skuItem.getSkuTitle());

        skuPrice.setText(skuItem.getSkuPrice());

        return convertView;

    }

}

Answer: Here are 2 things you could try:

You could try to setup the clickListener() Method in the Adapter for each item:

convertView.setOnClickListener(v -> { //Your code here });
In this example we assume that the click method should be triggerd when the convertView is pressed.

Also try to make sure that the array numPlayersArray isn't empty, when the ClickListener gets assigned.

Please let me know if it helped.
Comment: can you provide sample code for the first option? I am new to android programming coming from ios.
Comment: I have added my current Adapter code
Comment: I've added some sample code. Please let me know if it works or if you're facing any issues.
Comment: So i did that, but now the behaviour of the dropdown menu is not working. I put a basic `Toast.makeText(getContext().getApplicationContext(), "Sku Selected: " + sku.getSkuTitle(), Toast.LENGTH_SHORT).show();` which displays correctly and all but the menu does NOT close like you would expect it to once a user selects an item!?
Comment: For that you need to hide the parent view by changing its visibility. In that case I belive it works like this: `parent.setVisibility(View.GONE);`. But I'm  not sure if this is working in your case. If not, you probably have to access the parent view by getting the parent through:  `convertView.getParent()` and then changing the visibility. Or you can pass it from outside into the adapter.


Determining wire gauge based on MCA and max fuse size

Question: I've been doing research on the electrical system in my home, for my own knowledge and also to verify things are code compliant.
I have a Mitsubishi mini-split which was installed 3 years ago by an HVAC company.  The outdoor unit model is MXZ-3C24NAHZ2. The manual specs Max Fuse Size: 40A, and Min. Circuit
Ampacity 29.9.
There is a 40A breaker in my panel for this.  However, they ran 10ga Romex from there to the disconnect (which is 8' away), instead of 8ga, which is what I thought was required.

If MCA 29.9 can run on 10ga, why does the manufacturer specify a 40A instead of 30A?
Did the contractor size things correctly?

The outdoor unit provides both heat and cooling, and everything has run fine since installation.
Comment: #2 is a yes if the answer to imaginary question #3 is also a yes; that it is 90c THHN copper? Romex is a *no*. That's *cable* not *wire*.
Answer: Having both a minimum (in your case 29.9A, which effectively means 30A) and a maximum (40A) is quite common. Note however, that if the actual load is 29.9A then it may need a continuous use derate, which brings it to 29.9A x 1.25 = 37.375A, which means a 40A breaker anyway.
There are a bunch of possible reasons why you might prefer the maximum rather than the minimum (when there really is a difference):

Add-on equipment powered from the same circuit
Better allowance for higher load during motor startup
Allow for future larger size equipment

But whatever you do, the wire size must be large enough for the breaker. The only way you get to 40A on 10 AWG wire is 90 C rating on wires, which (a) is not normally applicable even with the right type of wires and (b) you probably have cable rather than individual wires anyway.
You haven't had a problem because:

The actual load is probably close to 30A. That matches the basic rating of 30A for the cable anyway.
It is probably rare that it runs for really long times continuously.
Unless the cable is inside an insulated wall, it probably dissipates heat at a rate that safely allows more current (within reason).

It sounds like the contractor sized the circuit correctly (40A) but got lazy (reused existing 10 AWG cable already in place) and/or cheap when it came to the wiring.
That being said, replacing the 10 AWG cable with 8 AWG cable (or 8 AWG wires in conduit) is the right thing to do.
Comment: The 8 feet isn't going to cost much at all.
Answer: MCA of 29.9 cannot use #10. An Air Conditioner isn't 125% because it's continuous, it's 125% because it's required in NEC 440.32(2), the Air Conditioning section. 29.9 x 1.25 = 37.375A. The best available termination rating limits even the best wire to the 75° column of 310.16, and would allow up to 35A on #10. But "Romex" is NM cable and is limited to 60°, so is limited to 30A.
Understanding UL labelling of Max Fuse Size is a little more complicated, UL considers what temperature the copper will be damaged and time curves for insulation damage, and other factors directly relating to equipment components, and results in numbers not defined in the NEC.
Comment: @Mazura I was trying to not go too deeply into the weeds, i did say "best available wire and termination". The terminations are the key, the breakers and disconnect will be 75°, which brings the wire rating down to the termination rating. 90° rating is basically only good for doing some de-rating calculations.
Comment: Because your question didn't give full details I didn't address other implied issues, but agree with other answers that fuse means fuse required and NM cable shouldn't penetrate into wet or damp location.
Comment: 90° THHN #10 is good to 40 amps. But OP has romex though so that's right out. ... cannot use #10 *romex*.
Answer: I think what's gotten my attention is the part where you said they ran 10AWG ROMEX to the disconnect. ROMEX isn't suitable for outdoor use, unsupported use, etc.
Replace that with an 8AWG whip of the required length. There are limits on unsupported whip length, attach it to something every 6 feet or less. There's a 6 foot limits on the length of the flexible metal type when relying on the spiral metal tape for fault grounding. There's no limit when there's a green wire other than the support spacing. If you can't find a pre-made whip you can buy liquid tight and 8AWG Type THHN wire and make your own, but it's usually both easier and cheaper to buy than to make.
Comment: You may be right. But since the 8 feet of Romex is to the **disconnect**, it is possible that the disconnect is on the outside wall with the cable running through the wall into the back of the disconnect box. There seems to be some controversy as to whether that is allowed or not, but my understanding is that in many places it is allowed (including I am pretty sure my electrician (with inspection) wired up my generator inlet that way. Definitely needs to be 8 AWG.
Comment: *runs along the house in conduit for 2'* If that means, as I think it does, *on the outside wall of the house*, then that is definitely against code. Romex (and similar non-metallic cable) is not normally rated for use in wet areas, and outside == wet, even though it is in conduit.
Comment: The Romex comes out of my garage wall just below the load center and goes into a 90 degree conduit outlet body.  It then runs along the house in conduit for 2' and goes into the disconnect.  From there, a whip goes out to the unit.
Answer: The X-factor you're missing is that most motors have overload protection onboard the motor. And that works better because it can sense actual motor temperature instead of guesswork from afar.
Normally UL wants the breaker to be close to the running amps of the machine so it can provide overcurrent protection to the machine.  However, with overcurrent protection covered,  the breaker is only concerned with short-circuit (and bolted fault; similar to short-circuit) protection.   As such, breaker sizing can focus on another common problem of motors: nuisance trips from normal startup surges.
And that brings us to Article 430, which allows us to upsize a motor breaker as much as 225%.  A 40A breaker is going to do about the same job as a 30A breaker at detecting short circuits.  A 300A short will simply be 750% of rating instead of 1000% of rating, making little difference in trip time.
Answer: The manufacturer gives you a range.
MCA of 29.9 means a 30A breaker is fine. So you could leave the wire alone, swap the breaker to 30A, done with the wire you have. This is the manufacturer telling you EXACTLY how much capacity is required to run the thing under worst case conditions, so exceeding it is neither required, nor particularly beneficial. Most of the time it will use less than that.
Max Fuse (or "Overcurrent protection") of 40A means you can use a 35 or 40A breaker if you want to, and that's also fine. If you do, you need suitable wire size for 35 or 40A, which you don't have now. If you were swapping out an old unit with 40A breaker and wiring in place, great, no need to change anything. If you choose to stay with the 40A breaker you don't need, you need to change the wiring to suit it.
Mitsubishi mini-splits are inverter drive, so they don't have huge start-up surges - they start slow and ramp up to the required speed. Knee-jerking to an oversized breaker to run them is outdated thinking.
I'm fairly certain that being specified as Minimum Circuit Ampacity (rather than just "Amps") the manufacturer has already performed the derate calculation; derating twice is not required.
Example case: I run a pair of them with an MCA of 10.9A (on 15A breakers, 240V) They are the major load on my power in winter. Actual typical hourly power use overnight, when it's basially them and the fridge, and the motion lights if a deer walks past, for the whole building recently was around 2.4KWh/h in cold weather and closer to 0.6 KWH/h in the late January/early February thaw we've just had. So 10A for the pair of them (and the fridge, but it's like 1 KWh/day) in colder wather, 2.5A for the pair of them in the thaw. Nowhere close to 21.8A for the pair.
If I go back to last year when the power company claims it was -20°F and my recollection is it was more like -16F the worst hour of the day (just before dawn) was 3.8KWh, or 15.83A for the pair and the fridge. Almost but not quite 8A actual, each.
Comment: I neglected to mention that Mitsu spec'd "Time Delay" for the fuse.  Would a standard trip 30A trip unnecessarily?
Comment: If they spec a FUSE, you have to use a fuse (somewhere in the circuit.) Typically that would be in a fused disconnect, since we don't tend to have fuse panels any more. Given the trip curve of a typical breaker, it would be unlikely to trip without a fault. If the spec is for Max Overcurrent Protection Device a fuse is not needed, but if a fuse was used and they spec time delay for a fuse, you'd need that. Regukar fuses blow faster than breakers, typically.
Answer: When the labeling on a complex machine with its own internal fuses and breakers specifies a maximum fuse on its input, it sometimes means that if the fuse doesn't stop a short circuit as high as what that size fuse would usually be required to stop, the short circuit current that makes it through a larger fuse might dangerously destroy the internal breakers in the machine .  In IEC standards for power control boxes ("fuse panels") there is a technical requirement that the box shall have label stating the max worst case short circuit that the incoming supply can produce for a brief moment of horror, usually something like 4000 A or 8000 A, with many of the breakers and fuse holders needing to be more expensive models to handle the higher worst case rating.  What this large number means is that if the main breaker or fuse has to, it can stop such a huge current safely at least once before catching fire, and that the installing electrical contractor is supposed to measure (in some clever but standard way) how much the incoming feed from the grid or local power source might supply if some gremlin suddenly put a huge copper bolt across the wires entering the box.
So if the makers of this air conditioner wrote "max 40 A fuse" it probably means that their factory engineers looked at the reaction times of common household fuses and concluded that a 50A fuse would let through enough juice to fry the thermostat relay contact points if something inside the unit shorted out out, but a 40A fuse would be safe enough for their product liability insurance .  So running two of these units on a 60A fuse would be dangerous even though on a normal day they only draw 30A each.
Other answers are correct that the wires after a fuse must be rated to whatever that fuse is allowed to let through, so a 40A fuse must be followed by 40A wiring to not cause a fire if someone plus a 40A space heater into the wire instead of the device currently using those wires.


JS Autobuild table with dictionary array from category list

Question: I work with table, using jquery, for myself i have task t show dictionary data at this table.
For example i have such array:
var mokData = [
{ category: "Material", id: 'Code0-1', name: 'Brakedown of machine' },
{ category: "Material", id: 'Code0-1', name: 'Brakedown of machine' },
{ category: "Tool", id: 'Code0-1', name: 'Brakedown of machine' },
{ category: "Tool", id: 'Code0-1', name: 'Brakedown of line' },
{ category: "Tool", id: 'Code0-1', name: 'Brakedown of machine' },
{ category: "Tool", id: 'Code0-1', name: 'Brakedown of line' },
{ category: "Tool", id: 'Code0-1', name: 'Brakedown of machine' },
{ category: "Tool", id: 'Code0-1', name: 'Brakedown of line' }
];

From this array i sort ant get data at my table, but i need build table depends of data which i will receive from server.
function pushDataToTable(data, value) {
    $.each(data, function (key, val) {
        if (val.category === value) {
            var tr = '
';
            tr += '' + (key + 1) + '	';
            tr += '' + val.id + '	';
            tr += '' + val.name + '	';
            tr += '<button class="chose" data-key="' + (key + 1) + '">Chose</button>	';
            tr += '
';
            $('tbody').append(tr);
           } else {
            console.error("Error");
        }

    });

    $('button.chose').on('click', function () {
        var cRow = $(this).parents('tr');
        var cId = $('td:nth-child(2)', cRow).text();
        var intKey = $(this).data('key');

        cRow.fadeIn('slow', function () {
            doChose(cId, intKey);
        });
    });

    function doChose(param1, param2) {
        alert('Data with\n\nID: [' + param1 + ']\nKey: [' + param2 + ']');
    }
}

$(document).ready(function () {
    $(".categoryLink").on("click", function () {
        $(this).addClass("active");
        $(this).siblings().removeClass("active");
        var href = $("a", this).attr('href');
        getValueFromHref(href)
    });
});

function getValueFromHref(value) {
    var test = value.replace("#", "")
    pushDataToTable(mokData, test);
}

How u can see my JS code, from which i parse data to table, but i have problem.
I have category navigation at my page.
Code:
$(document).ready(function () {
$('.category_list .category_item[category="all"]').addClass('ct_item-active');

$('.category_item').click(function () {
    var catProduct = $(this).attr('category');
    console.log(catProduct);

    $('.category_item').removeClass('ct_item-active');
    $(this).addClass('ct_item-active');

    $('.product-item').css('transform', 'scale(0)');
    function hideProduct() {
        $('.product-item').hide();
    } setTimeout(hideProduct, 400);

    function showProduct() {
        $('.product-item[category="' + catProduct + '"]').show();
        $('.product-item[category="' + catProduct + '"]').css('transform', 'scale(1)');
    } setTimeout(showProduct, 400);
});
});

And from this category depends of button click i change data at my table.
Data are sorted. But previus values are not clear from table.
My HTML code:

Down time registration

                    Technical
                    Organizational
                    Operator
                    Other

Equipment

Tool

Tool

                            #
                            Code
                            Description
                            Action

And CSS:
wrap {
    max-width: 1100px;
    width: 100%;
    margin: 5px;
}

    .wrap > h1 {
        color: #494B4D;
        font-weight: 400;
        display: flex;
        flex-direction: column;
        text-align: center;
        margin: 15px 0px;
    }

        .wrap > h1:after {
            content: '';
            width: 100%;
            height: 1px;
            background: #C7C7C7;
            margin: 20px 0;
        }

.store-wrapper {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.category_list {
    display: flex;
    flex-direction: column;
    width: 30%;
}

    .category_list .category_item {
        display: block;
        width: 100%;
        padding: 15px 0;
        margin-bottom: 20px;
        background: #E84C3D;
        text-align: center;
        text-decoration: none;
        color: #fff;
    }

    .category_list .ct_item-active {
        background: #2D3E50;
    }

.products-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}

    .products-list .product-item {
        width: 40%;
        margin-left: 3%;
        margin-bottom: 25px;
        box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.22);
        display: flex;
        flex-direction: column;
        align-items: center;
        align-self: flex-start;
        transition: all .4s;
        display: none;
    }

        .products-list .product-item img {
            width: 100%;
        }

        .products-list .product-item a {
            display: block;
            width: 100%;
            padding: 8px 0;
            background: #2D3E50;
            color: #fff;
            text-align: center;
            text-decoration: none;
        }
.container2 {
    width: 70%;
    height: 400px;
    display: flex;
}

.section2 {

    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* for Firefox */
    min-height: 0;
}

.content {
    padding: 2px;
}

.scrollable-content {
    flex-grow: 1;
    overflow: auto;
    min-height: 0;
}

So conclution is, i have problem with dictionary array which are not clear after chosing new category from category list.
Answer: You have a few typos in your code.
I have created a fiddle with the code you have posted above, cleaned it up and made a couple of small changes and it appears to work as you require.

I cleaned up some html (missing div tags added)
Changed the line :

to this

At the start of the function I added this:

$("#tableResults").html('');
which clears the table before it is rebuilt.
Then added
$("#tableResults").append(tr);
//$('tbody').append(tr);

which builds up your new table
View the fiddle here


The shortest path that meets every extended line that passes through a circle of radius $r$

Question: Problem:
A straight underground pipe passes by a statue at a maximum distance of 100 meters. The exact whereabouts of this pipe is unknown. What is the shortest trench i must dig that will assure me to find the arbitrary laid pipe.
The answer appears to be a half circle with two lines of length 100 m aranged like a horse shoe magnet.
If this is the shortest trench path how could such be proven formally. e.g disproving all other trench paths.
the bold line represent the shortest trench path
is it worth investigating this problem for IB MATHS HL INTERNAL ASSESMENT?
Comment: The way this question is phrased does not seem accurate. A chord is a line segment.
Comment: For future searchers: this is the problem of finding shortest beam detectors. https://web.archive.org/web/19961110073734/http://www.mathsoft.com/asolve/constant/beam/beam.html
Answer: Without typo, length is equal to $ 2 r + \pi r.$
Comment: The question is about proving that this is the shortest path, not about calculating its length.


Why does my home continue to warm after sundown?

Question: I live in a 1950's single-story ranch-style with a vented attic space (with a roof ridge vent). I haven't turned on my central air yet for the summer, and I've noticed that the air temperature inside the house tends to increase between the time I get home and the time I go to bed, even though the outside air temperature is dropping during the same time.
I even jotted down some observations yesterday. High temperature outside was 85F at ~4:00pm (per weather app). At 6pm when I got home, it was 80 outside and 73 inside. At 11pm it was 70 outside and 77 inside. Had been keeping all doors and windows closed (until 11 when it was too hot to sleep comfortably), didn't use the range or oven for cooking, and only indirect sunlight coming in the windows during that time frame.
Might be more of a building science question than home improvement. I suspect it has to do with how air flows through the attic before and after the sun goes down, but don't really know why that would be the case. Mostly asking out of curiosity, but if there's something to help with the heat, I'm down to hear it.
Comment: Brick/stone/cement walls act like heat sinks/traps.  They collect/hold on to heat in the day time and slowly release the heat when the temperature cools.
Comment: Look up "Trombe Walls" (which work in areas of consistent sunshine - not so well where the sun is unreliable in heating season)
Answer: People think the need for A/C comes from the air outside being hotter than the air inside. No, it comes from direct sunlight. Sunlight is 300 BTU per square foot. And most roofs have an albedo in the single digits (reflect less than 10% of the energy).  The moon is pretty light colored, but it's only 12% albedo  (absorbing 88%).
But why evenings? For the same reason you don't need A/C prior to noon, even though 50% of the day's solarization has already happened.
Solar Gain meets building mass meets insulation
As mentioned just above, the lion's share of heat energy added to a building isn't transferred from the air. It's blasted directly by the sun, because the roof is non-white, so it absorbs most solar energy rather than reflects it).  Albedo (the ability to reflect solar energy in any significant way) requires a near-white surface.  You have to allow for the angle to the sun, but that means 300 BTU per square foot of roof or wall that is facing the sun.
This heat acts on the physical structure of the building.  The roof materials, rafters, joists, exterior walls, studs.  Materials store heat.  It takes awhile for cold things to warm up and vice versa. The structure of the building is massive, and it is soaking up this heat.  So this creates a considerable time lag between when the solar heat hits the building, and when it is felt.
4 hours before noon and 4 hours after noon, the sun is the exact same number of BTUs.  But the difference is obvious: 4 hours before noon, the building has had all night to cool off. 4 hours after noon, it's been absorbing these BTUs all day and is quite hot.
I wish it was easy to stick recording thermometers in the roof's surface, inside rafter wood, inside attics, inside walls, etc. Because then it would be obvious.
After 4 PM or so, the sun's angle is more and more oblique, so less and less practical heat is being absorbed by the buildings.  So why do we need the A/C only then?  Because this accumulated heat is finally soaking through the insulation.
The insulation slows down heat transfer; it doesn't stop it.  A freezer is very well insulated, but if you unplug it for a month in a 70F room, the freezer innards will be at 70F.
So at 4 PM, solarization is fading, but the temperature of the building's structure is probably at peak.  And it's had time to soak through the insulation and start warming the parts of the building that are inside the insulation envelope.
When the sun actually sets, the "outside of the insulation envelope" parts of the building are still quite hot.  And that heat is radiating out into the world, but it's also still radiating into the insulation.  Where it continues to heat the parts of the building inside the insulation.
The thermal mass of all these components is why we need to run A/C til midnight :)
Functionally, the building mass is our enemy.
Nowhere is this more obvious than the dumb design of insulating attic floors.  Now the entire attic, structure, and all things stored in the attic are added to that thermal mass which bedevils us and makes us run A/C later and later.
Change the insulation, change the game
So one strategy in Passivhaus and efficient design is to put as much building mass as possible inside the insulation envelope.  Think about simple corrugated metal roof/walls  followed by 8" of structural foam followed by 10" of reinforced concrete followed by studs and drywall or whatever.  The metal skin has negligible thermal mass, and will closely match solarization - it will be about as hot 4 hours before noon as 4 hours after noon.  No storage there. The insulation will greatly slow the skin's heat affecting the concrete. The BTUs which get through the insulation will find the huge mass of the concrete, and will have trouble warming it appreciably. So the concrete will act as a huge buffer, tending to hold the interior at a stable temperature.
This type of building turns the building's mass into our friend.  It functionally provides thermal energy storage, which moderates temperature changes in the building - but also delays them tremendously.
But you don't need to go to such an extreme - many buildings without PassivHaus design can still benefit by using the bones of the building as energy storage.  In fact, Technology Connections did a whole video on this, exploiting inside-the-insulation thermal mass  to choose the time of day that A/C can run.  The A/C starts almost exactly when your A/C shuts down, that just goes to show the extremes to which time-shifting is being done here. But it works because the insulation to interior thermal mass ratio is good enough. And this is just an average (though relatively recent build) home with some reasonable shading to escape some solar gain. (any house could do that with some white paint.)
But here's a more sensible plan: Solar panels respond to actual solarization. They output the same 4 hours before noon as 4 hours after noon.  So, what if we just ran the A/C while the solar power is available?    We'd have a bit of deviation - cooler than preferred in the mornings and warmer than preferred in the evenings, but not a lot of deviation depending on insulation. That combined with smarter insulation could get-r-dun for a lot of people.
We could also increase thermal mass of buildings by moving insulation layers outward - insulate the attic rafters instead of floor, or there are services which will add 2-6 inches of spray foam onto any roof, creating a new foam roof on top. Or skin the building with panel insulation.
There's a thing called the "Duck Curve" which reflects the difference between when solar panels generate power and when people want to run their A/C.  There's such a glut of morning solar in California they had to pay Arizona to take it (at the time, their reservoirs were too low to use pumped storage like they usually do). Meanwhile they're spinning up peaking plants in afternoons to cover supplemental A/C load.  I think Technology Connections is onto something.
For new construction, see also use ICF's or insulated concrete forms. They are single-use concrete forms, made out of foam, which stack up like LEGO blocks.  Normally when the concrete cures, you demolish the forms, but in this case, you leave the foam there forever and it becomes part of the insulation.
Comment: ICFs are an annoying design failure. They should have foam on the outside and not-foam on the inside. Instead, they isolate the thermal mass from both sides with foam.
Comment: @Ecnerwal I wrote that, then deleted it for reasons I forget.   But j**ust demolish the inner ICF**.  Battleship Texas has a bunch of void spaces outside their armor, with thin steel prone to leaks; they filled them all with structural foam. Seems like a terrible idea, but it was so the ship doesn't sink and block the Galveston Ship Canal.  At the dry dock they demolished the foam some astoundingly easy way - water jets, I think.  It's going to be in that dry dock most of a year. Nick of time too, the Spanish are getting uppity :)
Comment: Makes a lot of sense that even turning on my attic fans doesn't seems to help. The house has a brick façade, which I'm guessing holds a ton of heat. And it's an uneven grade, with the largest exterior wall facing south and getting baked the longest every day.
Answer: My hunch is the attic.
The attic is probably getting a lot hotter than the ambient outside temperature. During the evening hours some of that heat goes up and out, some of it goes down and out - i.e., into your living space.
The way to confirm this is to put a wireless remote thermometer in your attic and track temperature through the day and night. The ones I have are for refrigerator/freezer use so the temperature range is not right or I would recommend them. (At least, I don't think they give accurate readings at temperatures over 80 F.) But something similar, which I have selected for you at random on Amazon, is something like this indoor/outdoor thermometer:

Put the outdoor sensor in the attic. If you really want to get fancy, get an extra outdoor unit so you can track all three relevant temperatures:

Indoor
Outdoor
Attic

If the problem is the attic, there might be some adjustment you can do with passive cooling, but the usual solution is an attic fan.
Comment: In many cases an even better solution is extra attic insulation, because most houses this old have very little of it.


C# GridViewRow FindControl get/pass values

Question: I have an asp:linkbutton.  When it's pressed I want to get a list of DetailID's based on which of the checkboxes in my GridView are checked.  I have a lblTesting to see the list of DetailID's that I'm generating.  My goal is to get a list of DetailID's that I pass to an edit page.
I have looked at several examples on Stack Overflow but I cannot get any value other than the checkbox is checked.
Here is the link I have at the top of my page:
<asp:Linkbutton ID="getURLLink" runat="server" Text="Edit Die Detail" OnClick="GetLink"></asp:Linkbutton>
<asp:Label runat="server" ID="lblTesting"></asp:Label>

Here is my GridView:
 <asp:GridView ID="DieListDetailGridView" runat="server" AutoGenerateColumns="false" OnRowDataBound="DieListDetailGridView_RowDataBound" DataKeyNames="DieID" HeaderStyle-HorizontalAlign="Center" HorizontalAlign="Center" ForeColor="#333333" GridLines="Both">
        <RowStyle BackColor="#F5F5DC" />
        <AlternatingRowStyle BackColor = "White" ForeColor="#284775" />
        <Columns>
            <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:CheckBox ID="chkBox" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DieNum" HeaderText="Die Number"  />
            <asp:BoundField DataField="DieID" HeaderText="Die ID" Visible="false" />
            <asp:BoundField DataField="DetailID" HeaderText="Detail ID" Visible="false" />
            <asp:HyperLinkField DataTextField="DetailNum" HeaderText="Detail Number" DataNavigateUrlFields="DetailID" DataNavigateUrlFormatString="~/Tooling/DieDetail.aspx?DetailID={0}" />
            <asp:BoundField DataField="Description" HeaderText="Description" />
            <asp:BoundField DataField="MaterialType" HeaderText="Material Type" />
            <asp:BoundField DataField="Hardness" HeaderText="Hardness" />
            <asp:BoundField DataField="MinSpares" HeaderText="Min Spares" />
            <asp:BoundField DataField="MaxSpares" HeaderText="Max Spares" />
            <asp:BoundField DataField="CurrentSpares" HeaderText="Current Spares" />
            <asp:BoundField DataField="DetailNotes" HeaderText="Detail Notes" />
        </Columns>
    </asp:GridView>

And my GetLink function:
 protected void GetLink(object sender, EventArgs e)
        {

            // start off empty
            string DetailIDList = "";

            foreach (GridViewRow row in DieListDetailGridView.Rows) {

                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chkBox = (row.Cells[0].FindControl("chkBox") as CheckBox);

                    string DetailID = row.Cells[3].Text;

                    if (chkBox.Checked)
                    {
                       DetailIDList = DetailIDList + DetailID + ",";
                    }
                }
            }

            // Remove the last , from the list
            DetailIDList = DetailIDList.Remove(DetailIDList.Length - 1, 1);
            // comma delimeted list of checked Detail ID's
            lblTesting.Text = DetailIDList;

            //Response.Redirect("~/Tooling/DieDetail.aspx?DetailIDList=");
        }

I can't figure out why my DetailID is empty.
I've tried doing row.Cells[0].FindControl("DetailID") but that also didn't work.
What I am expecting to get from the DetailID are integers like "28925", "16423" etc.
I was asked to not show the column on the page, which is why visible = false.  I still need to reference the ID to pass it to the edit page.  I need to do the same edit to multiple Detail ID's.
What am I doing wrong?
Comment: I found out if the DetailID is VISIBLE this works and gives me a list of DetailID's but I need it to work while it is not visible.  So I'm still trying to figure out an answer to this.
Answer: The answer to having a list of ID's even though the datafield is set to not be visible was found on another StackOverflow question:  ASP.NET: GridView value set to null when column is not visible
The answer was to remove the "Visible=false" from the GridView and on each row created (after the column has the data added for the row) make it not visible.
This code fixed my issue:
 protected void DieListDetailGridView_RowCreated(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[2].Visible = false;
            e.Row.Cells[3].Visible = false;
        }


Door frame rotting on top edge

Question: I have an exterior door (~7 y/old) and the top frame is rotting. The door is on the SE side of house and gets almost no rain (weather comes from west normally). There is no screen door. The door is on the first floor, at my "workshop" room which is also next to the garage. So it is not, as far as I can tell, rotting from exterior moisture. It is from interior moisture or condensation. I have poked thru the wood and touched the insulation in the space and it is damp. The workshop room, and the garage which it is open to, has a relatively high humidity most of the time, I think because the water softener system is in the garage and the salt box isn't hermitically sealed. The humidity guage (in garage and workshop) is nearly always above 60%. The workshop room has only panelling on the walls (painted) not drywall. I suspect that the humid air is getting thru panel gaps, going into the gap around the door, and meeting a cold piece of wood (as it is exposed) in the winter, making condensation inside.
What would be a good preventative to seal up the room and stop the condensation? Should I remove all/some of the panelling around the door on the inside and replace with drywall? Should I apply a layer of tyvek/house wrap under the panelling? How well sealed would that need to be to the studs underneath? Other options?  Thanks.
Comment: Are there any opening anywhere above the door in question?
Comment: There is no window or other opening in the house there, above this door. On this wall there is only this door and the main car garage door next to it a couple feet away.
Comment: Solution was it seems there was caulk missing and even a small water intrusion probably never could dry out, the insulation was packed in so tight. Replaced wood with plastic plank and fixed caulking above flange area.
Answer: Wet insulation is never a good sign.
I would open up the paneling to see how bad it is, and keep removing insulation until there is no more moisture. You're going to have to do this anyway to add a proper vapor barrier.
At that point, you should be able to see where the water is coming from, and you may be surprised that there is a leak in the roof, siding, pipe, or who knows what. You may have mold to deal with as well.
Sealed inside a wall with no escape via evaporation, it doesn't take much of a leak at all to accumulate water.
Once you're in that far, you can evaluate what needs to be done to add or replace a vapor barrier. Would adding some ventilation to the room be an option as well?
Comment: Good answer. Note that leaks in the roof can often travel quite a way from their source.

Door frame rotting on top edge


Leveling-smoothing an exterior cement patio

Question: I paid for a 16' x 16' cement slab to be laid down so I can build a shade spot for BBQ and enjoying the evenings. My problem is that I did not want a rough surface. I want to be able to walk out in bare feet to have morning coffee.
I told the guy that. Guess what? Yep, it has small rocks on the surface. What is the least expensive way to level this my self?
Comment: "Small rocks"? Is it an exposed aggregate patio? A photo would be invaluable. What does your contract stipulate? Concrete is normally finished with either a smooth (troweled) or textured (broomed) surface. This sounds like neither.
Comment: cheaper and more practical to get a pair of $5 flip-flops.
Answer: The only good ways to get a truly smooth surface at this point is to 1) cover the slab with tile, or 2) grind it smooth.
You can install porcelain or quarry tile for a truly finished surface. Obviously there's some expense and effort involved with this option.
On several occasions I've seen businesses bring in companies to grind their concrete to a polish finish. It's visually attractive and very smooth.


DHTML Drop Down Menu

Question: I need to generate Dhtml menus. but i want to use a tool.
does anyone know what FREE tool should I use?
I used CoffeeCup Dhtml menu builder but i does not compatible with IE.
Comment: There's lots of Google matches for `DHTML menus`. Pick the one you like. I don't use them, so I can't advise. I prefer jQuery nowadays for this sort of thing.
Answer: http://www.dynamicdrive.com/dynamicindex1/

DHTML Drop Down Menu


Does an accidental enemy death count as a kill against the PEACE WALKER achievement?

Question: Does an accidental enemy death count as a kill? Specifically, if I tranq an enemy then he dies as a result of the action of another party (someone else shaking the bridge or an animal or something else), do I get a kill as a result? I'm going for the PEACE WALKER achievement for no kills.
Answer: I can't cite a source however when I played through MGS3:HD I remember that shooting the enemies on the floating crafts in the swamp/river and having them crash counted as a kill so I want to say that the design is probably generally the same. Just save often and be very careful because MGS is a sneaky, sneaky series.
Comment: No pun intended. ;D
Comment: Don't claim that pun snuck up on you.


remove keys that are present in sibling object and have a certain value

Question: I have the following input file:
{
    "dic": {
        "a": "",
        "b": "",
        "c": "",
        "d": ""
    },
    "remove": {
        "b": true,
        "c": false,
        "d": true
    }
}

I want to remove with jq all elements of the dictionary dic which are also in the dictionary remove with the value true.
This would be the output:
{
    "dic": {
        "a": "",
        "c": ""
    },
    "remove": {
        "b": true,
        "c": false,
        "d": true
    }
}

I am not sure how to do this. I would first need to clean the remove dic and only get the keys with the value true. Then I would need to somehow only delete these keys from dic.
Comment: Does it need to be using only `jq`? That can be done using `jq` and `bash`.
Comment: Bash would also be ok. But I don't want to use any other external interpreter like node or python. Just bash and jq.
Answer: You don't need anything other than JQ for that.
[.remove | path(.[] | select(.))] as $p | .dic |= delpaths($p)

Online demo
If there might be other values in remove than true and false, use
select(. == true)

instead of
select(.)

Answer: Here's a straightforward and efficient solution using jq alone:
(.remove | with_entries(select(.value == true))) as $remove
| .dic |= with_entries(select($remove[.key] | not))

Answer: That can be done using bash loops:
#!/bin/bash
# saving the json so we can manipulate it freely
data="$(cat data.json)"
for k in $(echo "$data" | jq '.remove' | jq -r keys[]) # getting all the keys from remove
do
    # skipping the key if it isn't supposed to be removed
    [ $(echo "$data" | jq .remove.$k) == 'false' ] && continue
    data="$(echo "$data" | jq "del(.dic.$k)")" # removing the key
done
echo "$data" # final json without the keys


It it okay to edit definitions in GCC "bits/g++config.h"?

Question: Specifically, I want to set _GLIBCXX_FULLY_DYNAMIC_STRING to 0 so the std::string move-constructor is declared noexcept by the library.
I changed it and my code compiles fine, however I did not find any documentation about this file anywhere. I have a bad feeling about changing internal parts of the library.
On the other hand, this file seems like it is allowed to be edited.
Is this safe to do?
Comment: _"Is this safe to do?"_ No, it isn't, that's a very bad idea! Try to use a compiler option like `-D_GLIBCXX_FULLY_DYNAMIC_STRING=0` instead.
Comment: Depends on whether you understand what it does and whether the compiler knows you've made the changes.  Generally, it is an extremely bad idea to make such changes unless it is documented somewhere that you can.  The header probably documents how G++ behaves; you changing the value may not change the compiler, but may misinform your code and lead to obscure problems.  Treat the headers in `/usr/include` and the compiler's internal header directory as sacrosanct.  Assume you will be struck by lightning if you tamper with them.
Answer: Don't change system include files. Your package manager will hate you.
Comment: Fully agreed. And worse, some of the programs you work with may stop working, because they were expecting genuine g++. And you may have troubles linking with libraries compiled without this modification...


Any reason not to ground the sheathing of MX wire?

Question: Having recently bought an older house (c1943) I am doing a little work on the place. While rewiring a light switch I noted that there is newer Romex wiring from the distribution panel to the switch, but older BX (2-conductors) wiring from the switch to the light fixture.
I now need to put in a junction box nearby to join the BX and a new length of Romex (which runs to a different appliance). This gives me a chance to connect the sheathing of the BX to the Romex ground wire (which is grounded at the distribution panel). Is there any reason not to do so?
Answer: TOTALLY DIFFERENT ANSWER FROM THE ORIGINAL:
The original answer was not complete and had some misunderstandings. I hope to clarify here.
First off, there are many types of armored cable, most of which are colloquially called "BX". By "older BX" I assume you mean something like the wire at the bottom of this image:

Two conductors, no ground wire, no bonding strip. This kind of wire is an older design predating the grounding requirement. If the wire is original to the house, it was not designed to have the armor grounded (because it's 20 years older than the NEC grounding requirement itself). It's still available (hence the newer PVC insulation and overall new condition of the wire in the picture) because there are still situations in which it can be used safely (and jurisdictions that don't care); however, your situation and location probably falls under neither of those.
It can be dangerous to use the armor of older, "non-bonded" BX cable as a ground connection because:

The armor of this older cable was never rated to transmit current, much less 15+ amps of it; if it is too thin, or the run too long, it can present high resistance to current along its length, meaning less current will flow through it in a failure situation, and so the breaker may not trip when it is supposed to.
The armor may be aluminum (in fact it is likely to be), which is highly "anodic"; where aluminum touches copper (such as your proposed join between the copper Romex ground and the armor), or iron/steel (nails/screws/pipes), or really any metal besides other aluminum, zinc or magnesium, the aluminum will corrode preferentially when given any excuse at all (humidity, salt, high temperature, electrical flux) and eventually your ground path will fail.
Continuity of the armor becomes a primary concern; if the armor is damaged, its continuity can be reduced or destroyed. This can be problematic when the primary purpose of the armor as designed was to take a beating.
Aluminum, when an electrical current passes through it, heats up more than copper. In a sustained failure situation that doesn't pop a breaker/fuse, this could end up being a fire hazard, especially if there is increased resistance due to damage at any point in the armor.

It's possible, and it may even be likely, that you'll never have a problem, but electrical codes are extremely pessimistic for a reason. When "possible" takes another job on Murphy's side, and "likely" don't want to come in to work that day, that's the day you have a problem.
Nowadays, type AC cable (modern "BX") looks more like the following:

Notice the bare wire. This type of cable is designed specifically to have its armor and this "bonding strip" form the ground path in combination. You do still have to be careful about what you connect it to:

The bonding strip may still be aluminum, as in the picture (though copper-bonded AC cable is available); if so, it should not directly touch any copper or steel. You should instead ground the J-box (typically galvanized or zinc-plated steel; the zinc coating in either case protects both the steel and aluminum from galvanic corrosion) through the wiring clamp by bending the bonding strip backwards so it's also held by the clamp, then attach the copper wire somewhere else in the box (there are usually other attachment points in the J-box for just this purpose).
The bonding strip is 16AWG, because it's designed to complement the armor; if the armor is fully compromised at any point along its length, however, the bonding strip is all that's left, and it's 2AWG smaller (and aluminum provides more resistance) than the minimum gauge of copper wire rated for 15A.

This all just means you should be careful when installing it, to make sure that you don't abuse the armor or create a galvanic cell in your J-box. You also must not install this wire in any location where water could be an issue; instead, you should use a Type MC cable with a PVC outer jacket. However, if installed properly, this type of wire is perfectly safe.
Looking at the first image again, the middle cable is an example of non-bonded, grounded BX, known in the NEC as type MC (though newer MC has an extra PVC jacket between the conductors and armor; it's basically armored Romex). Because it doesn't have a bonding strip, the armor of this cable should not be used as ground. Instead, the green wire (in the image it's a very blue-green) should be used as the ground connection. MC severs these two responsibilities; the armor is there to take abuse, the ground is there to add electrical safety to the circuit.
Comment: -1 Advising not to ground a BX cable is not a responsible answer! NEVER, EVER is it okay to leave a BX cable sheathing ungrounded! If that cable sheathing ever becomes energized, and is touching ductwork, plumbing, gas pipes, etc. as you say, a grounded system will trip the circuit breaker and protect the homeowner. That is how the system is designed to protect. If you left it ungrounded anything touching the cable will become live! Possibly going unnoticed until a victim comes along! The Romex gets bonded to the metal box with a bonding screw, the BX cable is bonded through the box connector.
Comment: I have to agree.  A HUGE point of the sheathing is to BE THE GROUND.  The potential energizing of ductwork, gas lines, etc. is a risk if the bx is NOT GROUNDED.  If the BX *IS* grounded, then the other lines won't energize because the charge will go to the ground, as designed.
Comment: @wallyk: No, no, and no. First, fuses/breakers are "slow-blow" for a reason; you don't want a fast trip for a simple overload. It can take up to a second for a circuit breaker to break at its rating. Second, as I said, energizing grounded armor may not *ever* cause the breaker to trip, if there's enough resistance between the short and the bus strip that less than 15A is flowing. It's the same reason house plumbing is no longer an acceptable ground; it may well be grounded, but real ground can only absorb so much current.
Comment: Lastly, think; what would the cable be dissipating that heat *into*? It's rare, but failures energizing older BX can make the stuff glow red (without popping a fuse, as we've covered). The BX would be clamped to wooden structural members, not far from paper-backed insulation. Expecting older BX to do the job of newer AC/MC cable is asking for a house fire.
Comment: @wallyk: The ridges in BX cable cause considerable [inductance](http://en.wikipedia.org/wiki/Inductance) *(which, if you're not familiar with it, is like resistance that only resists AC current)*.  Because of this, a ground-fault to grounded BX cable could cause a low enough current that the breaker does not trip at all, leaving the device-frame electrically-charged while the BX cable heats up.  That is why modern BX cable has a bonding strip *(which is basically a separate grounding wire)* to eliminate the inductance, which allows it to act as a sufficient ground.
Comment: *"The cable may contact ventilation ducts, plumbing pipes, even gas pipes"* - All of those things are *supposed* to be grounded anyways...
Comment: What I was trying to say was not clearly communicated, and there is also a difference between "true" BX-class cable and what's normally used now (aka MC). I cannot delete this answer and start over, so I am editing.
Comment: Perhaps the biggest omission of info in the last revision is that I assumed, due to the age of the house, that the BX was non-bonded. The OP infers this is not the "type AC" cable you are familiar with today; it has nothing identifiable as a "ground wire" or "bonding strip". This type of cable dates back to the turn of the last century, and if original to the house, was installed almost 20 years before grounding of receptacles became a code requirement. As such there is no rating nor guarantee that the armor will withstand current and in fact it can be a fire hazard to try.
Comment: The current capacity of the armor is irrelevant.  It only needs to conduct for a few A.C. cycles to trip the breaker, for a non-dead short, it has lots of surface area so it will dissipate heat well, and it is a much better conductor than a human and tends to eliminate electrical shock hazards.
Comment: @KeithS: For a load fed by a conventional breaker, I agree that BX cable would be insufficient as a ground path.  What if the breaker is a GFCI or AFCI?  Is there any way the BX could pass more than 25mA for a sustained period without causing the GFCI or AFCI to trip and kill power?


javascript: constructor function vs revealing module pattern for single use

Question: I have come to understand that constructor functions can be instantiated to create new objects in javascript which has its own _proto_ property and also giving the property 'prototype' to the constructor function.
function MyController() {
    var controllerName = 'initialcontroller';
    function init() {
        console.log(controllerName);
    }
    this.init = init;
}

Here, init can be called like this:
var mycontroller = new MyController();
mycontroller.init();

Supposing I am only instantiating only once and never again, isn't this an overkill if I don't intend to use all the prototype properties being provided by the MyController.prototype ?
Question: Instead, can i not code like this using the revealing module pattern?
var myController = function() {
    var controllerName = 'initialcontroller';
    function init() {
        console.log(controllerName);
    }
    return {
        init : init
    }
}();

Here, init can be called like this:
myController.init();

In this case, if I try to access any property inside myController that is not present, the javascript engine won't try to find whether the property exists anywhere in the prototype chain, thus saving my time.
Or is there any other advantages of instantiating a function that i am overlooking?
Comment: Yes, you can code like this using the revealing module pattern. It's perfectly valid js.
Also, shorter codes, I guess.
Answer: If you simply want a "singleton"-like object with some methods and other properties, you could  just use an object literal to simplify things even more:
var myController = {
    init: function (foo) {
        // do something with foo or whatever
    }
}

myController.init("bar");

Or - if you need some "private" internal state, use the regular revealing module pattern:
var myController = (function () {
    var internal = "i am private";
    return {
        init: function () {
            // blah blah
        }
    };
}());

myController.init();

About the prototype lookup time: Yeah, theoretically, the lookup traverses up the prototype chain when you're trying to access a non-existing property. Theoretically, this might be a tiny bit faster for plain ol' Object instances that have "no" specific constructor. In reality, this performance impact should be quite negligible. Don't attempt to optimize here unless you REALLY need it. :)


Karate feature file + calling Java class with spring annotations, getting PolyglotException

Question: I have some classes having Java code with spring annotation, however its observed when we call them from .feature file, getting org.graalvm.polyglot.PolyglotException. When removed those annotation it worked. Now we have my libraries which use such classes, so can anybody help on same how to invoke spring flavoured classes from feature files.
Answer: Please note that re-using "production" objects in your test-suites is a common mistake, please don't do it. Because the risk is that when you re-factor some Java classes, you will never know if it really breaks some API consumers.
You can assume that what you are trying to do is not supported by Karate. If you follow this process, others will be in a better position to suggest a workaround: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue
Comment: Thanks Peter, by the way nice work Karate is awesome and hope it gets more mature as time passes. Keep the good work going and all the best. I will be filling issue in above mentioned link.


Dwarf stuck on an upper level while building a wall

Question: I am building a wall on a higher level on another wall that exists in the lower level. My dwarf is now stuck on the upper level, how to remedy that?
Answer: You can either deconstruct walls (d - n, I believe?) until he can get free, or alternatively, build scaffolding up to him -- up/down stairs work well and can easily be stacked.
Answer: This is a fairly common problem when building tall structures and I haven't found a solid way to prevent it. In my experience, dwarves appear to ignore designated construction and don't always build in a "smart" order.
Probably your best bet is building temporary ramps, stairs, or other "scaffolding" systems up to the dwarf so he or she can get down and other dwarves can finish whatever other construction needs to be done up there.
The other option is to designate your wall building one tile at a time, waiting for each wall section to be built before placing the next. I can think of cases where either option would be the lesser of two evils.
Comment: There is a pretty easy way to prevent it -- build your corners first! And remember, dwarves can only construct in the 4 cardinal directions.
Comment: @RavenDreamer "Build corners first" might work for some floor plans, but certainly not all.
Comment: @Javadoc -- the only floor plan I can think of where it *doesn't* work is when you're building a 1-tile-wide wall above the 1st z-level, in which case, I'd recommend up/down stair scaffolds.
Comment: As would I, although the ideal solution would be dwarves that could prioritize construction themselves so that no one gets trapped in the first place. (Not that I'm holding my breath.)
Comment: Smart dwarves? In *my* dwarf fortress?
Comment: @RavenDreamer: Actually, dwarves can build on the diagonal, they just can't build on the diagonal through two walls. FREX (using the numbered example from my answer) if there is a wall at 2, and an accessible floor at 5 a dwarf can and will build something at the X. If there were walls at 1 & 3 he could not build from 5 however.
Answer: Prevention is the best option and there are several things you can do:
1) Know how dwarves like to build (1 is the favorite spot to build if X is the building):
<code>537
1X2
648
</code>
2) Build corners first.
3) Dwarves generally prefer to avoid standing in a queued construction. Where possible you can designate a wall/building and then Suspend the building, canceling construction after the real construction is finished.
4) Sometimes you have to build a temporary floor, or a quick staircase.
Comment: Although I hear people say #3 all the time, this has never worked for me.
Comment: A little testing suggests this is not true in the latest version. I'm pretty sure it was true in 40d though.


Mule Http Listner getting url parameter values

Question: <flow..>
    <http:listener-config name="HTTP_Listener_Configuration" host="${http.hostname}" port="${http.port}" basePath="${http.base.path}" doc:name="HTTP Listener Configuration"/>
    <http:listener config-ref="HTTP_Listener_Configuration" path="store/*" doc:name="HTTP"/>
    Old http end point

    <apikit:router config-ref="store-api-config" doc:name="APIkit Router" />
</flow>
<flow name="get:/rates/search:smartstore-api-config">
     <logger message=" #[message.inboundProperties['referenceDate']]" level="INFO" doc:name="Log Request"/>
</flow>

When I try to invoke the url, I am getting null value in logger. If I enable old http end point point it is working fine.

http://localhost:8899/apis/myapp/myrates/search?referenceDate=2015-01-01

I have tried with this link, but didnot work.
Answer: 1) #[message.inboundProperties.'http.query.params'.referenceDate]

2) #[message.inboundProperties.'http.query.params'.get('referenceDate')]

3) #[message.inboundProperties.get('http.query.params').get('referenceDate')]

Answer: try to use this line of code it works properly using MEL
#[message.inboundProperties.get('http.query.params').get('referenceDate')]

also you can set this value inside a variable and handle it in any way you want
Answer: When it comes to Java, to you read parameters like:
eventContext.getMessage().<Map<String,Object>>getInboundProperty("http.query.params").get("yourParam");
Hope it's usefull.


Microservices Api gateway and Identity Server 4 kubernates

Question: I have microsevices and SPA app. All of them run on docker with docker compose. I have ocelot api gateway. But gateway knows  ip address or container names of microservices for reaching .  I add a aggregater service inside ocelot app. And I can reach to all services from aggregator service with ips.
But I want to move kubernates. I can scale services. there is no static ip. How can I configure .
I have identity service. This service knows clients ip addresses. Again same problem.
I searched for hours. I found some keywords. Envoy, Ingress, Consul, Ocelot . Can someone explain these things ?
Answer: It sounds like your question is related to Service Discovery.
In Kubernetes, the native way an "API Gateway" is implemented, is by using Ingress resources and Ingress Controllers. If you use a cloud provider, they usually have a product for this, or you can use a custom deployed within the cluster.
Service Discovery the Kubernetes way, is by referring to Service resources, e.g. the Ingress resources maps URLs (in your public API) to services. And your app is deployed as a Deployment resource, and all replicas (instances) is exposed via a Service resource. An app can also send request to other apps, and it should address that request to the Service resource for the other app. The Service resource does load balancing to the replicas of the receiving app.
Comment: yes. Envoy is a proxy. Istio is a Service Mesh product that uses Envoy as a proxy. Consul can aslo be used as a Service Mesh product. Ingress is a kubernetes resource and an Ingress Controller is needed if you use Ingress resources. You may use an "ingress gateway" from a Service Mesh. I don't think your app need to use Ingress resources if you use a Service Mesh. It is easier to start with Ingress, and then move to Service Mesh after that - it is more complex.
Comment: I made some research.I found istio. What is differences between envoy,ingress, istio , Consul? Can you explain shortly please ? Im sorry. Maybe one of them an apple and another is pear I dont know.
Answer: you can use the service name to connect with the service instead of the client IP.
<code>for example : curl HTTP://<service.name>.<namespace name>.svc.cluster.local
</code>
now if you are looking forward to list of API gateway and Identity server for Kubernetes
there are several options however it all depends on requirement.
For basic requirement nginx ingress and other ingress is available while if you are looking for API gateway :

Kong APi gateway
Ambassador api gateway
TYK API gateway

part of that service mesh can be also useful not in all scenario because it's mostly used for managing internal traffic (east-west).
API gateway is mostly used for managing edge traffic.
List of identity servers :

keycloak
Cognito IAM (AWS)

ingress controllers :

GCE ingress
Nginx ingress controller
Kong ingress controller
Gloo
HA proxy
AKS gateway
istio ingress


C# LinkedList<> remove by index

Question: Given a:
LinkedList<int> myList;

How would I remove an element at index n?  I can't seem to find any methods, only ones to remove by value which is no good as this particular list can have duplicate values.
EG:
myList.removeAt(n);

Comment: That's basically how you can tell that you should not use LinkedList.  Use List instead.
Comment: @RandRandom hey always learning - thought LinkedList data structure specifically was meant to offer better performance for randomly shuffling items around than a data structure backed by an array
Comment: @HansPassant understood, but in this list I need to be able to move items around as I wish - I thought linked list offered better performance for this.
Comment: Linked lists can be more efficient for removing nodes that you have an existing reference to (or at the head). Moving nodes around by index is infefficient.
Comment: Its faster for adding and removing, but it is slower at finding a specific index.
Comment: @RandRandom having 30k rep doesn't make you a master of all trades, I have seen plenty of excellently answered questions from users with less than 1k rep, I have also seen plenty of fairly simple questions from users with more than 50k rep on topics they arent that familiar with. I believe thats why the rep system is fairly flawed.
Comment: I think this link would help.
https://stackoverflow.com/a/582210/3064448
Answer: Linked lists have great advantage in speed if you are adding or removing a node you have a existing reference to, but when you don't have a reference the best you can do is walk the list to the index, grab the node, then delete it.
Here is a extension method that does that process. It returns a reference to the removed node in case you want it later to insert to some other list or you are moving it's position within the list.
public static class ExtensionMethods
{
    public static LinkedListNode<T> RemoveAt<T>(this LinkedList<T> list, int index)
    {
        LinkedListNode<T> currentNode = list.First;
        for (int i = 0; i <= index && currentNode != null; i++)
        {
            if (i != index)
            {
                currentNode = currentNode.Next;
                continue;
            }

            list.Remove(currentNode);
            return currentNode;
        }

        throw new IndexOutOfRangeException();
    }
}

C# LinkedList<> remove by index


Why cant i combine jquery css with jquery events?

Question: i tried to make a sidebar permanently hidden until a .click eventhandler with the fade-in event until the event will be triggered, and the text of this bar should slid-down (speed of 500). Unfortunatly i tried and tried and googled lot of these functions/eventhandler? but couldnt figure it out how to make this work as wished.
and the id #about is the side bar, the id #about_me is an list item that should trigger the event, the id#about_profile is the content of the sidebar.
now back to main content, here is the code:
//second js code .css('visibility','hidden')
$('#about').css('visibility','hidden')
$("#about_me").click(function(){
    $("#about").fadeIn(500);
    $('#about_profile').slideDown(200)({

        });
    });

my second question is, why isnt this event not taking place? following code:
    $('#about').css('visibility','hidden',function(){
    $("#about_me").click(function(){
        $("#about").fadeIn(500);
        $('#about_profile').slideDown(200)({
    });
});

thank you for help
kind regards
ps: i ve searched even stackoverflows AQL(Asked-question Library)
Comment: You can't pass a function to `.css()` like that.
Comment: http://jsfiddle.net/5xYsV/3/ here is my full code ... i just gotten started with it
Answer: The jQuery .css method doesn't accept a callback, and it is synchronous, meaning it doesn't actually need a callback parameter. Your first snippet is the correct way to do this.
$('#about').css('visibility','hidden');
$("#about_me").click(function(){
    $("#about").fadeIn(500);
    $('#about_profile').slideDown(200);
});

Comment: what do you mean with snippet? (sry english isnt my mother language)
Comment: The first piece of code in your question. I'll add it to my answer
Comment: There were a few syntax problems in your first piece of code, i corrected them in my answer.
Comment: ive did... an still nothing occures.
Answer: $('#about').css('visibility','hidden');

$("#about_me").click(function(){
     $("#about").fadeIn(500);
     $('#about_profile').slideDown(200);
});

That should do it.
Comment: i added the ; to the first line but still nothing happens.
Comment: jsfiddle.net/5xYsV/3 here is my full code ... i just gotten started with it
Comment: i dont get it ... i tried .hide() and when i refreshed the page the element showed it self and disapeard... i dont understand what the failure i did there. however your version of the script doesnt seem to have the same problem as mine thanks.
Comment: Just apply display: none; to the box in CSS, that way it won't show on page load, as javascript only runs once the page has got to it (unless you do something like document ready or window load etc).
Comment: ohh i see ... ive made lots of mistakes ..thanks. after .slideDown ive added some round and curly brackets... ok thanks alot ... now i relize that jquery is a piece of hard work and patience.
Answer: Try $('#about').hide(); instead of $('#about').css('visibility','hidden');
Comment: `.hide()` = `display:none` which basically doesn't consume any space.. but `visibility:hidden` consumes the space it has.. just that it will not be seen ;)
Comment: as vega says .. i tried the .hide event but when i reload the page one can see how the element gets hidden... and i am trying to make it hidden permanently till the event has been triggered.
Comment: Right, but `show` doesn't make visible something that's been `hidden`. [Fiddle.](http://jsfiddle.net/8A8XV/1/)
Comment: If [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) is a concern, hide the element in the HTML (faster) or with CSS (better practice) using `display: none;`.
Answer: I believe that fadeIn set the display property to block and does not alter the visibility property... You may be better off using css('display', 'none') or better .hide() as someone already suggested. Docs are here: http://api.jquery.com/fadeIn/ and in the comments the "display: none" problem is mentioned.


Single Variable Calculus Fundamental theorem of calculus

Question: I'm quite lost on the following problem:
The function $f(x)$ is:
$$f(x)=\int_0^{g(x)} \frac {1}{1+\sin(t) + e^t} dt $$
where $g(x)$ is
$$g(x)=\int _{-x}^{x^2} h(t) \, dt $$
And $h(t)$ is odd such that $h(1) = 2$. Find the equation of the tangent line of $f(x)$ at $x=1$.
Please help.
Comment: Do you know in general how to compute the tangent line at a point?
Comment: Yes, I know that!
Comment: You seem to know that you need the FTC, so it appears this will ultimately involve you plugging in a certain function into another and computing a composition.
Comment: Hint: you just need to find $f(1)$ and $f'(1)$. The former is easy because $h$ is odd, and the latter can be computed with help from Mhenni Benghorbal's answer.
Comment: Oh I see!! thank you so much!
Answer: Here is your tool (Leibniz integral rule)

$$ \frac{d}{dx}\int_{g(x)}^{h(x)}f(t) dt=f(h(x)) h'(x)-f(g(x))g'(x). $$
Comment: Thank you for providing the requested information.
Comment: @ZellAllon: You are welcome.
Answer: Let $F$ be the antiderivative of $m=\frac{1}{1+\sin t+e^t}$, then by the fundamental theorem of calculus:
$f(x)=\int_0^{g(x)}m(t)\,dt=F(g(x))-F(0)$, then the tangent line of $f$ is given by $f'$, so:
$f'(x)=\frac{d}{dx}(F(g(x)-F(0))=g'(x)F'(g(x))$
$g'(x)=\frac{d}{dx}(H(x^2)-H(-x))=2xh(x^2)+h(-x)$ ($H$ is the antiderivative of $h$)
so $f'(1)=g'(1)F'(g(1))=(2h(1)+h(-1))\large(\frac{1}{1+\sin(g(1))+e^{g(1)}})$
$=(2h(1)-h(1))(\frac{1}{1+\sin(g(1))+e^{g(1)}})=2(\frac{1}{1+\sin(g(1))+e^{g(1)}})$
Now $g(1)=\int_{-1}^1h(t)dt=0$ because $h$ is odd.
so $f'(1)=1$
Comment: Thank you for providing the requested information.
Answer: To find the line tangent to $f(x)$ at $x=1$ we must find $f(1)$ and $f'(1)$.
Starting with $f(1)$:
$$f(1)=\int^{g(1)}_{0}\frac{1}{1+\sin t+e^t}dt$$
Proceeding to compute $g(1)$, we have
$$g(1)=\int^{1}_{-1}h(t)dt$$
Since we know that $h(t)$ is odd, we know that $-h(t)=h(-t)$, so any integral of $h$ symmetric to the origin will be $0$. Hence $g(1)=0$. Returning to $f(1)$ we see that
$$f(1)=\int^{0}_{0}\frac{1}{1+\sin t+e^t}dt=0$$
Now turning to $f'(1)$, by the Fundamental Theorem of Calculus we have
$$f'(x)=\frac{g'(x)}{1+\sin g(x) + e^{g(x)}}$$
so
$$f'(1)=\frac{g'(1)}{1+\sin g(1) + e^{g(1)}}$$
Since we already know $g(1)$ it remains only to compute $g'(1)$. We see that
$$g'(x)=2x\cdot h(x^2)-(-1)\cdot h(-x)$$
by the FTC. Then, again remembering that $h$ is odd and that $h(1)=2$,
$$g'(1)=2\cdot h(1)+h(-1)=2\cdot2+(-2)=2$$
Having computed all the required values, we see that
$$f'(1)=\frac{2}{1+\sin 0 + e^{0}}=\frac{2}{2}=1$$
Now the tangent line to $f$ at $x=1$ is of the form $y-f(1)=f'(1)(x-1)$. Thus
$$y=x-1$$


(Unity) Your app currently targets API level 30 and must target at least API level 31

Question: Today I got following warning from Google Play "Your app currently targets API level 30 and must target at least API level 31 to ensure it is built on the latest APIs optimized for security and performance."
How can and where I should specify target API level? To be honest I didn't specify anything. I just recently moved from Unity 2018 to Unity 2020 and got following warning.
How can it be fixed? Thank you in advance
Answer: First of all, always ensure you are using the latest stable build of unity. Older versions may not have the new API levels required for the latest android versions.
Then go to:
Edit -> Project Settings -> Player -> Other Settings
If you have selected Android as the Build Platform:
Under the Identification, there will be a Minimum API Level and Target API Level.
Set the Target API Level to automatic, which will be the highest installed. If you won't have an API Level such as 31, it means you need to upgrade your unity version or install the API level manually.
Comment: Is it possible to add API level manually to unity 5, bcz it only supports level 28 and to upgrade the project to the latest unity LTS version would mean loosing alot of assets and vfx. So is there a way to upgrade the level to 30 without the need to update to the latest LTS?
Comment: Ben, thank you very much for your answer. Can you have a glance on this screenshot?
https://i.postimg.cc/QMRJNcmm/api.gif

Does it mean that API 31, API 32, API 33 aren't installed and they are just mentioned in the list?
Comment: Yes, they are installed certainly, make sure the second drop-down, the target API aims at the highest possible. However, if that still does not work, it means that there must be an issue with the build itself. Maybe the aab file is not working, or the build is in the development mode.
Comment: No this is wrong form the image posted by @Richard you can not know if API 31, API 32, API 33 are installed. If they are not and you start a build process unity will try to install them.
Comment: Same error here, Hace the same image than Richard, but API 31,32,33 doesn't compile. Setting the Automatic mode doesn't work either. It only works with API 30...
Answer: if you have android studio or unchecked the ticks that Unity handles the android SDKs automatically you need to check these two folder
C:\Users\username\AppData\Local\Android\Sdk\build-tools
C:\Users\username\AppData\Local\Android\Sdk\platforms
unity has issue with sdk API 31+ (32 and so on...)
unity will download build-tools based on target sdk on player settings, if you set to automatic, it will download highest version (33 right now), which is problematic,
set target sdk to 31
or set the Target API Level to automatic, unity will search build-tools folder automatically for highest version which you need to remove any 31+ if unity has downloaded before.
if you have android studio targeting 33 for android build u must cut it to desktop and put it back for ur android build.


Jqgrid in jquery ui tabs

Question: I have a custom button for my jqgrid that when pressed takes me to another view.
But for some reason when i navigate between the tabs there is an extra added custom button every time a re-visit that tab. Is there a way to say only to add this button once?
This is the markup:
$('#tabs').tabs( {
    show: function (event, ui) {
        if(ui.index == 0) {
           Show some content on this tab.. Not important.
        }

        if(ui.index == 1) {
            $("#functionslist").jqGrid({
                datatype: 'json',
                url: '/Admin/GetFunctionsList',
                colNames: ['Namn'],
                colModel: [
                           { index: 'FunctionName',
                             name: 'FunctionName',
                             width: 100,
                             sortable: false
                           }
                          ],
                 rowNum: 20,
                 prmNames: { sort: 'SortColumn', order: 'SortOrder', page: 'Page', rows: 'Rows', search: null, nd: null },
                 hidegrid: false,
                 pager: '#functionspager',
                 autowidth: true,
                 shrinkToFit: true,
                 height: '100%',
                 caption: 'Functions',
                 viewrecords: true,
                 onSelectRow: function (id) {
                        window.location.href = '/Function/Edit/' + id;
                 }
             }).jqGrid('navGrid', '#functionspager', { edit: false, add: false, del: false, search: false, refresh: false })
             .navButtonAdd('#functionspager', {
                 caption: '',
                 title: 'Create new function',
                 buttonicon: 'ui-icon-plus',
                 onClickButton: function () {
                     window.location = '/Function/Add/';
                 }
             }); .... and so forth....

Everything runs fine and i have the behavior i desire but for some reason when i navigate between the two tabs more and more custom button are added. Any ideas why, have tried to resolve this but with no luck.
/Daniel
Answer: Why not check to see if the button already exists before adding it?
 if ($('#functionspager :has(".ui-icon-plus")').length == 0) {
     $("#functionslist").jqGrid('navGrid', '#functionspager', { edit: false, add: false, del: false, search: false, refresh: false })
         .navButtonAdd('#functionspager', {
            ...
          });
 }

Answer: The call $("#functionslist").jqGrid({/*parameters*/); convert the empty
 to a grid having columns, capture, pager and so on. You should make the call once and not repeat it on every tab activation.
Exactly in the same way the methods navGrid and navButtonAdd should be called only once.
So you should decide what should be done if the user select the tab having jqGrid. You can for example call
$("#functionslist").trigger('reloadGrid', [{current:true}]);

(see here for details)

Jqgrid in jquery ui tabs


Dictionary in android resources

Question: Is there a way to use dictionary in android resources. I couldn't find anything in String.xml file about dictionary and searchable file has many other fields that I don't need.
Edited: in C# and visual studio we can add dictionary to the resources as well as string or int, however, I couldn't find any option for adding dictionary to the resources and only string and string array or integer are available on android resources.
Comment: @ jitendra sharma : I edited the question.
Answer: maybe it`s late to answer here but you can use something like this:
res/strings.xml
<code><string-array name="tags">
   <item>KEY_A:Some string value 1</item>
   <item>KEY_B:Some string value 2</item>
   <item>KEY_C:Some string value 3</item>
</string-array>
</code>
Here, the ":" symbol stands for delimiter between key - value pairs in string array.
And then somewhere in code(e.g. onCreate()):
<code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    String[] tags = getResources().getStringArray(R.array.tags);
    for(String tag : tags) {
        String[] pair = tag.split(":");

        String key = pair[0];
        String value = pair[1];

        // do whatever you want with key and value
    }
}
</code>
This approach is good if you have simple data for more complex data better to use res/raw files with json objects, as described by other guys above.
Answer: There is no such a resource type. You have to put an arbitrary file in res/raw/ and import it manually in a HashMap.
Comment: To open these resources with a raw InputStream, call Resources.openRawResource() with the resource ID, which is R.raw.filename. (http://developer.android.com/guide/topics/resources/providing-resources.html)
Comment: how can I access the file in res/raw?

Dictionary in android resources


Create new Minecraft server using existing map/world and RandomSeed?

Question:
Possible Duplicate:
Is it possible to turn a Minecraft single player map into multi-player server?

Problem

I want to create a new Minecraft Server using Bukkit.
I have an old world that I want to be part of the new world. So I edited the old one with MCEdit, i.e. surrounding it with Bedrock and creating new chunks far from that old world and moving the spawn point there.

Questions

Copy existing "world" to new Server: Is it correct to copy a "world"-folder and only deleting the "players"-folder in it? Or do I have to adapt more than that to have a properly functioning world afterwards?
Random Seed: In the resulting world, I do not want to have any limitations of world generation because I flicked something together there. In MCEdit I can change the RandomSeed number. Is it of any importance that this number is the same like the one in the "server.properties"-file of the new Server will be? (In MCEdit I create the "start" of the new world, far away of the old. This will only be one to a few chunks.) When leaving RandomSeed in server.properties blank, it will use different Seeds every time, right? Than it would be no problem I guess.
World generation: Because I take the old world, generated with an older Minecraft version, as a starting point, will this limit the world generation in newer Mincraft versions? Does the world folder somehow contain generation parameters apart from the RandomSeed so even with a newer Minecraft version the world is still generated like it would be in the old version?
Comment: Possible Duplicate: http://gaming.stackexchange.com/questions/20692/is-it-possible-to-turn-a-minecraft-single-player-map-into-multi-player-server and http://gaming.stackexchange.com/questions/30130/how-does-minecraft-1-8-handle-saves-generated-in-previous-versions
Answer: Please see this question for information on how to copy a world from singleplayer to a server
If the world was generated in an older version of Minecraft, due to changes in the terrain generation, new chunks will not line up correctly, as shown in this question


How do I repair a leak in my roof?

Question: I'm dealing with a water leak issue after the recent ice storm. Noticed dripping around my sliding door jam and the crease where the ceiling meets the wall. I've cut a 4" square hole to drain water, but I can't access it through the attic crawl space due to fear of falling through the ceiling. I suspect it's from an ice dam on the roof.
Any advice on immediate steps and what type of professional handles repairs?
Comment: A roofer will be the best, a general contractor will also work.  Leaks need to be fix where the water is coming from, not from where they show in the inside.  The attic will only point where the leak is, but needs fixing from on top/outside.
Comment: That looks like an Answer, @crip659. (I have a roofer starting work tomorrow redoing some flashing, replacing most of the fascia boards, and putting up new and better-designed gutters; if I'm lucky that will solve my leak. If not we'll have to do exploratory surgery to try to find the actual path of water flow.)
Comment: @keshlam   Finding the actual leak is the biggest problem with roof leaks, since water will travel before dripping down.
Comment: For what it's worth, the leak I'm now having repaired turned out to be rotted siding on a gable-end wall. Putting up fresh cedar shakes on that one area is setting me back about $20k; cedar is durable (the stuff being removed is probably 100 years old) but not cheap. While I've got the guys on site I'm throwing another $15k into replacing soffit boards and gutters which also need work.
Comment: "A boat is a hole in the water that you throw money into. A swimming pool is a hole in the ground that you throw money into. A house is a hole in the air that you throw money into."
Answer: Sounds exactly like an ice dam.
Ice dams happen when the roof is warmed by the house, snow melts and seeps between the shingles, the re-freezes and expands, creating a water path.
The first thing you need to do is to stop the dam. If you have the means (eg a roof rake), remove all of the snow from the roof. The snow is the source of new water.
A roofer should be able to remove the ice dam -- it really depends on your roof configuration, but the usual way is to cool the attic (e.g. with a fan) to freeze the water, then melt the ice dam from the outside. If you are lucky and get a warm day, the roof will dry by itself. Then just keep the snow off the roof for the rest of the season. Once the emergency is over, you have two options:

get your attic insulated and ventilated properly so that the roof remains frozen throughout the winter or

remove all snow from your roof as soon as it falls.
Comment: Attic ventilation is important also.  We only had gable end vents and had icicles all the time.  Added ridge vent with new roof and no more icicles.
Comment: @crip659 True. I added that.
Comment: @crip659 do you have soffit vents too?
Comment: @FreshCodemonger  Always had the soffit vents.  I imagine the ridge vent increased air flow over the two small gable vents or maybe the changed in direction from N-S to more W-E.  The soffits are W-E
Comment: @crip659 I did the same except I sealed my gable vents.  The airflow ideally should be from the soffit flowing up the underside of the roof sheathing to cool the shingles in the summer, the gable vents short circuit that airflow path.

How do I repair a leak in my roof?


Is there anyway to fix a bugged quest?

Question:
Possible Duplicate:
Help, the next quest would not come up after iv don the reavealing the unseen please help

The quest I am to do is to find the archmage but he is dead and the other people at the college will just go on as normal.
Comment: You already asked a question about this quest...
Comment: Nobody helped me on that one..
Comment: You may not receive an answer right away.  There is one answer to the question.  If that answer does not help, try adding more information.  Creating duplicate questions will not help you get an answer faster.
Comment: Well sorry, are you ok?
Answer: Are you doing the containment quest by any chance?  The archmage is supposed to be dead at that point.  What you have to do is continue into winterhold (the town), and find the anomalies that you need to defeat.
Comment: Yes, i did go to the town but found nothing:(
Comment: @dudegjersvik if you are on the PC, open up the console and type in: setstage MG05 50
Comment: And the quest containment would not come up as a quest..
Comment: I typed setstage MG05 50. Then it comes item "mag05" not found for parameter quest
Comment: its MG05, not MAG05
Comment: Miss cliked, ment MG05

Is there anyway to fix a bugged quest?


Series equal to e

Question: I'm having trouble convincing myself why
$$\sum_{k = 0}^{\infty} \frac{k}{k!} = e.$$
As I was under the impression that only
$$\sum_{k = 0}^\infty \frac{1}{k!} = e$$
by definition.
By writing out terms of the first series
$$\sum_{k = 0}^{\infty} \frac{k}{k!} = 0 + 1 + 1 + \frac{1}{2!} + \frac{1}{3!} + \frac{1}{4!} + ...$$
Shouldn't it then be $1 + e$, not just $e$?
Thanks!
Comment: Why? $0+1+1+\frac12+\frac16+\ldots=1+1+\frac12+\frac16+\ldots$
Comment: Note that the first two terms of $\sum_{k=0}^\infty \frac{1}{k!}$ are $\frac{1}{0!} = 1$ and $\frac{1}{1!} = 1$.
Comment: https://math.stackexchange.com/questions/1711318/show-sum-k-1-infty-frack2k-2-mathrme    https://math.stackexchange.com/questions/576976/evaluate-the-series-lim-limits-n-to-infty-sum-limits-i-1n-fracn22
Answer: Since $\frac 0{0!}=0$, we have
$$\sum_{k=0}^\infty\frac k{k!}= \sum_{k=1}^\infty\frac k{k!}=\sum_{k=0}^\infty\frac {k+1}{(k+1)!}=\sum_{k=0}^\infty\frac 1{k!}=e.$$

Series equal to e


Why hover colors are often inverted

Question: Recently I see more and more websites using color invertion as a hover visualization. For me it's really annoying as I usually start to read the first few words and than hover over the line to have a visual/kinesthetic feedback in which line I am. So I hover over and it gets inverted ... which takes a few miliseconds to adapt to the new font color.
I guess this is coming from the selection color from Windows (and maybe other operating systems). But why? Only because of the better contrast?
Comment: Hover isn't selection, so are you objecting to the inversion in and of itself or to the inversion on hover? Maybe the hover colors would be better if a toned down (less saturated) version of the selection colors?
Comment: You are right - the title was wrong. I claim the inversion on hover. I prefer saturated colors too, but multiple sites start to use inversion on hover and I'm asking if this is just bad design or something on purpose?
Answer: The Selected state is the "opposite" of the Unselected state, and it's often important to let users identify selected items at a glance. "Reversing" the colors — using the background color for content and the content color for background — achieves this very quickly.
Also, inverted colors have been available almost as long as we've been putting text on screens, so it's a natural:
Comment: After writing this answer, the question was changed to address *hover* highlighting. Inverting on hover is a bit excessive. Typically, the purpose of hover highlighting is to indicate that the element can be clicked (and possibly selected). Hover highlighting should "intensify" the hovered element within the color palette of the site, indicating that it is an active element.

Lately, with the advent of "flat design," this kind of helpful user cueing is being lost in the interest of … I don't know, probably "simplicity."
Answer: Two things:

It looks nice
It helps identify elements that are important or selected. It's far much easier to see

this

than " > this"
Answer: You could use a fade-in or fade-out fx.
Why inverted?

Clearly stand out from the unselected.
Keep the same colors (eg, red and white -> white and red), so it is understood that belong to the same context.

Not always are reversed, sometimes only the background is changed. But the problem may be that changing the background visibility can decrease (for example white background and red letters -> orange background).
Comment: Fade out is quiet a bad idea depending upon the horizontal real estate of list item. Even a simple movement in screen will perform fade in/out action. So user has to move his mouse pointer to neutral area every time to see all list items at a glance. This solution causes bigger problem than inverting colors.

Why hover colors are often inverted


Error installing Gerix Wifi Cracker Xubuntu 14.04

Question: I tried installing Gerix Wifi Cracker. Everything is going great until the last step where I'm supposed to install it by typing:
sudo dpkg -i deb.deb

I then get the following error message:
dpkg: error processing archive deb.deb (--install):
 unable to open file '/var/lib/dpkg/tmp.ci//.svn': Is a directory

I've only been using linux for about a week and would appreciate any kind of help!
Edit: I followed the guide that was on here How to install Gerix-Wifi-Cracker?
Comment: You should read the whole guide and the comments. There is a link in the comments: https://lkubuntu.wordpress.com/2011/06/29/easy-way-to-fix-dpkg-svn-error/
Answer:
Open a terminal
Download your deb again. eg:
cd
wget http://www.clshack.it/nopaste/gerix-wifi-cracker-ng-2.0-bt7.deb

Download the package
sudo apt-get install dpkg-dev

Create a temporary folder
mkdir ~/deb$$

Make a copy of the deb file
cp gerix-wifi-cracker-ng-2.0-bt7.deb ~/deb$$

And use this commands:
cd ~/deb$$
dpkg-deb -x gerix-wifi-cracker-ng-2.0-bt7.deb deb
cd deb
dpkg-deb -e ../gerix-wifi-cracker-ng-2.0-bt7.deb

Create the file
nano ../svn.sh

Add this code
#!/bin/bash
# SVN Emergency Fix
function rdirls() {
    for i in $1/*
    do
        if [ -d "$i" ]
        then
          echo $i
          rm -rf $i/.svn
          rdirls $i
        else
          echo "NOT " > /dev/null 2>&1
        fi
    done
}
if [ -d "$1" ]
then
  echo $1
  rm -rf ./.svn
rdirls $1
fi

Save and close
Use this commands
chmod a+x ../svn.sh
../svn.sh .
cd ..
sudo dpkg-deb -b deb
sudo dpkg -i deb.deb

Source
Answer: To install software you need to use:
cd directory

sudo dpkg -i package_name.deb

Make sure you are in the proper directory as well
Comment: Copy and paste your code and error message if that doesn't answer your question
Comment: I followed the guide that was on here http://askubuntu.com/questions/379574/how-to-install-gerix-wifi-cracker
Comment: Did that work for you?
Comment: Sorry for being unclear. I follwed that guide and at the last step my error occured. I've been following that guide all along @Shane