Posts

Showing posts from 2015

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

Bootstrap 4 Carousel not working -

building page carousel slider. bootsrap 4 carousel not working: <div id="carouselexampleindicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselexampleindicators" data-slide-to="0" class="active"></li> <li data-target="#carouselexampleindicators" data-slide-to="1"></li> <li data-target="#carouselexampleindicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <div class="carousel-item active"> <img class="d-block img-fluid" src="/wp-content/themes/tarps/assets/img/aaatarps-banner.png" alt="first slide"> </div> <div class="carousel-item"> <img class="d-block img-fluid" src="

html - Chrome rendering hidden labels -

i've created tab system using css working intended, except in chrome 1 label gets randomly hidden. i've created small example represent issue: http://jsbin.com/xexupiciru/edit?html,css,output this excerpt of relevant code represents single tab: <div> <input name="tagmanage-tabbed" id="tagmanage-tabbed2" type="radio"> <section> <h1> <label for="tagmanage-tabbed2">{{ tabtitle }}</label> </h1> <div> <p>some content</p> </div> </section> </div> in safari , firefox works intended, in chrome, when label clicked, label gets hidden reason , can't figure out why. the reason why getting hidden in google chrome when click on element makes ever larger causing overflow imperceptible you. google chrome looks @ following rule , hides it: .tagmanage-tabbed > div > section > h1 { overflow: hidden; } w

r - Dplyr difference between select and group_by with respect to quoted variables? -

in current version of dplyr, select arguments can passed value: variable <- "species" iris %>% select(variable) # species #1 setosa #2 setosa #3 setosa #4 setosa #5 setosa #6 setosa #... but group_by arguments cannot passed value: iris %>% group_by(variable) %>% summarise(petal.length = mean(petal.length)) # error in grouped_df_impl(data, unname(vars), drop) : # column `variable` unknown the documented dplyr::select behaviour iris %>% select(species) and documented documented dplyr::group_by behaviour iris %>% group_by(species) %>% summarise(petal.length = mean(petal.length)) why select , group_by different respect passing arguments value? why first select call working , continue work in future? why first group_by call not working? i'm trying figure out combination of quo() , enquo() , !! should use make work. i need because create function takes

User inserting Alphabet into array and controlling if there are repetitions and order of input Java -

i need create array of 26 , insert in alphabet letters, have control if there repetitions , order of input eg: a,b,c or z,y,x . my code: import java.util.scanner; public class esercizio4 { scanner sc = new scanner(system.in); private int ripetions; public esercizio4(){ char alfa[] = new char[26]; (int i=0;i<=26;i++){ system.out.println("insert letter"); alfa[i]=sc.next().charat(0); } } } i googled how make control of input being correct (accepting letters) couldn't find or hard understand. second part might easier still how control if there repetitions , if order increasing/decreasing ( a,b,c / z,x,y ). to know if char letter have compare numerical representation of char. have @ table i.e.: the letter a = 97 while a = 65 . what tells char can range between value of 97 - 122 lowercase letters , 65 - 90 capital letters. then question of looping trough array , comparing v

php - mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 to be resource or mysqli_result, boolean given -

i trying select data mysql table, 1 of following error messages: mysql_fetch_array() expects parameter 1 resource, boolean given or mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given this code: $username = $_post['username']; $password = $_post['password']; $result = mysql_query('select * users username $username'); while($row = mysql_fetch_array($result)) { echo $row['firstname']; } the same applies code $result = mysqli_query($mysqli, 'slect ...'); // mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given while( $row=mysqli_fetch_array($result) ) { ... and $result = $mysqli->query($mysqli, 'selct ...'); // call member function fetch_assoc() on non-object while( $row=$result->fetch_assoc($result) ) { ... and $result = $pdo->query('slect ...', pdo::fetch_assoc); // invalid argument supplied foreach() foreach( $result $row ) { ... and

python - Substract epoch time from datatime.datatime.now -

