I am Using
Rails → 5.2
ruby → 2.4
MDBootstrap
I am using 3 separate bootstrap related frameworks they are
sb-admin-2(old version),
cardoor template,
mdbootstrap
sb-admin 2 is used in app/assets
cardoor is used in vendor/cardoor/
I am using custom layout setup root contains
-vendor
-customer
-font
-img
-javascripts
-stylesheets
stylesheets folder contains following files
vendor/customer/stylesheets/all.css
vendor/customer/stylesheets/bootstrap.css
vendor/customer/stylesheets/font-awesome.css
vendor/customer/stylesheets/mdb.css
vendor/customer/stylesheets/mdb.lite.css
vendor/customer/stylesheets/mdb.lite.min.css
vendor/customer/stylesheets/mdb.min
vendor/customer/stylesheets/customer.css
instead of application.css I have used customer.css
vendor/customer/stylesheets/customer.css
/*
*= require customer/stylesheets/bootstrap
*= require customer/stylesheets/bootstrap.min
*= require customer/stylesheets/mdb
*= require customer/stylesheets/mdb.lite
*= require customer/stylesheets/mdb.lite.min
*= require customer/stylesheets/mdb
*= require customer/stylesheets/all
*= require customer/stylesheets/font-awesome
*= require customer/stylesheets/style
*= require customer/stylesheets/style.min
*= require customer/stylesheets/addons/datatables-select
*= require customer/stylesheets/addons/datatables-select.min
*= require customer/stylesheets/addons/datatables
*= require customer/stylesheets/addons/datatables.min
*= require customer/stylesheets/addons/directives
*= require customer/stylesheets/addons/directives.min
*= require customer/stylesheets/addons/flag
*= require customer/stylesheets/addons/flag.min
*= require customer/stylesheets/addons/rating
*= require customer/stylesheets/addons/rating.min
*= require selectize
*= require bootstrap-datetimepicker
*= require selectize.default
*= require select2.min
initializers/assets.rb
Rails.application.config.assets.precompile += %w( rtt_demo/stylesheets/rtt_demo.css )
Rails.application.config.assets.precompile += %w( rtt_demo/javascripts/rtt_demo.js )
layouts/customer.html.erb
<%= stylesheet_link_tag 'rtt_demo/stylesheets/rtt_demo', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'rtt_demo/javascripts/rtt_demo', 'data-turbolinks-track': 'reload' %>
I am getting the following error and fontawesome icon is not displaying
downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:2): status=2147746065 source: http://localhost:3000/assets/customer/webfonts/fa-solid-900.woff
downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:3): status=2147746065 source: http://localhost:3000/assets/customer/webfonts/fa-solid-900.ttf
downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:1): status=2147746065 source: http://localhost:3000/assets/customer/webfonts/fa-solid-900.woff2
Related
I have been trying to create react app using the npx command but every time I run it, I get the error message in console:
yarn add v1.22.4
error An unexpected error occurred: "EISDIR: illegal operation on a directory, read".
I also get a yarn-error.log file with the first few lines as thus:
Arguments:
/Users/sammyebinne / .nvm / versions / node / v14 .5 .0 / bin / node / usr / local / Cellar / yarn / 1.22 .4 / libexec / bin / yarn.js add--exact react react - dom react - scripts cra - template--cwd / Users / sammyebinne / Documents / Work / Practice / radler / rad
PATH: /Users/sammyebinne / .npm / _npx / 5326 / bin: /Users/sammyebinne / node_modules / .bin: /Users/sammyebinne / .nvm / versions / node / v14 .5 .0 / bin: /usr/local / bin: /usr/bin: /bin:/usr / sbin: /sbin:~/.npm - global / bin: /Library/Apple / usr / bin: /Users/sammyebinne / .nvm / versions / node / v14 .5 .0 / bin
When I run the following commands
g := UnivariatePolynomial(Rationals, [12,-5,0,0,0,1]);
RootsOfPolynomialAsRadicals(g);
I get this error
*** too many arguments: ...;,nf=nfinit([f,nfbasis(f,1)]);fac=lift(nffact
*** ^--------------------
*** at top-level: for(i=1,#fac[,1],for(j=1,fac[i,2
*** ^--------------------
*** incorrect type in _[,_] OCcompoC [not a matrix] (t_POL).
Error, List Element: <list>[1] must have an assigned value in
faktoren[1] := lcoeff * faktoren[1]; at /proc/cygdrive/C/gap486/pkg/Alnuth-3.0.0/gap/factors.gi:99 called from
FactorsPolynomialPari( AlgExtEmbeddedPol( H, poly )
) at /proc/cygdrive/C/gap486/pkg/Alnuth-3.0.0/gap/factors.gi:51 called from
FactorsPolynomialAlgExt( erw.H, poly ) at /proc/cygdrive/C/gap486/pkg/radiroot/lib/SplittField.gi:237 called from
RR_Zerfaellungskoerper( poly, rec(
roots := [ ],
degs := [ ],
coeffs := [ ],
K := FieldByMatrices( [ [ [ 1 ] ] ] ),
H := Rationals ) ) at /proc/cygdrive/C/gap486/pkg/radiroot/lib/Radicals.gi:293 called from
CallFuncList( RootsOfPolynomialAsRadicalsNC, arg
) at /proc/cygdrive/C/gap486/pkg/radiroot/lib/Radicals.gi:253 called from
<function "RootsOfPolynomialAsRadicals">( <arguments> )
called from read-eval loop at line 2 of *stdin*
you can 'return;' after assigning a value
I am using GAP 4.8.6 on windows 10, installed from the windows installer on the GAP downloads page, and PARI/GP 2.9.1 64 bit (stable installer). I've also tried manually downloading and using the latest versions of Alnuth and Radiroot but I'm still getting the same error. Does anyone know how to fix this?
This now works in GAP 4.11.0, with Alnuth 3.1.2, RadiRoot 2.8 and Pari/GP 2.9.3, under macOS:
g := UnivariatePolynomial(Rationals, [12,-5,0,0,0,1]);
RootsOfPolynomialAsRadicals(g);
starts an xdvi viewer which displays the result. It's hard to read as an image, so I am providing the LaTeX source for it, which may be more useful:
\documentclass[fleqn]{article}
\setlength{\paperwidth}{84cm}
\setlength{\textwidth}{80cm}
\setlength{\paperheight}{59.5cm}
\setlength{\textheight}{57cm}
\begin{document}
\noindent
An expression by radicals for the roots of the polynomial $x^{5} - 5x + 12$ with the $n$-th root of unity $\zeta_n$ and
\\
$\omega_1 = \sqrt[2]{ - 10}$,\\
$\omega_2 = \sqrt[5]{\left( - \frac{421}{5}\zeta_{5} - \frac{449}{5}\zeta_{5}^{2} - \frac{49}{5}\zeta_{5}^{3} + \frac{229}{5}\zeta_{5}^{4}\right) + \left( - \frac{168}{25}\zeta_{5} - \frac{849}{25}\zeta_{5}^{2} - \frac{1101}{25}\zeta_{5}^{3} - \frac{582}{25}\zeta_{5}^{4}\right)\omega_1}$,\\
\\
is:
\\
\noindent
$\left( - \frac{2}{11}\zeta_{5} - \frac{1}{11}\zeta_{5}^{2} + \frac{4}{11}\zeta_{5}^{3} - \frac{4}{11}\zeta_{5}^{4}\right)\omega_2 + \left( - \frac{42}{121}\zeta_{5} + \frac{34}{121}\zeta_{5}^{2} - \frac{92}{121}\zeta_{5}^{3} + \frac{15}{121}\zeta_{5}^{4}\right)\omega_2^2 + \left(\frac{91}{605}\zeta_{5} + \frac{7}{605}\zeta_{5}^{2} + \frac{38}{605}\zeta_{5}^{3} + \frac{149}{605}\zeta_{5}^{4}\right)\omega_1\omega_2^2 + \left(\frac{175}{1331}\zeta_{5} + \frac{302}{1331}\zeta_{5}^{2} + \frac{706}{1331}\zeta_{5}^{3} + \frac{482}{1331}\zeta_{5}^{4}\right)\omega_2^3 + \left(\frac{255}{1331}\zeta_{5} + \frac{364}{1331}\zeta_{5}^{2} + \frac{40}{1331}\zeta_{5}^{3} + \frac{246}{1331}\zeta_{5}^{4}\right)\omega_1\omega_2^3 + \left( - \frac{11480}{14641}\zeta_{5} + \frac{420}{14641}\zeta_{5}^{2} + \frac{7725}{14641}\zeta_{5}^{3} - \frac{740}{14641}\zeta_{5}^{4}\right)\omega_2^4 + \left(\frac{786}{14641}\zeta_{5} + \frac{6399}{14641}\zeta_{5}^{2} + \frac{45}{14641}\zeta_{5}^{3} + \frac{1275}{14641}\zeta_{5}^{4}\right)\omega_1\omega_2^4$
\end{document}
It's difficult to say what was the original problem, there were many changes in both packages, which are now hosted on GitHub - the source code repositories are https://github.com/gap-packages/radiroot and https://github.com/gap-packages/alnuth.
I am trying to run the test of a project I cloned. I am new to Scala and Activator and I can not figure out what is happening
in the root folder I have the build.sbt
name := "xxxxx"
version := "2.0-SNAPSHOT"
scalaVersion := "2.11.5"
doc in Compile <<= target.map(_ / "none")
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
lazy val root = (project in file(".")).enablePlugins(PlayScala)
libraryDependencies ++= Seq(
jdbc,
anorm,
cache,
"org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
"json-module" %% "json-module" % "2.0.0",
)
instrumentSettings
ScoverageKeys.excludedPackages in ScoverageCompile := "<empty>;views*;views.*;views*html;Routes*;controllers*routes*;controllers*Reverse*;controllers*javascript*;controller*ref*"
ScoverageKeys.highlighting := true
This is an example file
class TestExampleSpec extends AbstractSpec {
"TestExample#get(:testId)" must {
val url = controllers.routes.TestExample.get(1, 1, 10).url
"return 400 without X-Client-Id header" in {
val fakeRequest = FakeRequest("GET", url).withTextBody("")
val result: Future[Result] = controllers.TestExample.get(1, 1, 10)(fakeRequest)
status(result) mustBe 400
contentType(result) mustBe Some("application/json")
val body = contentAsString(result)
val bodyJson = Json.parse(body)
(bodyJson \ "error").asOpt[Boolean] mustBe Some(true)
(bodyJson \ "message").asOpt[String] mustBe Some("Missing X-Client-Id header")
}
I tried this commands
$ activator reload
$ activator clean
$ activator test
But none of this worked I get this kind of messages
home/username/code/testing-project/test/TestExampleSpec.scala:10: value in is not a member of String
"return 400 without X-Client-Id header" in {
Thank you
I think the problem was related because the project was changed from play 2.2 to play 2.3.8
I added this dependency
"org.scalatestplus" %% "play" % "1.2.0" % "test"
Which seems did the trick.
I'm making some changes to resources in runtime to prepare application for different (physical) screen sizes:
var info = DisplayInformation.GetForCurrentView();
Size screenSize = new Size(Math.Round(Window.Current.Bounds.Width * info.RawPixelsPerViewPixel),
Math.Round(Window.Current.Bounds.Height * info.RawPixelsPerViewPixel));
Application.Current.Resources["SmallerText"] = (1.0 / 15.0) * screenSize.Height / info.RawDpiY * 72;
Application.Current.Resources["SmallText"] = (1.0 / 12.0) * screenSize.Height / info.RawDpiY * 72;
Application.Current.Resources["MediumText"] = (1.0 / 10.0) * screenSize.Height / info.RawDpiY * 72;
Application.Current.Resources["LargeText"] = (1.0 / 5.0) * screenSize.Height / info.RawDpiY * 72;
var displayMargin = (1.0 / 320.0) * screenSize.Height;
Application.Current.Resources["DisplayMargin"] = new Thickness(displayMargin);
Now when I try to use modified font sizes, it works:
<Style TargetType="Button" x:Key="BaseButton">
<Setter Property="FontSize" Value="{StaticResource SmallText}" />
But when I try to use modified Thickness, application crashes:
<Grid Grid.Row="0" Margin="{StaticResource DisplayMargin}">
Error message is quite enigmatic:
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in MyApp.exe but was not handled in user code
WinRT information: Failed to assign to property '%0'. [Line: 17 Position: 50]
Additional information: The text associated with this error code could not be found.
Failed to assign to property '%0'. [Line: 17 Position: 50]
If there is a handler for this exception, the program may be safely continued.
Why can't I use modified Thickness? If I don't modify it from the code behind, everything works correctly.
Edit: Workarounds
Workaround #1:
var displayMargin = (1.0 / 320.0) * screenSize.Height;
Application.Current.Resources.Remove("DisplayMargin");
Application.Current.Resources.Add("DisplayMargin", new Thickness(displayMargin));
Workaround #2:
<Grid Grid.Row="0" Margin="{ThemeResource DisplayMargin}">
This is my source code and I want to reduce the possible errors. When running this code there is a lot of difference between trained output to target. I have tried different ways but didn't work so please help me reducing it.
a=[31 9333 2000;31 9500 1500;31 9700 2300;31 9700 2320;31 9120 2230;31 9830 2420;31 9300 2900;31 9400 2500]'
g=[35000;23000;3443;2343;1244;9483;4638;4739]'
h=[31 9333 2000]'
inputs =(a);
targets =[g];
% Create a Fitting Network
hiddenLayerSize = 1;
net = fitnet(hiddenLayerSize);
% Choose Input and Output Pre/Post-Processing Functions
% For a list of all processing functions type: help nnprocess
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
% Setup Division of Data for Training, Validation, Testing
% For a list of all data division functions type: help nndivide
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% For help on training function 'trainlm' type: help trainlm
% For a list of all training functions type: help nntrain
net.trainFcn = 'trainlm'; % Levenberg-Marquardt
% Choose a Performance Function
% For a list of all performance functions type: help nnperformance
net.performFcn = 'mse'; % Mean squared error
% Choose Plot Functions
% For a list of all plot functions type: help nnplot
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression','plotconfusion' 'plotfit','plotroc'};
% Train the Network
[net,tr] = train(net,inputs,targets);
plottrainstate(tr)
% Test the Network
outputs = net(inputs)
errors = gsubtract(targets,outputs)
fprintf('errors = %4.3f\t',errors);
performance = perform(net,targets,outputs);
% Recalculate Training, Validation and Test Performance
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,outputs);
valPerformance = perform(net,valTargets,outputs);
testPerformance = perform(net,testTargets,outputs);
% View the Network
view(net);
sc=sim(net,h)
I think you need to be more specific.
What is the performance like on your training set and on your test set?
Have you tried doing any regularization?