Posts

Showing posts from June, 2014

ftp - In PhpStorm, what do I need a "HTTP connection" for? -

Image
i want create project remote files via ftp connection. in "add remote server" dialog, set ftp connection. "test connection" told me it's valid, , can choose root directory, ftp working. however, right under it, there "web server root url" input , "don't check http connection server" checkbox. need these for? what's point of http connection, when using ftp? documentation doesn't explain in no sense. i had check latter box, otherwise couldn't continue import/synchronizing: says "connection failed: connection refused", although ftp connection stable. made me think needed ftp and http. for visualisation purposes:

java - ForkJoinTask understanding -

what happens after subtask.fork() returns forkjointask<int> object? compute() method invoked many times after , how? i'm new java , i'm trying learn concept of fork/join framework. saw code below online. know after reading java api subtask.fork() returns object of forkjointask<v> , forkjointask<int> in case. couldn't understand happens after that? output indicate compute() method have been invoked many times after , how? public class myrecursiveaction extends recursiveaction { public static void main(string[] args) { myrecursiveaction mra1 = new myrecursiveaction(100); forkjoinpool fjp1 = new forkjoinpool(); fjp1.invoke(mra1); } private long workload = 0; public myrecursiveaction(long workload) { this.workload = workload; } @override protected void compute() { //if work above threshold, break tasks smaller tasks if(this.workload > 16) { system.out.pr...

php - Trying to use an array value as an SQL insert value -