Image
this question has answer here: convert python datetime epoch strftime 5 answers i asked value of key json on particular website , subtract value .now (it's expiration date). i'm doing using requests.get json.load . problem is: value i'm getting epoch time , datetime.datetime.now not. what's easiest way ( datetime.datetime.now - key(epoch value) )? see values in screenshot below. i've tried converting epoch "human date" subtraction nope. edit : may not duplicate because asks processing timestamp , wants number of seconds between timestamp , now. you did easiest. when timestamp involved think of arrow library. >>> time_string = '2017-08-14 11:52:09.145000' >>> import arrow >>> time_diff = arrow.now()-arrow.get(time_string) >>> time_diff.total_seconds() 17604.346025

node.js - ionic build error reflect metadata -

i've transferred ionic application mac computer windows computer. ionic installation , ran fine, moment try run 'ionic serve' or 'ionic build' error saying "error: cannot find module 'reflect-metadata' does know of fix this? i have read forums mention adding line "reflect-metadata": "^0.1.3", and have done no luck. please help!

Python delete certain lines from file -

i have csv file looks following: ccc, rev, pindex, no. 23, 2.5, 0, 4 34, 4.3, 1, 3 27, 7.9, 2, 5 12, 5.7, 3, 7 where third element in each line called pindex . have code replicates each line once, while updating pindex accordingly. output looks following: ccc, rev, pindex, no. 23, 2.5, 0, 4 23, 2.5, 1, 4 34, 4.3, 2, 3 34, 4.3, 3, 3 27, 7.9, 4, 5 27, 7.9, 5, 5 12, 5.7, 6, 7 12, 5.7, 7, 7 below code that: with fileinput.input(inplace=true) f: n = 0 line in f: line = line.rstrip('\n') numbers = line.split(sep = ',') in range(2): numbers[3] = n n += 1 s = '' j in numbers: s += str(j) + ',' s = s.rstrip(',') print(s) now want delete 1 duplication each of first , last line, delete first line (after header, pindex 0) , last line in file. using fileinput , trying write result in same file. tried result = [] result.a

web services - Front-end web development -

i'll cut chase!! i have created portfolio page , looking attach of other websites i've created it, brings me dilema. want use 1 domain of projects , store on rented server space. each website has it's own folder , it's own index.html page. can leave each project it's own index.html , link them main website? or there better way? i appreciate bit of advice/criticism thanks

keytool - Error with signing keys for phonegap build -

Image
i trying create singed key phonegap build can deploy app google play store! error occurs every time try.

javascript - How to make a style change when a property is "true" -

i'm using material-ui, react class app extends component { constructor() { super(); this.state = { draweropened: true }; }; render () { return( <div> <drawer open={this.state.draweropened}> <div style={{paddingleft: '256px'}}> </div> </div> i want padding-left when drawer open (true), how remove padding when closing drawer? <div style={{paddingleft: this.state.draweropened ? '256px' : 'initial'}}>

cursor - In MySQL, i am not being able to execute commands after a loop -

i using cursor , loop execute stored procedure on each item of table. need done once day. procedure works , executes daily procedure on each row of table. part works fine. but, when try adding logging @ end (updating of table rollupcontrol time execution took) command doesn't executed @ all... added 2 debugging selects, 1 inside loop , other outside. 1 inside gets executed 1 outside doesn't... drop procedure if exists `runx`; delimiter $$ create procedure `runx`() runx:begin -- roda rup366 uma vez para cada dispositivo declare t0 datetime(2) default now(2); declare t0i float default 0; declare debug int default 1; declare viddisp varchar(6); declare done boolean default false; declare _id bigint unsigned; declare cur cursor (select id tablem m join tabler r on m.id = r.id time_to_sec(timediff(lastupdatedtime,lastqueryedtime))/(60*60*24) > 1); declare continue handler not found set done := true; open cur; runxloop: loop fetch

swift - Show short videos from iOS library -

is possible show short videos ios photo library ? i want user able show , import videos less 10 seconds library. edit: i'm using uiimagepickercontroller retrieve videos photo library using native uiimagepicker don't think possible. however can show videos using uiimagepicker, , if user choose long video, push notification him first 10 seconds taken. better if show him video , let him pick 10 seconds it. hope helps!

python - Displaying specific posts using django -

i have post application in django different staff members can create post. want able display each posters post when log in , not include others post. model class post(models.model): """docstring post.""" user = models.foreignkey(settings.auth_user_model, default=1) #blank=true, null=true)#default=1 title = models.charfield(max_length = 120) slug = models.slugfield(unique= true) draft = models.booleanfield(default = false) publish = models.datefield(auto_now=false, auto_now_add=false) content = models.textfield() updated = models.datetimefield(auto_now=true, auto_now_add=false) timestamp = models.datetimefield(auto_now=false, auto_now_add=true) #objects = postmanager() def __str__(self): return self.title view def index(request): results = post.objects.all().filter(draft=false)#.filter(publish__lte=timezone.now()) que = request.get.get("q") if que: results =resul

Facebook sharing preview image / description -

i have been having ongoing issue site work on. site in question is: http://guysboroughjournal.com/ the issue main article image (and description) not automatically picked facebook when sharing website. have following meta og tags in site: <meta property="og:locale" content="en_us" /> <meta property="og:type" content="website" /> <meta property="og:title" content="the guysborough journal" /> <meta property="og:image" content="http://www.guysboroughjournal.com/_uploads/image/142957_2017-08-09.jpg" /> <meta property="og:description" content="<p><strong>ahoy:</strong> mist of avalon made big impression on sailors , landlubbers alike when tied @ guysborough marina on wednesday, august 2. two-masted schooner part of tall ships rdv 2017 event continuing throughout maritimes summer.</p> " /> <meta property="og:url" co

javascript - Chrome Refresh "resubmit form data" Submits Null -

as stated, in vs2017 asp.net mvc application submits null value when refreshing , "resubmitting" (for built in search) in chrome only. other browsers work normally. google search has yielded nothing useful. i'm not sure begin. additionally, might related - i've @ same time had disable chrome javascript debugging in visual studio settings vs freeze js debugging enabled. this issue applies version 60.0.3112.101 (official build) (64-bit) google seems know issue, have bug ticket opened @ https://bugs.chromium.org/p/chromium/issues/detail?id=747812 . doesn't right now, know it's not issue our code!

bokeh - Dask Distributed Webpage Address from ipython -

when start client in jupyter-notebook, can address bokeh webpage (dashboard) here. from dask.distributed import client client=client() client screenshot of client info i wondering way can info in ipython console? tried print(client . didn't info. thanks.

oracle - SERVEROUTPUT shows results one after another execution -

when execute following trigger code compiled. after inserting data, serveroutput says '1 row inserted' trigger result ('user example has insrted data') didn't displayed. then after execution of pl/sql previous trigger result appears on display. should solve issue? here trigger , insertion command , results, / set serveroutput on; create or replace trigger btr_superheros before insert on superheros each row enable declare v_user varchar2(30); begin select user v_user dual; dbms_output.enable(); dbms_output.put_line('user:' ||v_user||' has inserted data'); end; / result - trigger btr_superheros compiled insert superheros values('superman'); result - 1 row inserted. (didn't shows dbms_output) you need set serveroutput on in client application (sql*plus, sql developer etc) in session run statement, otherwise won't know want fetch , display output buffer when statement completes. set server out

visual studio code - How to enable the bold font in terminal that's intergrated in VSCode? -

i'm struggling on how enable bold text in integrated terminal pre-installed in visual studio code . so far i've tried enabling in settings.json using these parameters: "terminal.integrated.enablebold": true , had no luck. any idea on how accomplish this? or if there more customizable terminal happen know of, i'll glad try out. i'm using vscode_x64 v1.15.1, , somehow enabled bold font default as tried switching between bold or not, works fine

angular - BehaviorSubject undefined in constructor -

i have problem behaviorsubjects. i have service : import{ injectable } '@angular/core'; import { behaviorsubject } 'rxjs/behaviorsubject'; @injectable() export class boutonimprimergriseservice { boutonimprimergrise = new behaviorsubject<boolean>(true); boutonimprimergrisechanged$ = this.boutonimprimergrise.asobservable(); boutonmettreazerogrise = new behaviorsubject<boolean>(true); boutonmettreazerogrisechanged$ = this.boutonmettreazerogrise.asobservable(); } and use in component : export class gestioncompteurscomponent { boutonimprimergrise: boolean; boutonmettreazerogrise: boolean; private _boutonimprimergrisesubscription: subscription; private _boutonmettreazerosubscription: subscription; constructor(private _boutonimprimergriseservice: boutonimprimergriseservice) { this._boutonimprimergrisesubscription = this._boutonimprimergriseservice.boutonimprimergrisechanged$.subscribe( value => { console

delphi - Local variable broken by closure capture when accessed in nested method -

i've managed reduce problem : program project1; {$apptype console} uses sysutils, threading; procedure foo(astring: string); var ltask : itask; capturedstring : string; procedure nested; begin try writeln('nested : ' + capturedstring); { ! eintoverflow (win32) here } except on e : exception writeln(e.message); end; end; begin capturedstring := astring; writeln('local : ' + capturedstring); nested; ltask := ttask.create( procedure procedure anonnested; begin writeln(capturedstring); { removing eliminates problem } end; begin end); end; begin foo('foo'); readln; end. here capturedstring variable gets corrupted when accessed within nested method. win32 compile raises eintoverflow , win64 compile writes out (corrupt) empty string - either build can provoked av or other exceptions manipulation in cases reference local variable corrupted when entering nested proc

node.js - npm nodejs project with typescript; live build doesn't recompile changed modules -

i found description init nodejs project in typescript here: https://basarat.gitbooks.io/typescript/docs/quick/nodejs.html this describes way autorecompile onchange, if run code using npm start. i created project configuration: tsconfig.json: { "compileroptions": { /* basic options */ "target": "es2015", /* specify ecmascript target version: 'es3' (default), 'es5', 'es2015', 'es2016', 'es2017', or 'esnext'. */ "module": "commonjs", /* specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'esnext'. */ "outdir": "./build", /* redirect output structure directory. */ /* strict type-checking options */ "strict": true /* enable strict type-checking options. */

Latest version of ruamel.yaml fails to parse simple flow mapping -

posting here instead of bitbucket because i'm unsure whether or not user error. simple broke after upgrading latest version: >>> ruamel import yaml >>> test_str = '{"in":{},"out":{}}' >>> yaml.safe_load(test_str) ruamel.yaml.parser.parsererror: while parsing flow mapping in "<byte string>", line 1, column 1: {"in":{},"out":{}} ^ (line: 1) expected ',' or '}', got '<scalar>' in "<byte string>", line 1, column 6: {"in":{},"out":{}} ^ (line: 1) putting spaces after "in" , "out" resolves issue. this bug in ruamel.yaml<0.15.30. the token scanner had been changed few micro versions earlier, in order allow :: , ? to occur in plain scalars (as required 1.2 specification, see example 7.10), , changes affected this, "compact json", syntax. one workaround,

java - Android (ART) crash with error JNI DETECTED ERROR IN APPLICATION: jstring is an invalid local reference -

i writing android application processes picture(raw format) native c (ndk r15b). im getting following errors: 08-14 18:08:25.407 6107-6107/compresor.app.tfg.compresor e/art: 0xa3f20b80 spacetypemallocspace begin=0x12c00000,end=0x12e17000,limit=0x2ac00000,size=2mb,capacity=384mb,non_growth_limit_capacity=384mb,name="main rosalloc space"] 08-14 18:08:25.407 6107-6107/compresor.app.tfg.compresor e/art: 0xa3f1fa80 allocspace main rosalloc space live-bitmap 3[begin=0x12c00000,end=0x2ac00000] 08-14 18:08:25.407 6107-6107/compresor.app.tfg.compresor e/art: 0xa3f1fac0 allocspace main rosalloc space mark-bitmap 3[begin=0x12c00000,end=0x2ac00000] 08-14 18:08:25.407 6107-6107/compresor.app.tfg.compresor e/art: 0xaf99b780 spacetypeimagespace begin=0x6fbf5000,end=0x6fcf9288,size=1040kb,name="/data/dalvik-cache/x86/system@framework@boot.art"] 08-14 18:08:25.407 6107-6107/compresor.app.tfg.compresor e/art: 0xaf92f1e0 imagespace /data/dalvik-cache/x86/system@framework

Get long running google cloud speech api operation result later -

i using ruby api google cloud speech api. following code returns operation object. project_id = "xxx" speech = google::cloud::speech.new project: project_id file_name = "test.flac" audio = speech.audio file_name, encoding: :flac, sample_rate: 44100,language: "en-us" operation = audio.process words: true with operation.wait_until_done! poll operation till finished. audio files 30 minutes long. block processes long time. is possible result of operation later? know can call operation.id unique identifier operation. possible use 1 later results of operation? ran same problem. basically, can access operation via standard restapi call. seems strange way of doing it, works. ugly solution here

wordpress - below, where are wrong in my code? -

<?php while ( have_posts() ) : the_post(); ?> <?php $qa_entries = get_post_meta( get_the_id(), 'demjo', true ); $i = 1; //sets variable-counter ?> <ul class="questions"> <?php foreach ( $qa_entries $value) { ?> <li><a href="#q-<?php echo $i++;?>"><?php echo esc_html( $value['titleh'] ) ?></a></li> <?php } ?> </ul> <!--/.questions--> <?php $i = 1; //resets counter foreach ( $qa_entries $value) { ?> <h4 id="q-<?php echo $i++;?>"><?php echo esc_html( $value['question'] ) ?></h4> <p><?php echo esc_html( $value['answer'] ) ?></p> <?php } ?> warning: illegal string offset 'titlehf' in c:\xampp\htdocs\admin\wp-content\themes\corporate\single.php on line 35

sql server - get the employee 'in/out' status based on 'enter/exit' column -

in sql server, how can employee 'in/out' status based on 'enter/exit' column? example, if last record employee 'enter', 'in'. if last record 'exit', 'out'. id=111, in_out should 'in', , id=222 should 'out' +-----+---------------------+------------+ | id | timestamp | status | +-----+---------------------+------------+ | 111 | 01/01/2017 07:00:10 | enter | | 222 | 01/01/2017 01:10:29 | enter | | 111 | 01/01/2017 18:20:17 | exit | | 111 | 01/02/2017 08:20:34 | enter | | 333 | 01/02/2017 06:20:11 | enter | | 222 | 01/02/2017 10:10:47 | exit | +-----+---------------------+------------+ i understand should use case statement, following code won't work select id, case when status = 'enter' 'in' when status = 'exit' 'out' else 'n/a' end in_out table1 if understand correctly can qu

Xcode memory leak detection for c++ command line app -

Image
i'm trying use leaks instrument detect memory leaks in linked list implemented. here code - #ifndef linkedlist_h #define linkedlist_h #include <initializer_list> #include <iostream> #include <stdexcept> using std::runtime_error; using std::initializer_list; using std::ostream; template <typename t> class linkedlist { template <typename u> friend ostream& operator<<(ostream &, const linkedlist<u> &); public: typedef t value_type; typedef int size_type; private: struct node { t value; node *next; node *prev; }; node *head; node *tail; size_type n_elems; public: linkedlist(); linkedlist(std::initializer_list<t> il); ~linkedlist(); size_type size() const; bool empty() const; void push_front(const t&); void push_back(const t&); void pop_back(); void pop_front(); t& front() const; t& back(

Google Maps Embedded API - Won't work without WWW in URL -

this question exact duplicate of: google maps api referernotallowederror 1 answer i trying use google maps embedded api. have used years on page post every often. year wasn't working obtained new key , updated html on webpage. works if put "www" in front of page's url not if use domain name only. same page, adding www allows work. unfortunately, many of our users , documents refer our website without www. i figured might google api key restriction "referrer". use hosted service, using "http referrers (web sites)". have tried both restriction turn off (and waiting 10 minutes) , of following in http referrers list (our domain though , again waiting 10 minutes): *.example.com/* *example.com* *example.com/* in both cases, works www.example.com/page.html , not example.com/page.html any ideas? if want redir

php - AND OR query in elastic search -

i need dynamically make elastic search query based on and, or query. user inputs string similar sql format: ((("query1 query2" or query3) or query4) , (query5 or query6)) , query7 i parse array: [ 'and' => [ [ 'and' => [ [ 'or' => [ [ 'or' => [ '" query1 query 2"', 'query3' ] ], 'query4' ] ], [ 'or' => [ 'query5', 'query6' ] ] ] ], 'query7' ] ] and based on array need make search 1 field. something like: {"bo

regex - Why does this regular expression test give different results for what should be the same body text? -

here's pertinent code, giving different results on regular expression test message body depending on whether launch using testlaunchurl or message passed outlook when incoming message arrives: public sub openlinksmessage(olmail outlook.mailitem) dim reg1 regexp dim allmatches matchcollection dim m match dim strurl string dim retcode long set reg1 = new regexp reg1 .pattern = "(https?[:]//([0-9a-z=\?:/\.&-^!#$;_])*)" .global = true .ignorecase = true end playthesound "speech on.wav" retcode = reg1.test(olmail.body) msgbox "the retcode reg1.test(olmail.body) equals" + str(retcode) ' if regular expression test urls in message body finds 1 or more if retcode playthesound "chimes.wav" ' use regex return instances match allmatches group set allmatches = reg1.execute(olmail.body) each m in allmatches strurl = m.submatches(0) ' don't activate urls unsubscribi

asp.net mvc - Display a checkbox using Razor -

i have declared bool property so; public bool applyingmyself { get; set; } i have following mark-up checkbox @html.label("i young person applying myself") @html.checkboxfor(m => m.applyingmyself) but receiving error model' not contain definition 'applyingmyself' , no extension method 'applyingmyself' accepting first argument of type 'model' found (are missing using directive or assembly reference?) any appreciated... some additional context may required answer question following may address issue. ensure you've declared model you're implementing in view: //at top of view: @model modelname // code checkbox in view @html.label("i young person applying myself") @html.checkboxfor(m => m.applyingmyself) if case , have model declared in view, possible you've updated model applyingmyself property , visual studio "unaware" of change. try rebuilding project (in vs 2017 can s

swift - Extracting values from a reversed linked list -

question: you have 2 numbers represented linked list, each node contains single digit. digits stored in reverse order, such 1 's digit @ head of list. write function adds 2 numbers , returns sum linked list. an example: input: (7-> 1 -> 6) + (5 -> 9 -> 2). that is: 617 + 295. output: 2 -> 1 -> 9. that is: 912. in order begin question, first created class define linked list: step 1: defining linked list class node: customstringconvertible{ var value: int var next: node? var description: string{ if next != nil { return "\(value) -> \(next!)" } else{ return "\(value) -> \(next)" } } init(value: int) { self.value = value } } step: 2 - generated linked list, user input of integer values func generatelist (num: int) -> node { var stringnum = array(string(num).characters) let head = node.init(value:int(st

html - carousel for bootstrap4 slides did not next and prev When I click it -

hi every 1 me please regarding project i'm getting frustrating of error not next when try click next in edge browser carousel not work button you can view information carousel have choosen here's link http://v4-alpha.getbootstrap.com/components/carousel/#carouselprev <section id ="carousel"> <div id="carousel-home" class="carousel slide"data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carousel-home" data-slide-to="0" class="active"></li> <li data-target="#carousel-home" data-slide-to="1"></li> <li data-target="#carousel-home" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="carousel-item active"> <img class="d-block img-f

javascript - What are the js files needed to use the materialize select? -

i calling these files: './public/js/vendor/jquery.easing.1.3.js', './public/js/vendor/global.js', './public/js/vendor/dropdown.js', './public/js/vendor/forms.js', but think missing, because click not working when this: $('#mappgingpipeline .select').find('option[value="'+isactive+'"]').prop('selected', true); $('#mappgingpipeline .select').material_select();

cannot loading custom CSS in Django ontop of Bootstrap -

i able load static images, however; when comes loading custom css sheets cannot seem working. because static images loading, believe settings.py set properly, however, wrong. my static files css , images located within /static/img/hive.png , /static/css/main.css respectively. any appreciated! settings.py import os base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) allowed_hosts = [] debug = true installed_apps = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] middleware = [ 'django.middleware.security.securitymiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.mid

ubuntu - Upload files from webserver to GitHub -

i wondering if possible to, via git, copy files webserver github repo start editing github? thanks if mean want copy files directly webserver github, no, not possible git alone. while straightforward shell scripting, recommend try manually now. first, create new repository on github - following documentation walk through this: https://help.github.com/articles/create-a-repo/ . then can clone computer! - https://help.github.com/articles/cloning-a-repository/ download copy of current webserver files - html, css, js (if any), images, etc, whole shebang, make sure don't have passwords or other secrets in there. copy webserver files folder created when cloned repository. now, need add files "index" (also called staging area or cache), , commit them repository. this, open terminal, cd cloned repository folder, , run: git commit -am 'initial commit' lastly, push changes github: git push done! (but read below...) i suggest having @ githu

sql - Return 10% of records for each group that meet a certain criteria -

i trying query table has multiple groups 10% of systems in each group meet criteria. here's data: create table tablename select '4fh6v1' computername, 'az1' location, '3093' rating dual union select '0glyq1' computername, 'az1' location, '3093' rating dual union select 'p191r1' computername, 'az1' location, '3093' rating dual union select '7cmj02' computername, 'az3' location, '3392' rating dual union select '8w2qs1' computername, 'az4' location, '3093' rating dual union select 'k9chx1' computername, 'az7' location, '3192' rating dual union select '3xzns1' computername, 'az7' location, '3093' rating dual union select '79rgx1' computername, 'az9' location, '3192' rating dual union select '02br22' computername, 'az3' location, '2593' rating dual ; | computername