Posts

Showing posts from February, 2015

jquery - Trying to add missing img attributes to custom javascript -

i have javascript changes image scr when click on , cycle through. has navigation links , arrow keyboard navigation. i'm having trouble of adding image attributes width, height , alt img scr. when view final result shows: <img class="picture" src="http://i.imgur.com/tl6nw.gif" imageposition="1"> it's missing width,height , alt. in html content have included width,height , alt javascript doesn't seem adding attributes final result. can me fix code? /* set first image in frame #shoebox on document.ready */ $(function() { var leadoff = $('#shoebox img:first-child').attr('source'); $('.picture').attr({ 'src': leadoff, 'imageposition': '1' }); var select = $('#select-jump-to'); $.each($('#shoebox img'), function(idx, img) { select.append('<option value="' + img.getattribute('source') + '">image ...

asp.net - VBScript getAttribute is not a member of MSXML.IXMLDOMNode -

converting classic .asp application .aspx , function below takes in xml snippet. works fine in asp gives me comipilation error "error bc30456: getattribute not member of msxml.ixmldomnode" in .aspx function extractdatafromxml(byref sinputxml string) string dim xmldom msxml.domdocument dim currnode msxml.ixmldomnodelist dim node msxml.ixmldomnode dim serror string dim sresult string xmldom = new msxml.domdocument xmldom.async = false if (xmldom.loadxml(sinputxml) = false) sresult = "xml parse error: " & xmldom.parseerror.reason & " code=" & xmldom.parseerror.errorcode & " " & chr(13) & chr(10) else currnode = xmldom.selectnodes("//push-response") each node in currnode serror = node.selectsinglenode("response-result").getattribute("code") if serror = "1000" sresult = node.selectsinglenode("address").text else ...

android - Multiple errors during the gradle sync when I try to add Google Service library to the dependencies -

i want add app ads using admob, site says need add google services dependencies use functionality. android studio went file->project structure->app->dependencies, clicked on "+" button e searched "play-services". found "com.google.android.gms:play-services:9.4.0" added dependencies. during gradle sync android studio sends errors , stops gradle sync. this log form sync: http://pastebin.com/zpn4rucm here data might useful: compile sdk version: api 17 build tools version: 23.0.1 android studio 2.1.2 this main gradle file: // top-level build file can add configuration options common sub-projects/modules. buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.1.2' } } allprojects { repositories { jcenter() } } and app gradle file: apply plugin: 'com.android.application' android { compilesdkversion 'google inc.:google apis:17' buildtoolsversion...

axapta - How to upload client file to server? -

