Posts

Showing posts from July, 2011

android - Resetting plugins due to page load. getting issue -

i using cordova 2.7 ios app. when runing app in device got resetting plugins due page load.and app crashed , stop working. error coming when app loading self not able debug why occurring. 1 have idea how solve. have used of existing solution of solution not working . using xcode 6.3 , ios 8. [4147:50249] multi-tasking -> device: yes, app: yes [4147:50249] resetting plugins due page load.

mysql - Insert into query is not working php -

$sql = "insert `visitors`(`cust_id`, `first_name`, `last_name`, `email_address`, `phone_no`, `st_addr`, `city`, `state`, `zip`, `age`, `ethnicity`, `signup_date`) values (".'$firstname'.", ".'$lastname'.", ".'$email'.", ".'$telephone'.", ".'$street_address'.", ".'$city'.", ".'$state'.",".'$zip'.",".' $age'." , ".'$ethnicity'.",".'$date'.")"; id on auto increment the number of columns don't match. don't need specify id if autoincrement. also '$something' literally insert $something . want use " insert dynamic data. $sql = "insert visitors (first_name, last_name, email_address, phone_no, st_addr, city, state, zip, age, ethnicity, signup_date) values ('".$firstname."', '".$lastname."', '"

How can I discard some unwanted rows from a matrix in Matlab? -

i have matrix a= [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16; 17 18 19 20] i want calculation on matrix. not need rows. have discard of rows above matrix before doing calculation. after discarding 3 rows, have new matrix. b= [1 2 3 4; 9 10 11 12; 17 18 19 20]; now have use b make other calculations. how can discard of unwanted rows matrix in matlab? suggestion helpful. thanks. try this: (use when no. of rows keep lesser) %// input a = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16; 17 18 19 20]; %// rows (1-3,5) wanted keep b = a([1:3, 5],:) output: b = 1 2 3 4 5 6 7 8 9 10 11 12 17 18 19 20 alternative: (use when no. of rows discard lesser) %// rows 2 , 3 discarded a([2,3],:) = []; output: >> = 1 2 3 4 13 14 15 16 17 18 19 20 note: here (in alternate method), output replaces original a . need a if need afterwards. before discarding operation backup input matrix

sql - How to handle recursion in a flat table? -

i have 2 tables keep track of permissions groups of users. first table 2 columns, identifier , name, used solely names of permissions. second table permissions applied , parent permissions assigned create hierarchy. problem i'm using joins create permission hierarchy "string" based on parent permissions and, without knowing how deep parent recursion might go, have no way of knowing how many joins make. questions is, there more correct way solve problem? i've included complete working script, stripped unnecessary columns: create table #temppermissions ( permission_id int identity, permission varchar(50) ) create table #tempapppermissions ( apppermission_id int identity, permission_id int, parent_id int ) insert #temppermissions values ('users') insert #temppermissions values ('add') insert #temppermissions values ('edit') insert #temppermissions values ('remove') insert #temppermissions values ('permissi

c# - Partial View in kendo grid column -

i have ajax enabled kendo grid client template displays data model row bound. (because of ajax, using columns.template seems not possible.) @(html.kendo().grid<model>() .columns(columns => { columns.bound(x => x.submodel).clienttemplate("bla #= somepropertyofsubmodel # bla") }) .datasource(datasource => datasource.ajax()) this works basically, not satisfied result. ex., have problems make kendo controls in template work. rather hang partial view in client template, did not succeed. farthest got was columns.bound(x => x.submodel).clienttemplate(html.partialview("view", //??) //how bind submodel? .tohtmlstring()) any appreciated. i think need .toclienttemplate() in kendo control template, view.cshtml @(html.kendo().numerictextbox() .name("namehere") .min(0) .htmlattributes(new { style = "width:200px" }) .toclienttemplate() )

php - Eloquent sortBy - Specify asc or desc -

trying sort eloquent collection: $collection->sortby('field'); there no information in laravel 4's docs on how choose descending or ascending sort method. is possible? http://laravel.com/api/4.1/illuminate/database/eloquent/collection.html#method_sortby $collection->sortby('field', [], true);//true descending

timer - Setting up batch if statements correctly -

i've written timer batch script can compare real time execution of file vs internal run time looks this: @echo off setlocal enabledelayedexpansion cls /f "delims=_" %%j in ('forfiles /p "%%f" /m *.ext /c "cmd /c echo @path"') ( set start=!time! echo start time: !start! start "program" /d "c:program files\path\to\program" set end=!time! echo end time: !end! /f "tokens=1-4 delims=:.," %%a in ("!start!") ( set /a "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100" ) /f "tokens=1-4 delims=:.," %%a in ("!end!") ( set /a "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100" ) set /a elapsed=end-start if !elapsed! lss 0 set /a elapsed + 8640000 echo elapsed time: !elapsed! the second last line if statement there solve problem of script running past midnight however, doesn't seem wor

xslt - get file name of xml file with xsl -

what's best way name of accessed xml document xsl 2.0? i guess it's combination of resolve-uri , base-uri. base-uri gives me absolute path, need name of file, without path. there smart way wiithout substring-before , stuff that? so when path c:/users/abc/desktop/somefile.xml , need somefile.xml . thanks , tips! how about: tokenize(base-uri(), '/')[last()]

c# - ASP.NET MVC 5 - "Create" view that can handle any number of elements for an IEnumberable based on clicking an "Add row" button? -

i writing recipe manager wife in c#/.net mvc 5. i'm getting page creating recipe, , i'm little stumped. recipe consists of name , list of ingredients. when create view, have form: @using(html.beginform()){ //form elements @html.displaynamefor(x => model.name) //button adding new ingredient recipe <input type="submit" text="submit new recipe!" /> enter code here } when button adding ingredient clicked, should render block of html inside form above button itself, way user can add number of ingredients , submit recipe when form posted controller. for functionality, should make button call controller sends partial view or something? i'm not sure how accomplish outside of javascript, i'm wanting use .net mvc solution if can. i try minimize reliance on javascript whenever can, agree @br4d knockout best option here. if want avoid @ cost, more complex, slower , not user friendly here how it. enclose form in di

Apache ignores .htaccess file -

i have debian apache server. reason apache ignores .htacces file. ideas why happening? here /etc/apache2/sites-available/default file <virtualhost *:80> serveradmin webmaster@localhost documentroot /var/www <directory /> options followsymlinks allowoverride none </directory> <directory /var/www/> options indexes followsymlinks multiviews allowoverride order allow,deny allow </directory> scriptalias /cgi-bin/ /usr/lib/cgi-bin/ <directory "/usr/lib/cgi-bin"> allowoverride none options +execcgi -multiviews +symlinksifownermatch order allow,deny allow </directory> errorlog ${apache_log_dir}/error.log # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. loglevel warn customlog ${apache_log_dir}/access.log combined here .htaccess file rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !-l

javascript - How can I bind data to an event in node.js -

here boiled down version of sort of code i've written: var cb_gen, item, list, label, token; cb_gen = function (token_string) { return function (data) { var msg = "logout of [" + token_string + "] "; msg += (typeof(data.error) == "undefined") ? "succeeded" : "failed"; console.log(msg); }; }; (item in list) { label = "api_" + item; token = make_token(item); app_resources.event.once(label, cb_gen(token)); } this has side effect of generating callback function each iteration of loop. i'd rather following: var cb_gen, item, list, label, token; callback = function (data, token_string) { var msg = "logout of [" + token_string + "] "; msg += (typeof(data.error) == "undefined") ? "succeeded" : "failed"; console.log(msg); }; (item in list) { label = "api_" + item; token = make_token(item);

r - Error using fortify() in ggplot2 -

i creating map using zip code information census data data have each zip code. i obtained shapefiles zip codes https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html . i read in shapefiles using readogr following code: zip = readogr("c:\\...pathname....\\cb_2013_us_zcta510_500k.shp") i running problem when try use fortify can combine information shapefile data. names(zip) [1] "zcta5ce10" "affgeoid10" "geoid10" "aland10" "awater10" test = ggplot2::fortify(zip, region="awater10") error in fortify.spatialpolygonsdataframe(zip, region = "awater10") : `region' not supported the error replicated when try of results names(zip). not sure column contains zip code information interested in, tried of them. my ultimate goal use zip code information ggmap fill in zip codes different colors based on information in data.

How to automate Amazon aws EC2 for scraping -

hi i'd set amazon ec2 instances (multiple) scrape data arbitrary sites. way imagine being set 1 amazon instance that's master programatically set other instances scrape. right have php scripts can scrape way want to, how can set master server to... 1) make other ec2 instances 2) communicate between master server , slave servers you could build having master launch worker instances when needed, send them scrape requests, terminate them when needed , code orchestration , try make highly available. that's not way this. instead, should take advantage of aws features. you use combination of sqs , auto scaling groups. master instance add scrape requests sqs queue , have auto scaling group triggered on sqs queue depth launches new worker instances - helps automate launching of workers (scrapers) when workload high , terminate workers when workload low. worker instances pull scrape request sqs queue, scraping work, , repeat. another way use aws lambda. can tr

frustum - Three.js, center camera to view all objects that is in the scene -

i write algorithm can explode (fold , unfold) mechanical set double clicking on then. but want move camera backward or forward after see objects in fov. i'm trying use frustum calculate intersection between frustum , objects, don't undestand how use planes. i'm working orthographiccamera. what : at every frame recalculate new frustum (when camera move): projscreenmatrix.multiplymatrices( camera.projectionmatrix, camera.matrixworldinverse ); frustum.setfrommatrix(projscreenmatrix); then loop on 6 planes , bounding box of objects in scene : for (var = 0; < planes.length; i++) { var plane = planes[i]; (var j = 0; j < boxs.length; j++) { var box = boxs[j]; var line = new three.line3(box.min, nox.max); //console.log({'plane': plane, 'line': line}); if (plane.isintersectionline(line)) // move camera }; }; but plane.isintersectionline(line) false. do

Why does this python script work on Ubuntu but not Raspbian? -

a friend , created following script utilizing beautifulsoup html of job page, append job array, file, email job in human-readable format ourselves. script works on ubuntu, on raspberry pi, uses raspbian, doesn't work. the message see when running terminal is: 'end of file' , 'start write...' lines in code. there no error messages when running pi, nothing gets appended array , no emails sent. can take look? thanks. import urllib2, email, smtplib, os.path import cpickle pickle bs4 import beautifulsoup class job: """docstring job""" def __init__(self, title, date, url): self.title = title self.date = date self.url = "http://www.forensicfocus.com/"+url def describjob(self): return (self.title +" "+ self.date +" "+ self.url) def createjobsarray(): soup = beautifulsoup(urllib2.urlopen('http://www.forensicfocus.com/jobs').read()) bigfatstring

url - Display page name in javascript? -

how add location.href.split('/').pop() html document display page name? (not whole url) display page name only. example: if page "www.example.com/whaterver/mypage.html" display "mypage". what full script? new javascript , found online don't know whole code. me out? i stick in function in case need reuse elsewhere in code. split page name @ end , take first element: function getpagename(url) { return url.split('/').pop().split('.')[0]; } you can pass in actual url: var pagename = getpagename('www.example.com/whaterver/mypage.html'); // mypage or, using location.href : var pagename = getpagename(location.href); // mypage i might inclined return if there no match *.html , here's revised function returns null if there isn't match: function getpagename(url) { var pagename = url.split('/').pop().split('.')[0]; return pagename.length > 0 ? pagename : null; } demo

Maven Tomcat plugin - 404 WebServlet not found -

Image
i have webapp maven uses tomcat plugin server. app gets compiled .war which, when extracted, seems contain classes (incl. servlets) in web-inf/classes folder. when url http://localhost:8080/com.galya.crm gets hit, index.html (which spa app) gets loaded redirecting http://localhost:8080/com.galya.crm/#!/login/msg/notlogged i have 4 servlets annotated in similar manner: @webservlet("/restapi/login") public class logincontroller extends httpservlet { the problem comes when spa app tries authenticate using login servlet (shown above). expect here: http://localhost:8080/com.galya.crm/restapi/login , 404 error. below attached tomcat plugin folder automatically created. work directory empty , i'm not sure if it's ok. initially webapp/web-inf/web.xml auto generated , contained following: <!doctype web-app public "-//sun microsystems, inc.//dtd web application 2.3//en" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> &

sql server - SQL Trigger Error Code -

i trying develop sql server trigger seems throwing off error me when update records have same values trigger keyword value, if 1 record matches value, not throwing off error. error code: in regards trigger developing snl, seems producing error: subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. statement has been terminated. trigger code: use [testtrigger] go /****** object: trigger [dbo].[testtrigger] script date: 06/04/2015 08:29:34 ******/ set ansi_nulls on go set quoted_identifier on go alter trigger [dbo].[testtrigger] on [dbo].[sn_contact2] insert,update begin declare @idstatus varchar(254) declare @contactid varchar(36) declare @clienturl nvarchar(254) set @contactid = (select contact_contactid inserted) set @idstatus = (select contact_category inserted) set @clienturl = (select cust_1004 inserted) if @idstatus = &#

javascript - How to check mark a check column in a grid? -

i have check column on grid need programatically check mark. here how check column scripted: columns: { items:[ { itemid: 'checkcolumn', xtype: 'selectallcheckcolumn', cls: 'select-all-check-column', dataindex: 'checked', hideable: false }, var grid = ext.componentquery.query('grid[itemid=gridid]')[0]; var view = grid.getview(); var record = view.getrecord({0}); var active = record.get('active'); record.set('active', !active);

jquery - Scala.js: Selecting and manipulating generated SVG -

i'm struggling seemingly simple. using scaja.js, have generated svg scalatags library. i wish manipulate svg elements using events: circ.onclick = { e: dom.mouseevent => ... } specifically, want select elements of class , toggle class attributes on them. i tried scala.js jquery binding. while can retrieve selections it, cannot manipulate selected elements (set classes etc). seems fundamental problem of svg being different kind of dom cannot manipulated jquery. next, tried low level dom api. gets me selection: document.body.getelementsbyclassname("myclass").foreach { node => ... } i struggle manipulating attributes of node . can access them cannot set them, node.attributes.setnameditem(...) requires raw.attr argument have trouble creating, there no constructor set name of attr . also, going low level api quite inconvenient. i'd prefer selection of class easier manipulate, e.g. element . any ideas? there no constructor attr in

linux - Calling a python function with options from shell script -

i have python script takes various options command line e.g. -runs gui python myscript.py -gui -runs without requiring user prompts python myscript.py -aut -runs input data taken input.py python myscript.py input.py -and combinations of above e.g. runs automatically taking input input.py python myscript.py -aut input.py i able call anywhere on linux box. how can this? have tried aliasing in .bashrc file, using method unable accept of input options. have tried export path=$path:/path/to/folder/above_myscript/ but recognises command if type myscript, not python myscript . typing myscript unable run python script. i have tried writing shell script call. #!/bin/bash #file: myscript.sh python '/path/to/folder/above_myscript/myscript.py' however, again unable pass options it. best solution problem? if add #!/usr/bin/env python top of myscript.py file , run chmod +x myscript.py on should able run myscript.py without needing put python b

ios - How to get the local notifications which are listed in Notifications pull down? -

Image
i have ios 8.0 application produces local notifications shown in global notifications pull down ( the notifications view ). perfect! to: get listed notifications app. delete specific notification based on userinfo have provided when producing local notification. i have been looking around https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/remotenotificationspg/chapters/whatareremotenotif.html#//apple_ref/doc/uid/tp40008194-ch102-sw1 and exploring properties , methods uiapplication : uiapplication.sharedapplication().scheduledlocalnotifications.count ~ 1 empty makes sense because notifications in list have been fired , no longer scheduled... so: which api(s) can use ? update 1 most recent explanation scheduledlocalnotifications beining empty ios 8 [uiapplication sharedapplication].scheduledlocalnotifications empty which lead me rather awkward solution storing notification in nsuserdefault key , later key , canceling usual wa

sql server - Running Stored Procedures Hangs Sometimes -

Image
i have stored procedures in sql server called front-end form in vb. here example of doing: it runs 1st stored procedure, runs fine, , populates datagridview, ie. then when click on row runs 2nd stored procedure using of cell values parameters. it's hanging. trying figure out what's causing this. of stored procedures have 2 parameters don't think makes difference.

ruby - How to render the javascript frontend application, in rails json API architecture? -

i working on rails app, front end on martyjs/reactjs. i've set route matches every pattern, user can follow link deep in reactjs app. implementing login/logout , i've came problem. in application_controller.rb i've set filter: before_action :authenticated_account? def authenticated_account? customer = user::customer.find_by_session_token cookies.signed[:session_token] if customer.verify_session!(cookies.signed[:session_token],request.remote_ip ) else resp = response.new("not authorized", nil, 401) end return respond resp if resp end but rightly, deny interface render, since server receive json message. response when app loaded, because app intercept gracefully 401 code. but not find out soluton rendering js app , respond code if user open window , go link directly deep in reactjs app. like i've said, knew missing something. i've dedicated controller action render of html page onepageapplication, , sk

java - Maven copy dependent jars into the war lib -

i have maven project 3 modules inside. 2 projects produces jar on build, , project builds war file. produced war file has dependency jars copied web-inf/lib directory. whereas libraries other projects uses not included. how configure maven project copy other jar files war? the parent pom.xml <project> <....> <modelversion>4.0.0</modelversion> <groupid>company.project</groupid> <artifactid>project</artifactid> <version>1.0.0-snapshot</version> <packaging>pom</packaging> <modules> <module>project-service</module> <module>project-api</module> <module>project-platform</module> </modules> <properties> <java.version>1.8</java.version> <slf4j.version>1.7.2</slf4j.version> <junit.version>4.11</junit.version> <spring.version>4.1.6.release</s

android - Button inside a Widget ListView does not trigger Broadcast -

my widget single listview number of elements. should clickable through listview , since elements have 2 buttons, should clickable, too. desired action on button click broadcast, while list element click should open activity (which works). the receiver registered in manifest , has corresponding intent-filter. in remoteviewsfactory.getviewat(int position) done add pendingintent: private void registerbuttonlistener(remoteviews remoteview, int id, int zoneid) { intent intent = new intent(widgettemperaturereceiver.action); intent.putextra("id", zoneid); intent.putextra("up", id == r.id.buttontempup); intent.setclassname(widgettemperaturereceiver.class.getpackage().getname(), widgettemperaturereceiver.class.getname()); pendingintent pending = pendingintent.getbroadcast(context.getapplicationcontext(), 0, intent, pendingintent.flag_update_current); remoteview.setonclickpendingintent(id, pending); } however nothing received. ideas why

javascript - Catching Mixed content error -

i'm trying detect xhr failing on mixed content. looks different browsers have different implementations: var xhr = new xmlhttprequest(); try { xhr.open('http://otherdomain/'); } catch (err) { console.log(err); // ie10 hits 1 } try { xhr.send(); // chrome fails here, doesn't throw error } catch (err) { console.log(err); // no browser i've tried hits 1 } i don't want use autodetection ( xhr.open('//otherdomain') ), since target might not support http, or https. want know call failed, can show error in page. possible handle correctly browsers? there no way handle error javascript unfortunately. security restriction enforced browser , thrown on lower level. have tried many different methods, including use of extensions nothing worked except timeout handler honest.

sql - PhP Select not sending value -

<?php include ("forms/coneccao_feed.php"); $query = "select id id, nome nome provedor"; $query1= "select max(id) id provedor"; $ultprovedor = mysqli_query ($ligacao_feed, $query1); $ultimo_provedor = mysqli_fetch_row($ultprovedor); $provedores = mysqli_query($ligacao_feed, $query); ?> <select name="provedor"> <?php while($provedor=mysqli_fetch_array($provedores)){ if ($provedor['id'] == $ultimo_provedor['0']){ ?> <option value="<?php echo $provedor['id']; ?

c# - I have stored Table fields and Textbox values in two different list<string> now I want to use those lists in insert query how to do it? -

i have stored table fields , textbox values in 2 different list<string> . i want use lists in insert query how ? , quotation marks if value numeric ? foreach (control txt_name in tb_list) { string txtname = txt_name.text; string field_name = txt_name.name.substring(3); field_name.add(field_name); tb_name.add(txtname); } sqlcommand cmd = new sqlcommand("insert "+ table_name + "('"+ field_name + "') values('" + tb_name + "')", con); table field must separated commas. value field must treated in different ways. example: string values want single quote before , after value, int doesn't.. best way handle insert statement sql procedure.

graph - Find node having two distinct relationship in Cypher -

i newbie in cypher. trying find query returns nodes having more 1 relationship other nodes. please refer http://neo4j.com/docs/snapshot/images/cypher-match-graph.svg structure. trying find person has acted in movie(s) , father. when running below query, giving me 0 records: start n=node(*) match (n)-[r]->() type(r)="acted_in" , type(r)="father" return n,count(n); however, when running below query, return data think not wanted: start n=node(*) match (n)-[r]->() type(r)="acted_in" or type(r)="father" return n,count(n); so basically, need query fetch charlie sheen since acted in wall street movie , father of martin sheen i have tried follow others saying in cypher query find nodes have 3 relationships or how retrieve nodes multiple relationships using cypher query or cypher query find nodes have 3 relationships not able fathom trick :( any of appreciation ! the right way query is: match (p:person)-[:acted_in]

c++ - passing a dummy int int the template argument -

this question has answer here: overloading template classes template parameter number 3 answers recently got stuck in templates , passed dummy argument in template isn't working , gives compilation error here code.. #include <iostream> using namespace std; template<typename t> class a{ private: t b; public: a() { cout<<"1st executing "<<endl; } }; template<typename t,int> class a{ private: t b; public: a(){ cout<<"2nd executing "<<endl; } }; int main(){ a<string> a; a<string,100> b; } in point of view should work fine gives re declaration error , dn't know why .....plz thanks i'm not sure, think template <typename t = int>

YouTube API appears no longer available -

the following url no longer appears return, eg: https://gdata.youtube.com/feeds/api/playlists/59787513dafb0226 just returns 'no longer available' i know playlist fine , correct. could help? api deprecated? regards, alex api v2 turned down . can use migration guide migrate app.

c# - How many threads (timers) can I launch using System.Threading.Timer from one thread? -

i in c# .net 3.5. seems, registering more 10 system.threading.timers same thread causes first ones die off somehow... can't believe though. if true, i'd more shocked. here line, start timer, each time new message arrives: system.threading.timer tmr = new system.threading.timer(waitackelapsedtmrhandler, msgid, constants.time_to_wait_for_ack, timeout.infinite); what else problem ? believe have locked thread shared resources , log in , outs to/from locked zones -> can't see deadlocks. how can detect deadlock in such case ? system.threading.timer can garbage collected if not keep reference alive. after 10 messages appears gc kicks in , kills off timers. switch different timer not garbage collected system.timers.timer or keep kind of reference timer instead of letting variable go out of scope , program should work. see this question more in-depth explanation why system.timers.timer survive gc system.threading.timer not.

Javafx : Restrict Column rearrangement on drag and drop -

in tree table view, can re-arrange columns dragging column headers. want restrict user dragging first column alone . means first column should first column time. is possible? thanks in advance. this simple example storing column arrangement in temporary list , when ever trying move or replace first column resetting column arrangement. !change.getlist().get(0).equals(col1) checks if col1 still @ first location after change. if not, replace old list. mcve import javafx.application.application; import javafx.collections.fxcollections; import javafx.collections.listchangelistener; import javafx.collections.observablelist; import javafx.scene.scene; import javafx.scene.control.tablecolumn; import javafx.scene.control.tableview; import javafx.stage.stage; public class fixfiestcolumntable extends application { public static void main(string[] args) { launch(args); } @override public void start(stage stage) { final tableview tablevie

android - Send Push Notification to the server -

i've implemented gcm push notification in server , in android device . im able send push notification server , receive in device. now im trying send push notification device server. is possible? i heard upstream messages didnt found it. thanks.

Showing Data in Google Maps Drawing -

i using google maps in web page. on map, user can draw circle. have following: var mymanager = new google.maps.drawing.drawingmanager({ drawingmode: google.maps.drawing.overlaytype.marker, drawingcontrol: true, drawingcontroloptions: { drawingmodes: [ google.maps.drawing.overlaytype.circle, ] }, circleoptions: { clickable: true, editable: true, draggable: true, zindex: 1 } }); mymanager.setmap(new google.maps.map(document.getelementbyid("roadmap"), {});); mymanager.setdrawingmode(null); google.maps.event.addlistener(mymanager, 'circlecomplete', function(circle) { }); as user drawing, want show them radius of circle. in other words, may 1.25 miles. circle grows, may go 2.0 miles. there way google maps? if so, how? have been unsuccessful in figuring out how this. thank you! you don't have access circle until circlecomplete event fires. once happens can display radius, , add radius_changed liste

node.js - Best approach to forward upload stream -

i'm working on rest server script written in nodejs. script lets user post request uploading files. since server not responsible store files , taken care of remote server rest server, forward/redirect file upload stream remote server. best approach that? should buffer stream , wait until receive file in entirety before streaming remote server? or should pipe chunks remote server receive them? tried piping in upload route statement - req.pipe(request.post(connection).pipe(res) but received error remote server - "connection has been cancelled client". or is possible redirect incoming upload stream remote server script wouldn't middleman? thanks

forms - MS Access calculated fields changing to "#Error" -

i have form runs off of query , works swimmingly, or @ least appears. have 3 fields in question: id field, client name field, , age field. age field client's age @ signing of quote, calculated field using date of quote , client's dob. the age calculation works upon first look. reason id , name fields in question because when double click them opens form, yet again works fine. problem when exit forms , come original form. the age field of whatever record on changes "#error" instead of displaying. if click on different record in form age field changes "#error" well. seems happen every time , have no clue why. has solved issue similar or have idea on how solve it? thanks in advance! update: changed open report rather form , issue still there. the calculation in question: int(([effectivedate]-[dateofbirth])/365.25) try calculating age way: datediff("yyyy", [dateofbirth], [effectivedate]) + ([effectivedate] < dateseri

Create VB.NET password protected installer -

i'm trying create installer vb.net project in vs 2010. however, want make installer require password or key install project. haven't been able find anywhere possible. ideas? i go file > add project usually, issue want create sort of license key users install. doesn't have randomize, can password. i'm going 1 installing this. if want have password protection own installer add form this: visual basic .net tutorial 12 -how create password protection using textbox in vb.net something like... if textbox.text = "password" msgbox("true!") frmtwo.show() else msgbox("false!") end if define password char * in text field's properties!

Cassandra row level isolation -

i have table created in cql : create table isolation_demo(key text,column1 text,column2 text,column3 text ,primary key(key,column1,column2)); i have 2 statement in batch. update isolation_demo set column3 ='abc' key =1 , column1 =1 , column2=1; delete isolation_demo key =1 , column1 =2 , column2=2; here both statements share same partition key. (key=1), different clustering column values. these 2 statements isolated? these queries must isolated, mentioned in c* docs here , here : in versions of cassandra, possible see partial updates in row when 1 user updating row while user reading same row. example, if 1 user writing row 2 thousand columns, user potentially read same row , see of columns, not of them if write still in progress. full row-level isolation in place, means writes row isolated client performing write , not visible other user until complete.

xml - Toolbar spacing issue using Android Design Support Library -

Image
while following liuguangqiang's sample , chris bane's cheesesquare samples android design support library, there seems issue in toolbar spacing, in image. here activity.xml code: <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="192dp" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar"

ios - Load custom view from .xib doesn't fit to iPhone 6+ -

Image
i m using autolayout in app. when load custom uiview .xib from viewdidload it's size (300,325) should be, on iphone6+ is't (394, 493). but when load custom uiview .xib after (somewhere) size isn't change ( stay (300, 325) ) iphone6+ scale. can u reason , solution? thanks in advance! you have use add new constraints specific uiview. it's automatically resize view. otherwise if xib somewhere ... have set frame programmatically based on device.

function - XLST concatenating two arrays -

i'm trying concatenate 2 string arrays in special way. arrays like this: first array (arg1): 'a', 'b', 'c' second array (arg2): '-3', '', '-4' the result should 1 string: 'a-3/b/c-4' but code i'm getting result (only last part returned): 'c-4' code: <xsl:function name="functx:k" as="xs:string"> <xsl:param name="arg1" as="xs:string*"/> <xsl:param name="arg2" as="xs:string*"/> <xsl:variable name="indexedpath"/> <xsl:for-each select="$arg1"> <xsl:variable name="i" select="position()" as="xs:integer"/> <xsl:variable name="indexedpathnew" select="concat($indexedpath, $arg1[$i], $arg2[$i], '/')"/> <xsl:variable name="indexedpath" select="$indexedpathnew"/>

Adding a secondary element to show where user has dragged slider to in JQuery UI -

using normal implementation of jquery ui slider code: $(function() { $('.slider').slider(); }); jquery ui creates surrounding slidable area, , handle drag. have experience extending add secondary element shows user has dragged to? want achieve have 2 colour draggable area, either side of handle. you can add divs in slider , update size on slide event. this: $('.slider').slider({ max: 100, min: 0, slide: function (e, ui) { $('.left-side').css('width', $(ui.handle).position().left) $('.right-side').css('width', $(e.target).width() - $(ui.handle).position().left) } }); $('.left-side').css('width', '0px'); $('.right-side').css('width', $('.slider').width()) .slider div { position: relative; height: 100%; } .left-side { background-color: aliceblue; left: 0px; width: 200px; float: left; }

ios - Using CAShapeLayer fill color issue -

Image
i want draw circle text inside.unable display text.any help? below image ref. expected behaviour. below code reference: uilabel *lbltitle = [[uilabel alloc]initwithframe:cgrectmake(100, 40, 40, 40)]; lbltitle.text = @"me"; lbltitle.textcolor = [uicolor blackcolor]; lbltitle.font = [uifont fontwithname:@"helveticaneuelight" size:10.0] ; lbltitle.textalignment = nstextalignmentcenter; [view addsubview:lbltitle]; cashapelayer *circlelayer = [cashapelayer layer]; circlelayer.path = [uibezierpath bezierpathwithovalinrect:cgrectmake(0, 0, 40, 40)].cgpath; circlelayer.fillcolor = [uicolor clearcolor].cgcolor; circlelayer.fillcolor = [uicolor colorwithred:56.0/255.0 green:212.0/255.0 blue:203.0/255.0 alpha:1.0f].cgcolor; circlelayer.strokecolor = [uicolor blackcolor].cgcolor; circlelayer.linewidth = 1; [lbltitle.layer addsublayer:circlelayer]; you can setting cornerradius of uilabel @sujay said: uilabel *lbltitle = [[uilabel alloc]initwithframe:cg

javascript - Why angular JS behave differently? -

in angular js controller, put list $scope below: $scope.processes = ['process-aa','process-bb', 'process-cc']; $scope.selectedprocess=-1; $scope.collapseprocess = function(index) { console.log('-----------------------in collapseprocess-------------- %s, %s', $scope.selectedprocess, index ); return $scope.selectedprocess != index; }; $scope.switchcollapse = function(index) { $scope.selectedprocess = index; } the page list processes , there div inside of each process, make div toggle. @ time, 1 div allowed expand. html below: <li ng-repeat="process in processes" class="resultitem" ng-click="switchcollapse($index)"> <div collapse="collapseprocess($index)" class="collapseblock"> </div> </li> the above code totally works expected. when select first process, inner div expanded, if select second process, first process's div collapsed ,

php - ZF2 & Apigility - Correct way to setup GET and POST RPC services -

what correct way setup , post services in apigility? currently, if setting service, include variable require in route: /api/verify/merchant[/:merchant_code] and if wish setup post service, route becomes: /api/verify/merchant and add merchant_code 'field' and if want route accept both post , get, this: /api/verify/merchant[/:merchant_code] and add merchant_code field well... is correct way setup routing this? in general post new entities on collection endpoint in case /api/verify/merchant . server respond new resource self href newly created merchant . href formatted /api/verify/merchant[/merchant_code] merchant_code identifier newly added merchant resource. sending post request /api/verify/merchant[/merchant_code] not necessary/valid. get , patch , delete or put requests on endpoint of merchant resource depending on action want perform (read, update, delete, replace).

multithreading - tbb matrix mulitiplication stack overflow error c++ -

i'm trying matrix multiplication using task in intel tbb, algorithm i'm using strassen's algorithm... here code main() : #include "matrix.h" #include "tbb/tick_count.h" using namespace tbb; using namespace std; //here how call mattask class matrica callparallel(matrx& a, matrix& b, matrix& c, int n){ mattask& t = *new (task::allocate_root ()) mattask (a, b, &c, n); task::spawn_root_and_wait (t); return c; } int main(){ int rows, columns; matrix serialc; cout << "*******************\n" << "if rows , columns < 6 enter matric manualy\n" << "********************\n" <<endl; cout << "enter rows matrix a: "; cin >> rows; cout << "enter columns matrix a: "; cin >> columns; matrix a(rows, columns); if(rows > 5 && columns > 5){ a.creatematrixautomatic();

How to pass a Swift array to an Objective-C function -

i'd pass array of cgpoint values objective-c function. swift: var mypoints:[cgpoints]? = [cgpoint(x: 0, y:0)] objcwrapper.callsomething(&mypoints) objective-c + (void) callsomething: (cgpoint []) points {...} error got: cannot invoke 'callsomething' argument list of type 'inout [cgpoint]?)' the problem you’ve made mypoints optional, i.e. [cgpoint]? instead of [cgpoint] . code snippet, it’s not clear why you’re doing this. if there’s not need wider context, drop ? , code should compile. note, if objcwrapper.callsomething function wrote , control, consider making take const cgpoint [] instead if doesn’t need change values in array. way, won’t inout won’t need & in front of mypoints , , use if it’s declared let , i.e.: // no need give type, can inferred [cgpoint] let mypoints = [cgpoint(x: 0, y:0)] objcwrapper.callsomething(mypoints) if declare as: + (void) callsomething: (const cgpoint []) points {...} if on other

Scala existentials placeholder translation for M[_,_] where M[X,Y <: N[X]] -

given following types trait n[x] trait m[x, y <: n[x]] how scala translate this: m[_,_] i've tried following without success: scala> import scala.reflect.runtime.universe._ import scala.reflect.runtime.universe._ scala> typeof[class[_]] =:= typeof[class[c] forsome { type c }] res4: boolean = true scala> typeof[list[class[_]]] =:= typeof[list[class[c] forsome { type c }]] res5: boolean = true scala> typeof[m[_,_]] =:= typeof[m[x,y] forsome { type x; type y <: n[x] }] res5: boolean = false warning: existential type m[x,y] forsome { type x; type y <: n[x] }, cannot expressed wildcards, should enabled making implicit value scala.language.existentials visible. quite puzzling? if cannot expressed wildcards compiler should produce error rather warning, shouldn't it? scala translates m[_,_] m[x, y] forsome { type x; type y } . proven: scala> type foo = m[_,_] defined type alias foo scala> type bar = m[x, y] forsome { type x;

node.js - Debugging with node-inspector: Cannot GET / -

i running nodejs server application want debug. in order achieve using node-inspector run app follows: node-debug server.js unfortunately can not access webserver via url anymore. visiting http://127.0.0.1:8080 results in cannot / however if start application usual way with node server.js everything fine (except fact can not debug). can access http://127.0.0.1:8080 . the '/' request not logged seems never reaches server. hence problem have is: can access remote debugger via http://127.0.0.1:8080/debug?ws=127.0.0.1:8080&port=5858 can not start debugging because can not trigger action on webserver via url. oh , debugger not paused or anything. skipped first break point. i resolved problem choosing different port 8080. seems debugger uses port. not aware of because port familiar me used application.

tomcat - MaxActive database connection parameter doesn't work -

i have problem datasource configuration. i have tomcat 7 java 7 , quartz web application. application has datasource configured: <resource auth="container" driverclassname="com.mysql.jdbc.driver" factory="org.apache.tomcat.dbcp.dbcp.basicdatasourcefactory" logabandoned="true" maxactive="3" maxidle="1" maxwait="10000" name="jdbc/name" password="xxxxxx" removeabandoned="true" removeabandonedtimeout="120" type="javax.sql.datasource" url="jdbc:mysql://xxxxxx:3306/xxxxx?autoreconnect=true&zerodatetimebehavior=converttonull&rewritebatchedstatements=true" username="usr" validationquery="select 1" /> with maxactive = 3 expected see no more 3 connection opened. instead of this, see new connection opened every time quartz job starts, untill 8 connection (don't know if defaul

ios - Dynamically set the height of uitextview like message app -

i having problem of setting height of uitextview message app. it's achieved increasing height of when ever newline occurs. my problem when user edits text content it's not decreasing height of container, in textview child. i using auto layout , code - (void)textviewdidchange:(uitextview *)textview { uitextposition* pos = self.posttextview.endofdocument;//explore others beginningofdocument if want customize behaviour cgrect currentrect = [self.posttextview caretrectforposition:pos]; if (currentrect.origin.y > previousrect.origin.y){ if (self.containerheightt.constant == 99) { return; } self.containerheightt.constant += 10; nslog(@"the container height %f",self.containerheightt.constant); } previousrect = currentrect; } please tell me how detect when line gets deleted textview , thereafter reducing height of container. please below way - make sure uitextview s

Iterate through directories recursively in PHP -

when upload photos web server try split photos several folders won't have many photos in 1 single folder. for example inside class: $filename = hash('crc32b', mt_rand()); $img_dir = upload_dir.ds.'img'.ds.$filename[0].$filename[1].ds.$filename[2].$filename[3].ds.$filename[4].$filename[5]; ds short version of directory_separator this create directories these: public_html\assets\upload\img\25\55\8b public_html\assets\upload\img\00\8c\2a if file not exist , there no directories already $img_path = $img_dir.ds.$filename.'.jpg'; if (!file_exists($img_path) && !is_dir($img_dir)) { $mode = 0755; mkdir($img_dir, $mode, true); chmod(upload_dir, $mode); chmod(upload_dir.ds.'img', $mode); chmod(upload_dir.ds.'img'.ds.$filename[0].$filename[1], $mode); chmod(upload_dir.ds.'img'.ds.$filename[0].$filename[1].ds.$filename[2].$filename[3], $mode); chmod(upload_dir.ds.'img'.ds.$filename[

apache - HTTPS for www and non-www only - HTTP for all subdomains -

i have certificate single domain only, including www. current .htaccess setup, redirecting http requests https. want make following: force https domain.com (www , non-www) allow http subdomains *.domain.com is possible? my current .htaccess setup forces use https # force ssl rewritecond %{https} !=on rewriterule ^ https://%{http_host}%{request_uri} [l,r=301] i have found 1 solution: # force https www rewritecond %{https} off rewritecond %{http_host} ^(?:www\.)(domain\.com)$ [nc] rewriterule ^ https://www.%1%{request_uri} [r=301,l] # force http subdomains rewritecond %{https} on rewritecond %{http_host} ^((?!www).+\.domain\.com)$ [nc] rewriterule ^ http://%1%{request_uri} [r=301,l]

html - More columns in Typo3 7.2 (Bootstrap) -

i need make 4 column website bootstrap in typo3 default setting have 2 cols max. able edit each column in backend have created layout following tutorial: http://blog.sebastiaandejonge.com/articles/2012/july/26/implementing-typo3s-backend-layouts/ i cannot display content of columns on frontend though. in template section page uses layout have added agptop1 < styles.content.get agptop1.select.where = colpos = 20 agptop2 < styles.content.get agptop2.select.where = colpos = 21 etc positions set in layout manager. should specify variable agptop1 created template file among other bootstrap templates in typo3conf\ext\bootstrap_package\resources\private\templates\page it copy of default template things changed like... <f:layout name="default"/> <f:section name="main"> <f:cobject typoscriptobjectpath="lib.dynamiccontent" data="{pageuid: '{data.uid}', colpos: '3'}"/> <div class=&q