Posts

php - Get last part of a string preceded by a forward slash -

i have following viemo url: http://player.vimeo.com/video/5836196 how able last part of url 5836196 using php? you can use substr / strrpos - substr( $url, strrpos( $url, '/' )+1 ); demo

excel - Macro exiting early with no error -

i using below code copy in workbooks particular folder 1 workbook. 9 out of 10 times code works fine , data copied macro appears exit without finishing msgbox never displays , not error message. macro appears have been exited allows me run other macros. can advise me might causing this? seems happen if start other things on computer while macro running. sub getsheets() application.screenupdating = false dim response response = msgbox("this take time run. sure want proceed?", vbyesno) if response = vbno exit sub end if application.run ("getxlsxfiles") application.run ("getxlsfiles") datacopied = 1 sheets("instructions").select msgbox "completed successfully" end sub sub getxlsxfiles() dim sheet worksheet path = sheets("instructions").range("filename").value filename = dir(path & "*.xlsx") while filename <> "" workbooks.open filename:=path & filename, readonly:=true,...

javascript - Type casting when == used instead of === -

this question has answer here: which equals operator (== vs ===) should used in javascript comparisons? 48 answers i don't prefer using == today experimenting following code including == , results bit confusing me. can please explain happening? all these falsy values: '', 0, false, undefined, null suppose did: if (undefined == null) { alert('a'); } else { alert('b'); } the statements below give true : null == undefined 0 == '' false == '' 0 == false but why code below return false ? undefined == 0 undefined == '' null == 0 because 0 , false , '' "values" while null "absence of value" , undefined "absence of definition". thus, can compare "values" each other, same "non-values". can't compare "values" "n...

heroku - Where to host Meteor-Apps? -

i want build meteor-app run little side-project/business. in mind: i want cheap environment (online) test , share progress i want have option scale in terms of production in few months i want use standard command line tools push service the database options have scale if need more i've started looking heroku , there "good practices" can recommend? never hosted meteor-app, , i want avoid private server because of administration etc. meteor apps ready deploy heroku. question broad, heroku fits bill every parameter specified. here's flow creating example meteor app , deploying it: $ meteor create --example leaderboard $ cd leaderboard $ git init . && git add . $ git commit -m "first commit" $ heroku create --buildpack https://github.com/jordansissel/heroku-buildpack-meteor $ git push heroku master

How can I configure my index to use BM25 in ElasticSearch using the JAVA API? -

i'm trying migrate mysql database elasticsearch can use full-text search technique using bm25 similarity on each fields. i'm using java fetch entries mysql , add them elasticsearch index. i'm building index using java index api , can't figure out way set bm25 similarity on fields. i consider table products table mysql , dev index products it's index type. the original table products contains following fields : id title description you can find code on github , if you'd take look. it's forked project i've configured maven integration. any suggestion , welcome, thanks! i found answer question. here code : settings settings = immutablesettings .settingsbuilder() .put("cluster.name", "es_cluster_name")) // define similarity module settings .put("similarity.custom.type", "bm25") .put("similarity.custom.k1", 2.0f) ...

php - SQL-ASCII encoding in database throws Error: json_encode(): Invalid UTF-8 sequence in argument -

i have old postgresql database sql-ascii encoding.. in laravel, tried query records containing characters Ñ , ñ unfortunately, throws error json_encode(): invalid utf-8 sequence in argument . how solve problem? please help.

jquery - Counting and storing the number of checkboxes in a sharepoint list -

i have sharepoint list that's purpose measure competency of team. have highly regulated financial environment , there on 790 "core competencies" maintain on 200 colleagues. i've decided use sp 2013 solution. list contains fields "credit cards" "multi choice check box fields" inside credit cards - there more 30 checkboxes (eg. opening credit card , closing credit card, refunding fee, etc) essentially, when users select boxes (basically saying "i know how this") , i'd number of checkboxes in field counted , placed in sp field. example, checkbox field called "credit cards" there field called creditcardscore counts number of boxes ticked in credit card score , total number , displays %. (we can split multiple fields, needs update every time form opened) so if user ticked 15 out of 30 boxes, i'd know they're 50% competent @ job. (so can focus on getting them trained up) i'd use jquery i've seen numero...