Posts

Showing posts from September, 2011

javascript - Getting Instagram feed to my website -

i wondering how instagram feeds on website. have tried if include embed code, working specific feed only. here need is; feeds of instagram website instead of specific feed. code tried lies here <blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="7" style=" background:#fff; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#f8f8f8; line-height:0; margin-top:40px; padding:50.0% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,ivborw0kggoaaaansuheugaaacwaaaascamaaaapwqozaaaabgdbtueaalgpc/xhbqaaaafzukdcak7ohokaaaamuexurczmzpf399fx1+bm5mzy9amaaadisurbvdjlvzxbesmgces5/p8/t9furvcrmu73jwlzosgsiizurcjo/ad+eqjjb4hv8bft+idpqocx1wjosbfhh2xssxeiy

php - Only change the quantity when product already exists in database -

i have problem kind of 'webshop' i'm building add products in database want change quantity when product exists. i don't know how achieve this. can maybe me function check if product exists can add +1 ['aantal'] everytime add product exists? the post is: if(isset($_post['submit-bonbon'])){ $postgewicht = $_post['gewicht']; $bonbonname = $_post['product']; $image = $_post['afbeelding']; $quantity = $_post['aantal']; $jsondata = unserialize($_session['json_data']); if(count($jsondata,1) >= 1){ $jsondata['bonbons'][] = array('gewicht' => $postgewicht,'name' => $bonbonname,'afbeelding' => $image, 'aantal' => $quantity); } else { $bonbonsarray[] = array('gewicht' => $postgewicht,'name' => $bonbonname,'afbeelding' => $image, 'aantal' => $quantity); $order =

blpapi - Why do I get less securities than request in RefData? -

i requesting refdata bloomberg api via c#. i create list of 912 securities. but final "response" message after 92. why might be? bloomberg split responses large requests each partial_response event contain data multiple securities. currently, looks each event contain data 10 securities, not rely on number staying same seem remember few years ago 8.

mongodb - Multiple $and with multiple $or in $match mongoose -

expected condition if(pid==req.session.pid && ((status==0 && statusdate1>=somedate)||(status==1 && statusdate2>=somedate)|| (status==2 && statusdate3>=somedate)||(status==0 && statusdate1>=somedate))) i have tried writing below $match statement meet above condition, reason not expected. var match = { $match: { $and: [ { practiceid: req.session.p_id }, { $or:[{status : 0, statusdate1:{$gte:somedate}}] }, { $or:[{status : 1, statusdate2:{$gte:somedate}}] }, { $or:[{status : 2, statusdate3:{$gte:somedate}}] }, { $or:[{status : 3, statusdate4:{$gte:somedate}}] }] } } could please point me in right direction? update tried below versions, still did not expecting. attempt 1 var match = { $match: { $and: [ { practiceid: req.session

c# - How do I list the available labels of a Project? -

it's first time develop .net winforms application using vault client api functionalities. want use vault client api list of labels per project. i found method serveroperations.processcommandfindlabels() in vaultclientintegrationlib.dll don't have clue how parameters should successful result. any appreciated. after many attempts can labels of project running code below. i added 2 dll's (vaultlib.dll , vaultclientintegrationlib.dll) under references in visual studio project , added 2 using statements (in class) using vaultlib; using vaultclientintegrationlib; i've added following code in static method serveroperations.client.loginoptions.url = url; serveroperations.client.loginoptions.user = user; serveroperations.client.loginoptions.password = pass; serveroperations.client.loginoptions.repository = rep; serveroperations.login(); serveroperations.client.autocommit = true; string prjpath = "$/projectpath"; vaultlabelitemx[] arlabelitems

html - Update template of component from typescript with Angular2 -

i have div add dynamically html code , take code html save in database (database spring). then code html saved inside database problem operations used update dynamically div example have inline ckeditor divs or insert other divs not work when code code database. so ask if way update template of component typescript because using this: $('#content').html(this.section.content); with jquery this angular2 way perform html binding : <div id="content" [innerhtml]="this.section.content"> </div>

How can I get the specific definition of battery status in Android? -

as far know, there 7 values recorded in android. according this page, are: int battery_health_cold int battery_health_dead int battery_health_good int battery_health_overheat int battery_health_over_voltage int battery_health_unknown int battery_health_unspecified_failure however, page not tell me specific condition of battery. for example, how hot battery - called battery_health_overheat ? in situation android return battery_health_dead ? does document write down definition?

android - Reply to Reviews API | Google Play Developer API -

i working on creating web/app company (in free time) provide access our customers retrieve , reply google reviews apps have published them. google has released reply reviews api should work this. i haven't been able figure out gaining access portion. i'm trying use service account. i've created oauth2 service account, granted access, downloaded private key, , tired follow sample provided here (below). i know in example using plus service. questions are, service supposed using? i'm assuming plus service not want. is generating certificate way correct way auth_token (in reply reviews api documentation)? thanks help! using system; using system.security.cryptography.x509certificates; using google.apis.auth.oauth2; using google.apis.plus.v1; using google.apis.plus.v1.data; using google.apis.services; namespace google.apis.samples.plusserviceaccount { /// <summary> /// sample demonstrates simplest use case service account service. /// certificate nee

Matlab after enter Ctrl+c, Can we execute some code or calling a function? -

sometimes, matlab code may run long time. want stop - enter ctrl+c, want execute code after that. e.g. for = 1:100000, m(i) = function(i,values); end even if loop not over, stop ctr+c or abnormal situation etc. want call function other process. n = new_func(m) save(n) take in oncleanup object. create oncleanup object giving code you'd run when code finishes - , whether code finishes naturally, error, or ctrl-c. there's small restriction on use - needs used within function, not script (because executes code when oncleanup object goes out of scope , deleted, rather when code ends). that's not of restriction.

csv - Python: Parse string objects into python objects from a file -

Image
i've got .csv file , need information it. if open file, can see 2 lines in it, says "data" , "notes", , need information these 2 variables have. when open .csv file, shows these lines: data = [0,1,2,3,4,5,3,2,3,4,5,] notes = [{"text": "hello", "position":(2,3)}, {"text": "bye", "position":(4,5)}] to open file use: import csv class a() def __init__(self): #some stuff in here def get_data(self): file = open(self.file_name, "r") data = csv.reader(file, delimiter = "\t) rows = [row row in data] now, read information in data, write: line in row[1][0]: try: value_list = int(line) print value_list except valueerror: pass and, can create list these values , print it. now, need read data "notes", can see, list dictionaries elements. need do, read "position" element inside each dictionary , prin

javascript - URL anchor hash, then open a tab using another id via URL -

i need url parameter select section via hash id (#features) , open tab #2 within section (tab 1 open default). want use index.html#features , once has located section, open tab #2 (#tab2). my js below looks hash in url, if hash shown, trigger click effect hash. trying use index.html#tab2, won't move down #features section , i'm not sure how solve this. the #features section near bottom of page, need first locate section , open 2nd tab. js fiddle <article id="features"> <div class="tab-wrapper"> <ul class="tab-wrapper__tab-list" role="tablist"> <li role="presentation"> <a href="#tab1" role="tab" aria-controls="panel0">tab one</a> </li> <li role="presentation"> <a href="#tab2" role="tab" aria-controls="panel1">tab

popping a new frame and deleting the old one in wxPython -

i have simple frame button on it. want when press button, close frame , open new one. old 1 needs destroyed while new 1 should have same functionality destroyed frame. want infinite time. this code wrote: import wx class subpanel(wx.panel): def __init__(self, parent, value = 2): wx.panel.__init__(self, parent) self.btnpresshere = wx.button(self, -1, "press here") self.value = value hbox = wx.boxsizer() hbox.add(self.btnpresshere, 1, wx.expand) self.setsizer(hbox) if __name__ == "__main__": class screen(wx.frame): def __init__(self, parent): wx.frame.__init__(self, parent, size = (600,600)) panel = wx.panel(self) panel0 = subpanel(panel, 0) box = wx.boxsizer() box.add(panel0, 1, wx.all | wx.expand) panel.setsizer(box) self.centre() self.show(true) app = wx.app(false) screen(none) app

php - Group Array Items with similar strings -

i have simple array of strings: $hand = array("05h", "02h", "03c", "02s", "04h"); here's want it: if number appears more once, group number @ beginning of array. end result be: $hand = array("02h", "02s", "05h", "03c", "04h"); here's i've pieced far other answers, don't know how make pieces work accomplish goal. $hand = array("05h", "02h", "03c", "02s", "04h"); rsort($hand,sort_numeric); print_r ($hand); echo "<br>"; function myfunction($card) { return(substr($card,0,2)); } $countedhand = array_count_values(array_map("myfunction",$hand)); asort($countedhand); print_r(array_reverse($countedhand)); uchiha's comment solved original array, have couple more complex arrays doesn't work for. here's couple other arrays. $hand2 = array("05h", "02h",

c++ - Getting iterators within TBB parallel_for loop -

i having issues conceptually straightforward code. need collect iterators vector inside loop, , use tbb capabilities parallelize loop. here minimal (not) working example: #include <tbb/tbb.h> #include <vector> int main() { std::vector<int> v{1,2,3,4,5,6,7,8}; tbb::concurrent_vector<decltype(v)::iterator> cv; tbb::parallel_for(std::begin(v), std::end(v), [&](const auto& iter) { cv.emplace_back(iter); }); } as can see, interested in iterators, not values. accomplish similar thing using pointers or reference wrappers (here example below), understand reason not able want... #include <tbb/tbb.h> #include <vector> int main() { std::vector<int> v{1,2,3,4,5,6,7,8}; tbb::concurrent_vector<std::reference_wrapper<decltype(v)::value_type>> cv; tbb::parallel_for_each(std::begin(v), std::end(v), [&](auto& element) { cv.emplace_back(std::ref(element)); }); }

Android vector drawable app:srcCompat not showing images -

i'm using support library show vector images on android kitkat. when test app on emulater don't see of these images. made separate layout android lollipop , above , workd (i think because i'm using src attribute instead of srccompat here's code i'm usign support library <linearlayout android:layout_alignparentbottom="true" android:id="@+id/lake_detail" android:background="@drawable/my_fishing_plan_footer_line" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="90dp" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <relativelayout android:layout_marginright="3dp" android:id="@+id/fire_logo" android:layout_width="20sp" android:layout_height="20sp"> <imageview

php - Array Echo Together Each Value Together -

this question has answer here: how can loop through 2 arrays @ once? [duplicate] 2 answers i have 2 arrays $name = array ( [1] => potrait color correction [2] => extraction ) $number = array ( [1] => 060716113223-13555 [2] => 49101220160607-25222 ) i'm trying print index 1 of first array index 1 of 2nd array , similary index 2 this code printing (think it's wrong) foreach ($name $abc => $val) { foreach ($number $xyz => $valu) { if(!in_array($val, $arr)){ //echo $val." ";echo $valu; $arr[]=$val; } } } problem array number printing first value getting repeated both potrait color correction 060716113223-13555 extraction 060716113223-13555 im looiking echo potrait color correction 060716113223-13555 extraction 49101220160607-25222

c++ - using std::bind() on overloaded class method -

this question has answer here: why bind not work pass reference? [duplicate] 1 answer i'm sure must common issue apologies if it's search skills failing. i'm trying without boost because functionality exists in c++11 , i'm fan of standards. i'm trying use std::bind() wrap method in class external library. (specifically: asio::io_service::run() ) unfortunately method overloaded confuses std::bind(). minimal test case demonstrate issue: #include <functional> // std::bind class test{ public: void method(){} void method(int i){} }; int main(int argc, char * argv[]) { test test_instance; auto bound_thing_1 = std::bind(test::method, test_instance); return 0; } and compile: duncan@casper:/tmp/bind_test$ gcc -v using built-in specs. collect_gcc=gcc collect_lto_wrapper=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper target: x86

javascript - How to validate textarea and radio button in a loop -

i need 1 help. have multiple textarea, radio button , dropdown list created clicking on button. need validate them textarea has blank value, radio button check , dropdown select using javascript/jquery. explaining code below. <div style="width:24%; float:left; padding:10px;">no of questions : <input name="no_of_question" id="ques" class="form-control" placeholder="no of question" value="<?php if($_request['edit']) { echo $getcustomerobj->no_of_question; } else { echo $_request['no_of_question']; } ?>" type="text" onkeypress="return isnumberkey(event)"> </div> <div style="padding-bottom:10px;"> questions : <input type="button" class="btn btn-success btn-sm" name="plus" id="plus" value="+" onclick="addquestionfield();"><input type="button" class="btn btn-danger

java - HTTP Request in GWT -

i have understand whole rpc mechanism because need own project , upcoming exam. @remoteservicerelativepath("message") public interface messageservice extends remoteservice { message getmessage(string input); } the "remoteservicerelativepath..." part confusing me. don't understand how works http url , how http request works in general. i'm beginner , cool if here explain me :) in advance! for me confusing part how use @remoteservicerelativepath("message") , have put in web.xml. <servlet-mapping> <servlet-name>greetservlet</servlet-name> <url-pattern>/sample/greet</url-pattern> </servlet-mapping> so url /sample/greet made of 2 strings in case: sample comes module name, find in *.gwt.xml file. <module rename-to='sample'> ... </module> and greet part in comes @remoteservicerelativepath("greet") @remoteservicerelativepath("greet"

oracle - How to propagate globally defined exception through execute immediate? -

here minimal test case reason fails ora-06510: pl/sql: unhandled user-defined exception create package my_test global_exception exception; end; / set serveroutput on; begin execute immediate 'begin raise my_test.global_exception; end;'; exception when my_test.global_exception dbms_output.put_line('global_exception'); end; / here test case works: begin raise my_test.global_exception; exception when my_test.global_exception dbms_output.put_line('global_exception'); end; / is there way raise global exceptions through execute immediate? database version 12c or 11g you can catch if use dbms_sql instead of execute immediate (in 11gr2): declare l_cur pls_integer; l_rc pls_integer; begin l_cur := dbms_sql.open_cursor; dbms_sql.parse (l_cur, 'begin raise my_test.global_exception; end;', dbms_sql.native); l_rc := dbms_sql.execute(l_cur); exception when my_test.global_exception dbms_output.put_l

javascript - How to put a specific html area on an extra page when printing it -

i'm searching way put left aside-area website on page when i'm printing it. may had same problem , found easy way that. @ moment, website printing element element, want control it. want, specific element printed on next page , not after element before. you can print using media query. @media print { background-color: lightgreen; }

javascript - Using spiwer cannot slide over input area -

i develop mobile webpage , use swiper.js achieve slide between 2 pages. every page has input textfield users input username , passwd. , found swiper become useless on input area, normal in other area button , on. now, want achieve if click on input area, can input want, if want slide page, can slide anywhere want.

java - Caused by: XmlBeanDefinitionStoreException: Line 3 in XML document [/WEB-INF/spring/data.xml] -

i have spring application doest user registration , allows user enter data using crud in spring mvc. when launch application error stackrace caused by: org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 3 in xml document servletcontext resource [/web-inf/spring/data.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 3; columnnumber: 110; cvc-elt.1: cannot find declaration of element 'beans'. this second line of stacktrace error throws caused by: org.xml.sax.saxparseexception; linenumber: 3; columnnumber: 110; cvc-elt.1: cannot find declaration of element 'beans'. atm.sun.org.apache.xerces.internal.util.errorhandlerwrapper.createsaxparseexception(errorhandlerwrapper.java:203) this class defined in web-inf folder error located <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframewo

jquery - Ajax call throwing "TypeError: object is not a function" Exception -

this code throwing typeerror idea salt remote external server , append password , generate hash. problem code throwing typeerror says typeerror: object not function the following part of index_user_scripts.js . /*jshint browser:true */ /*global localstorage, console, $ */ (function(){ "use strict"; /* * hook event handlers */ function register_event_handlers(){ $(document).ready(function(){ try { if(!window.opendatabase) { console.log('local databases not supported browser.'); } else { var shortname = 'chtrshk'; var version = '1.0'; var displayname = 'chhatrasahayak'; var maxsize = 2*1024*1024; var db = window.opendatabase(shortname, version, displayname, maxsize); } } catch(e) { if (e == 2) { // version mismatch. console.log("invalid database version.");

node.js - How to display a greet message include text and image in nodejs -

Image
i want show greeting message when user start conversation on facebook messenger before user input message. i did code in node js server triggers when user sends message want show greeting message below. i want know should code welcome message. read https://developers.facebook.com/docs/messenger-platform/thread-settings/greeting-text here text possible. this link text greeting facebook messenger :how show greeting message when start conversation if using nodejs, use request (or curl) create greeting button , pass parameter listen on post back. let request = require('request'); request.post({ method: 'post', uri: `https://graph.facebook.com/v2.6/me/thread_settings?access_token=${access_token}`, qs: { setting_type: 'call_to_actions', thread_state: 'new_thread', call_to_actions: [{ payload: 'get_start' }] }, json: true }, (err, res, body) => {

android - errors when compiling with adMob V2 (Error retrieving parent for item / UNEXPECTED TOP-LEVEL ERROR:) -

i having these type of error in admobs b4a 5.50 ide - process timeout: 600 javac.exe: c:\java\jdk1.8.0_73\bin\javac.exe android.jar: c:\android\android-sdk\platforms\android-15\android.jar b4a bridge: v2.13 phone: samsung galaxy s3 (gt-i9305) system: android 4.4.4 libraies: core (v4.92) , admob (v2.0) running debug, error: b4a version: 5.50 parsing code. (0.00s) compiling code. (0.05s) compiling layouts code. (0.00s) generating r file. error c:\android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: error retrieving parent item: no resource found matches given name '@android:style/theme.material.light.dialogwhenlarge.noactionbar'. i faced similar type of issue in android in these need increase maxramfordex: https://www.b4x.com/android/forum/posts/58036/ it solve problem

javascript - change the xlink:href of an <image> in a svg, through a classic <a> link -

i have svg in webpage (i use php): <svg width="500px" height="500px" xml:lang="fr" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image width="500" height="500" xlink:href="img1.jpg" opacity="0.35" /> </svg> i able change xlink:href variable when clicking on link (and without reload webpage), like: <a href=#" onclick="changexlinkhref(img2.jpg)">change img2</a> but don't know code of js function changexlinkhref(img){} (and don't use jquery on project) thanks! you'll need put img2.jpg argument in single quotes should provided have 1 image element on page. function changexlinkhref(value) { document.queryselector("image").setattributens('http://www.w3.org/1999/xlink', 'xlink:href', value); }

Mysql, order by "pattern"? -

i want order type, pattern. records now: type name 1 2 b 1 c 4 d 4 e 3 f 2 g 3 h my pattern 2,4,3,1 get: 2 b 2 g 4 d 4 e 3 f 3 h 1 1 c use order field (type,2,4,3,1) . give correct result.

ios - How do i store finger print against database record -

i using touch id , appears work fine pushing view in when sucesffull fingeer print found question how store against user record in azure can ups on customer data best way of doing this. ie should finger print reader o active once have signed app. the following code using catch finger print on btn touch inside partial void touchid(uibutton sender) { //lets double check device supports touch id if (context.canevaluatepolicy(lapolicy.deviceownerauthenticationwithbiometrics, out error)) { var replyhandler = new lacontextreplyhandler((success, error) => { invokeonmainthread(() => { if (success) { var newvc = new uiviewcontroller(); presentviewcontroller(newvc, true, null); } else { var alert = new uialertview(

php - Laravel Migration - Adding Check Constraints In Table -

i want create table in laravel migration this- create table payroll ( id int primary key, positionid int, salary decimal(9,2) check (salary < 150000.00) ); what have done is- schema::create('payroll', function (blueprint $table) { $table->increments('id'); $table->integer('positionid '); $table->decimal('salary',9,2); //$table->timestamps(); }); but can't create this- check (salary < 150000.00) can please tell, how implement check constraints in laravel migration ? adding constraints not supported blueprint class (at least of laravel 5.3), is possible add constraints tables directly migrations, using database statements. in migration file, public function () { schema::create('payroll', function (blueprint $table) { $table->increments('id'); $table->integer('position_id'); $table->decimal('salary',9,2); });

Batch File: Assign random line of text file as variable for later use -

i'm trying write simple batch file personal use...it's complete except 1 thing i'm stumped on. easy fix (i'm illiterate when comes code). basically i'm trying have script choose random line text file, couple times couple different text files, wish assign output each text file variable can use them in various combinations...then repeat process. here have right now... @echo off :start setlocal setlocal enabledelayedexpansion enableextensions set "list1=list1.txt" /f %%a in ('type "%list1%"^|find /c /v ""') set /a numlines=%%a set /a list1random=(%random% %% %numlines%) if "%list1random%"=="0" (set "list1random=") else (set "list1random=skip=%list1random%") /f "usebackq tokens=* %list1random% delims=" %%a in (`type %list1%`) ( >> output.txt echo %%a ) :finish endlocal goto start` this procures random line, , spits text file. well, next step, take random result ,

c++ - Qt queued exit event for worker object in another thread -

myclass object has worker qobject , working in thread: class myclass { .... private: qthread thread; worker worker; // inherits qobject }; ... worker.movetothread(&thread); now when call thread.exit() worker thread stops instantly. prefer finish pending events, quit. i have tried "queued exit": connect(this, signal(signalfinish()), &thread, slot(quit()),qt::queuedconnection); ... void myclass::finish() { emit signalfinish(); worker.disconnect(); // not queue more events thread.wait(); } but doesn't work. wait forever... how stop qthread after it's event loop process pending events? the thread , myclass instances both live in same thread - main thread: myclass::myclass() { ... q_assert(this->thread() == thread.thread()); yet events you're queuing worker object go worker thread: worker.movetothread(&thread); q_assert(worker.thread() == &thread); q_assert(worker.thread() !=

sql server - Select Only first row from the join result -

i have stored procedure using below 2 tables ticket nav group(table) - column: ticket type id ticket nav group id ticket sorting(table) - column : ticket typeid, nav groupid, priority i did inner join between these tables. using ticket type id since ticket type id , navgroup id , priority different, have found duplicate row . now requirement need select first matching row result each ticket type id . also need display ticket type id , priority in result if have multiple ticket typeid in second table, can join this: select a.[ticket type id], a.[ticket nav group id], b.[priority] [ticket nav group] inner join ( select [ticket typeid], max([priority]) [ticket sorting] group [ticket typeid] ) b on b.[ticket typeid] = a.[ticket type id] and if understand right, think have table design issue.

swift - Searching for objects matching a particular type -

Image
i've got nsviewcontroller extension iterates through descendant child view controllers looking first view controller passes particular test (specified user-defined block): extension nsviewcontroller { func descendantviewcontrollerpassingtest(test: (viewcontroller: nsviewcontroller) -> bool) -> nsviewcontroller? { var retval: nsviewcontroller? childviewcontroller in childviewcontrollers { if test(viewcontroller: childviewcontroller) { retval = childviewcontroller } else if let descendantviewcontroller = viewcontroller.descendantviewcontrollerpassingtest(test) { retval = descendantviewcontroller } if retval != nil { break } } return retval } } ninety-nine percent of time tests consist of simple type-check... contentviewcontroller.descendantviewcontrollerpassingtest {$0 outlineviewcontroller} ...so i'd create short convenience extension this:

MySQL : how to find nearest polygon from a special point in mysql versions above 5.6.1? -

Image
i've table urbanpolygons column holds polygon paths have point surrounded polygons , wanna search polygons , find 1 closer point. the green box(polygon) 1 should chosen! i manage point inside polygon or not: select * urbanpolygons st_contains(urbanpolygons.paths, geomfromtext('point(29.632262, 52.497868)')); this question not duplicate of get polygons close lat,long in mysql or mysql find polygon nearest point the older question mentioned above asked 6 years ago , plenty of geospatial features have been implemented in mysql time. it's better answer considering new features of mysql < 5.6.1 offers,such st_contains , ... sqlfiddle doesn't offer mysql version above 5.6 decided write litte example here: create table `urbanpolygons` ( `id` int(11) not null auto_increment, `name` varchar(45) not null, `paths` polygon not null, primary key (`id`), unique key `id_unique` (`id`) ) insert urbanpolygons (`id`, `name`, `paths`) values ('1'

python - Is PySide 1.2.4 stable? The newest release is crashing with an odd Error -

Image
i spent week debugging problem got python crash (not give scripting error, literally crash vm) due random error. after tracking days using procdump , found pyside 1.2.4 causing problem. stable version unstable? according pip standards , stable release has put when normal installation command given, hence pip install pyside should provide stable version. spent week debugging problem got python crash (not give scripting error, literally crash vm) due random error. after tracking days using procdump , found pyside causing problem. following bug extracted dump file using windbg: i went there report issue, , got shocked find current standard version provided pip/pypi (1.2.4) not stable! it's dev version!!! check screenshot reporting website: of course pyside not free commercial purposes, using people's resources test dev version without telling them? unethical , don't want others fall in same trap had. please aware of this! hence, when install pysi

oauth 2.0 - Using the soundcloud api's RESOLVE from vb.net, plus very general questions -

i have website written in vb.net (actually asp.net using vb) , want allow users view soundcloud videos embedded in pages. idea use javascript api add particular feature specialized subset of users might want. i need ability javascript make audio such actions as: 1) play 2) pause 3) seek also, need events audio tell me when audio has 1) paused 2) started play , 3) seeked , 4) ended. this basic, , have read of documentation, guidance in reading rest, have following questions: if agrees allow soundcloud file used on website, have set 'enable-api' or other settings? if so, on "upload" page? does soundcloud have private permissions youtube does? in youtube, can make video public, can make shareable circle of friends. if third party (me, instance) embeds 1 of videos in own website, users have logged in youtube on browser can see video. soundcloud have analogous? feature have, because if user has doubts security, can still rely on youtube or soundcloud

php - Guzzle 6: Two-legged OAuth1 Authorisation -

i using guzzle 6 , oauth subscriber machine-to-machine communcation, interfacing api base uri https://foo.bar ofwhich vendor provides following parameter instructiond: consumer key consumer secret request token url: https://foo.bar/oauth/request authorize url: https://foo.bar/oauth/authorize access token url: https://foo.bar/oauth/access following the oauth bible , imply two-legged oauth required, wish bypass manual authorisation redirection, though unsure how how/where to-set request-token url , access token url @ client level. i have setup simple client, using consumer-key , secret, allows partial api access $stack = handlerstack::create(); $middleware = new oauth1([ 'consumer_key' => $params['consumerkey'], 'consumer_secret' => $params['consumersecret'], 'token_secret' => false, ]); $stack->push($middleware); $client=new client([ 'base_uri' => $params['

php - How do i get databasevalues in my website by using a var? -

we doing project using flipcards show questions , flip on see answer. have use database , managed add category , questions , answers database. but want questions , answers out of database , place them on our flashcards. cant seem right. this have : index.php foreach($acategories $acategory) { $name = $acategory['id']; echo "<div class='col-md-3 col-xs-6'><a href='/oefenen/vraag-1' name='$name' class=\"btn btn-info\">".$acategory['name']."</a></div>"; } oefenen_controller.php public function indexaction() { $odatabase = new database(); $this->userloggedin(); $acategories = $odatabase->getcategories(); $this->set("acategories", $acategories); $avragen = $odatabase->getvragen(); $this->set("avragen", $avragen); } in index.php tried use name='$name' values out of data

ruby on rails - rspec require lib only in one model -

i'm using refile gem , wanna test uploader rspec. since i'm using refile 1 model in app wanna avoid requiring in rails_helper. if try require see below require': cannot load such file -- refile/file_double (loaderror) error. should do? rails_helper.rb require 'devise' require "pundit/rspec" require 'capybara/rails' require 'capybara/poltergeist' spec/models/company_spec.rb require 'rails_helper' require 'refile/file_double'

jquery - jQueryUI Accordion - Expand/Collapse multiple sections -

i want expand , collapse accordion sections 1 click. right works <a class="accordion-expand-all" href="#" target="_self">open/close all</a> <div id="accordion"> want work <div id="accordion2"> through <div id="accordion4"> well. accordions in different tabs works fine when click open/close link opens , closes accordion sections in <div id="accordion"> . <!doctype html> <head> <title>accordion</title> <meta charset="utf-8"> <link href="css/style.css" rel="stylesheet"> <link href="css/jquery-ui.css" rel="stylesheet"> </head> <body> <a class="accordion-expand-all" href="#" target="_self">open/close all</a> <div id="tabs"> <ul> <li><a href="#tabs-1">tab 1</a></li> <li>&l