Posts

Showing posts from June, 2013

c++ - Why doesn't QString overload + operator? -

i've stumbled upon strange behavior when using operator+ on qstring s until found out qstring doesn't overload operator+ (in contrary std::string ). reasons there not (especially since overloaded quite bunch of other operators)? edit: sorry, have looked wrong section in docs. can please close question? it provides + operator, question have @ right hand side?

java - Flipping to next screen shows black color in background -

in vertical flip effect,when flip next screen background shows black color happens in gt_n7100 mobile...how fix problem???can please me... <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/white" android:orientation="vertical" > <imageview android:id="@+id/bar" android:layout_width="480dp" android:layout_height="1dp" android:layout_margintop="36dp" android:scaletype="fitxy" android:src="@drawable/line" /> <textview android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/bar" android:layout_margin="5dp" android:textappearance="@android:style/textappearance....

android - Samsung Galaxy Devices can't use geolocation.getCurrentPosition -

ok, i've been looking adequate response issue quite time. have web application uses navigator.geolocation.getcurrentposition user's position. the native browser on samsung galaxy devices have problems getcurrentposition code. have tried kinds of variations of code callbacks , timeouts, same issue. plenty of people have documented issue, , indicate restarting device work (sometimes restarting work, not - , alert telling users restart device seems beyond rediculous). has figured out surefire way use getcurrentposition work on samsung galaxy device? here's i'm working with... <script> $(document).ready(function(){ if( navigator.geolocation ) { navigator.geolocation.getcurrentposition( success, fail ); } else { alert("sorry, browser not support geolocation services."); } function success(position) { window.location = "mobile_set_coordinates.php?user_lat=" + position.coords.latitude + "&user_lon=" + po...

distribution - Jquery plugin to calculate correlation coefficient -

is there jquery plugin calculate correlation coefficient, standard deviation , covariance. please refer me link if need simple stuff covariance, correl, ..., jsanalysis should trick. more advanced features, jstat contains need.

dependencies - Browser or server version of module -

using requirejs , javascript modules, i'd share code between server , browser, there 4 situations. 1/ module server define([], function() { if(typeof window != 'undefined') return null; // server //module code }) 2/ module browser define([], function() { if(typeof window == 'undefined') return null; // browser //module code }) 3/ module shared define([], function() { //module code }) 4/ module different code server/browser define(['require'], function(require) { if(typeof window == 'undefined') // server version { return require('nodejs module'); } // browser version }) what want solve better way including module code browser, have past whole code of browser version. nodejs require sync, works. in browser have use like define(['require'], function(require) { if(typeof window == 'undefined') // server version { return require('nodejs_module'); } ...

css - Padding on input element not working as expected on mobile safari (iphone) -

why doesn't padding work in iphone safari? padding-right exact simple html: <div class="content"> <input class="inputsblock"/> </div> and css: .content{ padding:18px; } .inputsblock{ width:100%; border:2px solid #000; } it works in anothers browsers. solution? image: link actually, remove padding .inputsblock{ padding: 0; } http://jsfiddle.net/lkhtm/9 tested on simulator only

tclsh - Tcl version change issue from 8.4 to 8.5.12 -

i have problem changing tcl version 8.4 8.5.12 on rhel machine. our product uses tcldevkit components tcldom, tclxml, etc. using incr tcl (itcl). trying create pkgindex.tcl file in itcl in order find itcl when package required follown: package ifneeded itcl 3.4 [list load [file join $dir "libitcl-o.a"] itcl ] but when use package require itcl getting report: couldn't load file "/somepath/itcl/lib/libitcl-o.a": /somepath/lib/libitcl-o.a: invalid elf header it seems can't load files .a extention, same done previous version of tcl (8.4) , works fine. googled lot, read lot of documentation, doesn't go further. please help. thanks in advance libraries come in 2 general sorts, static libraries , shared libraries. on linux, static libraries have extension .a default, , shared libraries have extension .so (plus optionally numbers indicate version). only shared libraries work tcl's load command , have designed work way (with app...

ios - Fastest way to remove a color from a UIImage? -

i have image i'm using create anaglyph splitting separate red , cyan versions , setting parallax between them. the source image 1146 x 580 (at retina resolution). i'm using cicolormatrix create each image. here's code cyan version removes of red. -(uiimage *)createcyan:(uiimage *)animage { ciimage *inputimage = [ciimage imagewithcgimage:animage.cgimage]; cifilter *matrixfilter = [cifilter filterwithname:@"cicolormatrix"]; [matrixfilter setdefaults]; [matrixfilter setvalue:inputimage forkey:kciinputimagekey]; [matrixfilter setvalue:[civector vectorwithx:0 y:0 z:0 w:0] forkey:@"inputrvector"]; [matrixfilter setvalue:[civector vectorwithx:0 y:1 z:0 w:0] forkey:@"inputgvector"]; [matrixfilter setvalue:[civector vectorwithx:0 y:0 z:1 w:0] forkey:@"inputbvector"]; [matrixfilter setvalue:[civector vectorwithx:0 y:0 z:0 w:1] forkey:@"inputavector"]; ciimage *outputimage = [matrixfilter ...

Dataset in Matlab -

i have large set of cross-sectional time series data in dataset in matlab , want extract arrays (columns) of data based on header given dynamically array in loop. can suggest how implement in matlab, have tried following code cdslist = universe.bond; cdscount = length(universe.bond); i=1:cdscount cds = cdslist(i); % here want use variable cds dynamically give names dataset called spread, instance spread.cds cds changing in loop. end is possible ? help assuming cds string, can used dynamic field name: cdslist = universe.bond; cdscount = length(universe.bond); spread = struct; = 1:cdscount cds = cdslist{i}; spread.(cds) = data; end

c# - After installing driver still it shows Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine -

i install driver. http://www.microsoft.com/download/en/details.aspx?id=13255 still shows microsoft.jet.oledb.4.0' provider not registered on local machine based on link in question apparently installed newer ace database driver, try using microsoft.ace.oledb.12.0 instead.

jquery - Javascript draw directions when take data from json -

this basic question please becouse try solve 3 days , dont have answer. try many solutions again same. here have narray functions return me bigarray json, contain objects this: bigarray array[5] 0: object 1: object distance_from_previous_object_location: 2.087970147789207 lat: "48.866588" leftposition: 183 lng: "2.309037999999987" topposition: 57 __proto__: object 2: object 3: object 4: object length: 5 __proto__: array[0] so here have "n" number of object. objects contain lat , lng. i try solve problem basic google example: http://jsfiddle.net/6vz52/3/ here have problem how change <option value in google example json(lat,lng) data code. i try code: <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var directionsdisplay; var directionsservice = new google.maps.directionss...

Android : ListVIew : change background onClick -

i have listview , , want change background of items when click on , show selected. when use code (under text) change every 13 items background color . example: if select 1 item , scroll down change color of each 13 item ( 1-13-26..) . , want change background 1 item. lvpl.setonitemclicklistener( new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { textview tv = (textview) view tv.setbackgroundcolor(color.argb(125,75,236,90)); final_ids.add(ids.get(position)); } }); the problem adapter list reusing views moved out of screen. the solution set default color in adapter other views public view getview(int position, view convertview, viewgroup parent) { if (convertview == null) { layoutinflater inflater = (layoutinflater) convertview.getcontext() .getsystemservice(context.layout_inflater_service); = i...

c# - MEF2 how does the catalogs work? Looks like it's been removed -

i can't find examples on mef2. i create plugin directory , use directory catalog load imports. what like: no attributes. use of configuration builder conventions plugin directory when dll added application aware of new exports available. could use castle windsor this? if you're referring new windows store version of mef available on nuget , the documentation states, there no catalog concept, nor composition batches, nor “container hierarchy” or composition scoping apis. sounds crazy mef 1 developer, page explains rationale well. however, you require : when dll added application aware of new exports available. this explicitly unavailable in mef 2 (win store) version, since doesn't support re-composition. for need "full" mef .net framework, in system.componentmodel.composition .

android - Fragment issue (Multiple instances) -

i have annoying problem don't know how solve. problem straightforward: i have fragmenta pushes fragmentb (a listview ) on button click. in fragmentb can push fragmenta onitemclick . see, depth infinite. the problem when pushed fragmentb second time, , go (2 times) first instance of fragmentb have items first , second instance in listview . if make 10 instances, have items of 10 instances in first instance. can explain problem , please provide me solution? edit (code snippet): followersfragment frag = new followersfragment(); bundle bundle = new bundle(); bundle.putstring(constants.user_id, userid); frag.setarguments(bundle); ((mainactivity) getactivity()).pushfragment(frag); public void pushfragment(trigdfragment fragment) { pushfragment(fragment, new animationobject()); } public void pushfragment(trigdfragment fragment, animationobject animate) { switchcontent(fragment, animate, false); } public void switchcontent(trigdfragment fragment, animationobj...

c# - Data forwarding server -

i have app android , app pc, both written me. android app connects pc app, , pc app sends data (in realtime) smartphone. the problem is: if pc connected mobile wireless network, can't address, can't connect android app pc. so, there simple application (for windows), can use server data forwarding. pc , mobile app connected server (launched on station static address), , server forward data 1 app another? or maybe there tutorials creating such kind of server on c#/java? i use third pc (a server) acts bridge android , pc. wrote web service in .net virtual server on internet. both android , pc know ip address (or domain name) of server. the pc talk server using .net native web service call, android uses ksoap. for more infomration ksoap android here: http://code.google.com/p/ksoap2-android/ edit: suppose can have web server in pc need configure modem forward specific ports pc. if have no static ip address need reconfigure ip address on android device eve...

java - Android: How to stretch an image to the screen width while maintaining aspect ratio? -

i want download image (of unknown size, square) , display fills screen horizontally, , stretches vertically maintain aspect ratio of image, on screen size. here (non-working) code. stretches image horizontally, not vertically, squashed... imageview mainimageview = new imageview(context); mainimageview.setimagebitmap(mainimage); //downloaded server mainimageview.setscaletype(scaletype.fit_xy); //mainimageview.setadjustviewbounds(true); //with line enabled, scales image down addview(mainimageview,new linearlayout.layoutparams( layoutparams.fill_parent, layoutparams.fill_parent)); i accomplished custom view. set layout_width="fill_parent" , layout_height="wrap_content", , point appropriate drawable: public class banner extends view { private final drawable logo; public banner(context context) { super(context); logo = context.getresources().getdrawable(r.drawable.banner); setbackgrounddrawable(logo); ...

android - MultipartEntity entity -

after update android sdk 22.0.5 can not compile project. error message: dex loader] unable execute dex: multiple dex files define lorg/apache/http/auth/auth; if delete libarys mime4j apache-core-0.7.2.jar, httpclient-4.2.2.jar, core-4.2.2.jar , http http mime-4.2.2.jar , commented out code compile code. i need upload multipartentity. any ideas can do? thanks help

Composite pattern in C++ and C# - protected virtual methods -

how can add protected virtual method in "component" class, can called "composite"? as concrete example, @ code below, , please tell me how avoid compiler error in dxcompositeshape.computesize . abstract class dxshape // component { public abstract void paint(); protected abstract void computesize(); } class dxcompositeshape : dxshape // composite { public readonly ilist<dxshape> shapes = new list<dxshape>(); public override void paint() { this.computesize(); } protected override void computesize() { foreach (dxshape sh in shapes) { sh.computesize(); // compiler error cs1540 } // , other logic here } } edit: modified sample, have computesize instead of init (people assume init can called in constructor). create non-virtual function initialise() in base class calls init eg: abstract class dxshape { protected void initialise() { ...

Pagination is not working in cakephp -

my code controller: public $paginate = array( 'paramtype' => 'querystring', 'limit' => 3, ); $this->paginate['comment'] = array( 'conditions' => array('comment.post_id' => $this->params['id'])); $this->set('comments',$this->paginate('commant')); when pr($this->paginate['comment'] = array( 'conditions' => array('comment.post_id' => $this->params['id']))); exit; the output array ( [conditions] => array ( [response.claim_id] => 4 ) ) but instead of finding comment related post shows post db once tried pr($this->paginate['comment'] = array( 'conditions' => array('comment.id' => $this->params['id']))); exit; and result same array ...

c# - Configuring cache manager expiration time in Caching Application Block -

i'm using caching application block on application. configuration file looks this: <cachingconfiguration defaultcachemanager="cache manager"> <cachemanagers> <add name="paramcache" type="microsoft.practices.enterpriselibrary.caching.cachemanager, microsoft.practices.enterpriselibrary.caching, version=5.0.414.0, culture=neutral, publickeytoken=31bf3856ad364e35" expirationpollfrequencyinseconds="60" maximumelementsincachebeforescavenging="1000" numbertoremovewhenscavenging="10" backingstorename="nullbackingstore"/> </cachemanagers> <backingstores> <add type="microsoft.practices.enterpriselibrary.caching.backingstoreimplementations.nullbackingstore, microsoft.practices.enterpriselibrary.caching, version=5.0.414.0, culture=neutral, publickeytoken=31bf3856ad364e35" name="nullbackingstore"/> </backingstores> </cachingconf...

Excel arrays count totals using criterias from multiple ranges (or sheets) -

Image
what count amount of lines matches criterias verified in 2 arrays. can't use vba, add new columns (for instance new column vlookup formula) , preferably use arrays. i have 2 separate ranges, each id column identifier , other fields data. for instance, range 1: range 2: if had check first range do: ={sum((d4:d7="red") * (e4:e7="big"))} but don't know how check using data other range. how, example, count number of items red, big , round using both ranges ? put in cell f4: =if((vlookup(c4,$c$11:$d$12,2)="round")*(d4="red")*(e4="big"),1,"") note behavior of vlookup finds value first parameter. since there's no 1 in second dataset, first cell going show "#n/a", don't know how solve, when extend formula down compare other sample data in first set, id numbers 2 , 4 show "yes" you. edit: wanted count of list. after this, should easy count of cells in column usin...

asp.net - DateTime.TryParseExact does not process long format strings -

i have try , parse out date time string causing trouble. most of time string follows 'sat aug 10 08:01:37 2013' ^ note 1 space my original date format tryparseexact 'ddd mmm d hh:mm:ss yyyy' however, on single digit days, digit in ten's place not deleted, instead replaced space (see below) 'wed aug 7 08:01:37 2013' ^^ note 2 spaces my first idea remove spaces achieve format string: 'dddmmmdhh:mm:ssyyyy' but datetime.tryparseexact fails , never accepts newly formatted (spaceless) format string. why? because tryparseexact , spacing of date important. it's bit hacky, if no better solution presented, tryparseexact using 'ddd mmm d hh:mm:ss yyyy' , if fails, tryparseexact using 'ddd mmm d hh:mm:ss yyyy' (with 2 spaces) edit i think found smarter way, pass datetimestyles.allowinnerwhite tryparseexact method. according docs: extra white-space characters in middle of ...

indexing - Mysql not use index over huge table -

i have next table: create table `test` ( `fingerprint` varchar(80) collate utf8_unicode_ci not null, `country` varchar(5) collate utf8_unicode_ci not null, `loader` int(10) unsigned not null, `date` date not null, `installer` int(10) unsigned default null, `browser` varchar(5) collate utf8_unicode_ci not null default '', `version` varchar(5) collate utf8_unicode_ci not null default '', `os` varchar(10) collate utf8_unicode_ci not null default '', `language` varchar(10) collate utf8_unicode_ci not null default '', primary key (`fingerprint`, `date`), key `date_1` (`date`), key `date_2` (`date`,`loader`,`installer`,`country`,`browser`,`os`) ) engine=innodb default charset=utf8 collate=utf8_unicode_ci; right contains 10m records , increase per 2m records / day. my question, why mysql use "using where" on next query: explain select count(*) test date between '2013-08-01' , '2013-08-10' 1 simple test ran...

endianness - Little-endian support in Netty 4 -

the new & noteworthy docs netty 4 state support little-endian -ness has changed significantly, going on show use of bytebuf.order() . whilst that's useful localised use within channel handlers, whole downstream pipeline use little-endian buffers. the upstream handler lengthfieldbasedframedecoder takes constructor argument byte order, downstream handler lengthfieldprepender not. appears support configuration-driven replacement of buffer factories has gone netty 4, how should arrive @ complete little-endian downstream pipeline? i did this, though feels awfully hacky: https://gist.github.com/thomaslee/7871444 if wire in pipeline after lengthfieldprepender run, rewrite (big endian) length field using little endian byte ordering. probably more efficient write length in little endian after measuring length of in & dropping lengthfieldprepender entirely rather adding step pipeline code has been lazily copied & can attest working. :) i love know if ...

how to call a function of javascript in jsp without any event -

how can call javascript function without event. have session variable namely x. need call javascript function demo() if session variable not null. <% if((string)session.getattribute("x")!=null) { %> <script type="text/javascript"> demo(); </script> <% } %> let me know right way of calling demo function. if understand correctly, use onload event. at http://www.javascriptkit.com/javatutors/event3.shtml window.onload vs <body onload=""/>

node.js - Mongoose removes too many from ID -

i may misunderstanding something, on client have request sent server. like: $.post("/resources/remove", {"id": 52024e25b26d39f931000003}) on server have resource.remove({_id: request.body.id}) the "id" correct , using resource.find same arguments returns record want remove. however, when run removes all resource records. return value of exec(function (err, returnvalue) number of resource records there, removing of them. using remove.(request.body.id) same thing. do need else make sure record corresponding _id removed? if entry invalid why removing all records? try using resource.findoneandremove reference i've never used use , works me postmodel.findone({_id: id}, function (err, result) { if (err) { throw err; } if (result) { postmodel.remove({_id: id}, function (err, result) { if (err) { throw err; } res.json(200, result); }...

android - YouTubePlayerSupportFragment fullscreen button forces orientation change and does not enter fullscreen -

i creating youtubeplayersupportfragment . playing in portrait mode works fine. click fullscreen button of player forces orientation change , recreates activity in (the video stops playing , fragment recreated). this how create fragment: fragment = (youtubeplayersupportfragment) getsupportfragmentmanager().findfragmentbyid(r.id.youtube_fragment); fragment.initialize(config.youtube_api_key, this); the similar thing on stackoverflow find question: youtubeplayersupportfragment starts duplicate activity this guy has same problem no answer far. i had same issue , apparently it's defined behaviour. can disable (for example in oninitializationsucces): @override public void oninitializationsuccess(provider provider, youtubeplayer player, boolean success) { player.setfullscreencontrolflags(0); more info here .

html - How can I align an image with css -

i have code: jsfiddle <div id="picture1"> <a href="http://www.google.com" target="_blank"><img src="http://farm4.staticflickr.com/ 3780/9455263123_9150ae4a6e_o.png" /></a> </div> <div id="picture2"> <a href="http://www.google.com" target="_blank"><img src="http://farm6.staticflickr.com/ 5483/9458043690_5bce524ccf_o.png" /></a> </div> and css #picture1 { top:-10px; left: 190px; right: auto; float:right; } #picture2 { top:-10px; left: 50px; right: auto; float:left; } img { position:relative; top:-10px; -webkit-transition: 0.5s; -moz-transition: 0.5s; -ms-transition: 0.5s; -o-transition: 0.5s; transition: 0.5s; } i want images stay side side, overlapping. web site example how can this? want insert images , place them designed in background. ...

Meteor: Disallow user from selecting id's when inserting documents -

when using mini-mongo insert documents collection user pass _id field , _id set on document long string or objectid (and doesnt collide existing id). doesnt seem sensible me. want _id of documents generated server, always, dont end db both strings (potentially of different length) , objectids exist _ids. is there simple way achieve this? right best can think of checking id in deny rule (where _id either set meteor or value user provided) , if it's not type/length want change it, requires checks avoid duplicate ids. not difficult seems overly complex basic this. reviewing response, here's answer: deny inserts. create method , collectioninsert(document) , checks if _id field specified. meteor.methods({ collectioninsert: function(document) { if (document && document._id) { delete document._id; } // returns _id generated return collection.insert(document); } }); in today's versions of meteor (0.8 , higher) server , client ...

javascript redirecting mobile devices if referrer is not my domain -

for reasons long explain here, want use javascript redirect visitors index page mobile subdomain if devices using useragent. the issue have mobile site has "view full site" link sends index page. creates loop condition. here trying accomplish. if referring url not own domain and user agent matches, redirect mobile subdomain. i close missing something. if (document.referrer != "mydomain.com" && (navigator.useragent.match(/iphone/i)) || (navigator.useragent.match(/ipod/i)) || (navigator.useragent.match(/ipad/i)) || (navigator.useragent.match(/googlebot-mobile/i))); { location.replace("https://m.mydomain.com"); } your condition bit funny , have semicolon shouldnt. the referrer condition ignored since or'ed other conditions. put or's in brackets , should work. if (document.referrer != "mydomain.com" && ((navigat...

java - How to use Spring Data Repositories as Vaadin JPAContainer -

is possible use org.springframework.data.jpa.repository.jparepository repositories jpacontainer vaadin? we setting new vaadin 7 project scratch spring 3.2. the spring integration done spring vaadin integration addon . as far can entityprovider jparepository or somewhere else can use jpacontainer this: entitymanager entitymanager = getentitymanager(campaign.class)); mutablelocalentityprovider<campaign.class)> provider; provider = new cachingmutablelocalentityprovider<campaign.class)>(campaign.class), entitymanager); provider.settransactionshandledbyprovider(false); jpacontainer<campaign> container = new jpacontainer<campaign>(campaign.class); container.setentityprovider(entityproviderutil.get().getentityprovider(campaign.class)); or jsut simple entitymanager entitymanager = getentitymanager(campaign.class)); jpacontainer<campaign> container = jpacontainerfactory.make(campaign.class, entitymanager) well, should read following...

sap - Unable to access xsjs file from browser -

i new sap hana , trying expose .xsjs file data through webbrowser following url: hostname:80<instance#>/workspace/session/a00/data/services/retrievedata.xsjs however, getting following error when try access it: this link seems broken not find resource you're trying access. might misspelled or unavailable these files have created in project explorer: myschema.hdbschema schema_name="myschema" trendsdata.hdbtable table.schemaname = "myschema"; table.tabletype = columnstore; table.description = "newdataset order trendsdata"; table.columns = [ {name= "c"; sqltype = nvarchar; nullable = true; length=10; }, {name= "d"; sqltype = varchar; nullable = true; length=5; }, {name= "du"; sqltype = nvarchar; nullable = true; length=20; }, {name= "sa"; sqltype = decimal; nullable = true; length=...

apache2 - Trouble configuring apache server to proxy an SSL connection -

i'm running application on tomcat7 apache portable runtime, bought ssl certificate , configured correctly - when try connect through ip:port combination, connects fine warns me certificate issued domain name, not ip. the vps i'm on doesn't have selinux (and there's issue installing), afaik required have ssl configured in apache, want route requests tomcat, on end. i configured apache proxy connections, first port 80 works perfectly: namevirtualhost www.mysite.com:80 <virtualhost www.mysite.com:80> proxypreservehost on proxyrequests off servername http://www.mysite.com serveralias http://www.mysite.com proxypass / http://localhost:8180/mysite/ proxypassreverse / http://localhost:8180/mysite/ proxypassreversecookiepath /mysite/ / </virtualhost> and ssl port doesn't want work reason: namevirtualhost www.mysite.com:443 <virtualhost www.mysite.com:443> sslproxyengine on proxypreservehost on proxyrequests off ...

javascript - jQueryvmap with Bootstrap Popover Content -

i trying implement bootstrap popover in jqueryvmap region click event. jsfiddle default hello message :- http://jsfiddle.net/perlfanatic/kd6fm/6/ jsfiddle "message" variable :- http://jsfiddle.net/perlfanatic/kd6fm/7/ i trying implement this http://jsfiddle.net/perlfanatic/kd6fm/7/ i.e, message jqvmap on popover. reference : https://github.com/manifestinteractive/jqvmap#dynamic-updating can please me out. not javascript friendly user, don't use much, please kind on javascript noobbrain. <script type="text/javascript"> var message; jquery('#vmap').vectormap({ map: 'world_en', backgroundcolor: null, color: '#ffffff', hoveropacity: 0.7, selectedcolor: '#666666', enablezoom: true, showtooltip: false, values: sample_data, scalecolors: ['#c8eeff', '#006491'], normalizefunction: 'polynomial',onregioncli...

Getting complete educations from LinkedIn API -

i full educations data using linkedin api end-date , id fields can see. [education] => array ( [0] => simplexmlelement object ( [id] => 115254687 [end-date] => simplexmlelement object ( [year] => 2010 ) ) ) i asked r_fullprofile permissions. need additional permission? thanks. when use r_fullprofile member permission, access full profile fields of authenticated user. can retrieve basic profile fields of 1st degree connections of authenticated user explained in our connections api doc. there no member permissions allow access full profile fields of connections. restriction added protect data privacy of users.this issue not code, getting our linkedin apis allow. read following link understand more https...

javascript - touch events event delegation with jquery's .on() -

so have javascript code listens touch events on elements in document. document.addeventlistener("touchstart", touchhandler, true); document.addeventlistener("touchmove", touchhandler, true); document.addeventlistener("touchend", touchhandler, true); document.addeventlistener("touchcancel", touchhandler, true); that works fine except want listen events on items of class of datacard ( .datacard ) , of children not anchors <a> . so how thought fix through creating jquery selector, using jquery earlier in page, , calling .addeventlistener() on that. didn't work. this tried: $('.datacard, .datacard *:not(a)').addeventlistener("touchstart", touchhandler, true); $('.datacard, .datacard *:not(a)').addeventlistener("touchmove", touchhandler, true); $('.datacard, .datacard *:not(a)').addeventlistener("touchend", touchhandler, true); $('.datacard, .datacard *:not(a)').add...

symfony - FOSUserBundle validate email in controller -

i'm trying validate fields fosuserbundle in controller. i'm passing values ​​from request without using form (i'm using jquery plugin x-editable). far have tried way saves me email if invalid or empty: $userid = $request->get('pk'); $value = $request->get('value'); $em = $this->getdoctrine()->getmanager(); $user = $em->getrepository('acmeuserbundle:user')->find($userid); if (!$user) { throw $this->createnotfoundexception('unable find products entity.'); } $user->setemail($value); $validator = $this->container->get('validator'); $errors = $validator->validate($user, array('profile')); if (count($errors) > 0) { return new response(print_r($errors, true), 400); } $this->container->get('fos_user.user_manager')->updateuser($user); return new response('', 200); where doing wrong? ...

javascript - HTML 5 maze game - What to do after collision detection if the touch event continues? -

i working on maze game using html5 canvas , javascript (i prefer using jquery library coding). - the game mobile devices , totaly new using touch events on canvas, adding maze image - black , whit gif labyrinth. i going use trouch in order navigate through maze. here have done: add event listener touch: window.addeventlistener("touchmove", handlemove, false); added function handle move: function handlemove(e){ e.preventdefault(); // check touch position on canvas var checkx = event.targettouches[0].pagex - canvas.offsetleft; var checky = event.targettouches[0].pagey - canvas.offsettop; var collision = checkcollision(checkx,checky); if (collision == 0){ x = checkx; y = checky; draw(imgwidth,imgheight,ctx); } else { // here problem - should do? //because if touch event continues, collision // function hit white color again //and ball navigating through maze // pass border. } }; checking collision - here pr...

animation - Jquery shaker to all sides -

is there jquery function, shake object sides? i'm using css: @-webkit-keyframes spaceboots { 0% { -webkit-transform: translate(2px, 1px) rotate(3deg); } 10% { -webkit-transform: translate(-1px, -2px) rotate(-3deg); } 20% { -webkit-transform: translate(-3px, 0px) rotate(4deg); } 30% { -webkit-transform: translate(0px, 2px) rotate(3deg); } 40% { -webkit-transform: translate(1px, -1px) rotate(4deg); } 50% { -webkit-transform: translate(-1px, 2px) rotate(-4deg); } 60% { -webkit-transform: translate(-3px, 1px) rotate(3deg); } 70% { -webkit-transform: translate(2px, 1px) rotate(-4deg); } 80% { -webkit-transform: translate(-1px, -1px) rotate(4deg); } 90% { -webkit-transform: translate(2px, 2px) rotate(3deg); } 100% { -webkit-transform: translate(1px, -2px) rotate(-4deg); } } but working chrome. is there jquery function, shake object sides no, there isn't. jquery not have function specific.

trouble making drive insertion detection c# -

i trying add drive detection program having bit of difficulty. when try use code specified on code project . using windows project , having trouble getting working. namespace project { public partial class mainwindow : window { other code private const int wm_devicechange = 0x219; protected override void wndproc(ref message m) { switch (m.msg) { case wm_devicechange: // wparam value identifies occurring. // n = (int)m.wparam; break; } base.wndproc(m); } } } for wndproc need have using system.windows.forms; have using system.windows.controls; gives me following error is ambiguous reference between 'system.windows.controls.menuitem' , 'system.windows.forms.menuitem' for base.wndproc(m); error:'system.windows.window' not contain definition 'w...

internet explorer - Parent document is in Standards mode but Inner Iframe document (without doctype) runs in wierd mode in IE -

i have webpage runs in standards mode. webpage hosts iframes linking visitors home pages on have no control. have observed visitors home pages run in quirks run standalone , once loaded in inner iframe, styles breaks up. it appears inner document running in ie5 quirks! is there workaround issue? short answer: no, there's no work-around, document type inherited parent page in ie > 8. your options are: a) open page in new tab b) put page quirks mode (if do, pages requiring non-quirksmode won't work, includes iframe & parent page pages) c) ask site owner please update html standards-compliant you can put main page ie8 mode: <meta http-equiv="x-ua-compatible" content="ie=emulateie8" /> that break pages requiring ie9+ features.

c# - Receiving UnauthorizedAccessException When Trying to Move File -

i'm writing regression tests , need manually move file 1 location another. each time unauthorizedaccessexception happens, i'm assuming has permissions of folder file has moved from? i've checked file attributes , not set read-only. other questions , answers, i've tried setting attribute within program normal. i've thought maybe using setaccesscontrol help, i'm having trouble figuring out how set filesecurity parameter. of course, way off on issue well. in terms of permissions, administrator on local machine , on network, , if try moving files , locations in question powershell, no issues, don't have elevate or force, visual studio running on different permissions, , if so, how can change that? here code: internal static bool process5010claims(string batch) { string batchregex = createbatchregex(batch); string batchonfilesystem = adddecimaltobatch(batch); bool isfound = false; string pth = @"\\hedgefr...

sql - Update or Insert value if a field is NULL -

i know simple question wanted sure. have null value in field, , want change null value. change null value use insert or update? for example: insert datatable (column 1) values (1) 'column 1' = null or update datatable set 'column 1' = 1 'column 1' = null thank you. you use update updates , insert inserts(new records). update incorrect since cannot compare null values = or <> . therefore have use is : update datatable set [column 1] = 1 [column 1] null

ios - Is there a way to get the last push notification when my app starts up? -

in scenario user did not swipe push notification before disappeared, there way retrieve last 1 sent device app? can go notification center , see last few push notifications app there, there way can retrieve last 1 when app opens? there no way retrieve past push notifications. typically, isn't needed. once launched, app can communicate server see what's new. if app launched notification, app receive push notification passed in option key uiapplicationlaunchoptionsremotenotificationkey app delegate method application:didfinishlaunchingwithoptions . if app running , in foreground when push notification arrives, app delegate application:didreceiveremotenotification called with ios 7 , later, if notification type content-available , have background app refresh capability turned on (and user has not disabled background app refresh), app in background application:didreceiveremotenotification

ms access - Form based on a one-to-many relationship - just show parent records with child actions -

i have 2 tables, 1 parent records, , 1 child records. the child records displayed in subform attached bottom of form containing parent records. i want main form's recordset consist of parent records child records exist. however, when try this, multiple parent records (i.e. if flick through records, have pass 4 parent records if there 4 associated child records, etc.). i think need use group when try create query (so might able base form on it) tells me need group on fields in query, errors when so. please help! thanks i don't know how populating main (parent) form, if find record source form, property sheet, click build button (...) invoke query builder , can add in (show) child table. assuming there exists relationship between 2 tables, create inner join. if there isn't relationship (a join) drag , drop primary key in parent table foreign key in child table. you don't need include fields child table, have include fields need parent table in qu...

javascript - Why is YUI.add required when specifying YUI modules and if it is required how can non-YUI modules work? -

we use yui3 loader manage loading our javascript , css files. part of bootstrap js code on each page, have following: yui({ ... groups: { ... mygroup: { modules: { "my-module": { ... path: "mymodule.js", requires: [ "yui-base" ] }, } ... } } }).use("my-module", function (y) { y.mymodule.dostuff(); }); mymodule.js has following: yui.add('my-module', function (y) { y.mymodule = function () { ... _validator: y.lang.isstring }; }, '3.4.0', { requires: [ "yui-base" ] }); yui claims here loader can used non-yui3 "modules" given have dependencies specified in configuration. give following example module configuration yui2 group: yui2: { combine: true, base: 'http://yui.yahooapis.com/2.8.0r4/build/', c...

css - Importing Google Font into HTML Service -

are able import google font google apps script's html service? i trying do: <link href='http://fonts.googleapis.com/css?family=roboto' rel='stylesheet' type='text/css'> and use .nav-stacked li { color: rgb(136, 136, 136); display: list-item; font: 18px 'roboto', sans-serif; font-weight: 100; height: 20px; line-height: 20px; padding-right: 10px; text-indent: 24px; width: 194px; } but keeps reverting sans-serif font. thanks help, you need style properly .nav-stacked li { font: 18px 'roboto',sans-serif; }

html5 - Jquery Mobile slider not working JQM 1.3.2 and Jquery 1.10.2 -

i working jquery mobile first time design mobile web application. application has 1 page has header , navigation bar placed @ fixed position . onclicking tabs on navigation bar page loads on same page below nav bar within div left blank . seems on calling new pages on same page via ajax makes jquery mobile effect not work. none of data-theme, data-role , range , other data-attribute work. trying implement slider page "journal" shows text box value in it <div style="float:left" data-role="fieldcontain"> <label for="slider-fill">input slider:</label> <input type="range" name="slider-fill" id="slider-fill" min="0" max="100" data-highlight="true" /> </div> i using jquery mobile 1.3.2 , jquery 1.10.2 ! here html code page. see many repetition code coz not connected complete database once connect database wud little less messy. <body> <link...

java - Parse an Expression to its components and sub components -

i need parse expression such as: neg(and(x,y)) i need come out abstract stack machine code such example above: load x; load y; exec and; exec neg; but machine code not issue, how can parse / break input string of expression sub expressions? i have tried find first bracket , concat last bracket gives isuess if have inner expression? code have tried: (please not still in development phase) private boolean evaluateexpression(string expression) { int brackets = 0; int beginindex = -1; int endindex = -1; (int = 0; < expression.length(); i++) { if (expression.charat(i) == '(') { brackets++; if (brackets == 0) { endindex = i; system.out.println("the first expression ends @ " + i); } } if (expression.charat(i) == ')') { brackets--; if (brackets == 0) { endindex = i; system.out.printl...

dimensions - reshape in MATLAB -

if come following line of code in matlab : reshape(dataset{i},1, 200*200); here, dataset{j} seems element in cell array . right? since using reshape , can that element array ? when use reshape , define dimensions (i.e; m,n). in code above, m=1 , n=200*200 ? but, why wasn't n written 400 instance? there reason writing in syntax see? thanks. dataset cell array can't assume dataset{j} array. reshape work on strings , cell arrays well: reshape({1,2,3,4},2,2) ans = [1] [3] [2] [4] >> reshape('abcd',2,2) ans = ac bd there's not obvious reason write 200*200 unless 200 important understanding being computed.

appsdk2 - Using Rally WsapiDataStore at a certain date -

i want create chart of how many tasks in given schedule state during length of sprint. possible call wsapidatastore on each day? what looking lookback snapshot store , using lookback api - allows specify date or point in time want query by. a typical use looks this: ext.create('rally.data.lookback.snapshotstore', { pagesize : 10000, fetch : ['fetch'], filters : [{ property : '__at', value : 'current' },{ property : '_itemhierarchy', value : 'hierarchicalrequirement' }] }).load({ callback : function(records) { ext.array.each(records, function(record) { // each record }); } });

c# - Returning a multiple table LINQ query as one object -

so current application need query database using repository returns single object. problem information split 2 different tables. object im trying rule object. rule class consists of following database entities: class rule { stratruledef ruledefinition { get; set; } list<stratcode> rulecodelist { get; set; } in repository im using following query relevant info: public void getrule(int rulekey) { rule rulequery = ruledefinition in arecontext.stratruledefs rulecodes in arecontext.stratcodes ruledefinition.stratrulekey == rulekey && rulecodes.stratrulekey == rulekey select new { ruledefinition, rulecodes }; so have 2 problems. 1) how return rulequery 'rule' object, if change 'var' rule following error: error 10 cannot implicitly convert type 'system.linq.iqueryable' 'testrul...