i need create form upload file client side server in ax 2012 r3 using x++ . can 1 give me link / example regarding issue? i try search , find can use class sysfilestoremanager , still confused how use it. you can find example use of sysfilestoremanager using cross-reference tool . find bit bloated. you can this: static client container getpackedfileclient(filename _filenameclient) { bindata bindata = new bindata(); bindata.loadfile(_filenameclient); return bindata.getdata(); } this sysfilestoremanager.getpackedfileclient method, without protected keyword. save file: static server container savefiletoserver(container _packedfile, filename _filename) { #file bindata b = new bindata(); b.setdata(_packedfile); new fileiopermission(_filename, #io_write).assert(); b.savefile(_filename); } this sysfilestoremanager.copyfiletoclient_client adapted general use. can call methods in sequence: savefiletoserver(getpackedfileclient(c...

javascript - Vector: Get closest vectors based on a single vector -

Image
update: thanks user @thomas able fix script. can find comments in comment section below. to make easier, here important quotes: [...] why vectors contain strings instead of numbers? i accidently kept on using strings in vectors, breaking proper results. make sure not use strings when working numbers. in addition, make sure results proper sorted: sort by: min(||house.min - client||, ||house.max - client||) or ||(house.max + house.min)/2 - client|| the problem: i have array 3 houses, each containing 2 x, y, z vectors. 1 of them min point, whereas other max. 2 vectors represent field/area house in. in addition, have 1 client represented single vector. now want closest houses client near to. preferably based on min , max vector of house. values: var houses = [ { "max": { x: "-7839.9688", y: "-7469.0312", z: "215.537" }, "name": "house 1", ...

javascript - Ember: Build Error Unexpected token -

i following tutorial try codes below controller index.js import ember 'ember'; export default ember.controller.extend({ emailaddress: '', isvalid: ember.computed.match('emailaddress', /^.+@.+\..+$/), isdisabled: ember.computed.not('isvalid') actions: { saveinvitation() { alert(`saving of following email address in progress: ${this.get('emailaddress')}`); this.set('responsemessage', `thank you! we've saved email address: ${this.get('emailaddress')}`); this.set('emailaddress', ''); } } }); index.hbs <div class="jumbotron text-center"> <h1>coming soon</h1> <br/><br/> <p>don't miss our launch date, request invitation now.</p> <div class="form-horizontal form-group form-group-lg row"> <div class="col-xs-10 col-xs-offset-1 col...

writer - while(line.contains("^")) loop not breaking -

this class: import java.io.*; public class test { public static void main(string[] args) throws filenotfoundexception, ioexception { bufferedreader br = new bufferedreader(new filereader("file2.txt")); bufferedwriter bw = new bufferedwriter(new filewriter("file.txt")); int = 0; string line; while ((line = br.readline()) != null) { while(line.contains("^")) { ++; line = line.replacefirst("^", integer.tostring(i)); } bw.write(line + "\n"); } br.close(); bw.close(); } } the file2.txt , file.txt same , want make lines like <wpt lat="26.381418638" lon="-80.101236298"><ele>0</ele><time> </time><name>waypoint #^</name><desc> </desc></wpt> to like <wpt lat="26.381418638" lon="-80.101236298"><ele>0</ele><time> </time><name>w...

c++ - Error LNK2019: Unresolved External Symbol _HUGE referenced in _luaopen_math -

i got error when finished revising things. searched here error different because lua this error got error 17 error lnk2019: unresolved external symbol __huge referenced in function _luaopen_math c:********\lua52.lib(lmathlib.obj) els-cf_1 thank you! , have day __huge symbol defined in libcmt.lib . check linked against lib. if need ignore libcmt.lib try define huge_val value in code. math library used in lmathlib.c @ lua_pushnumber(l, huge_val);

c# - How to use x-sampa phonetic transcription on SAPI 5 -

i have bunch of x-sampa phonetic transcriptions "p_hleis use sapi 5. is possible? i don't believe so, no. does, however, support ipa which, understand, x-sampa extended translate ipa. w3.org covers how when ingest xml grammars sapi. if wanted use ipa on fly, however, in c++ like: m_cpvoice->speak(l"his name <phoneme alphabet=\"ipa\" ph=\"ɹəˈbɛːɹɾoʊ bɛˈniːnji\">roberto benigni</phoneme>", svsfisxml, null); if can't use wide chars whatever reason, might have translate unicode like: m_cpvoice->speak(l"his name is<phoneme alphabet=\"ipa\" ph=\"&#x2c8;l&#x251; &#x2c8;vi&#x2d0;&#x27e;&#x259; &#x2c8;&#x294;e&#x26a; &#x2c8;b&#x25b;l&#x259;\"">la vita e bella </phoneme>", svsfisxml, null); which admittedly looks terrible. it's not different in c#.

javascript - Unable to get Area and Range in ChartJS -

i'm new html5 , chartjs. seem find 2 different type of declarations among attaching js chart versions 1.0.1 , 2.1.1. can briefly explain on that.? also, i'm unable stripes behind in chart in local copy, appears in jsfiddle. link: http://jsfiddle.net/u20cfpcd/ why ? my code: <!doctype html> <html> <head></head> <body> <canvas id="mychart" width="250" height="250"></canvas> <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.1.0/chart.bundle.min.js"></script> <!-- <script src="chart_v2.min.js"></script> --> <script> chart.defaults.stripe = chart.helpers.clone(chart.defaults.line); chart.controllers.stripe = chart.controllers.line.extend({ draw: function(ease) { var result = chart.controllers.line.prototype.draw.apply(this, arguments); // don't render stripes till we've finished animating if ...

http - Error 500 when trying to subscribe to ical calendar feed in Yahoo Calendar -

i trying subscribe ical feed through yahoo calendar using url in following format: https://calendar.yahoo.com/subscribe?ics={__ics_feed_url__}&name={__name__} . after accessing url, yahoo presents me dialog box pre-populated url feed , name. after hitting "ok" dialog box follows after 500 error. digging around in chrome console reveals following message in chrome console call used yahoo subscribe calendar: {"calendarerror":{"lang":"en-us","description":"failed create new folder","detail":"not applicable","code":0}} . example ical feed begin:vcalendar version:2.0 prodid:-//lanzar group//sendcalendar//en name:sample: walking tours x-wr-calname:sample: walking tours begin:vevent uid:mkq2333pn8zh6rcec@sendcalendar.com sequence:0 dtstamp:20160829t062543z dtstart:20160901t100000z dtend:20160901t120000z summary:sample event: visiting eiffel tower location:champ de mars\, 5 avenue anatole fr...

spring - Questions on its Use so i can know which scheduler to use -

hi new schedulers , looking features in schedulers need. spring batch support following: ui • support monitoring job status • initiating ad hoc jobs • setting , modifying regularly scheduled jobs scripting • scripting languages support • have api loading scripts capabilities • chaining • dependencies • error handling support • there commercial version support any regarding these points appreciated. thank you. springbatch not scheduler. springbatch framework based on spring implement batch-jobs in java. this jobs can run scheduler streamworks, jobscheduling not part of springbatch, , hence, questions can answered 'no'.

scripting - Not receiving email sent using powershell command -

send-mailmessage -smtpserver "smtp.com.au" -from "me@me.com" -to "you@you.com" -subject "testing" -attachments "\\test\archive.zip" -body "attached" i using above command email zip file don't see in (you@you.com) mailbox. the command runs without errors. i think problem in function call. miss lot of parameters. take on working gmail example: $password = convertto-securestring "123456789" -asplaintext -force $emailcredentials = new-object pscredential ("from@gmail.com", $password) try { send-mailmessage -from "from@gmail.com" -to "to@to.com" -subject "subject" -body "body" -smtpserver "smtp.gmail.com" -port 587 -credential $emailcredentials -encoding utf8 -usessl -erroraction stop } catch { echo $error[0] } there no -credential parameter in call, , i'm sure, that's problem. smtp server may have protocol on different p...

reactjs - Packery layout is not working as expected in meteor with react -

using packery layout layouting several items. working fine in initial mode, when create new item, newly created item overlap first item, , when refresh page, working fine. here code sample using while item rendered .. componentdidmount(){ $('#packery-layout').packery({ itemselector: '.item', gutter: 10 }); } componentdidupdate(){ $('#packery-layout').packery({ itemselector: '.item', gutter: 10 }); } what want that, when create new design, newly created design should not overlapped first item. clue/solution issue ? thanks.

parameters - How to decide whether to parameterize on the type-level or the module-level when designing modules? -

i'm working towards deep understanding of ml-style modules: think concept important , love kind of thinking encourage. discovering tension can arise between parametric types , parametric modules. seeking tools thinking matter me make smart design decisions build programs. fist try describe question in general. provide concrete example learning project working on. finally, revisit general question in order draw point. (i'm sorry don't yet know enough pose question more succinctly.) in general terms, tension i've discovered this: functions flexible, , open widest reuse, when provide them parametric type signatures (where appropriate). however, modules flexible , open widest reuse when seal parameterization of functions inside module, , instead parameterize entire module on given type. a ready example of difference can found in comparing modules implement list signature implement ord_set . module list:list provides bunch of useful functions, parameterized on ...

python - find max square with black border -

for square matrix, each cell either black (1) or white (0), trying find max sub-square border black. here code python 2.7, wondering if logically correct? , performance improvements? thanks. my major ideas is, keep track of how many black nodes on top (continuously) , on left (continuously), left , top matrix represents. then, based on left , top tracking, node, try find minimal value of top , left continuous black node, base minimal value see if square formed. a=[[1,1,0,0,0], [1,1,1,1,1], [0,0,1,0,1], [0,0,1,1,1], [0,0,0,0,0]] top=[[0] * len(a[0]) in range(len(a))] left=[[0] * len(a[0]) in range(len(a))] result = 0 in range(len(a)): j in range(len(a[0])): if a[i][j] == 1: top[i][j] = top[i-1][j] + 1 if > 0 else 1 left[i][j] = left[i][j-1] + 1 if j > 0 else 1 print top print left in range(len(a)): j in range(len(a[0])): if a[i][j] == 1: top[i][j] = top[i-1][j] + 1 if > 0 else 1 l...

jquery - DataTables not recognizing data -

Image
i'm trying insert data datatable. i have following code: datatable: <table id="ladder" class="table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>place</th> <th>team name</th> <th>w - l</th> <th>strk</th> <th>exp</th> <th>level</th> </tr> </thead> <tbody id="ladder_stats"> </tbody> </table> the jquery: function fillladder(place, name, w, l, strk, exp, lvl, id, ladder) { $('<tr><td>' + place + '</td><td><a href="/team?id=' + id + '&l=' + ladder + '">' + name + '</a></td><td>' + w + ' - ' + l + '</td><td>' + strk + '</td>...

php - Fetching profile picture and name and etc. from Facebook by ID -

i used link in 2014 in php fetching profile photo, name, surname , other information facebook id number. http://graph.facebook.com/ {id}/ - link returned me json encoded information , can decode , use. in 2016 link not work. seems facebook changed graph structure, how can use now? method? you can "me" (the user authorized app) picture using javascript graph api. fb.api( '/me', 'get', {"fields":"id,name,picture"}, function(response) { console.log(picture.data.url); } ); you can play graph api in facebook's tool graph api explorer read more graph api javascript , php

c# - How to Use MVC Controller and WebAPI Controller in same project -

i trying use mvc controller , webapi controller in same project got 404 errors webapi . started project mvc project in vs 2015 added webapi controlle , default code giving 404 error what possible solution . have tried solution on stackoverflow didn't worked 1 of them below link (accepted answer on there ) all asp.net web api controllers return 404 global.asax file code : protected void application_start() { arearegistration.registerallareas(); globalconfiguration.configure(webapiconfig.register);//web api 1st filterconfig.registerglobalfilters(globalfilters.filters); routeconfig.registerroutes(routetable.routes); bundleconfig.registerbundles(bundletable.bundles); } webapi.config file public static class webapiconfig { public static void register(httpconfiguration config) { config.maphttpattributeroutes(); config.routes.maphttproute( ...

How to Integrate Disqus into an Aurelia app? -

how integrate disqus aurelia app? tried doing this: index.html ... <script src="http://example.disqus.com/embed.js"></script> </head> post.html ... <div id="disqus_thread"></div> </article> </template> post.js export class post { activate(params, routeconfig) { // params contains unique post identifier. e.g. http://example.com/#/blog/my-post-title this.post = // post retrieved firebase , rendered in view } attached() { disqus.reset({ reload: true, config: function () { this.page.identifier = this.post.subdirectory; this.page.url = "http://example.com/" + this.post.subdirectory; this.page.title = this.post.title; } }); } } this loads correct blog post , manages load disqus, same disqus comment section loaded each individual blog post. i managed integrate disqus aurelia app doing following: // index.html...

Jquery/Javascript memory leak -

i have web application show chart , update chart status each 10 seconds. html is: <div id="hoze-bar-chart"></div> js drawing chart: var handlestackedchart = function() { "use strict"; function v(e, t, n) { $('<div id="tooltip" class="flot-tooltip">' + n + "</div>").css({ top: t, left: e + 35 }).appendto("body").fadein(200); } var e = displaycount.e; var n = displaycount.n; var h = displaycount.h; var p = { xaxis: { tickcolor: "transparent", ticks: h }, yaxis: { tickcolor: "#ddd", tickslength: 10 }, grid: { hoverable: !0, tickcolor: "#ccc", borderwidth: 0, bordercolor: "rgba(0,0,0,0.2)" }, series: { stack: null, lines: { show: !1, fill: !1, steps: !1 }, bars: { show: !0, b...

remove rows from dataset1 & add those to dataset 2 C# -

i have 2 datasets, instances dataset1 & dataset2 same structure. need query dataset1, result, remove rows dataset1 & insert rows dataset2. how ? assuming have condition ready (e.g. id == 8 ), easy using linq: var records = dataset1.where(d => d.id == 8); dataset1.remove(d => d.id == 8); foreach (var r in records) dataset2.add(r);

canvas - Javascript img to base64 don't load -

i develop photoshop extension sends images server. edit: extensions in photoshop build html file define gui, js file same js file, it's can launch photoshop function , execute photoshop. i need send images file system of user (from c:\path\to\images) to encode images converted them dataurl (base64). the problem occurs in first time convert images dataurl. in second time , so, manages convert images , fine. in first time image doesn't loaded. i have folder images , want upload pictures there, used loop runs on photos , set them <img src=path> , converts them based 64 via <canvas> . my code: function convertlayerstobase64(imgheight, imgwidth){ var img = new image(); images = []; (var i=0; i<=imageslength; i++){ path = folder + "layer " + +".png"; img.src = path; var canvas = document.createelement("canvas"); canvas.height = imgheight; canvas.width = imgwidth; ...

gcloud - Cloud pubsub slow poll rate -

i have pubsub topic, 1 subscription, , 2 different subscribers pulling it. using stackdriver, can see subscription has ~1000 messages. each subscriber runs following poll loop: client = pubsub.client() topic = client.topic(topic_name) subscription = pubsub.subscription(subscription_name) while true: messages = subscription.pull(return_immediately=true, max_messages=100, client=client) print len(messages) # put messages in local queue later processing. processes ack subsription my issue slow poll rate - though have plenty of messages waiting polled, i'm getting several messages each time. also, lots of responses without messages. according stackdriver, messages pulled rate ~1.5 messages/sec. i tried use return_immediately=false , , improved bit - pull rate increased ~2.5 messages/sec, still - not rate expect have. any ideas how increase pull rate? pubsub poll best practices? in order increase pull rate, need have more 1 outstanding pull request @ ti...

html - JavaScript ES6 side nav issue when function call -

i'm building side nav javascript es6 , started supercharged-show code example. made toggle button replace show , hide ones. try use togglesidenav function call showsidenav nothing happen. i'm missing this . my html page looks : <body> <header class="header"> <!--<button class="js-menu-show header__menu-toggle material-icons">menu</button>--> <hc-hamburger role="button" class="js-menu"> <div class="hamburger-menu"> <div class="bar"></div> </div> </hc-hamburger> </header> <aside class="js-side-nav side-nav"> <nav class="js-side-nav-container side-nav__container"> <!--<button class="js-menu-hide side-nav__hide material-icons">close</button>--> <header class="side-nav__header"> side nav </header...

java - How do I reference one Eclipse project from another? -

Image
i have 2 java projects in eclipse follows: client (a swing application) contracts (something class library in .net world) i client reference contracts project. here have done. i have class in client project so: package practice.bookyard.client; public interface iauthenticationmanager { operationresult<string> authenticateuser(string username, string password); } and in contracts project, class so: package practice.bookyard.contracts; public class operationresult<t> { protected final boolean successful; protected final string errormessage; protected final t data; public operationresult(boolean successful, string errormessage, t data) { this.successful = successful; this.errormessage = errormessage; this.data = data; } public boolean getsuccessful() { return this.successful; } public string geterrormessage() { return this.errormessage; ...

android - Draw paint over image not blank space using canvas -

i trying draw line on image, works fine faced problem. problem want draw line on image only, not blank space. code here sizechanged method declare this. class drawingpaint extends view implements view.ontouchlistener { private canvas mcanvas; private path mpath; private paint mpaint, mbitmappaint; public arraylist<pathpoints> paths = new arraylist<pathpoints>(); private arraylist<pathpoints> undonepaths = new arraylist<pathpoints>(); private bitmap mbitmap; private int color; private int x, y; private string texttodraw = null; private boolean istextmodeon = false; int lastcolor = 0xffff0000; static final float stroke_width = 15f; matrix m; int imageheight,imagewidth; public drawingpaint(context context/*, int color*/) { super(context); //this.color = color; setfocusable(true); setfocusableintouchmode(true); this.setontouchlistener(this); mbitmappaint = new paint(paint.dither_flag); /*mpaint = new paint(); mpaint.setantia...

php - Getting Null values for the Long length Strings -

$val=""; $val = mysql_real_escape_string(stripslashes(trim($_post['feed']))); $name = stripslashes(trim($_request['name'])); if (isset($val)) { error_log("*********************************"); $json = array(); $temp = json_encode($val); error_log("encoded value = ". $temp); $decoded = json_decode($temp); whenever, provide long length string 'val', decoded value gets null. however, provides correct value in case of short length string. need help.

maven - mvn clean install not able to resolve class -

Image
i have following maven structure parent pom.xml - common/pom.xml - search/pom.xml search module not able common module classes when mvn clean install on search module package de.test.common not exists . ran mvn clean install on parent platform no success. common module building fine. <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>de.test.search</groupid> <artifactid>search</artifactid> <packaging>jar</packaging> <parent> <groupid>de.test.platform</groupid> <artifactid>platform</artifactid> <version>0.0.1-snapshot</version> </parent> <properties> <app-name>search</app-n...