Windows Phone - Cordova - Select crash - angularjs

I've got a strange problem on my Windows Phone 10 App.
Setup:
Cordova 6.2
Windows Platform 4.4.2
Angular 1.5.5
Angular Material v1.1.0-rc.5
Angular-Translate v.2.7.2
Inside my app I got a select-control:
<select style="width:100%;height:40px;margin-top:10px;margin-bottom:10px;" ng-model="isoCodeList.region">
<option ng-repeat="entry in ::isoCodeList.list track by $index" value="{{::entry}}">
{{::"ISO_" + entry | translate}}
</option>
</select>
The isoCodeList looks like:
$scope.isoCodeList.list = ['AD', 'AE', 'AF', 'AG',...]
The translation labels looks like:
"ISO_AE": "United Arab. Emirates"
When I open the select-control 1 second later the app crashes.
The problem doesn't exists while I debug the app via Visual-Studio, it just occures when the App is deployed and downloaded from the Windows-Store.
Also this issues doesn't occure on a Windows-Phone 8.1 device, just on Windows-Phone 10, but both get the same .appx-file.
Anyone experienced the same problem?
PS: I can't use the standard angular-material md-select because it needs more then 20 to 30 seconds to open the whole control.
Thanks in advance
Graphefruit

Related

Joomla module language file wont work

I want to follow Joomla best practise but I can't get the module language file working. I've tried everything. I've been through all the Joomla and stack overflow questions and the code I've got seems to match the answers but it won't work :(
I have inside of the files tags in the xml for the module
<folder>language</folder>
under files I have the language def:
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_events_display.sys.ini</language>
<language tag="en-GB">en-GB/en-GB.mod_events_display.ini</language>
</languages>
The language folder and files are present on the server. I've also put copies in the site and the admin language folder just for good measure.
The language file is simple now as I've taken everything out to get it to work:
MOD_EVENTS_DISPLAY="Magazine display"
MOD_EVENTS_DISPLAY_SHOW_EVENT_TITLE_LABEL="Show event title"
It's used int the xml file like this:
<field name="showEventTitle" type="radio" default="0" label="MOD_EVENTS_DISPLAY_SHOW_EVENT_TITLE_LABEL" description="MOD_EVENTS_DISPLAY_SHOW_EVENT_TITLE" class="btn-group btn-group-yesno">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
I've checked the module with language debug and it says that it's loaded the file:
**Loaded** : JROOT/language/en-GB/en-GB.mod_events_display.sys.ini
What started out as a 30 min job to be compatible with Joomla guidelines has turned into a 5 hour nightmare trying to get the system to actually work
Any ideas about what other debugging I could do would be great.
(Joomla 3.8.5 and php 7)
Make a copy of what you have and see if this might work for you.
// <folder>language</folder> // remove this line
<languages folder="language">
<language tag="en-GB">en-GB.mod_events_display.sys.ini</language>
<language tag="en-GB">en-GB.mod_events_display.ini</language>
</languages>
...
<field
name="showEventTitle"
type="radio"
default="0"
label="MOD_EVENTS_DISPLAY_SHOW_EVENT_TITLE_LABEL"
description="MOD_EVENTS_DISPLAY_SHOW_EVENT_TITLE"
class="btn-group btn-group-yesno"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
And that your language folder is structured like this
language
|__ en-GB
|-- en-GB.mod_events_display.sys.ini
|__ en-GB.mod_events_display.ini
Good luck!

Display project version in ASP.NET Core 1.0.0 web application

None of what used to work in RC.x helps anymore.
I have tried these:
PlatformServices.Default.Application.ApplicationVersion;
typeof(Controller).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
Assembly.GetEntryAssembly().GetName().Version.ToString();
They all return 1.0.0.0 instead of 1.0.0-9 which should be after execution of the dotnet publish --version-suffix 9 having this in project.json: "version": "1.0.0-*"
Basically they give me "File version" from the attached picture instead of "Product version" which dotnet publish actually seems to change.
For version 1.x:
Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
For version 2.0.0 this attribute contains something ugly:
2.0.0 built by: dlab-DDVSOWINAGE041 so use this one:
typeof(RuntimeEnvironment).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
I would do it like this on ASP.NET Core 2.0+
var assemblyVersion = typeof(Startup).Assembly.GetName().Version.ToString();
In .Net Core 3.1 I show the version directly in my View using:
#GetType().Assembly.GetName().Version.ToString()
This shows the Assembly Version you have in your csproj file:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>2.2.2.2</FileVersion>
<Version>4.0.0-NetCoreRC</Version>
</PropertyGroup>
If you want to display the "other" FileVersion or "Informational" Version properties in the View add using System.Reflection:
using System.Reflection;
.... bunch of html and stuff
<footer class="main-footer">
<div class="float-right hidden-xs">
<b>Assembly Version</b> #(Assembly.GetEntryAssembly().GetName().Version)
<b>File Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version)
<b>Info Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion)
</div>
</footer>
Note that after adding the System.Reflection the original #GetType().Assembly.GetName().Version.ToString() line returns 0.0.0.0 and you need to use the #Assembly.GetEntryAssembly().GetName().Version
There's a blog post here
Edit: Make sure to follow proper naming conventions for the Version strings. In general, they need to lead with a number. If you don't, your app will build but when you try to use NuGet to add or restore packages you'll get an error like 'anythingGoesVersion' is not a valid version string. Or a more cryptic error: Missing required property 'Name'. Input files: C:\Users....csproj.'
more here:
This work for me too:
#Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion
It works with csproj file - either <Version>1.2.3.4, or <VersionPrefix>1.2.3</VersionPrefix>. However the <VersionSuffix> isn't recoganized as this doc says.
The answer by Michael G should have been the accepted one since it works as expected. Just citing the answer by Michael G above.
var version = GetType().Assembly.GetName().Version.ToString();
works fine. It gets the Package version set in the Package tab of project properties.
As an addition, if we need to get the Description we set in the same tab, this code would work. (core 3.1)
string desc = GetType().Assembly.GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
Just in case someone needs this.
Happy coding !!!

