Posts

Showing posts from August, 2015

Facebook PHP Destroy Session -

despite me trying hours on this, can't figure out why can't destroy facebook session. logout url logs out of facebook, can't destroy session. i've trawled through stack overflow none of answers have helped far. session_start(); $app_id = 'xxx'; $app_secret = 'xxx'; $redirect_uri = 'xxx'; $permissions = array(xxx); define( 'root', dirname( __file__ ) . '/' ); require_once( root . 'facebook-php-sdk-v4-4.0-dev/autoload.php' ); use facebook\facebooksession; use facebook\facebookredirectloginhelper; // initialize sdk facebooksession::setdefaultapplication( $app_id, $app_secret ); $helper = new facebookredirectloginhelper( $redirect_uri ); // check if existing session exists if ( isset( $_session ) && isset( $_session['fb_token'] ) ) { // create new session saved access_token $session = new facebooksession( $_session['fb_token'] ); // validate access_token make sure it's still valid ...

Insert Statement Check Is NULL SQL Server 2008 -

my small sql query importing data old database new one. new database not allow projectno , projectname or leaderid null value, code needs check if value null , if is, add in default values projectname , leaderid ( projectno primary key of old table, cannot null ). as far can tell, have written case statement correctly keep getting following error: cannot insert value null column 'projectname', table 'erp.dbo.project'; column not allow nulls. insert fails. i using sql server 2008 well insert [erp].[dbo].[project] ([projectid], [projectname], [leaderid]) select projectno, case when projectname null 'unknown' end, case when projectleaderid null 1 end multitech.dbo.projects go using isnull insert [erp].[dbo].[project] ([projectid] ,[projectname] ,[leaderid]) select projectno, isnull(projectname, 'unknown'), isn...

javascript - JS Speech Synthesis Issue on iOS -

i implemented basic web app relied on google's tts url generate clear mp3 files playback on front end. this has since been subject additional security check, meaning have had update code base use alternative methods. one such alternative javascript's speech synthesis api, i.e. speechsynthesisutterance() , window.speechsynthesis.speak('...'). works on desktop , laptop use on ios devices, rate of audio accelerated significantly. can suggest can resolve this? see below example code: var msg = new speechsynthesisutterance(); msg.text = item.title; msg.voice = "google uk english male"; msg.rate = 0.7; msg.onend = function(){ console.log('message has ended'); $('.word-img').removeclass('img-isplaying'); }; msg.onerror = function(){ console.log('error speech api'); $('.word-img').removeclass('img-isplaying'); }; window.speechsynthesis.speak(msg);...

c++ - newComputePipelineStateWithFunction failed -

i trying let neural net run on metal. basic idea of data duplication. each gpu thread runs 1 version of net random data points. i have written other shaders work fine. i tried code in c++ command line app. no errors there. there no compile error. i used apple documentation convert metal c++, since not c++11 supported. it crashes after loads kernel function , when tries assign newcomputepipelinestatewithfunction metal device. means there problem code isn't caught @ compile time. mcve: kernel void net(const device float *inputsvector [[ buffer(0) ]], // layout of net * uint id [[ thread_position_in_grid ]]) { uint floatsize = sizeof(tempfloat); uint inputsvectorsize = sizeof(inputsvector) / floatsize; float newarray[inputsvectorsize]; float test = inputsvector[id]; newarray[id] = test; } update it has dynamic arrays. since fails create pipeline state , doesn't crash running actual shader must coding issue. not input...

android - ArrayAdapter.getView returns only the last item being fetch -

