TypeScript implicit ‘any’ type with computed property key

(irrelevant code removed for demo purposes)

I am new to using TypeScript and I have this React component which has an object literal inside the component, which I’m then accessing using a computed property key. Everything works as expected but I was getting the following TS error:

Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ keyword: string; hex: string; rgb: string; }'. No index signature with a parameter of type 'string' was found on type '{ keyword: string; hex: string; rgb: string; }'.ts(7053) 

I managed to get rid of the error by adding the : any to the formats object, though I think this is not the best solution?

interface Props {   keyword: string;   hex: string;   rgb: string;   copyFormat: string; }  export default ({ keyword, hex, rgb, copyFormat }: Props) => {   const formats: any = {     keyword,     hex: hex.toUpperCase(),     rgb: `rgb($  {rgb})`,   };    return <p>{formats[copyFormat]}</p>; }; 

Google Maps coordinates to image of a property?

I’m writing a python script that takes in addresses and outputs an image of the property. I converted the addresses into google map coordinates using a geocoding module. Is there a way to output and save an image of a property from coordinates using a google map api? I have already looked into several imports that are used to open images from python but none that can intake coordinates and convert them to an image.

Keep property value between swipes on SwipeAdapter / Fragment [on hold]

I’m using a SwipeAdapter loaded in my Activity which then reads a text file and passes it to a Fragment.

In the Fragment I have an OnClickListener that sets an “isHidden” value to true or false, depending what it was.

I want to add the option to hide certain parts of the fragment labels when the screen is tapped, but with every swipe, the “isHidden” value is reinitialised and reset to “False”

SavedSessionState also doesn’t help. I want to save the “isHidden” value so that I can retain the value with the next swipe.

Any help?

WPF MVVM validate property before setting when user’s change value in DataGrid [migrated]

Issue: I have a list of a class that’s being displayed in a Datagrid, one of the values needs to ask the user if they really want to change it. This was implemented with a YesNo MessageBox in the value’s Setter.

The problem is that this messagebox should not come up every time the Setter is called, like when a new object is being added to the datagrid with a dialog, it will still ask if you are sure you want to change the value of what is currently being created.

I’m not sure if there’s a clean way of doing this, so any help is appreciated.

Right now the setter in the class looks like this:

