element id containing $ character throws exception. How to escape it? - html

let my expression be --- #popovertagapplicator-container-m_mid-cAAAm-ZIq209hIFeJe1a7xI2uY-mP-pr$ivate
It gives the error:
Uncaught Error: Syntax error, unrecognized expression: #popovertagapplicator-container-m_mid-$cAAAm-ZIq209hIFeJe1a7xI2uY-mP-private.
Is there any way to escape $ sign?

This may help you
<h1>#popovertagapplicator-container-m_mid-cAAAm-ZIq209hIFeJe1a7xI2uY-mP-pr$ivate</h1>
<script> $('h1').text( $('h1').text().replace(/\$/g, '') ); </script>

when i try to : this.$el.find('#popovertagapplicator-container-m_mid-cAAAm-ZIq209hIFeJe1a7xI2uY-mP-pr$ivate')
it gives me : Uncaught Error: Syntax error, unrecognized expression when expression

Related

Deployment template parse failed: 'Unexpected character encountered while parsing value: <. Path '', line 0, position 0.'. (Code: InvalidTemplate)

While i am trying to deploy a azure template through azure portal i am getting validation error as `
{
"telemetryId": "8a5ab567-31cf-4eb4-832b-4f6ce5d98986",
"bladeInstanceId": "Blade_15b8aeb39a5249f788c6d40029a3b77b_6_0",
"galleryItemId": "MyGalleryItem",
"createBlade": "DeployToAzure",
"code": "InvalidTemplate",
"message": "Deployment template parse failed: 'Unexpected character encountered while parsing value: <. Path '', line 0, position 0.'."
}
How to debug the error.
Please help in this regard.
Thank you.

Angular - unexpected token error when colon in time string

Here is my error:
Error: [$parse:syntax] Syntax Error: Token ':' is an unexpected token at column 3 of the expression [06:20] starting at [:20].
The output is a JSON time string, eg: "5:30"
My HTML:
<input value="{{details.order.earlyPickup}}" ng-model="details.order.earlyPickup">
I can't figure out how to fix this so I don't get the error, can anyone help?

Trouble groking cython memoryviews ... how do I implement here?

Two functions: one which creates a 32-million integer array and another which uses it for a lookup millions of times.
from cpython cimport array as c_array
from array import array
def get_lut(file_location):
cdef c_array.array lut
with open(file_location, "rb") as f:
lut = array("I", f.read())
return lut
def use_lut(int[:] lut):
// Do a whole bunch of lookups.
Compiling with the following command:
c:\Users\Michael\Documents\Poker>set DISTUTILS_USE_SDK=1
c:\Users\Michael\Documents\Poker>python setup.py build_ext -i --compiler=msvc
Produces the following output:
Compiling handeval.pyx because it changed.
Cythonizing handeval.pyx
warning: View.MemoryView:288:5: Cannot profile nogil function.
warning: View.MemoryView:763:5: Cannot profile nogil function.
warning: View.MemoryView:899:5: Cannot profile nogil function.
warning: View.MemoryView:1063:5: Cannot profile nogil function.
warning: View.MemoryView:1070:5: Cannot profile nogil function.
warning: View.MemoryView:1124:5: Cannot profile nogil function.
warning: View.MemoryView:1131:5: Cannot profile nogil function.
warning: View.MemoryView:1142:5: Cannot profile nogil function.
warning: View.MemoryView:1163:5: Cannot profile nogil function.
warning: View.MemoryView:1223:5: Cannot profile nogil function.
warning: View.MemoryView:1295:5: Cannot profile nogil function.
warning: View.MemoryView:1317:5: Cannot profile nogil function.
warning: View.MemoryView:1352:5: Cannot profile nogil function.
warning: View.MemoryView:1362:5: Cannot profile nogil function.
running build_ext
building 'handeval' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\cl.exe /c /nolo
go /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\Michael\Anaconda3\include -IC:\Users\Mic
hael\Anaconda3\include /Tchandeval.c /Fobuild\temp.win-amd64-3.4\Release\handeva
l.obj
handeval.c
handeval.c(2391) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'long',
possible loss of data
handeval.c(2420) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int',
possible loss of data
handeval.c(2449) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int',
possible loss of data
handeval.c(2478) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int',
possible loss of data
handeval.c(2507) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int',
possible loss of data
handeval.c(2536) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int',
possible loss of data
handeval.c(2565) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int',
possible loss of data
handeval.c(12955) : error C2275: 'PyGILState_STATE' : illegal use of this type a
s an expression
C:\Users\Michael\Anaconda3\include\pystate.h(191) : see declaration of '
PyGILState_STATE'
handeval.c(12955) : error C2146: syntax error : missing ';' before identifier '_
_pyx_gilstate_save'
handeval.c(12955) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13026) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13052) : error C2275: 'PyGILState_STATE' : illegal use of this type a
s an expression
C:\Users\Michael\Anaconda3\include\pystate.h(191) : see declaration of '
PyGILState_STATE'
handeval.c(13052) : error C2146: syntax error : missing ';' before identifier '_
_pyx_gilstate_save'
handeval.c(13052) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13125) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13152) : error C2275: 'PyGILState_STATE' : illegal use of this type a
s an expression
C:\Users\Michael\Anaconda3\include\pystate.h(191) : see declaration of '
PyGILState_STATE'
handeval.c(13152) : error C2146: syntax error : missing ';' before identifier '_
_pyx_gilstate_save'
handeval.c(13152) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13242) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13909) : error C2275: 'PyGILState_STATE' : illegal use of this type a
s an expression
C:\Users\Michael\Anaconda3\include\pystate.h(191) : see declaration of '
PyGILState_STATE'
handeval.c(13909) : error C2146: syntax error : missing ';' before identifier '_
_pyx_gilstate_save'
handeval.c(13909) : error C2065: '__pyx_gilstate_save' : undeclared identifier
handeval.c(13935) : error C2065: '__pyx_gilstate_save' : undeclared identifier
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\
amd64\\cl.exe' failed with exit status 2
Whereas removing the int[:] type declaration from the use_lut signature compiles fine.
What am I doing wrong here?

routing in html5 backbone-marionette app with pushState: true is failing if more than one component to url

I have an backbone-marionette app routing issue driving me nuts. I setup Marionette.AppRouter to for each module I have. The routing works fine as long as there is only one component to the url. The moment we had a second "directory" or even an :id, I get syntax errors in the browser for every file included in the index.html.. including the index.html itself.
for example
myapp/articles works fine. myapp/articles/78 gives me the issues. I even tested just creating two appRoutes in the router... "article" and "article/something". I can go to http://myapp or http://myapp/article but http://myapp.article/something gives the syntax and never processes anything.
My article_app.js below shows trying to get article/:id to work.. but that fails everytime with the error posted below all this
azBest.module("ArticleApp",function(ArticleApp, azBest, Backbone, Marionette, $, _) {
ArticleApp.Router = Marionette.AppRouter.extend({
appRoutes: {
"article": "returnToResultsPage",
"article/:id": "test"
},
});
var API = {
test: function(id) {
console.log("testing...id:" + id);
azBest.trigger("storefront:show");
},
returnToResultsPage: function() {
azBest.trigger("storefront:show");
}
};
azBest.on("article:show", function(model) {
Backbone.history.navigate("article/"+model.get("articleid"));
azBest.ArticleApp.Show.Controller.showArticle(model);
});
azBest.addInitializer(function(){
new ArticleApp.Router({
controller: API
});
});
});
Captured from firefox's console.
SyntaxError: syntax error
78 (line 276)
SyntaxError: syntax error
json2.js (line 1)
SyntaxError: syntax error
unders....min.js (line 1)
SyntaxError: syntax error
backbo....min.js (line 1)
SyntaxError: syntax error
marion....min.js (line 1)
SyntaxError: syntax error
spin.min.js (line 1)
SyntaxError: syntax error
spin.jquery.js (line 1)
SyntaxError: syntax error
jquery...-min.js (line 1)
SyntaxError: syntax error
app.js (line 1)
SyntaxError: syntax error
storefront_app.js (line 1)
SyntaxError: syntax error
results_app.js (line 1)
SyntaxError: syntax error
article_app.js (line 1)
SyntaxError: syntax error
views.js (line 1)
SyntaxError: syntax error
featuredItems.js (line 1)
SyntaxError: syntax error
popularItems.js (line 1)
SyntaxError: syntax error
ads.js (line 1)
SyntaxError: syntax error
articles.js (line 1)
SyntaxError: syntax error
list_view.js (line 1)
SyntaxError: syntax error
list_c...ller.js (line 1)
SyntaxError: syntax error
show_view.js (line 1)
SyntaxError: syntax error
show_c...ller.js (line 1)
SyntaxError: syntax error
show_view.js (line 1)
SyntaxError: syntax error
show_c...ller.js (line 1)
SyntaxError: syntax error
show_view.js (line 1)
SyntaxError: syntax error
show_c...ller.js (line 1)
SyntaxError: syntax error
show_view.js (line 1)
SyntaxError: syntax error
show_c...ller.js (line 1)
SyntaxError: syntax error
list_view.js (line 1)
SyntaxError: syntax error
list_c...ller.js (line 1)
SyntaxError: syntax error
show_view.js (line 1)
SyntaxError: syntax error
show_c...ller.js (line 1)
ReferenceError: azBest is not defined
azBest.start();
78 (line 276)
I am at a loss as to what is causing the syntax errors. Each error except the first and last seems to be pointing at <!DOCTYPE html>
I figured out the issue...
When the apache rewrite does its thing, it changes the base so none of my included scripts are found correctly.
To fix this, I changed my htdocs to:
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L,QSA]
I also changed the included scripts to be relative and added to the head of the index.html.

Error in building itk with GDCM git repository

I build ITK with gdcm official release for windows. But its not having some of file that I'm using in further coding. So I have to use git version of gdcm cause its having those which I needed but following error encountered when I am trying to build ITK with ITK_USE_SYSTEM_GDCM and using gdcm git version to build gdcm bin.
>------ Build started: Project: ITKIOGDCM, Configuration: Debug Win32 ------
80>Compiling...
80>itkGDCMImageIO.cxx
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMImageIO.cxx(41) : fatal error C1083: Cannot open include file: 'gdcmImageHelper.h': No such file or directory
80>itkGDCMSeriesFileNames.cxx
80>D:\ITK\src\Modules\IO\GDCM\include\itkGDCMSeriesFileNames.h(154) : error C2664: 'void gdcm::SerieHelper::AddRestriction(const gdcm::TagKey &)' : cannot convert parameter 1 from 'const std::string' to 'const gdcm::TagKey &'
80> Reason: cannot convert from 'const std::string' to 'const gdcm::TagKey'
80> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(29) : error C2248: 'gdcm::SerieHelper::SerieHelper' : cannot access protected member declared in class 'gdcm::SerieHelper'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(198) : see declaration of 'gdcm::SerieHelper::SerieHelper'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(64) : see declaration of 'gdcm::SerieHelper'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(160) : error C2027: use of undefined type 'gdcm::File'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(34) : see declaration of 'gdcm::File'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(160) : error C2227: left of '->IsReadable' must point to class/struct/union/generic type
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(163) : error C2027: use of undefined type 'gdcm::File'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(34) : see declaration of 'gdcm::File'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(163) : error C2227: left of '->GetFileName' must point to class/struct/union/generic type
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(166) : error C2027: use of undefined type 'gdcm::File'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(34) : see declaration of 'gdcm::File'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(166) : error C2227: left of '->GetFileName' must point to class/struct/union/generic type
80>itkGDCMImageIOFactory.cxx
80>Generating Code...
80>Build log was saved at "file://d:\ITK\binGDCM\Modules\IO\GDCM\src\ITKIOGDCM.dir\Debug\BuildLog.htm"
80>ITKIOGDCM - 9 error(s), 0 warning(s)
Please help.
You are mixing the very old and deprecated GDCM 1.x with GDCM 2.x. They are actually API incompatible.