After upgrade 2.5 to joomla 3.5 custom plugin doesn't work - joomla

My debug stack says :
JHtml image not found.
Call stack
Function Location
1 JApplicationCms->execute() C:\xampp\htdocs\test\index.php:49
2 JApplicationSite->doExecute() C:\xampp\htdocs\test\libraries\cms\application\cms.php:257
3 JApplicationSite->dispatch() C:\xampp\htdocs\test\libraries\cms\application\site.php:230
4 JComponentHelper::renderComponent() C:\xampp\htdocs\test\libraries\cms\application\site.php:191
5 JComponentHelper::executeComponent() C:\xampp\htdocs\test\libraries\cms\component\helper.php:380
6 require_once() C:\xampp\htdocs\test\libraries\cms\component\helper.php:405
7 JControllerLegacy->execute() C:\xampp\htdocs\test\components\com_incidentmap\incidentmap.php:131
8 IncidentController->display() C:\xampp\htdocs\test\libraries\legacy\controller\legacy.php:728
9 JControllerLegacy->display() C:\xampp\htdocs\test\components\com_incidentmap\controller.php:31
10 IncidentViewFlorida->display() C:\xampp\htdocs\test\libraries\legacy\controller\legacy.php:690
11 JViewLegacy->display() C:\xampp\htdocs\test\components\com_incidentmap\views\florida\view.html.php:31
12 JViewLegacy->loadTemplate() C:\xampp\htdocs\test\libraries\legacy\view\legacy.php:209
13 include() C:\xampp\htdocs\test\libraries\legacy\view\legacy.php:670
14 JHtml::_() C:\xampp\htdocs\test\components\com_incidentmap\views\florida\tmpl\default.php:8
Please help me fix this

