text:
Q: How to setup a WLAN interfaces with one for Hotspot? So I'm trying to setup a two interfaces for two wireless cards. One card for connecting to wireless network an one for a hotspot to access this computer through SSH. I need wlan0 for WI-FI connection and wlan1 for hostapd hotspot.
I was trying to do it myself but I don't have enough information for this yet.
So my /etc/network/interfaces look like this:
#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.

# Local
auto lo
iface lo inet loopback

# Ethernet
#allow-hotplug eth0
iface eth0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4

# Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid Zelkow177
wireless-key werabartekagataS
wireless-mode Managed
wireless-power off
wpa-ssid Zelkow177
wpa-psk werabartekagataS
#dns-nameservers 8.8.8.8 8.8.4.4

#Wifi 2

auto wlan1
allow-hotplug wlan1
iface wlan1 inet dhcp
#dns-nameservers 8.8.8.8 8.8.4.4

#Bridge
#Work in progress

And my hostapd.conf looks like this:
### Wireless interface wlan1 ###
interface=wlan1

### Bridge br0 ###
#bridge=br0

### Driver ###
driver=nl80211

### Country code ###
country_code=PL

### SSID ###
ssid=DietPi

### Hideing SSID ###
ignore_broadcast_ssid=0

### WPA ### (WPA=1, WPA2=2, WPA_Both=3)
wpa=2

### WPA Password ###
wpa_passphrase=dietpi

### WPA accept cipher suites ###
wpa_pairwise=THIP CCMP

### WI-FI mode ###
hw_mode=g

### Channel ###
channel=1

### Auth system ###
auth_algs=2

### Mac whilelist ###
macaddr_acl=1

### MAC whilelist file ###
accept_mac_file=/etc/hostapd/hostapd.accept

I want to do a bridge wlan0 to wlan1 to get access to internet while connected to hotspot and also DHCP but this isn't a problem.
But the main issue is that the hostapd don't work with wlan1 and the br0 (that I deleted because it was horrible) don't work. Also I wan't to switch cards with interfaces because on the "bad" one currently work on wlan0 but I want it to work on wlan1 and same thing on the "better" one.
Cards that I'm using:

*

*For HOTSPOT TP-LINK TL-WN725N

*For WI-FI TPLINK TL-WN722N

I think I give all information needed but if not just ask for it.
EDIT:
I did everything by myself! yey!
But this TP-LINK TL-WN725N doesn't work with hostapd.

A: You can easily create a Hotspot using create_ap .
Install create_ap and run the following command:
create_ap wlan0 wlan1 MyAccessPoint MyPassPhrase

wlan0 to get an internet connection
wlan1 to create a hotspot wifi
To install create_ap and starting the service , run:
git clone https://github.com/oblique/create_ap
cd create_ap
make install
systemctl start create_ap
systemctl enable create_ap


text:
Q: Event handling issue with Firefox I have a very basic code that just won't work on Firefox, but works fine on Chrome. I just want to trigger a function when the user clicks anywhere in the page. Here is the code:
window.onload = function(){
 alert(document.body);   // Is executed correctly
 document.body.onclick = function(){
       /*do stuff*/
  }
}

and it works just fine on Chrome but not on Firefox. I tried many workarounds but none of them work, and there is no error in the error console.
  function set(){
       /*do stuff*/
  }
 document.body.onclick = set;

or
document.body.addEventListener('click',set,false);

I am trying with a very basic html page with just

Hello World

None of them work. What am I missing?

A: Are you sure you are binding onclick event after the html page has loaded?

$(function (){
  document.body.onclick = function() { alert("Hi");};
});

This works fine in both Chrome and Firefox.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can I differentiate values in my JSON Array from other values in my ListView? I have a JSON Array which consists of some contacts in my phonebook who are also users of my app. For example, the JSON Array might look like :
[{"contact_phonenumber":"11111"},{"contact_phonenumber":"22222"},{"contact_phonenumber":"33333"}]

phoneNumberofContact is a string which, in the do statement in my code below, returns every contact in my phone. How can I check which phoneNumberofContact numbers appear in my JSON Array and then, besides those contacts in the ListView put the words '- app user'. My ListView is working fine, I just want to add this feature in.
So, for example, for the number 11111 I would have in my ListView :
Joe Blogs - app user
11111

Here's my code:
JSONArray jsonArrayContacts = response;
//response is something like [{"contact_phonenumber":"11111"}, etc...]

  @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_contact);

        //selectPhoneContacts is an empty array list that will hold our SelectPhoneContact info
        selectPhoneContacts = new ArrayList<SelectPhoneContact>();

        listView = (ListView) findViewById(R.id.listviewPhoneContacts);

}

//******for the phone contacts in the listview

    // Load data in background
    class LoadContact extends AsyncTask<Void, Void, Void> {
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }

        @Override
        protected Void doInBackground(Void... voids) {

//          we want to delete the old selectContacts from the listview when the Activity loads
//          because it may need to be updated and we want the user to see the updated listview,
//          like if the user adds new names and numbers to their phone contacts.
            selectPhoneContacts.clear();

//          we have this here to avoid cursor errors
            if (cursor != null) {
                cursor.moveToFirst();

            }

            try {

//                get a handle on the Content Resolver, so we can query the provider,
                cursor = getApplicationContext().getContentResolver()
//                the table to query
                 .query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                                null,
                                null,
                                null,
//               display in ascending order
                 ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE LOCALIZED ASC");

//                get the column number of the Contact_ID column, make it an integer.
//                I think having it stored as a number makes for faster operations later on.
//                get the column number of the DISPLAY_NAME column
                int nameIdx = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
//                 get the column number of the NUMBER column
                int phoneNumberofContactIdx = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);

                cursor.moveToFirst();

//              We make a new Hashset to hold all our contact_ids, including duplicates, if they come up
                Set<String> ids = new HashSet<>();

                do {

                    System.out.println("=====>in while");

//                        get a handle on the display name, which is a string
                    name = cursor.getString(nameIdx);

//                        get a handle on the phone number, which is a string
                    phoneNumberofContact = cursor.getString(phoneNumberofContactIdx);

                    //----------------------------------------------------------

                    // get a handle on the phone number of contact, which is a string. Loop through all the phone numbers
//                  if our Hashset doesn't already contain the phone number string,
//                    then add it to the hashset
                    if (!ids.contains(phoneNumberofContact)) {
                        ids.add(phoneNumberofContact);

                                SelectPhoneContact selectContact = new SelectPhoneContact();

                                selectContact.setName(name);
                                selectContact.setPhone(phoneNumberofContact);
                                selectPhoneContacts.add(selectContact);
                            }

                } while (cursor.moveToNext());

            } catch (Exception e) {
                Toast.makeText(NewContact.this, "what the...", Toast.LENGTH_LONG).show();
                e.printStackTrace();
                //   cursor.close();
            } finally {

            }

    if (cursor != null) {
        cursor.close();

    }
    return null;
}

        @Override
        protected void onPostExecute(Void aVoid) {
            super.onPostExecute(aVoid);

            adapter = new SelectPhoneContactAdapter(selectPhoneContacts, NewContact.this);

//                    we need to notify the listview that changes may have been made on
//                    the background thread, doInBackground, like adding or deleting contacts,
//                    and these changes need to be reflected visibly in the listview. It works
//                    in conjunction with selectContacts.clear()
            adapter.notifyDataSetChanged();

            listView.setAdapter(adapter);

       }
   }

A: In the first, you can parse the jsonArrayContacts to a List:
 final List<String> responseContacts = new ArrayList<String>();
                    try {
                        JSONArray responseObject = new JSONArray(response);
                        for (int i = 0; i < responseObject.length(); i++) {
                            final JSONObject obj = responseObject.getJSONObject(i);
                            responseContacts.add(obj.getString("contact_phonenumber"));
                        }
                      //  System.out.println("the matching contacts of this user are :" + responseContacts);

                    } catch(Exception e) {
                        e.printStackTrace();
                    }

after you get your local contacts, then you have two sets of contacts, so it's easy to check which number appears in your json array contacts.
And then you can pass the responseContacts into SelectPhoneContactAdapter during you initialize it, and in getView() method of the adapter, you can know whether you need to put the words '- app user' to your item view or not.


text:
Q: How to resolve this 'Unresolved reference' when I have defined the function? I am just a beginner in programming, started learning Kotlin today. I am getting this error.
fun main(args: Array<String>) {

    val (two, three) = nextTwo(1) // Unresolved reference: nextTwo
    println("1, $two, $three")

    fun nextTwo(num: Int) : Pair<Int, Int> {
        return Pair(num+1, num+10)
    }

}

Picture of the error.

A: Local functions can only be used in their local scope after their definition.
You can either move the nextTwo function out of the main function, like this (in this case, it doesn't matter whether it's before or after main):
fun nextTwo(...) {}

fun main(args: Array<String>) {
    nextTwo(...)
}

Or you can just move it before its usages inside main:
fun main(args: Array<String>) {
    fun nextTwo(...) {}

    nextTwo(...)
}


text:
Q: Subject math GRE exam 0568 Q.46 This is the question with its answer:
It is not clear for me why we should show the first statement in the following picture:
Could anyone explain this for me please?

A: Since $i$ generates the group then $z=i^m$ for some $m$. Now, if $i$ maps to $i^k$ then $z$ maps to $i^{mk}=z^k$ following the homomorphism properties.


text:
Q: Implementing a custom iterator returning data from 2 vectors I have a class implementing data structure (some kind of hash map) with 3 vectors.
std::vector<uint64_t> keys;  // storage of keys to values (actually hash values)
std::vector<int> values; // storage for values (some integer)
std::vector<bool> allocated; // vector of allocated elements

Each of the vectors have the same size (for example 8 elements)
It would look like this
keys:      32233 52263 0     22224 0    87222  65432  0
values:    234   44    0     43    0    78     98     0
allocated: 1     1     0     1     0    1      1      0

I would like to implement a custom iterator that can iterate over the allocated
vector and being able to return the corresponding value of the values vector and the
key of the keys vector. The empty spots (marked as 0 in the allocated vector) should be ignored as these spots are considered as free spots.
I thought I might be able to return a pair type of each iterated allocated spot, like std::pair< key, value > or such so I would have they key as it->first and the value as it->second.
I really have no idea how to get a start on implementing this. Is this possible at all? Would be great if someone can give me small sample code. Maybe this is even more simple then I think.
Thanks in advance for your help!


text:
Q: Compare Percent Change values inside a for loop I have a list like below

I want to be able to compare the percent change of QQQ at 9:35 to various other stocks like AAPL and AMD at the same time. So check if percent change of AAPL at 9:35 is greater than percent change of QQQ at 9:35. Same thing for AMD at 9:35 and then at 9:40 and then 9:45 and so on.
I want to do this via python
This is what i have so far but not quite correct
import pandas as pd
import time
import yfinance as yf
import datetime as dt
from pandas_datareader import data as pdr
from collections import Counter
from tkinter import Tk
from tkinter.filedialog import askopenfilename
import os
from pandas import ExcelWriter
d1 = dt.datetime(2020, 8, 5,9,00,00)
d2 = dt.datetime(2020, 8, 5,16,00,00)