Esri bootstrap-map-js and Invalid argument error on IE 7/8

I'm using this awesome project called bootstrap-map-js.
A simple framework for building responsive mapping apps with ArcGIS
and Bootstrap.
Since Esri ArcGIS JavaScript API states that they support IE7+ I thought the amazing bootstrap-map-js project would also be compatible with IE 7. Maybe it is and the problem is in my code...
I'm getting an Invalid Argument error with no further info on IE 11 Developer Tools console window when simulating the page on IE 7/8 document modes. IE 9 onwards works great. All other browsers work great too! :) Only finicky IE refuses to work as always...
Looks like dojo.require is barking somewhere. See this related question: Dojo nested requires on IE7 and IE8 causes Invalid Argument Exception
If I remove the reference to bootstrapmap.js and the var map = ... declaration, then the code works and I see hey Leniel! otherwise the code breaks and I see the Invalid argument. The code breaks in the call to BootstrapMap.create.
Can anyone shed some light on what's going on with finicky IE? Is there anything I can do to see more from the error? As you see in the image, there's no message, description, etc. :(
Here's the minimum code I had to assemble to get to what was causing the error:
<!-- ArcGIS JavaScript API v3.8 -->
<script type="text/javascript" src="http://localhost/arcgis_js_api/library/3.8/3.8/init.js"></script>
<script type="text/javascript">
function init()
{
require([
"esri/map",
"/myproject/Scripts/bootstrapmap.js",
"esri/layers/FeatureLayer"
], function(
Map,
BootstrapMap,
FeatureLayer
)
{
// Get a reference to the ArcGIS Map class
var map = BootstrapMap.create("mapDiv", {
basemap: "oceans",
center: [-117.789, 33.543],
zoom: 12
});
alert('hey Leniel!');
});
}
dojo.addOnLoad(init);
</script>
I made some progress on this issue as you can read here.
I read Configuring Dojo with dojoConfig and then added this before ArcGIS JS API script tag:
<!-- set Dojo configuration, load Dojo -->
<script>
dojoConfig = {
has: {
"dojo-firebug": true
},
parseOnLoad: true,
async: true
};
</script>
Now I get a more descriptive error instead of only Invalid argument as before. IE Dev Tools shows this:
SCRIPT87: Invalid argument.
File: init.js, Line: 136, Column: 65
This is line 136 in init.js when I click on the link provided by IE Dev Tools:
b;b=d[b]?"cssFloat"in f.style?"cssFloat":"styleFloat":b;if(3==k)return q?g(f,e):f.style[b]=e;for(var r in b)l.set(a,r,b[r]);return l.getComputedStyle(f)};return l})},"dojo/dom-geometry":function(){define(["./sniff","./_base/window","./dom","./dom-style"],function(b,n,k,m){function l(a,b,d,c,h,f){f=f||"px";a=a.style;isNaN(b)||(a.left=b+f);isNaN(d)||(a.top=d+f);0<=c&&(a.width=c+f);0<=h&&(a.height=h+f)}function r(a){return"button"==a.tagName.toLowerCase()||"input"==a.tagName.toLowerCase()&&"button"==
Sounds like IE 7/8 is barking about some crazy CSS manipulation done by ArcGIS JS API.
Fixed it connecting the dots...
Searched for NaNpx e's value as I had never seen that before. Found this jQuery ticket.
Followed the advice given there and changed that return in line 136,
from:
return q?g(f,e):f.style[b]=e;
to:
return q?g(f,e):f.style[b]=(e=='NaNpx'?'0px':e);
Note: I'm using jQuery 1.11.0 which supports IE 7.

AngularJS: Error while interpolating: {{ $index + 1 }}

I used $index inside simple ng-repeat to show items' number:
<li ng-repeat="item in dataList | limitTo:5">
<span>{{ $index + 1 }} </span>
</li>
And it worked OK for long time.
But sudden couple days ago I started getting:
Error: Error while interpolating: {{ $index + 1 }} illegal access
at Error (native)
at Object.k (/vendors/angular/angular.min.js:55:287)
at Object.e.$digest (/vendors/angular/angular.min.js:90:233)
at Object.e.$apply (/vendors/angular/angular.min.js:92:431)
at Object.<anonymous> (/js/controllers/HomePage.js:99:28)
at l (/vendors/jquery/jquery.min.js:4:24797)
at Object.c.fireWith [as resolveWith] (/vendors/jquery/jquery.min.js:4:25618)
at k (/vendors/jquery/jquery.min.js:6:5201)
at XMLHttpRequest.<anonymous> (/vendors/jquery/jquery.min.js:6:9005)
at both production and local environments.
Data in dataList is correct and the same as was all time previous.
It is reproducible only in latest Chrome (32.0.1700.14) in other browsers it still working correct.
Any ideas why this can happen and how it can be fixed?
Angular version: 1.1.5.
Debugging showed that exception is thrown from angular.js:6371 on native adding operation, and it is not about AngularJS itself.
For those who are getting same issue, looks like the only solution is to find any alternative way of implementing your task on which it is failing. At least till next Google Chrome update.
Thanks to #Heikki for pointing to chromium issues tracker.
Since the bug is related to String + Number concatenation I am using toString() on the numbers as a temp workaround.
{{($index + 1).toString()}}
worked in my case.

Silverlight crashes FireFox 3.5, IE7, & IE8

One of my users has an HP Pavilion DV4-1430us laptop running Windows Vista Professional 64-bit. She is using the latest version of the Silverlight Plug-In, downloaded on 24 July from microsoft.com/silverlight.
While typing in a text box in a silverlight web application my company developed, all three browsers will occasionally crash. Nine times out of ten, she can go back to the page where the crash occurred and pick up from where she left off, only to have it crash again several minutes later.
This only occurs while she is typing in a text box, and it only occurs on her laptop. I have watched her to confirm there is no user error.
Any thoughts?
Edit 1: I replicated the error. In Firefox 3.5, the window in which I was working closed with no warning, and the Mozilla Crash Reporter popped up. I'm pasting the crash report code:
Add-ons: {20a82645-c095-46ed-80e3-08825760534b}:1.1,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.5.1
BuildID: 20090715094852
CrashTime: 1248713784
InstallTime: 1248455260
ProductName: Firefox
SecondsSinceLastCrash: 245055
StartupTime: 1248713511
Theme: classic/1.0
Throttleable: 1
URL: [redacted]
Vendor: Mozilla
Version: 3.5.1
Edit 2: I replicated the error in IE8. I highlighted the text in a text box and began to type. Instantly,
Internet Explorer has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
appeared.
Here is the event log entry:
>Log Name: Application
>Source: Application Error
>Date: 7/27/2009 1:06:10 PM
>Event ID: 1000
>Task Category: (100)
>Level: Error
>Keywords: Classic
>User: N/A
>Computer: [computer name]
>Description:
>Faulting application iexplore.exe, version 8.0.6001.18702, time stamp 0x49b3ad2e, faulting module kernel32.dll, version 6.0.6000.16820, time stamp 0x4995210a, exception code 0xe0434352, fault offset 0x0001e05c, process id 0x1a54, application start time 0x01ca0edc4c7c0054.
>Event Xml:
><Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
> <System>
> <Provider Name="Application Error" />
> <EventID Qualifiers="0">1000</EventID>
> <Level>2</Level>
> <Task>100</Task>
> <Keywords>0x80000000000000</Keywords>
> <TimeCreated SystemTime="2009-07-27T17:06:10.000Z" />
> <EventRecordID>2636</EventRecordID>
> <Channel>Application</Channel>
> <Computer>[computer name]</Computer>
> <Security />
> </System>
> <EventData>
> <Data>iexplore.exe</Data>
> <Data>8.0.6001.18702</Data>
> <Data>49b3ad2e</Data>
> <Data>kernel32.dll</Data>
> <Data>6.0.6000.16820</Data>
> <Data>4995210a</Data>
> <Data>e0434352</Data>
> <Data>0001e05c</Data>
> <Data>1a54</Data>
> <Data>01ca0edc4c7c0054</Data>
> </EventData>
></Event>
The web app was written for Silverlight 2, and was trying to call System.ComponentModel.dll. The user was using the Silverlight 3 runtime, which does not include System.ComponentModel.
Solution: Downgrade user to Silverlight 2 until webapp can be rewritten for Silverlight 3.
Try disabling and re-enabling the Pen Tablet Service. It seems that Silverlight needs to access WispTis.exe or Wacomservice file for it to work properly. You can check to see if it is enabled by going to Control Panel > Administrative Tools > Services > Tablet PC Input Service. Make sure the service is started and set to automatic.
You should look at FireFox's bugzilla for issues in firefox. You'll get a lot better idea of what todo. If you look, you will see quite a number of simular faults.

Resources