text:
Q: Python code produces incorrect results without using the .COPY() function I have this code.
List1 = [{'pg_id': 100, "group_name": "test1", "product_price": 100}, {'pg_id': 200, "group_name": "test2", "product_price": 200}]
List2 = [{'lowest_price': 20}]

FINAL_DICT = {}
for latest_lowest in List1:
    for idx, coupon_related__product in enumerate(List2):
        if coupon_related__product['lowest_price'] < latest_lowest['product_price']:
            FINAL_DICT[ latest_lowest['pg_id'] ] = coupon_related__product
            FINAL_DICT[ latest_lowest['pg_id'] ]['group_name'] = latest_lowest['group_name']
            print("Group name is %s"%(latest_lowest['group_name']))

for PG_ID, LOWEST_PRICED_PRODUCT_THIS_PG in FINAL_DICT.iteritems():
    print(LOWEST_PRICED_PRODUCT_THIS_PG)

My desired output in terminal is
Group name is test1
Group name is test2
{'lowest_price': 20, 'group_name': 'test2'}
{'lowest_price': 20, 'group_name': 'test1'}

But it outputs
Group name is test1
Group name is test2
{'lowest_price': 20, 'group_name': 'test2'}
{'lowest_price': 20, 'group_name': 'test2'}

If I change
FINAL_DICT[ latest_lowest['pg_id'] ] = coupon_related__product

to
FINAL_DICT[ latest_lowest['pg_id'] ] = coupon_related__product.copy()

Then it produces correct output which I want.
My question is, why all of the dictionaries in FINAL_DICT has group_name=test2 when I don't use .copy()

A: this line:
FINAL_DICT[ latest_lowest['pg_id'] ] = coupon_related__product

assigns a dictionary to your entry. The next line:
FINAL_DICT[ latest_lowest['pg_id'] ]['group_name'] = latest_lowest['group_name']

changes the group name, but the reference of the dict is the last dictionary you assigned to, so the reference is shared.
that's why you have to make an copy of the dict so references are independent:
FINAL_DICT[ latest_lowest['pg_id'] ] = coupon_related__product.copy()

now modifying FINAL_DICT[ latest_lowest['pg_id'] ]['group_name'] doesn't change the values of others FINAL_DICT[ latest_lowest['pg_id'] ]

A: In Python dictionaries are mutable objects and are therefore not copied by default. You can read more about this here: python dictionary passed as an input to a function acts like a global in that function rather than a local
If the whole pass by name vs pass by value vs pass by reference thing is too confusing then all you need to know is that Python does not normally make a copy of a list or dict when assigning values using =. When you want to make a copy of a list or dict you need to explicitly tell Python you would like a copy. So in summary
x = {"hello": "world"}
y = x
y["hello"] = "not world"
print("x is " + str(x))
print("y is " + str(y))

> x is {'hello': 'not world'}
> y is {'hello': 'not world'}

vs
x = {"hello": "world"}
y = x.copy()
y["hello"] = "not world"
print("x is " + str(x))
print("y is " + str(y))

> x is {'hello': 'world'}
> y is {'hello': 'not world'}


text:
Q: SP 2016 with March CU stating Application with Search is not compliant The minrole feature is supposedly supported, but is not reflecting such.

A: [SOLVED] - Thanks to Trevor Seward
I had intentionally installed the Foundation Web Application on the WFE and not the APP, thinking it was correct since the APP should not serve pages, but apparently there are situations and reasons that it is needed on the APP server.
I followed https://sharepointumar.wordpress.com/2013/10/11/restart-microsoft-sharepoint-foundation-web-application-service-stuck-at-stopping/comment-page-1/#comment-146 to provision the service and then the missing web applications.
The Provision() method can be invoked to only provision on the server that invoked it, instead of needing to use ProvisionGlobally().

redpajama_set_name: RedPajamaStackExchange