pc=Counter()
filePath=r"C:\Users\Adil\Documents\Python Test - ET\Data\Trail.xlsx"
stocklist = pd.read_excel(filePath)

for i in stocklist.index:
    symbol=stocklist['Symbol'][i]
    date=stocklist['Date'][i]
    close=stocklist['Close'][i]
    pc=stocklist['PercentChange'][i]

    if (pc[i]>pc['QQQ']):
        print(pc[i])

A: Alright,
I got from a comment, an explanation of what the OP wants:

Yes so i want to see if within a given time 5 min time period if a
stock performed better than QQQ

First thing you need to do, is make it so you can look up your information by the time and symbol.  Here is how I would do that:
my_data = {}

for i in stocklist.index:
    symbol=stocklist['Symbol'][i]
    date=stocklist['Date'][i]
    pc=stocklist['PercentChange'][i]
    my_data[symbol, date] = pc

That makes a dictionary where you can lookup percent changes by calling my_data['ABCD', 'datetime']
Then, I would make a list of all the times.
time_set = set()
for i in stocklist.index:
    date = stocklist['Date'][i]
    time_set.add(date)
times = list(time_set)
times.sort()

If you are pressed for computer resources, you could combine those two loops and run them together, but I think having them separate makes the code easier to understand.
And then do the same thing for symbols:
sym_set = set()
for i in stocklist.index:
    date = stocklist['Symbol'][i]
    sym_set.add(date)
symbols = list(sym_set)
symbols.sort()

Once again, you could have made this set during the first for-loop, but this way you can see what we are trying to accomplish a bit better.
Last thing to do, is actually make the comparisons:
for i in times:
    qs = my_data['QQQ', i]
    for j in symbols:
        if qs != 'QQQ':
            which = "better" if my_data[j, i]>qs else "worse"
            print(j + " did " + which + " than QQQ at " + i)

Now, this just prints the information out to the console, you should replace the print command with however you want to output it.  (Also, I assumed higher was better; I hope that was right.)


text:
Q: Can't log in to Magento admin backend I have installed Magento 1.9 into the htdocs of xampp, using the theme Milano. The front end seems to be working perfectly well but I cant access the back end.
As you can see, there are 2 input text boxes for password! I know the user name and password and have tried several combinations to somehow log in, but the output is always this page.
I'm a newbie here so please bear with me. Thanks already.

A: This is a consequence of having magento locally. To fix this you have to comment out some code roughly placed in code/core/mage/core/session/varien....if I am remembering the path correctly there should be only one file in this directory and your looking for a chunk of code tracking cookies

A: As Chris Richardson says, it is a problem caused by local installation.
To "trick" your browser, add a virtualhost in xampp for your local magento, and add a entry to host file:
127.0.0.1 www.example.dev
where www.example.dev must match the host name you give when you create the virtualhost.

A: You can change secure and unsecure url as follows.
Customer cannot login to magento 1.8.1
After setting this, it will work.

A: You can find solution here
I think your problem will be solved with this thread
https://stackoverflow.com/a/15491865/5083109


text:
Q: Remove event handler if controls unlocked with three.js pointerlock controls I have a model I'm navigating using the threejs pointerlock controls. Clicking on certain sections of the model when the camera is "looking" at them will take you to other parts of the site. This all works well, except for the specific situation where the camera is centered over a section and you escape out of the pointerlock.  Clicking to go back into pointerlock not only traps the mouse, but also calls the event handler and sends the user elsewhere.
The solution is to remove the event handler, but my code to do so isn't working.  This is the code for the for statement that defines the bounding box of the space to clickthrough and adds the listener.
for (var p = 0; p < panels.length; p++ ) {
    //console.log(p);
    if (point_x <= panels[p].x_max && point_x >= panels[p].x_min) {
        x_value = "true";
        if (point_y <= panels[p].y_max && point_y >= panels[p].y_min) {
            y_value = "true";
            if (point_z <= panels[p].z_max && point_z >= panels[p].z_min) {
                z_value = "true";
                clickthrough.innerHTML = panels[p].wall.charAt(0).toUpperCase() + panels[p].wall.slice(1) + " Wall, " + "Panel " + panels[p].panel;
                clickthrough.style.display = 'block';
                //console.log(panels[p].wall.charAt(0).toUpperCase() + name.slice(1) + " Wall, " + "Panel " + panels[p].panel);

                if (controls.isLocked) {
                    console.log ('controls locked');
                    window.addEventListener( 'click', function () {

                    window.location.href = panels[p].url;

                    }, false );
                }
                else {
                    console.log ('controls unlocked');
                    window.removeEventListener( 'click', function () {

                    window.location.href = panels[p].url;

                      });
                    }

                    break;
                  }
                  else {    z_value = "false";
                        clickthrough.style.display = 'none';}}
                  else {    y_value = "false";
                        clickthrough.style.display = 'none';}}
                  else {z_value = "false";
                        clickthrough.style.display = 'none';}
                       }

                 }

The particular section that generates or removes the window listener is:
    if (controls.isLocked) {
        console.log ('controls locked');
        window.addEventListener( 'click', function () {

        window.location.href = panels[p].url;

          }, false );
        }
        else {
                console.log ('controls unlocked');
                window.removeEventListener( 'click', function () {window.location.href = panels[p].url;});
        }

I suspect the issue is that I'm simply not invoking the removeEventListener correctly, but I'm not sure how to do so.  And if I am invoking it correctly, is there a way I can make sure it works properly?

A: The code you've provided is adding and removing two different functions:
if (controls.isLocked) {
    console.log ('controls locked');
    window.addEventListener( 'click', function () {

        // this function instance
        window.location.href = panels[p].url;

    } );
} else {
    console.log ('controls unlocked');
    window.removeEventListener( 'click', function () {

        // is different from this function instance
        window.location.href = panels[p].url;

    } );
}

If you would like to later remove a function that you've added as an event listener you need to save a handle to the original function reference:
const originalFunction = function () {

    window.location.href = panels[p].url;

};

if (controls.isLocked) {
    console.log ('controls locked');
    window.addEventListener( 'click', originalFunction );
} else {
    console.log ('controls unlocked');
    window.removeEventListener( 'click', originalFunction );
}


text:
Q: An exercise about the definition of nuclear maps Definition 2.1.1 Let $A, B$ be the C*-algebra, a map $\theta: A\rightarrow B$ is called nuclear if there exist contractive completely positive maps $\phi_{n}: A\rightarrow M_{k(n)}(\mathbb{C})$ and $\psi_{n}:M_{k(n)}(\mathbb{C}) \rightarrow B$ such that
$$||\psi_{n}\circ\phi_{n}(a)-\theta(a)||\rightarrow0$$
for all $a\in A$.
Exercise 2.1.2 Prove that $\theta: A\rightarrow B$ is nuclear if and only if there exist contractive completely positive maps $\phi_{n}:A\rightarrow C_{n}$ and $\psi_{n}:C_{n} \rightarrow B$, where the $C_{n}$ are finite-dimensional C*-algebras, such that $\psi_{n} \circ\phi_{n}\rightarrow\theta$ in the point-norm topology. (Hint: Find integers $k(n)$ such  that there is a unital embedding $C_{n}\subset M_{k(n)}(\mathbb{C})$ and construct a conditional expectation $M_{k(n)}(\mathbb{C}) \rightarrow C_{n}$.)
Could someone show me more details of this question?

A: One implication is obvious, since you can take $C_n=M_{k(n)}(\mathbb C)$.
So assume you have an approximate factorization of $\theta$ by $A\xrightarrow{\phi_n}C_n\xrightarrow{\psi_n}B$. Following the hint, choose $k(n)$ such that, for each $n$, $C_n\subset M_{k(n)}(\mathbb C)$.
Fix $n$. Being a finite-dimensional C$^*$-algebra, each $C_n$ is a sum of full-matrix blocks. This means that there exist pairwise orthogonal projections $P_1,\ldots,P_s$ in $M_{k(n)}(\mathbb C)$ such that
$$
C_n=\sum_{j=1}^s P_jM_{k(n)}(\mathbb C)P_j.
$$
So the map $\rho_n:X\mapsto \sum_j P_jXP_j$ is a completely positive map $M_{k(n)}(\mathbb C)\to C_n$ that is the identity when restricted to $C_n$ (i.e., a conditional expectation).
Now define $\psi'_n=\psi_n\circ\rho_n$. This is completely positive for all $n$, and now we have $A\xrightarrow{\phi_n} M_{k(n)}(\mathbb C)\xrightarrow{\psi'_n} B$.
For any $a\in A$, $\psi'_n(\phi_n(a))=\psi_n(\rho_n(\phi_n(a)))=\psi_n(\phi_n(a))$. So $\theta(a)=\lim_n\psi'_n\circ\phi_n(a)$.


text:
Q: How can I effectively kill giants in melee combat? I read some good hints in this question, but I am a warrior. I don't want to run around the giant throwing him dozens of arrows, I want to fight him face to face, mace to mace.
I am level 25 now, specialized in 1-hand combat, shield and heavy armor. Is it possible to challenge a giant in melee combat and win? What equipment should I use that can help me against giants, or better yet, what skills can help me out here?

A: I don't know about level 25, but at level 28 I received a few bounties to kill giants.
I found that if I shot a giant with a frostbite venom arrow (with sneak damage) and then charged him with my Shield of Solitude, and did a power bash every time he swung, along with a sword which had the "Absorb health" enchantment, I was able to defeat the giant , even if it hit me twice.  Just make sure there are no other giants or mamoths around, and that you keep your stamina up.
This was with Heavy Armor and a rating of 350+ armor (from my smithing orcish armor and making it epic)
This was without a follower.

A: Melee killing giants requires a simple technique you can get with practice. When the giant charges you, charge him but pass to the side of him, the giant will take a swing and pause. Turn around and slash him. When the giant turns to face you charge him again and pass by, repeat. Should only take 2-4 times.

A: Giants are boring by level 30 with ~400 armor rating and 4 perk points in Armsman or Barbarian.  4 or 5 hits to kill them, they need 9 or 10 hits to kill me.  I don't even potion, poison, heal, shout, block or use allies.
Look, armor rating works against opponents like giants that only do physical damage.  Take your awesome blacksmith'd armor, put an Oakflesh on top of it and trade blows.

A: Lead with the Marked for Death shout if you aren't going to sneak attack it.

A: I think it's possible to survive a giant attack without being sent to the stratosphere, if you're moving (strafing) and you have enough armor rating for your level.
As a good general rule first I'd double check that I have the best weapons and armor for my level. If you're not smithing or enchanting check the merchants for better enchants. Level scaling can sometimes make encounters very frustrating.
With this in mind you could look into perks and enchants that work well without you having to stay toe to toe all the time:

