Posts

Showing posts from July, 2014

How to read a file delimited by \ in R? -

i have file follows in text file a\b\c\d\f 399\i 2017\11\m\09 491\i 2017\01\ma\161 4\i 2014\01\m\16 in a , b , c , d , f names of variables. try use without results mv <- read.csv("p.txt", header=t, sep = "\")

c - XMLHttpRequest cannot load has been blocked by CORS policy -

Image
i trying consume wcf(rest) service in angular js application. wcf service working fine when run application in google chrome unable data database , can insert , update , delete operation. when run application not show error when lunch developer tools see following errors. ?o=3&g=ec0825c4-90a4-2692-d257-cd2c2b565912&s=1a2c77e8-0498-4a11-b8b8-d740dbec71c4&z=1403834305:2 uncaught syntaxerror: unexpected token < index:1 xmlhttprequest cannot load http://localhost:50028/studentservice.svc/getallstudent . redirect ' http://localhost:50028/studentservice.svc/getallstudent ' ' http://localhost:50028/studentservice.svc/getallstudent/ ' has been blocked cors policy: no 'access-control-allow-origin' header here angular js code ... /// <reference path="../angular.min.js" /> var app; (function () { app = angular.module("restclientmodule", []); app.controller("crud_angularjs_restcontroller", functio...

php - How can I find values in an array which match criteria, without using a for loop? -

i have array this $a = [ [ "id" => "1", "values" => [ "1", "2" ] ], [ "id" => "2", "values" => [ "1", "3" ] ], [ "id" => "3", "values" => [ "2", "4" ] ], [ "id" => "4", "values" => [ "4", "6" ] ], ]; to search , return array 'values' has 2 $result = [ [ "id" => "1", "values" => [ "1", "2" ] ], [ "id" => "3", "values" => [ ...

sql server - Implementation of K-mer/n-gram in SQL -

i want implement k-mer/n-gram algoirthm in sql server. ( https://en.wikipedia.org/wiki/n-gram ). in databases, have millions of protein sequences , want find k-mers array. as example; atataggtcgt | k=5 result 1 | atata 2 | tatag 3 | atagg 4 | taggt 5 | aggtc 6 | ggtcg 7 | gtcgt thanks attention. with respect https://en.wikipedia.org/wiki/n-gram k or n variable. user function best solution taking k or n input parameter. if object_id('dbo.ngram','if') not null drop function dbo.ngram; go create function dbo.ngram(@s nvarchar(max),@ int) returns table return value as( select 2 p,left(@s,@)g len(@s)>=@ union select p+1,substring(@s,p,@)from value len(@s)>p-2+@) select g value go t as( select s from(values('atcgaaggtcgt'),('at'))t(s) ) select s,g t outer apply dbo.ngram(s,2) i think query works you.

lua - Completely clearing a text file -

well, name self explanatory. don't know how go along , don't want risk breaking script deleting file , replacing it. can post method use? tried searching around , far no luck. posting egor skriptunoff 's comment answer. use io.open(filename,"w"):close() where filename name of file want clear. open file writing , close file, discarding contents.

php - Set maximum input number -

my question quite complex. working on loan system. have 2 tables regarding loan module: item loan when item being loaned, loaned quantity subtracted inventory(item_qty - loan_qty). problem comes @ update loan module. don't know how set maximum quantity. know need add item_qty , loan_qty, can't find way so. i've googled long time , still stuck. here code: <?php $loan_id=$_get['loan_id']; $acc_query = $con->query("select * `loan` natural join `item` loan_id = '$_request[loan_id]' ") or die(mysqli_error()); $acc_fetch = $acc_query->fetch_array(); ?> <div> <form method="post" action="update_loan.php" > <input type="hidden" name="item_id" value="<?php echo $item_id; ?>"> <input type="hidden" name="loan_id" value="<?php echo $loan_id; ?>"> <div class = "form-group"> ...

python - Updating tracker variables inside a dictionary -

i'm trying keep track of complex set of variables , update them, within dictionary. if dictionary not appropriate tool here, please let me know. a = 1 b = 1 c = 1 dict = {a: [(b, c)]} # {1: [(1, 1)]} = 1 b = 1 c = 2 dict = {a: [(b, c)]} # {1: [(1, 2)]} = 1 b = 2 c = 1 dict = {a: [(b, c), (b, c)]} # {1: [(1, 2), (2, 1)]} = 2 b = 1 c = 1 dict = # {1: [(1, 2), (2, 1)], 2: [(1, 1)]} = 1 b = 1 c += 1 dict = # {1: [(1, 3), (2, 1)], 2: [(1, 1)]} please note not viable python code, example of 4 procedures i'm trying keep track of. if changes, want new key, if b changes want new pair of values in appropriate key of a, , if c changes, want update existing pair of a: (b, c). couple more examples given existing dictionary: a = 2 b = 4 c = 1 dict = # {1: [(1, 3), (2, 1)], 2: [(1, 1), (4, 1)]} = 6 b = 3 c = 1 dict = # {1: [(1, 3), (2, 1)], 2: [(1, 1), (4, 1)], 6: [(3, 1)]} my question have no idea how syntax for: the process of updating values of c, or i...

clang++ - Boost.Python Link Error with Python3 and virtualenv -

i got following error when tried compile .cpp file clang++ . ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) i set python , boost-python follows. python i installed python 3.6.0 using pyenv-virtualenv (via homebrew ) boost-python i used homebrew in python 3 environment. $ source activate py36 $ brew install boost-python --with-python3 --without-python ~/.bash_profile my ~/.bash_profile looks this: export pyenv_root="/usr/local/var/pyenv" export pyenv_virtualenv_disable_prompt=1 export cplus_include_path="$cplus_include_path:/usr/local/var/pyenv/versions/3.6.0/include/python3.6m/" if pyenv > /dev/null; eval "$(pyenv init -)"; fi if pyenv-virtualenv-init > /dev/null; eval "$(pyenv virtualenv-init -)" ; fi test cpp this file tried compile , failed (saved test.cpp ). #define boost_python_static_lib #include <boost/python.hpp...

Perforce and PhpStorm/WebStorm: shelved files from default changelist disappear -

i learning how use perforce version control understanding of processes weak. phpstorm 2017 ide. i'd as possible use ide version control operations, linked ide perforce client ( instructions ). created files , in p4v, appeared in default pending changelist. once finished, within phpstorm selected "menu bar >> vcs >> shelve changes..." expecting see files moved shelf within changelist in perforce. instead, files have disappeared best can tell. gone os folder structure, , don't show in perforce either in default changelist or shelf. i need figuring out: what happened files? how them back? can phpstorm/webstorm used work perforce shelving/unshelving? if so, how properly? there couple of concepts needed understand first: phpstorm offers own shelve/unshelve functionality , independent of version control system my files not found because " main menu >> vcs >> shelve changes... " put them in ide's shelf, not...

osx - Custom Bash Autocomplete with File Path Completion -

i'm working on bash auto-completion project i'm maintainer of. can find script here . i've cobbled hacking on own, , of contributors understand completion apis better do. what have works great -- 1 exception. can manage completion like this //type pestle.phar som[tab] //completes pestle.phar some-command-name however, once we're here lose file path/name completion that's part of stock bash shell. is, working off previous example, if user types //type pestle.phar some-command-name /va[tab] we'd complete to //completes following, because var exists pestle.phar some-command-name /var is there way tell complete command like hey, in addition we're telling our custom bash function, keep normal file path completion if not, there there known science/boilerplate reimplementing file path completion in own custom base completion functions? some other answers , the docs seem indicate -o filenames or -o bashdefault options should...

sql - Google BigQuery: how to find the repo owner's github username for all github repos that contain a string? -

i'm exploring cool github repos open dataset on bigquery, , hit query can image can't quite write. curious, bigquery query return: the github username of author of each github repo with javascript file or html file that contains string d3 ? here approximate answer, minus constraint file match should javascript or html file (have filename ends in .js or .html ) #standardsql create temp function reponameshaved3(reponames array<string>) returns int64 language js """ return reponames.some(namehasd3) ? 1 : 0; function namehasd3(name) { var normalized = name.tolowercase(); return normalized.indexof('d3') === 0 || normalized.indexof('-d3') !== -1; } """; select author.name, repo_name `bigquery-public-data.github_repos.commits` reponameshaved3(repo_name) = 1 -- limit 10 credit @deathmtn on twitter query

android - Gradle build unable to compile when trying to add ads -

Image
this question has answer here: failed resolve: com.google.firebase:firebase-core:11.2.0 3 answers ok trying add ads application , tells me add line of code in build.gradle file. error image: compile 'com.google.android.gms:play-services:11.2.0' as can see in image @ bottom says failed resolve:compile 'com.google.android.gms:play-services:11.2.0' i cannot click install repository , sync project because when nothing. not open windows or anything? try adding maven { url 'https://maven.google.com' } to project level gradle file

c++ - how to specialize the template -

consider existing situation template<typename t, int n = 10> struct { //whatever }; template <typename t1,typename t2, typename t3> struct b; template<typename t2, typename t3> struct b<double,t2,t3> { //... protected: a<t2> mya; }; now i'm interesting able pass different default n a in specialization of b without changing declaration of b . possible? i can think template<typename t2, typename t3, int n> struct b<double,t2,t3> { //... protected: a<t2,n> mya; }; but i'm not sure how use it... well, class b usable that: b<double, c, d> b; where c and d types themselves. you cannot pass number there. specialization won't you. specialization don't change how can use class or parameters can pass, can change implementation set of parameter. said, what suggest change declaration of b like: template <typename, typename, typename, int = 10> struct b; ans s...

Using xpath in watson natural language understanding API to analyze parts of a website -

i'm trying use watson natural language analyze number of web pages. wanted use xpath search feature pick "divs" whatever type xpath field gives me 0 results. i'm doing wrong. has tried , got work, if can post examples of out in xpath field. thanks. you can try going to: https://watson-api-explorer.mybluemix.net/apis/natural-language-understanding-v1?cm_mc_uid=02726180788415030252514&cm_mc_sid_50200000=1503025251&cm_mc_sid_52640000=1503025251#/

c++ - Particles not oriented to the camera -

i've got simple particle system display particles on screen , move them around x, y , z axis. problem particles not oriented camera. glrotatef(g_fx, 1.0f, 1.0f, 1.0f); glenable(gl_blend); glblendfunc(gl_src_alpha, gl_one_minus_src_alpha); glenable(gl_texture_2d); gldisable(gl_depth_test); glbindtexture(gl_texture_2d, texcircle); glcolor3f (1.0f, 0.0f, 0.0f); (x = -1; x <= 1; x += 0.25) { (y = -1; y <= 1; y += 0.25) { (z = -1; z <= 1; z += 0.25) { glbegin(gl_triangle_strip); gltexcoord2d(1,1); glvertex3f(x+0.5f,y+0.5f,z); gltexcoord2d(0,1); glvertex3f(x-0.5f,y+0.5f,z); gltexcoord2d(1,0); glvertex3f(x+0.5f,y-0.5f,z); gltexcoord2d(0,0); glvertex3f(x-0.5f,y-0.5f,z); glend(); } } } glenable(gl_depth_test); gldisable(gl_blend)...

Python - Insert value to list in a dictionary -

i need fix code. try append value list in dictionary. def distance(x1, y1, x2, y2): dis=((x1-x2)**2) + ((y1-y2)**2) return dis def cluster_member_formation2(arrch, arrn, k): dicch = dict.fromkeys(arrch,[]) arre = [] j in range(len(arrch)): d_nya = distance(arrn[1][0], arrn[1][1], arrn[arrch[j]][0], arrn[arrch[j]][1]) arre.append(d_nya) minc = min(arre) ind = arre.index(minc) x = arrch[ind] dicch[x].append(1) print(arre, minc, ind, x, dicch) arrch=[23, 35] arrn={0:[23, 45, 2, 0], 1:[30,21,2,0], 23:[12, 16, 2, 0], 35:[48, 77, 2, 0]} cluster_member_formation2(arrch, arrn, 1) the output: [349, 3460] 349 0 23 {35: [1], 23: [1]} i try calculate distance between node 1 , node in arrch, , take minimum distance. in output show result of arre [349, 3460], minimum 349. 349 has index 0, find arrch index 0, likes arrch[0]=23. finally, want update dicch[23].append(1) result is {35: [], 23: [1]} but, why code update keys, 35 , 23? i hope can me. thank ...

spring - Unable to fix "could not obtain transaction-synchronized Session for current thread" -

i new spring hibernate. using sprin 4.3.8 , hibernate 5.2. i tried solutions available on net , have of them in code, yet getting error please me resolve this. error: exception in thread "main" org.hibernate.hibernateexception: not obtain transaction-synchronized session current thread @ org.springframework.orm.hibernate5.springsessioncontext.currentsession(springsessioncontext.java:133) @ org.hibernate.internal.sessionfactoryimpl.getcurrentsession(sessionfactoryimpl.java:456) @ com.travello.daoimpl.activitydaoimpl.getactivity(activitydaoimpl.java:43) @ com.travello.model.springmain.main(springmain.java:17) here activitylistdaoimpl: @transactional public class activitydaoimpl implements activitydao { @autowired private sessionfactory sessionfactory; public sessionfactory getsessionfactory() { return sessionfactory; } public void setsessionfactory(sessionfactory sessionfactory) { this.sessionfactory = sessionfactory; } @override public activitylist ...

python - How to import csv file as a training with label and testing with target data for classifier in scikit-learn? -

i have 2 csv files training , testing data. both of them (i show 1 of them, both of them same form of data , same attributes name) : full,id,id & ppdb,id & words sequence,id & synonyms,id & hypernyms,id & hyponyms,gold standard 1.667,0.476,0.952,0.476,1.429,0.952,0.476,2.345 3.056,1.111,1.667,1.111,3.056,1.389,1.111,1.9 1.765,1.176,1.176,1.176,1.765,1.176,1.176,2.2 0.714,0.714,0.714,0.714,0.714,0.714,0.714,0.0 1.538,0.769,0.769,0.769,1.538,0.769,0.769,2.586 2.188,1.875,1.875,1.875,1.875,2.188,1.875,1.667 3.333,1.333,1.333,1.333,3.333,2.0,1.333,2.8 2.5,1.667,1.667,1.667,2.222,1.944,1.667,2.481 i'm newbie in scikit-learn. learn example of training+label , testing+target data input : x_train = np.array(["new york hell of town", "new york dutch", "the big apple great", "new york called big apple", "nyc nice", ...

asp.net mvc - Make WCF client static or use dispose method -

i developing website in mvc asp.net uses wcf service. i'm using wcf client in controller that public class home : controller { private serviceclient _client = new serviceclient(); public actionresult index() { //code here } } so think 2 options have define it: 1- make client object static private static serviceclient _client = new serviceclient(); 2- use idisposable.dispose public class home : controller, idisposable { private serviceclient _client = new serviceclient(); protected override void dispose(bool disposing) { _client.dispose(); base.dispose(disposing); } } what best option performance ? both options irrelevant performance point of view. creating wcf channel factories performance "expensive". serviceclient inherits clientbase , channel factory caching. creating clients cheap , that's correct approach: create client, use it, dispose immediately. the second option therefo...

For cube building do we need to use Cognos Transformer or Cube Designer? -

for cognos cube building heard using cognos transformer?. see there tool called cube designer?. 1 need use normal cube building?. cognos cube designer latest , succeeded other 1 ?. it depends. “different data requirements require different data solutions. “ cognos has decision guide table outlining fundamental aspects of various technologies. i've found couple of links it. but transformer modeler powercubes , cube designer modeler cognos dynamic cubes. business requirements drive technology adopt , that, in turn, dictate modeling tool using. https://books.google.ca/books?id=re5jcgaaqbaj&pg=pa10&lpg=pa10&dq=use+cases+for+dynamic+cubes&source=bl&ots=5awntatx7p&sig=2z-mdsjk6g_l_hnxe6p3jd8ftpc&hl=en&sa=x&ved=0ahukewicpa_vyo7vahxs34mkhco4bp8q6aeiwzaj#v=onepage&q=use%20cases%20for%20dynamic%20cubes&f=false http://www-01.ibm.com/support/docview.wss?uid=swg27036155

Swift: How to add new property to UIImageView class? -

i'm afraid i'm relatively new swift, have looked around best , haven't been able figure out how relatively simple task! i add new property called "angle" class uiimageview, such use "image.angle". here's i've got, having attempted follow method of tutorial used (note required init? part suggested xcode , not sure of does): class selection_image: uiimageview { var angle = double() init(angle: double) { self.angle = angle } required init?(coder adecoder: nscoder) { fatalerror("init(coder:) has not been implemented") } } thank help!! class selection_image: uiimageview { var angle = double() // new init required convenience init(angle: double) { self.init(frame: cgrect.zero) self.angle = angle } override init(frame: cgrect) { super.init(frame: cgrect.zero) } required init?(coder adecoder: nscoder) { fatalerror("init...

javascript - Slick not working -

i developing html template, need slick handle testimonials carousel, if point div id slick nothing happen. i got no errors in console. this code using: ---- html ---- <section id="testimonials"> <h2 class="text-center text-uppercase margin-bottom-3">testimonials</h2> <div class="row is-full"> <div class="columns large-8 medium-8 hide-for-small-only nopadding"> <img src="assets/img/testimonials-bg.jpg" alt="placeholder"/> </div> <div class="large-4 medium-4 small-12 bg-odd rel" id="tslider"> <div class="text-center margin-3"> <img src="assets/img/test1.jpg" class="testimonial is-rounded" alt="test1"> <h5 class="text-capitalize">john doe</h5> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit. ab acc...

javascript - Vertical menu magento site -

i want ask can do? problem following. site made on magento platform. when go main menu , open 1 tab menu, left sidebar menu opened "modern" category -> /accordion sumb menus/. want according menu not loading automatically, mechanically when click +. i made changes js file on theme, no result: function accordionprocess() { var $ = jquery; var accordionlist = $('.accordion-format'); var plusicon = '+'; var minusicon = '&ndash;'; var etopener = '<div class="open-this">' + plusicon + '</div>'; accordionlist.find('li:has(ul)',this).each(function() { $(this).find('>a').prepend(etopener); }); if (jquery('.active-parent').length > 0) { jquery('.active-parent').find('>a .open-this').html(minusicon).closest('.active-parent').addclass('opened').find('>ul.children').show(); } else { if(!accordionlist.hasclass('home-sideb...

java - How to display the same code, when you are logged in on different pages in jsp? -

everyone. i start learning spring+bootstrap , create web app, have admin cp section... created login functions, , display content when have logged in , warning message when not logged in. so problem use of tags. i have following structure of code. <c:choose> <c:when test="${mode == 'admincp' }"> <c:choose> <c:when test="${loggedin eq true }"> <!-- start navbar code --> </c:when> <c:otherwise> <!-- start code diplay warning message when not logged in --> </c:otherwise> </choose> </c:when> </choose> i used first c:when tag () , because if don't when i'm not logged in warning message shop everywhere in pages don't need logged in see them. and question is. how can add different c:when tags inside on 1 <c:choose> <c:when test="${loggedin eq true }"> after navbar code, represent different pages. t...

How to add HttpClient Interceptors conditionally in Angular -

recently have been using interceptors angular httpclient. i add headers corresponding http methods , not need headers. how can tell interceptor conditionally add interceptors methods? can split services 1 service headers , 1 without headers or 1 different headers , 1 different. ngmodule providers { provide: http_interceptors, useclass: authinterceptor, multi: true, },{ provide: http_interceptors, useclass: angularinterceptor, multi: true, } myinterceptors @injectable() export class authinterceptor implements httpinterceptor { intercept(req: httprequest<any>, next: httphandler): observable<httpevent<any>> { const authreq = req.clone({headers: req.headers.set('x-auth-token', "-------------------------")}); return next.handle(authreq); } } @injectable() export class angularinterceptor implements httpinterceptor { intercept(req: httprequest<any>, next: httphandler): observable<httpevent<any>>...

c - how to parallelize a dot product with MPI -

i've been trying learn mpi , i've code snippet c should formatted mpi make parallizable; // dot product int a[100000]; int b[100000]; int c=0; (int i=0 ; i<100000; i++){ c += a[i] * b[i]; } im kinda confused of how deal for-loops when using mpi answer exercise; // dot product int a[100000]; int b[100000]; int c=0; int rootid = 0; int numtasks, taskid, len, partner, message; mpi_status status; mpi_init(&argc, &argv); mpi_comm_rank(mpi_comm_world, &taskid); (int i=0 ; i<100000; i++){ c = a[i] * b[i]; if(rootid == taskid){ mpi_send(&a[100000], &b[100000], mpi_int, 1, 0, mpp_comm_world, mpi_status) }else if (rootid < taskid){ mpi_recv(c, 100000, mpi_int, 0, 0, mpp_comm_world, mpi_status) } mpi_finalize(); return 0; } im not sure if correct, believe im in right direction... the problem mpi can't find examples of how rewrite or structe loops - there examples in fortran nothing im familia...

chatbot - How to get Chatbase data to show on Dashboard -

struggling find forum on this. we've started using chatbase , struggling see our data in dashboard. api returns 200's message_ids. able point me in right direction in terms of how debug further? have followed docs here: https://chatbase.com/documentation/generic , 'codelab'. issues logged on github , tweeted. some of our data show - intents , of 'session flows', rest blank. no messages, no 'active users' ever.

java - android studio firebase gettoken id -

i programming chat app , want save token id in firebase database got token empty. code: firebaseuser user = firebaseauth.getinstance().getcurrentuser(); string user_id = mauth.getcurrentuser().getuid(); string device_id = firebaseinstanceid.getinstance().gettoken(); toast.maketext(this, device_id, toast.length_short).show(); mdatabasetokenid.child(user_id).child("device_token").setvalue(device_id).addoncompletelistener(new oncompletelistener<void>() { @override public void oncomplete(@nonnull task<void> task) { if (task.issuccessful()){ }else{ toast.maketext(loginactivity.this, ""+task.getexception() , toast.length_short).show(); } } }); if(user.isemailverified()){ intent intent = new intent(getapplicationcontext(),mainactivity.class); intent.addflags(intent.flag_activity_new_task | intent.flag_activity_...

python 3.x - How can I make a specific login for specific group with Django's `authenticate()`? -

hello have been looking through documentation in https://docs.djangoproject.com/en/1.11/topics/auth/default/#authenticating-users . however, shows how authenticate user . i have grouped user want specific user login in specific form. how can achieve that? additionally, when should use permissions , when should use groups ? i suggest create custom decorator it, why? because think method easy understand how work group using permissions. an example in yourapp/decorators.py : you can see, here focusing on if ... request.user.groups.filter(name='moderator') handle group. from django.shortcuts import render def moderator_login_required(function): def wrap(request, *args, **kwargs): if request.user.is_authenticated() \ , request.user.groups.filter(name='moderator').exists(): return function(request, *args, **kwargs) else: context = { 'title': _('403 forbidden...

database - Android Studio SQLiteDatabase - no such column -

this question has answer here: when sqliteopenhelper oncreate() / onupgrade() run? 10 answers i have started working sqlite database , have ran problem. whenever try update or delete data, app crashes , displays , error "no such column: s_id". have tried fix days have had no luck. appreciate if tell me problem , why occurring. thank you. here database: public class databasehelper extends sqliteopenhelper{ public static final string database_name = "sqlite.db"; public static final int version = 1; public static final string table_name = "tbl_reminder"; public static final string s_id = "s_id"; public static final string s_title = "s_title"; public static final string s_date = "s_date"; public databasehelper(context context) { super(context, database_name, null, version); } @override public void on...

javascript - calling a function in angular controller from google api present in view -

i using google places details api. in src attribute put google api has callback named initmap here code <div class="tab-pane active" id="timeline"> <p class="lead">location</p> <hr> <div class="row"> <div class="col-md-1"></div> <div class="col-md-8"> <h2><a href="#"></a> <span>location <b style="color:black;"> kolkata</b></span></h2> <p></p> <div id="map" style="width:100%;height:400px;"></div> <script src="https://maps.googleapis.com/maps/api/js?key=api_key&libraries=places&callback=initmap"></script> <p></p> </div> </div> </div> in same html have written initmap function <script> function initmap() { var map = new google.maps.map(document.getelem...

php - Nginx multiple projects in one domain blank page laravel -

this config here nginx have domain named tstdmn , 2 laravel projects first tstdmn.com project , second florist project want deploy florist project tstdmn.com/florist , set return blank page @ tstdmn.com/florist what's issue here?! , know problem nginx configuration because switch florist project main project , works, not laravel configurations root /var/www/html/tstdmn.com/public; # add index.php list if using php index index.html index.php index.htm index.nginx-debian.html; server_name tstdmn.com www.tstdmn.com; location / { # first attempt serve request file, # directory, fall displaying 404. try_files $uri $uri/ /index.php?$query_string; } location ^~ /florist { alias /var/www/html/florist/florist_backend/public; try_files $uri $uri/ @laravel1; location ~ \.php { fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_split_path_info ^(.+\.php)(.*)$; include /etc/nginx/fastcgi_params; }...

android - Two keywords with the same data -

i'm trying have 2 keywords same result, please thanks. here's code: if (et2.gettext().tostring().trim().equals("good evening")) { tv.settext("naimbag sardam"); tv2.settext("naimbag sardam"); tv3.settext("maupay nga gab-i"); tv4.settext("maayong gabii"); tv5.settext("mayap bengi"); }

java - ClassLoader.getResource returns odd path (maybe)? -

when loading asset such text file resources folder, common approach use classloader path: string path = getclass().getclassloader().getresource("file.txt").getpath(); you can use of many readers java has read content of file. reason, paths.get(path) not happy path: byte[] content = files.readallbytes(paths.get(path)) -> throws java.nio.file.invalidpathexception when executed classloader.getresource(...).getpath() returning: /d:/projects/myapp/build/resources/main/file.txt paths.get() doesn't it. apparently ':' after /d 'illegal char'. (note path seems correct, file there) which 1 causing problem? classloader.getresource() returning invalid path or paths.get() acting on nothing? some time later seems there multiple different formats paths in java. various frameworks don't appear agree on right , wrong, therefore there various discrepancies between paths create , accept. in example, paths.get() in fact not expecting ...

wpf - Combine different Triggers with a logic -

i'm facing problem, don't understand how animate custom styled controls. understand heavy topic , read many approaches visualstatemanager , triggers , behaviors. however, every approach has limitations , come same question: how do right? now, stick trigger approach, because think it's general approach. however, i'm struggling in creating animation logic. example, i'd animate textbox's border. created 3 events triggers: mouseenter , mouseleave , gotfocus . whenever mouse enters control, textbox's border changes color. when it's focused changes color again. however, when mouse leave's textbox border doesn't keep focus color shows color defined in mouseleave event trigger. how create logic keeps focus color in case? how solve tasks these? can recommand resources describe actual solutions , not possible ways? you use multitrigger or multidatatrigger listens several properties: <style.triggers> <multitrigger> ...

How do I use the number range in regex matched groups in a loop in javascript? -

i'm looking use numbers in regex find , run loop using first number starting point , last number ending point , write text using javascript core objects, methods or functions. have array of strings in form '<disp-formula id="deqn4-9">', '<disp-formula id="deqn15-17">' , on.. , using array want write below: expected output: rid"4"/<disp-formula id="deqn4-9"> rid"5"/<disp-formula id="deqn4-9"> rid"6"/<disp-formula id="deqn4-9"> rid"7"/<disp-formula id="deqn4-9"> rid"8"/<disp-formula id="deqn4-9"> rid"9"/<disp-formula id="deqn4-9"> rid"15"/<disp-formula id="deqn15-17"> rid"16"/<disp-formula id="deqn15-17"> rid"17"/<disp-formula id="deqn15-17"> basically, takes number range array , uses every single ...

swift - UICollectionview custom flow layout - performance issues -

i struggling with performance issues while changing orientation of device. according apple documentation there way improve performance implementing override func shouldinvalidatelayout(forboundschange newbounds: cgrect) -> bool and override func invalidationcontext(forboundschange newbounds: cgrect) -> uicollectionviewlayoutinvalidationcontext the second method allows me invalidate items interested of. invalidate items ( don't wanna invalidate headers, footers. ) if return true first method performance going jump crazy, if stay implementation inside view controller : override func viewwilltransition(to size: cgsize, coordinator: uiviewcontrollertransitioncoordinator) { super.viewwilltransition(to: size, with: coordinator) coordinator.animate(alongsidetransition: nil, completion: { _ in uiview.animate(withduration: 1.0, delay: 0.0, usingspringwithdamping: 0.5, initialspringvelocity: 0.5, options: .curvelinear, animati...