text:
Q: Meteor: sending info to disconnected templates on clicks I am trying to do a single page app in which a task bar of items is created on clicking some links and when any item on task bar is clicked, it has a corresponding div element in the DOM that must be hidden or shown. So the task bar elements are in separate template and the div elements that task bar manipulates are in separate template. I thought of being able to simply set the display='block' or display='none' using spacebars depending on which task bar item is clicked. but the biggest challenge i am facing is, how to send the ID of the div element to the event handler or helper method?
div elements that need to be hidden or shown.
<template name="currentDisplay">
{{#each dispElems}}

{{/each}}
</template>

task bar or menu items
<template name="siteHome">

{{> Meteor.userId}}

logout

Home

Files

Comm

    {{> currentDisplay}}

</template>

I wrote following code but it doesn't work.
var navElemsArray = ["nav1"];
var navElemsDispArray = ["disp-nav1"];
var navElemsSettingsArray = ["block"];
var incrementedIndex = 0;

var dispElems = new Mongo.Collection("dispElems");
dispElems.insert({elemId:"nav1", dispId: "disp-nav1", dispType: "block"});

Template.siteHome.events({
'click .logout': function (e, t) {
    Meteor.logout();
},
'click .nav': function (e, t) {
    var elemId = e.currentTarget.id;
    //console.log(navElemsArray);
    console.log(elemId);
    var currentElemIndex = _.indexOf(navElemsArray, elemId);
    console.log(currentElemIndex);
    if(currentElemIndex == -1)
    {
        dispElems.insert({elemId: elemId, dispId: "disp-"+elemId, dispType: "block"});

     /*   navElemsArray.push(elemId);
        navElemsArray.push("disp-"+elemId);
        navElemsSettingsArray.push("block");*/
        incrementedIndex++;
        console.log("INDEX= "+currentElemIndex);
        UI.insert(UI.render(Template.currentDisplay), $("#swapArea").get(0));
    }
    currentNavIndex = currentElemIndex;
    console.log("before loop");
/*        var dE = dispElems.find();
    dE.forEach(function (elem) {
        if(elem.elemId != incrementedIndex) elem.dispType = "none";
    });
*/
    /*
    for(i=0;i<navElemsArray.length;i++)
    {
        console.log("Setting for "+i);
        if(i == incrementedIndex)
        {
            console.log("Setting block for "+i);
            navElemsSettingsArray[i] = "block";
        }
        else
        {
            console.log("Setting none for "+i);
            navElemsSettingsArray[i] = "none";
        }
    }*/
}
}
});

Any tips are appreciated.

A: I would suggest you to use
http://bootstrapdocs.com/v3.2.0/docs/components/#nav-tabs
for handling tabs functionality.

To send id to the template you can use data argument (example):

    {{>  Template.dynamic template=currentDisplay data = myDataHelper}}

Have a variable id like
    var incrementedIndex = 0;
    var elemId;

Template.siteHome.events({
        'click .nav': function (e, t) {
           elemId = e.currentTarget.id;
           .....
        }
    });

Template.siteHome.helpers({
     myDataHelper: function () {
          return elemID;
     }
});

Then get the id in currentDisplay template :
Template.currentDisplay.rendered = function () {
     var id = this.data;
}


text:
Q: Subset-join-replace using R data.table I have a dataset consisting of id-name pairs. These pairs can appear multiple times. In some rows the value in the name column is missing, in others the id is missing:
id_name = data.table(stringsAsFactors=FALSE,
                 id = c("x123", "xy234","x123",NA,"z123","y123","d654","d654"),
                 name = c("john", "mary", NA,"mary","bob","bob", "john",NA)
                     )

I would like to replace only the NA values in one column with the (non-missing) value from another row, using the other column as lookup value. The result should be:
            id name
      1:  x123 john
      2: xy234 mary
      3:  x123 john
      4: xy234 mary
      5:  z123  bob
      6:  y123  bob
      7:  d654 john
      8:  d654 john

What is the idiomatic way of achieving this, the data.table way? The following approach for updating only the name column does not produce an error, but it does not update the dataset either :
id_name[is.na(name)][id_name[!is.na(name)], on="id", name:=i.name]
> id_name
      id name
1:  x123 john
2: xy234 mary
3:  x123 <NA>
4:  <NA> mary
5:  z123  bob
6:  y123  bob
7:  d654 john
8:  d654 <NA>

However, just subset-and-join without update works:
id_name[is.na(name)][id_name[!is.na(name)], on="id",nomatch=0L]

     id name i.name
1: x123 <NA>   john
2: d654 <NA>   john

UPDATE
Updated MRE to make clear that some names can be associated with 2 ids. Both ids have to be kept.

A: We can group by 'name', 'id', and replace the NA elements in 'id' by the first non-NA value
id_name[, id := id[!is.na(id)][1], name]
id_name[, name := name[!is.na(name)], id]

-output
id_name
#     id  name
#1:  x123  john
#2: xy234 marry
#3:  x123  john
#4: xy234 marry

Update
We can use fill from tidyr
library(tidyr)
id_name1 <- id_name[, fill(.SD, id), name][,  fill(.SD, name) , id]
id_name1
#      id name
#1:  x123 john
#2:  x123 john
#3:  d654 john
#4:  d654 john
#5: xy234 mary
#6: xy234 mary
#7:  z123  bob
#8:  y123  bob

A: I think you are looking for:
id_name[is.na(name), name :=
    id_name[!is.na(name)][.SD, on=.(id), x.name]
]
id_name[is.na(id), id :=
    id_name[!is.na(id)][.SD, on=.(name), mult="first", x.id]
]
id_name

A: You can use zoo's na.locf to fill the missing values.
library(zoo)
library(data.table)

id_name[, id := na.locf(id), name]
id_name[, name := na.locf(name), id]
id_name

#      id  name
#1:  x123  john
#2: xy234 marry
#3:  x123  john
#4: xy234 marry


text:
Q: How to iterate through a dict in pandas when some outputs will repeat I have a series that starts with a state name and then list certain cities in that state, like so...
locations = ['Alabama', 'Auburn', 'Tuscaloosa', 'Alaska', 'Fairbanks', 'Arizona', 'Flagstaff', 'Tempe', 'Tuscon']

and a dict which takes state names and turns them into postal codes, like so...
state_codes = {'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ'}

what I want is a dataframe x with each postal code applied properly to each location, whether the location is a city or a state...
State              RegionName
'Alabama'          AL
'Auburn'           AL
'Tuscaloosa'       AL
'Alaska'           AK
'Fairbanks'        AK
'Arizona'          AZ
'Flagstaff'        AZ
'Tempe'            AZ
'Tuscon'           AZ

...but I can't quite seem to find the right code to get me there. I had been trying to use a temporary value that changes whenever a new state name is detected:
temp = 'fail'
newAreas = []
for k in range(0, len(locations)):
    if (locations[k] in state_codes.items()):
        temp = state_codes[locations[k]]
    newAreas.append(temp)

...but that returns a column of entirely the word 'fail.'  What am I doing wrong?

A: Use map and ffill
In [483]: locations = ['Alabama', 'Auburn', 'Tuscaloosa', 'Alaska', 'Fairbanks',
                       'Arizona', 'Flagstaff', 'Tempe', 'Tuscon']

In [484]: state_codes = {'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ'}

In [485]: df = pd.DataFrame({'State': locations})

In [496]: df['RegionName'] = df['State'].map(state_codes).ffill()

In [497]: df
Out[497]:
        State RegionName
0     Alabama         AL
1      Auburn         AL
2  Tuscaloosa         AL
3      Alaska         AK
4   Fairbanks         AK
5     Arizona         AZ
6   Flagstaff         AZ
7       Tempe         AZ
8      Tuscon         AZ

A: This is one way:
from collections import defaultdict
from itertools import chain

locations = ['Alabama', 'Auburn', 'Tuscaloosa', 'Alaska', 'Fairbanks', 'Arizona', 'Flagstaff', 'Tempe', 'Tuscon']
state_codes = {'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ'}

d = defaultdict(list)
for loc in locations:
    if loc in state_codes:
        current_loc = loc
    d[state_codes[current_loc]].append(loc)

# defaultdict(list,
#             {'AK': ['Alaska', 'Fairbanks'],
#              'AL': ['Alabama', 'Auburn', 'Tuscaloosa'],
#              'AZ': ['Arizona', 'Flagstaff', 'Tempe', 'Tuscon']})

df = pd.DataFrame(list(chain(*(((j, k) for j in v) for k, v in d.items()))),
                  columns=['State', 'RegionName'])

#         State RegionName
# 0     Alabama         AL
# 1      Auburn         AL
# 2  Tuscaloosa         AL
# 3      Alaska         AK
# 4   Fairbanks         AK
# 5     Arizona         AZ
# 6   Flagstaff         AZ
# 7       Tempe         AZ
# 8      Tuscon         AZ

A: Here is one way. Create a mapping of location to state code. Then use this with apply().
locations = ['Alabama', 'Auburn', 'Tuscaloosa', 'Alaska', 'Fairbanks', 'Arizona',
             'Flagstaff', 'Tempe', 'Tuscon']
state_codes = {'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ'}

# this assumes that the series that starts with a state name
# and then list certain cities in that state as described in the OP
loc_to_state = {}
for l in locations:
    if l in state_codes:
        current_state = l
    else:
        loc_to_state[l] = state_codes[current_state]

df1 = pd.DataFrame(columns=['State', 'RegionName'])
df1['State'] = locations
df1['RegionName'] = df1['State'].apply(
    lambda x: x if x in state_codes else loc_to_state.get(x, 'fail')
)

print(df1)
#        State RegionName
#0     Alabama    Alabama
#1      Auburn         AL
#2  Tuscaloosa         AL
#3      Alaska     Alaska
#4   Fairbanks         AK
#5     Arizona    Arizona
#6   Flagstaff         AZ
#7       Tempe         AZ
#8      Tuscon         AZ

The dictionary loc_to_state looks like:
{
    'Auburn': 'AL',
    'Fairbanks': 'AK',
    'Flagstaff': 'AZ',
    'Tempe': 'AZ',
    'Tuscaloosa': 'AL',
    'Tuscon': 'AZ'
}

The dictionary get() function return the value if the key exists in the dictionary. Otherwise, it will return 'fail'.

A: Data from Zero
pd.Series(state_codes).get(df.State).ffill()
Out[1250]:
State
Alabama       AL
Auburn        AL
Tuscaloosa    AL
Alaska        AK
Fairbanks     AK
Arizona       AZ
Flagstaff     AZ
Tempe         AZ
Tuscon        AZ
dtype: object


text:
Q: How to preview unfinished torrent video files I'm using uTorrent 2.0 and downloading videos. Some videos are large and I don't want to wait till their download is completed in order to preview. Is there a way I can preview the finished part of the videos with the .!ut extension?

A: This is not possible in 2.0.
However.... µTorrent 2.1 alpha has this functionality.

(screenshot borrowed from DownloadSquad link above)
You can grab the latest build from here.

A: With a good media player (e.g. KMplayer or VLC) you could open uncomplete files.
Except the order in which the file is downloaded, it's not really dependant of the download manager.... So you could do it with any µTorrent version, it's just not integrated in versions previous 2.1 alpha.
The real condition is to have downloaded the first and last part of the file. There's an option in Option > Preferences > Advanced > bt.prio_first_last_piece that let you prioritize these pieces, but it's not recommended for the global network speed... (I hope it will not be the default in 2.1)
So, if you have donwloaded these parts, you just have to going in your download directory and open them with the adequate media player. (For convenience, if you check Option > Preferences > General > "Append .!ut to incomplete files" you could register this extension with a dedicated media player...)

A: What you need is a torrent Client that has "Sequential Download" option which gives you the option to download a file in order and view it on players that can read partial files like KMPlayer and PotPlayer.
P.S.
I'm using tTorrent on my android. I'm watching movies while it downloads. also gives you the option to download in sequence before you start the download. Try it. it has a lot of options.

A: I'm currently running ubuntu, and I am able to find where the partial video files are stored and open them with vlc player. I would assume that you could do the same thing in any other operating system provided that you know where the files are located.
Be aware that viewing these files may corrupt the data and cause downloading to be extended due to junk bits, and that your video quality is going to be absolutely horrible until the file finishes downloading. This is because these files are not downloaded sequentially and linearly from 0:00 to the end consecutively.

A: The first thing you need is a torrent client that can download file parts in order. AFAIK BitComet can also do that and has a preview button (I think it launches an embedded mplayer).
The second thing you need is a player that can play unfinished files (also optionally, to recreate the index info, so you could navigate the file). Mplayer can do that.
You would also need some good connection.
Here's a solution for OS X: https://apple.stackexchange.com/questions/30244/watch-1080p-torrents-while-downloading/30374#30374

A: Use bitcomet if you want a preview dowload mode. all versions have this functionality


text:
Q: How to add bookmarkt to UITableView Cell & save to CoreData? I have a question on adding bookmark/favorite button to a UITableView. Currently my mainVC has a tableView that is populated from a public database in CloudKit. If I want to add a bookmark/favorite button where the user can save the data for that row into CoreData (string objects, image, boolean type)...how I do I execute that?
I added the button as an outlet to UITableViewCell. In the cellForRow, I added
cell.favoriteButton.tag = indexPath.row

Then I added a @IBAction addFavorites to that MainVC, but I'm unsure how do I save all the objects to CoreData from that row?
This is my save to Core Data method:
if let managedObjectContext = (UIApplication.sharedApplication().delegate as? AppDelegate)?.managedObjectContext
{
   place = NSEntityDescription.insertNewObjectForEntityForName("Place", inManagedObjectContext: managedObjectContext) as! Place
   place.name = name!
   place.type = type!
   place.address = address!
   place.neighborhood = neighborhood!
   place.phoneNumber = phoneNumber!
   if let placeImage = imageView.image
   {
      place.image = UIImagePNGRepresentation(placeImage)
   }
   do {
      try managedObjectContext.save()
   } catch {
      print(error)
      return
   }

Any advice?

A: First, I think using tags is not a very good idea. To identify a row with a button use this method:
let point = button.convertPoint(CGPointZero, toView: tableView)
let indexPath = tableView.indexPathForRowAtPoint(point)!

Second, where are you getting your variables from? In your code it looks like you are using properties associated with the cell. That is also not a good idea because you should not use the view to read your data - instead use the original CloudKit data source.
Third, it is not advisable to store an image in Core Data unless it is just a small thumbnail. If it is larger, use external storage, devise a scheme in your application documents folder or download on demand from CloudKit.
Finally, it is not clear what else you need. I suppose you want to display the favorite status in the table view. If you could include some kind of unique identifier, you could check the existence of this identifier in cellForRowAtIndexPath in your Core Data set of objects and mark the cell accordingly.


text:
Q: Preposition and article prior to dates - UK vs US differences In the lead of the Wikipedia article on the JWST, I notice the following fragment:

It was launched 25 December 2021…

As a Brit, I recognize that as an American form. In the UK, we'd tend to use, "launched on the" (or "launched on" if the order of the month and day was reversed), but I acknowledge that all three forms (as well as several others) are "correct" in their respective locales.
But I wonder if anyone could give a brief analysis of what is going on with the various types; something akin to the excellent answers by John Lawler and Barrie England to a question about a related question entitled To write or to write to?. I was particularly intrigued by John's mention of "Dative Alternation" and wondered if a related mechanism might be at play here?

Note: I'm aware there are a few existing questions on the use/non-use of prepositions prior to dates, but none I could find get into the details I'm looking for.


text:
Q: Substitute of tabulation in web browsers It is annoying that double-newline is used to mark a beginning of paragraph in most websites. This happens both because some software strips the leading tabulation (and probably spaces too) and because Tab key is a focus shifter in all browsers which I know.
So, what is a consistent way of indenting paragraphs when writing a text in web browser text field on a random website?


text:
Q: Can we use Admob reward ads without giving any rewards to user? I wanted to ask is it legal to use the Google Admob reward ads without giving any reward to the user like coins, points or etc. And can we use these ads in non-gaming applications like maps applications or chatting applications and etc.

A: The video type of interstitial ads rather than the rewarded video ads should suit your purpose. Try using the sample unit id for the interstitial video written in this page to see if it is really what you want.

A: I guess is legal and feasible. Rewarded ads are commonly used to continue playing with same items, weapons, collectables... after your character dies instead of losing all the progress. And AdMob is not limited to games.


text:
Q: How to polyfill FormattedDate on SSR? The problem is that FormattedDate from react-intl generates one content on SSR and another one on client side.
I took for example this project to demonstrate error:
https://github.com/weiliang903/react-intl-with-next
From SSR I'll get 'Tue, Oct 15' but on client side 'Tuesday, October 15'. What is the problem?
<FormattedDate
  value={new Date()}
  weekday="long"
  month="long"
  day="2-digit"
/>

A: The error occurs from config for this function. You should provide only combinations described on this page or function will use default config.


text:
Q: Could not find the correct Provider above this EditRetailer Widget
@override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Column(
        children: <Widget>[
          _myAppBar(context),
          Container(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height - 80,
            child: ListView.builder(
                itemCount: items.length,
                itemBuilder: (context, index) {
                  return Stack(children: <Widget>[
                    // The containers in the background
                    Column(children: <Widget>[
                      Padding(
                        padding: EdgeInsets.only(left: 8.0, right: 8.0),
                        child: Container(
                          width: MediaQuery.of(context).size.width,
                          height: 80.0,
                          child: Padding(
                            padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
                            child: Material(
                              color: Colors.white,
                              elevation: 14.0,
                              shadowColor: Color(0x802196F3),
                              child: Center(
                                child: GestureDetector(
                                child: Padding(
                                  padding: EdgeInsets.all(8.0),
                                  child: Row(
                                    mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                    children: <Widget>[
                                      Text(
                                        '${items[index].name}',
                                        style: TextStyle(
                                            color: Colors.black,
                                            fontSize: 20.0),
                                      ),

                                    ],
                                  ),
                                ),
                                  onTap: () {
                                    Navigator.of(context).push(MaterialPageRoute(
                                        builder: (context) => EditRetailer(items[index])));
                                  },
                  ),
                              ),
                            ),
                          ),
                        ),
                      ),
                    ]),
                  ]);
                }),
          ),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        backgroundColor: Color(0xFFFA7397),
        child: Icon(
          FontAwesomeIcons.listUl,
          color: Color(0xFFFDDE42),
        ),
        onPressed: () {
          //Navigator.push(context,MaterialPageRoute(builder: (context) => TaskScreen()),
          Navigator.push(
            context,
            MaterialPageRoute(
                builder: (context) => RetailerScreen(Retailer('', '', '', '')),
                fullscreenDialog: true),
          );
        },
      ),
    );
  }

The problem occurred when i add this line of code into my above widget :
 onTap: () {
                                    Navigator.of(context).push(MaterialPageRoute(
                                        builder: (context) => EditRetailer(items[index])));
                                  },

My editRetailer.dart code
class EditRetailer extends StatefulWidget {
  final Retailer retailer;

  EditRetailer([this.retailer]);

  @override
  _EditRetailerState createState() => _EditRetailerState();
}

class _EditRetailerState extends State<EditRetailer> {
  final nameController = TextEditingController();
  final phoneController = TextEditingController();
  final gstController = TextEditingController();
  final addressController = TextEditingController();

  @override
  void dispose() {
    nameController.dispose();
    phoneController.dispose();
    gstController.dispose();
    addressController.dispose();
    super.dispose();
  }

  @override
  void initState() {
    if (widget.retailer == null) {
      //New Record
      nameController.text = "";
      phoneController.text = "";
      gstController.text = "";
      addressController.text = "";
      new Future.delayed(Duration.zero, () {
        final retailerProvider = Provider.of<RetailerProvider>(context,listen: false);
        retailerProvider.loadValues(Retailer(null,null,null,null));
      });
    } else {
      //Controller Update
      nameController.text=widget.retailer.name;
      phoneController.text=widget.retailer.phone;
      gstController.text=widget.retailer.gst;
      addressController.text=widget.retailer.address;

      //State Update
      new Future.delayed(Duration.zero, () {
        final retailerProvider = Provider.of<RetailerProvider>(context,listen: false);
        retailerProvider.loadValues(widget.retailer);
      });

    }

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    final retailerProvider = Provider.of<RetailerProvider>(context);

    return Scaffold(
      appBar: AppBar(title: Text('Edit Retailer')),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: ListView(
          children: <Widget>[
            TextField(
              controller: nameController,
              decoration: InputDecoration(hintText: 'Retailer Name'),
              onChanged: (value) {
                retailerProvider.changeName(value);
              },
            ),
            TextField(
              controller: phoneController,
              decoration: InputDecoration(hintText: 'Retailer Phone'),
              onChanged: (value) => retailerProvider.changePhone(value),
            ),
            TextField(
              controller: gstController,
              decoration: InputDecoration(hintText: 'Retailer GST'),
              onChanged: (value) => retailerProvider.changeGst(value),
            ),
            TextField(
              controller: addressController,
              decoration: InputDecoration(hintText: 'Retailer Address'),
              onChanged: (value) => retailerProvider.changeAddress(value),
            ),
            SizedBox(
              height: 20.0,
            ),
            RaisedButton(
              child: Text('Save'),
              onPressed: () {
                retailerProvider.saveRetailer();
                Navigator.of(context).pop();
              },
            ),
            (widget.retailer !=null) ? RaisedButton(
              color: Colors.red,
              textColor: Colors.white,
              child: Text('Delete'),
              onPressed: () {
                retailerProvider.removeProduct(widget.retailer.gst);
                Navigator.of(context).pop();
              },
            ): Container(),
          ],
        ),
      ),
    );

  }
}