*

*Absorb Health is very helpful. I have a Glass Mace with +15 Absorb Health and it makes dragon fights much easier. Even one that I enchanted myself with only +5 Absorb Health to have at least 50 charges was very helpful. No need to gulp any potions. It seems that landing a critical hit gives you more health in return (I've had sometimes much more health left than expected at the end of a fight, which I assume was related to the critical hits, maybe someone else can confirm this?).

*Get the Critical Charge perk. Land a power attack while sprinting, then keep sprinting past the giant, while your Absorb Health weapon keeps you in shape.

I also prefer to fight toe to toe, and don't want to use tricks related to pathing. But with that said, nothing wrong with softening up your giant with a few unsavory arrows (perhaps coating them with a health or stamina regen poison), until they are at close range.
EDIT: Well I confirm this works although I suspect they are also much easier past level 30. Got hit a few times for ~20% health damage. Used Critical Charge, then ran while casting the quick healing, then turned back, rinse-repeat. At level 38 it took 4-5 hits.
If you really want to stay in melee I guess you could try a Health Regen potion plus a max health increase potion, best armor and weapon available + smithing improvements... but if you run you can take two giants at once :)

A: You say "Mace to Mace", I prefer "Mace to Face" :D
2 most important things for melee against a giant:

*

*Dance in and out of range before he strikes

*Use shield attacks to interrupt his power attacks

Without very high damage absorption (armour >500 etc) on a high difficulty multiplier you will hurt if he gets a good hit on you, so controlling the combat and ensuring you aren't flanked by a second giant is important.
If you still have trouble then 3) Have decent block absorption (skill, perks and possibly enchanted block) -> only a few % of damage taken.
Easy money :)
[ Mages have no problem with them with impact, And rogues can find a sneaky rock to stand on ]

A: Its all about beeing able to take 1 hit, if you survie just spam potions to fill your hp up again. I managed to kill a giant without follower around lvl 22, with glass armor, dual swords and Oakflesh. It isn't a mission impossible to do.

A: I did it by luring the giant to a river, and using fire breath (dragon shout) and flames (destruction spell). You can kill one if you have learned the shout to call a dragon.

A: Here's how I take giants down with melee:

*

*Get a decent sword (steel will do)

*Enchant it with absorb stamina or drain stamina

*Get the critical charge perk

*use only light armor and any kind of heavy shield

*also make sure you have a midget character
Instructions:
First off you will need to provoke the giant by shooting at it or whatever you can do to get him angry.Next when he is charging at you charge straight towards him and do a power attack when your close enough and then go through his legs.Keep running forward for 2 seconds and then stop and wait for him to turn around and figure out what just happened.Rinse and repeat until you have a knocked out giant or a dead one.
If hes knocked out: uneguip your weapons and keep punching him for fun.
If hes dead: good for you
Warning:It takes a bit of practice to get the timing right.

A: If you're an Orc, you can kill it at level 1. The first time I was lvl 6 light armor + 2 handed, I snuck up on it, activated Berserker Rage and sneak power attacked it, then just wailed on it. The second time was level 1 with full iron + banded iron armor, and steel war axe, both un-improved and not enchanted. I just activated berserk mode and rained blows on it, bashing sometimes when it raised a club or fist. That time, I used minor health potions and minor stam potions. I think both times I tried to stay behind it. Hope this helps!

A: I just used a nord to make the giant flee. The I slashed it with dual wield battle axe for bleededing affect nd by da time it was coming back to get me, all those bleededing affects stacked just drained its health quickly on its own. I was lvl 16.

A: First you need to hire Marcurio in Riften, then make a giant aggro you and let Marcurio shower the giant in spells.


text:
Q: What verb can be used transitively with the noun "bridge"? Imagine an unsurpassable abyss between you and some kind of other side. And although you know you can't possibly make it, you still jump with a mad hope to make it to the safety of that other side. When you think you will sink into this abyss some kind of force makes a bridge and rescues you. I am looking for a metaphor, simile or just an acceptable expression containing the noun bridge as the direct object of a verb.
My sentence:

When we think that we fall into the abyss, it [the force] will [____ us (with if needed ) the bridge] of its power.

Is there a verb that can be used transitively here? I thought of throw or extend or stretch something that unfolds like a bridge, but I am not sure of any of these.

A: throw a bridge +preposition
has seen usage.
The phrase goes back at least 150 years.

The Brooklyn Bridge: A Cultural History

More recent usages...

North Dakota's thundering economic boom (when I was driving across the state last fall, almost all the local radio announcements seemed to be for help wanted) has revived plans to throw a bridge and oil-access highway across the river upstream from the site, now technically known as the Elkhorn Ranch Unit of Theodore Roosevelt National Park.

NYT
But is also used metaphorically.

There, the trappings of period serve to throw a bridge of continuity between the classics of yesteryear and the present, rather in the way that the Grammys always go to modern versions of 50s soul acts: Amy Winehouse, Adele, Norah Jones.

The Guardian

If Kant has already established that on the basis of our awareness of our obligations under the moral law we can be confident that we have free will and that all of the laws of nature are at least consistent with our realization of the ends commanded by the moral law, what more needs to be done in order to throw a bridge between the theoretical cognition of nature and the laws of freedom?

SEP

When he wrote this song, he was struggling to throw a bridge across his own troubled water.

Huffington Post
Quotes seen on LudwigGuru
Note that the phrase is usually accompanied with a preposition such as across or between.

I have been searching for usages going back into military history...here is one:

The Delhi Gazelte has learnt your honour for it because iwice I have written you to edition that it is in contemplation to throw a bridge of pontoons across ...

Allen's Indian Mail and Register of Intelligence for British ...
I knew I had seen it used with 'pontoon bridge' before....

A: A very natural way to say this is to verb the noun metaphorically, to use 'bridge' directly as the verb:

How can we bridge the gap between academia and industry?

A: If the bridge itself is makeshift or constructed of an unusual material or component, "form" is often used.
1836, The United Service Magazine - Volume 21 - Page 562
"Thus ten rafts would throw 250 men across a river and form a bridge of 250 feet in length, immediately after."
2008,  Biologically Inspired Optimization Methods: An Introduction p.99
"In such cases, Weaver ants form a bridge using their own bodies.

A: "Imagine an unsurpassable abyss between you and some kind of other side. And although you know you can't possibly make it, you still jump with a mad hope to make it to the safety of that other side. When you think you will sink into this abyss some kind of force makes a bridge and rescues you. I am looking for a metaphor, simile or just an acceptable expression containing the noun bridge as the direct object of a verb."
Generally, uncrossable is better. Or: unsurpassable, though that is usually for states or conditions, not physical things.
The problem is that here, in English, if you have an abyss, something can bridge the abyss or span it.
So this:
When we think that we fall into the abyss, it [the force] will [____ us (with if needed ) the bridge] of its power.
would become:
When we think that we are falling into the abyss, the force will span it or bridge it with its power.
One should never forget the power of the verb in English.
Examples of span the abyss:
span the abyss is found in many texts

A: The verb  "to prop up" is a possibility.

(OALD) prop up phrasal verb, prop something  up
to prevent something from falling by putting something under it to support it

*

*When we think that we fall into the abyss, it will prop us up with the bridge of its power.


text:
Q: How to run post actions if setting up the shared library fails? I'm using a shared library via @Library('shared-lib') _. The pipeline script implements post actions. E.g.
post {
    always {
        script {
           // Do stuff
        }
    }
}

When there's an error with the shared lib then Jenkins just fails the entire build and the post action block isn't executed, as it seems (tested with wrong repository URL and non-existing branch). In case GitHub is down, I want Jenkins to run post actions to notify the issuer of the build that it failed. Is there a way to do this, without having the issuer making API calls of some kind for verification?
Thanks for any suggestion!

A: One way you can control the loading of the shared library is by Loading libraries dynamically, when you do so you can wrap the loading phase with a try catch block and handle the failure.
However, when using this technique the error will be handled outside the pipeline execution so in order to avoid duplicating the error handler function (that sends notifications) you can define the error handling in a separate methods (or in a shared library) and call it for the catch block and from the post block.
Something like:
try {
    library "shared-lib"
}
catch(Exception ex){
    // handle the exception
    handleError(ex.getMessage())
}

pipeline {
    agent any
    stages {
        stage('Hello') {
            steps {
                ...
            }
        }
    }
    post {
        always {
            script {
                handleError(message)
            }
        }
    }
}

def handleError(message){
    emailext ...
}

You can also try to load the library inside a pipeline step, thus utilizing the post directive on failure, but this can cause issues with the context of the loaded library and therefore it is not recommended.
You can also of course handle separately each failure type and avoid the need of an external function.
Last thing, shared library failures are usually not handled because if the job failed to load the library for the SCM then it will probably fail to load the pipeline itself form the SCM, so assuming you host them both on the same SCM platform, this scenario is relatively rare.


text:
Q: How can I do "version control" in vim? For example, I have a working code but not fast enough, so I want to record this version of the code and ten continue to optimize it, and maybe got a better version, then record this version again, so  on.
If I eventually failed to get a fast code, I want to roll back to the original working code.
I guess this could be achieved by using undo branch, but I didn't find how to do it.

A: Use a version control system. I recommend Git + Fugitive.
Seriously!
You won't look back.

A: Yes, you can add undo branches functionality that makes it more like a version control system.
In vim 7.3 you can have persistent undo, as described here, you only need to add the following lines to your .vimrc.
set undodir=~/.vim/undodir
set undofile

To get the most of undo branches I highly recommend gundo since you can use it to visualize the tree and see the diffs of the commits.

A: Using a version control system is definitely a good idea for any projects you work on, even if they are fairly small. Even so, HaskellElephant makes a good point -- occasionally, you might experiment with a small throwaway script that you want to tweak. It might actually be pretty cool to be able to create save points on such occasions, so I played around with vim's undotree() function and came up with this script:
command! -nargs=1 StoreUndo call s:StoreUndo(<f-args>)
function! s:StoreUndo(label)
  if !exists('b:stored_undo_state')
    let b:stored_undo_state = {}
  endif

  let b:stored_undo_state[a:label] = undotree()['seq_cur']
endfunction

command! -nargs=1 -complete=custom,s:CompleteUndoStates RestoreUndo call s:RestoreUndo(<f-args>)
function! s:RestoreUndo(label)
  if !exists('b:stored_undo_state')
    let b:stored_undo_state = {}
  endif

  if !has_key(b:stored_undo_state, a:label)
    echoerr a:label.' not found in stored undo states.'
  endif

  exe 'undo '.b:stored_undo_state[a:label]
endfunction

function! s:CompleteUndoStates(A, L, P)
  if !exists('b:stored_undo_state')
    let b:stored_undo_state = {}
  endif

  return join(keys(b:stored_undo_state), "\n")
endfunction

