Posts

Showing posts from January, 2013

node.js - `express` - app chrome postman giving always error instead of response -

Image
please 1 me find issue here: when trying post username , password getting error : requester.js:6211 post http://localhost:7000/api/login 403 (forbidden)send @ requester.js:6211(anonymous function) @ requester.js:4811dispatch @ jquery.min.js:3i @ jquery.min.js:3 requester.js:1056 defining mode i don't know issue here @ all. here post man request screen shot : here api file : var user = require('../models/user'); var config = require('../../config'); var secretkey = config.secretkey; var jsonwebtoken = require("jsonwebtoken"); function createtoken ( user ) { var token = jsonwebtoken.sign({ _id : user.id, name : user.name, username: user.username }, secretkey, { expiresin : "1440m" }) return token; } module.exports = function( app, express ) { var api = express.router(); api.post('/signup', function( req, res ) { var user = new user({ name

javascript - Angular js : How to make make ajax call for directives to create options -

i created directives form controls. there controls have options ajax[api] call. i stuck here how make ajax call on directives. function selectcontroldir() { return { transclude: true, restrict: 'e', scope: { data: '=data' }, template: "<div ng-transclude></div><label>{{data._text}} </label><select type='text' name='{{data._attributename}}' id='{{data._attributename}}' >\n\ <option ng-repeat='ans in data._answeroptions'>{{ans._prompttext}}</option></select>" , link: function (scope, element, attrs) { //console.log("scope.data.questiondata", scope.data.questiondata); } }; } plunker complete code http://plnkr.co/edit/op1qdwubecaospuc7r3n?p=preview here want make api call year (on page load). on y

html - CSS login Modal opening but only appears in background -

my login modal (both, trigger & actual modal code) in header bar of page. works on of pages. but on pages there may existing styling, modal open alright , page background becomes dark usual, but... of styling on page "overlay" , appear on top of modal.. result, modal not clickable... is there way modify modal .css when it's triggered, stays on top of else? here's .css code modal: > .cd-user-modal { > position: fixed !important; > top: 0 !important; > left: 0 !important; > width: 100% !important; > height: 100% !important; > background: rgba(52, 54, 66, 0.9) !important; > z-index: 3 !important; > overflow-y: auto !important; > cursor: pointer !important; > visibility: hidden !important; > opacity: 0 !important; > -webkit-transition: opacity 0.3s, visibility 0.3s !important; > -moz-transition: opacity 0.3s, visibility 0

sorting in kendo grid using custom values -

need sorting these json results days inside kendogrid. need way turn plus sign .5 or along lines. suppose have loop through each one, if find plus sign change value number.5 , drop new value in before displaying? { name: alex, days: "2" }, { name: jason, days: "1" }, { name: fred, days: "2+" }, { name: jane, days: "3" }, { name: john, days: "3+" } here code got working <body> <div id="grid"> </div> <div> <script> $(document).ready(function () { //json data var people = [ { firstname: "hasibul", lastname: "haque", email: "hasibul2363@gmail.com", rank:"2" } , { firstname: "jane", lastname: "smith", email: "jane.smith@kendoui.com", rank: "3+" } , { firstname: "jason", lastname: &qu

python - Socket.close() doesn't close the Socket -

i'm trying develop simple client/server program, server part working i've problem client part can't understand why. the client's work simple, retrive counter value external device, i'm trying send retrieved data server part. at beginning socket working well, time when should send data i've got server exception , after client not working. i can't understand if s.close() function working properly. update: exception got "errno 110 connection timed out" client: import time, socket, struct, array, json import client_axis import sys import serial import os import datetime import re import packet import config_mio usbport = '/dev/ttyama0' h = "/r/n" if __name__=="__main__": """main function starts server""" curr_value = "0000000000" prev_value = "" line = '111111111111111' error_counter = 0 people_in = 0 people_out

ios - How to handle escaped emebed json within another JSON using Swift ObjectMapper -

i'm trying map json string data model using objectmapper. below json string i'm trying: { "username":"test", "studentno":71129, "activity":{ "name":"test name", "semester":"1", "activityhistory":"{ \"id\": \"111111\", \"items\": [ { \"datetime\": \"201923022016\", \"mediaformat\": \"online\" } ,{ \"datetime\": \"201923022016\", \"mediaformat\": \"online\" } ,{ \"datetime\": \"201923022016\", \"mediaformat\": \"online\" } ]}" } } the embedded json within json payload coming external api , have no control on it. my model classes: import uikit import objectmapper class studentmodel: mappable { var username: string? var studentno : string? var activity : [activitymod

php - Not able to send links in email after setting header -

i not able send links in email. using wp_mail() function send email. when set header $headers .= "content-type: text/html; \r\n"; header removes href attribute in received email. i using wp_editor textarea. tried html textarea result same. when send mail without setting header, getting anchor tag text. <a href=\'http://example.com\'>example</a> here code. jquery('.for_email').click(function(e){ e.preventdefault(); var mail_data = jquery('.email_popup_form').serialize(); //console.log(mail_data); jquery.ajax({ url:"<?php echo admin_url('admin-ajax.php'); ?>", data:'action=mail_link_popup&'+mail_data, success:function(res) { //console.log(jquery('#mycustomeditor_afds_ifr').contents().find('#tinymce').html()); } }); }); and php code add_action('wp_a

symfony - Symfony2 - Security Role - From PHP 5.3 to PHP >5.4 - getRole() on a non-object -

Image
i had @ issue : https://github.com/symfony/symfony/issues/3691 my problem can't find solution make work. i use symfony 2.8.3 here error had : fatalerrorexception in rolehierarchy.php line 43: error: call member function getrole() on non-object i serialized properly, here classes : user <?php /** */ namespace cnamts\phpk\securitybundle\security\user; use symfony\component\security\core\user\userinterface; use cnamts\phpk\securitybundle\security\role; /** * classe abstraite implémentant la classe symfony userinterface. */ abstract class user implements userinterface { public function __construct() { $this->roles = array(); } /** * concaténation du nom et du numéro d'agent : nom-numero. * * @var string */ protected $ismum; /** * nom de l'utilisateur. * * @var string */ protected $nom; /** * prénom de l'utilisateur. * * @var string */ protected

sql - Geographic coordinates in PostgreSQL query -

there 2 fields in database table, latitude , longitude . (other fields too, not important now.) i have function, 3 parameters: latitude , longitude , max_distance (km). is there way construct raw postgresql query returns rows represent location within max_distance (km) measured given latitude , longitude? example parameters latitude=59.9138699, longitude=10.7522451, max_distance=10 to this, use postgis. postgis has functions such st_distance , st_pointfromtext : select * tbl st_distance( st_pointfromtext('point(' || longitude || ' ' || latitude || ')', 4326), st_pointfromtext('point(10.7522451 59.9138699)', 4326) ) < 10000; to fast, should use geometry field , index it. you should learn bit spatial reference systems , srid. srid 4326 denotes wgs84 coordinate system, commonly in use on web.

php - Laravel Public vs Storage directories for audio files -

Image
i little bit confused in directory should put .mp3 files in laravel 5. public/ , first choice mp3 can considered media (like images stored there) storage/app , according docs directory kind of recommended purpose. i don't mind being able url of these audio files since serve stream (to somehow prevent downloads, lol). any advice? thanks. guess depends on whether want direct public access or not. public/ simpler. in there can link directly. js or css or images resources. storage/app more secure, no way access directly. that's use (actually think i'd storage/app/audio specific) have more control on how accessed.

How to define welcome file list in spring 4 using java config annotation -

Image
i trying load welcome file using spring java config annotation. read document google , got idea if used index.html or index.jsp our webcontent folder load automatically. using login.jsp page. so not loaded automatically. i have tried loaded login.jsp file using below code unable load. my attempt : @bean public internalresourceviewresolver viewresolver() { internalresourceviewresolver viewresolver = new internalresourceviewresolver(); viewresolver.setviewclass(jstlview.class); viewresolver.setprefix("/web-inf/views/"); viewresolver.setsuffix(".jsp"); return viewresolver; } @override public void addviewcontrollers(viewcontrollerregistry registry) { registry.addviewcontroller("/").setviewname("login"); } @override public void configuredefaultservlethandling(defaultservlethandlerconfigurer configurer) { configurer.enable(); } every time getting 404 exception. missing? below image showing place of login.js

tsql - Count of SQL Server OS types for each month of last 12 months -

Image
i have task of creating report should show different operating system types of sql servers in our environment each month of last 12 months. i created following table , data loaded inside every day: i need os types each month last 12 months displayed in following format: i wrote following query wrong. struggle have how os types count last data collection of each month (not last day of each month) , display date in format mon yyyy . use sql server 2008 r2. ideas? with cte ( select osver = case osver when '5.0.2195' 'windows server 2000' when '5.2.3790' 'windows server 2003' when '6.0.6002' 'windows server 2008' when '6.1.7600' 'windows server 2008 r2' when '6.1.7601' 'windows server 2008 r2 sp1' when '6.2.9200' 'windows server 2012'

visual studio 2012 - Wix Build "AssignTargetPath" Error in Heat.exe -

i have searched around site , others , cannot seem find has ran specific error. information helpful. i following error when building content wix. rest of solution builds fine, including infrastructure wix , mps.content wix. heat.exe(0,0): error heat5313: build error during harvesting: c:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets(2132,5): "assigntargetpath" task failed unexpectedly. so turns out folder structure long in tfs 1 of files used in web service project being referenced in content wix. so remapped tfs folder "c:\projects\enterprise\etc..." "c:\projects\e\etc..." , apparently enough of change in folder structure length able build.

sharepoint - PowerShell 2.0 Network Path not found when creating drive and copying files -

the script works several days, , email message saying failed because "the network path not found". when run manually works fine, it's hard find problem. how keep dropping/losing network path? improvements or tips welcome. i have written script create new folder on shared drive in order backup accounting logs sharepoint. have script deletes of these folders older 30 days. the script create folder today's date on shared drive \sfserverspb4\accounting. create drive random drive letter between 'd' , 'z' not in use. point drive sharepoint path \intranet.mycompany.com\dept copy files, folders, sub-folders sharepoint path accounting shared folder created today. remove created drive when done. this first powershell script. thank you! #copy po logs sharepoint (intranet.mycompany.com) sfserverspb4\accounting try { write-host 'creating new folder' -fore black -back yellow $today_folder = new-item -itemtype directory -path &q

php - Woocommerce Custom payment gateway callback function not working -

i have been struggling time now. explored google replies etc... here code: class wc_gateway_mysolugion extends wc_payment_gateway { public function __construct() { ... ... /* hook ipn callback logic*/ add_action( 'woocommerce_api_wc_gateway_mysolugion', array( $this, 'check_callback' ) ); } .... function check_callback() { // other code } the problem function check_callback never called when controll returns site payment gateway site. what doing wrong? any appreciated. thanks. payment gateways should created additional plugins hook woocommerce. inside plugin, need create class after plugins loaded (or alternatively at initialisation if on function.php file of active theme, see below) . so code this: // plugin (the better choice) add_action( 'plugins_loaded', 'init_mysolugion_gateway' ); // or theme function.php file // add_action( 'init', 'init_mysolugion_gateway' ); fun

Alternative for Option tag in HTML that can support images -

since images cannot added option tag, can please suggest alternative this, can add image along text. new html, not quite aware of tags. you have option use this: <select> <option style="background-image:url(image1.jpg);">male</option> <option style="background-image:url(image2.jpg);">female</option> <option style="background-image:url(image3.jpg);">others</option> </select> however, can use ddslick a free light weight jquery plugin allows create custom drop down images , description.

android - greenDAO: compare two properties with each other -

i sure should simple can't seem find solution. say have table 5 fields (id, colour, size, scanned, expected) how rows expected greater scanned? i have tried mydao.property.expected.gt(mydao.property.scanned).list() but returns 0 rows. using log_sql boolean can see looking property field, not value of field. d/greendao: values query: [0, de.greenrobot.dao.property@33ecce97] greendao's querybuilder api not support (yet). have use raw query . it this: query myquery = mydao.querybuilder().where(new stringcondition( property.expected.columnname + " > " + property.scanned.columnname)).build(); ps.: created feature request if want track future greendao version.

What problems does jQuery solve? -

i understand jquery powerful javascript framework , have completed few tutorials. however, assist understanding, know class of problems jquery written solve. how make coding javascript easier? example or 2 of native javascript code , equivalent using jquery useful. jquery's syntax designed make easier navigate document, select dom elements, create animations, handle events, , develop ajax applications. jquery provides capabilities developers create plug-ins on top of javascript library. enables developers create abstractions low-level interaction , animation, advanced effects , high-level, theme-able widgets. modular approach jquery library allows creation of powerful dynamic web pages , web applications. https://en.wikipedia.org/wiki/jquery example dom selection , class adding the plain javascript: function addclassf(el, cls) { var clss; if (typeof cls === "string") { clss = cls.split(" "); } else if (cls instanceof array) {

TeamCity - Artifact dependency view -

i know can see dependecies specific project has. possible see other way round: can see projects have artifact dependency on "my project"? i'm not talking view "this build used other builds" because can see project has used specific build. know every project using "my project"?

java - Do you extract interface out of any class that can be instantiated? -

Image
is considered practice have every single class (excluding domain models) of application based off of interface? if class called within package? update: based on comments, here sample scenario can think of, feel had been have classes based off interface. a calculator class within parent package, calculations , uses class (printer) print out results, file system. suppose calculator class public, printer class has package protection. if want printer send result on http instead of writing file system? if printer class based off of interface, , if injecting printer class using spring. had swapped out implementation new 1 easily. not @ all. interfaces best used plan provide various polymorphic implementations, or wish invert dependencies purpose of unit testing. interfaces should created when necessary. should designed.

Call function on object literal, represented by string - JavaScript -

i using history.js. in stateobj of pushstate function, want add reference function ( car.init() , or boat.init() . in c++, believe use function pointer. then on window.onpopstate, want reference function , call it. can read string ( car.init() , how can call function? don't want use eval . you shouldn't, if want invoke function based on global dotted-path name, accomplished this: function callfunction(name, var_args) { // break string individual property/method names var parts = name.split('.'); // start reference global object var target = window; var previoustarget = null; (var = 0; < parts.length; i++) { // keep copy of previous reference use `this` value previoustarget = target; // change reference next named property target = target[parts[i]]; } // grab remaining arguments var args = array.prototype.slice.call(arguments, 1); // call target function, previoustarget subject, using

php - Foreach string replacement with multiple variations -

i trying find out best way of going string replacement multiple collations. i have sentence inserted user, have array of miss-spelled words in sentence , potential corrections. $sentence = 'i want recovary vehical cabs'; i want display following: i want recovery vehicle cabs i want recover vehicle cabs i want revary vehicle cabs code far: $element = array( "vehical" => array('vehicle'), "recovary" => array('recovery', 'recover', 'revary') ); $sentence = 'i want recovary vehical cabs'; foreach($element $i => $val){ echo $i; } edit: expanded scenario: what happen if there more 1 variation in top array. "vehical" => array('vehicle', 'vehiclesy', 'whatever'), "recovary" => array('recovery', 'recover', 'revary') i want recovery vehicle cabs i want recovery vehiclesy cabs i want recovery

ros - how to add or use tfx python module for catkin? -

i download repository [ https://github.com/simon0793/pr2_simu ... ] using catkin_workplace when ever run python code python simulation_one_motion_queue.py every time error comes tfx not found as; raise resourcenotfound(name, ros_paths=self._ros_paths) rospkg.common.resourcenotfound: tfx ros path [0]=/opt/ros/indigo/share/ros ros path [1]=/home/mudasser/p/src ros path [2]=/opt/ros/indigo/share ros path [3]=/opt/ros/indigo/stacks that means package tfx not found. make sure on ros_package_path. can try if added in path running $ roscd tfx that should bring package directory. otherwise have search , include yourself. (worst case, tfx package not installed, have install first).

c++ regex convert regex to c++ code -

first time regex (in c++ is) i have hard time writing (?<=name=")(?:[^\\"]+|\\.)*(?=") that matches example name="blabla" xyz blabla code... how i std::regex thename("(?<=name=")(?:[^\\"]+|\\.)*(?=")"); correctly please? you need use capturing rather positive lookbehind in c++ regex. also, advisable use unroll-the-loop principle unroll ([^"\\]|\\.)* subpattern make regex fast can be, see [^\"\\]*(?:\\.[^\"\\]*)* . also, advisable use raw string literals (see r"(<pattern>)" ) when defining regex patterns in order avoid overescaping. see c++ demo : #include <iostream> #include <regex> using namespace std; int main() { std::string s = "name=\"bla \\\"bla\\\"\""; std::regex thename(r"(name=\"([^\"\\]*(?:\\.[^\"\\]*)*)\")"); std::smatch m; if (regex_search(s, m, thename)) { std

ios10 - iOS 10: "[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction" -

Image
i message in logs of xcode 8b3 when running app, seems work, i'd know comes from. google did not @ all. in xcode: click on active scheme name right next stop button click on edit scheme.... in run (debug) select arguments tab in environment variables click + add variable: os_activity_mode = disable

How to rename file names using text file in python -

i need rename bunch of files in folder new name reference text file. can please give example this. my new names in text file: 1ba 1bb 1bc 1bd 1be 1bf 1c0 1c1 1c2 1c3 like this. updated code: import csv import os open('names.txt') f2: filedata = f2.read().split(",") os.rename(filedata[0].strip(), filedata[1].strip()) f2.close() f2 = open ('lines.txt','w') f2.write(filedata) f2.close() what using csv (comma separated) file input in format oldpath, newpath , following: import csv import os open('names.csv') csvfile: reader = csv.reader(csvfile) row in reader: oldpath = row[0] newpath = row[1] os.rename(oldpath, newpath) alternatively, if want move file directory/filesystem can have @ shutil.move

android - Play 360° videos on GearVR without going through the Oculus interface -

i'd know if there way play 360° video on gearvr without going through oculus interface. mean is, want icon on phone can click , launches video. have plug gearvr watch it. thanks if interested in creating application, use samsung gear vr framework develop application this. please see below link: https://github.com/gearvrf/gearvrf-demos/tree/master/gvr-360video app plays video in 360 when app launched.

javascript - Google Maps are not showing with domainname.com -

Image
javascript: <script async defer src="https://maps.googleapis.com/maps/api/js?key=mykey"type="text/javascript"></script> javascript function: <script type="text/javascript"> var geocoder; var map; var latlng; function codeaddress(address) { geocoder = new google.maps.geocoder(); if (geocoder) { geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.geocoderstatus.ok) { latlng=results[0].geometry.location; latlng = new google.maps.latlng(latlng); var myoptions = { zoom: 13, center: latlng, maptypeid: google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); map.setcenter(results[0].geometry.location); var marker = new google.maps.marker({

java - False positive MS_PKGPROTECT bug in FindBugs -

i pretty sure getting false positive findbugs. code following: public class myclass { protected static string filenameprefix; } and bug i'm getting: field should package protected a mutable static field changed malicious code or accident. field made package protected avoid vulnerability. bug kind , pattern: ms - ms_pkgprotect is false positive or i'm missing something? the protected modifier allows 3rd party subclass elevated access field. class myevilsubclass extends myclass { static { filenameprefix = "../" + filenameprefix; } } findbugs pointing out 'protected' doesn't protect field public access in wild. if field package protected know intent share secret among trusted friends. in general, hide field , create accessor methods more flexible in terms of encapsulation, thread-safety, , lazy loading.

How to send email - SAPUI5 -

Image
i trying send sample email in sapui5. have used sap.m.urlhelper.triggeremail(["dummy@mail.com"], ["sample subject"], ["hi"]); . not working. have tried using window.top.location = "mailto:" + email + "&subject=" + subject + "&body=" + message; . no luck. try this: sap.m.urlhelper.triggeremail("dummy@mail.com", "sample subject", "hi"); it should without [ ] because parameters triggeremail expects of type string

java - What is the practical application of an assignment involving a wildcard? -

what reason of assignment this? list<? extends fruit> flist = new arraylist<apple>(); // flist.add(new apple()); // flist.add(new fruit()); // flist.add(new object()); once "upcast" apple container in fruit container, not able add in it. i know like: list<apple> basket = new arraylist<apple>(); //fill basket tons of juicy apples list<? extends fruit> fruitcontainer = basket; and able use fruit interface use elements held fruitcontainer . can practical reason this, if cannot add later? list<? extends fruit> flist = new arraylist<apple>(); that line taken whole has no practical use, you've noted in question, each of the parts of ( list<? extends fruit> flist , new arraylist<apple>() ), separately, has practical use. they're both valid, , useful, not in combination (unless don't need put in list). that's why compiles, each of parts valid; it's us, programmers, combine them i

apache - java application running on tomcat. Unable to access over ajp. -

application accessible on tomcat http port. application when accessed web server(apache http server) gives bad gateway error. worker.properties(apache http server) & server.xml(tomcat) tuned well. socket/connection timeout 20 sec on both sides. jk.log shows below error. enter image description here the error says tomcat not accepting connections. how come @ same time, application accessible on http. on tomcat side dont see errors in log. you use different ports http connection (default 8080) , ajp connection (default 8009). can check exact values in conf/server.xml . your error indicates there problems between httpd , client (firewall, slow connection etc.). try remove timeouts, worker.ajp13.socket_timeout=3 . ( https://tomcat.apache.org/connectors-doc/common_howto/timeouts.html ) make sure ports not blocked possible firewalls. ubuntu, ufw (uncomplicated firewall) used open ajp connections: ufw enable && ufw allow 8009 .

python - how to make a mulit line input the size of the tkinter window? -

i trying make multiline input field in tkinter, needs full size of screen. have tried use root.winfo.height() , root.winfo.width() entry(root, height=root.winfo_height, width=root.winfo_width.pack(side=top,padx=10,pady=10) but works when window loads, , that's no good see can do, gook luck! you should use text widget instead of entry widget. here simple example: from tkinter import * app = tk() text_widget = text(app) text_widget.pack(expand = true) #this make text widget fill entire window app.mainloop()

How to add list in file to Lisp -

i want add list in text file lisp , bound variable. example mylist.txt contains: ((1 2 3 4) (5 6 7 8) (9 10 11 12) (13 14 15 16) ) , want read file , and set list variable mylist. (defun readfile (filename) (let ((in (open filename :if-does-not-exist nil))) (when in (loop line = (read in nil) while line (print line)) (close in) ) ) ) (setf mylist (readfile "list.txt")) output should (mylist should bounded to): ((1 2 3 4) (5 6 7 8) (9 10 11 12) (13 14 15 16) ) i have seen of answer on stackflow regarding this, non them worked example tried reading line line , used collect dont seem give me right answer since collect's entire line , treat list item. as stands far reading file , printing standard output ( (print line) statement in readfile ). instead, want collect input. (defun read-fil

php - Azure App Services File Access -

i've got few files on wwwroot/uploads need publicly accessible anyone. it throws 404 error, file exists, , url i'm using correct. can guide me configuring access controls folder? i've tried using .htaccess files (allow all), , tried messing web.config file. no luck though. (the access attributes need applied recursively children of 'uploads' directory. thanks all! update: the problem iis not configured support .mp4 mime type trying use. added in there in main web.config file , works :) thanks @misaim :) this due mime type not being enabled media files default. try removing web.config , enabling mp4 or image file , see if errors go away. https://en.wikipedia.org/wiki/media_type

PHP Pagination target page -

my code working when click on next page in pagination, nothing appear in page. i think problem target page $cat_id = $_get['cat']; $targetpage = "test2.php?cat=$cat_id"; because url want have next page try encode url bellow $targetpage = "test2.php?cat=".urlencode($_get['cat']);

How do you create an Android View Pager with a dots indicator? -

Image
probably many of (as me), have problem creating viewpager bottom dots, this: how create such android viewpager? all need are: viewpager , tablayout , 2 drawables selected , default dots. firstly, have add tablayout our screen layout, , connect viewpager . can in 2 ways: nested tablayout in viewpager <android.support.v4.view.viewpager android:id="@+id/photos_viewpager" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.tablayout android:layout_width="match_parent" android:layout_height="wrap_content"/> </android.support.v4.view.viewpager> in case tablayout automatically connected viewpager , tablayout next viewpager , not on him. separate tablayout <android.support.v4.view.viewpager android:id="@+id/photos_viewpager" android:layout_width="match_parent" android

c++ - Qt - debug dynamic library -

i'm working on qt application arm , using 1 of our own qt library. application compiles , runs fine. now, want debug. i've library source open in qt creator , compiled lib files deployed @ /usr/lib on target ( arm board). setting break points in qt creator not working i.e., debugger never stopping @ breakpoints. how debug dynamically loaded libraries? you don't debug libraries, debug processes. attach process runs on target. if process has loaded library, breakpoints become active.

regex - Using each match in preg_replace() in PHP -

i've read through multiple tutorials on regex , it's associated functions stumped on one. i have really simple replace looks specific delimiter , parses name of php variable. here is: var_dump(preg_replace('/{{\$(.*?)}}/', ${$1}, $this->file)); i keep getting errors php not liking #1 in ${$1} . fair enough, can't start variable name number, knew that... so tried: var_dump(preg_replace('/{{\$(.*?)}}/', ${'$1'}, $this->file)); same thing. yet if try: var_dump(preg_replace('/{{\$(.*?)}}/', '$1 yo', $this->file)); it works... so, how php echo variable named whatever $1 is. for example: $hola = yo; $string = hello{{$hola}}hello{{$hola}}; var_dump(preg_replace('/{{\$(.*?)}}/', ${$1}, $string)); and output be: helloyohelloyo spank you! edit i should mention am aware there standard recommendation on how match php variables regex, i'd working regex understand first. like so:

php - Array to string conversion, what to do? -

i'm having problems array string conversion error. it's occurring here: <div id="pagename"> <?php echo ['select name hjemmesider']; ?> </div> i'm trying fetch row db , display it, can't make work... have tried tons of things try , sort out, , of course researched great bit on internet. in foreach or while use echo $row['your_field_name']; you not doin right.. try this: $sql = "select id, firstname, lastname myguests"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "0 results"; }

java - changing the color of an ellipse using hashtag data using Twitter4j 3.0.3 -

okay, dont know writing code, yet. working on project uses twitter api data. goal project use hash tags represent both , bad things (for sake of simplicity, lets use #good , #bad). i want hashtag data modify color of simple ellipse shade of color in between red , green, depending on number of #good , #bad tweets. think of +100/-100 spectrum. each #good tweet +1, each #bad -1. if @ -100 tweets, ellipse full red. if @ +100 tweets, ellipse full green. i know little complicated, art project im doing. followed tutorial , have twitter data responding on simple array list of tweets (tutorial @ https://www.youtube.com/watch?v=gws6irtgk-c ) using processing, java, twitter4j 3.0.3, , macbook pro osx el capitan 10.11.3 any appreciated. pointing me in direction on how code myself. if need more information me, ill respond see it! configurationbuilder cb = new configurationbuilder(); twitter twitterinstance; query queryfortwitter; arraylist tweets; void setup() { cb.setoauthconsumerk