This is the error im getting while running the app.
Error: Could not find the correct Provider<RetailerProvider> above this EditRetailer Widget

This likely happens because you used a `BuildContext` that does not include the provider
of your choice. There are a few common scenarios:

- The provider you are trying to read is in a different route.

  Providers are "scoped". So if you insert of provider inside a route, then
  other routes will not be able to access that provider.

- You used a `BuildContext` that is an ancestor of the provider you are trying to read.

  Make sure that EditRetailer is under your MultiProvider/Provider<RetailerProvider>.
  This usually happen when you are creating a provider and trying to read it immediatly.


text:
Q: How to loop through multiple values in a dictionary to create a long list in python Just wondering if there is an easy way to create a list of filenames from different values in a dictionary. For example:
thisdict = {
  "V": [20,40,60,80],
  "F": [0.1,0.2],
  "T": [4,3]
}
totalRuns = 1
for val in thisdict.keys():
    totalRuns = totalRuns*len(thisdict[val])

fileList = ['Run_Name']*totalRuns

The end goal to have a list of string outputs like:
Run_Name_20V_0.1F_4T,
Run_Name_40V_0.1F_4T,
Run_Name_60V_0.1F_4T,
Run_Name_80V_0.1F_4T,
Run_Name_20V_0.2F_4T,
Run_Name_40V_0.2F_4T,
Run_Name_60V_0.2F_4T,
Run_Name_80V_0.2F_4T,
Run_Name_20V_0.1F_3T,
Run_Name_40V_0.1F_3T,
Run_Name_60V_0.1F_3T,
Run_Name_80V_0.1F_3T,
Run_Name_20V_0.2F_3T,
Run_Name_40V_0.2F_3T,
Run_Name_60V_0.2F_3T,
Run_Name_80V_0.2F_3T
Since we have 4 for V, 2 for F and 2 for T, we would want a list of size 16 (4x2x2)
Thanks!


text:
Q: How to implement in a pipe a search and a highlighting? After several unsuccessful searches, I would like to know if there is the possibility in a pipe to associate a search function and a highlighting function.
The only example I found and this one :
https://stackblitz.com/edit/angular-searchpipe-8q9jyc
who does the research and highlighting but in two different pipe.
Maybe the use of the pipe may not be the right solution for both these features.
Can be go through a service or component ....
If you have any solutions that could teach me I'm a taker

A: You can pass another argument to the pipe to highlight your contents, along with search term if you choose to
Pipe
transform(list: any[], searchText: string, highlight?: boolean): any[] {
  if (!list) { return []; }
  if (!searchText) { return list; }

  searchText = searchText.toLowerCase();
  let response = list.filter( item => {
    return item.name.toLowerCase().includes(searchText);
  });

  if(highlight) {
    response = response.map(item => ({
      ...item,
      name: this._sanitizer.bypassSecurityTrustHtml(
        item.name.replace(searchText, `<span style='background-color:yellow'>${searchText}</span>`)
      )
    }));
  }
  return response;
}

Template:

you can pass multiple arguments to pipe separated by : here I am passing a second argument doHighlight=true wishing to highlight my filtered matches, If you choose not to highlight them just pass doHighlight=false or don't pass anything as highlight is an optional argument.
Demo: https://stackblitz.com/edit/angular-searchpipe-bmzzez


text:
Q: Filtering lists which have the same number of different elements in them in Haskell I am pretty new to Haskell and I have the data data Instruction = Add | Sub | Mul | Div | Dup | Pop deriving (Eq,Ord,Show,Generic) and I am generating lists with all possible combinations of Mul and Dup with mapM (const [Mul, Dup]) [1..n]) of size n.
I wanted only the lists starting with Dup and ending with Mul so I used filter((== Mul) . last)(filter((== Dup) . head) (mapM (const [Mul, Dup]) [1..n])) but I also want only the lists with the same number of Mul and Dup in them but I can't seem to come up with a way of doing this. How do I filter this and is there a more efficient way of doing this as there may be a huge amount of combinations as lists get bigger?
A sample list would look like this: [Dup,Mul,Dup,Mul] and [Dup,Dup,Mul,Mul] for lists of size 4.

A: While your approach is correct, I think it's not the most efficient one. You generate 2^N lists and then filter out many of them. Forgetting the other requirements to keep the counting simple, by requiring that we have as many Muls as Dups, we end up with only choose(N, N/2) lists (the number of subsets of size N/2 of 1..N), which is a much smaller figure.
We can instead try to avoid the filtering and generate the wanted lists, only, in the first place. I suggest the following approach, which you can modify as needed to satisfy the other requirements.
We define a function sameMulDup which takes two integers m and d and generates all the lists with m Muls and d Dups.
sameMulDup :: Int -> Int -> [[Instruction]]
sameMulDup 0 d = [replicate d Dup]
sameMulDup m 0 = [replicate d Mul]
sameMulDup m d = do
    -- generate the first element
    x <- [Dup, Mul]
    -- compute how many m and d we have left
    let (m', d') = case x of
           Dup -> (m  , d-1)
           Mul -> (m-1, d  )
    -- generate the other elements
    xs <- sameMulDup m' d'
    return (x:xs)

Intuitively, if d=0 or m=0 there is only one possible list to include in out list-of-lists result. Otherwise, we non deterministically pick the first element, decrement the correponding counter d or m, and generate the rest.
Alternatively, the last equation can be replaced by the following more basic one:
sameMulDup m d =
    map (Dup:) (sameMulDup m (d-1))
    ++
    map (Mul:) (sameMulDup (m-1) d)

Anyway, given sameMuldup, you should be able to solve your full task.

A: It should be possible to define a function countPred :: a -> [a] -> Int, which counts the number of items in the list which are equal to the first argument; you can then do filter (\l -> countPred Mul l == countPred Dup l) (or alternately filter ((==) <$> countPred Mul <*> countPred Dup) if you prefer point-free form). Another approach I suppose might be to do (==0) . sum . map (\case { Mul -> 1, Dup -> (-1) }), but that strikes me as being slightly more complex than necessary.

