Posts

Showing posts from March, 2015

c# - Process.Start takes long time to start outside application -

i have method launches second exe. issue i'm having if i'm in debug mode in visual studio , put breakpoint directly after process.start call second application launches if have no break points in vs or run main c# application outside of vs launching of second application via process.start can take 2 minutes. method below , put breakpoint see immediate launch of 2nd app @ line "if(null != _processmine)". put launch of second exe in worker thread because when close main exe want second exe close also. public static void runbtnprocessthread(string processname, string sargs, button btn) { // disable button until release newly launched process btn.enabled = false; backgroundworker worker = new backgroundworker(); worker.dowork += (doworksender, doworkargs) => { processstartinfo startinfo = new processstartinfo(); startinfo.createnowindow = false; startinfo.useshellexecute = false...

php - File is readable but fails to be included -

i have file include files listed. i'm facing unknown error. there's class file in /class/class.user.php , there's include file in /includes/_inc_include.php now, when run :- var_dump(is_readable('../class/class.user.php')); it returns true when try include using :- include '../class/class.user.php'; it gives error :- include(../class/class.user.php): failed open stream: no such file or directory why happening ? you've mentioned trying include file, error you're getting require is may have required file 1 of other files including /includes/_inc_include.php ? the error message got, contain file path , line number of resulting error, should trace error causing require

How to change format of date and insert it in database using php and html only -

i used tag in html accepting date $date = date('d-m-y', strtotime($_post["date"])); i used code converting date. date converted if echo date not getting inserted in database. gets posted 00-00-0000 if click in database proper date appears.the type 'date' used in database store date. please tell me how store in database in converted format. you can't store in database in format in date field. database stores dates in y-m-d format (yyyy-mm-dd), when read date out again , display it, convert format want show as.

c++builder xe8 - TMapView.AddPolyline crashes the app -

hello trying create application test map capabilities of tmapview component. trying code add polylines on map surface: tarray__1<tmapcoordinate> mapcoords; mapcoords.length = 2; mapcoords[0].latitude = 0.1; mapcoords[0].longitude = 0.1; mapcoords[1].latitude = 0.5; mapcoords[1].longitude = 0.5; tmappolylinedescriptor mapdesc = tmappolylinedescriptor::create(mapcoords); mapview1->addpolyline(mapdesc); mapview1->location = mapcoords[0]; i have no idea why code crashes app. can't debug app because working on virtual machine(i not allowed install 3rd party apps on specific laptop) , virtual machine doesn't recognize phone. please me out.

android - nativescript sample projects fail with error Command ant failed with exit code 1 -

i went through setup steps - on mac - sample nativescript projects fail same error. "command ant failed exit code 1" here log trace: https://gist.github.com/getsetbro/c0225e8fc493d57b3f64 other info android studio on mac run projects fine in emulators , connected devices same projects run in ios emulator without errors. i installed jdk 8, never had version 7 on system. i see following error in logs. cannot run program "/users/sb/documents/dev/nativescript/test_nativescript/platforms/android/${aapt}" i might wrong seems aapt tool missing $path environment variable. if case, try adding <android_sdk_root>/tools $path

ruby on rails - how to get the reference? -

please solve problem. there table users: id :integer, autoincrement name :string gender_id :integer there table genders: id :integer, autoincrement gender_name :string model user: class user < activerecord::base belongs_to :gender end model gender: class gender < activerecord::base has_many :users end i need gendername. try so: <% @users.each |user| %> <div class="col-xs-6"><%= user.name %></div> <div class="col-xs-2"><%= user.gender_id %></div> <% end %> the result output number, need gendername my column 'gender_id' contain 0 value. problem has been

shell - Expect-like functionality to IO.gets? -

for example, if wanted automate authorizing hex user. like mix hex.user auth #!/usr/bin/expect -f expect "username: " send -- "$hex_username\r" expect "password: " send -- "$hex_password\r" mix hex.user auth asks username: , password: don't think expect works this given following script: u = io.gets("username: ") |> string.strip p = io.gets("password: ") |> string.strip io.puts "" io.puts "#{u} - #{p}" you can pass input this: $ export hex_username="hexuser" $ export hex_password="hexpass" $ echo "$hex_username\n$hex_password" | elixir test.exs username: password: hexuser - hexpass so, use echo "$hex_username\n$hex_password" | mix hex.user auth

ios - UITableviewCell row height shrinking -

