Posts

Featured post

javascript - Using conditionals inside template literals -

i know more elegant way define string variables included, if want add conditional in pre es6 do.. var = "text"+(conditional?a:b)+" more text" now template literals do.. let a; if(conditional) = `test${a} more text`; else = `test${b} more text`; is there more elegant way implement conditional? possible include if shortcut? use this: let = `test${conditional ? : b} more text`;

c# - Why is the FilterConfig class not static? -

when create new asp.net mvc project defaults, filterconfig class ( , others ) this; namespace nop.web { public class filterconfig { public static void registerglobalfilters(globalfiltercollection filters) { filters.add(new handleerrorattribute()); } } } and it's usage ( under globalasax > application_start ) protected void application_start() { //... filterconfig.registerglobalfilters(globalfilters.filters); //... so why filterconfig class not static ? should this; public static class filterconfig { public static void registerglobalfilters(globalfiltercollection filters) { filters.add(new handleerrorattribute()); } } because there 1 static method in it, filterconfig should static too. missing something?

ssl - Unable to attach files in Odoo when using HTTPS via nginx -

been having issue , narrowed down, can't find solution. if setup nginx redirect https, works great, ssl connection , all, except when writing messages in odoo, our staff can't attach files. gets stuck on "uploading" (blue bar on file icon). there's no useful output in log, on verbose debug level. as workaround, i've disabled ssl, i'd turn on. suggestions? running odoo v9.0c.

mongodb - Mongo $text search not working on nested object? -

this code var mongoose = require('mongoose'); var schema = mongoose.schema; mongoose.connect('mongodb://localhost/mongo_search_problem'); var test = new schema({ text: { type: string, required: true }, level: { two: { type: string, required: true } } }); test.index({ text: 'text', 'level.two': 'text' }); var model = mongoose.model('tests', test); model.find({ $text: { $search: 'two' } }, function(err, result){ console.log(result); }); this document { "text" : "text", "level" : { "two" : "two" } } it return nothing if search two , if search text instead return document. why won't work on nested object?

css - Language-specific LESS classes which contain @font-faces not working -

i have bilingual site using i18n. i18n attaches classes , tags of site when renders. example, have: <html class="en"> <body class="i18n-en"> </body> </html> and when user switches languages, following renders: <html class="ar> <body class="i18n-ar"> </body> </html> i've created less file programmatically loads different font replace english default font when arabic version of site loads, follows: body.i18n-en { @font-face { font-family: 'dinalternatebold'; src: url('../fonts/din-alternate-bold.ttf') format('truetype'); } } body.i18n-ar { @font-face { font-family: 'dinalternatebold'; src: url('../fonts/harmattan-regular.woff') format('woff'); } } note calling "harmattan-regular.woff" same variable name "din-alternate-bold.ttf", replacement of instance of dinal

c++ - How to compile a C++03 project that uses a C++11 library API? -

i required use shared library , api compiled using c++11. uses c++11 features std::mutex , std::shared_ptr in api. have no control on library a. however, being required compile code using c++03 uses library a's api. i pretty sure cannot done because compiler errors stating uses of std::mutex , std::shared_ptr , , others in api not found. (my understand is, if library didn't use c++11 specific types should able this.) but want make sure there isn't not understanding need in order compile code against c++11 library a. so question is, can compile code using c++03 against shared library , api uses c++11? an api exposes at edges c++11-specific features won't usable c++03. 1 way work around build c++11 wrapper library converts c++11-specific inputs , outputs c++03-compatible types. example if original c++11 library returns std::shared_ptr api, wrapper library return boost::shared_ptr or raw pointer instead. "pimpl" idiom might helpful wh

jquery - Kendo UI chart select feature gets reset -

select on kendo ui chart made user lost when browser (mobile device/computer) resized. can retain selection when browser resized? to reproduce, please save below code html on system, open on browser, make selection on chart , resize browser. selection made lost. <html> <head> <meta charset="utf-8"> <title>retain kendo chart selection</title> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.common.min.css"> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.rtl.min.css"> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.default.min.css"> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.mobile.all.min.css"> <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script