A: I like chi's answer, but in a comment, I mentioned that it doesn't achieve as much sharing as it could. I speculated that the sharing would be beneficial if you iterate over the list of instructions multiple times, but worse if you iterate just once. Empirically, the sharing version appears to be faster no matter how many times you iterate, but the memory tradeoff is as predicted: worse for one iteration, better for multiple. So I thought it might be interesting to show it.
Here's how it looks. We're going to make an infinite list of answers. The first index will be how long the list of instructions will be; the second is how many Muls there are (though I'll use True and False instead of Mul and Dup). So:
bits :: [[[[Bool]]]]
bits = iterate extend [[[]]] where
    extend bsss = zipWith (++)
        (map (map (False:)) bsss ++ [[]])
        ([[]] ++ map (map (True:)) bsss)

For completeness, here's how you write a function with the same signature as chi's sameMulDup, and computing the same answer (up to the swap to Bool):
sameMulDup' :: Int -> Int -> [[Bool]]
sameMulDup' m d = bits !! (m+d) !! m

Some timings on my machine, for m=d=12, when compiled -O2:
sameMulDup , one iteration  1.35s    6480Kb
sameMulDup', one iteration  1.11s  226476Kb
sameMulDup , two iterations 4.26s 2135368Kb
sameMulDup', two iterations 1.97s  620880Kb

Here is the driver code I used for acquiring these numbers:
main :: IO ()
main = do
    [sharing, twice, m, d] <- getArgs
    let answer = (if read sharing then sameMulDup' else sameMulDup) (read m) (read d)
    if read twice
       then do
           print . sum . map (sum . map fromEnum) $ answer
           print . sum . map (sum . map (fromEnum . not)) $ answer
        else print . sum . map (sum . map fromEnum) $ answer

There are some subtle points here:

*

*To iterate over the list twice, we must have a way of referring to the same list in both iterations. This is answer in the above code.

*We must use an iteration that actually forces all the values for it to be useful. I do this by counting up how many Trues there are, but there are other ways. (Just printing the whole list doesn't work well: the calculation's runtime is then dwarfed by the production of the String to print and the work done in transferring it to the terminal.)

*Although the first iteration uses the same code in both branches of the if, it is important that this code not be shared and moved out of the if. We want the compiler to know in the else branch that answer will not be used again, so that it may garbage collect. If you write print answer >> if twice then print answer else pure (), it is not as obvious statically when the prefix of answer may be garbage collected.

*In the then branch, I used two different calculations in the two loops, so that the compiler did not attempt to get clever and do the calculation just once and then print the calculated result twice.


text:
Q: Why does constructing a new object potentially alter the field of *every* instance of that class? Here's a simplified version of the code in question:
class thing:
    def __init__(self, data1, data2={'foo': 1}):
        self.data2 = data2
        self.data2['bar'] = data1

datas = ['FIRST', 'SECOND']
things = [thing(x) for x in datas]
for p in things:
    print p.data2['bar']

I would expect this code to return:
FIRST
SECOND

However, it actually returns:
SECOND
SECOND

Why?

My best guess is:

*

*that I am creating a single dictionary ur_dict = {'foo': 1},

*that when I initialize an object of class thing I am not creating a new dictionary self.data2={'foo': 1} but rather initializing a reference to ur_dict,

*and that when, in the constructor, I add the key-value pair bar: data1 to self.data2, I'm actually adding that key and value to ur_dict itself. This would update the data2 field of every single object in the list.

I tested this hypothesis by appending the following snippet to the code above:
things[0].data2['bar'] = 'FIRST'
for p in things:
    print p.data2['bar']

Sure enough, the result is:
FIRST
FIRST

So I think my hypothesis is probably correct, but it's still mysterious to me. My question seems very related to this question --- when I create a default value in a constructor, is this value a class variable instead of an instance variable? Why doesn't python create new objects for default values of arguments in an object? Is there a good way to conceptualize or to catch this kind of error in the future? What are some good references to learn about what's going on here?
(Apologies in advance if I mangled jargon; I'm a mathematician by formal education.)

Edit: @CrazyPython[::-1] mentioned this is a property of functions, not classes or objects. I created an example of a function with a mutable default argument and I'm trying to figure out how to break it in the manner I experienced with objects and classes above. Came up with this:
EXPONENT = 1
def fooBar(x, y=EXPONENT):
    return x**y
print EXPONENT
print foo(5)
EXPONENT = 2
print EXPONENT
print foo(5)

However, it returns:
1
5
2
5

What's a good way to "break" this to illustrate why not to use a mutable default argument here?

A: self.data2={'foo': 1} is a mutable default argument. Never do that. 99% of the time it's a mistake.
def foo(a, b={}):
    ...

is not equivalent to
def foo(a, b=None):
    if b is None:
        b = {}

b is not reconstructed every time. It's the same object.

Is there a good way to conceptualize or to catch this kind of error in the future?

Use PyCharm or another good editor

when I create a default value in a constructor, is this value a class variable instead of an instance variable?

no no no no no no. It's tied to the function, not the class or instance. This is behavior applies to all functions. It has nothing to do with classes or your linked question.

Why doesn't python create new objects for default values of arguments in an object?

Performance and compatibility. Constructing an object is a potentially expensive operation.

Addendum

*

*Please use CamelCase for classes. Not doing so is a PEP 8 violation, which is the Python official style guide.

*Get a decent editor. Personally, I recommend PyCharm. (I'm no salesperson) It's free.

*

*PyCharm can rename variables, highlight PEP 8 errors, perform advanced auto complete, type checking, spot mutable default arguments, and much more.

*You aren't inheriting off of object. That's bad.*

Why does this python code alter the field of every object in a list?

*Without context, that's a bad title. It asks about the code. When we read the title, we don't have the code.

Making it more clear
When a function is stated, the default arguments are evaluated. (not when it is executed, when it is stated) They are tied to the function. When a function is executed, a copy of the default arguments is not produced. You directly modify the default arguments. The next function that is called will receive the same object, with modifications.

*You seem to be a professor or the like. Please don't be offended by a meme. That's just the risk of getting advice from the internet.


text:
Q: why don't we have an error, after using replaceWith() method on a constant object reference value? I have trouble comprehending, why this code has no errors,
aren't we changing reference value by using the replaceWith() method?
const btn = document.getElementById("btn");

btn.replaceWith(btn.cloneNode(true));


text:
Q: Fixed width table cell I'm trying to make cells have a fixed (in px) width within a table.
This is what I have now:

                Row 1 Col 1
                Row 1 Col 2
                Row 1 Col 3

However, none of the table-cells are 4px wide. What am I missing?

A: You can add a 4th  tag, with no width specified:

            Row 1 Col 1
            Row 1 Col 2
            Row 1 Col 3

See the result here. The width of the first three cells is 4px, and the 4th, empty cell fills up the remaining width of the table.

A: Well, you can add buffer cells...
Example: http://jsfiddle.net/YGRGG/
HTML

            Row 1 Col 1

            Row 1 Col 2

            Row 1 Col 3

CSS
table {
    border: 1px solid black;
    width: 1128px;
}
table td:nth-of-type(2),
table td:nth-of-type(4),
table td:nth-of-type(6) {
    width:4px;
}


text:
Q: 'FieldBoost' causes CFIndex to fail I read in the CF10 docs that the attribute 'FieldBoost' has been added to CFIndex in order to specify which fields should have more importance in Solr's scoring.
However, it seems that not only does it not work as intended, it in fact causes the whole indexing operation to fail completely!
I've seen other posts on the Adobe forums mentioning exactly the same issue, but no replies or resolution available.
I'm running CF10 Update 11.
The following code works and indexes 14,000 records:
        <cfindex collection = "MyCollection"
        action          = "refresh"
        type            = "custom"
        query           = "Local.MyContent"
        key             = "ID"
        title           = "Name"
        body            = "Name,Description"
    >

However, if I add the FieldBoost value, there are no errors and the index operation appears to run correctly, however the collection now contains zero records:
        <cfindex collection = "MyCollection"
        action          = "refresh"
        type            = "custom"
        query           = "Local.MyContent"
        key             = "itemID"
        title           = "Name"
        body            = "Name,Description"
        fieldBoost      = "title"
    >

Has anyone had this working?

A: From the comments...
I found this bug which I believe is similar to your situation (although it was reported on a Mac platform).
Although it is not documented very well you need to include the weight with the fieldboost attribute.  For ColdFusion's implementation you specify the weight by appending it to the field you want boosted delimited with a : (colon). The attribute should look something like this:
fieldboost="title:6"

I was able to find a little bit of documentation on this attribute in the Adobe ColdFusion 10 Beta documentation (on page 106 of that document specifically). Here is an excerpt from that document:

Improving search result rankings
  The following attributes in cfindex help you improve the search result rankings:

*

*fieldBoost: Boost specific fields while indexing.
  fieldBoost enhances the score of the fields and thereby the ranking in the search results. Multiple fields can be boosted by specifying the values as a comma-separated list.

*docBoost: Boost entire document while indexing.
  docBoost enhances the score of the documents and thereby the ranking in the search results

And the following code is the example they used to show the fieldboost attribute (notice that they are boosting two fields, separated by a comma):

<cfindex collection="autocommit_check" action="update" type="file"
  key="#Expandpath(".")#/_boost1.txt" first_t="fieldboost" second_t="secondfield"
  fieldboost="first_t:1,second_t:2" docboost="6" autocommit="true">

Also check this related question for a way to boost fields during the search - CF10 Fieldboost on cfindex has no effect


text:
Q: Using rtools grep/pipe combination through a system call I have a file called goodfile. Lets say the contents are
badline
goodline
badline
goodline
badline
badline

On a windows machine I want to filter this file to get only the "goodline"s before reading it to save on memory costs. Thankfully, the rtools installation comes with grep that should allow me to do that. I should be able to do
if(!pkgbuild::has_rtools()){
    stop('install rtools')
}
rtoolsPath = pkgbuild::rtools_path()
grep = file.path(rtoolsPath,'grep.exe')

command = paste(grep, "goodline goodfile")
system(command)

and get
goodline
goodline

However when I try to pipe the output to a file by doing
command = paste(grep, "goodline goodfile > betterfile")
system(command)

I get
goodfile:goodline
goodfile:goodline
/usr/bin/grep: >: No such file or directory
/usr/bin/grep: betterfile: No such file or directory

This error message and the "betterfile" is not generated.
If I take the same command and run it on my command line, it just works, if  I do the same system call with regular grep on R in linux machine it just works, so I can't see what the problem is.
I was able to find an alternative way to get the file by doing
system2(grep,
        args = c('goodline','goodfile'),stderr = 'betterfile',stdout = 'betterfile')

but still curious why the pipe doesn't work


text:
Q: Google Play service is missing I am new to firebase and i am doing a signup activity for my app using Official Documentation but when i hit my signup button for register i got this error
Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/com.example.farrukh.firebaseaccount-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.farrukh.firebaseaccount-1/lib/x86_64, /vendor/lib64, /system/lib64]]

W/GooglePlayServicesUtil: Google Play services is missing.

I also refer to google but due to low number of users of firebase i didn't get my answer , I also look at these both Link1 Link2 answers but it wouldn't solve my issue.
I have google-service.json in my project i applied all dependencies what firebase project need and updated android studio.
What can i do?
Note : Email/Password is enabled in my firebase Auth Panel
Here's my code
public class MainActivity extends AppCompatActivity {

    private FirebaseAuth mAuth;

    private String mUserName, mUserEmail, mPassword;
    private EditText mEmail, mPass;
    Button signup;

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

        mAuth = FirebaseAuth.getInstance();
        signup = (Button) findViewById(R.id.button);
        mEmail = (EditText) findViewById(R.id.editText);
        mPass = (EditText) findViewById(R.id.editText2);

        signup.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                mUserEmail = mEmail.getText().toString();
                mPassword = mPass.getText().toString();
                mAuth.createUserWithEmailAndPassword(mUserEmail,mPassword).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        Toast.makeText(getApplicationContext(),"Success",Toast.LENGTH_LONG).show();

                        if (!task.isSuccessful()) {

                            Toast.makeText(getApplicationContext(), "Authentication failed.",
                                    Toast.LENGTH_SHORT).show();
                        }
                    }
                });
            }
        });

    }// End OnCreate

}// End Activity

A: GooglePlayServicesUtil: Google Play services is missing.

It seems that you are using a device without Google Play Service.
To test your app when using the Google Play services SDK, you must use either:

*

*A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.

*The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

More info here.

A: Got the answer, I just uninstalled the HAXM and reinstall it solves the issue and my app successfully signup the user into my authentication panel.
However still getting this line
Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/com.example.farrukh.firebaseaccount-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.farrukh.firebaseaccount-1/lib/x86_64, /vendor/lib64, /system/lib64]]


text:
Q: What is the html tag for collapsing & expanding a tree I have a html code here. I want to put the link "Google link" as a collapse, expand under label 2.
Please could any help me with html code ?

<title> Sample Page </title>

    Welcome to Google

 1

 2

 <a href = "https://www.google.co.in/" "Google link"