i have uitableviewcell 2 labels , switch. when switch value changes state off remove 1 of labels , when changed on added view. have used auto layout. when wanted add added lost constraints while removing. here code snippet - (void)willupdatecell:(sampletableviewcell *)cell{ nsindexpath *indexpath = [self.tableview indexpathforcell:cell]; if ([cell.messageswitch ison]) { cell.messagedescription = [uilabel new]; cell.messagedescription.translatesautoresizingmaskintoconstraints = no; cell.messagedescription.text = self.messages[indexpath.row][@"description"]; cell.messagedescription.numberoflines = 0; cell.messagedescription.linebreakmode = nslinebreakbywordwrapping; [cell.contentview addsubview:cell.messagedescription]; cell.left = [nslayoutconstraint constraintwithitem:cell.messagedescription attribute:nslayoutattributetrailing relatedby:nslayoutr...

Using grepl in R -

in cases these 2 different ways of implimentation give different results? data(mtcars) firstway <- mtcars[grepl('6',mtcars$cyl),] secondway <- mtcars[mtcars$cyl=='6',] if these ways give same results of them recommended , why? thanks using package microbenchmark, can see faster library(microbenchmark) m <- microbenchmark(mtcars[grepl('6',mtcars$cyl),], mtcars[mtcars$cyl=='6',], times=10000) unit: microseconds expr min lq mean median uq max neval mtcars[grepl("6", mtcars$cyl), ] 229.080 234.738 247.5324 236.693 239.417 6713.914 10000 mtcars[mtcars$cyl == "6", ] 214.902 220.210 231.0240 221.956 224.471 7759.507 10000 it looks == faster, when possible should use that however, functions not same thing. grepl searches if string present @ wheras == checks whether expressions equal grepl("6", mtcars$disp) [1] true true false false ...

osx - PATH not working on Mac OS X 10.10.3 -

i want configure maven , wildfly on local mac computer. in terminal use zsh shell. so, input maven , wildfly home in .zshrc file as maven_home="/users/myuser/development/maven" jboss_home="/users/myuser/development/wildfly" and then export path="$path:$jboss_home/bin:$maven_home/bin" but when type maven command in terminal, shows me response zsh: command not found: maven then put 3 commands in .bashrc , .bash_profile files. nothing. after reboot. wrong? maven command mvn , not maven :)

ruby - Importing data that may take 10-15 minutes to process, what are my options in Rails? -

i have rails application displays thousands of products. products loaded product feeds, source may large xml file or web service api calls. i want able re-use models in existing rails application in import process. what options in importing data rails application? i use sidekiq fire off rake tasks, not sure if sidekiq suitable tasks take 10+ minutes run? use cases have seen sending of emails , other similiar light tasks i create maybe stand-alone ruby script, not sure how re-use rails models if go route. update total product around 30-50k items. sidekiq great option others have mentioned. 10+ minutes isn't unreasonable long understand if restart sidekiq process mid run job stopped well. the concern have if importing 50k items , have failure near beginning you'll never last ones. suggest looking @ import routine , seeing if can break smaller components. this: start sidekiq import job. first thing job reschedule n hours later. fetch data api/x...

file upload - Laravel 5.1 AWS S3 Flysytem: AWS HTTP error: cURL error 6: Couldn't resolve host name -

i'm on local environment , enable file uploading aws s3, using laravel 5.1 flysystem/filesystem. all setup has been done. have created test form, , i'm trying upload file. when push submit button, absolutely, lovable error: s3exception in wrappedhttphandler.php line 152: error executing "headobject" on "https://s3.frankfurt.amazonaws.com/bucketname/resource-6"; aws http error: curl error 6: couldn't resolve host name sooo... have gone wrong? here code: form / view {!! form::open([ 'route' => 'resource-store', 'class' => 'uploadresource', 'files' => true ]) !!} {!! form::label('resource title') !!} {!! form::text('title', null, ['placeholder'=>'descriptive title']) !!} {!! form::label('your resource') !!} {!! form::file('resource', null) !!} {!! form::submit('create resource') !!} {!!...

vim - Custom mappings in help text buffers -

i tend not use windows in vim (i prefer tabs), there things use them, such text buffers. i'm fine that, how seldom use windows, takes me second remember how close window ( <c-w>c ) , go doing. i'd add line vimrc maps q close window, if window buffer. i've done similar netrw windows, this: augroup wtf_netrw autocmd! autocmd filetype netrw nnoremap <buffer> q :e#<cr> augroup end i tried doing similar thing filetype help : :autocmd filetype nnoremap <buffer> q <c-w>c but didn't work -- typing q in text buffer did default q action, recording macro. when try :nnoremap q <c-w>c , typing q in text buffer closes window expect. is there special way add mapping works in text buffer? i use (borrowed junegunn's vimrc, think): augroup vimrc autocmd! autocmd bufenter *.txt call s:at_help() ... augroup end " special actions files function! s:at_help() if &buftype == 'help' ...

regex - Remove duplicates from text file based on second text file -

how can remove lines text file ( main.txt ) checking second textfile ( removethese.txt ). efficient approach if files greater 10-100mb. [using mac] example: main.txt 3 1 2 5 remove these lines removethese.txt 3 2 9 output: output.txt 1 5 example lines (these actual lines i'm working - order not matter): chijw3p7xz8yyikrbd_tjkgjrs0 chij08x-0kmayikr5ccrf-xt6za chijixbjoykfyikrzugzz6tio1u chijiaf4aooeyikr2c9wyapwdxm chij39hopkdix4krcfdirxivrqs chijk5nev8chyikrihmxier5ak8 chijs9inbrcfyikrf0zlka1njeg chijrycysg0cyikrarqactwz-e8 chijc8haxludyikrfsfjoqwe698 chijxrvp80zpcearavmzvlcwa24 chijw8_laaeeyikr68nb8cpalsu chijs35yqobit4kr05f4cxshd_8 chijormgsdwgyikrvlbhoe7xahq chijattwbawyvogrcppdyk42-nc chijtujgaqunvogr90kc8hriw8c chijn7p2nf8evigrwxdzecjl5eq chijizgc0lsbvigrdlis85m5dbs chijc8h6zqccvigr7u5aefjxjjc chij6ymovoeyvogrjjcmcl6oqco chij54hccsaevogriy9___rgz6o chijif92qn2yvogr87n0-9r5tla chij0t5e1yayvogrifrl7s_oem8 chijwwgce4eyvogrcrfc5pvznd4 there 2 standard ...

c - Write System Call Argument Registers -

i have piece of assembly code write system call (is correct?) via call write@plt before doing so, values of rax , address rsp , edi , rsi , rdx set/modified. how know registers used arguments write or system function calls in general? my guess write it's rsp , edi , rsi since in c takes 3 arguments: ssize_t write(int fd, const void *buf, size_t nbytes); when call write@plt don't directly invoke write(2) system call, tiny wrapper around (a tiny c function syscall , sets errno on failure). so write function using standard c calling convention , defined in abi (application binary interface). linux x86-64 read sysv abi interface x86-64 read vdso(7) find out bit more how syscalls done. others might use sysenter machine instruction, etc... details given in abi spec (stricto sensu, real syscall not using stack , passes arguments & results thru registers). read linux assembly howto (more focused on 32 bits x86). also, c standard librar...

nginx - 200 connect() to unix:/tmp/uwsgi.sock failed -

i configuring nginx uwsgi on ec2, have check logs in file /var/log/nginx/error.log . i getting error: 200 connect() unix:/tmp/uwsgi.sock failed (2: no such file or directory) while connecting upstream my uwsgi.sock location /var/www/myapp/ how can change file location uwsgi://unix:/tmp/uwsgi.sock uwsgi://unix:/var/www/myapp/ in configuartion? this might problem classical namespaced temp, please see this: http://fedoraproject.org/wiki/features/servicesprivatetmp but mentioned have set sock location app directory, have done in nginx configuration virtual host? need restart web server changes take affect. please refer question , answer, might useful in case. got 'no such file or directory' error while configuring nginx , uwsgi please refer section in nginx.conf file, uwsgi_pass mentioned. if have not made changes that, please , restart webserver. think must solve problem.

vb.net - Visual Basic 2010 Trying to click submit button with no id and only text on it in web browser -

button trying click in webbrowser <button type="submit" class="c-btn c-btn-primary c-pull-right" tabindex="3">sign in</button> my code : webbrowser1.document.getelementbyid("user_login").setattribute("value", nstextbox1.text) webbrowser1.document.getelementbyid("passwd_login").setattribute("value", nstextbox2.text) webbrowser1.document.getelementbyid("rem_login").invokemember("click") delay(1) the login button clicker go after delay(1) part. ive been stuck on days, done countless searches , can not find out how click using code.

javascript - How to use a polygon string in google maps api -

i have following polygon string: polygon ((5.031728766 52.016855117, 5.039437914 52.018712029, 5.038732065 52.01933205, 5.03880625 52.019536002, 5.036666299 52.021123062, 5.037225302 52.021436208, 5.036494826 52.021980534, 5.040069034 52.024180983, 5.041131857 52.023541011, 5.041485972 52.023745389, 5.042328698 52.023235595, 5.043167194 52.022781293, 5.043379189 52.022938683, 5.04366399 52.022788333, 5.044615961 52.023393034, 5.046878469 52.022023355, 5.047609948 52.02119413, 5.048777737 52.022018526, 5.049465821 52.022060318, 5.05135083 52.021274278999996, 5.053039915 52.020873436, 5.052288001 52.019935439, 5.052174884 52.019294199, 5.053026298 52.019318482, 5.053120663 52.018982405, 5.05237284 52.018935127, 5.051442801 52.019120203, 5.046607457 52.016128313, 5.046220739 52.015628312, 5.04412241 52.015134981, 5.043853082 52.015544473, 5.043410675 52.015932024, 5.042704158 52.016254485, 5.042235947 52.016357569, 5.040118936 52.0166409, 5.039579367 52.015163505, 5.034087326 52.015...

scripting - google apps script - batch setValues() on Sheet -

in order optimize code, i'm trying batch updates. instead of calling setvalues() on loop, want store data in array, setvalues() once after loop. however, can't make work: var tempvaluesarr= []; var ctr = 0; ....{ //there 1 row needed every second sheet, data @ 2nd //row 6 columns var secondsheetrange = secondsheet.getrange(2, 1, 1, 6); tempvaluesarr.push(secondsheetrange.getvalues()); ctr++; } //finally, copy these tempvalues @ sheet, starting @ second row var anothersheetrange = anothersheet.getrange(2, 1, ctr, 6); anothersheetrange .setvalues(tempvaluesarr); here's error i'm getting: incorrect range width, 1 should 6 thanks! i think issue pushing 2d array ( [[cella2, cellb2], [cella3, cellb3]] ) 1d array ( [] ), leaving 3d array ( [[[cella2, cellb2], [cella3, cellb3]]] ). to use setvalues need 2d ( [[cella2, cellb2], [cella3, cellb3]] - 2 rows or [[cella2, cellb2]] - 1 row ) array of values. try this, push first 1d a...

c# - Iterating through multiple levels of Child Objects -

i have block of code. , need iterate through every child object, child objects have more children within them. awake() method called when program first ran. so, i'm asking how build iterator check if there children within children. , run resizemeshcollection(meshfilter[] collection) on children, until there no more child objects. public class resizeasset : monobehaviour { void awake() { resizemeshcollection(this.getcomponentsinchildren<meshfilter>()); } void resizemeshcollection(meshfilter[] collection) { foreach (meshfilter mf in collection) { mf.getcomponent<meshfilter>(); transform tf = mf.getcomponent<transform>(); /// resize logic here /// check if there children under child object, /// run resizemeshcollection() on /// children until there no more. i'm sure not want run resizemeshcollection() within itself, nor know if po...

scala - How to access 'this' element from event handler passed into scalatags? -

i'm trying access text of current ( this ) element within event handler created scalatags. here tried: val onchange = {(e: htmlelement) => number() = e.textcontent.toint }: js.thisfunction input(`type`:="number", onchange := onchange).render when debug above code, nothing being passed onchange function. specifically, if put function body: js.dynamic.global.alert(json.stringify(e)) , prints {} . also, error e.textcontent null. how pass in javascript this element? i got clarification on scala.js gitter , , turns out can access element within closure so: val inputelem = input(`type`:="number").render inputelem.onchange = {(e: event) => number() = inputelem.value.toint }

javascript - Uncaught TypeError: cannot set property 'x' of undefined -

as part of first code trying make array randomly generated circles (stars). this line typeerror occurs. stars[i].x = math.floor(math.random() * w) i looked through code , stars defined. $(document).ready(function() { //canvas var canvas = $("#canvas")[0]; var ctx = canvas.getcontext("2d"); var w = $("#canvas").width(); var h = $("#canvas").height(); var stars = []; the rest of code fine might have here see else may have gone wrong. $(document).ready(function() { //canvas var canvas = $("#canvas")[0]; var ctx = canvas.getcontext("2d"); var w = $("#canvas").width(); var h = $("#canvas").height(); var stars = []; function init() { createstars(); drawstars(); } init(); function createstars() { (var i=0; i<=4; i++) { stars[i].x = math.floor(math.random() * w); stars[i].y = math.floor(math.random() * h); } } function drawstars() { (var i=0; <= 4; i++)...

angularjs - is there a version of SmartAdmin/Sb-Admin based on angular-meteor? -

i'm 1 of these people learns best looking @ examples i've been searching through different variants of wrapbootstrap's smartadmin/sb-admin. found 1 based on angular. also, found 1 based on meteor could not find 1 based on both (i.e. one, using angular-meteor bridge) wonder of have come across such breed a little late party, purposes of looking @ different code samples on wrapbootstrap, how inspinia? seems have both meteor , angular versions. project: https://wrapbootstrap.com/theme/inspinia-responsive-admin-theme-wb0r5l90s app versions: http://webapplayers.com/inspinia_admin-v2.5/package.html

ruby on rails - Sunspot gem return all result -

sunspot gem return data select * contents my model has_many :pictures, :dependent => :destroy searchable text :title integer :id text :pictures pictures.map { |picture| picture.image_file_name } end end and calling section code is @search = contents.search fulltext params[:q].to_s fields(:title) fields(:image_file_name) end looking filter result search multiple fields , multiple tables one thing need change in code fields attribute trying search. in model have defined searchable field as: text :pictures pictures.map { |picture| picture.image_file_name } end hence, searchable field named pictures . in controller search, trying search on field image_file_name , whereas should searching on field pictures . so, search code needs this: @search = contents.search fulltext params[:q].to_s fields(:title, :pictures) end end if still continue facing issu...

android - Why is BUILD FAILED? -

i trying run simplest qt application on android device. there avd , real phone android. both of them error: build failed /home/user1/dev/android-sdk-linux/tools/ant/build.xml:649: following error occurred while executing line: /home/user1/dev/android-sdk-linux/tools/ant/build.xml:655: execute failed: java.io.ioexception: cannot run program "/home/user1/workspace/build-test11123-android_for_armeabi_v7a_gcc_4_9_qt_5_4_2-debug/android-build/${aidl}": error=2, no such file or directory @ java.lang.processbuilder.start(processbuilder.java:1047) @ java.lang.runtime.exec(runtime.java:617) @ org.apache.tools.ant.taskdefs.launcher.java13commandlauncher.exec(java13commandlauncher.java:58) @ org.apache.tools.ant.taskdefs.execute.launch(execute.java:428) @ org.apache.tools.ant.taskdefs.execute.execute(execute.java:442) @ org.apache.tools.ant.taskdefs.exectask.runexecute(exectask.java:628) @ org.apache.tools.ant.taskdefs.execta...

Select count(*)... mysql -

i have table 1 : id : name : point 1 john 30 2 james 30 3 owen 20 4 mikel 20 5 jenny 20 6 kobi 10 how can use count() function select * have point 20 , less 20 , > 20 select (*) table_name point 20 // return 3 select (*) table_name point < 20 // return 1 select (*) table_name point > 20 // return 2 how can 3 query in 1 return table count(*) ________ 3 1 2 use conditional aggregation: select sum(point = 20), sum(point < 20), sum(point > 20) table_name; also, don't use like numbers! converts values strings. produce unexpected results , might make query unable use indexes.

php - bbPress automatically replaces a url with html link, inside crayon -

i using crayon plugin , bbpress plugin in wordpress. bbpress allows use forums inside wordpress. after adding new topic in bbpress, noticed normal url being replaced html link. because wrote url inside crayon code. if write url outside crayon code, not replaced link. problem seems crayon plugin. example: inside crayon plugin wrote http://www.example.com replaced <a href="http://www.example.com" rel="nofollow">http://example.com</a> please help!

javascript - How to create link between nodes from different svg elements using d3.js -

updated : working visualization using d3.js (javascript library). requirement follows: there multiple number of groups ( represented rectangular boxes), , there multiple number of nodes in each group. given set of links between various nodes. want use force directed layout. can move boxes , nodes across screen , links should move accordingly. i able create boxes , nodes inside boxes not able create links. links not getting aligned nodes , links not moving in accordance movement of nodes. can please me? here jsfiddle link of code. http://jsfiddle.net/s6y183mh/32/ var width = 600, height = 500; radius =10; var svg = d3.select("body").append("svg") .attr("width", 900) .attr("height", 800) .style("background-color","#ece9e9") .attr("overflow","scroll"); // outer force layout var graph = { "nodes": [ {"name": "probe1", "group": 1}, {...

jquery - Jspanel (fake modal window in cshtml) with angularjs -

has used jspanel angularjs? i can't find examples of that. otherwise, there similar framework in order manage modal window inside page, open , access iframe in it, , use postmessage communication? you have @ kendo ui framework. have nice modal window iframe support: kendo window . looks there angular.js features included. i dont know if suits needs, framework thats worth look. hope helps!

Android Studio is slow (how to speed up)? -

i upgraded eclipse android studio , i'm not liking experience. i'm comparing them both on windows 7 64 bit ultimate 16gb of ram , intel i7 4770 running nvidia geforce 780 latest nvidia drivers if matters , i'm running latest jdk , latest android studio. the android studio slow in building project can live it's extremely resource intensive , slows down pc crawl. whenever i'm building or running in as, pc seems become extremely sluggish. causes flickering of screen , blanking second monitor if click on "gradle build running" spinner find odd. ram usage shoots ~3gb find excessive doing nothing (this when it's idle after few builds). in addition, panels @ bottom of keep jumping around horrible user experience (moves android messages version control or else on ad-hoc basis depending on what's happening very, annoying). what know basically: 1) how make android studio run better? may doing wrong or missing updates i'm not aware of ...

powershell - Advanced XPath SelectNodes criteria -

i have reached stumbling point in understanding of xpath. can basic selections without trouble, have need select nodes based on not node part of, based on if contain specific node, , keep finding myself going down path of large selection doing loop , if dance whittle down. , somehow think missing nifty trick in xpath in single statement. so, given xml below, end set of computer nodes, based on particular location id , presence of particular value in set. so, $location = amsterdam & $set = viz should return a-1 computer, $location = amsterdam & $set = arch should return 3 computers in amsterdam. so, can done purely in xpath statement? , if not, there nifty powershell pipeline trick? or best bet use xpath address location , loop , if strain out sets? <management> <computers> <location id="amsterdam"> <computer id="a-1"> <conformsets> <set>arch</set> <set>viz</s...

Slow Azure Table Search and Insert Operations on small tables -

i trying benchmark search/read & insert queries on ats small size(500 entities). average insert time 400ms , average search + retrieve time 190ms. when inserting, querying on partition key , condition composed of 1 predicate : [partitionkey] eq <value> (no more ands/ors). also, returning 1 property. what reason such results? search code: tablequery<dynamictableentity> projectionquery = new tablequery<dynamictableentity>().select(new string[] { "state" }); projectionquery.where(tablequery.generatefiltercondition("partitionkey", querycomparisons.equal, "" + msg.partitionkey)); // define entity resolver work entity after retrieval. entityresolver<bool?> resolver = (pk, rk, ts, props, etag) => props.containskey("state") ? (props["state"].booleanvalue) : null; stopwatch sw = new stopwatch(); sw.start(); list<bool?> slist = table.executequery(pr...

linux - Does Java JVM use pthread? -

does jvm on mac os x use pthread create threads? what on linux distributions, default way create threads jvm on distributions? yes, hotspot jvm (i.e. oracle jdk , openjdk) uses pthreads on linux , on mac os x .

javascript - Can't Post to Facebook Page using JS -

okay want post facebook page page(this developing mode application viewable ne). have done facebook login. so ask 2 permissions , are manage pages publish pages i can post page using facebook graph explorer tool can't via javascript code. here code write using js. code written inside function. fb.api('me/accounts', function(response){ token = response.data[0].access_token; post_with_token(token); }); function post_with_token(token){ var message = $('#post_body').html(); var page_id = 'page_id'; fb.api('page_id/feed', 'post', { message : message, access_token : token}, function (response){ console.log(response); }); the error object in console says message: "(#200) user hasn't authorized application perform action" both apps , graph explorer have same permissions granted.is new permission asked. unable figure out problem is.correct me if wrong...

laravel - L5 Paypal Integration - Finding Controller method -

i trying integrate paypal laravel 5 site using package: http://packalyst.com/packages/package/netshell/paypal when go to: /paypal/checkout though, error: invalidargumentexception in urlgenerator.php line 561: action app\http\controllers\paypalcontroller@getdone not defined. this route: route::get('/paypal/checkout', [ 'as' => 'get-paypal-checkout', 'uses' => 'paypalcontroller@getcheckout' ]); and paypalcontroller: <?php namespace app\http\controllers; use app\http\requests; use app\http\controllers\controller; use paypal; use redirect; use illuminate\http\request; class paypalcontroller extends controller { private $_apicontext; public function __construct() { $this->_apicontext = paypal::apicontext( config('services.paypal.client_id'), config('services.paypal.secret')); $this->_apicontext->setconfig(array( 'mode' =...

c# - Get the field list of flat file connection? -

how write function (external function, c#, f# or powershell script, etc) list<string> getfields(string ssispackagename, string filesourcename); to field list of ssis package? since package xml file, can xquery used list? or better, more information, class field { public string name { get; set; } public string type { get; set; } } list<field> getfields(string ssispackagename, string filesourcename); @billinkc right, should keep data typing issues in mind. said, @ best retrieve code page , unicode values flat file connection manager itself. following code should started, might need lookups code page , data type attributes. string path = @"mypathto\package.dtsx"; xnamespace dts = "www.microsoft.com/sqlserver/dts"; xdocument doc = xdocument.load(path); // connections var connections = ele in doc.descendants(dts + "connectionmanager") ele.attributes(dts + "objectname").count() != 0 ...

liferay 6 - Sharepoint 2010 CMIS Integration -

i have been trying connect liferay 6.2 ee sharepoint 2010 using cmis. failing. steps followed - 1) install sharepoint connector 2) created user common in both sharepoint , liferay 3) activate sharepoint cmis producer 4) added repository these details - repository type - sharepoint site url - http://<domain>/_vti_bin/cmis/rest/<repo id>?getrepositoryinfo library name - <repo id> i able create repository no documents , folders being fetched. backend error - axisfault faultcode: {http://xml.apache.org/axis/}http faultsubcode: faultstring: (405)the service method invoked requires optional capability not supported repository. faultactor: faultnode: faultdetail: {}:return code: 405 no service point mapped request. {http://xml.apache.org/axis/}httperrorcode:405 (405)the service method invoked requires optional capability not supported repository. @ org.apache.axis.transport.http.httpsender.readfromsocket(httpsender.java:...

html - Bootstrap navbar responsiveness -

i'm having problem bootstrap navbar. have 3 links in left , 2 links in right. change min screen width of navbar 600px collapse problem after 768px, links stop moving/response screen change , 2 links right no longer visible before navbar collapse. how can fix this? or should change in getbootstrap.com/customize/ allow navbar further stick after 768px. thanks here navbar code <nav class = "navbar navbar-default navbar-fixed-top"> <div class = "container"> <div class = "navbar-header"> <button type = "button" class = "navbar-toggle collapsed" data-toggle = "collapse" data-target = "#navbar" aria-expanded = "false" aria-control = "navbar"> <span class = "sr-only">toggle navigation</span> <span class = "icon-bar"></span> <...

python - How do I set up a virtual environment with Flask using conda? -

i wish set virtual environment can use develop web applications using flask framework python (3.4.2, mac os). given instructions on how here , using virtualenv. however, trying follow these instructions ran problem: have python installed via anaconda , , upon trying: sudo easy_install virtualenv i warned should doing already-installed conda package instead. can't imagine conda way of doing things harder, want bogged down reading documentation, because might not emerge out of again... question is, what's quick way of setting virtual environment flask using conda? , how can add more dependencies mix? your mileage may vary, docs tends answers are. conda create -n my_flask_env source activate my_flask_env conda install condastuff pip install otherstuff

angularjs - Unable to set default selected option in selection tag -

i have encountered issue angular.js 1.4.0. can't set default in select tag if use 'number' work if use 'string'. select statement hard code in view. initialize model in controller. // not work, value passed 'number' $scope.colors = 2; // work, value passed 'string' $scope.colors='2'; view/model: <div ng-app="app"> <div ng-controller="mycontroller"> <select ng-model="colors"> <option value="1">red</option> <option value="2">blue</option> <option value="3">green</option> </select> <p>selected color: {{colors}}</p> <div ng-switch="colors"> <p ng-switch-when="1"><span class="red-block"></span></p> <p ng-switch-when="2"><span class="blue-block"></span></p> ...

c# - Binding property of usercontrol to data -

i'm not sure of correct terminology use. created windows store app year ago , main page created visual studio , never changed much. uses view model works fine don't know enough fix problems. anyhow... the page uses gridview display contents of collectionviewsource element reference observablecollection. works fine. datatemplate 1 of data items looks right now: <datatemplate x:key="topimagetiletemplate"> <grid minheight="135" width="350" margin="0" background="transparent"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="135"/> </grid.rowdefinitions> <textblock text="{binding path=imagepath}" fontsize="33"/> <usercontrols:waitingimagecontrol sourcepath="{binding path=imagepath}" grid.row="0" width="350" height="165...

JavaScript Date mismatch after being stored as string -

this question has answer here: javascript date object comparison 4 answers i cannot figure out why ls_a === a returning false in code below. seems when convert date string , date, being lost, what?? jsfiddle: http://jsfiddle.net/s6accbax/ var = new date(); localstorage.a = a.gettime(); ls_a = new date(parseint(localstorage.a)); console.log(a); // fri jun 12 2015 22:12:34 gmt-0600 (mdt) console.log(ls_a); // fri jun 12 2015 22:12:34 gmt-0600 (mdt) console.log(ls_a === a); // returns false!?!?! console.log(ls_a.gettime() === a.gettime()); // returns true expected duplicate of: javascript date object comparison this because ls_a different object a when call .gettime() getting string isn't compared object

php - Display multidimensional array dynamically -

i have array, array ( [part_number] => array ( [1] => "88888" [2] => "898989" [3] => "12312" [4] => "321321321" ) [manufacturer] => array ( [1] => "dell" [2] => "toshiba" [3] => "asus" [4] => "amd" ) [description] => array ( [1] => "i3 processor" [2] => "i5 processor" [3] => "i7 processor" [4] => "video card 4gb" ) [list_price] => array ( [1] => "450" [2] => "100" [3] => "100" [4] => "150" ) [net_price] => array ( [1] => "500" [2] => "120" [3] => "120" [4] => "200" ) [quantity] => array ( [1] =...

c++ - GDB Python APIs: Doesn't .parse_and_eval() make .cast() and .dereference() redundant? -

i not able understand utility of 2 gdb-python apis, value.cast() , value.dereference() . feel gdb.parse_and_eval() can same thing these 2 guys ( , more ). for example, can achieve value.cast("int*") gdb.parse_and_eval('(int*)value') , can achieve value.dereference() gdb.parse_and_eval(*value) . specifically have seen people use .dereference() dereference struct pointer some_struct_ptr.dereference()['some_var'] . here feel .dereference() not needed @ all. some_struct_ptr['some_var'] produces exact same output. am missing something? parse_and_eval not want. unlike other operations, exposed user's current language setting, , other things set print object . and, if have gdb.value other computation, using parse_and_eval means must convert string first -- can pain if pretty-printers involved, instead safety have convert long , string. it true dereference not needed if accessing member via pointer. gdb quirk got expos...

assembly - Why Masm32 only give 1 to 100 result for add and subtraction operation and beyond that I got wrong answer? -

i new assembly language. make code , run no errors far, except give result 1 - 100, here's code. this simple math operation addition , subtraction. tried analyzing code maybe in num1 db 10 dup (?) tried changing 10 100 still wont work. did miss something? .386 .model flat, stdcall option casemap :none include \masm32\include\masm32rt.inc .data msgec db "choose operation", 00ah, 0 msgadd db "addition 1", 00ah, 0 msgsub db "subtraction 2", 00ah, 0 msgex db "exit 3", 00ah, 0 msg db "addition", 00ah, 0 msgsub2 db "subtraction", 00ah, 0 msg1 db "enter 1st number:", 00ah, 0 msg2 db "enter 2nd number:", 00ah, 0 msg3 db "sum is:", 00ah, 0 msgdf db "diff is:", 00ah, 0 endl db 00ah, 0 msg4 db "try again[1/0]:", 0 .data? num1 db 10 dup (?) num2 db 10 dup (?) res sdword ? choice db 10 dup (?) choice2 db 10 d...

javascript - Hand up and down with parrallax effect -

i'm creating landing page selfmade application (its schoolproject). when load page see animation pops iphone in wrist. what i'm trying create parrallax effect. when scroll down, hand go down , when scroll hand go based on scrollspeed. at moment made work animations animate.css want step game adding parrallax effect. here can see how looks @ moment http://faces.jorendemaeyer.be you guys have idea's how can that? have checked out skrollr library? works , easy set up. github page ihatetomatoes.com has great tutorials , documentation started whatever might need. good luck!

java - Trying to change the Alignment of setText() method? -

i trying change alignment of "settext" method of "textview".to clear,on emulator i'm trying align set text of "settext".however unsuccessful in doing that.below posted code. <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textcolor="#ff00ff" android:text="@string/username" android:background="#00ff00" android:id = "@+id/text1" android:textcolorhighlight="#000000" android:textisselectable="true" android:textalignment="center" android:layout_alignparenttop="true"/> attached java code textview t1,t2; t1 = (textview)(findviewbyid(r.id.text1)); system.out.println(t1.tostring()); tablerow = new tablerow(getapplicationcontext()); t1 =new tex...