Posts

Showing posts from July, 2015

Composer user on Ubuntu -

trying composer update throw exception on laravel : [runtimeexception] not delete /home/sherkat2017/ftp/www/vendor/symfony/yaml/dumper.php: even running chmod 775 -r vendor , chown sher:www-data -r vendor did not solve issue: drwxrwxr-x 8 sher www-data 4096 apr 13 18:25 storage i think composer run user different www-data . this worked me delete /vendor folder delete composer.lock run composer install and run these commands while re-install composer install --no-dev --no-scripts composer install --no-dev -o composer install

java - Android app hint "overlay animation" -

i trying learn more animation in android app development https://www.youtube.com/watch?v=soeuaehbzcq << 1:26 want similar if button pressed animated hint show. how can this. topics should checkout this link shows example of how define animations in xml, load them , execute on views. search objectanimator lets perform animations on basis of view properties (eg. alpha/transparency of view ). gl!

angularjs - Angular-animate not working with ng-show -

i using angular animate show div when button clicked. this button shows div : <input type='button' value='+' ng-click=addroom(x) ng-model="collapse"> this div shown when button pressed. <div class="row coll" ng-show="collapse"> <div ng-repeat="data in room[x.room_type_id]"> adult:<select ng-model="seladultvalue" ng-change="setadultprice(x)" > <option ng-repeat="a in x.plannames">{{a}}</option> </select> </div> <button class="btn pull-right" ng-class="{'btn-primary': book_status == 'available', 'btn-info disabled': book_status == 'not available'}" data-toggle="modal" data-target="#book_now" ng-click="aftertax()">book now</button> </div> this working fine div shown instantl

laravel - Missing argument 1 for Illuminate\\Support\\Manager::createDriver() -

i had @ every post related error in laravel: missing argument 1 illuminate support manager - createdriver() 2th link 3th link none of them solved issue: using laravel lumen version 5.4 , dingo api package . i want access authenticated user in incoming request: $request->user(); //returns instance of authenticated user however throw me error saying: missing argument 1 illuminate\support\manager::createdriver(), called in /var/www/html/myapp/vendor/illuminate/support/manager.php on line 88 , defined", i know in order authenticated user, need provide auth middleware inside routing: $api->get('register/{accountid}', ['middleware' => 'auth', 'app\http\controllers\api\v1\registercontroller@registeraction']); but adding middleware auth inside route not reach controller endpoint , throw same error can see above. i have authserviceprovider registered in bootstrap/app.php: $app->register(app\providers\authser

javascript - Vue.js 2: Get data from AJAX method -

i'm new vue, , i'm attempting grab data via ajax in method. i know method working. here's vue code: vue.component('sub-folder', { props: ['folder'], template: '<a href="#">{{folder.title}}</a>' }); var buildfolderslist = new vue({ el: '#sub-folders', data: { folderslist: this.folderslist }, methods: { buildfolders: function () { $.ajax({ url: base_url + 'api/folder/get_subfolders/' + browser_folder_id, method: 'post', data: { "folder_id": browser_folder_id }, success: function (data) { console.log("data"); console.log(data); this.folderslist = data; }, error: function (error) { alert(json.stringify(error));

html - How to add data attribute without value in react create element? -

i adding div dom below, react.createelement("div", { classname: "test"}); the rendered html should below <div class="test" data-test> </div> where can add data-test in createelement ? you can't because attribute without value means attribute has value true in jsx. don't pass data-test , this.props['data-test'] undefined in component. or if need have attribute empty value add default values in component definition. defaultprops: { 'data-test': '' }

halide - Bilateral Grid Generator class using Enhanced Generator -