A: I think you are looking for

It is a HTML5 tag but it is marked as experimental.
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
So I agree to Zeratops, you should go with JS.
There are existing javascript "polyfills" for the "details" tag ...

A: Use nested ul/li tags, and JavaScript or CSS to handle expand/collapse behaviour. A very basic example in CSS:

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + ul {
    display: block;
}

ul ul {
    display: none;
}

A

        B (click on me)
        <input id="b" type="checkbox" />

B1

                B2 (click on me)
                <input id="b2" type="checkbox" />

B21

B22

B23

B3

C


text:
Q: Anaconda Navigator not opening on M2 MacBook Air running MacOS Ventura I just downloaded anaconda on my M2 MacBook Air running MacOS Ventura (version 13.2.1). The download process went smoothly and I was able to locate Anaconda Navigator. But when I try opening it, it just won't open without even showing any error message.
After trying to run it from the terminal using anaconda-navigator, I got the following error:

Note that I have python 3.9.13 which was downloaded with anaconda when I downloaded it.
I tried to uninstall and reinstall anaconda, I also tried to check the .condarc file I also tried to check the list of packages that were installed using conda list to make sure that anaconda-navigator was there (Version 2.3.1 was installed). I also tried to uninstall and reinstall anaconda navigator using conda remove anaconda-navigator & conda install anaconda-navigator but none of these worked. Is there anyone else experiencing. the same issue? Or does anyone know how to fix that?
I will include the list of packages that were also installed out of the box for your reference:
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py39hecd8cb5_1
alabaster                 0.7.12             pyhd3eb1b0_0
anaconda                  2022.10                  py39_0
anaconda-client           1.11.0           py39hecd8cb5_0
anaconda-navigator        2.3.1            py39hecd8cb5_0
anaconda-project          0.11.1           py39hecd8cb5_0
anyio                     3.5.0            py39hecd8cb5_0
appdirs                   1.4.4              pyhd3eb1b0_0
applaunchservices         0.3.0            py39hecd8cb5_0
appnope                   0.1.2           py39hecd8cb5_1001
appscript                 1.1.2            py39h9ed2024_0
argon2-cffi               21.3.0             pyhd3eb1b0_0
argon2-cffi-bindings      21.2.0           py39hca72f7f_0
arrow                     1.2.2              pyhd3eb1b0_0
astroid                   2.11.7           py39hecd8cb5_0
astropy                   5.1              py39h67323c0_0
atomicwrites              1.4.0                      py_0
attrs                     21.4.0             pyhd3eb1b0_0
automat                   20.2.0                     py_0
autopep8                  1.6.0              pyhd3eb1b0_1
babel                     2.9.1              pyhd3eb1b0_0
backcall                  0.2.0              pyhd3eb1b0_0
backports                 1.1                pyhd3eb1b0_0
backports.functools_lru_cache 1.6.4              pyhd3eb1b0_0
backports.tempfile        1.0                pyhd3eb1b0_1
backports.weakref         1.0.post1                  py_1
bcrypt                    3.2.0            py39hca72f7f_1
beautifulsoup4            4.11.1           py39hecd8cb5_0
binaryornot               0.4.4              pyhd3eb1b0_1
bitarray                  2.5.1            py39hca72f7f_0
bkcharts                  0.2              py39hecd8cb5_1
black                     22.6.0           py39hecd8cb5_0
blas                      1.0                         mkl
bleach                    4.1.0              pyhd3eb1b0_0
blosc                     1.21.0               h8346a28_1
bokeh                     2.4.3            py39hecd8cb5_0
boto3                     1.24.28          py39hecd8cb5_0
botocore                  1.27.28          py39hecd8cb5_0
bottleneck                1.3.5            py39h67323c0_0
brotli                    1.0.9                hca72f7f_7
brotli-bin                1.0.9                hca72f7f_7
brotlipy                  0.7.0           py39h9ed2024_1003
brunsli                   0.1                  h23ab428_0
bzip2                     1.0.8                h1de35cc_0
c-ares                    1.18.1               hca72f7f_0
ca-certificates           2022.07.19           hecd8cb5_0
cctools                   949.0.1             h9abeeb2_25
cctools_osx-64            949.0.1             hc7db93f_25
certifi                   2022.9.24        py39hecd8cb5_0
cffi                      1.15.1           py39hc55c11b_0
cfitsio                   3.470                hbd21bf8_7
chardet                   4.0.0           py39hecd8cb5_1003
charls                    2.2.0                h23ab428_0
charset-normalizer        2.0.4              pyhd3eb1b0_0
click                     8.0.4            py39hecd8cb5_0
cloudpickle               2.0.0              pyhd3eb1b0_0
clyent                    1.2.2            py39hecd8cb5_1
colorama                  0.4.5            py39hecd8cb5_0
colorcet                  3.0.0            py39hecd8cb5_0
conda                     22.9.0           py39hecd8cb5_0
conda-build               3.22.0           py39hecd8cb5_0
conda-content-trust       0.1.3            py39hecd8cb5_0
conda-env                 2.6.0                         1
conda-pack                0.6.0              pyhd3eb1b0_0
conda-package-handling    1.9.0            py39hca72f7f_0
conda-repo-cli            1.0.20           py39hecd8cb5_0
conda-token               0.4.0              pyhd3eb1b0_0
conda-verify              3.4.2                      py_1
constantly                15.1.0             pyh2b92418_0
cookiecutter              1.7.3              pyhd3eb1b0_0
cryptography              37.0.1           py39hf6deb26_0
cssselect                 1.1.0              pyhd3eb1b0_0
curl                      7.84.0               hca72f7f_0
cycler                    0.11.0             pyhd3eb1b0_0
cython                    0.29.32          py39he9d5cce_0
cytoolz                   0.11.0           py39h9ed2024_0
daal4py                   2021.6.0         py39h01d92e1_1
dal                       2021.6.0           haf03e11_929
dask                      2022.7.0         py39hecd8cb5_0
dask-core                 2022.7.0         py39hecd8cb5_0
dataclasses               0.8                pyh6d0b6a4_7
datashader                0.14.1           py39hecd8cb5_0
datashape                 0.5.4            py39hecd8cb5_1
debugpy                   1.5.1            py39he9d5cce_0
decorator                 5.1.1              pyhd3eb1b0_0
defusedxml                0.7.1              pyhd3eb1b0_0
diff-match-patch          20200713           pyhd3eb1b0_0
dill                      0.3.4              pyhd3eb1b0_0
distributed               2022.7.0         py39hecd8cb5_0
docutils                  0.18.1           py39hecd8cb5_3
entrypoints               0.4              py39hecd8cb5_0
et_xmlfile                1.1.0            py39hecd8cb5_0
fftw                      3.3.9                h9ed2024_1
filelock                  3.6.0              pyhd3eb1b0_0
flake8                    4.0.1              pyhd3eb1b0_1
flask                     1.1.2              pyhd3eb1b0_0
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.11.0               hd8bbffd_0
fsspec                    2022.7.1         py39hecd8cb5_0
future                    0.18.2           py39hecd8cb5_1
gensim                    4.1.2            py39he9d5cce_0
gettext                   0.21.0               h7535e17_0
giflib                    5.2.1                haf1e3a3_0
glib                      2.69.1               h8346a28_1
glob2                     0.7                pyhd3eb1b0_0
gmp                       6.2.1                he9d5cce_3
gmpy2                     2.1.2            py39hd5de756_0
greenlet                  1.1.1            py39h23ab428_0
gst-plugins-base          1.14.0               h4180768_2
gstreamer                 1.14.0               h0fc69c2_2
h5py                      3.7.0            py39h4a1dd59_0
hdf5                      1.10.6               h10fe05b_1
heapdict                  1.0.1              pyhd3eb1b0_0
holoviews                 1.15.0           py39hecd8cb5_0
hvplot                    0.8.0            py39hecd8cb5_0
hyperlink                 21.0.0             pyhd3eb1b0_0
icu                       58.2                 h0a44026_3
idna                      3.3                pyhd3eb1b0_0
imagecodecs               2021.8.26        py39h0f85e6e_1
imageio                   2.19.3           py39hecd8cb5_0
imagesize                 1.4.1            py39hecd8cb5_0
importlib-metadata        4.11.3           py39hecd8cb5_0
importlib_metadata        4.11.3               hd3eb1b0_0
incremental               21.3.0             pyhd3eb1b0_0
inflection                0.5.1            py39hecd8cb5_0
iniconfig                 1.1.1              pyhd3eb1b0_0
intake                    0.6.5              pyhd3eb1b0_0
intel-openmp              2021.4.0          hecd8cb5_3538
intervaltree              3.1.0              pyhd3eb1b0_0
ipykernel                 6.15.2           py39hecd8cb5_0
ipython                   7.31.1           py39hecd8cb5_1
ipython_genutils          0.2.0              pyhd3eb1b0_1
ipywidgets                7.6.5              pyhd3eb1b0_1
isort                     5.9.3              pyhd3eb1b0_0
itemadapter               0.3.0              pyhd3eb1b0_0
itemloaders               1.0.4              pyhd3eb1b0_1
itsdangerous              2.0.1              pyhd3eb1b0_0
jdcal                     1.4.1              pyhd3eb1b0_0
jedi                      0.18.1           py39hecd8cb5_1
jellyfish                 0.9.0            py39hca72f7f_0
jinja2                    2.11.3             pyhd3eb1b0_0
jinja2-time               0.2.0              pyhd3eb1b0_3
jmespath                  0.10.0             pyhd3eb1b0_0
joblib                    1.1.0              pyhd3eb1b0_0
jpeg                      9e                   hca72f7f_0
jq                        1.6               h9ed2024_1000
json5                     0.9.6              pyhd3eb1b0_0
jsonschema                4.16.0           py39hecd8cb5_0
jupyter                   1.0.0            py39hecd8cb5_8
jupyter_client            7.3.4            py39hecd8cb5_0
jupyter_console           6.4.3              pyhd3eb1b0_0
jupyter_core              4.11.1           py39hecd8cb5_0
jupyter_server            1.18.1           py39hecd8cb5_0
jupyterlab                3.4.4            py39hecd8cb5_0
jupyterlab_pygments       0.1.2                      py_0
jupyterlab_server         2.10.3             pyhd3eb1b0_1
jupyterlab_widgets        1.0.0              pyhd3eb1b0_1
jxrlib                    1.1                  haf1e3a3_2
keyring                   23.4.0           py39hecd8cb5_0
kiwisolver                1.4.2            py39he9d5cce_0
krb5                      1.19.2               hcd88c3b_0
lazy-object-proxy         1.6.0            py39h9ed2024_0
lcms2                     2.12                 hf1fd2bf_0
ld64                      530                 h20443b4_25
ld64_osx-64               530                 h70f3046_25
ldid                      2.1.2                h2d21305_2
lerc                      3.0                  he9d5cce_0
libaec                    1.0.4                hb1e8313_1
libarchive                3.6.1                he336d3b_0
libbrotlicommon           1.0.9                hca72f7f_7
libbrotlidec              1.0.9                hca72f7f_7
libbrotlienc              1.0.9                hca72f7f_7
libclang                  12.0.0          default_hbc2896b_2
libcurl                   7.84.0               h6dfd666_0
libcxx                    14.0.6               h9765a3e_0
libdeflate                1.8                  h9ed2024_5
libedit                   3.1.20210910         hca72f7f_0
libev                     4.33                 h9ed2024_1
libffi                    3.3                  hb1e8313_2
libgfortran               5.0.0           11_2_0_h246ff09_26
libgfortran5              11.2.0              h246ff09_26
libiconv                  1.16                 hca72f7f_2
libidn2                   2.3.2                h9ed2024_0
liblief                   0.11.5               he9d5cce_1
libllvm11                 11.1.0               h46f1229_5
libllvm12                 12.0.0               h9b2ccf5_3
libllvm14                 14.0.6               he552d86_0
libnghttp2                1.46.0               ha29bfda_0
libpng                    1.6.37               ha441bb4_0
libpq                     12.9                 h1c9f633_3
libsodium                 1.0.18               h1de35cc_0
libspatialindex           1.9.3                h23ab428_0
libssh2                   1.10.0               h0a4fc7d_0
libtiff                   4.4.0                h2ef1027_0
libunistring              0.9.10               h9ed2024_0
libwebp                   1.2.2                h56c3ce4_0
libwebp-base              1.2.2                hca72f7f_0
libxml2                   2.9.14               hbf8cd5e_0
libxslt                   1.1.35               h5b33f42_0
libzopfli                 1.0.3                hb1e8313_0
llvm-openmp               14.0.6               h0dcd299_0
llvmlite                  0.38.0           py39h8346a28_0
locket                    1.0.0            py39hecd8cb5_0
lxml                      4.9.1            py39h65b224f_0
lz4                       3.1.3            py39h9ed2024_0
lz4-c                     1.9.3                h23ab428_1
lzo                       2.10                 haf1e3a3_2
markdown                  3.3.4            py39hecd8cb5_0
markupsafe                2.0.1            py39h9ed2024_0
matplotlib                3.5.2            py39hecd8cb5_0
matplotlib-base           3.5.2            py39hfb0c5b7_0
matplotlib-inline         0.1.6            py39hecd8cb5_0
mccabe                    0.7.0              pyhd3eb1b0_0
mistune                   0.8.4           py39h9ed2024_1000
mkl                       2021.4.0           hecd8cb5_637
mkl-service               2.4.0            py39h9ed2024_0
mkl_fft                   1.3.1            py39h4ab4a9b_0
mkl_random                1.2.2            py39hb2f4e1b_0
mock                      4.0.3              pyhd3eb1b0_0
mpc                       1.1.0                h6ef4df4_1
mpfr                      4.0.2                h9066e36_1
mpi                       1.0                       mpich
mpich                     3.3.2                external_0
mpmath                    1.2.1            py39hecd8cb5_0
msgpack-python            1.0.3            py39haf03e11_0
multipledispatch          0.6.0            py39hecd8cb5_0
munkres                   1.1.4                      py_0
mypy_extensions           0.4.3            py39hecd8cb5_1
navigator-updater         0.3.0            py39hecd8cb5_0
nbclassic                 0.3.5              pyhd3eb1b0_0
nbclient                  0.5.13           py39hecd8cb5_0
nbconvert                 6.4.4            py39hecd8cb5_0
nbformat                  5.5.0            py39hecd8cb5_0
ncurses                   6.3                  hca72f7f_3
nest-asyncio              1.5.5            py39hecd8cb5_0
networkx                  2.8.4            py39hecd8cb5_0
nltk                      3.7                pyhd3eb1b0_0
nose                      1.3.7           pyhd3eb1b0_1008
notebook                  6.4.12           py39hecd8cb5_0
nspr                      4.33                 he9d5cce_0
nss                       3.74                 h47edf6a_0
numba                     0.55.1           py39hae1ba45_0
numexpr                   2.8.3            py39h2e5f0a9_0
numpy                     1.21.5           py39h2e5f0a9_3
numpy-base                1.21.5           py39h3b1a694_3
numpydoc                  1.4.0            py39hecd8cb5_0
olefile                   0.46               pyhd3eb1b0_0
oniguruma                 6.9.7.1              h9ed2024_0
openjpeg                  2.4.0                h66ea3da_0
openpyxl                  3.0.10           py39hca72f7f_0
openssl                   1.1.1q               hca72f7f_0
packaging                 21.3               pyhd3eb1b0_0
pandas                    1.4.4            py39he9d5cce_0
pandocfilters             1.5.0              pyhd3eb1b0_0
panel                     0.13.1           py39hecd8cb5_0
param                     1.12.0             pyhd3eb1b0_0
parsel                    1.6.0            py39hecd8cb5_0
parso                     0.8.3              pyhd3eb1b0_0
partd                     1.2.0              pyhd3eb1b0_1
patch                     2.7.6             h1de35cc_1001
pathlib                   1.0.1              pyhd3eb1b0_1
pathspec                  0.9.0            py39hecd8cb5_0
patsy                     0.5.2            py39hecd8cb5_1
pcre                      8.45                 h23ab428_0
pep8                      1.7.1            py39hecd8cb5_1
pexpect                   4.8.0              pyhd3eb1b0_3
pickleshare               0.7.5           pyhd3eb1b0_1003
pillow                    9.2.0            py39hde71d04_1
pip                       22.2.2           py39hecd8cb5_0
pkginfo                   1.8.2              pyhd3eb1b0_0
platformdirs              2.5.2            py39hecd8cb5_0
plotly                    5.9.0            py39hecd8cb5_0
pluggy                    1.0.0            py39hecd8cb5_1
ply                       3.11             py39hecd8cb5_0
poyo                      0.5.0              pyhd3eb1b0_0
prometheus_client         0.14.1           py39hecd8cb5_0
prompt-toolkit            3.0.20             pyhd3eb1b0_0
prompt_toolkit            3.0.20               hd3eb1b0_0
protego                   0.1.16                     py_0
psutil                    5.9.0            py39hca72f7f_0
ptyprocess                0.7.0              pyhd3eb1b0_2
py                        1.11.0             pyhd3eb1b0_0
py-lief                   0.11.5           py39he9d5cce_1
pyasn1                    0.4.8              pyhd3eb1b0_0
pyasn1-modules            0.2.8                      py_0
pycodestyle               2.8.0              pyhd3eb1b0_0
pycosat                   0.6.3            py39h9ed2024_0
pycparser                 2.21               pyhd3eb1b0_0
pyct                      0.4.8            py39hecd8cb5_1
pycurl                    7.45.1           py39h0a4fc7d_0
pydispatcher              2.0.5            py39hecd8cb5_2
pydocstyle                6.1.1              pyhd3eb1b0_0
pyerfa                    2.0.0            py39h9ed2024_0
pyflakes                  2.4.0              pyhd3eb1b0_0
pygments                  2.11.2             pyhd3eb1b0_0
pyhamcrest                2.0.2              pyhd3eb1b0_2
pyjwt                     2.4.0            py39hecd8cb5_0
pylint                    2.14.5           py39hecd8cb5_0
pyls-spyder               0.4.0              pyhd3eb1b0_0
pyobjc-core               8.5              py39hc55c11b_0
pyobjc-framework-cocoa    8.5              py39hca72f7f_0
pyobjc-framework-coreservices 8.5              py39hca72f7f_0
pyobjc-framework-fsevents 8.5              py39hecd8cb5_0
pyodbc                    4.0.34           py39he9d5cce_0
pyopenssl                 22.0.0             pyhd3eb1b0_0
pyparsing                 3.0.9            py39hecd8cb5_0
pyqt                      5.15.7           py39he9d5cce_0
pyqt5-sip                 12.11.0          py39he9d5cce_0
pyqtwebengine             5.15.7           py39he9d5cce_0
pyrsistent                0.18.0           py39hca72f7f_0
pysocks                   1.7.1            py39hecd8cb5_0
pytables                  3.6.1            py39h648f197_1
pytest                    7.1.2            py39hecd8cb5_0
python                    3.9.13               hdfd78df_1
python-dateutil           2.8.2              pyhd3eb1b0_0
python-fastjsonschema     2.16.2           py39hecd8cb5_0
python-libarchive-c       2.9                pyhd3eb1b0_1
python-lsp-black          1.2.1            py39hecd8cb5_0
python-lsp-jsonrpc        1.0.0              pyhd3eb1b0_0
python-lsp-server         1.5.0            py39hecd8cb5_0
python-slugify            5.0.2              pyhd3eb1b0_0
python-snappy             0.6.0            py39h23ab428_3
python.app                3                py39hca72f7f_0
pytz                      2022.1           py39hecd8cb5_0
pyviz_comms               2.0.2              pyhd3eb1b0_0
pywavelets                1.3.0            py39hca72f7f_0
pyyaml                    6.0              py39hca72f7f_1
pyzmq                     23.2.0           py39he9d5cce_0
qdarkstyle                3.0.2              pyhd3eb1b0_0
qstylizer                 0.1.10             pyhd3eb1b0_0
qt                        5.15.9               hecd8cb5_0
qt-main                   5.15.2               h719ae48_7
qt-webengine              5.15.9               h90a370e_4
qtawesome                 1.0.3              pyhd3eb1b0_0
qtconsole                 5.3.2            py39hecd8cb5_0
qtpy                      2.2.0            py39hecd8cb5_0
qtwebkit                  5.212                h24dc246_4
queuelib                  1.5.0            py39hecd8cb5_0
readline                  8.1.2                hca72f7f_1
regex                     2022.7.9         py39hca72f7f_0
requests                  2.28.1           py39hecd8cb5_0
requests-file             1.5.1              pyhd3eb1b0_0
ripgrep                   13.0.0               hc2228c6_0
rope                      0.22.0             pyhd3eb1b0_0
rtree                     0.9.7            py39hecd8cb5_1
ruamel_yaml               0.15.100         py39h9ed2024_0
s3transfer                0.6.0            py39hecd8cb5_0
scikit-image              0.19.2           py39hae1ba45_0
scikit-learn              1.0.2            py39hae1ba45_1
scikit-learn-intelex      2021.6.0         py39hecd8cb5_0
scipy                     1.9.1            py39h3d31255_0
scrapy                    2.6.2            py39hecd8cb5_0
seaborn                   0.11.2             pyhd3eb1b0_0
send2trash                1.8.0              pyhd3eb1b0_1
service_identity          18.1.0             pyhd3eb1b0_1
setuptools                63.4.1           py39hecd8cb5_0
sip                       6.6.2            py39he9d5cce_0
six                       1.16.0             pyhd3eb1b0_1
smart_open                5.2.1            py39hecd8cb5_0
snappy                    1.1.9                he9d5cce_0
sniffio                   1.2.0            py39hecd8cb5_1
snowballstemmer           2.2.0              pyhd3eb1b0_0
sortedcollections         2.1.0              pyhd3eb1b0_0
sortedcontainers          2.4.0              pyhd3eb1b0_0
soupsieve                 2.3.1              pyhd3eb1b0_0
sphinx                    5.0.2            py39hecd8cb5_0
sphinxcontrib-applehelp   1.0.2              pyhd3eb1b0_0
sphinxcontrib-devhelp     1.0.2              pyhd3eb1b0_0
sphinxcontrib-htmlhelp    2.0.0              pyhd3eb1b0_0
sphinxcontrib-jsmath      1.0.1              pyhd3eb1b0_0
sphinxcontrib-qthelp      1.0.3              pyhd3eb1b0_0
sphinxcontrib-serializinghtml 1.1.5              pyhd3eb1b0_0
spyder                    5.3.3            py39hecd8cb5_0
spyder-kernels            2.3.3            py39hecd8cb5_0
sqlalchemy                1.4.39           py39hca72f7f_0
sqlite                    3.39.3               h707629a_0
statsmodels               0.13.2           py39hca72f7f_0
sympy                     1.10.1           py39hecd8cb5_0
tabulate                  0.8.10           py39hecd8cb5_0
tapi                      1000.10.8            ha1b3eb9_0
tbb                       2021.6.0             haf03e11_0
tbb4py                    2021.6.0         py39haf03e11_0
tblib                     1.7.0              pyhd3eb1b0_0
tenacity                  8.0.1            py39hecd8cb5_1
terminado                 0.13.1           py39hecd8cb5_0
testpath                  0.6.0            py39hecd8cb5_0
text-unidecode            1.3                pyhd3eb1b0_0
textdistance              4.2.1              pyhd3eb1b0_0
threadpoolctl             2.2.0              pyh0d69192_0
three-merge               0.1.1              pyhd3eb1b0_0
tifffile                  2021.7.2           pyhd3eb1b0_2
tinycss                   0.4             pyhd3eb1b0_1002
tk                        8.6.12               h5d9f67b_0
tldextract                3.2.0              pyhd3eb1b0_0
toml                      0.10.2             pyhd3eb1b0_0
tomli                     2.0.1            py39hecd8cb5_0
tomlkit                   0.11.1           py39hecd8cb5_0
toolz                     0.11.2             pyhd3eb1b0_0
tornado                   6.1              py39h9ed2024_0
tqdm                      4.64.1           py39hecd8cb5_0
traitlets                 5.1.1              pyhd3eb1b0_0
twisted                   22.2.0           py39hca72f7f_1
typing-extensions         4.3.0            py39hecd8cb5_0
typing_extensions         4.3.0            py39hecd8cb5_0
tzdata                    2022c                h04d1e81_0
ujson                     5.4.0            py39he9d5cce_0
unidecode                 1.2.0              pyhd3eb1b0_0
unixodbc                  2.3.11               hb456775_0
urllib3                   1.26.11          py39hecd8cb5_0
w3lib                     1.21.0             pyhd3eb1b0_0
watchdog                  2.1.6            py39h999c104_0
wcwidth                   0.2.5              pyhd3eb1b0_0
webencodings              0.5.1            py39hecd8cb5_1
websocket-client          0.58.0           py39hecd8cb5_4
werkzeug                  2.0.3              pyhd3eb1b0_0
wget                      1.21.3               h6dfd666_0
whatthepatch              1.0.2            py39hecd8cb5_0
wheel                     0.37.1             pyhd3eb1b0_0
widgetsnbextension        3.5.2            py39hecd8cb5_0
wrapt                     1.14.1           py39hca72f7f_0
wurlitzer                 3.0.2            py39hecd8cb5_0
xarray                    0.20.1             pyhd3eb1b0_1
xlrd                      2.0.1              pyhd3eb1b0_0
xlsxwriter                3.0.3              pyhd3eb1b0_0
xlwings                   0.27.15          py39hecd8cb5_0
xz                        5.2.6                hca72f7f_0
yaml                      0.2.5                haf1e3a3_0
yapf                      0.31.0             pyhd3eb1b0_0
zeromq                    4.3.4                h23ab428_0
zfp                       0.5.5                he9d5cce_6
zict                      2.1.0            py39hecd8cb5_0
zipp                      3.8.0            py39hecd8cb5_0
zlib                      1.2.12               h4dc903c_3
zope                      1.0              py39hecd8cb5_1
zope.interface            5.4.0            py39h9ed2024_0
zstd                      1.5.2                hcb37349_0