Here it is in gist form: https://gist.github.com/1473170
You can put it under ~/.vim/plugin, for example. Executing the command :StoreUndo foo will create a savepoint named "foo". You can make any changes you like. When you execute :RestoreUndo foo, the buffer will restore the saved state. The RestoreUndo command is tab-completed with all existing save points.
This is not persisted on file. If you close the buffer, you lose the history, so this could be only useful temporarily, for quick experimentation.

A: There's plugins for vim.
Check also: http://www.vim.org/scripts/script.php?script_id=90

A: I'm no expert with vim (in fact, I can barely use it), but the solutions that come to my mind are:

*

*Use an actual version control, that's what it's for. Maybe even one of them "distributed" flavours, since they don't need a separate repository;

*Just make a backup copy of your file/folder when you want to.

*You can even write a short program (shell script?) that copies the file/folder for you with an automatically appended suffix which marks the time when you made the copy.

*... and then bind that program to a vim shortcurt (no idea how to do that, but vim is rumored to be so powerful, that I would imagine that it has such a feature).


text:
Q: Data structure for tiled map I want to make an infinite tiled map, from (-max_int,-max_int) until (max_int,max_int), so I'm gonna make a basic structure: chunk, each chunk contain char tiles[w][h] and also it int x, y coordinates, so for example h=w=10 so tile(15,5) is in chunk(1,0) on (5,5) coordinate, and tile(-25,-17) is in chunk(-3,-2)on(5,3) and so on. Now there can be any amount of chunks and I need to store them and easy access them in O(logn) or better ( O(1) if possible.. but it's not.. ). It should be easy to: add, ??remove??(not must) and find. So what data structure should I use?

A: Read into KD-tree or Quad-tree (the 2d variant of Octree). Both of these might be a big help here.

A: So all your space is splited into chunks (rectangular clusters). Generally problem is storing data in sparse (since clusters already implemented) matrix. Why not to use two-level dictionary-like containers?.. I.e. rb-tree by row index where value is rb-tree by column index. Or if you are lucky you can use hashes to get your O(1). In both cases if you can't find row you allocate it in container and create new container as value but initially with only single chunk. Of course allocating new chunk on existing row will be a bit faster than on new one and I guess that's the only issue with this approach.


text:
Q: I can't understand Intermediate Value Theorem Proof Intermediate Value Theorem. If ƒ is a continuous function on a closed interval [a, b] and if u is any value between ƒ(a) and ƒ(b), then u = ƒ(c) for some c in [a, b].
I'm trying to understand this theorem from Wikipedia(https://en.wikipedia.org/wiki/Intermediate_value_theorem#Proof), it says that if $A:= \{x \in [a,b]:f(x)≤u\}$ and $s:=supA$ then $f(s)=u$.
I can't understand it. Please help me to prove this theorem.
Edited:I don't understand this part on Wikipedia:

A: Let me comment on the sentences you are saying you don't understand:

By the properties of the supremum, there exists some $a^{*}\in (c-\delta ,c]$ that is contained in $S$, and so $f(c)<f(a^{*})+\varepsilon \leq u+\varepsilon$.

As the supremum is the least upper bound of $S$, if there wasn't such $a^*$ contained in $S$, it would be then possible to find a smaller upper bound. Namely, $c-\delta$ would be a smaller upper bound of $S$, if you assume the whole interval $(c-\delta, c]$ is devoid of elements of $S$.
Now pick such $a^*\in S$, and you will have $f(a^*)\le u$, while simultaneously having $f(c)-\varepsilon\lt f(a^*)\lt f(c)+\varepsilon$ (which they assumed is not just valid for $a^*$ but for any value in $(c-\delta, c+\delta)$). Put those two inequalities together to get the desired inequality $f(c)<f(a^{*})+\varepsilon \leq u+\varepsilon$.

Picking $a^{**}\in (c,c+\delta )$, we know that $a^{**}\not \in S$ because $c$ is the supremum of $S$. This means that $f(c)>f(a^{**})-\varepsilon>u-\varepsilon$.

$a^{**}\not\in S$ because $c=\sup S$ is the upper bound of $S$, i.e. all elements of $S$ are "below" or equal to $c$, while $a^{**}$ has been chosen to be greater than $c$.
Not being in $S$ means that $f(a^{**})>u$, but with $f(c)-\epsilon\lt f(a^{**})\lt f(c)+\epsilon$ (which again is not just valid for $a^{**}$ but for any number in $(c-\delta, c+\delta)$) we can put together those two inequalities and get the desired inequality $f(c)>f(a^{**})-\varepsilon>u-\varepsilon$.

A: About the Wikipedia proof quoted in revision 3:
By the $(\varepsilon, \delta)$-definition of limit and continuity, the proof one line above writes
$$f(x) - \varepsilon < f(c) < f(x)+\varepsilon \tag 1$$
for all $x \in (c-\delta, c+\delta)$.
$c$ is chosen to be the smallest number that is greater than or equal to every member of $S$ ($c=\sup S$).
So there are some $a^* \in (c-\delta, c]$ that's "just smaller" than $c$ and also $a^*\in S$. So $f(a^*) \le u$.
By the right hand side of inequality $(1)$, $f(c) < f(a^*) + \epsilon$, and so
$$f(c) < u + \varepsilon$$
Similarly, since $c = \sup S$, for $a^{**}\in (c, c+\delta)$ that's "just larger" than $c$, $a^{**}\not\in S$ and so $f(a^{**}) > u$.
By the left hand side of inequality $(1)$, $f(a^{**}) - \varepsilon < f(c)$, and so
$$u - \varepsilon < f(c)$$


text:
Q: Error: Statement Function is recursive This is trying to solve a linear equation of 3*3 and print out the results, but it got problems in the commented lines:
I defined the module LinearSolution outside of program, should I define it inside? what's the difference?
Why it says the statement is recursive, you know, when I use these statement as normal subroutine instead of module subroutine, they are verified to be fine.
module LinearSolution
    type LAE
        integer::N
        double precision,dimension(:,:),allocatable::A
        double precision,dimension(  :),allocatable::B
    contains
        procedure,nopass::RowReduction
    end type LAE
contains
    subroutine RowReduction
        double precision::C
        do k=1,N
            do i=k+1,N
                if(A(k,k)/=0) then
                    C=A(i,k)/A(k,k)
                    B(i)=B(i)-B(k)*C       !error: Statement Function is recursive
                    do j=k+1,N
                        A(i,j)=A(i,j)-A(k,j)*C   !error: Statement Function is recursive
                    end do
                end if
            end do
        end do

        do k=N,1,-1
            do i=k-1,1,-1
                if(A(k,k)/=0) then
                    C=A(i,k)/A(k,k)
                    B(i)=B(i)-B(k)*C  !error: Statement Function is recursive
                end if
            end do
        end do

        do k=1,N
            if(A(k,k)/=0) then
                B(k)=B(k)/A(k,k)  !error: Statement Function is recursive
            end if
        end do
    end subroutine RowReduction
end module LinearSolution

program TestLAE
    use LinearSolution  !fatal error: cant open module file LinearSolution.mod for reading
    type(LAE)::LAE1
    LAE1%N=3
    allocate(LAE1%B(1:N))
    allocate(LAE1%A(1:N,1:N))
    LAE1%B=(/1,1,1/)
    LAE1%A=(/2,0,0,0,2,0,0,0,2/)
    call LAE1%RowReduction
    print*, LAE1%B(1),LAE1%B(2),LAE1%B(3)
end program

A: As is so often the case, implicit none is your friend.
Let's take the errors one at a time:
B(i)=B(i)-B(k)*C       !error: Statement Function is recursive

the compiler doesn't recognize B in this context; there is no variable declared B here(*), so the best it can do is assume that it's a real-valued statement function defining B as a function of I.   Statement functions are space saving but confusing ways of defining a function inline, but amongst other things they can't be recursive; here you'd be defining B(i) in terms of B(i) which obviously fails.
(*) But!  you cry.  B is an array field in my type LAE!  Yes, but we're not in the context of LAE here; and indeed, in the context of this function there are no variables of type LAE to even use the B values of.   This is because the procedure was defined nopass; you need to have a variable which is the object being operated on which is of class LAE so that we can access those fields.   That looks something like this:
    type LAE
        !...
    contains
        procedure::RowReduction
    end type LAE

contains
    subroutine RowReduction(self)
        class(LAE), intent(InOut) :: self
        double precision::C
        integer :: i, j, k
        do k= 1, self%N
            do i= k+1, self%N
                if( self%A(k,k) /= 0 ) then
        !....

Note that we have to define self to be of class(LAE) rather than type; class is a superset of type and is needed when dealing with extensible objects which include those with (re-)allocatable components.   Note too we've added implicit none which would tell you right away that B wasn't defined, and thus specified the integer indices i,j, and k.
Once N, A, and B are being correctly referenced as fields of self, then most of the rest of the program is correct.  Note that you have to reshape your LAE1%A array:
LAE1%A=reshape((/2,0,0,0,2,0,0,0,2/), (/N, N/))

But otherwise things seem fine.
module LinearSolution
implicit none

    type LAE
        integer::N
        double precision,dimension(:,:),allocatable::A
        double precision,dimension(  :),allocatable::B
    contains
        procedure::RowReduction
    end type LAE

contains
    subroutine RowReduction(self)
        class(LAE), intent(InOut) :: self
        double precision::C
        integer :: i, j, k
        do k= 1, self%N
            do i= k+1, self%N
                if( self%A(k,k) /= 0 ) then
                    C = self%A(i,k) / self%A(k,k)
                    self%B(i) = self%B(i)- self%B(k)*C
                    do j=k+1, self%N
                         self%A(i,j) = self%A(i,j) - self%A(k,j)*C
                    end do
                end if
            end do
        end do

        do k = self%N,1,-1
            do i=k-1,1,-1
                if( self%A(k,k)/=0) then
                    C= self%A(i,k)/ self%A(k,k)
                    self%B(i)= self%B(i)- self%B(k)*C
                end if
            end do
        end do

        do k=1, self%N
            if( self%A(k,k)/=0 ) then
                self%B(k) = self%B(k) / self%A(k,k)
            end if
        end do
    end subroutine RowReduction
end module LinearSolution

program TestLAE
    use LinearSolution
    implicit none

    integer, parameter :: N = 3
    type(LAE)::LAE1
    LAE1%N=N
    allocate(LAE1%B(1:N))
    allocate(LAE1%A(1:N,1:N))
    LAE1%B=(/1,1,1/)
    LAE1%A=reshape((/2,0,0,0,2,0,0,0,2/), (/N, N/))
    call LAE1%RowReduction
    print*, LAE1%B(1),LAE1%B(2),LAE1%B(3)
end program

Running gives:
$ gfortran -o lae lae.f90 -Wall -std=f2003
$ ./lae
  0.50000000000000000       0.50000000000000000       0.50000000000000000


