Posts

Showing posts from July 3, 2018

Required field validator still firing even after removing from Model & Controller

Required field validator still firing even after removing from Model & Controller I am getting error regarding required field validator, two field on my razor page & it should not be required. So I removed the [Required] validation attribute for but still I am getting a message after submit that these fields are required. [Required] Below is my model properties. public decimal Longitude { get; set; } decimal Latitude { get; set; } & this is razor. @Html.TextBoxFor(model => model.Longitude, new { @class = "form-control") @Html.TextBoxFor(model => model.Latitude, new { @class = "form-control" }) A decimal can never be null - its must have a value. if you want to allow null , then make the nullable – Stephen Muecke Jun 30 at 7:28 decimal null null make both the attributes nul

Android 6.0 - Download file to external storage without asking for permission

Android 6.0 - Download file to external storage without asking for permission I have a superuser access on my device. I used this function very successfully to download and update my application programattically, but since android 6.0 this function stopped working (because of new type of permission requests). My question is: since I have superuser access on my rooted device, how can edit my function so I can download the external file on the sdcard without asking for permission from user? here is the function I use to update the app: public class UpdateAppZ extends AsyncTask<String,Void,Void>{ private Context context; public void setContext(Context contextf){ context = contextf; } @Override protected Void doInBackground(String... arg0) { try { URL url = new URL(arg0[0]); HttpURLConnection c = (HttpURLConnection) url.openConnection(); c.setRequestMethod("GET"); c.setDoOutput(true);

Flutter: get default context? or load assets without context?

Flutter: get default context? or load assets without context? I'm trying to load a json file in a class extending SearchDelegate to search through its content. I have a method to load this file: Future<void> loadCountryData() async { try { String data = await DefaultAssetBundle .of(context) .loadString("assets/data/countries.json"); _countries = json.decode(data); } catch (e) { print(e); } } Unfortunately this requires a Buildcontext (context) that seems only to be available in the SearchDelegate build methods (like buildActions, buildLeadings, etc), but no outside like for example in the constructor. https://docs.flutter.io/flutter/material/SearchDelegate-class.html As the @override xy build methods in SearchDelegate are called with every change in the search field, I would load my file over and over again, which is of course not ideal. I want to load my file once at the beginning only. Is there a way to get some so

Xcode 9 Autocomplete Not Working 100% - Partially Working

Image
Xcode 9 Autocomplete Not Working 100% - Partially Working This morning, Xcode 9.0 (9A235) shows a new/strange Auto Complete box that is not at all what it used to be. How do I get the full auto-complete box so that autocomplete looks like how it usually does? Deleting the DERIVED DATA Folder solved it for me. Thanks to another post. Thanks to this post: stackoverflow.com/questions/28429630/… – Ernie Sep 30 '17 at 17:38 Probably it is because indexing hasn't been completed yet. – ozgur Sep 30 '17 at 18:19 11 Answers 11 Deleting the DERIVED DATA folder seemed to fix my issue. Thanks to this post:

Why can't I redefine a property in a Javascript object?

Why can't I redefine a property in a Javascript object? I am creating a object using Object.create and I want to add properties to it. Object.create > var o = Object.create({}); undefined > Object.defineProperty(o, "foo", {value: 43, enumerable: true}); {foo: 43} > o {foo: 43} > o.foo 43 > for (var i in o) { console.log(i); } foo > Object.keys(o) ['foo'] > Object.defineProperty(o, "foo", {value: 43, enumerable: false }); TypeError: Cannot redefine property: bar Q1) Why can't I redefine the property ? > o.__proto__ {} > o.prototype undefined Q2) Why is the prototype empty ? And why are these 2 values different i.e. {} vs undefined ? {} undefined Be careful with __proto__ . – RobG Aug 27 '14 at 2:37 __proto__ 3 Answers

Chaning dummy variable in r to my desire variables dummy variables,

Chaning dummy variable in r to my desire variables dummy variables, [![enter image description here][1]][1] I am trying to change dummy variables in r to my desire dummy variables but the r code I am using did not give the desire result. I have provided the r code and the result I want in the attach image above. Thank you helping. lowbwt=read.csv("lowbwt_1.csv",header = T) library(dplyr) lowbwt<-lowbwt %>% + mutate(Black=ifelse(RACE_1=="Black",1,0)) %>% + mutate(Other=ifelse(RACE_1=="Other",0,1)) %>% + mutate(White=ifelse(RACE_1=="White",0,0)) model_1=glm(LOW~RACE_1+AGE+LWT,data=lowbwt,family = "binomial") summary(model_1) Call: glm(formula = LOW ~ RACE_1 + AGE + LWT, family = "binomial", data = lowbwt) Deviance Residuals: Min 1Q Median 3Q Max -1.4052 -0.8946 -0.7209 1.2484 2.0982 Coefficients: Estimate Std. Error z value Pr(>|z|)

Hakkâri

Image
This article is about the city. For the historical region, see Hakkari. For the province of the same name, see Hakkâri Province. Municipality in Hakkâri, Turkey Hakkâri ܐܲܟܵܪܹ̈ܐ Akkārē Municipality Hakkâri Coordinates: 37°34′35″N 43°44′12″E  /  37.57639°N 43.73667°E  / 37.57639; 43.73667 Coordinates: 37°34′35″N 43°44′12″E  /  37.57639°N 43.73667°E  / 37.57639; 43.73667 Country Turkey Province Hakkâri Government  • Mayor Dilek Hatipoğlu (BDP) Area [1]  • District 2,237.19 km 2 (863.78 sq mi) Elevation 1,720 m (5,640 ft) Population (2012) [2]  • Urban 58,584  • District 81,549  • District density 36/km 2 (94/sq mi) Hakkâri (Syriac: ܗܲܟܵܐܪܝ̣ ‎ Hakkārī , Kurdish: Colemêrg ‎), is a city and the capital of the Hakkâri Province of Turkey. It is located a few kilometres away from the Turkish - Iraqi border.The name Hakkâri is derived from the Syriac word ܐܲܟܵܪܹ̈ܐ ( Akkārē ) meaning farmers or cultivators. Akkārē itself is derived from Akkadian ikkaru [3] The population of the city

How to find all pairs of digits that sum to a specific number

How to find all pairs of digits that sum to a specific number I am trying to write a Python function that gets a number as input, and prints all pairs of digits within the number that sums into a per-specified number. My code is: def f(n,num): s = str(n) l = for digit in s: l.append(digit) for i in range(len(l)): for j in range(len(l)): if i != j: if (int(l[i]) + int(l[j]) == num): print(l[i]," ",l[j]) It works fine, but every pair is printed twice. I couldn't find a way to remove the duplicates and print every pair only once. Can you assist ? Thank you. for j in range(len(l)): => for j in range(i+1,len(l)): and you can drop the i != j test – Jean-François Fabre Jun 30 at 7:30 for j in range(len(l)): for j in range(i+1,len(l)):

Gaziantep

Image
Metropolitan municipality in Southeastern Anatolia, Turkey Gaziantep Metropolitan municipality Clockwise from top left: Gaziantep zoo; a view of the city center; Kamil Ocak Stadium; Uğur Plaza Hotel. Gaziantep Location of Gaziantep within Turkey. Coordinates: 37°04′N 37°23′E  /  37.067°N 37.383°E  / 37.067; 37.383 Coordinates: 37°04′N 37°23′E  /  37.067°N 37.383°E  / 37.067; 37.383 Country   Turkey Region Southeastern Anatolia Province Gaziantep Government  • Mayor Fatma Şahin (AKP) Area  • Total 7.642 km 2 (2.951 sq mi) Population (2014)  • Total 1,556,381 (estimate, last Census [2,000CE] = 603,434)  • Density 212/km 2 (550/sq mi) Time zone FET (UTC+3) Postal code 27x xx Area code(s) 342 & 343 Licence plate 27 Website www.gaziantep-bld.gov.tr Gaziantep ( Turkish pronunciation:  [ɡaːˈzianˌtep] ), previously and still informally called Antep ( pronounced  [anˈtep] ; Armenian: Այնթապ , Kurdish: Dîlok ), is a city in the western part of Turkey's Southeastern Anatolia