In addition, I tried resetting anaconda navigator through the terminal but I got the same error message.
Any help would be of great value :)
Thank you for your time!

A: Just got off a phone call with an Anaconda representative to try to solve this issue and it seems like they do not have any current support for M2 Macs and told me that I had to settle with using anaconda through the terminal until they do support this new chip.


text:
Q: How to Check if second child exsits I am struggling with how to check if second child exists or not. If it exists then perform certrain functionality:

First tr

First tr

A: You can check the length of the selector results to check the children count. You can then perform your operation or loop through each of them as well.
If you just want to check exactly 2 children, then use  === 2 condition. ( code added)

if ($('table tr').length > 1) {
  console.log('second child exists')
}

if ($('table tr').length === 2) {
  console.log('Only two child ')
}

First tr

First tr


text:
Q: Issue with CSS3 rotation I'm having issues with CSS3 rotation. On the image, you can see the SVG object that I need to animate on hover. The object on the left is a start state, and the object on the right is an example of what I have to accomplish.
I have tried with this:
.svg-pokazivac {
   transition: .2s all ease-in-out;
}
.svg-pokazivac:hover {
   transform: rotate(45deg);
   transform-origin: center center;
}

But no matter what I do and which transform-origin I choose, I always get the object that is somehow misplaced and translated to some strange position. The closest I've got to solution so far is with a code that looks like this:
.svg-pokazivac:hover {
   transform: translate(350px,-150px) rotate(45deg);
}