text:
Q: Can a macOS administrator retrieve the password of a user who has enabled TouchID on the same laptop? TouchID allows a user to log into a laptop through a fingerprint. The fingerprint itself is used by the operating system to retrieve the user password and then the password is used to complete the login and unlock the keychain.
Since this implies the password of a user with TouchID is stored somewhere on the device I would like to know if an administrator of the machine could potentially retrieve it and how.
Any additional detail on how the password is stored and protected would also be appreciated.

A: Enabling TouchID does not make it any easier to retrieve the password of a user, no.
You have misunderstood how TouchID works. It does not work by retrieving the user's password. The user's password is not involved when logging in with TouchID.


text:
Q: Django incomplete migration of table with multiple foreign keys Django version: 4.1.2
After heaving the following table defined in the model:
class Tasks(models.Model):
    name_text = models.CharField(max_length=200)
    duration_int = models.IntegerField(default=1)
    ...

the next two tables have been defined:
class Metiers(models.Model):
    name_text = models.CharField(max_length=50)
    ...

class TasksProperties(models.Model):
    task = models.ForeignKey(Tasks, on_delete=models.CASCADE, related_name='task_relation')
    metier = models.ForeignKey(Metiers, on_delete=models.CASCADE, related_name='metier_relation')
    ...

doing the migration, the metier is not created inside the SQL table, but the rest:
class Migration(migrations.Migration):

    dependencies = [
        ('simo', '0009_alter_specialdays_day_date'),
    ]

    operations = [
        migrations.CreateModel(
            name='Metiers',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_text', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='TasksProperties',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('workload_mh', models.IntegerField(default=8)),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='simo.tasks')),
            ],
        ),
    ]

Is there any reason, why metier is not taken into account?
Update on 27/11/2022:
So, it still not clear why it was not working because I believe the structure is correct; therefore I did some try-on-errors and finally the migration is complete, although the reason is not obvious. See below the resolution:
Step 1) Remove the migrated TaskProperties class from models and do a migration
Step 2) models.py was updated as
class TasksProperties(models.Model):
    workload_mh = models.IntegerField(default=8)
    metier = models.ForeignKey('Metiers', on_delete=models.CASCADE, related_name='metier_relation')

It resulted that the "metier" as foreignkey was visible in SQL after the migration.
Step 3) Adding the "task" as well, the migration dropped the following question:
class TasksProperties(models.Model):
    workload_mh = models.IntegerField(default=8)
    metier = models.ForeignKey('Metiers', on_delete=models.CASCADE, related_name='metier_relation')
    task = models.ForeignKey(Tasks, on_delete=models.CASCADE, related_name='task_relation')

*It is impossible to add a non-nullable field 'task' to tasksproperties without specifying a default. This is because the database needs something to populate existing rows.
Please select a fix:

*

*Provide a one-off default now (will be set on all existing rows with a null value for this column)

*Quit and manually define a default value in models.py.
Select an option: 2*

Then after updating the model.py adding default value default=0 to "task" the migration was successful:
class TasksProperties(models.Model):
    workload_mh = models.IntegerField(default=8)
    metier = models.ForeignKey('Metiers', on_delete=models.CASCADE, related_name='metier_relation')
    task = models.ForeignKey(Tasks, on_delete=models.CASCADE, related_name='task_relation', default=0)

Why is this "defualt" value is needed?

A: Try these three commands:
python manage.py makemigrations appname

python manage.py sqlmigrate appname 0001

python manage.py migrate

And see if it solves


text:
Q: How to download Dash video files as they appear on the server? Is it possible, given an mpd file like https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd, to easily download all the Dash files stored on the server (assuming we know that it's static content on the server). That is, I should be able to run an HTTP server serving the content I downloaded, and point a Dash player at it to play the same video.
youtube-dl does not seem to give me the Dash package. I could use curl to perform XHR requests like the browser, but I'm hoping there's an easier way.

A: No need to develop a wheel!
The grand tool youtube-dl knows hundreds of platforms/protocols/etc as well as MPEG DASH as well as Apple HLS and so on and so forth!
Very often updates/bugfixes
Have fun!
http://rg3.github.io/youtube-dl/
PS.:
If you want to keep fragments - use the option
--keep-fragments

Keep downloaded fragments on disk after downloading is finished; fragments are erased by default
Upd:
Your playlist has plenty of options (based on video bandwidth), eg:
youtube-dl.exe -F https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd
[generic] bbb_30fps: Requesting header
WARNING: Falling back on generic information extractor.
[generic] bbb_30fps: Downloading webpage
[generic] bbb_30fps: Extracting information
[info] Available formats for bbb_30fps:
format code                 extension  resolution note
bbb_a64k                    m4a        audio only DASH audio   67k , m4a_dash container, mp4a.40.5 (48000Hz)
bbb_30fps_320x180_200k      mp4        320x180    DASH video  254k , mp4_dash container, avc1.64000d, 30fps, video only
bbb_30fps_320x180_400k      mp4        320x180    DASH video  507k , mp4_dash container, avc1.64000d, 30fps, video only
bbb_30fps_480x270_600k      mp4        480x270    DASH video  759k , mp4_dash container, avc1.640015, 30fps, video only
bbb_30fps_640x360_800k      mp4        640x360    DASH video 1013k , mp4_dash container, avc1.64001e, 30fps, video only
bbb_30fps_640x360_1000k     mp4        640x360    DASH video 1254k , mp4_dash container, avc1.64001e, 30fps, video only
bbb_30fps_768x432_1500k     mp4        768x432    DASH video 1883k , mp4_dash container, avc1.64001e, 30fps, video only
bbb_30fps_1024x576_2500k    mp4        1024x576   DASH video 3134k , mp4_dash container, avc1.64001f, 30fps, video only
bbb_30fps_1280x720_4000k    mp4        1280x720   DASH video 4952k , mp4_dash container, avc1.64001f, 30fps, video only
bbb_30fps_1920x1080_8000k   mp4        1920x1080  DASH video 9914k , mp4_dash container, avc1.640028, 30fps, video only
bbb_30fps_3840x2160_12000k  mp4        3840x2160  DASH video 14931k , mp4_dash container, avc1.640033, 30fps, video only (best)

now, if you wish you download ALL the segments for all the bitrates, you could try to use the magic option
--all-formats

or you could do it one by one using the
    --format
option, e.g.:
youtube-dl.exe --format bbb_30fps_320x180_200k --keep-fragments

A: I found a project that downloads the segments as they are stored on the server: https://github.com/Viblast/dash-proxy
I had to fork it to fix a few things for myself though: https://github.com/elv-peter/dash-proxy

A: You may find that there is actually not an easier way readily available to you, unless someone happens to have built a tool to do this, which I am not aware of.
It worth remembering that a DASH stream will usually have multiple ABR (Adaptive Bit Rate) renditions and the original video on the server will actually be stored in multiple different bit rate versions on the server or CDN.
A normal player will select each chunk or segment of the video from whichever bit rate version is most appropriate for the device type and current network conditions.
So, if you wanted to replicate what was on the original server you would have to create a client which downloaded all the segments from all the available bit rate versions of the video. Or alternatively just download the highest quality version and transcode to the other bitrates yourself.
To actually then serve the DASH streams to somewhere else you would also need to make sure you update the manifest to point to the right URL's on your server.
And finally, you would need to check that you have the rights to share it and that the file is not encrypted, in which case you may not be able to share it with clients.


text:
Q: Azure AD and SAP-SF provisioning We are in the testing phase for the integration between Azure AD and SAP Success factors. In the provisioning process we have used the following mapping expression for creating unique UPN in Azure if two users have the same first name and last name, but from different company:
Append(Join(".", [firstName], [lastName]), Switch([companyName], "@x.onmicrosoft.com", "Contoso", "@contoso.com", "Fabricam", "@fabricam.com") )
How to update the expression to create unique UPN for the new user from the same company if he has the same first name and last name as an existing user in Azure AD?
I know that Use unique value expression works only for ActiveDirectory integration.
Thank you.

A: SAP-SF has the unique naming format it has different attributes so according to that the Name format will make "Formal Name" field as "unique format"
Name format can be associated with Legal Entity so that configured name format.

First Name, Middle Name, Third Name, Last Name, Second Last Name, Birth Name, Initials, Prefix etc.

Check these Name format document as well as the Attribute document.


text:
Q: Date code not converting to correct date format I am confused as to why my date is getting converted to unix default before entry into mysql. I am sure the code is correct but cannot see why this is not working. It should convert the date that I post to script.
I would be grateful if someone could check the code and point out my error. Many thanks.

Post: 22/08/2017 05:03:29 Output:1970-01-01 12:00:00

$date = $_POST['datetimepicker'];
$parsedDate = date('Y-m-d h:i:s', strtotime($date));

A: d/m/Y is not one of the date formats recognized by the PHP date parser.
Given the number of digits in the date components, the parser assumes m/d/Y and because 22 is not a valid month number it fails and strtotime() returns 0.
You can use DateTime::createFromFormat() to tell the parser what format do you use:
$date = DateTime::createFromFormat('d/m/Y H:i:s', '22/08/2017 05:03:29');
echo($date->format('Y-m-d H:i:s'));

# 2017-08-22 05:03:29


text:
Q: We use google maps api key restriction per AWS EC2 load balancer We use google maps api key with thousands of sites, how can we restrict by IP address when our sites are behind AWS EC2 Load Balancers that don't have static IPs?

A: So requests coming in from your load balancer contain a Google Maps API key, and also need to be restricted by IP address? That doesn't make sense to me.
I think what you mean is that you want to tell Google what server IP addresses are allowed to use your API keys to make API calls to Google Maps. If that's the case then the fact that they are behind a load balancer is not relevant. Traffic comes into servers from the load balancer, but API requests going out of your EC2 servers to Google do not go through the load balancer. So you could assign Elastic IPs to each server and then whitelist those IPs with Google. Of course if you are doing auto-scaling, or if you have lots of servers Elastic IPs aren't a good solution, in which case you should use NAT gateways or HTTP Proxies for the EC2 instances, and whitelist the IP addresses of the NAT or Proxy servers.


text:
Q: Understanding performance issues for ionic 4 app using firebase realtime database I have a ionic 4 app using firebase real time database. On app start the data fetch happens from firebase db using angularfire2.
This is taking 13 seconds with just 40 objects. To understand the issue I installed the app and opened it in the chrome debugger to see the network activity.
What I am seeing is that the network activity shows "Stalled" status for those 13 sec and like 0.2 ms for data download. Attached is a screenshot. Please note that you will see in the screenshot every odd entry with that behavior. This is like 2 tabs in my app. tab1 has the issue and tab2 is just a regular tab. so i am tapping between the two see that it is consistent.
https://www.dropbox.com/s/f0d0jgi1o8dfpyq/Screenshot%202019-12-16%2021.49.55.png?dl=0
https://www.dropbox.com/s/h43rschhi1domsh/Screenshot%202019-12-16%2021.56.52.png?dl=0
The code that is invoked is below:
async refreshData(){
    this.syncedCards = []
    const res:any = await this.dataSvc.getPendingCards(this.getUserKey())
    for(let cardQ of res){
      if(cardQ._status == GlobalVariables.QUEUED || cardQ._status ==  GlobalVariables.REJECTED)
         continue

      var card = this.copyContactDataFromJson(cardQ)
      this.syncedCards.push(card)

   }
  }

copyContactDataFromJson(cardQ:any){
    var card = new Card(cardQ._tempContactId, cardQ._frontImageUrl,cardQ._backImageUrl, cardQ._status, cardQ._date, cardQ._userId, cardQ._message, cardQ._objectType)
    card.firstName = cardQ._firstName
    card.lastName = cardQ._lastName
    card.jobTitle = cardQ._jobTitle
    card.company = cardQ._company
    card.email = cardQ._email
    card.mobile = cardQ._mobile
    card.workPhone = cardQ._workPhone
    card.website = cardQ._website
    card.street = cardQ._street
    card.city = cardQ._city
    card.state = cardQ._state
    card.country = cardQ._country
    card.postalCode = cardQ._postalCode
    card.favoriteContact = cardQ._favoriteContact
    card.profilePic = cardQ._profilePic
    card.dept = cardQ._dept
    card.fax = cardQ._fax
    card.workPhoneExtn = cardQ._workPhoneExtn
}

The data service fetching this is below
getPendingCards(userKey:string){
    console.log("userkey to fetch data is:" + userKey)
    return new Promise((resolve, reject) => {
      this.db.list("/users/" + userKey + "/cards", ref => ref.orderByChild('_date') )
      .valueChanges().subscribe(
        (res:any) => {
            resolve(res)
        },
        err => {
            console.log(err)
            reject(err)
        }
      )}
    )
  }


text:
Q: Add animation to bar in data sorting bar chart Highcharts What i tried:
highchartsLeaderBoard = Highcharts;
    chartOptionsLeaderBoard={
      chart: {
        reflow:false,
          type: 'bar',
          marginLeft: 80,
          width: 500,
          borderWidth:0,
          backgroundColor:'transparent',
      },
      plotOptions: {
        bar: {
          borderWidth:0,
        },
      },
     title: {
          text: 'LeaderBoard',
      },
    credits:{
        enabled:false
      },
     yAxis: {
        visible:false,
          title: {
              text: ''
          }
      },
    xAxis: {
          type: 'category',
          min: 0,
          labels: {
              animate: true,
              duration:5000
          }
      },

      legend: {
          enabled: false
      },

      series: [{
          zoneAxis: 'x',
          zones: [{
              value: 1,
              color: '#ff4d40'
          }],
          dataLabels: {
              enabled: true,
              format: '{y:,.0f}',
              borderWidth:0,
              color:'white',
               style:{
                 textOutline:0
              }
            },
          dataSorting: {
              enabled: true,
              sortKey: 'y',
              animate: true,
              duration:5000
          },
          data:[],
      }]
  }

this.chartOptionsLeaderBoard.series[0].data.push(array)

I want animation like how bars in this are sliding:
https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/datasorting/labels-animation
In the above fiddle code animation was added in setData()..but i cannot use setData() in angular.
THANKS in advance!!!

A: To perform an update / setData while working with the highcharts & highchart-angular wrapper, you need to update the chartOptions (as you did) and then set the updateFlag to true.
Docs references:
https://github.com/highcharts/highcharts-angular
Live example
https://stackblitz.com/edit/highcharts-angular-optimal-way-to-update


text:
Q: Ajax call to ASP.NET MVC Controller Returns 404 when Json Length is too Long I have a simple ajax call which is passing a json string to a controller action and if the content portion of the json is too long, or the json string in general, the server returns a 404, if I shorten the content, it the request resolves and completes correctly.
I thought it was do to the 8k limit of Microsoft's JavaScriptSeralizer, but I have updated the MaxJsonLength, with no luck. Can somebody please tell me what's going on here?
Here is my ajax request (Note: This is using Knockout.js)
 self.updatePost = function () {
            var postToUpdate = ko.toJS(self.selectedPost);
            postToUpdate.Content = $("#wmd-input").val();
            console.log(postToUpdate);

            $.getJSON('/blogs/posts/update', {post: ko.toJSON(postToUpdate)}, function(post) {
                if (post) {
                    // remove the selected post and add the updated post
                    self.posts.remove(self.selectedPost());
                    var updatedPost = new Post(post);
                    self.posts.unshift(updatedPost);
                    self.selectedPost(updatedPost);
                    $("#ghost-list li:first").trigger('click');
                    // show alert
                }
            });
        };

The C# Controller Action
 public JsonResult Update(string post)
    {
        var seralizer            = new JavaScriptSerializer();
        seralizer.MaxJsonLength  = int.MaxValue;
        seralizer.RecursionLimit = 100;
        var selectedPost         = seralizer.Deserialize<Post>(post);
        var student              = students.GetStudentByEmail(User.Identity.Name);
        var blog                 = db.Blogs.SingleOrDefault(b => b.StudentID == student.StudentID);
        var postToUpdate         = blog.BlogPosts.SingleOrDefault(p => p.ID == selectedPost.ID);

        if (postToUpdate != null)
        {
            // update the post fields
            postToUpdate.Title       = selectedPost.Title;
            postToUpdate.Slug        = BlogHelper.Slugify(selectedPost.Title);
            postToUpdate.Content     = selectedPost.Content;
            postToUpdate.Category    = selectedPost.Category;
            postToUpdate.Tags        = selectedPost.Tags;
            postToUpdate.LastUpdated = DateTime.Now;
            if (selectedPost.Published)
            {
                postToUpdate.DatePublished = DateTime.Now;
            }
            // save changes
            db.SaveChanges();

            var jsonResult = Json(seralizer.Serialize(selectedPost), JsonRequestBehavior.AllowGet);
            jsonResult.MaxJsonLength = int.MaxValue;
            return jsonResult;
        }
        return Json(false, JsonRequestBehavior.AllowGet);
    }

A: Have you tried using the post method:
$.post('/blogs/posts/update', {post: ko.toJSON(postToUpdate)}, function(post) {
    if (post) {
        // remove the selected post and add the updated post
        self.posts.remove(self.selectedPost());
        var updatedPost = new Post(post);
        self.posts.unshift(updatedPost);
        self.selectedPost(updatedPost);
        $("#ghost-list li:first").trigger('click');
        // show alert
    }
 }, 'json');

A: Try this at web config
<system.web.extensions>
<scripting>
  <webServices>
    <jsonSerialization maxJsonLength="500000000"/>
  </webServices>
</scripting></system.web.extensions>


text:
Q: Regular expression for name with parentheses so first time trying to come up with regular expression validation and im a bit confused. User populates the 'name' section of our form like so:
Lastname, firstname (department).

but it could also be
 lastname-hyphenedname, firstname (some department).

or anything along those lines. im having a hard time finding an expression that works around parentheses and various name formats with hyphens. Anyone happen to know a quick expression for this?

A: ^([A-Za-z]+([-']?|\s+))*[A-Za-z]+,\s*([A-Za-z]+([-']?|\s+))*[A-Za-z]+\s*(\([A-Za-z\s]+\))?$
Name which may contain one or more a hyphen parts or parts separated by spaces or ', then comma, maybe some spaces, then an first-name (maybe with hyphens or spaces or '), maybe some spaces, then (name with spaces in brackets). PCRE.