i trying re-implement bilateral grid example using enhanced generator class (e.g. using schedule() , generate() . i've got error when trying compile code. g++ -std=c++11 -i ../../include/ -i ../../tools/ -i ../../apps/support/ -g - fno-rtti bilateral_grid_generator.cpp ../../lib/libhalide.a ../../tools/gengen.cpp -o bin/bilateral_grid_exec -ldl -lpthread -lz bin/bilateral_grid_exec -o ./bin target=host generator bilateral_grid has base_path ./bin/bilateral_grid internal error @ /home/xxx/projects/halide/src/generator.cpp:966 triggered user code @ /usr/include/c++/4.8/functional:2057: condition failed: generator make: *** [bin/bilateral_grid.a] aborted (core dumped) it seems didn't put definition of rdom , generatorparam in correct place. since r.x , r.y used in both schedule() , generate() , think should put class member. should done fix this? here code wrote. class bilateralgrid : public halide::generator<bilateralgrid> { public: generatorparam<

How to kill pods on Kubernetes local setup -

i starting exploring runnign docker containers kubernetes. did following docker run etcd docker run master docker run service proxy kubectl run web --image=nginx to cleanup state, first stopped containers , cleared downloaded images. still see pods running. $ kubectl pods name ready status restarts age web-3476088249-w66jr 1/1 running 0 16m how can remove this?

android - Listview inside fragment onitemclick is not working -

in application in main view there 3 tabs. 3 tabs filled seperate fragment viewpage adapter. in second tab , there listview (includes in fragment). when user clicks on listview need show fragment there. when user clicks on listview item got error this no view found id 0x7f0e008a (com.example.abc.myapp:id/new_output) fragment mantrafragment{30391e5 #3 id=0x7f0e008a} i found error in other questions in stackoverflow. tried solutions of them , didn't work. please me fix issue. class includes listview public class twofragment extends fragment { private listview listview; private string items[]; public twofragment() { } @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); items = getresources().getstringarray(r.array.races_array); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_two, container, false);

lua - How do I create a function that returns the first non-nil, non-empty string passed to it? -

i'm trying implement function returns first non-blank string variables passed it. unfortunately, of these variables might nil, naive approach function first_non_empty(...) i, item in ipairs({...}) if item ~= nil , item ~= '' return item end end return '' end doesn't work: ipairs quits out encounters nil value. can fixed changing requirements variables can't nil, or passing length function table length doesn't have rely on ipairs , or wrapping parameters in function none of them explicitly nil function first_non_empty_func(...) i, func in ipairs({...}) local item = func() if item ~= nil , item ~= '' return item end end return '' end function fn(p) local f = function() return p end return f end -- change callers first_non_empty_func(fn(a), fn(b), fn(c)) however, both of these solutions complicate function prototype. there exist func

c++ - Include cpp-netlib with CLion and Make on macOS -

i'm new clion, cmake , macos @ need little bit of while trying include cppnetlib clion project. i started out creating new clion project gave me new cmakelists.txt edited include boost well: cmake_minimum_required(version 3.7) project(myapp) set(cmake_cxx_standard 11) set(source_files main.cpp) add_executable(myapp ${source_files}) find_package(boost 1.63.0 required) include_directories(${boost_include_dir}) target_link_libraries(dxcheck ${boost_libraries}) i've installed boost through homebrew, did not find package cppnetlib homebrew downloaded cppnetlib , placed in /usr/local/cellar/cpp-netlib. now, when follow tutorial on page , put set (cmake_prefix_path ${cmake_prefix_path} /usr/local/cellar/cpp-netlib) find_package (cppnetlib 0.12.0 required) include_directories (${cppnetlib_include_dirs}) target_link_libraries (myapp ${cppnetlib_libraries}) into cmakelists.txt, following output: -- boost version: 1.63.0 cmake error @ cmakelists.txt:14 (find_package):

logging - Looking into bash script to log SSH activity -

i'm having suspicious ssh activity, apparently originating computer (osx sierra)... reason trying determine why, , more happening. i'm looking track ssh calls, following seems work reveal process pid makes call. choose check every 15 seconds (perhaps should lower) lsof -r 15 -i -a -c ssh for process run ps -fp <pid> information program making these ssh requests. i'd automate (run ps -fp ssh activity found) , log resulting information. i have no real experience making scripts, if me make possible appreciated. hmm, not sure if work on mac, may started: while [[ 1 ]] ; echo "## $(date) ##" ; s_pids=$(lsof -i -a -c ssh | awk '/ssh/ {print $2}') ; ps -fp ${s_pids} ; sleep 15 ; done or, log info: while [[ 1 ]] ; echo "## $(date) ##" ; s_pids=$(lsof -i -a -c ssh | awk '/ssh/ {print $2}') ; ps -fp ${s_pids} ; sleep 15 ; done | tee /tmp/ssh.log :) dale

javascript - Json - get specific field -

i need field source json solution not working !! this json: "trailers":{ "quicktime":[], "youtube":[{ "name":"bandeannonce", "size":"hd", "source":"rqeuam9fsrg", "type":"trailer" }] } i try source : var link_trailer = data.trailers[0].youtube[0].source; not working me !! trailers object, don't need use index. var link_trailer = json.parse(data).trailers.youtube[0].source;

javascript - String as a Single value and Array as multiple value handling -

if select 1 value getting value val : "abc" but if select multiple value val comming in array val : ["abc","def"]. now because of problem neighther can work on single value nor multiple. can tell me how handle this. eg: var myobj = { data : "m1", val : "abc" } after adding value become var myobj = { data : "m2", val : abc,def } function handleval(val){ if ("string" === typeof val){ console.log("do sth string"); } else if (array.isarray(val)){ console.log("do sth array") } } handleval("abc"); handleval([1,2])

json - mysql cant save my big decimal number -

i have number 34.59704151614417 and put datatype on decimal(16,14) has saved 34.59704151614400 it means mysql save 12 digit decimal array array ( [geometry] => array ( [type] => polygon [coordinates] => array ( [0] => array ( [0] => array ( [0] => 32.34375 [1] => 48.690960390925 ) [1] => array ( [0] => 16.875 [1] => 34.597041516144

how to enable particular radio button of radio group according to radio button id saved in shared preference in android studio -

i developing quiz app. in there 2 buttons previous question , next question.what want when user selects answer options (for options there 4 radio buttons) , attempts next question if user wants view previous question time same radio button should enabled ever selected user. used shared preferences storing selected radio button id. here code: next button click: nextbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { int radioselected = radiogroup.getcheckedradiobuttonid(); int userselection = getselectedanswer(radioselected); sharedpreferences=getsharedpreferences(mypreferences,mode_private); sharedpreferences.editor editor=sharedpreferences.edit(); editor.putint("ans",userselection); editor.commit(); int correctanswerforquestion =firstquestion.getcorrectanswer(); if(userselection == correctanswerforquestion)

scala - classPath spark.jobserver. not found -

i have added new code file along existing example files in spark-jobserver directory , created .jar. throws following error after jar file uploaded successfully. f:\soft\spark\projects\spark-jobserver-master_1\spark-jobserver-master>curl --data-binary @job-server-tests/target/scala-2.10/job-server-tests_2.10-0.7.1-snapshot.jar localhost:8090/jars/test { "status": "success", "result": "jar uploaded" } f:\soft\spark\projects\spark-jobserver-master_1\spark-jobserver-master>curl -d "input.string = samsungj7prime16gbgold" "localhost:8090/jobs?appname=test&classpath=spark.jobserver.viewsrecommender" { "status": "error", "result": "classpath spark.jobserver.viewsrecommender not found" } though above command fails, when call class same jar runs shown below, f:\soft\spark\projects\spark-jobserver-master_1\spark-jobserver-master>curl -d "input.string = b c b se

intellij idea - Pycharm module structure from scratch -

i wanted know if ide pycharm there way create kind of plugin lets create form scratch. example: i'm going file, new -> (here appear menuitem module) when click it automatically generates tree structure of files module folders. for have seen possible create "templates" not need. thanks in advance.

While opening Chrome browser from selenium error occuring -

browser opening not secure showing in header , 'disable extension' showing. after chrome.exe stopped working. chrome verison 57.0 , selenium jar file 3.0.1 public static void main(string[] args) throws interruptedexception { system.setproperty("webdriver.gecko.driver","e:\\software\\geckodriver-v0.14.0-win64\\geckodriver.exe"); //webdriver wd= new firefoxdriver(); system.setproperty("webdriver.chrome.driver","e:\\software\\chromedriver_win32_v2.9\\chromedriver.exe"); chromeoptions options = new chromeoptions(); options.addarguments("--disable-extensions"); webdriver wd= new chromedriver(); wd.get("http://automationpractice.com/index.php"); } the first thing update chrome driver using automation. can 2.28 version , try these lines of code. desiredcapabilities capabilities = new desiredcapabilities(); capabilities = desiredcapabilities.chrome(); chromeoptions option

c# - Error opening a project/solution on Visual Studio 2017 Community -

Image
i trying open project/solution on visual studio 2017 community , next error: i have been googling error haven't found solution. suggestions? i hope have explained problem. update i using vs17 on virtual machine windows7 32bits. i tried solution proposed andrii delete <site> inside <sites> node under applicationhost.config file after restarting vs2017 , launch project, got following error: unable connect web server 'iis express' in config file, had put application pool following: <site name="myapp" id="1"> <application path="/" applicationpool="clr4integratedapppool"> <-- here <virtualdirectory path="/" physicalpath="c:\git\myapp\myapp" /> </application> <bindings> <binding protocol="http" bindinginformation="*:61508:localhost" /> </bindings> </site> <applicationdef

c# - NON-MVC application below MVCsite -

we have simple (not mvc) asp.net c# web form deployed application our web server. works perfectly. an mvc application added our web server using ip address , iis site. want above web form exist application within/below mvc site. however, when try access web form @ https://mvcsite/webform.aspx get: the codedom provider type "microsoft.codedom.providers.dotnetcompilerplatform.csharpcodeprovider, microsoft.codedom.providers.dotnetcompilerplatform, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" not located. with reference to: <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="microsoft.codedom.providers.dotnetcompilerplatform.csharpcodeprovider, microsoft.codedom.providers.dotnetcompilerplatform, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" warninglevel="4" compileroptions="/langversion:6 /nowarn:1659;1699;1701" /

c# - Partial Class Instance Initialization Null Reference Exception -

i have service reference code below: [system.xml.serialization.soaptypeattribute(namespace="urn:customer")] public partial class receipt : object, system.componentmodel.inotifypropertychanged { private int counternofield; private double activekwhfield; /// <remarks/> [system.xml.serialization.soapelementattribute("counter-no")] public int counterno { { return this.counternofield; } set { this.counternofield = value; this.raisepropertychanged("counterno"); } } /// <remarks/> [system.xml.serialization.soapelementattribute("active-km")] public double activekm { { return this.activekm field; } set { this.activekmfield = value; this.raisepropertychanged("activekm"); } } public event system.componentmodel.propertychangedeventhandler propertyc

An elegant way to surround a string in Javascript -

are there no better ways surround string html tag (or brackets, or quotation marks, or whitespace) mundane concatenation? inbefore “stupid question” very similar problems notable enough deserve own api functions: range. surroundcontents() (doing that, selections) string methods: trim() (doing opposite white spaces), split / join() , anchor / link() deprecated string methods: big() , blink() , bold() , fixed() , fontcolor() , fontsize() , italics() , small() , strike() , sub / sup() edit: such questions not stupid creators of javascript. who more stupid: creators of javascript or you? use cases i wish write like: div.innerhtml = rawstr.split("\n\n").join("", "<p>", "</p>"); newstr = oldstr.split(/\s+“|”\s+/g).join(" ", "\"", "\""); var str = "joan – despite curly hair – loved."; return str.split(/\s+–/s+/g).join(" ", "(", ")")

android - How can I set the horizontal spacing in HorizontalGridView? -

whole fragment layout: fragment layout i want separate views there 15dp of horizontal break between cards, looks : overlapped views i've tried adding android:horizontalspacing (like in regular gridview) attribute xml, nothing happened. using childrenoffsethorizontal layoutmanager didn't give results expected. here's code of fragment: public class tvdetailsfragment extends fragment { private horizontalgridview gridview; private seasonslistadapter seasonslistadapter; public tvdetailsfragment(){ } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // arguments showdetailsactivity. bundle args = getarguments(); view rootview = inflater.inflate(r.layout.fragment_tv_details, container, false); gridview = (horizontalgridview)rootview. findviewbyid(r.id.tv_details_seasons_gridview); gridview.setlayoutmanager(new linearlayoutmanager(getactivity(), lin

javascript - Why slide up doesn't work if I use ul tag? -

i want pull up/slide html "p" tag when page has been loaded. this jquery code works fine , that: $(function () { $('.graybgc').slideup(0); }); html: <p class="graybgc"> <span>a: </span>abcd..... </p> but when put tags ul, doesn't works , doesn't pull html p tag. <p class="graybgc"> <span>a: </span> <ul > <li>123</li> <li>123</li> </ul> </p> you cannot put ul tag inside of p tag. please check html specification . here working example using div tag (jsfiddle: https://jsfiddle.net/hulothe/sa09gu46/ ) : $('.graybgc').on('click', function() { $(this).slideup(0); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="graybgc" > <span>a: </span&

sql server - MSSQLSERVER Stuck in 'Starting' -

i'm running sharepoint installation on 3 vms , sqlvm can no longer start mssqlserver service. gets stuck @ 'starting' , uses 100% of processor core seems nothing. error log follows: 2017-04-12 11:28:50.86 server microsoft sql server 2014 - 12.0.4213.0 (x64) jun 9 2015 12:06:16 copyright (c) microsoft corporation standard edition (64-bit) on windows nt 6.3 <x64> (build 9600: ) (hypervisor) 2017-04-12 11:28:50.86 server utc adjustment: 1:00 2017-04-12 11:28:50.86 server (c) microsoft corporation. 2017-04-12 11:28:50.86 server rights reserved. 2017-04-12 11:28:50.86 server server process id 4660. 2017-04-12 11:28:50.86 server system manufacturer: 'microsoft corporation', system model: 'virtual machine'. 2017-04-12 11:28:50.86 server authentication mode mixed. 2017-04-12 11:28:50.86 server logging sql server messages in file 'e:\mssql12.mssqlserver\mssql\log\errorlog'. 2017-04-12 11:28:5

ruby on rails - Spree override admin menu with tab don't work -

i need customize spree (v3.2)admin menu add new tab have icon. i tried creating override as deface::override.new( :virtual_path => 'spree/layouts/admin', :name => 'custom-admin-tab', :insert_after => "[data-hook='admin_tabs']", :text => "<%= tab :messages, :icon => 'icon-th-large', url: spree.admin_messages_path %>" ) here routes spree::core::engine.add_routes namespace :admin resources :messages end end but in admin menu, don't show "messages" tab. so happend it?

javascript - How to access the correct `this` inside a callback? -

i have constructor function registers event handler: function myconstructor(data, transport) { this.data = data; transport.on('data', function () { alert(this.data); }); } // mock transport object var transport = { on: function(event, callback) { settimeout(callback, 1000); } }; // called var obj = new myconstructor('foo', transport); however, i'm not able access data property of created object inside callback. looks this not refer object created other one. i tried use object method instead of anonymous function: function myconstructor(data, transport) { this.data = data; transport.on('data', this.alert); } myconstructor.prototype.alert = function() { alert(this.name); }; but exhibits same problems. how can access correct object? what should know this this (aka "the context") special keyword inside each function , value depends on how function

android - Release resources in onPause instead of onDestroy -

this post-honeycomb (i.e., android 3.0+) , quotes below come https://developer.android.com/reference/android/app/activity.html according lifecycle, onstop , ondestroy killable, means: note "killable" column in above table -- methods marked being killable, after method returns process hosting activity may killed system @ time without line of code being executed in other words, onstop (along others occur before event) guaranteed called, yet @ moment method returns, process might die, ondestroy not guaranteed called. another quote states: for methods not marked being killable, activity's process not killed system starting time method called , continuing after returns. followed by thus activity in killable state, example, between after onpause() start of onresume(). but not correspond said above, unless corresponds pre-honeycomb . not true post-honeycomb , right? basically, both onpause , onstop guaranteed called. assuming re

reactjs - Webpack + Babel error -

i trying configure webpack , had , running, getting same error. i've combed through few other posts seem have been resolved correcting spelling/grammar errors, can't seem pinpoint wrong in code. there more serious happening? error in ./src/components/app/app.js module parse failed: /users/desktop/fred/src/components/app/app.js unexpected token (7:11) may need appropriate loader handle file type. | | render() { | return ( | <h1>hello</h1>; | ); | }; | @ ./src/index.js 3:0-39 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack-dev-server/client?http://localhost:8080 webpack/hot/only-dev-server ./src/index here webpack.config: var path = require("path"); var webpack = require("webpack"); var autoprefixer = require('autoprefixer'); var precss = require('precss'); module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:8080', 'webpack/hot/o