But animation of that is very funny. What i'm doing wrong?

A: You are getting the weird behavior because the transition: all is causing a transition between two different transform origins - the default and your explicitly specified one. Now the silent default for a CSS transform origin is supposed to be 50% 50% - so this shouldn't be a problem, but clearly Chrome thinks that the silent default for an SVG shape is the default for SVG transforms of 0% 0%. [Likely Bug!] If you add a transform origin to your base class it works just fine.
.svg-pokazivac {
   transition: .2s all ease-in-out;
       transform-origin: 347px 347px;
}
.svg-pokazivac:hover {
   transform: rotate(1805deg);
   transform-origin: 347px 347px;
}

Note that 50% 50% for transform-origin doesn't quite work because the pointer is being included in the calculation of the center. Also, you might think you could fix this by switching from transition all to transition transform (excluding transform-origin) but this doesn't work. Only specifying the transform origin in the base class does the trick.

A: After a few mugs of coffee, I finally managed to do it. What I did was to remove the pointer and the circle completely from the SVG element and remake them in a pure CSS:
.svg-pointer {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 45.5px 46px 45.5px;
    border-color: transparent transparent #4e4e4e transparent;
    position: absolute;
    top: 125px;
    left: 306px;
    transform-origin: 50% 227px;
}

.svg-circle {
    width: 379px;
    height: 379px;
    border-radius: 999px;
    background: #4e4e4e;
    position: absolute;
    top: 161px;
    left: 159px;
}

The rest is just a javascript transition manipulation. You can see the whole solution here:
http://jsfiddle.net/3c7zf4uq/7/
Also, I would like to point to this very helpful article which helped me a lot: http://demosthenes.info/blog/860/Animating-Elements-In-Arcs-Circles-and-Ellipses-With-CSS
I hope that it would help someone with similar problems :)


text:
Q: Shell script get real time from 'time' and save to variable I'm trying to make a shell script for my program to take time multiple times and then divide to get an average time for it to execute.
What I've tried is following:
time [./finder -p ARG1 ARG2 ARG3] > /dev/null 2>&1 | grep real | awk '{print $2}'

Basically I want to remove the output of my program, so I'm trying to redirect the output to null. I also want to remove the output of time. It's barely working and I also need to save the result in a variable so I can run it in a loop. Any ideas how that can be done?

A: Beware: "time" can be a shell builtin. Invoke as /usr/bin/time or with env to avoid the builtin and get proper pipeline and output behavior:
env time bash -c './finder >/dev/null' 2>&1 | awk '$2 == "real" {print $1}'

Also, it Would Be Bad to direct 1 to null, and then immediately direct 2 to the same place.
You can surround with backticks and assign to variable, or for simpler punctuation redirect to a temp file and then use:
ELAPSED=`cat time.txt`

Here is some example output that awk is parsing:
$ env time pwd
/tmp
        0.01 real         0.00 user         0.00 sys

The -p switch can be passed if you prefer POSIX output:
$ env time -p pwd
/tmp
real         0.01
user         0.00
sys          0.00

Here is one way to grab raw time stderr output in a variable:
$ TIME=`env time pwd 2>&1 | tail -1`
$ echo $TIME
0.00 real 0.00 user 0.00 sys

A: Via "intermediate" temporary file and format -f option:
real_time_val=$(/usr/bin/time -f "%e" -o tmpfile [./finder -p ARG1 ARG2 ARG3] > /dev/null 2>&1 && cat tmpfile)

*

*%e - Elapsed real (wall clock) time used by the process, in seconds.

*-o FILE - Write the resource use statistics to FILE instead of to the standard error stream
Exemplary result:
$ echo "$real_time_val"
0.02


text:
Q: Android: AsyncTask and Communicating Errors on UI thread I am using an Android AsyncTask to fetch some data from the web. Its a simple program (a 'crack me') that fetches bytes from random.org and displays the bytes. The program also pins random.org's public key to detect interception proxies.
I have implemented onPreExecute, doInBackground, and onPostExecute. These methods are required when "all things go well." When something goes wrong in doInBackground, I cannot display an AlertDialog because its not a UI thread. The interface also lacks an onError or similar method that executes on a UI thread.
How does one convey errors when using this class?

A: My suggestion is create field in your AsyncTask class. If something gonna wrong put there some exception throwed:
class SomeAsyncTask<..> extends AsyncTask<..> {
    Exception exception = null;
    public doInBackground(...) {
        try {
            . . .
        } catch (Exception ex) {
            exception = ex;
        }
    }

    public onPostExecute(...) {
        if (exception != null) {
            // process exception on UI thread
        }
    }

}

A: I catch the error in the doInBackground, save the Exception in a field variable and check in onPostExecute if an error occurred:
private Exception exception = null;

protected Void doInBackground(Void... params){
    try{
        doStuff();
    } catch (Exception ex){
        exception = ex;
    }

    return null;
}

protected void onPostExecute(Void result){
    if(exception != null){
        showException(exception);
    }
}

You could easily create your own interface using this code, and then implement the doStuff and showException methods when using it.

A: You should return any information needed to onPostExecute() and show your dialog there. Or you can store it locally as a member of an AsyncTask subclass.

A: No.  just issue a broadcast in the AsyncTask and handle the broadcast anywhere you like.  The AsyncTask just needs a Context to issue this which you can pass to it. Might want to issue as Sticky broadcast so you can recover it.


text:
Q: Object destructuring gives me a NaN value when using a specific variable name My object has 2 properties, when those properties are named left and top { left: rect.left, top: rect.top}.
After destructuring the object, my x and y variables are both NaN.
const { x, y } = this.getCanvasPosition(this.canvasHex.current);

But if I rename my properties of that object to x and y { x: rect.left, y: rect.top}, I get the values I'm looking for.
I'm wondering what is exactly going on here.