A: With pcre regex, you can do this:
^(?i)([a-z]+(?:[ '-][a-z]+)*), (?1) \([^)]+\)\.$

But you can be more restrictive.


text:
Q: A question about an explanation for $f^{-1}(\{y\})=\{f^{-1}(y)\}$ In a textbook, I'm asked what is the relationship between $f^{-1}(y)$ and $f^{-1}(\{y\})$ if $f$ is a function with inverse $f^{-1}$, and $y \in Range(f)$? I was wondering if "is the unique element thereof" is necessary in the author's explanation (for the purpose of turning the explanation into a proof)?

The symbol $f^{-1}(y)$ denotes the unique element $x \in Domain(f)$ such that $f(x)=y$. This element is unique since if $f(x')=y$, $$x'=f^{-1}(f(x))=x.$$

Likewise, $f^{-1}(\{y\})$ denotes the set of $x$ such that $f(x)=y$. By above, $$f^{-1}(\{y\})=\{x\}.$$

Therefore $f^{-1}(y) \in f^{-1}(\{y\})$, and is the unique element thereof. We can write this as $f^{-1}(\{y\})=\{f^{-1}(y)\}$

A: Whenever you are taking about $f^{-1} (y) $ for each $y\in Range(f) $, $f^{-1} $ means there as function, as by definition of a function , it takes each value uniquely to an another value. And , that's why, then $ f $ need to be bijective map from domain to it's range .
But Whenever you are taking about $f^{-1} (\{y\}) $ , then it's just a preimage of the set $ \{y\} $, for this $ f $ need to be just a relation.
So, in general, $f^{-1}(\{y\})=\{f^{-1}(y)\}$ is not possible.
For example , take $ f = x^2 $ on $\mathbb{R} $, clearly as $ f $ is not bijective, so, $f^{-1} (1) $ is not possible! But, $f^{-1} (\{1\}) = \{-1,1\} $.

A: We cannot write  $a\in a$ as its forbidden, but $a \in \{a\}$.


text:
Q: WebSphere Application Migration Toolkit (v20.0.0.1) not installing on Eclipse 2019-12 IDE for JavaEE Developers I'm currently having a problem installing the latest version of the WebSphere Application Migration Toolkit (v20.0.0.1) to Eclipse 2019-12 IDE for JavaEE Developers. I'm receiving the following message when trying to install:

Cannot complete the install because one or more required items could not be found.
Software being installed: Oracle to WebSphere Application Migration Tool 3.21.0.v20200305_1150 (com.ibm.ws.appconversion_feature.oracle.feature.group 3.21.0.v20200305_1150)
Missing requirement: Application Migration Tool - Common Feature 3.23.0.v20200305_1150 (com.ibm.ws.appconversion_feature.common.feature.group 3.23.0.v20200305_1150) requires 'org.eclipse.equinox.p2.iu; org.eclipse.birt.feature.group 2.3.2' but it could not be found
Cannot satisfy dependency:
  From: Oracle to WebSphere Application Migration Tool 3.21.0.v20200305_1150 (com.ibm.ws.appconversion_feature.oracle.feature.group 3.21.0.v20200305_1150)
  To: org.eclipse.equinox.p2.iu; com.ibm.ws.appconversion_feature.common.feature.group 3.17.0

A: The error shows up because one of the WebSphere Application Migration Toolkit dependencies, BIRT, is missing from the latest Eclipse versions. You'll need to install BIRT separately. In Eclipse, go to Help -> Install New Software. In the Work With field, paste in the Eclipse 2019-09 URL: http://download.eclipse.org/releases/2019-09. Select the Business Intelligence, Reporting and Charting and go through the installation steps. Restart Eclipse and try to install the WebSphere Application Migration Toolkit again.


text:
Q: Why does Jenkins say "This Jenkins instance appears to be offline" I have a fresh install of Jenkins 2.32.2 on Ubuntu.
Opened a browser on the instance and get to a page titled Offline, with the message "This Jenkins instance appears to be offline" and offers options to "Configure Proxy" or "Skip Plugin Installation"
The machine clearly isn't offline as I just used the internet connection to do the installation.
I also had a previous installation, done exactly the same way, that was working.
I removed the previous installation as Pipelines wouldn't work and Google told me it was because of JDK 9. So I removed all the JDK/JRE installations as well as jenkins, fresh installed JDK 8 only, installed Jenkins, and got to here.
Jenkins has worked on this box in the past so what makes it think it is offline?
Update: Found a log file /var/lib/jenkins/logs/tasks/Download metadata.log
and it starts with a message FATAL: Connection refused (Connection refused)
I would think that indicates that the internet connection is OK, but something else is stopping it getting data?
Update: Based on other research I checked the Update Site in the Plugin Manager. This is listed as http://updates.jenkins-ci.org/update-center.json and, from the command line a wget of this file succeeds. So most definitely not a connection issue. Worked with both http and https, jenkins works with neither.

A: In my case, it has something to do with SSL. I manage to fix it by editing /var/lib/jenkins/hudson.model.UpdateCenter.xml and change url to use http instead of https.
Restart jenkins and reload the website, it no longer shows offline.

A: in my case (macOS), updating jdk to 8 and reinstall jenkins solved the problem.

A: The issue is that for some reason Jenkins doesn't have access to the certificates chain of the Jenkins updates service.
On Ubuntu 18.04 I had this issue and the next links and instructions helped me to start Jenkins properly without modifying the default url or using a proxy of some sort.
Installing a new JDK 8(u101+) with JAVA_HOME should do the trick like at:

*

*https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04
is making sure that Lets Encrypt certificates are installed and available on the OS/SYSTEM.
To test it you can use the instructions at:

*

*Does Java support Let's Encrypt certificates?
And to install manually if required the Let's encrypt root chain using the next script:

*

*https://gist.github.com/Firefishy/109b0f1a90156f6c933a50fe40aa777e

A: I also faced this issue i.e. This Jenkins instance appears to be offline on windows 10.
Below are the steps I followed to solve it:

*

*Navigate to the Jenkins Home Directory.
For me, the default home directory is: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins

*Changed the protocol from HTTPS to HTTP in the file hudson.model.UpdateCenter.xml

*Restarted Jenkins (Go to C:\Program Files\Jenkins and then execute jenkins.exe stop, jenkins.exe start)

*Logged in to Jenkins again (http://localhost:8080/).
The offline error got solved.

A: In my case i have changed https to http in URL line of /var/lib/jenkins/hudson.model.UpdateCenter.xml file
and restarted the jenkins. It started functioning.

A: in case you are running jenkins in a container and vi is not installed
access your container in interactive mode
docker exec -it jenkins-ci /bin/bash

use this sed command to replace  https with http
sed -i 's/https/http/g' /var/jenkins_home/hudson.model.UpdateCenter.xml

A: For macOS users:
Step -1: Edit /Users/Shared/Jenkins/Home/hudson.model.UpdateCenter.xml and change url to use http instead of https.
Step -2: Restart jenkins (for instance by going to http:localhost:8080) and reload the website
Step -3(Optional): If it asks for user and password and if you don't remember creating one; default user is admin and copy the password from
sudo cat /Users/Shared/Jenkins/Home/secrets/initialAdminPassword

credits - @Alex in this post and @Tuan Pham here and @Joe Walsh for the comment on macOS directory path

A: There is something wrong with the internet connection of update center.I have met the same situation with Jenkins installed on macOS.
You can try to modify the hudson.model.UpdateCenter.xml file.
Jenkins installed with .pkg package on macOS,the file path is:
/Users/Shared/Jenkins/Home/hudson.model.UpdateCenter.xml
Jenkins installed by Homebrew on macOS,the file path is:
/Users/{username}/.jenkins/hudson.model.UpdateCenter.xml
Open the file:
<?xml version='1.1' encoding='UTF-8'?>
<sites>
  <site>
    <id>default</id>
    <url>https://updates.jenkins.io/update-center.json</url>
  </site>
</sites>

You can try to change https://updates.jenkins.io/update-center.json to:
http://updates.jenkins.io/update-center.json

or
// If you are in China or near China area,https and http are both OK.
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json

And then you can restart Jenkins by:
//loading the URL to restart Jenkins.
http://localhost:8080/restart

or
// Use Homebrew command to restart Jenkins if you installed Jenkins LTS version by Homebrew.
brew services restart jenkins-lts

A: On MacOS 10.11.6 :

*

*Go to /Users/<UserName>/.jenkins

*Open the file hudson.model.UpdateCenter.xml

*Change the value of default from https://xxx to http://xxx

A: For Windows OS,
follow below steps:

*

*Go to C:\Users\\*your user name*\\.jenkins

*Open the file hudson.model.UpdateCenter.xml

*Update the value of url from https://xxx to http://xxx

A: This mostly happens when you are working with company issued PC Windows OS.
Fix :-
click on "Configure Proxy" ask your IT team for specific server and port values that can bypass firewall and give your windows username & password. In this way you can resolve windows firewall and offline Jenkins issue.
I researched a lot over Internet but nowhere the fix is available.
Thanks!

A: *

*Took note of the secret Administrator password path that Jenkins displays when first opening http://localhost:8080/ on a browser.

*The path was: C:\Users{username}\AppData\Local\Jenkins.jenkins\secrets.
Therefore the hudson.model.UpdateCenter file was at C:\Users{username}\AppData\Local\Jenkins.jenkins\

*Updated the hudson.model.UpdateCenter file in notepad to have text http instead of https as follows:
http://updates.jenkins.io/update-center.json

*Reloaded the http://localhost:8080/ page but still showed the text "This Jenkins instance appears to be offline."

*Then navigated to the Services App in Windows (click Windows and type 'Services App' and it should display the App in the search list)

*In the services App right clicked the Jenkins service and selected Restart.

*After Windows restarted the Jenkins service navigated to http://localhost:8080/
The Jenkins page wouldn't even load. Navigated to the Jenkins login page: http://localhost:8080/login?from=%2F

*Then got a loading page with text:'Please wait while Jenkins is getting ready to work ...
Your browser will reload automatically when Jenkins is ready.'
Assumed that Jenkins was still restarting.

*Once the Jenkins login page loaded, entered that password/secret again and clicked Continue.

*This time the page with "This Jenkins instance appears to be offline." was not displayed. Jenkins displayed a Getting Started -> Customize Jenkins page with buttons to install plugins.

A: For Ubuntu,
go to /home/username/.Jenkins/Hudson.model.UpdateCenter.xml and
edit the file from https to http.

A: I make no claims about this, especially Java related (I personally cannot stand the language), but on my Ubuntu 18.04 L/T, I needed to stand-up a standalone Jenkins instance; So I installed both the Java on which Jenkins appears to be dependent and Jenkins itself
sudo apt install openjdk-8-jdk jenkins

Then I updated the Jenkins defaults
sudo gvim /etc/default/jenkins

... inserting the following at the top of the file - only because editing /etc/init.d/jenkins appeared to serve no purpose as it had no effect whatsoever ...
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/
PATH=$JAVA_HOME:$PATH

Finally, save & quit ... then attempt Jenkins restart
sudo service jenkins restart

HTH - it certainly worked for me :-)

A: I'm working on a Mac, and in my case, it turned out that the version of Java Jenkins was using  (1.8.0u66) wasn't up to date enough. I had both Java 11 and Java 14 installed, but the jenkins-lts script was coded to force use of Java 8. Rather than install a more up to date JDK 8 installation, I modified the script to run ${JAVA_HOME}/bin/java and set JAVA_HOME to the JDK 11 installation.

A: It might not always be an option but if you have a choice use different Image. I used Debian GNU/Linux 10 and it worked like a charm.

A: Re-installing JAVA JDK8 worked for me.

A: Another possibility - make sure DNS functions properly for Jenkins.
In my case, I followed Kubernetes setup instructions here to install Jenkins, and it led to this problem.
I enabled logging on CoreDNS and saw this:
│ [INFO] 10.70.116.14:45888 - 50490 "AAAA IN updates.jenkins.io.svc.cluster.local. udp 54 false 512" NXDOMAIN qr,aa,rd 147 0.0001896s                          │
│ [INFO] 10.70.116.14:45888 - 32566 "A IN updates.jenkins.io.svc.cluster.local. udp 54 false 512" NXDOMAIN qr,aa,rd 147 0.000169468s                           │
│ [INFO] 10.70.116.14:57907 - 22912 "A IN updates.jenkins.io.localdomain. udp 48 false 512" NOERROR qr,aa 110 0.000907476s                                     │
│ [INFO] 10.70.116.14:57907 - 52100 "AAAA IN updates.jenkins.io.localdomain. udp 48 false 512" NOERROR qr,aa 110 0.001709031s

The lookups were all cluster-local.
If I edited the URL (as suggested in other answers here) to include a dot after updates.jenkins.io. then hostname lookup worked and the URL resolved. Though Jenkins' next step errors for the same reason.
In the end I discovered the problem was ClusterFirst mode of the pod's DNS. I added dnsPolicy: Default to the deployment's pod template spec (the instructions link above), and now it works.

A: Even I faced similar issue, then figured out that JDK that I was using is 8 instead of 11.
Check jenkins jdk combination under jenkins official site
I used JDK11 with Jenkins 2.3031 version and it worked fine - all plugins got downloaded

A: In my case, I use WINDOWS OS. So, jenkins was installed in my C drive.
PATH : C:\Users\Username\ .jenkins
Under "hudson.model.UpdateCenter" file change "https" to "http"
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>http://updates.jenkins.io/update-center.json</url>
</site>
</sites>

A: As some others pointed out, in Windows, this could be because of firewall restrictions set by company infrastructure.
For my case, I need the recommended plugins to be present (e.g. Folders plugin)
My workaround was:
A. Install same Jenkins version into my personal laptop/VM, and be sure to install the recommended plugins the first time you browse to the Jenkins Web Page.
B. Copy the plugins folder from my personal laptop's JENKINS HOME folder (i.e. ProgramData\Jenkins...) into the Jenkins plugins folder of the company laptop.
Total size of the plugins folder was around 150MB (zipped).

A: jenkins_enable="YES"
jenkins_home="/usr/local/jenkins"
jenkins_user="jenkins"
jenkins_args="--webroot=${jenkins_home}/war --httpListenAddress=*.*.*.*  --httpPort=8180"

#jenkins_java_opts="-Djavax.net.ssl.trustStore=/usr/local/jenkins/cacerts -Djava.net.preferIPv6Addresses=true"

#jenkins_java_opts="-Djavax.net.ssl.trustStore=/usr/local/jenkins/cacerts -Djava.net.preferIPv4Addresses=true"

A: Enter this before running Jenkins.
# iptalbes -F

It may be because of the firewall.


text:
Q: Can't get ID of the next php generated row using jquery I have to generate some text boxes after each line of row sent from database, so I have this user who have 2 rows:

And of course each row belongs to an id:
                      <?php echo $counter--; ?>
                      <?php echo $installment['date_now'] ?>
                      <?php echo $installment['payment'] ?> $

                  <?php } ?>

Remaining:
                    <?php echo  ($cash['project_cost'] - $sum) ?> $

                  <tr id="<?php echo $cash['infoid']; ?>">Add Payment
                    <input type="date" class="form-control" id="date_pay_now[]"/>
                    <input class="form-control" type="text" id="pay_now"/>
                    <button id="add_payment" class="btn btn-success glyphicon glyphicon-plus"></button>

                <?php $sumCash = $sumCash + $cash['project_cost']; } ?>

                  Cash Total	<?php echo $sumCash ?> $

              <?php } else { ?>
              No Payments available
            <?php } ?>

Now, when select a date and type an amount, I should send those values into AJAX and but first I need to get the id of the row so I can send it too.
$("#add_payment").click(function()
{
  var date_of_pay = $("#date_pay_now").val();
  var pay_now = $("#pay_now").val();
  var id_pay = $(this).closest('tr').attr('id');
  console.log(id_pay);
  if(date_of_pay == "" || pay_now == "")
  {
    $("#date_pay_now").css('border-color', 'red');
    $("#pay_now").css('border-color', 'red');
  }
  if(date_of_pay != "" && pay_now != "")
  {
    $.ajax
    ({
      //Still not typed
    });
  }
});

If you see the image, when I click on the first button, I see the id correctly at the console and if they are empty I can see the red color, but when I refresh the page and click directly on the second row button, I can't see any value at the console and no css color due to empty text box shown.

And here when I click on the next button, no color and no id at the console:


text:
Q: Mongoose Model.create not executing I have a mongoose model called Rating. When I want to create a new Rating, I go to the post route and call Rating.create. For some reason, Rating.create never gets executed. I copied my code from someone else, and that person's code is working. Thus, I must be missing something somewhere else in my app. Any ideas?
Ratings.js route
var express     = require("express");
var router      = express.Router({mergeParams: true});
var Campground  = require("../models/campground");
var Rating      = require("../models/rating");
var middleware  = require("../middleware");

router.post('/', middleware.isLoggedIn, function(req, res) {
    Campground.findById(req.params.id, function(err, campground) {
        if(err) { console.log(err); }
        console.log("REQ.BODY.RATING: ", req.body.rating);
        if (req.body.rating) {
            console.log("IN HERE");
            Rating.create(req.body.rating, function(err, rating) {
                if(err) { console.log(err); }
                console.log("Creating rating");
                // do stuff
                req.flash("success", "Successfully added rating");
            });
        } else {
            req.flash("error", "Please select a rating");
        }
        res.redirect('/campgrounds/' + campground._id);
    });
});

module.exports = router;

I am getting the "IN HERE" console.log printed out.... but not the "Creating rating" one or error.
Ratings.js Model
var mongoose = require("mongoose");

var ratingSchema = new mongoose.Schema({
    rating: Number,
    author: {
        id: {
            type: mongoose.Schema.Types.ObjectId,
            ref: "User"
        },
        username: String
    }
});

module.exports = mongoose.model("Rating", ratingSchema);

Any ideas where I'm going wrong?

A: first of all thats too many if statements, try this approach
router.post('/', middleware.isLoggedIn, function(req, res) {
    Campground.findById(req.params.id, function(err, campground) {
        if(err) { console.log(err); }
        else if (req.body.rating) {
            console.log("IN HERE");
            Rating.create(req.body.rating, function(err, rating) {
                if(err) { console.log(err); }
                console.log("Creating rating");
                rating.author.id = req.user._id;
                rating.author.username = req.user.username;
                rating.save();
                campground.ratings.push(rating);
                campground.save();
                // do stuff
                req.flash("success", "Successfully added rating");
            });
        } else {
            req.flash("error", "Please select a rating");
        }
        res.redirect('/campgrounds/' + campground._id);
    });
});

and make sure in the ejs file you name the variable as an array Object so it would create it based on that object "it cant create using just a number variable you need to pass in an array so it turns it into a Java object in the DB", just like we did in the comments as in:
<input class="form-control" type="text" name="comment[text]" placeholder="text">

<input class="form-control" type="text" name="rating[rating]" placeholder="text">


text:
Q: vim - folding with more than one marker I have a debug file which looks like this:
==>func1:
.....
..
==>func2:
......
...
<==func2
..
<==func1
==>func3:
......
...
<==func3

Basically, I would like to be able to fold each one of the functions to eventually see something like this:
+-- x lines: ==> func1:
+-- x lines: ==> func3:

but still be able to expand func1 and see func2 folded:
==>func1:
.....
..
+-- x lines: ==> func2:
..
<==func1

is there any way to do so? thanks.

A: The unmatched markers need extra handle, here's an expr solution( see :h fold-expr):
setlocal foldmethod=expr
setlocal foldexpr=GetFoldlevel(v:lnum)

function GetFoldlevel(lnum)
    let line = getline(a:lnum)

    let ret = '='
    if line[0:2] == '==>'
        let name = matchstr(line, '^==>\zs\w*')
        let has_match = HasMarkerMatch(a:lnum, name)
        if has_match
            let ret = 'a1'
        endif
    elseif line[0:2] == '<=='
        let ret ='s1'
    endif

    return ret
endfunction

function HasMarkerMatch(lnum, name)
    let endline = line('$')
    let current = a:lnum + 1

    let has_match = 0
    while current <= endline
        let line = getline(current)

        if line =~ '^<=='.a:name
            let has_match = 1
            break
        endif

        let current += 1
    endwhile

    return has_match
endfunction


text:
Q: How can I set the yAxis limits within highchart() plot? I would like to balance the appearance of my plot by setting each side my y axis 100%.
I have tried to apply some solutions from Highcharts, but I am struggling with converting the syntax to R.
library(highcharter)
categories = c('2015', '2016', '2017', '2018', '2019')
hc <-highchart()%>%
  hc_chart(type= 'bar')%>%
  hc_title(text= 'My Assessment')%>%
  hc_subtitle(text= 'Mathematics')%>%
  hc_legend(enabled = TRUE) %>%
  hc_xAxis(
    list(categories = categories)) %>%
  hc_tooltip(
    shared = FALSE,
    formatter = JS("function () {
                   return this.point.category + '
' +
                   Highcharts.numberFormat(Math.abs(this.point.y), 1);}"))%>%
    hc_yAxis(title = list(
                  text= 'Percent of Students in Performance Levels'),
           labels = list(
                  formatter = JS("function () {
                      return Math.abs(this.value) + '%';
                                    }")))%>%
  hc_plotOptions(series = list(stacking= 'normal'))%>%
  hc_series(
    list(name = 'Not Yet Met',
         data = c(-3, -4, -5, -6,-4),
         legendIndex = 1),
    list(name = 'Partially Met',
         data = c(-12, -13, -14, -15, -20),
         legendIndex = 2),
    list(name = 'Approached',
         data= c(-10, -11, -12, -13, -15),
         legendIndex = 3),
    list(name= 'Exceeds',
         data= c(11, 10, 10, 11, 20),
         legendIndex = 5),
    list(name= 'Meets',
         data= c(64, 62, 60, 55, 41),
         legendIndex = 4)
)
hc

I expect to see the plot regenerated with 100% on the positive and negative sides of the y axis. The plot is auto generating 40% as the limit on the negative side and 80% on the positive side.

A: You need to add min and max arguments inside hc_yAxis:
library(highcharter)
categories = c('2015', '2016', '2017', '2018', '2019')
hc <-highchart()%>%
  hc_chart(type= 'bar')%>%
  hc_title(text= 'My Assessment')%>%
  hc_subtitle(text= 'Mathematics')%>%
  hc_legend(enabled = TRUE) %>%
  hc_xAxis(
    list(categories = categories)) %>%
  hc_tooltip(
    shared = FALSE,
    formatter = JS("function () {
                   return this.point.category + '
' +
                   Highcharts.numberFormat(Math.abs(this.point.y), 1);}"))%>%
  hc_yAxis(title = list(
    text= 'Percent of Students in Performance Levels'),
    labels = list(
      formatter = JS("function () {
                      return Math.abs(this.value) + '%';
                                    }")),
    ##### here add min and max
    min=-100,max=100
    )%>%
  hc_plotOptions(series = list(stacking= 'normal'))%>%
  hc_series(
    list(name = 'Not Yet Met',
         data = c(-3, -4, -5, -6,-4),
         legendIndex = 1),
    list(name = 'Partially Met',
         data = c(-12, -13, -14, -15, -20),
         legendIndex = 2),
    list(name = 'Approached',
         data= c(-10, -11, -12, -13, -15),
         legendIndex = 3),
    list(name= 'Exceeds',
         data= c(11, 10, 10, 11, 20),
         legendIndex = 5),
    list(name= 'Meets',
         data= c(64, 62, 60, 55, 41),
         legendIndex = 4)
  )
hc


text:
Q: How do I combine @Asynchronous and Weld/CDI Events and @Observes(during=TransactionPhase.AFTER_COMPLETION) in Glassfish 3.1 First of all let me state, that the following code example worked just fine in GF 3.0.1. The troubles started when we switched to GF 3.1.
I'm using a method
@Asynchronous
public void executeFlowStep(
    @Observes(during=TransactionPhase.AFTER_COMPLETION)
    ExecuteFlowStepEvent executeFlowStepEvent) {

Since the switch, whenever this should receive an ExecuteFlowStepEvent I get the following error message:
WELD-000401 Failure while notifying an observer of event [package].ExecuteFlowStepEvent

No further information or stacktrace is given.
It works if I remove the @Asynchronous annotation and the AFTER_COMPLETION attribute, of course this breaks the program as I depend on the AFTER_COMPLETION timing.
I tried to ask for help on the Weld Forums, so far to no avail, although there seem to be other people with the same problem: http://seamframework.org/Community/WeldUsers
I at least would like to know:
Is this a bug, or is this wanted. Does this imply that Weld does NOT work with Asynchronous methods/AFTER_COMPLETION attributes? Why did this work in GF 3.0.1?
Has anyone managed to make this work on GF 3.1?

A: According to the link you posted as a comment to your own question, this is a bug that was fixed in Wield 1.1.2 and GlassFish 3.1.2 (build 14+).
disclamer: I posted this answer to an age old question to help SO (StackOverflow) get rid of unanswered questions.