Replace the problematic code with:
JHtml::image($file, $alt, $attribs = null, $relative = false, $returnPath = 0)
Of course, you will need to replace the parameters above with your values.
I think you were using JHtml::_('image.site',... which no longer exists in Joomla 3.

Related

How to avoid row names in further analysis in R?

I´m just running the following example from GGEBiplotGUI package and of course, it works properly.
library(GGEBiplotGUI)
data("Ontario")
Ontario
GGEBiplot(Data = Ontario)
But when I download "Ontario" data and I want to run the above cited script on my PC. See the example below.
Ontario <- read.csv("Book.csv")
library(GGEBiplotGUI)
GGEBiplot(Data = Ontario)
The result is the following table (from column 0 to 10) taking numbers (From 1 to 17) as genotypes and "X" as another location.
See the result below please.
X BH93 EA93 HW93 ID93 KE93 NN93 OA93 RN93 WP93
1 ann 4.460 4.150 2.849 3.084 5.940 4.450 4.351 4.039 2.672
2 ari 4.417 4.771 2.912 3.506 5.699 5.152 4.956 4.386 2.938
3 aug 4.669 4.578 3.098 3.460 6.070 5.025 4.730 3.900 2.621
4 cas 4.732 4.745 3.375 3.904 6.224 5.340 4.226 4.893 3.451
5 del 4.390 4.603 3.511 3.848 5.773 5.421 5.147 4.098 2.832
6 dia 5.178 4.475 2.990 3.774 6.583 5.045 3.985 4.271 2.776
7 ena 3.375 4.175 2.741 3.157 5.342 4.267 4.162 4.063 2.032
8 fun 4.852 4.664 4.425 3.952 5.536 5.832 4.168 5.060 3.574
9 ham 5.038 4.741 3.508 3.437 5.960 4.859 4.977 4.514 2.859
10 har 5.195 4.662 3.596 3.759 5.937 5.345 3.895 4.450 3.300
11 kar 4.293 4.530 2.760 3.422 6.142 5.250 4.856 4.137 3.149
12 kat 3.151 3.040 2.388 2.350 4.229 4.257 3.384 4.071 2.103
13 luc 4.104 3.878 2.302 3.718 4.555 5.149 2.596 4.956 2.886
14 m12 3.340 3.854 2.419 2.783 4.629 5.090 3.281 3.918 2.561
15 reb 4.375 4.701 3.655 3.592 6.189 5.141 3.933 4.208 2.925
16 ron 4.940 4.698 2.950 3.898 6.063 5.326 4.302 4.299 3.031
17 rub 3.786 4.969 3.379 3.353 4.774 5.304 4.322 4.858 3.382
How can I fix this problem? I mean, in order to avoid "rownames" and "x" as a variables in the GGEBiplotGUI analysis.
I have also tried with these codes and they didn´t work:
attributes(Ontario)$row.names <- NULL
print(Ontario, row.names = F)
row.names(Ontario) <- NULL
Ontario[, -1] ## It deletes the first column not the 0 one.
Many thanks in advance!
This code worked properly.
Ontario <- read.csv("Libro.csv")
rownames(Ontario)<-Ontario$X
Ontario1<-Ontario[,-1]
library(GGEBiplotGUI)
GGEBiplot(Data = Ontario)

Cant run app Nativescript on iOS but runs on android

Cant run app Nativescript on iOS but runs on android
My code works ok android with no problems but in iOS i get those erros below.
and i have no ideia why, what im missing ???? Its a plugin? Module?
Any help would be good cuz im lost here. thanks
when i run tns run ios --env.aot --env.uglify.
the erros i get when running the app :
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x10fe3991f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x10fe71b60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3 0x110812dd6 ffi_closure_unix64_inner
4 0x1108137fa ffi_closure_unix64
5 0x114515d22 -[CALayer layoutSublayers]
6 0x11451a9fc CA::Layer::layout_if_needed(CA::Transaction*)
7 0x114526d58 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
8 0x11449624a CA::Context::commit_transaction(CA::Transaction*)
9 0x1144cd606 CA::Transaction::commit()
10 0x116f942c3 __34-[UIApplication _firstCommitBlock]_block_invoke_2
11 0x115a97cbc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
12 0x115a97480 __CFRunLoopDoBlocks
13 0x115a91d04 __CFRunLoopRun
14 0x115a914d2 CFRunLoopRunSpecific
15 0x11b8af2fe GSEventRunModal
16 0x116f7afc2 UIApplicationMain
17 0x11081363d ffi_call_unix64
18 0x12db4cf70
JavaScript stack trace:
1 #file:///node_modules/tns-core-modules/ui/content-view/content-view.js:44:0
2 _eachLayoutView#file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1015:0
3 #file:///node_modules/tns-core-modules/ui/proxy-view-container/proxy-view-container.js:45:0
4 eachChildView#file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0
5 _eachLayoutView#file:///node_modules/tns-core-modules/ui/proxy-view-container/proxy-view-container.js:43:0
6 get#file:///node_modules/tns-core-modules/ui/content-view/content-view.js:38:0
7 onMeasure#file:///node_modules/tns-core-modules/ui/page/page.js:272:0
8 measure#file:///node_modules/tns-core-modules/ui/core/view/view.js:55:0
9 measureChild#file:///node_modules/tns-core-modules/ui/core/view/view-common.js:954:0
10 i#file:///node_modules/tns-core-modules/ui/core/view/view.js:636:0
11 viewDidLayoutSubviews#file:///node_modules/tns-core-modules/ui/page/page.js:192:0
12 UIApplicationMain#[native code]
13 S#file:///node_modules/tns-core-modules/application/application.js:277:0
14 run#file:///node_modules/tns-core-modules/application/application.js:305:0
15 bootstrapNativeScriptApp#file:///node_modules/nativescript-angular/platform-common.js:205:0
16 bootstrapApp#file:///node_modules/nativescript-angular/platform-common.js:106:0
17 bootstrapModuleFactory#file:///node_modules/nativescript-angular/platform-common.js:77:0
18 #file:///app/bundle.js:72:449
19 ./main.ts#file:///app/bundle.js:72:477
20 k#file:///src/webpack/bootstrap:750:0
21 n#file:///src/webpack/bootstrap:43:0
22 r#file:///src/webpack/bootstrap:30:0
23 anonymous#file:///src/$_lazy_route_resource lazy namespace object:2:0
24 evaluate#[nat<…>
JavaScript error:
file:///node_modules/tns-core-modules/ui/content-view/content-view.js:44:0 JS ERROR Error: More than one layout child inside a
1 UIApplicationMain#[native code]
2 S#file:///node_modules/tns-core-modules/application/application.js:277:0
3 run#file:///node_modules/tns-core-modules/application/application.js:305:0
4 bootstrapNativeScriptApp#file:///node_modules/nativescript-angular/platform-common.js:205:0
5 bootstrapApp#file:///node_modules/nativescript-angular/platform-common.js:106:0
6 bootstrapModuleFactory#file:///node_modules/nativescript-angular/platform-common.js:77:0
7 #file:///app/bundle.js:72:449
8 ./main.ts#file:///app/bundle.js:72:477
9 k#file:///src/webpack/bootstrap:750:0
10 n#file:///src/webpack/bootstrap:43:0
11 r#file:///src/webpack/bootstrap:30:0
12 anonymous#file:///src/$_lazy_route_resource lazy namespace object:2:0
13 evaluate#[native code]
14 moduleEvaluation#:1:11
15 promiseReactionJob#:1:11
Somewhere in your source, usually at the root of a particular component's html/xml, you have a view that is only rendered on iOS. However, because it fails on iOS and not Android, it is likely that you have not placed the similar restriction on the other top-level element.
<ios>
<Label text="only iOS"></Label>
</ios>
<Label text="only Android"></Label> <!-- Error; is present in template for both!! -->
It is hard for me to guess where exactly the issue might be, but I'd suggest having a look through your templates for the usage of ios.
Well in ios u cant have free templates floating arround everything was too be inside a LayoutContainer
Android (Works) iOS (Don't Work)
<GridLayout>
(... Content)
</GridLayout>
<GridLayout>
(... More Content)
</GridLayout>
Android (Works) iOS (Works)
<GridLayout> // MAIN CHILD
(... Content)
<GridLayout>
(... More Content)
</GridLayout>
</GridLayout>

Laravel 5.7 Database Design Layout / Average from Collection

I have a situation where each Order can have Feedback. In case the product is physical, the Feedback can have many packaging_feedbacks. The packaging_feedbacks are supposed to be a relation to the packaging_feedback_details.
Feedback Model
public function packagingFeedbacks()
{
return $this->hasManyThrough('App\PackagingFeedbackDetail', 'App\PackagingFeedback',
'feedback_id', 'id', 'id', 'user_selection');
}
packaging_feedback_details
id|type_id(used to group the "names" for each feedback option)|name
1 0 well packed
2 0 bad packaging
3 1 fast shipping
4 1 express delivery
packaging_feedbacks
id|feedback_id|user_selection (pointing to the ID of packaging_feedback_details)
1 1 2
2 1 6
3 1 7
4 1 12
5 1 15
6 1 17
7 2 1
8 2 6
9 2 7
10 2 12
11 2 15
12 2 17
13 3 1
14 3 6
15 3 7
16 3 12
17 3 15
18 3 17
Now I would like to be able to get the average selection of the users for a physical product. I started by using:
$result = Product::with('userFeedbacks.packagingFeedbacks')->where('id', 1)->first();
$collection = collect();
foreach ($result->userFeedbacks as $key) {
foreach ($key->packagingFeedbacks as $skey) {
$collection->push($skey);
}
}
foreach ($collection->groupBy('type_id') as $key) {
echo($key->average('type_id'));
}
But it returns not the average id since it will calculate the average not the way I need it to calculate. Is there some better way, because I think it's not the cleverest way to do so. Is my database design, in general, the "best" way to handle this?
The type of average you're looking for here is mode. Laravel's collection instances have a mode() method which was introduced in 5.2 which when provide a key returns an array containing the highest occurring value for that key.
If I have understood your question correctly this should give you what you're after:
$result->userFeedbacks
->flatMap->packagingFeedbacks
->groupBy('type_id')
->map->mode('id');
The above is taking advantage of flatMap() and higher order messages() on collections.

Error messages when compiling old fortran code

I am trying to compile a code that hasn't been developed with the newest standards in mind. I am using the gfortran compiler and get a few errors that I can't correct.
A partner of mine uses the Intel Visual Fortran compiler in MS Visual Studio and doesn't get any errors. Below are the relevant sections of code and their errors. Insight into any of these would be greatly appreciated.
Error 1:
flow.for:63.63:
3 *gjmh_old(j)*abs(gjmh_old(j))/2.0d0/dens_fjmh(j) )
1
Error: Expected a right parenthesis in expression at (1)
Corresponding code:
sum_dpjmh_old= 1.0/2.0*(dens_jmh(j)+dens_old(j))*grav*(dzc(j)/2.0d0) !!!!
1 + ( gavg_old(j)*gavg_old(j)/dens_mom(j)
1 -gjmh_old(j)*gjmh_old(j)/dmom_jmh(j) )
3 + 1.0/2.0*
3 ( fric(j)*dzc(j)/2.0/dhyd(j)
3 *gavg_old(j)*abs(gavg_old(j))/2.0d0/dens_fric(j)
3 +fjmh(j)*dzc(j)/2.0/dhyd(j)
3 *gjmh_old(j)*abs(gjmh_old(j))/2.0d0/dens_fjmh(j) )
Error 2:
flow.for:78.13:
1 + ( gavg(j)*gavg(j)/dens_momn(j)
1
Error: Missing exponent in real number at (1)
Corresponding Code:
sum_dpjmh = 1.0/2.0*(dens_jmhn(j)+dens_ch(j))*grav*(dzc(j)/2.0d0) !!!!
1 + ( gavg(j)*gavg(j)/dens_momn(j)
1 -gjmh(j)*gjmh(j)/dmom_jmhn(j) )
3 + 1.0/2.0*
3 ( fric(j)*(dzc(j)/2.0)/dhyd(j)
3 *gavg(j)*abs(gavg(j))/2.0d0/dens_ch(j)
3 + fjmh(j)*(dzc(j)/2.0)/dhyd(j)
3 *gjmh(j)*abs(gjmh(j))/2.0d0/dens_jmhn(j) )
Error 3:
flow.for:684.72:
3 /dens_fjmh(j) )
1
Error: Syntax error in argument list at (1)
Corresponding code:
gjmh(j) = gjmh_old(j) + dt/dzc(j)*(
1 phi*2.0d0*(pjmh(j)-p(j))
1 + (1.0-phi)*2.0d0*(pjmh_old(j)-p_old(j))
1 - 2.0d0*( gavg_old(j)*gavg_old(j)/dens_mom(j)
1 -gjmh_old(j)*gjmh_old(j)/dmom_jmh(j) )
4 - dens_jmh(j)*grav*dzc(j)
3 - fjmh(j)*dzc(j)/2.0d0/dhyd(j)*gjmh_old(j)*abs(gjmh_old(j))
3 /dens_fjmh(j) )
It seems your code is not well formatted. If you are trying to use fixed format, you should follow the request of fixed format, as http://nf.nci.org.au/training/FortranBasic/slides/slides.005.html.
Or following instructions in http://en.wikipedia.org/wiki/Fortran#Fixed_layout_and_punched_cards:
Column 1 contains *, ! or C for comments.
Column 6 for continuation.
Another way is to convert fixed format to free format, but since your code is not well formatted, most converter may be not working well.

System.Windows.Navigation.NavigationService.Navigate is throwing invalidoperationexception

Frame Image Function Offset
0 coredll.dll xxx_RaiseException 19
1 mscoree3_7.dll 436488
2 mscoree3_7.dll 386545
3 mscoree3_7.dll 540936
4 TransitionStub 0
5 System.Windows.Navigation.NavigationService.Navigate 1652
6 XXX.Components.pushScreen 172
7 XXX.pushHomeScr 996
8 XXX.update 1488
9 .__c__DisplayClass3._ResponseReady_b__0 700
10 mscoree3_7.dll 429164
11 mscoree3_7.dll 185803
12 mscoree3_7.dll 184423
13 System.Reflection.RuntimeMethodInfo.InternalInvoke 112
14 System.Reflection.RuntimeMethodInfo.InternalInvoke 1556
15 System.Reflection.MethodBase.Invoke 104
16 System.Delegate.DynamicInvokeOne 476
17 System.MulticastDelegate.DynamicInvokeImpl 84
18 System.Windows.Threading.DispatcherOperation.Invoke 80
19 System.Windows.Threading.Dispatcher.Dispatch 404
I am using the following code to push new page
Uri navigateUritemp = new Uri(url, UriKind.RelativeOrAbsolute);
if(scrObj.NavigationService.CurrentSource != navigateUritemp)
{
scrObj.NavigationService.Navigate(navigateUritemp);
}
It looks the following line is throwing invalidoperationexception
scrObj.NavigationService.Navigate(navigateUritemp);
can someone tell what is wrong in this code?
One common situation in which I've seen this InvalidOperationException happen is if multiple navigations are attempted simultaneously, or if a navigation attempt occurs while the app is not in the foreground.
This can happen, for example, if a user manages to hit an appbar button a second time while a slow navigation is occurring.
A quick search reveals others have seen the same sort of thing - e.g. http://www.nickharris.net/2011/01/windows-phone-7-navigation-is-not-allowed-when-the-task-is-not-in-the-foreground/
Try to use if (scrObj.NavigationService.CurrentSource.equals(navigateUritemp)) Maybe this will help. Are you getting this exception all the time?
Try to do the following:
Create a new project and remove the rest of your code and keep the code related to NavigationService.
Crate a folder (Name the folder something like homescreen)
Add 2 XAML pages (eg: Page1.xaml, Page2.xaml)
Test NavigationService code from MainPage.xaml
Try this:
NavigationService.Navigate(new Uri("/homescreen/Page1.xaml", UriKind.Relative));
or
NavigationService.Navigate(new Uri("/homescreen/Page2.xaml", UriKind.Relative));
if you are using UriKind.Relative make sure to specify the correct path, eg: if you use "homescreen/Page2.xaml" it want work, you have to use "/homescreen/Page2.xaml", " / " at the beginning of your path is like "root" or "~" in ASP.NET

Resources