Posts

Showing posts from June, 2011

Facebook Update Status not working: FB pulling wrong data from page -

when paste url in update status on facebook, not pull right data meta open graphics. i've used fb's object debugger ( https://developers.facebook.com/tools/debug/og/object/ ) , appears working fine except when show preview: shows messy title. idea problem is? -richard

Use Gridstack or gridster for widget layout? -

i'm trying choose widget layout , have come across: gridstack: http://troolee.github.io/gridstack.js/ gridster: http://gridster.net/ enter link description here any 1 used these before can share pros , cons , features? gridster great library built ducksboard acquired time back. @ time, best of understanding, have ceased development , fork community not active. gridstack active project @ time. it's openly states inspired gridster , should offer same functionality, if not all, in time. gridstack not rebuild of gridster, however, , aims improve upon concept. example, supports responsive layouts, becoming vertical stack of widgets on smaller format screens . gridstack way go if you're looking library these days.

java - Need to remove extra square brackets in the string -

static arraylist<string> coordinates = new arraylist<string>(); static string str = ""; static arraylist scribbles = new arraylist(); coordinates.add("string placed, string not placed"); string codchange = coordinates.tostring().replaceall(", ", ""); stringbuffer sb = new stringbuffer(codchange); sb.insert(1,"m "); arraylist alistnumbers = new arraylist(arrays.aslist(sb.tostring())); system.out.println("coordinates: " + alistnumbers.tostring().replaceall("\\[|\\]", "")); scribbles.add(alistnumbers); str = scribbles.tostring(); system.out.println("string: " + str); output: coordinates: m string placedstring not placed string: [[m string placedstring not placed]] i want string: appear single square brackets like: string: [m string placedstring not placed] since there 2 different replacement required. use below code string s = "[[m string pla

sed regex cannot get first match -

i give up... of following 15 sep 1605.00 (spx1530u1605-e),0.25,0.0,0.05,0.10,0,87 i want extract number 1530 out of blob. "spx" can combination of capital letters [a-z] , varies in length, (e.g. goog, fb). there capital letter following number, in "u" in example. below gets second number, 1605. i'm @ loss on how extract 1530. echo "15 sep 1605.00 (spx1530u1605-e),0.0,0.0,266.10,284.60,0,0" | \ gsed -r 's/.*[a-z]([0-9].*)[-][a-z].*/\1/g' it acceptable perform operation on string "spxw1530i1605-e" rather entire line. usually grep tool of choice when want extract data. can use gnu grep, offers perl compatile regular expression when pass -p option: grep -op '\([a-z]+\k[0-9]+' file we searching literal ( followed 1 or more capital (ascii) letters. using \k cleans match buffer. (nice, isn't it?) following numbers final match.

rspec - Capybara: get selected radio button using webkit or poltergeist -

it's easy enough selected radio button capybara using rack_test driver. # rack_test page.set('input_id') # => "checked" page.find('[checked]') # => #<capybara::node::element tag="input" path="/html/body/p[1]/label[1]/input"> however, doesn't work webkit or poltergeist. # webkit or poltergeist page.set('input_id') # => "" page.find('[checked]') capybara::elementnotfound: unable find css "[checked]" i've tried using #selected? method, doesn't seem working radio button. # driver page.set('input_id') page.all('input').select(&:selected?) # => [] how can checked radio button capybara in webkit or poltergeist? you running difference between attributes , properties in js supporting browsers. you've done in rack-test works because knows attributes. find checked input in other browsers do find('input:checked') or thing

google project tango - Unity Video Overlay Issues -

i have used arscreen.cs script , ar_screen shaders augmentedreality scene provided in getthehub. the gui shows perfectly, background/video overlay displays else draws on video , stains. video overlay , gpu acceleration options enabled on tango manager, ux script enabled options disabled. any advice regarding having 3d objects render normal (exactly markups in unity example project) thanks solved! enable ux script's options, set culling of main camera, camera using arscreen.cs script solid color white, , in arscreen.cs commented out command/call //_updatetransformation(timestamp); in case... apparently _updatetransformation command placed camera far player's object , objects not visible , seemed if video overlay covered seen.

php - Store and add value to variables -

i'm new php , wanted make basic slot machine, when winning number equal user number "money" variable (fake money) doesn't add +10. stays @ 50. i have made if statement , user number generated rand() , $currentvalue = $money + 10; isn't working. i'm doing wrong, what? example of if statement: if($winnr == $usrnr) { echo 'you won!'; $currentvalue = $money + 10; } else { echo 'oops, try again'; echo '<button onclick="window.location.reload()">try again</button>'; $currentvalue = $money - 10; } assuming have way store $money between page calls (i.e. session), here's how save it if($winnr == $usrnr) { echo 'you won!'; $money += 10; } else { echo 'oops, try again'; echo '<button onclick="window.location.reload()">try again</button>'; $money -= 10; }

Android "hello world" app in C++ without JNI -

i want write simple "hello world" gui (not cli) app in c++ , run on android device. tried hello-jni sample android ndk package, uses java code , want in pure c++ way, without jni. possible or have to use java wrapper? it nice old way – without eclipse, c++ code file + makefile. all traditional android apps, particularly user interface, need activity can launched user home screen's launcher, , activity has in java. ndk developers welcome use nativeactivity activity , developers not have mess java themselves. there a sample app demonstrating use part of documentation. it nice old way – without eclipse, c++ code file + makefile. you don't have use eclipse, , eclipse support ending in ~3 months anyway, have use android sdk , ndk toolchains create apk file, if trying create traditional android app.

Convert a large javascript file into multiple files -

my question: how 1 best go breaking large, monolithic javascript object literal multiple, discrete, files? i have single javascript file consists of object literal many methods attached it. it's getting quite long , want break smaller parts can more managed. i've heard can use amd or commonjs organize things, i've heard should use requirejs, should use webpack or browserify, should use number of other tools/techniques. after looking @ these things confused best approach is. how it? how take single object literal consisting of few thousands lines of javascript (made of functions "search" , "login" , "user") , reorganize multiple files more dealt group of developers? single, giant file thing getting unwieldy , options seems varied , unclear. simple app uses vanilla js, little jquery , sits on top of grails backend. i think question pretty clear if need code @ here example of sort of object literal talking about: var myobj = { f

Using AngularJS inside Rails framework. "ng-repeat" is working, but "ng-submit" is not -

my data being displayed controller. "ng-repeat" works fine when displaying data, "ng-submit" not adding new data model using following code: pages.js.coffee @pagescontroller = ($scope) -> $scope.entries = [ {name:"larry"} {name:"curly"} {name:"mo"} {name:"ralph"} ] $scope.addentry = -> $scope.entries.push($scope.newentry) $scope.newentry = {} index.html.erb <div ng-controller="pagescontroller"> <h1>angular & rails</h1> <form ng-submit="addentry"> <input type="text" ng-model="newentry.name"> <input type="submit" value="add"> </form> <ul> <li ng-repeat="entry in entries"> {{entry.name}} </li> </ul> </div> function have execute it, addentry()

linux - Is there a way to detect the terminal program that someone is using in bash -

i'm trying make bash script behaves differently based on terminal program using (putty, mobaxterm, etc). there way retrieve kind of information bash script? i searching around online not able find (or i'm wording incorrectly, distinct possibility). thank you you need understand these terminal emulators . there simple, crude identification function (most?) modern line terminals (now that's oxymoron!) return vt102 or xterm i.e. whatever emulator emulating; not identity of program performing emulation. incidentally, used when session initiated, , reflected in value of $term environment variable.

Rails does not propagate Java exception to ApplicationController -

i have rails website, , models cause backend service. have rescue_from standarderror in applicationcontroller, can capture rails exception, cannot capture exceptions backend service. applicationcontroller: class applicationcontroller < actioncontroller::base rescue_from standarderror |exception| # end end actual controller: class statementscontroller < applicationcontroller def show # statement respond_to :js end end if "raise 'error message'" inside show method, applicationcontroller's rescue method can capture error. if statement encounters service exception backend service, applicationcontroller cannot catch it. however, if do class statementscontroller < applicationcontroller def show # statement respond_to :js rescue standarderror => e # don't need write code here end end then applicationcontroller can catch java exception. new rails. can me this? thanks

Creating image asset in Android Studio -

Image
i trying create image asset in android studio. facing problem @ 2 levels. first, when launch asset studio , select image asset type set 'launcher icon', asset created inside mipmap folder instead of drawable folder. so changed asset type 'action bar , tab icons'.but causes image appear white blocks. please advise supposed do. about first problem, behavior correct.you have save ic_launcher in mipmap folder see android documentation the 'action bar , tab icons' icons only, , icons defined android use 1 color

Setting the wallpaper in Windows using Java -

i'm trying set wallpaper in windows 7 using java. i've tried using code answers here , here . works in windows 8 , 10, not in 7. there no errors, doesn't anything. i've tried setting different 1920x1080 wallpapers (that's resolution set in control panel) , different file formats (png, jpg, bmp) , running program on few different computers. code have after line that's supposed set wallpaper runs fine. i'm using jna version 4.2.0 , java 8 update 60. is there way can set wallpaper in windows 7 using java? edit: here's code: import java.util.hashmap; import com.sun.jna.native; import com.sun.jna.platform.win32.windef.uint_ptr; import com.sun.jna.win32.stdcalllibrary; import com.sun.jna.win32.w32apifunctionmapper; import com.sun.jna.win32.w32apitypemapper; public class wallpaperchanger { public interface spi extends stdcalllibrary { long spi_setdeskwallpaper = 20; long spif_updateinifile = 0x01; long spif_sendwinin

python db connectivity with mysql -

i using sql workbench, php code in tools of workbench db connection is: $host="215.157.120.106"; $port=3386; $socket=""; $user="root"; $password=""; $dbname="pay"; $con = new mysqli($host, $user, $password, $dbname, $port, $socket) or die ('could not connect database server' . mysqli_connect_error()); //$con->close(); i want query in python. attempt: import mysqldb db = mysqldb.connect(host="215.157.120.106",user="root",db="pay",port=3386,passwd="") but gives error: operationalerror: (1045, "access denied user 'root'@'16.95.57.211' (using password: no)")

php - import Sakila Database to PhpMyAdmin -

i want import sakila db phpmyadmin in windows can't , can import schema phpmyadmin in import section cant import sakila data , when i'm getting following error - no data received import. either no file name submitted, or file size exceeded maximum size permitted php configuration. see faq 1.16. go through link. mysqli dump example if database file more 2mb have use command prompt. mysql -u username -p password use databsname source path-to-sql-file (e:/folder/file.sql)

Want to display correct answer and player selected answer at the end of android quiz game -

i have quiz app consists of question & 4 buttons options. @ end of quiz, app displays correct answers questions. want display correct answer , player selected answer @ end of quiz. here's code working display answers. public static string getanswers(list<question> questions) { int question = 1; stringbuffer sb = new stringbuffer(); (question q : questions){ sb.append("q").append(question).append(") ").append(q.getquestion()).append("? \n"); sb.append("answer: ").append(q.getanswer()).append("\n\n"); question ++; } return sb.tostring();} and quesactivity is: private void setquestions() { //set question text current question string question = utility.capitalise(currentq.getquestion()) + "?"; textview qtext = (textview) findviewbyid(r.id.question); qtext.settext(question); //set available options list<string> answers = currentq.getquestionoptions(); btn1 =

css - Media query for fullscreen -

i use following media query apply css overrides in fullscreen mode: @media (device-width: 100vw) , (device-height: 100vh) { .content { padding: 0px !important; } } in works in firefox unreliable in chrome (both latest versions on windows 7 x64). can try apply overrides when not in fullscreen mode need invert query. questions are: should chrome support query? how negate (logical not)? p.s. my viewport declared this: <meta name="viewport" content="width=device-width, initial-scale=1.0"/> it might less elegant, more robust, listen full screen event, perhaps add is-fullscreen class body can write rule this: body.is-fullscreen .content { padding... for example: document.addeventlistener('fullscreenchange', function() { document.body.classlist.toggle('is-fullscreen', document.fullscreenenabled); }); this event has vendor-prefixed versions, make sure you're using one(s) need.

javascript - How to refine Synthetic Events in Flow? -

so have handler accepts different kinds of syntheticevent s code: defaultprops = { events: [ 'mousemove', 'keydown', 'wheel', 'dommousescroll', 'mousewheel', 'mousedown', 'touchstart', 'touchmove', 'mspointerdown', 'mspointermove', ], element: (typeof window === 'undefined' ? 'undefined' : typeof window) === 'object' ? document : {}, } componentdidmount() { this.props.events.foreach((eventname: string) => { if (this.props.element) { this.props.element.addeventlistener( eventname, this.handleevent(),

python - How to get a syntax tree with comments? -

i'm trying create documentation generator several languages. need ast, in order known that, instance, comment class , 1 method of class. i started write simple python code display tree recursively looking on it: import sys import antlr4 ecmascriptlexer import ecmascriptlexer ecmascriptparser import ecmascriptparser def handletree(tree, lvl=0): child in tree.getchildren(): if isinstance(child, antlr4.tree.tree.terminalnode): print(lvl*'│ ' + '└─', child) else: handletree(child, lvl+1) input = antlr4.filestream(sys.argv[1]) lexer = ecmascriptlexer(input) stream = antlr4.commontokenstream(lexer) parser = ecmascriptparser(stream) tree = parser.program() handletree(tree) and tried parse javascript code, antlr ecmascript grammar : var = 52; // inline comment function foo() { /** foo documentation */ console.log('hey'); } this outputs: │ │ │ │ └─ var │ │ │ │ │ │ └─ │ │ │ │ │ │ │ └─ = │ │ │ │ │ │ │ │

java - How to place marker snippet & click listeners on OSMdroid map app? -

Image
i tried following link , managed put custom tileserver, polyline & marker couldn't find integrating polygon, marker snippet & click listeners. source code extends several classes (looks complicated) , unable fetch code each controls clearly. any appreciated, thanks

javascript - How to keep fields selected values after page reload in jquery UI -

i want keep selected values after page refresh, using jquery ui selectable https://jqueryui.com/selectable/ here's code sample of jquery selectable <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jquery ui selectable - default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery- ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <style> #feedback { font-size: 1.4em; } #selectable .ui-selecting { background: #feca40; } #selectable .ui-selected { background: #f39814; color: white; } #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; } </style> <script s

r - merge with condition on two dataframes -

similar unanswered question here: merge 2 dataframes condition on timestamp question more general , not time-series specific i have 2 dataframes want merge proximity condition on 2 columns both dataframes. in sql have done like select * (select * a) t1 inner join (select * b) t2 on t1.user = t2.user , t1.label - t2.label < 2 what i'm looking canincal way above in r, like- merge(x,y,by='user', condition = x$label - y$label <=2 ) so following should without rows 3,7,11,12,13,15 etc.... set.seed(1212) <- data.frame(user=rep(paste("u",1:3,sep=''),4),label=sample.int(10,12,t)) b <- data.frame(user=rep(paste("u",1:3,sep=''),4),label=sample.int(10,12,t)) merge(a,b,by='user') user label.x label.y 1 u1 3 1 2 u1 3 3 3 u1 3 10 4 u1 3 5 5 u1 3 1 6 u1 3 3 7 u1 3 10 8 u1 3 5 9

javascript - Loop Rotation on any axis for a 3D obj Three js -

i trying make imported 3d object rotate continuously on axis classic cube, sphere etc.. don't work, not moving @ , don't understand why. here code: var scene6, camera6, renderer6, light, shipmtl, shipobj; function init() { scene6 = new three.scene(); camera6 = new three.perspectivecamera(35, 1, 1, 1000); camera6.position.z = 400; //lights light = new three.pointlight(0xffffff, 2, 0); light.position.set(200, 100, 300); scene6.add(light); //3d model shipmtl = new three.mtlloader(); shipmtl.load('../models/spacecraft1.mtl', function(materials) { materials.preload(); shipobj = new three.objloader(); shipobj.setmaterials(materials); shipobj.load('../models/spacecraft1.obj', function(object) { object.scale.set(10, 10, 10); object.rotation.x += .01; scene6.add(object); }); }); renderer6 = new three.webglrenderer({ canvas: document.getel

Sharing folder via batch script on french windows -

this batch script use automatically share specific folder "everyone". might have noticed have first extract name in current installed language. french version correct string "tout le monde" (everyone). problem word "tout" , after space ignored. c:\windows\system32>net share sharedfolder="c:\temp\sharedfolder" /grant:tout,full result folder not shared. know how improve script in order full name spaces? set mysid=s-1-1-0 /f "delims= " %%a in ('"wmic path win32_account sid='%mysid%' name"') ( if not "%%a"=="name" ( set myvar=%%a goto :loop_end ) ) :loop_end net share sharedfolder /delete /y net share sharedfolder="c:\temp\sharedfolder" /grant:%myvar%,full icacls "c:\temp\sharedfolder" /t /c /q /grant:r *%mysid%:(oi)(ci)f icacls "c:\temp\sharedfolder" /t /c /q /inheritance:e pause it have been helpful if you'd shown act

visual c++ - C++ if statements in windows forms -

i'm trying make program tells zodiac sign.i have 2 text boxes day , month , button , , richtextbox output. cannot if statements work, richtextbox shows same thing every input . example says capricorn if day 5 , month 7. so, how can make if statements work? i'm new c++ windows forms, , visual studio, , know it's useless program, want know how these things work. here code inside button: private: system::void button1_click(system::object^ sender, system::eventargs^ e) { string ^ input = textbox2->text; string^inputday = textbox1->text; int luna; int day; luna = convert::toint32(input); day = convert::toint32(inputday); {if (luna == 1 && day < 20) { richtextbox1->text = "your sign capricorn "; } else { richtextbox1->text = "your sign aquarius"; }} { if (luna == 2 && day < 19) { richtextbox1->text = "your sign aquarius"; } else { richtextbox1->

broadcastreceiver - Service does not send broadcast to Activity -

i have made app listens copies user makes in other apps , pastes text activity. service use listening copies works great recognizing copied text when want send broadcast activity, "onreceive" method not called. this service code listening , sending data activity: @override public int onstartcommand(intent intent, int flags, int startid) { cm = (clipboardmanager) getsystemservice(clipboard_service); cm.addprimaryclipchangedlistener(this); return start_sticky; } @override public void onprimaryclipchanged() { string copiedtext = cm.gettext().tostring(); mydynamictoast.informationmessage(getapplicationcontext(), copiedtext); intent sendcopy = new intent(getapplicationcontext(), createnoteactivity.class); sendcopy.putextra("copiedtext", copiedtext); localbroadcastmanager.getinstance(getapplicationcontext()).sendbroadcast(sendcopy); } and @ activity: private val receivecopy = object : broadcastreceiver() { override

oop - Class enumeration setter, convention javascript -

hi have following class: const myclass = function myclass() { this.state = null; } myclass.prototype.set = function(key, value) { this[key] = value; } and following enum in other module: const enumeration = { active: 'active', pending: 'pending', done: 'done' } i know best practices / conventions handle setter enumerations properties (state here) i this: let myclass = new myclass(); myclass.set('state', enumeration.pending); but bit verbose, , need know myclass module , enum module. other idea that: const myclass function myclass() { this.state = null; } myclass.prototype.setpending = function() { this.state = enumeration.pending; } and allow call myclass.setpending() don't know right naming of kind of setters. first argue question not opinion-, needs-based . if preference-based, means have not encountered issues best practices established avoid. in mind, first best practice keep simple pos

Proper naming convention for html elements -

i name html elements prefix btn buttons, txt textbox, chk checkbox, rad radio buttons, etc. however, 1 of colleague pointed out not proper way it. said should not use prefix, instead name saverecord submit button instead of btnsaverecord . my point of doing can knew element defined on situation, example: for php: if (isset($_post["btnsaverecord"])) for coldfusion: <cfif structkeyexists(form, "btnsaverecord")> is there common-majority practice on how name these elements?

multithreading - Java Unisex Bathroom monitor -

i have solve problem monitor locks. did code need advice logic. in output example seems checks case of 1 person occupied bathroom , other 1 waiting turn (i'm sorry english, trying discribe can). here output: man 0 enters bathroom man 0 in bathroom man 0 exits bathroom man 0 enters bathroom man 0 in bathroom man 0 exits bathroom woman 1 enters bathroom woman 1 in bathroom man 2 in waiting------------>>>> woman 1 exits bathroom man 2 in bathroom man 2 exits bathroom woman 2 enters bathroom woman 2 in bathroom woman 2 exits bathroom and here code of 4 functions. public void woman_wants_to_enter(int i) throws interruptedexception { lock.lock(); try { if (occupiedcount < numberoftoilets) { if (menusingn == 0) { if (womenwaitingn == 0) { system.out.println("woman " + + " enters bathroom "); womenusingn++; occupiedcount++;

java - Method Overloading for null argument -

i have added 3 methods parameters: public static void dosomething(object obj) { system.out.println("object called"); } public static void dosomething(char[] obj) { system.out.println("array called"); } public static void dosomething(integer obj) { system.out.println("integer called"); } when calling dosomething(null) , compiler throws error ambiguous methods . issue because integer , char[] methods or integer , object methods? java try use specific applicable version of method that's available (see jls §15.12.2 ). object , char[] , integer can take null valid value. therefore 3 version applicable, java have find specific one. since object super-type of char[] , array version more specific object -version. if 2 methods exist, char[] version chosen. when both char[] , integer versions available, both of them more specific object none more specific other, java can't decide 1 call. in case you'l

How to fill the div elements with javascript/jquery -

i have code showing data mysql. can fill divs innerhtml, when use += concates values in array. need create new elements in div. how should implement it? jquery(document).ready( function() { $(".dropdown-item").click( function() { var data = { action: 'get_data', id: $(this).attr('id') }; var parent= document.getelementbyid('info-block bg-grey m-b-2 p-a'); var name = document.getelementsbyclassname('h4 underline-sm')[0]; var job = document.getelementsbyclassname('m-b-1')[3]; var phone=document.getelementsbyclassname('m-b-0')[6]; var image= document.getelementsbyclassname('col-sm-4 text-xs-right m-b-1')[0]; jquery.ajax({ cache: false, url: '/wp-admin/admin-ajax.php', data: data, datatype:'json', method: 'post', success: function(response) { $.each(response, function(key, value){

java - How can i return variable "realImage" which is within onComplete method? -

i've created asynctask in activity , want return variable "realimage" asynctask cant seem access it... public class photoutils { public static photo getimage(string id) { unsplash.getphoto(id, new unsplash.onphotoloadedlistener() { @override public void oncomplete(photo photo) { photo realimage=photo; } @override public void onerror(string error) { } }); return realimage; //this line shows error cannot resolve symbol realimage } } this async task in other activity public class imagetask extends asynctask<photo,void,photo> { @override protected photo doinbackground(photo... photos) { intent intent=getintent(); bundle bd=intent.getextras(); string getid = (string) bd.get("id"); photo finalphoto=photoutils.getimage(getid); return finalphoto; } @ov

android - How to use Facebook deep linking in react-native app? -

Image
i'm trying use deep linking authorize user through facebook oauth. i send user browser via https://www.facebook.com/v2.10/dialog/oauth?&client_id=x&scope=y&redirect_uri=myappname://authorize but gives me: how solve this? please!

Error in Android View documentation? (MeasureSpec and LayoutParams) -

from android view documentation ( emphasis mine): the measure pass uses 2 classes communicate dimensions. view.measurespec class used views tell parents how want measured , positioned. base layoutparams class describes how big view wants both width , height. but measurespec documentation states that a measurespec encapsulates layout requirements passed parent child. and layoutparams documentation states that layoutparams used views tell parents how want laid out. this seems contradictory me. there error in view documentation? should italicized view.measurespec replaced viewgroup.layoutparams ?

android - How can I know my app was previously installed on a phone? -

i trying make app allows single account per device. trying know property of phone never changes. @ first thought save mac address of device in database read in 1 of question on know in android when try access mac address programatically constant same every device. know never changing property of android device can access programatically. also in future develop app ios, there same non changing property of ios phone can access programatically ? thank you. for purpose, have differentiate between devices. for android, can use device id for ios, can use vendor id link . for ios : when app deleted , reinstalled vendor id changes better store vendor id in keychain using below code. -(nsstring *)getuniquedeviceidentifier { nsstring *yourappname=[[[nsbundle mainbundle] infodictionary] objectforkey:(nsstring*)kcfbundlenamekey]; nsstring *applicationuuidstr = [sskeychain passwordforservice:appname account:@“your_app_name”]; if (applicationuuidstr == nil) { applic

How to get category list in wordpress -

get_the_category_list(); wp_list_categories(); above functions not working in project. can't new created categories in wordpress. https://developer.wordpress.org/reference/functions/get_terms/ i recommend using get_terms $terms = get_terms( 'category', array( 'hide_empty' => false, ) );

mysql - Workflow Process - if all records are approved create new row -

i trying write query need check if multiple records in same stage insert new one, if records aren't in same stage should nothing. example table records: recordid stageid 1 3 1 2 5 3 7 3 7 3 when recordid has met condition if multiple records in same stage should insert new records this recordid stageid 5 4 7 4 i think phrased insert ... select should work here. select query below finds records of stages same, , returns corresponding recordid along current stage incremented one. note can take max (or min , or aggregate) here because stage values same such matching records. insert yourtable (recordid, stageid) select recordid, max(stageid) + 1 yourtable group recordid having min(stageid) = max(stageid)

python - Pydrive backend not working with duply -

i'm unable duply / duplicity work pydrive on mac , can't seem work out what's going wrong. i'm getting error --- start running command bkp @ 10:38:21.000 --- backendexception: pydrive backend requires pydrive installation. please read manpage setup details. exception: no module named httplib2 10:38:25.000 task 'bkp' failed exit code '23'. --- finished state failed 'code 23' @ 10:38:25.000 - runtime 00:00:04.000 --- i'd found question answer still unable work. i've followed advice still no luck. i've got pydrive config file in local duply directory , permissions set correctly. $ ls -la total 48 drwx------ 8 enwhat staff 272b 26 mar 2016 . drwx------ 3 enwhat staff 102b 16 mar 2016 .. -rw------- 1 enwhat staff 7.6k 20 mar 2016 conf -rw------- 1 enwhat staff 462b 18 mar 2016 exclude -rw------- 1 enwhat staff 303b 26 mar 2016 gdrive -rw------- 1 enwhat staff 858b 10 sep 2016 gdrive.cache -rw------

php - Get data from table and Insert into another table from while loop -

Image
i having little issue getting data table while loop. want simple want take data table cart cookie value table orders matches cookie value , query tables cart extract data matches cookie value in cart table , place them in table orders_final . . final part after querying cart table cookie value gotten order table, want place data orders_final table matches cookie value order , cart $zomo = $_cookie['shopa']; // cookie stored in cart table , updated when transaction successful $get_products = "select * `cart` cookie_value = '$zomo'"; $limo = mysqli_query($con, $get_products); while($colo = mysqli_fetch_array($limo)){ $product_id = $colo['product_id']; $order_quantity = $colo['order_quantity']; $cookie_value = $colo['cookie_value']; //var $dance when update table data after payment , data gotten payment processing company $dance = "update `orders` set `status`='$r_status',`time`='$r_time&#

javascript - Change output of function object to state its name -

i trying basic lambda calculus in javascript , using node repl. define identity , mockinbird combinator , run mockingbird combinator identity combinator input. i = f => f m = f => f(f) m(i) the mockinbird combinator identity combinator input yields identity combinator. last line gives following output. [function] but more useful, in case, if outputted following. [function: i] this way can see function being printed. have seen done in youtube video: https://www.youtube.com/watch?v=3vq382qg-y4 does have idea how achieve this? newer versions of node.js (at least v6+, maybe earlier). if don't want upgrade, define inspect method, node.js use when inspecting: function.prototype.inspect = function () { return "[function: " + this.name + "]"; }

R from command line, view window with all variables with values -

i use r , matlab command line , edit files external editors. in matlab, command workspace opens graphical window list of variables and current values . if double click on complex object, matrix, matlab automatically opens window table containing values. is there similar way in r? in this link , in end of first "box", listed command browse.workspace , seems looking for. unfortunately cannot invoke it. i tried commands prints output in terminal (like str(as.list(.globalenv)) ) not result. when have got lot of variables big mess.

javascript - Passing the data from AngularJs Service to Controller and Controller to Controller -

currently able pass value angularjs service angular controller, doing calculation in 1 controller , want pass controller , can please me service name : detailservice controller 1 : fromservice controller 2 : barctrl in below code getting values detailservice fromservice controller and in fromservice controller evaluating value array $scope.valuessendtograph i wanted send $scope.valuessendtograph barctrl controller , can please me , how approach problem angularjs code var app = angular.module('myapp', ["chart.js"]); app.service('detailservice', function($http, $filter, $q) { return { getinfo: function() { return $http({ method: 'post', url: 'myjson.json' }).then(function(response) { msoresponsearray = response.data; var passbycompanyarray = []; var failbycompanyarray = []; var wipbycompanyarray = []; var releasenamearray = []; var totalcountarray

swift - tableview constraints to optimal window width -

Image
i working swift 4 macos , have trouble constraints in nstableview. i have tableview: you can see, textfields not use complete width of tableview. fill complete width textfields, red textfield should larger width this: but doesn't work yet :( example: https://drive.google.com/open?id=0b8pbtmqt9gdore1xsuuxevfawvu can me? you describing nsstackview. it's view distributes arranged subviews you, in accordance configuration. want fill configuration red text field has lower content hugging priority other fields, alone can stretch.

Remove duplicate element from vector of vectors c++ -

i'm trying remove duplicated item bigger vector ex: 6 11 7 8 6 16 17 i should get: 6 11 7 8 16 17 what have: vector<vector<int>>b; vector<vector<int>>::iterator b_list; vector<vector<int>>::iterator b_it; vector<int>::iterator b_list_it; vector<int>::iterator b_it_it; (b_list = b.begin(); b_list != b.end()-1; ++b_list) { (b_it = b_list+1; b_it != b.end(); ++b_it) { (int = 0; < (*b_list).size(); ++i) { (int j = 0; j < (*b_it).size(); ++j) { if ((*b_list)[i] == (*b_it)[j]) { if ((*b_list).size() > (*b_it).size()) { (*b_list).erase((*b_list).begin()); } if ((*b_list).size() < (*b_it).size()) { (*b_it).erase((*b_it).begin()); }

How to pass to Spring parameter by @Query, sql isn't working -

i'm using spring 4, postgresql , eclipselink. i build query db, passing 2 parameters. i'm having these troubles : call: select n.id, n.volume, n.numero numberentity n n.volume = :volume , n.numero = :numero query: readallquery(referenceclass=numberentity sql="select n.id, n.volume, n.numero numberentity n n.volume = :volume , n.numero = :numero")] root cause org.postgresql.util.psqlexception: errore: errore di sintassi o presso ":" posizione: 70 @ org.postgresql.core.v3.queryexecutorimpl.receiveerrorresponse(queryexecutorimpl.java:2103) @ org.postgresql.core.v3.queryexecutorimpl.processresults(queryexecutorimpl.java:1836) @ org.postgresql.core.v3.queryexecutorimpl.execute(queryexecutorimpl.java:257) @ org.postgresql.jdbc2.abstractjdbc2statement.execute(abstractjdbc2statement.java:512) @ org.postgresql.jdbc2.abstractjdbc2statement.executewithflags(abstractjdbc2statement.java:388) @ org.postgresql.jdbc2.abstractjdbc2statement.