Localizable.strings – The data couldn’t be read because it isn’t in the correct format

Use plutil from the Terminal: you have to run it for each version of the localizable file. E.g cd into your project root cd eb.lproj – you can replace this with any localisation you are working with. plutil -lint Localizable.strings When you run step 3, you will either be shown an error, telling you what … Read more

Disable warnings when loading non-well-formed HTML by DomDocument (PHP)

Call libxml_use_internal_errors(true); prior to processing with with $xmlDoc->loadHTML() This tells libxml2 not to send errors and warnings through to PHP. Then, to check for errors and handle them yourself, you can consult libxml_get_last_error() and/or libxml_get_errors() when you’re ready: libxml_use_internal_errors(true); $dom->loadHTML($html); $errors = libxml_get_errors(); foreach ($errors as $error) { // handle the errors as you wish … Read more

how to set showModalBottomSheet to full height?

[Update] In showModalBottomSheet(…) set the property isScrollControlled:true. It will make bottomSheet to full height. [Original answer] You can Implement the FullScreenDialog instead. Flutter Gallery app has an example of FullScreenDialog You can open your Dialog using below code: Navigator.of(context).push(new MaterialPageRoute<Null>( builder: (BuildContext context) { return Dialog(); }, fullscreenDialog: true )); Check this blog post too … Read more

Get public/external IP address?

Using C#, With webclient its a short one. public static void Main(string[] args) { string externalIpString = new WebClient().DownloadString(“http://icanhazip.com”).Replace(“\\r\\n”, “”).Replace(“\\n”, “”).Trim(); var externalIp = IPAddress.Parse(externalIpString); Console.WriteLine(externalIp.ToString()); } Command Line (works on both Linux and Windows) wget -qO- http://bot.whatismyipaddress.com OR curl http://ipinfo.io/ip

How can I increment a variable without exceeding a maximum value?

I would just do this. It basically takes the minimum between 100 (the max health) and what the health would be with 15 extra points. It ensures that the user’s health does not exceed 100. public void getHealed() { health = Math.min(health + 15, 100); } To ensure that hitpoints do not drop below zero, … Read more

JContainer, JObject, JToken and Linq confusion

You don’t really need to worry about JContainer in most cases. It is there to help organize and structure LINQ-to-JSON into well-factored code. The JToken hierarchy looks like this: JToken – abstract base class JContainer – abstract base class of JTokens that can contain other JTokens JArray – represents a JSON array (contains an ordered … Read more