hey guys trying use value got previous query in new one, value string stored in array, $name , $email variables, looks when var_dump them... string 'nathgold' (length=8) .... want use nathgold value in insert of new query. error notice: array string conversion in c:\wamp\www\login\post.php on line 30 <?php include_once('connect-db.php'); session_start(); if(!isset($_session['islogged'])) { header("location: home.php"); die(); } if (!isset($_request['mbid'])) exit; if (!isset($_request['parent'])) { $parent = 0; } else { $parent = $_request['parent']; } if (isset($_post['title'])) { $user_info=mysqli_query($connection, "select * usertest id=".$_session['user']); $userrow=mysqli_fetch_array($user_info); $name = $userrow=['username']; $email = $userrow=['email']; $title = mysqli_real_escape_string($c...

javascript - ReactJS - What is the best way to push data in an array within an array? -

i wanted push data inside object(orders). orders have array inside products, parts , prints. want push data in prints only. meaning have 2 buttons, 1st button push data of orders while 2nd button push portion of orders, prints. can see prints under orders. can suggest way on how can this? below array of orders have. want push data orders.prints orders: [{ product: { ptype: '', name: '', brand: '', color: '', files: [] }, parts: [], prints: [{ name: '', width: '', height: '', colors: '' }], breakdown: [{ size: '', quantity: 0 }] }] got working adding value in orders set index. orders[0] onaddprint = () => { var newprints = this.state.ord...

c# - How can I bind a model property to another property of the same instance of that model? -

Image
tl;dr : <usercontrol.datacontext> <foo:bar> <foo:bar.baz blat={binding source={relativesource self}, path=bing, mode=twoway}"/> results in following error message : system.windows.data warning: 40 : bindingexpression path error: 'bing' property not found on 'object' 'relativesource' (hashcode=38995967)'. bindingexpression:path=bing; dataitem='relativesource' (hashcode=38995967); target element 'bar' (hashcode=53937671); target property 'baz' (type 'baz')` and ends binding failing - why? the meat of problem i have rather convoluted colormodel class in have inherited dependencyobject inotifypropertychanged : [serializable] public class colormodel : dependencyobject, inotifypropertychanged { } within class 4 double values - alpha , red , green , blue : //the latter 3 dependencyproperties pretty same : public static readonly dependencypro...

ios - Upload a new version to app store? -

i downloaded source code of app github built else. have made quite few changes in app. test app on iphone, changed bundle id, codesigning, provisioning profile etc. issue how update app on appstore? need download provisioning profiles or other files upload safely? how code sign app again no problems occur? kindly help. if app created on developer account can not change bundle id it. you need delete appid developer account , create new appid , assign new bundle id , create certificate, provisional profile initial.

Alternative to simulink transparent subsystem -

Image
i need organize set of elements in simulink. first method create subsystem. problem subsystem elements inside no longer visible. alternative method create colorized box , put behind set of elements background. makes lot of troubles during selection of elements. the ideal method have subsystem transparent can see elements inside it. can make large , see inside without opening it. what feasible alternative method? knowing there no support simulink doing this, possibility use mask icon shows content. following rough prototype mask code: model='s1/subsystem'; loc=fullfile(pwd,[model,'.png']); print(['-s' model], ['-dpng'], '-r300', loc); image(loc); port_label('input',1,'in1'); port_label('output',1,'out1'); obviously prototype has multiple issues must addressed when using code: remove hard-coded directory. set in- , outports automatically. create required folder structure. (folder s1 must...

amazon s3 - S3 upload on https with dots in bucket name -

i've been trying implement ajax upload amazon's s3 on site uses https, of course have upload secure version of s3, https://bucket.name.s3.amazonaws.com . however, when try upload, end getting error site has invalid security certificate. reading, expected because amazon's s3 certificate covers 1 level of subdomains ( http://shlomoswidler.com/2009/08/amazon-s3-gotcha-using-virtual-host.html ). therefore, changed url i'm uploading to https://s3.amazonaws.com/bucket.name , i've read, supposed equivalent https://bucket.name.s3.amazonaws.com . however, attempts upload there gave me 301 permanent redirect error. know fact code works, because when attempted instead upload bucket no dots in name, https://bucket.s3.amazonaws.com , went through fine, gets 301 when attempt https://s3.amazonaws.com/bucket . <form id="form"> <input type="hidden" name="key" value="..." /> <input type="hidden" name...

python 3.4 - How do you set a variable from an input in a module -

so, i'm trying set variable in main program integer input function in module. can't work out how this. this main program. menu name of module, i'm using display menu. 'menulist' want menu display. part works ok. import time, sys menu import * menulist = ['say hi', 'say bye', 'say yes', 'say no', 'exit'] choice = int(0) menu(menulist) choosing(menulist, choice) print(choice) ##this can see if choice == 1: print('say hi') elif choice == 2: print('say bye') elif choice == 3: print('say yes') elif choice == 4: print('say no') elif choice == 5: sys.exit() else: ##this print if choice doesn't equal want print('error') this module. import time def menu(menulist): print('menu:') time.sleep(1) x = 0 while x < len(menulist): y = x + 1 printout = ' ' + str(y) + '. ' + menulist[x] print...

asp.net web api - How to show Json string data in list view for multiple columns in Xamarin.android using C#? -

i trying make android app using xamarin. new xamarin, facing issue i.e how display json string data in listview or in grid. i using webapi fetch data database. webapi returns string is- [{"questionid":2,"question1":"4,8,12 digit greatest?","answer":"12"}] method using in android application is- private string questionlist() { var url = httpwebrequest.create(string.format(@"url")); url.contenttype = "application/json"; url.method = "get"; string tempdata = string.empty; using (httpwebresponse response = url.getresponse() httpwebresponse) { if (response.statuscode != httpstatuscode.ok) console.out.writeline("error", response.statuscode); using (streamreader reader = new streamreader(response.getresponsestream())) { var c...

javascript - How to parse HTML tags from JSON Object -

i have json object has value of html styles. tried including in html using jquery append . the value getting appending, not converting normal dom, appending whole thing string. this json object value: var obj = { content : "<p>&lt;linkrel=&quot;stylesheet&quot;type=&quot;text/css&quot;href=&quot;http:<p>&lt;styletype=&quot;text/css&quot;&gt;<br/>.wrap{<br/>&nbsp;&nbsp;background-color:#f6f6f6;<br/>}<br/>&lt;/style&gt;</p><p>&lt;divclass=&quot;wrap&quot;&gt;<br/> &lt;/div&gt;</p>" } this tried: html: <div id='container'></div> js: $('#container').append(obj.content); demo output should part of dom, instead printing entire thing string. you can ... var obj = { content : '<p>&lt;style&gt;.wrap{color:red}&lt;/style&gt;&lt;div class=...

php - How to compare two encrypted(bcrypt) password in laravel -

how compare 2 bcrypt password $pass1 = '$2y$10$oopg9s1lcwugyv1nqeynco0ccyjf8hlhm5djxy7xoamvgiczxhb7s'; and $pass2 = '$2y$10$qrgais6bpatkkqet22zgkuhq.eddfxqc2.4b3v.zan.gtgwoyqumy'; both $pass1 & $pass2 bcrypt 'test'. how can check equality. without using text 'test' this $hash1 = hash::make('test'); $hash2 = hash::make('test'); var_dump(hash::check('test', $hash1) && hash::check('test', $hash2)); you can't compare 2 encrypted bcrypt passwords each other directly strings because encryption contains salt makes hashes different each time.

Keep calling channel after called channel hangs up in Asterisk -

i want execute agi script calling party after called party hangs up. example, doing survey customers going run agi script after agent hangs up. unfortunately, when agi scripts runs agi debug output says: "511: command cannot executed on dead channel" use commands "answer" or "stream file" in agi script need channel run on. know calling channel hangs called party hangs up. tried deadagi instead of agi , "g" option in dial command none of them works. so, think have search solution keep calling channel can run script on that. suggestion please? you should not use "g" param case, because caller hangup. should use "f" f([[context^]exten^]priority): when caller hangs up, transfer *called* party specified destination , *start* execution @ location. note: channel variables want called channel inherit caller channel must prefixed 1 or 2 underbars ('_'). f: when caller hangs up, transfer *c...

r - Package inputenc Error & Error: pandoc document conversion failed with error 43 -

i trying produce pdf file knitr in rstudio encountered problem. have read lot of solutions found on stack overflow , google not helpful. please me this? obliged! the error shown below: output file: final_project.knit.md "c:/users/johnl_~1/appdata/local/pandoc/pandoc" +rts -k512m -rts final_project.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output final_project.pdf --template "e:\r\r-3.2.3\library\rmarkdown\rmd\latex\default-1.15.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" ! package inputenc error: unicode char 骞?(u+5e74) (inputenc) not set use latex. see inputenc package documentation explanation. type h immediate help. ... l.128 \maketitle try running pandoc --latex-engine=xelatex. pandoc.exe: error producing pdf error: pandoc document conversion failed e...

java - Mockito when().thenReturn doesn't work -

i'm trying write tests spring controller , having problem. following code returns redirect:/welcome though have when(result.haserrors()).thenreturn(true); should return add . may i'm doing wrong. me solve this, please. controller @controller public class springcontroller { @autowired private userservice userservice; @autowired private correctvalidator correctvalidator; @autowired private existvalidator existvalidator; @autowired private unwrapper unwrapper; @requestmapping(value = "/create", method = requestmethod.post) public string create (wrapper wrapper, bindingresult result) throws parseexception { correctvalidator.validate(wrapper, result); existvalidator.validate(wrapper, result); if (result.haserrors()) { return "add"; } userservice.create(unwrapper.unwrap(wrapper)); return "redirect:/welcome"; } } test @runwith(springjun...

ms access - Unable to Group on MSAccess SQL multiple search query -

Image
please can me before go out of mind. i've spent while on , resorted asking helpful wonderful people. have search query: select groups.groupid, groups.groupname, ( select sum(siterates.sitemonthlysalesvalue) siterates invoicesites.siteid = siterates.siteid ) sumofsiterates, ( select count(invoicesites.siteid) invoicesites siterates.siteid = invoicesites.siteid ) countofsites (invoicesites inner join (groups inner join sitesandgroups on groups.groupid = sitesandgroups.groupid ) on invoicesites.siteid = sitesandgroups.siteid) inner join siterates on invoicesites.siteid = siterates.siteid group groups.groupid with following table relationship http://m-ls.co.uk/extfiles/sql-relationship.jpg without group entry can list of entries want drills results down siteid instead want group groupid. know...

html - Which is better? Having 1000 clients using SSE to talk with server or Ajax polling by 1000 clients to the server -

i beginning learn ajax , sse. performance wise method considered better? assume application cater 1000 clients. having server sent events keep 1000 http connections open 1 way communication push updates clients. or having clients implement ajax polling every 1 second server. you not want have each client poke server every 1 second. make math: 1000 requests every second. 1 of request starts taking more 1 second, start launch denial of service on own server. i don't know if in asp.net environment server, if are, suggest take @ signalr library . a typical demo app signalr chat program. see chatjs or jabbr . you can follow tutorial learn more signalr.

c# - if, else if vs. mapping performance -

i have performance question. i parsing large text files (bills) , assigning name of service provider variable based on if text appears on bill. this small sample of doing (don't laugh, know it's messy). in all, there approximately 250 if, else if's. if (txtvar.billtext.indexof("swgas.com") > -1) { txtvar.provider = "southwest gas"; } else if (txtvar.billtext.indexof("georgiapower.com") > -1) { txtvar.provider = "georgia power"; } else if (txtvar.billtext.indexof("city of austin") > -1) { txtvar.provider = "city of austin"; } // , on , forth 250 times because grew big decided take different approach cleaner , more efficient. ended implementing mapping, store in external .psv file. i save mapping variable (this runs once , takes 35 milliseconds... var providermap = system.io.file.readlines(@"u:\program\applicationfiles\provider...

javascript - Multi canvas layer paint application in HTML5 -

i building paint tool eraser option using html5 canvas. canvas loads backgroung image , on image users can draw paintings. on using eraser tool painted part should erased(not part of image). know must use more 1 canvas it. please me code example if can. in advance. yes, can use 2 canvases support both indestructible background , sketching foreground. btw, background doesn't need canvas. image or div content. a quick illustration you can wrap background , sketching canvases in wrapper div: <div id="wrapper"> <canvas id="canvas2" width=300 height=200></canvas> <canvas id="canvas" width=300 height=200></canvas> </div> then use css position sketching canvas directly on top of background canvas: body{ background-color: ivory; } #wrapper{ position:relative; width:300px; height:200px; } #canvas,#canvas2{ position:absolute; top:0...

python - mysql setting user name and password -

i have installed mysql on mac osx , can open in shell , gain access databases , tables come it. now want create database in python using mysql-connector/python before doing figured wise set user name , password in mysql. i have tried using following error messages. goal set user name , password may provide mysql-connector python, , execute sql queries python environment. here tried @ mysql command prompt: set password 'root'@'localhost' = password('newpwd'); and error message: error 1044 (42000): access denied user ''@'localhost' database 'mysql' so tried update method: update mysql.user set password = password('newpwd') user = 'root'; and error message: error 1142 (42000): update command denied user ''@'localhost' table 'user' so know why denied , how can make changes create user , password may use in mysql connect in python environment? sounds not authenticated....

django - Converting geometry point to lat/long in Geodjango app -

i'm creating web mapping application using django, geodjango, openlayers , postgis. want zoom on openlayers basemap location of city has been selected combo box , figure can passing lat/long coordinates , zoom level openlayers. i have view function runs django query filter selected city , calculate centroid returned queryset, shown below. centroid = lga.objects.get(name=lga).geom.centroid the way setting map centre statically following code: var center = new openlayers.lonlat(133.0, -27.0).transform( new openlayers.projection("epsg:4326"), map.getprojectionobject() ); those coordinates centre of australia, want set map centre dynamically selected city using django template variables lat , long. i'm not sure how lat , long centroid calculate in view function, or alternatively, if there way set map centre in openlayers passing geometry rather coordinates. thanks in advance help. ro what geometry point formatting? can provide exampl...

java - How do I combine multiple Jar files into one deliverable Jar? -

i have been researching trying find way combine multiple jar files on jar deliverable. in directory have ant file named jar_gen.xml consists of following code in entirety <target name="combine-jars"> <jar destfile="out.jar"> <zipgroupfileset dir="lib" includes="*.jar"/> </jar> </target> in same directory have directory named lib contains of jar files flatten. i have been running ant script with ant -buildfile jar_gen.xml making sure running same directory jar_gen.xml file in. i getting no output ant script , have not idea why. can please me fix script may flatten of jars , continue constructing deliverable package. note i have no main class eclipse runnable jar not work me i have little experience running ant scripts complete answers helpful. is directory structure set correctly? i created quick test using script , appears work, given have set in directory structure ...

sql - Order by last digit in a number column in oracle 11 -

i have number column in table have order records basing on last digit of column value. for ex, want records ends '2' , created 'john' first , remaining below ## number ## ## createdby ## 3234445452 john 3432454542 john 3432454572 alex 1234567890 john 3432432441 john thanks help... if want order last digit can use mod(value, 10) . if want have ending 2 first (which suppose isn't stranger rest of requirement) can use case statement within order clause: with t42 as( select 3234445452 value dual union select 3432454542 dual union select 1234567890 dual union select 3432432441 dual ) select value t42 order case when mod(value, 10) = 2 0 else 1 end, mod(value, 10), value; value ---------- 3234445452 3432454542 1234567890 3432432441 so puts ending 2 first, remainder ordered last digit, end 'buckets' 2, 0, 1, 3, 4, 5, ... , first 2 arguments of order by . third...

date - How to store java.util.sql to XMLGregorian Calendar -

i trying change format of xmlgregoriancalendar date. code in schema file(.xsd) this: <xs:element name="latestsaledate"> <xs:annotation> <xs:documentation>latest sale date on property (format mm/dd/yyyy)</xs:documentation> </xs:annotation> <xs:simpletype> <xs:restriction base="xs:date"/> </xs:simpletype> </xs:element> i created java classes xjc command i got setter , getter set latestsaledate as: @xmlelement(name = "latestsaledate") protected xmlgregoriancalendar latestsaledate; but when trying date db , assign xmlgregoriancalendar object gives me illegalargumentexception can here me how can solve , format write xml file in format dd/mm/yyyy can here me how can solve , format write xml file in format dd/mm/yyyy you can't , shouldn't - @ least not without changing schema. schema expressly specifies it's xs:date - , spe...

angular using ui-select2 to assign an object as a model property -

hypothetical example illustrate problem having using angular-ui select2. let's have screen want edit "game" model. game, among other things has players. want able set players via select2 drop down menu. here's example code: app.js $scope.getgamepromise().then(function(results) { $scope.game = results; console.log(game.players); //prints [{name:'joe',age: 15},{name:'sally',age:16}] }); $scope.players = [ { name: 'joe', age: 15 }, { name: 'fred', age: 14 }, { name: 'sally', age: 16 }, { name: 'lucy', age: 13 } ] view.html <select ngmodel="game.players" ui-select2 multiple> <option ng-repeat="player in players" value="player">{{ player.name }}</option> </select> when want save 'game' object, send game object server. server expecting game.p...

javascript - Cannot center my menu option items -

i'm having trouble centering items within dropdown menu. i've tried many things suggested on website , none seem work. here css: select { -webkit-appearance: button; -webkit-user-select: none; -webkit-padding-start: 6px; -webkit-padding-end: 6px; background-color: #050505; color: #ffffff; border: 1px solid #ffffff; box-shadow: 11px 10px 5px #000000; text-shadow:4px 4px 10px #000000; font-family: "uglyqua", arial, helvetica, sans-serif; font-size: 20px; font-weight: bold; padding-top: 2px; padding-bottom: 2px; text-align: center; white-space: nowrap; } ..and html: <!doctype html> <html> <head> <script language="javascript" type="text/javascript"> function jump(form) { var myindex=form.menu.selectedindex if (form.menu.options[myindex].value != "0") { window.open(form.menu.options[myindex].value, target="iframe1"); } } //--> ...

java - File Synchronization in Eclipse through the Ubuntu One -

i working in 2 machines , using ubuntu 1 synchronize files. when create workspace folder eclipse , project (java project example) inside of ubuntu 1 path, works fine first time, when closed , open in machine, or same machine, project problems doesn't show in package explorer windows. *.java , *.class files synchronize looks project path o similar confuse. i know maybe not right way synchronize work, in moment that, perhaps should change git o similar. does have idea problem or best way synchronization?

python 3.x - How to create multiple value dictionary from pandas data frame -

lets have pandas data frame 2 columns(column , column b): values in column 'a' there multiple values in column 'b'. want create dictionary multiple values each key values should unique well. please suggest me way this. one way groupby columns a: in [1]: df = pd.dataframe([[1, 2], [1, 4], [5, 6]], columns=['a', 'b']) in [2]: df out[2]: b 0 1 2 1 1 4 2 5 6 in [3]: g = df.groupby('a') apply tolist on each of group's column b: in [4]: g['b'].tolist() # shorthand .apply(lambda s: s.tolist()) "automatic delegation" out[4]: 1 [2, 4] 5 [6] dtype: object and call to_dict on series: in [5]: g['b'].tolist().to_dict() out[5]: {1: [2, 4], 5: [6]} if want these unique, use unique (note: create numpy array rather list): in [11]: df = pd.dataframe([[1, 2], [1, 2], [5, 6]], columns=['a', 'b']) in [12]: g = df.groupby('a') in [13]: g['b'].unique() ou...

Appending a byte to String in java using escape sequence -

i wish append byte i.e. 16 = 0x10 string, using escape sequence in single line of code: string appendedstring = new string('\16'+"string"); this results in hex representation of appendedstring = 0x0e,0x74,0x72,0x69,0x6e,0x67 using \2 this: string appendedstring = new string('\2'+"string"); works fine resulting in hex representation of appendedstring = 0x02,0x74,0x72,0x69,0x6e,0x67 using \10: string appendedstring = new string('\10'+"string"); results in hex representation of appendedstring = 0x08,0x74,0x72,0x69,0x6e,0x67 someone may kindly explain , suggest solution. thanks. the problem using octal escape. java language specification, section 3.10.6 , defines escapes, including octal escapes. octalescape: \ octaldigit \ octaldigit octaldigit \ zerotothree octaldigit octaldigit so, \16 character 14 in decimal, or 0x0e in hexadecimal. the character \2 remains 2 in decima...

php - sqlite with mulitple like -

i trying set query php , sqlite , query has multiple conditions... $findme = 'blah'; $nlast = -1; $nrecord = 5; $db = new pdo('sqlite:data.db'); $qry = "select * mytable (id > $nlast) , ((col1 '%$findme%') or (col2 '%$findme%') or (col3 '%$findme%') or (col4 '%$findme%')) limit $nrecord order id desc"; $result = $db->query($qry); ...but not return results. if run query 1 of conditions work. any thoughts? why not try using glob instead of like ? select * "mytable" ('col1' || 'col2' || 'col3' || 'col4') glob '%$findme%'

javascript - setInterval + image src changes when clicked on button -

i want give blink effect(dark , light) when clicked on button.i have written following code not work.so please me. $(document).ready(function () { $(".search").click(function () { setinterval(function () { var cursrc = $("#red").attr('src'); if (cursrc === '../images/lightred.jpg') { $(cursrc).attr("src", "../images/darkred.jpg"); } if (cursrc === '../images/darkred.jpg') { $(cursrc).attr("src", "../images/lightred.jpg"); } }, 2000); }); }); cursrc source attribute, yet trying wrap in jquery, won't make object. you'll have target #red again , set source: if (cursrc === '../images/lightred.jpg') { $("#red").attr("src", "../images/darkred.jpg"); } if (cursrc === '../images/darkred.jpg') { $(...

java - SocketException: Connection reset after reconnect -

if start server first , client works perfect, when start client first , server(making sure client able connect when svr crashes , goes online again) client connect server, after 2,3 seconds throws socketexception: connection reset. don't know causing , apprechiate if me figure out. server code handles clients: public serverhandler(socket socket){ try{ pw = new printwriter(socket.getoutputstream()); writerholder[usercounter] = pw; inputstreamreader in = new inputstreamreader(socket.getinputstream()); reader = new bufferedreader(in); usercounter++;// increment number of people connected }catch(exception ex) { ex.printstacktrace(); } } client code connects server: private void startconnection() { try { sock = new socket("192.168.1.5", 5000); inputstreamreader input = new inputstreamreader(sock.getinputstream()); reader = new bufferedreader(input); ...

xml - Incorrect behaviour of xsl:for-each in Java -

i'm seeing inconsistent behaviour when applying xslt java program compared testing xml spy. specifically, when using java, xsl:for-each directive not seem iterate on entire list. not case when testing xml spy. my xml document: <metadata xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:fn="http://www.w3.org/2005/xpath-functions"> <maps> <geographiccoverages> <coverage key="on">ontario</coverage> <coverage key="mb">manitoba</coverage> <coverage key="sk">saskatchewan</coverage> <coverage key="ab">alberta</coverage> <coverage key="bc">british columbia</coverage> <coverage key="yt">yukon</coverage> <coverage key="nu">nunavut</coverage> </geographiccoverages> </maps> ...

Linking 2 json file on my map -

i want use 2 or more json file produce markers (easier make changes files shorter). files identical in construction, when add them code details last one. i renamed data var jsonsl , var jsonpm, can't seem merge both. code can work this, works on 1 file @ time. <script type="text/javascript" src="js/mapping_1sl.js"></script> <script type="text/javascript" src="js/mapping_1pm.js"></script> var gmarkers = []; function initialize() { var latlng = new google.maps.latlng(53.995391,-3.795069); var myoptions = { zoom: 6, center: latlng, maptypeid: google.maps.maptypeid.roadmap, maptypecontrol: true, }; var map = new google.maps.map(document.getelementbyid("map"),myoptions); var categoryicons = {} (var = 0; < jsonsl.length; i++) { var data = jsonsl[i], latlng = new google.maps.latlng(data.latitude, data.longitude); var marker = new...

ajax - ASP.NET MVC 4 shared page element containing user data -

Image
in asp.net mvc 4 application, have log in box, included in "_layout" view , shared between pages. after successful authentication, present basic data logged in user (first name, score, etc.) instead of log in box. of course, needs visible on every page. best method of implementing this? how can data? below can see screenshots of box , want achieve. before log in: after log in: i using following: @if(!request.isauthenticated) { //partialview log in form } else { // partialview after login }

how to integrate Paypal Express checkout using new method? -

i want integrate paypal express checkout in project. think paypal has upgraded apis , methods. downloaded rest api github not able figure out how integrate it. confused. because in rest zip downloaded there many files , not able understand how can integrate express checkout new api , method. have gone through many of sites examples execute them error 10001. please help. i not sure, whether still need this, should read document: paypal docu when using rest api, don't have download anything! how works is: have have developer account, create 1 here: dev account there should client_id , secret . then have connect url https://api.sandbox.paypal.com/v1/oauth2/token with http headers : "accept": "application/json", "accept-language":"en_us" with auth set to your_client_id:your_secret replace values above client_id , secret got docu. and parameters ( params ): "grant_type":"client_credentials...

I can not detect the USB device with Android USBManager -

i trying use usbmanager of android, not find device connected usb. testing on emulator android, connected 1 card reader , want control reading of data, app can not read if there device connected usb port. anyone had problem? usbmanager musbmanager = (usbmanager)getsystemservice(context.usbservice); int countdevice = musbmanager.devicelist.count; devicelist = musbmanager.devicelist; does card reader work computer? perhaps driver needs installed first? on other hand, have listed intent usb device manager: <intent-filter> <action android:name="android.hardware.usb.action.usb_device_attached" /> </intent-filter> it helpful if posted error message get.

SQL Server 2008 Job error 1204 Lock -

i'm having trouble ancient database have maintain. it's been around ages (no, did not design it, no, it's not possible make changes on it) it goes this: there 2 tables, "documents" , "versions". documents pretty simple table, primary key, varchar storing document name , user created document.versions has foreign key document belongs to, image field actual document stored (mainly word documents , pdfs), extension, , field keeps version number. whenever application (an ancient vb6 application) consumes document, new version generated. every night, job run on database, in order delete versions except 5 latest ones of each document. has been working like, forever. delete t_ad_versions versionnumber < dbo.maxversion(coddocument)-4 problem is, eventhough everyday versions table has job running in order discar oldest entries, database reaching alarming size (currently 300+ gb). in order reduce said size, realized there's no need keep vers...

php - Custom routing and controller function -

i have routes.php as $route['home'] = 'pages/home'; $route['login'] = 'pages/login'; $route['default_controller'] = 'pages/home'; and controller pages.php as class pages extends ci_controller { public function home() { $this->load->view('templates/header'); $this->load->view('pages/home'); $this->load->view('templates/one'); $this->load->view('templates/two'); $this->load->view('templates/footer'); } public function login() { //if ( ! file_exists('application/views/templates/'.$page.'.php')) { // echo "no file"; // } // $data['title'] = ucfirst($page); $this->load->view('templates/header'); $this->load->view('templates/login'); $this->load->view('templates/footer'); ...

how to create joomla 2.5 quick installer package? -

i have seen quick joomla installer package others theme development websites. want create same file can give files clients , install joomla ready made dummy content. thanks i explain more in depth comment little vague. joomla 2.5 package you see in installation\sql\mysql file called sample_data.sql . download copy of database , replace file stated above one. make sure give same name. open sample_data.sql , see query create table , it's columns so.... create table if not exists #__assets ...replace with: truncate #__categories ; . sure each 1 see. copy template folder site tempplates folder in new joomla package. zip , you're go hope helps

bash - Test if user passed in a shell variable -

i have shell function check if user passed in second variable. have tried not seem working function dash() { if [ -z "$2" ]; open dash://$1:$2; else open dash://$1; fi } basically, want if second argument $2 passed in 'x' else 'y' just do: function dash() { open dash://$1${2+:}$2 } the ${2+:} expands : if $2 set, , null string otherwise.

cordova - ios app crashes with phonegap 3.0 and Facebook-connect phonegap plugin -

i'm building ios 7 app newer phonegap 3.0. use facebook connect phonegap plugin , work. problem after usage of facebook functions, ios 7 app crashes due low memory. did not have problem until migrate phonegap 3.0. using xcode 5's memory allocation , memory leaks detection tools, manage track root cause of memory issues. seems every time initiate facebook function, calls cdvcommandqueue function , memory usage jumps couple mbytes. constant jump in memory usage causes ios app crash or being minimized ios itself. does see problem? i'm desperately seeking solution please help. from understand, facebook connect plugin hasnt been updated phonegap v.3. keep using v.2.9. until is.

php - Error: Call to a member function get() on a non-object -

i trying send mail swift_message when go send data not send , error of fatalerrorexception: error: call member function get() on non-object in /vagrant/vendor/symfony/symfony/src/symfony/bundle/frameworkbundle/controller/controller.php line 252 here email controller using. use symfony\component\finder\shell\command; use symfony\component\httpfoundation\request; use symfony\component\console\output\outputinterface; use symfony\bundle\frameworkbundle\controller\controller; use symfony\component\dependencyinjection\containerinterface; class emailcontroller extends controller{ public function createmessage($subject, $from, $from_name, $to, $to_name, $body){ // create message $message = \swift_message::newinstance() // give message subject ->setsubject($subject) // set address associative array ->setfrom(array($from => $from_name)) // set addresses associative array ...

understanding ColdFusion FindNoCase -

i'm going through coldfusion code , encountered following information. didn't understand part of it. questions follows: code: <cfif findnocase( "xyz.seta", "#cgi.server_name#") gt 0 > <cfset publicpath = "abcxyz/new_abc/public"> <cfset sessionpath = "abcxyz/new_abc/session"> i understand findnocase used find first occurance of substring in string, specified start position. function syntax: findnocase(substring, string [, start ]) 1) so, in case, xyz.seta substring searched starting " #cgi.server_name# " ? confused here? 2) question regarding publicpath , sessionpath defined: when checked server (after logging using vnc viewer), folders visible me public , session. can find path before it? please clarify or let me know if need study more before asking such question. thanks you correct first assumption. findnocase return index of start of sub-string. think cf indexes 1 base...