public string Value {   get { return _value; }   set    {        string message = "Are you sure you want to modify this value?";        MessageBoxResult result = MessageBox.Show(message, "Confirmation",        MessageBoxButton.YesNo, MessageBoxImage.Question);        if (result == MessageBoxResult.Yes)        {           _value = value;        }        else        {         // Set to previously used value         Value = _value;        }           RaisePropertyChanged("Value");   } } 

Does $AA^{-1}$ have the unique product property?

Let $ A$ be a finite subset of a torsion free group $ G$ with $ |A|\geq3$ . Does the set $ AA^{-1}$ have the “unique product” property (i.e. there exist an element $ c\in AA^{-1}$ that is uniquely written as a product $ ab$ with $ a\in A$ , $ b\in A^{-1}$ )? In particular, what can we say if we consider the Passman four group: $ $ G:=\langle x,y: (x^2)^y=x^{-2}, (y^2)^x=y^{-2}\rangle$ $

‘Firebase.push failed: first argument contains undefined in property ‘orders.troco_id”

Nesse meu código eu tenho dois formulários em pop-up, o primeiro que serve para adicionar endereço ou editar, e o segundo para adicionar troco ou editar o troco, ambos são salvos com sucesso no seu devido lugar, esses dados que são salvos vão para uma form em html que possui opções em (checkbox), ou seja lá o usuário marca o endereço e o troco que foi enviado pelos pop ups, então assim que o usuário clicar em enviar formulário esses dados deveriam ir para o banco de dados como uma compra, porem estou tendo o retorno destes erro:

> Firebase.push failed: first argument contains undefined in property > 'orders.troco_id' 

Código javascript

//Check if user already logged in firebase.auth().onAuthStateChanged(function(user) {   if (user) {     $  scope.addresses= $  firebaseArray( fireBaseData.refUser().child(user.uid).child("address") );      $  scope.trocos= $  firebaseArray( fireBaseData.refUser().child(user.uid).child("troco") );      $  scope.user_info=user;     } });  $  scope.payments = [   {id: 'CREDIT', name: 'Cartão de crédito'},   {id: 'CASHOF', name: 'Dinheiro'} ];  $  scope.pay=function(address,payment,troco){    if(address==null || payment==null){     //Check if the checkboxes are selected ?     sharedUtils.showAlert("Atenção!","Por favor selecione o endereço e o modo de pagamento.")   }   else {     // Loop throw all the cart item     for (var i = 0; i < sharedCartService.cart_items.length; i++) {       //Add cart item to order table        fireBaseData.refOrder().push({          //Product data is hardcoded for simplicity         product_name: sharedCartService.cart_items[i].item_name,         product_price: sharedCartService.cart_items[i].item_price,         product_image: sharedCartService.cart_items[i].item_image,         product_id: sharedCartService.cart_items[i].$  id,          //item data         item_qty: sharedCartService.cart_items[i].item_qty,          //Order data         user_id: $  scope.user_info.uid,         user_name:$  scope.user_info.displayName,         address_id: address,         troco_id: troco,           time: Date.now(),            status: "Na fila"       });      }      //Remove users cart     fireBaseData.refCart().child($  scope.user_info.uid).remove();      sharedUtils.showAlert("Alerta!", "Pedido feito com sucesso!");      // Go to past order page     $  ionicHistory.nextViewOptions({       historyRoot: true     });     $  state.go('lastOrders', {}, {location: "replace", reload: true});   } }    $  scope.addManipulation = function(edit_val) {  // Takes care of address add and edit ie Address Manipulator     if(edit_val!=null) {     $  scope.data = edit_val; // For editing address     var title="Ediar endereço";     var sub_title="Edite seu endereço";   }   else {     $  scope.data = {};    // For adding new address     var title="Adicionar endereço";     var sub_title="Adicione seu endereço";   }   // An elaborate, custom popup   var addressPopup = $  ionicPopup.show({     template: '<input type="text"   placeholder="Nome"  ng-model="data.nickname"> <br/> ' +     '<input type="text"   placeholder="Endereço" ng-model="data.address"> <br/> ' +     '<input type="text" placeholder="Cidade" ng-model="data.pin"> <br/> ' +     '<input type="number" placeholder="Telefone" ng-model="data.phone">',     title: title,     subTitle: sub_title,     scope: $  scope,     buttons: [       { text: 'Fechar' },       {         text: '<b>Salvar</b>',         type: 'button-positive',         onTap: function(e) {           if (!$  scope.data.nickname || !$  scope.data.address || !$  scope.data.pin || !$  scope.data.phone ) {             e.preventDefault(); //don't allow the user to close unless he enters full details           } else {             return $  scope.data;           }         }       }     ]   });    addressPopup.then(function(res) {      if(edit_val!=null) {       //Update  address       fireBaseData.refUser().child($  scope.user_info.uid).child("address").child(edit_val.$  id).update({    // set         nickname: res.nickname,         address: res.address,         pin: res.pin,         phone: res.phone       });     }else{       //Add new address       fireBaseData.refUser().child($  scope.user_info.uid).child("address").push({    // set         nickname: res.nickname,         address: res.address,         pin: res.pin,         phone: res.phone       });     }    });  };  $  scope.addTroco = function(edit_troco) {  // Takes care of address add and edit ie Address Manipulator   if(edit_troco!=null) {     $  scope.data = edit_troco; // For editing address     var title="Editar troco";     var sub_title="Edite aqui seu troco";   }   else {     $  scope.data = {};    // For adding new address     var title="Informar troco";     var sub_title="Informe aqui seu troco";   }   // An elaborate, custom popup   var trocoPopup = $  ionicPopup.show({     template: '<input type="text"   placeholder="Troco"  ng-model="data.troco"> <br/> ',     title: title,     subTitle: sub_title,     scope: $  scope,     buttons: [       { text: 'Fechar' },       {         text: '<b>Salvar</b>',         type: 'button-positive',         onTap: function(e) {           if (!$  scope.data.troco) {             e.preventDefault(); //don't allow the user to close unless he enters full details           } else {             return $  scope.data;           }         }       }     ]   });    trocoPopup.then(function(res) {      if(edit_troco!=null) {       //Update  address       fireBaseData.refUser().child($  scope.user_info.uid).child("troco").child(edit_val.$  id).update({    // set         troco: res.troco       });     }else{       //Add new address       fireBaseData.refUser().child($  scope.user_info.uid).child("troco").push({    // set         troco: res.troco       });     }    });  }; 

Código HTML

<ion-view title="Checkout"  id="page16" >   <ion-content padding="false" class="has-header">      <form name="checkoutForm" class="list " ng-submit="pay(address_choice,pay_choice,phone,troco_choice)" >        <!--Address Header-->       <label class="item item-input  item ic-selected" >         <a class="icon icon-right ion-ios-location" style="margin-right: 10px;" ></a>         Endereço de entrega         <div class="right">           <button ng-click="addManipulation()" type="button" class="btn btn-success btn-xs glyphicon glyphicon-plus" style="margin-left: 10px;">Adicionar endereço</button>         </div>       </label>         <!-- Address -->       <ion-list  ng-repeat="item in addresses">         <ion-radio name="addr_group" ng-value="item.address" ng-model="$  parent.address_choice">           <a class="icon icon-right ion-ios-location"></a>           {{item.nickname}} <br/>           {{item.address}} <br/>           Cidade : {{item.pin}}<br/>           Telefone : {{item.phone}}         </ion-radio>        </ion-list>        <ion-list ng-repeat="user in usersss">          Telefone: {{user}}       </ion-list>        <!--troco Header-->       <label class="item item-input  item ic-selected" >         <a class="icon icon-right ion-ios-location" style="margin-right: 10px;" ></a>         Troco         <div class="right">           <button ng-click="addTroco()" type="button" class="btn btn-success btn-xs glyphicon glyphicon-plus" style="margin-left: 10px;">Adicionar troco</button>         </div>       </label>        <!-- Troco -->       <ion-list name="addr_group" ng-repeat="item in trocos">         <ion-radio ng-value="item.troco" ng-model="$  parent.troco_choice">           <a class="icon icon-right ion-ios-location"></a>           Troco para: {{item.troco}} <br/>         </ion-radio>        </ion-list>         <!--Payment Header-->       <label class="item item-input  item ic-selected" >         <a class="icon icon-right ion-cash" style="margin-right: 10px;" ></a>         Modo de pagamento       </label>         <!-- Payment Options -->       <ion-list  ng-repeat="item in payments">         <ion-radio name="pay_group" ng-value="item.name" ng-model="$  parent.pay_choice" > {{item.name}} </ion-radio>       </ion-list>         <button type="submit" class=" button button-calm  button-block icon-right ion-android-arrow-forward ">         Pagar       </button>      </form>    </ion-content>   </ion-view> 

How to avoid saving a value of property of form object when saving changes to db

In a crud asp.net core 2.2 web app, I need to avoid saving a property of form object to db. How do I do that?

I’ve tried using [Editable(false)] data annotation on the ListBin property to prevent saving property value to db.

[Table("supply_lists")] public partial class SupplyLists {     [Column("id")]     public int Id { get; set; }     [Column("category_id")]     public int CategoryId { get; set; }     [Required]     [Column("coursecode")]     [StringLength(200)]     public string Coursecode { get; set; }     [Required]     [Column("title")]     [StringLength(200)]     public string Title { get; set; }     [Required]     [Column("filename")]     [StringLength(200)]     public string Filename { get; set; }     [Column("isactive")]     public bool Isactive { get; set; }     [Column("date", TypeName = "smalldatetime")]     public DateTime Date { get; set; }      [Column("list_bin")]     public byte[] ListBin { get; set; }      [ForeignKey("CategoryId")]     [InverseProperty("SupplyLists")]     public virtual SupplyListCategory Category { get; set; } }   [ModelMetadataType(typeof(MetaDataTypeModel))] public partial class SupplyLists {  } public class MetaDataTypeModel {     [Editable(false)]     public byte[] ListBin { get; set; }      [Display(Name = "Is Active")]     public bool Isactive { get; set; }      [Display(Name ="Course Code")]     public string Coursecode { get; set; }      [Display(Name = "Category")]     public int CategoryId { get; set; }      [DataType(DataType.Date)]     public DateTime Date { get; set; } }  public class EditModel : PageModel {     private readonly SupplyListCore22.Models.SupplyListsContext _context;     private readonly IHostingEnvironment _env;      public EditModel(SupplyListCore22.Models.SupplyListsContext context, IHostingEnvironment env)     {         _context = context;         _env = env;     }      [BindProperty]     public SupplyLists SupplyLists { get; set; }     [BindProperty]     public FileUpload FileUpload { get; set; }      public async Task<IActionResult> OnGetAsync(int? id)     {         if (id == null)         {             return NotFound();         }          SupplyLists = await _context.SupplyLists             .Include(s => s.Category).FirstOrDefaultAsync(m => m.Id == id);          if (SupplyLists == null)         {             return NotFound();         }        ViewData["CategoryId"] = new SelectList(_context.SupplyListCategory, "Id", "Category");         return Page();     }      public async Task<IActionResult> OnPostAsync()     {         //if (!ModelState.IsValid)         //{         //    return Page();         //}          _context.Attach(SupplyLists).State = EntityState.Modified;         await _context.SaveChangesAsync();          if (FileUpload.UploadSupplyList != null)         {             var fileUploadData = await utilities.utilities.ProcessFormFile(FileUpload.UploadSupplyList, ModelState);             if (ModelState.ErrorCount > 0)             {                 ViewData["CategoryId"] = new SelectList(_context.SupplyListCategory, "Id", "Category");                 return Page();             }             var sl = _context.SupplyLists.Find(SupplyLists.Id);             sl.ListBin = fileUploadData;              await _context.SaveChangesAsync();          }          return RedirectToPage("./Index");     } 

It set the ListBin to null in db which is not what I wanted when saving changes (I wanted to preserve the old value of ListBin in db).

Automatically generated managed property not being populated after change to search schema

In my SharePoint site, I have a managed metadata site column called ‘Item Category’ and it was mapped to two different managed properties in the search schema – the first managed property being ‘RefinableString01’ (mapped via the crawled property ‘ows_Item_x0020_Category’) and the second being ‘owstaxIditemx0200category’ (automatically generated and mapped to crawled property ‘ows_taxId_item_x0020_category).

I added ‘ows_taxId_item_x0020_category’ as an additional mapping to ‘RefinableString01’ but quickly realised that this didn’t achieve a result I originally intended, so removed that mapping. I also added ‘ows_taxId_item_x0020_category’ as a mapping to ‘owstaxIditemx0020category’ which appears to have overwritten the automatic settings with default managed property settings, as I’m no longer getting the warning message for automatic mappings at the top of the administration page for ‘owstaxIditemx0200category’.

I’ve now spotted that the search index doesn’t seem to be populated with values against either of those managed properties now, at least judging from content search web parts which used those managed properties now no longer returning a value for them against items in the display template (but still returning values for other managed properties I didn’t modify). I have re-indexed the site web but this has no effect. I also don’t have any prompts in the Result Types settings page to update any properties.

In this situation what would be the best way to fix the issue of the managed properties not being populated? For example, is there a way to revert the automatically generated managed property back to its original settings, and would this resolve the issue?

I also have an added constraint that my administrative rights are limited to SCA and that there is a very long ‘line of sight’ to any tenant level administrator.

Helly vs Strong Helly property of Hypergraphs

I am not clear about the difference between Helly and Strong Helly property. For example hypergraph H(V, E), V = { 1,2,3 } and E = {(1,2), (2,3), (1,3)} has non-empty set for each pair of intersection, which makes it qualify as Helly (but not strong Helly) however, this triangle hypergraph is not considered as Helly hypergraph. Any insight and correction would be appreciated.