here getview code. returns last item being fetched. how can resolve problem. new holderview. *updated codes public static final char[] alpha = {'a', 'b'....}; int[] icons = {r.drawable.a, r.drawable.b....}; public customlist(context context, character[] split) { super(context, r.layout.activity_list, split); inflater = layoutinflater.from(context); this.alphasplit = split; } static class holder { imageview imageview; } @override public view getview(int position, view convertview, viewgroup parent) { holder holder; if (convertview == null) { convertview = inflater.inflate(r.layout.activity_list, parent, false); holder = new holder(); holder.imageview = (imageview)convertview.findviewbyid(r.id.img); convertview.settag(holder); } else { holder = (holder)convertview.gettag(); } setimage: (int loop = 0; loop < alphasplit.length; loop++) { (int j = 0; j < alpha.length; j++) { ...

scheme - SICP exercise 3.62 -

i've been finished exercise 3.59, 3.60, 3.61 , stuck @ 3.62, turn sicp-solutions@scheme wiki community help. exercise 3.59 , 3.60 tested sine , cosine case, not 3.61 or 3.62. the 3.62 code provided on community produces all-zero tangent series on condition of correct sine , cosine series: > (display-stream-until sine-series 7) 0 1 0 -1/6 0 1/120 0 > (display-stream-until cosine-series 7) 1 0 -1/2 0 1/24 0 -1/720 > (display-stream-until tangent-series 7) 0 0 0 0 0 0 0 at first think code wrote in previous exercises might wrong, check solutions of 3.59/3.60/3.61 on community , turn out produce same result. i try copying code of 3.59 / 3.60 / 3.61 ide(drracket) , still tangent series printed zero. here code: (define (mul-series s1 s2) (cons-stream (* (stream-car s1) (stream-car s2)) (add-streams (mul-streams (stream-cdr s1) (stream-cdr s2)) (mul-...

node.js - Log to grunt from other file -

i'm using grunt plugin, grunt-casper , allow me use casperjs run web crawling tasks. however, way plugin works runs casperjs file.js on files specify in task options. i want able log output file.js , , can using console.log -- shows in terminal. can't that, however, grunt.log('test'); (unsurprisingly, don't have access grunt variable. suggestions?

c++ - Lifetime of rvalue ref -

the code below works fine , far understand every time function called, local variable (i.e. vector) created , ownership transferred in rvalue reference @ first call , in const reference (if remove won't compile) @ second call. result, local variables didn't die when function terminated, when references in main went out of scope (i.e. in end of main() ), i think ! #include <iostream> #include <vector> std::vector<int> get_v(void) { std::vector<int> v{1,2,3}; return v; } int main() { std::vector<int> &&rval_ref = get_v(); for(unsigned int = 0; < rval_ref.size(); ++i) std::cout << rval_ref[i] << "\n"; const std::vector<int> &con_ref = get_v(); for(unsigned int = 0; < con_ref.size(); ++i) std::cout << con_ref[i] << "\n"; return 0; } output: gsamaras@pythagoras:~$ g++ -std=c++0x -wall px.cpp gsamaras@pythagoras:~$ ./a.out 1 2 3...

c# - MVC razor partial view radio button selection for each row in model -

i have partial view displays viewmodel list containing 4 data columns. want have user select 1 row , press button post action. view model looks like: public class viewmodelselection { public long selecteditem { get; set; } public list<viewmodelfromdb> choices { get; set; } } the partial view looks like: @model myapp.viewmodels.viewmodelselection <h4>title</h4> @using (html.beginform()) { @html.antiforgerytoken() <table> <tr> <th></th> <th>name</th> <th>measurea</th> <th>measureb</th> </tr> @foreach (var item in model.choices) { <tr> <td> @html.radiobutton(item.id, model.selecteditem) </td> <td> @html.displayfor(modelitem => item.name) </td> ...

Mysql Merging Databases - Same Schema -

so year ago have taken on development , management of database organisation work for. (in-house developer). the organisation national organisation, started out in 1 state. dev company in charge of development @ time, decided take shortcut method of opening database other state duplicating schema , putting under different name. so, left work 4 duplicate database, years of information in them can't lose. it largely acts training database. site has classes, people participant in classes, there links cant messed up. site: (ai)site_id classes: (ai)class_id site_id person: (ai)person_id participants: (ai)id person_id site_id of course, 1 small part of database. i wanting turn partial tennant based database, can separate information needs separating (classes, sites ect), , national information (like person person in state) global. site: (ai)site_id state_id classes: (ai)class_id site_id state_id person: person_id participants: (ai)id person_id class_id state_id i...

Integrate PayPal with Cordova without plugin? -

i read paypal's plugin cordova/phonegap https://devblog.paypal.com/paypal-cordova-plugin-released/ but seems there no support windows phone, plus there gateway must supported application (it's local gateway , checked released nothing cordova). how can integration without plugins? have create webpage , make mobile access via browser?! if so, how come app when work finished? any ideas? you can refer link below windows 8 checkout sdk. https://developer.paypal.com/docs/classic/windows-8-checkout-sdk/gs_win8xo/ plus link below paypal mobile overview reference. https://developer.paypal.com/docs/classic/products/mobile-overview/

Azure Automation: VM shutdown runbook not working on new VM -

i had delete , re-install vm due issue vm locking up. vm online, noticed shutdown automation not working. working fine before ran issue vm. below ps script runbook, returns following error: correlation id: 72fa8e58-89f1-4612-bc43-1b05876c2bff timestamp: 2015-08-25 06:04:14z: remote server returned error: (401) unauthorized. @ shutdown:6 char:6 + + categoryinfo : closeerror: (:) [add-azureaccount], aadauthenticationfailedexception + fullyqualifiederrorid : microsoft.windowsazure.commands.profile.addazureaccount 8/24/2015 11:04:25 pm, error: get-azurevm : no default subscription has been designated. use select-azuresubscription -default <subscriptionname> set default subscription. @ shutdown:8 char:8 + + categoryinfo : closeerror: (:) [get-azurevm], applicationexception + fullyqualifiederrorid : microsoft.windowsazure.commands.servicemanagement.iaas.getazurevmcommand any idea missing working new vm? have been wracking brain credentials not include new ...

ios - Set background image of Button in Objective-C -

i problem cannot set background image uibutton. button colour button , want have image @ background of button. , also, can increase size of background image. code is: in .h @property (weak, nonatomic) iboutlet uibutton *color1; in .m uiimage *colorimage = [uiimage imagenamed:@"57_bg_selected"]; [_color1 setbackgroundimage:colorimage forstate:uicontrolstatenormal]; what got background image step on button. button should of custom type set image. verify code once again. set button custom type in storyboard.

Executing a string in PHP -

i have requirement have conditions saved in db. able bring conditions via php code, not able execute them. have shown 1 example below. <? $z = ">100";//i value db $x = 80; // value comes db if(exec("&1 &2",$x,$z)) echo "yes"; else echo "no"; ?> also tried this <? $z = ">100"; $x = 80; if(eval("$x $z")) echo "yes"; else echo "no"; ?> it should be, ( eval accepts statements, not expressions) $z = ">100";//i value db $x = 80; // value comes db if(eval("return {$x} {$z};")) echo "yes"; else echo "no"; ?>

visual studio 2013 - TFS download having issues with nuget packages -

i'm having similar issue following question owin: errors resolving nuget packages after tfs download . the errors have shown after downloading tfs are: type or namespace name 'cors' not exist in namespace microsoft.owin type or namespace name 'httplistener' not exist in namespace microsoft.owin.host' ... they show in nuget installed i've got exclamation next reference in project. i did removed , re-added packages , resolves issue on computer check in , download again different computer , issue still present. need download work every computer because of using tfs builder. see similar errors showing there when initiate build. i've tried on vs2013 , vs2015, vs2013 has handful of errors vs2015 gives me on 1200+ errors , think there other issues newest nuget , package migration... now, i'm going concentrate on vs2013.

Can we install both version Mule AnyPoint Studio July 2014 and June 2015 Release in same PC without any conflicts? -

i have small query generally. i'm working on studio july 2015 release 3.5.1 runtime client project. i'm willing install anypoint june 2015 runtime 3.7 release poc purpose. conflict each chance (or override while installing). don't want override or update july 2015( should not disturbed in ways) new since project running on it. if want install june 2015 step need take care? or don't require any? . please advice. there should no problem installing several versions of anypoint studio there no problem in installing several versions of eclipse on same machine. install different versions in different directories. you should able use same workspace across versions, potential weird effects if incompatible features used in projects opened 2 versions (which not you'll do, should fine).

bash while loop breaking too early -

i'm relatively new bash (programming in general) , have been self taught part, have while loop supposed exit if conditions met. while [[ "$var1" != "$var1_tgt" ]] && [[ "var2" != "$var2_tgt" ]] && [[ "$var3" != "$var3_tgt" ]] && [[ "$var4" != "$var4_tgt" ]]; loop...; done the problem seem having (i think) in evaluation of loop. when run script break if 1 of conditions met, want loop break when conditions have been satisfied. is, when var# equals var#_tgt var's, should loop break. far know using "&&" should mean conditions must met before loop exit, fact it's not working means missing something. appreciate figuring out. you need change loop to: while [[ "$var1" != "$var1_tgt" ]] || [[ "var2" != "$var2_tgt" ]] || [[ "$var3" != "$var3_tgt" ]] || [[ "$var4" != "$v...

draw connector on two mouse clicks in javascript -

i have below code have dynamically created circles drag-gable. need create connector between 2 drag-gable circles using js. using d3 library. on click co ordinates not sure how proceed further. when 2 clicks on of dynamically created circles 1 connector should created , should drag-gable. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script> <style type="text/css"> .mybutton { background:#0000ff; width:40px; height:40px; border-radius:20px; -khtml-user-drag: element; -webkit-user-drag: element; } #root { background:#ffff00; } #service{ background:#00ff00; } #divcontainer, #divresize { border:dashed 1px #ccc; width:120px; height:120px; padding:5px; margin:5px; ...

java - Android Image processing Code Explaination -

i new programmer.could please explain these line of code? getwindow().addflags(windowmanager.layoutparams.flag_fullscreen); setrequestedorientation(activityinfo.screen_orientation_landscape); it's pretty self explanatory, know. in first line of code, first gets window instance using activitie's getwindow() method. there addflags(int) method in window instance got. can call getwindow().addflags(/*blah blah blah*/); what addflags mean adds special attributes window. in case, windowmanager.layoutparams.flag_fullscreen constant defined in windowmanager.layoutparams class. think can it. this line of code sets window full screen! easy, huh? the second line of code, method name suggests, ( setrequestedorientation ) sets orientation of screen something. , what's in brackets i.e. screen_orientation_landscape . again screen_orientation_landscape constant defined in activityinfo class. this line of code sets orientation landscape mode. by way, code do...

html - Different login page for every client (on one server) -

scenario: currently, have website tool in asp.net mvc (www.tool.com/login) . now, client looking customizing login page several customers , have own domain (but 1 server all). for example: www.client1.com/login , www.client2.com/login , www.client3.com/login yell @ me if stupid question. please , give me idea on how implement it. should create different login htmls each client? related comment - create table clientinfo in db: title backgroundcolor language url --> has unique work [client1, client2]. don't save full url -- host let's passing model --> loginmodel loginpage.cshtml public class loginmodel { public string username { get; set; } public string password { get; set; } public styledto clientstyles { get; set; } } public class styledto { public string title { get; set; } public string logopath { get; set; } public string backgroundcolor { get; set; } } in controller when load view: public ...

Re-ordering an ArrayList in a specific order in java -

i have 2 following arraylists : orderlist=[htc, apple, blackberry, karbon] dynamiclist=[nokia, samsung, apple, htc, blackberry, micromax, lenova, karbon] while passing dynamiclist back-end, want re-order elements in dynamiclist based on order in orderlist in following way. dynamiclist=[htc, apple, blackberry, karbon, nokia, samsung, micromax, lenova] example : dynamiclist=[nokia, samsung, blackberry, micromax, lenova, karbon] should ordered follow dynamiclist=[blackberry, karbon, nokia, samsung, micromax, lenova] where should start ? create new list finallist . loop on orderlist , check if element present in dynamiclist . if is, add() finallist , remove dynamiclist . once you're done looping on orderlist , add remaining elements of dynamiclist finallist .

1062 Soap Fault Exception. Shipping address not set? -

request = new soapobject(namespace, "shoppingcartshippingmethod"); request.addproperty("sessionid", sessionid); request.addproperty("quoteid",cartid); request.addproperty("shippingmethod","flatrate_flatrate"); log.e("shippingrespomnse...", request.tostring()); env.setoutputsoapobject(request); androidhttptransport.call("", env); soapobject methodset; methodset = (soapobject) env.getresponse(); log.e("shippingrespomnse...", methodset.tostring());

php - I have time like this 12:00:00 AM how to add + two hours with the time -

this question has answer here: add 'x' amount of hours date 8 answers i have time 10:00:00 how add + 2 hours time. i have tried this: $today = "10:00:00 am"; $starttime = "02:00:00"; $endtime = date("g:i:s a", $starttime+$today); echo $endtime; i vanilla php, object style using datatime() $date = new datetime('10:00:00 am'); $date->modify('+2 hours'); echo $date->format("g:i:s a"); output: 12:00:00 pm or can try lib ouzo goodies , , in fluent way: echo clock::at('10:00:00 am')->plushours(2)->format("g:i:s a"); output: 12:00:00 pm

Cakephp admin url routing not working -

i have developed large website in cakephp. on development time admin url site_url/admin . client wants lc_admin. change prefixes in core.php file when tried access page shows me error lc_admin_index() action not defined. because actions admin_index , on. to solve issue tried code below router::connect('/lc_admin/:controller', array('action' => 'index', 'prefix' => 'admin', 'admin' => true)); router::connect('/lc_admin/:controller/:action/*', array('prefix' => 'admin', 'admin' => true));` but old url called site_url/admin working. , want new url accessible. if want direct route path keyword use simple. route path router::connect('/lc_admin',array('controller' => 'admin', 'action' => 'index'));

r - How to create a raw array in hexmode -

i need create array raw type in hexadecimal form.. for example, if have array c("f2","4d"......), how convert raw type in hexadecimal form. or, have methods create array value: raw [1:3] f2 4d 79 without transferring array of int or char?

PHP / MySQL - Query not fetching any data -

i have been trying set page lists prices of items table in database. here code: <?php $querylist = mysql_query("select item_name,image,price,added_by values"); while($row = mysql_fetch_array($querylist)) { echo '<div class="post rareitem" style="margin-right: 15px;float: left;"> <div class="rarename"> <strong>'; // shows item name echo $row['item_name']; echo '</strong> </div>'; // shows item image echo '<div class="rareimage" style="background-image: url(/app/tpl/skins/mango/images/values/rares/'; echo $row['image']; echo ');"></div>'; // shows item price echo '<div class="rarecontrols"> <div class="coinsbox"></div> <span> <b> <b>credits: </b> </b> '; ...

objective c - Store multiple json object in to a text file iOS -

when there no internet connection on device, storing json in text file. problem is, if again getting replaced. here doing store text file. how store multiple json object in text file.when connection need post json server. nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *docdir = [paths objectatindex:0]; nsstring *filepath = [docdir stringbyappendingpathcomponent:@"file.json"]; [jsonstring writetofile:filepath atomically:yes encoding:nsutf8stringencoding error:&error]; please advice. that's not straight forward concatenating multiple json files not result in valid json file. requires read , parse existing json file, give nsarray or nsdictionary top-level object, append data new json file , write whole thing out. that inefficient processing old data. therefore suggest write new data new file, using current date/time filename, , when it's time upload, read each of files , upload them ...

ember.js - ember - recommended way to fetch a collection of objects to use as menu options without them being considered part of the model -

i have model foo has field barid has belongsto relationship model named bar . want have menu of bars set barid value in "new" foo template. i've created select component displays things properly. where appropriate place me json fetch of bar collection? i'm assuming should stored in controller decorates model , makes context available template. doing rsvp.hash() in router's model() doesn't seem appropriate me, consider bar collection part part of foo model. should using router's aftermodel()/setupcontroller() , controller's init() or set somewhere else? sorry don't have jsfiddle or anything, don't know how set 1 code requires babel. any appreciated. it turned out non-issue using ember.rsvp.hash() in router's model() without using setupcontroller() defaults model.foo, model.bar, etc, can access in controllers/templates/etc. what worried other collections/objects fetched store stored along 'model' ...

javascript - How To Add Event Listener To OverlayView? -

i trying create overlayview on google map custom marker. i able create overlayview following. http://plnkr.co/edit/4xdane?p=preview however, when try add event listeners it, got stuck. i tried followings no luck. // ------------- trying add dom event listener --- google.maps.event.adddomlistener(this.div, 'click', function(){ alert(1); // not working }) // ------------- or, --- this.div.addeventlistener('click',function() { alert(1); // not working }); anyone made successfully? ----- update ---- per @dr-molle suggests, following accepts mouse click. //panes.overlaylayer.appendchild(div); not panes.overlaymousetarget.appendchild(div); // but, // ------------- trying add dom event listener --- google.maps.event.adddomlistener(this.div, 'click', function(){ alert(1); // working }) you must use different pane layer. currently use overlaylayer , overlaymousetarget , f...

Struts2 rest webservice with hibernate entity issue -

i doing webservice struts2 rest plugin, able send normal text , object json response, if try send hibernate entity having relationships not able send json response giving error no serializer found class org.hibernate.proxy.pojo.javassist.javassistlazyinitializer , no properties discovered create beanserializer (to avoid exception, disable serializationconfig.feature.fail_on_empty_beans) ) (through reference chain: org.codehaus.jackson.map.jsonmappingexception["path"]->java.util.unmodifiablelist[0]->org.codehaus.jackson.map.reference["from"]->java.util.arraylist[0]->app.com.gmf.dto.restaurantmasterbean["restype"]->app.com.gmf.dto.restauranttypebean_$$_javassist_4["hibernatelazyinitializer"]) the error says : jsonmappingexception the bean you're trying send contains other objects , not fetched eagerly & hence, there properties not initialized. when bean marshalled json, these properties fail. there multiple ...

json - Call dynamic method in c# -

i have json request parameters { "exp": 0, "iat": 0, "method": "login", "apisecretkey": "y109m113e122", "username": "test@test.com", "password": "test", "isguestcustomerid": 1 } and method in wcf rest api service(c#) login(string apisecretkey, string username, string password, int isguestcustomerid) how pass these request parameter login method? note : have around 200 methods call in way different parameters like register(string apisecretkey, string emailid, string password, string firstname, string lastname, string phonenumber, string gender, string dateofbirth, string companyname) , on different methods thanks in advance. using json.net, var jobj = jobject.parse(json); object instance = .... ; //instance of class containing methods.. var mi = instance.gettype().getmethod(jobj["method"].tostring(), bindingflags.instance...

sequence - Using Stride in Swift 2.0 -

i'm trying figure out how use stride features in swift. it seems have changed again, since xcode 7.0 beta 6. previously use let strideamount = stride(from: 0, to: items.count, by: splitsize) let sets = strideamount.map({ clients[$0..<advance($0, splitsize, items.count)] }) now, despite code hint cannot figure out how use feature. any examples helpful thanks. i've looked @ examples , cannot come grips how use it. apple docs limited. thanks it changed bit, here new syntax: 0.stride(to: 10, by: 2) and array(0.stride(to: 10, by: 2)) // [0, 2, 4, 6, 8] if take @ here , can see types conform strideable protocol. as @richfox pointed out, in swift 3.0 syntax changed original global function form like: stride(from:0, to: 10, by: 2)

java - Either log or rethrow this exception -

possible duplicate of sonar complaining logging , rethrowing exception . this code in class: try { this.processdeeplinkdata(data); } catch (final exception e) { // error while parsing data // nothing can logger.error(tag, "exception thrown on processdeeplinkdata. msg: " + e.getmessage()); } and logger class: import android.content.context; import android.util.log; import com.crashlytics.android.crashlytics; public final class logger { /** * convenience method. * * @see logger#log(string, string) */ public static void error(final string tag, final string msg) { if (logger.debug) { log.e(tag, "" + msg); } else { logger.log(tag, "" + msg); } } private static void log(final string tag, final string ...

How to send emails in background in python webapplication with flask framework? -

i need sent emails large number of recipients attachments web application after completing event. want run in background in order not affect main application processes. how implement this? miguel grinberg gives complete example of in flask mega tutorial . basically can push mail sending thread. from threading import thread app import app def send_async_email(app, msg): app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = message(subject, sender=sender, recipients=recipients) msg.body = text_body msg.html = html_body thr = thread(target=send_async_email, args=[app, msg]) thr.start()

android - Google Maps: custom LocationSource in iOS -

i have built android app able use google maps displaying users geo location several additional information beside wifi, cells , gps, instance qr codes, beacons or whatever use signal current position (i don't take account of actual accuracy of these locations). using locationsource , pass google maps api via setlocationsource . i have use google maps apple maps limited in available zoom level, can't zoom buildings. is possible provide custom locationmanager gets updated regularly action , inject google maps api locationsource ? i know there hacks place custom marker on map, makes impossible use other features of google maps move camera users location tapping on "my location" button. thank you. there solution. google maps api uses cocoa framework class cllocationmanager. how informed current gps location changes must conform cllocationmanagerdelegate , delegate of cllocationmanager object. updates being sent delegate object through locationmanag...

Javascript fade in with jQuery or Javascript -

how can make javascript fadein this: http://www.bewerberfilm.com the videos fadein left , right. textboxes above videos fade in different second settings. how can realize that? can show me or me? have no experience in js/jquery want learn language. you can add listener scroll event this: $(document).ready(function() { var element = $('#myelement'); var running = false; $(window).scroll(function() { console.log(element.position()); if (element.position().top <= $(window).scrolltop() + $(window).innerheight() && !running) { console.log("triggering animation"); running = true; element.removeclass().addclass('fadeinleftbig animated').one('webkitanimationend mozanimationend msanimationend oanimationend animationend', function() { $(this).removeclass(); }); } }); }); #myelement { height: 40px; clear: both; border: 1px solid black; } <script ...

webpack - Module not found: Error: Cannot resolve module 'server' -

i try use webpack managing files in project. use webpack-dev-server , bower-webpack-plugin . when run server, error in browser console. module not found: error: cannot resolve module 'server' webpack.config.js const bowerwebpackplugin = require("bower-webpack-plugin"); module.exports = { entry: './src/script/index.jsx', output: { filename: 'bundle.js', //this default name, can skip //at directory our bundle file available //make sure port 8090 used when launching webpack-dev-server publicpath: 'http://localhost:8090/assets' }, devtool: 'source-map', module: { loaders: [ { test: /\.js[x]?$/, loaders: ['react-hot', 'jsx', 'babel'], exclude: /node_modules/ }, { test: /\.scss$/, loaders: [ 'style', 'css?sourcema...

visual studio 2012 - C++ static library using functions defined in another cpp project -

i working on vs 2012 project , using compiled static library (that compiled in vs 2013). library references "vacopy" method vs 2013 compatible not found in vs 2012. when compile cpp project, linking error : error lnk2019: unresolved symbol __imp___vacopy my first reflex add declaration , definition of va_copy in project, included following: in header file : void va_copy(va_list dest, va_list src); in cpp file : void va_copy(va_list dest,va_list src) { dest = src; } but didn't resolve problem, still same linking error. thanks in advance answers. you basic problem library compiled link standard libraries in dll (thus __imp__); application set differently (to grab standard calls statically linked in library). you either have match compiler settings (in case project properties -> c/c++ -> code generation section) can specify use dll or static options. it's worth checking if there way specify include files version of link need - l...

c# - Empty Semicolon and Open Closed Curly Brace is Working -

i have console application project support assigned me, decide conduct code review in class, , while i'm doing code review run line contain semicolon , other line empty open-close curly brace, expectation compiler throw error, tried run console application working fine , no sign of error, thought compiler have problem decide reinstall it, console app still working fine, decide create new method test semicolon , curly brace try make nested curly brace , console.writeline() inside of , surprisingly working. can explain why happening or it's me , compiler? static void testmethod() { ; { } ; { } { ; } { }; { { { { { { { console.writeline("hello, world!"); console.read(); } } } } ...

Java: Generics in interface and factory -

i have base class plant there 2 subtype paths. fruit extends plant , vegetable extends plant. fruit , vegetable abstract classes , further have other classes banana extends fruit , spinach extends vegetable . now lets example, operation has operation via these classes , there interface operation. current design follows: i have interface: abstract class plant {} abstract class fruit extends plant {} class banana extends fruit {} public interface plantweigher<t extends plant> { public int weight(t fruit); } then have: public abstract class fruitweigher<y extends fruit> implements plantweigher<y> { } then further have concrete class: public class bananaweigher extends fruitweigher<banana> { public int weight(banana fruit); } now, user understands plant, correct instance of weigher , perform operation. so factory follows: public class weigherfactory { public static plantweigher<? extends plant> getinsta...

javascript - How do I find the absolute position of all hyperlink elements using jQuery? -

i absolute position of html hyperlink elements. write jquery find absolute position of each link element following: jquery('a').each(function() { var ellink = jquery(this); console.log(this.text + ' => ' + this.href + ' ' + json.stringify(ellink.offset()) + ' top:' + ellink.css('top') + ' left:' + ellink.css('left')) }); however, doesn't work. example, on page of http://www.actuino.fr , there link called "le crawler" give me top = 0 , left = 0, while "contact" link give me correct position. no links hidden. so how absolute position of these links? thank you! i don't think there should issues regarding getting .offset() of element whether absolute,relative, fixed or static positioned. but 1 thing noticed: in below example have 3 anchors , 1 of them hidden although absolutely positioned top,left has been assigned 0 browser. jquery('a').each(function() ...

wcf - getting "Could not establish trust relationship for the SSL/TLS secure channel with authority" when running fiddler -

i have wcf client application sends https request third-party webservice. everythings works well. receive correct answer. i have installed fiddler , trusted rootcertificate capture , encode https traffic. requests recieve error "could not establish trust relationship ssl/tls secure..." i have searched lot on error on web. each time solution need trust fiddler root certificate. since have done het start, looks not solution problem. here snippet out of code sends request: asymmetricsecuritybindingelement securitybindingelement = new asymmetricsecuritybindingelement(); securitybindingelement.initiatortokenparameters = new x509securitytokenparameters { inclusionmode = securitytokeninclusionmode.never }; securitybindingelement.recipienttokenparameters = new x509securitytokenparameters(); securitybindingelement.enableunsecuredresponse = true; securitybindingelement.endpointsupportingtokenparameters.signed.add(new x509securitytokenparameters()); custombinding binding = ...

javascript - how to translate Browse or Choose File for form input type=file based on browser language change -

html form input type = file providing " browse " , " no file selected " in firefox , " choose file " , " no file chosen " in chrome choose file. i have use case translate " browse " , " choose file " per browser language. is possible without adding javascript library? thanks in advance native input elements depending on operating system , browser clients using. can workaround custom file picker (an input file hidden, layer triggers hidden input file, text like). you can use refferences: how style "input file" css3 / javascript? http://markusslima.github.io/jquery-filestyle/ http://moro.es/projects/jquery-nicefileinput-js/ good luck!

Neo4j replication by filter -

i have big database of geolocation , want create 100 replication of databases based on countries i.e. world master database , every slave having data of 1 country. possible in neo4j documents out there explain concept of ha how can slice database while creating slaves isn't mentioned anywhere. and doing affect db performance? if understand correctly, want database sharding. not supported in neo4j, because it's "hard" problem in graphs find weak spots. here great post - https://stackoverflow.com/a/21566766/69684 still can that, information data each country, need store in application. could please share current model , tell more want achieve?

Android : Fetching image from MediaStore.Images.Media.DATA -

sorry if it's stupid question. confused. in android app, trying path image chosen user gallery. earlier, using mediastore.images.imagecolumns.data chosen image's path this: cursor = getcontentresolver().query(contenturi, projection, null, null, null); if (cursor == null) { // source dropbox or other similar local filepath log.d(logtag, "getrealpathfromuri : cursor null"); return contenturi.getpath(); } else { cursor.movetofirst(); int idx = cursor .getcolumnindex(mediastore.images.imagecolumns.data); string path = cursor.getstring(idx); cursor.close(); return path; } but caused issues in devices, i.e cursor returned there no such column. so, after referring stackoverflow answers, changed mediastore.images.imagecolumns.data mediastore.images.media.data. now, seems work. what's difference between mediastore.images.imagecolumns.data , mediastore.images.media.d...

javascript - Text not marking up -

i writing page allows tournament director (td) add players event. when td goes search player want search results appear on keyup below search input (without needing refresh page). @ stage have 2 php pages , 1 js page , have live search happening, output not getting marked up. have written piece of code convert php $_session[''] array javascript array, brain frying , i'm not sure go here. i want processed version of code output (presuming sql returns 1 player named john smith) <tr></td> 123 </td><td> john smith </td></tr> my main php page has: <table border='1px'> <tr><th colspan='6'> <?php echo ($ename . " - " . $vn); ?></th></tr> <tr><th>player id</th> <th>player name</th> <th>place</th> <th>points</th> <th>cash</th> <th>ticket?</th></tr> <tr><td colspan='3'>sea...

scala - How to make a query in Slick 3 to select from DB with count from children tables -

how can make query in slick 3.0 ? select *,(select count(*) flashcards setid = flashcards_sets.id ) allcount,(select count(*) flashcards studied = true , setid = flashcards_sets.id ) studiedcount flashcards_sets; private def filterbyflashcardquery(id: int): query[flashcards, flashcard, seq] = flashcards.filter(_.setid === id && _.studied = true) def findbyflashcardlength(flashcardid: int):future[int] = { try db.run(filterbyflashcardquery(flashcardid).length.result) println("db.close")//db.close } ```