A: You need a renaming of the properties, because you have no properties x and y, but left and top.
const { left: x, top: y } = this.getCanvasPosition(this.canvasHex.current);

const { left: x, top: y } = { left: 10, top: 5 };

console.log(x, y);


text:
Q: Auto increment in oracle database for java developer I am migrating a database from MySql to an Oracle database, using SQL developer as the migration interface.  I am new to Oracle, and am not sure whether this warrants a rewrite in Oracle using triggers or using auto-increment in Oracle, if that exists.
After generating the migration script For autoincrement, here is the resulting MySQL trigger code:
CREATE OR REPLACE TRIGGER Trigger_name BEFORE INSERT ON Table_name
FOR EACH ROW
DECLARE
v_newVal NUMBER(12) := 0;
v_incval NUMBER(12) := 0;
BEGIN
  IF INSERTING AND :new.table_PK_id IS NULL THEN
   SELECT  sequence_name.NEXTVAL INTO v_newVal FROM DUAL;
    IF v_newVal = 1 THEN
     SELECT NVL(max(table_PK_id),0) INTO v_newVal FROM Table_name;
     v_newVal := v_newVal + 1;
     LOOP
       EXIT WHEN v_incval>=v_newVal;
       SELECT sequence_name.nextval INTO v_incval FROM dual;
     END LOOP;
  END IF;
 :new.table_PK_id := v_newVal;
END IF;
 END;

...and here is the equivalent trigger generated in Oracle:
CREATE OR REPLACE TRIGGER Trigger_name
  BEFORE INSERT ON Table_name
  FOR EACH ROW
BEGIN
  SELECT sequence_name.nextval
  INTO :new.table_PK_id
  FROM dual;
END;

Should I use the Oracle DDL trigger code in my application, or does Oracle offer something better?

A: It's very important to determine which version of Oracle you are migrating to because you can potentially leverage some great features that Oracle offers.  Conversely, you could get stuck converting MySQL functions to Oracle procedures, which can be challenging depending on early versions of Oracle.
For example, in releases of Oracle prior to 12.1, auto-increment had not been provided, although it could be implemented using a combination of sequences and triggers.  Therefore if the version of Oracle is 12.1 or later, I recommend using an identity column with the sequence pseudo columns as default values, like this:
CREATE TABLE t1 (c1 NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
                   c2 VARCHAR2(10));

You can learn more about Identity Columns in Oracle Database 12c (12.1) and here.
Otherwise if Oracle is an earlier version, then yes your trigger code is sound but you will have to include the correct table and column, similar to below:
Table definition:

    CREATE TABLE departments (
      ID           NUMBER(10)    NOT NULL,
      DESCRIPTION  VARCHAR2(50)  NOT NULL);

    ALTER TABLE departments ADD (
      CONSTRAINT dept_pk PRIMARY KEY (ID));

    CREATE SEQUENCE dept_seq;

Trigger definition:
   CREATE OR REPLACE TRIGGER dept_bir
    BEFORE INSERT ON departments
    FOR EACH ROW

    BEGIN
      SELECT dept_seq.NEXTVAL
      INTO   :new.id
      FROM   dual;
    END;
    /

Note that this SQL DDL can also be found here:
How to create id with AUTO_INCREMENT on Oracle?


text:
Q: Delete children directories in powershell including symlinks Currently experiencing issue, I'm currently doing this:
Get-ChildItem $PATH -Recurse -ErrorAction SilentlyContinue |
  Where-Object {($_.Attributes -notmatch '\"Directory\"') -and
              ($_.LastWriteTime -lt (Get-Date).AddHours(-12))}|
    Remove-Item -Force -Recurse

Now, it would delete fine IF I didn't have symlinks, but I do. I am getting this error:

Remove-Item : There is a mismatch between the tag specified in the request and the tag present in the reparse point
  At line:1 char:184
  + ...  ($_.LastWriteTime -lt (Get-Date).AddHours(-12))}| Remove-Item -Force
  +                                                        ~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [Remove-Item], Win32Exception
      + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand

I'm unable to upgrade powershell to v6. It seems to be related to:https://github.com/powershell/powershell/issues/621#issuecomment-289230180
Anyone have a workaround?

A: Tested today on PowerShell 7 and unfortunately the issue is still there: PowerShell cannot delete symlink.
I had to delete the directory through an elevated prompt typing cmd /c rmdir /s /q C:\Users\Your_User_Name\Your_Folder_Name

A: This problem seems to be fixed in PS 6 (ref: https://github.com/powershell/powershell/issues/621)
In PS 5.1 one can work around it by using:
$(get-item $theSymlinkDir).Delete()

or as LotPings noted in the comments to the Q for this specific Foreach-Object loop:
|? LinkType -eq 'SymbolicLink'| % { $_.Delete() }


text:
Q: Count checkboxes within element I'm trying to find a way to count all checked checkboxes within a parent element using jQuery. Sofar I haven't found a decent (and fast) solution.
To illustrate the situation: I've got an ul-list with one 'check-all' checkbox, and one checkbox per child list-item. When there are no checked list-items, I want the check-all checkbox to be unchecked. Therefore I assume I've to count all the checked list-items each time one of them is changed.
[...]

<input type="checkbox" class="checkall" />

<input type="checkbox" id="ch1" class="list" />

<input type="checkbox" id="ch2" class="list" />

<input type="checkbox" id="ch3" class="list" />

[...]

As you can see I'm working with a nested ul-list, for the record.
Sofar I've got the following jQuery code, which serves for selecting the parent list-item, as I've only got to count the checkboxes within that 'group'.
// $(this).val() is neccesary for my code to know which checkbox has been affected
var parentnode = $('input#' + $(this).val()).parent().parent().parent();
alert(parentnode.children('input.list:checked').length);

I know it won't work using the children selector (that's for looping, right?), but I can't find a way to count the checked checkboxes length from the 'parentnode' element.. Can you help me out?

A: Since children() only processes the direct children of your element, you can use find() instead to process all descendants matching the selector:
alert(parentnode.find('input.list:checked').length);


text:
Q: What is the best way for using PayPal adaptive payment API with C++? I am trying to find the best way to use PayPal adaptive payment using API.
Our process is running on Linux, written in C++.
Since there is no SDK for C++, I have 2 options:

*

*Use a direct API (SOAP, REST)

*Create a php + SDK that will handle it externally.

Any thoughts about the right solution ?

A: If the SDK doesn't exist in C++, you can either redirect the user to a webpage from the process, or use a C++ RESTful library, like restbed to do the trick.


text:
Q: Regex - how to remove 8 digits onwards with regex I want to get only the numbers from a string to a maximum length of 7 characters using RegEx.
This is what I tried so far:Demo
Example:
Samsung Galaxy Edge  $1.234.000 text text text 23 text  1289
The RegEx should output:
1234000

A: perl -p -e 's/\D+//g' test | perl -p -e '/(\d{7})/ ; print "$1\n"'
% 1234000
Edit - some explanations
The first part of the expression removes everything which isn't a number (test is a file containing your line) I try to delete all the characters, except numbers, the second part looks for the first 7 digits in the result of the first part and prints them to the screen and then delete the number 7 onwards.
I don't know what language you're using, but the regexp essentials should be the same.

A: try this one :
$("td").each(function() {
  $(this).html(function(index, text) {
    return text.replace(/[^0-9]/g, '').slice(0,7);
  });
});

demo jsfiddle


text:
Q: How to set email alerts for high IO errors (sql server error log)? The sql server error logs show multiple entries with the following keywords:

IO taking longer longer 15 seconds

I want to setup email alerts for these errors. I have email alerts configured for severity level 20. To be able to receive the above IO errors I want to know what is their severity level?
If they are not belonging to any severity level, then how to setup email alerts for such messages?

A: The error number is 833, so it is just a matter of setting up an Agent Event Alert based on that error number. The number isn't written to eventlog by default, however, so you need to configure that first using sp_altermessage:
EXECUTE sp_altermessage 833, 'WITH_LOG', 'true';

A: Long IO requests are severity 10 error - you can view the information here:
select * from sys.messages
where   language_id = 1033
        and message_id = 833

First you would have to make those errors logged to the application log, for this execute the script Tibor posted in his answer. This will change the is_event_logged from 0 to 1
Then you need to create an alert for this error number:
USE [msdb]
GO

EXEC msdb.dbo.sp_add_alert @name=N'Long IO Requests',
    @message_id=833,
    @severity=0,
    @enabled=1,
    @delay_between_responses=60,
    @include_event_description_in=1,
    @category_name=N'[Uncategorized]',
    @job_id=N'00000000-0000-0000-0000-000000000000'

And don't forget to add operator (email address where to alert emails would be sent) in the created alert's properties

A: There are quite some ways you can do this. Getting data extracted from sys.messages about events and wrap in SQL job to look for the text conditions you may want to search for.
Please refer to https://blog.dbi-services.com/sql-server-get-email-notifications-for-error-log-entries/
and https://www.mssqltips.com/sqlservertip/2307/automate-monitoring-sql-server-error-logs-with-email-alerts/
to get an idea on how to set this up


text:
Q: Running software-sources results in Python error (LMDE 3) I am in need to run the Software Sources GUI (no, my job cannot be completed through apt or aptitude). Since the window would never load if I navigated from the launcher, I decided to see what happens if I were to run it from the command line:
jason@jason-mint:~$ software-sources
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 48
    def async(func):
            ^
SyntaxError: invalid syntax

The function in the file mintSources.py looks like this:
# Used as a decorator to run things in the background
def async(func):
    def wrapper(*args, **kwargs):
        thread = threading.Thread(target=func, args=args, kwargs=kwargs)
        thread.daemon = True
        thread.start()
        return thread
    return wrapper

At the very top, the shebang says: #!/usr/bin/python3. Since my default Python is Python 2.7, I changed the shebang to #!/usr/bin/python to see what happens, only to have a new error this time:
jason@jason-mint:/etc/apt$ software-sources
Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 6, in <module>
    import configparser
ImportError: No module named configparser

Which means it failes in import configparser, clearly an indication that python2.7 (my default) will not work. To clarify, I have both Python2 and Python3 available:
jason@jason-mint:~$ python --version
Python 2.7.16
jason@jason-mint:~$ python2
Python 2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
jason@jason-mint:~$ python3
Python 3.7.3rc1 (default, Mar 13 2019, 11:01:15)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
jason@jason-mint:~$ python
Python 2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Some system info if it helps:
jason@jason-mint:~$ cat /etc/debian_version
buster/sid
jason@jason-mint:~$ uname -r
4.19.0-4-amd64


text:
Q: Is there possible to get accurate value for image average mean of the single row/column? I just try out the numpy to find the mean for each column and row of the image, but it show up like a lot of number
import cv2
import numpy as np
shape = np.shape(img)
pixels = np.array(img)

column_means = np.mean(pixels, axis=0) //can change axis = 1 for row
column_max = np.max(pixels, axis=0) //can change axis = 1 for row
column_min = np.min(pixels, axis=0) //can change axis = 1 for row
column_subtract = column_max - column_min //can change axis = 1 for row

print(shape)
print(column_means)
print(column_max)
print(column_min)
print(column_subtract)

Here is sample photo I'm working on it