Posts

Showing posts from 2010

Facebook SDK for Javascript, FB.login() callback not firing (async call never gets a response?) -

Facebook SDK for Javascript, FB.login() callback not firing (async call never gets a response?) - the below code facebook api javascript far. it's pretty simple, bunch of console.log() s follow code flow. (i recognize naming arguments response , response2 terrible practice it's set avoid naming conflicts). as stands, fb.init() succeeds, fb.getloginstatus() works, , 2 fb.api() calls work, fb.login() never happens. async though console.log() s before , after execute. summarize, console output is: makes here makes here too permissions: object {data: array[37]} see you, my-name-is-here. i guess it's because async fb.login() phone call never gets response callback never fires, no console.log() s within function. need fb.login() in order extended permission ads_management . thought wrong, or @ to the lowest degree direction go solving myself? window.fbasyncinit = function() { fb.init({ appid: 'my-app-id-is-here', xfbml: tr

r - Extract string elements that possibly appear multiple times, or not at all -

r - Extract string elements that possibly appear multiple times, or not at all - start character vector of urls. goal end name of company, meaning column "test" , "example" , "sample" in illustration below. urls <- c("http://grand.test.com/", "https://example.com/", "http://.big.time.sample.com/") remove ".com" , whatever might follow , maintain first part: urls <- sapply(strsplit(urls, split="(?<=.)(?=\\.com)", perl=t), "[", 1) urls # [1] "http://grand.test" "https://example" "http://.big.time.sample" my next step remove http:// , https:// portions chained gsub() call: urls <- gsub("^http://", "", gsub("^https://", "", urls)) urls # [1] "grand.test" "example" ".big.time.sample" but here need help. how handle multiple

vb.net - How to return list from webservice -

vb.net - How to return list from webservice - within webservce myservice. documentlist class containing properties id, name -- class serializable public function getdoclist(args...) list(of documentlist) 'code add together documentlist 'no issue here... end function within project. dim thisservice new myservice sub main dim doclist new list(of documentlist) doclist = thisservice.getdoclist(args...) end sub i error - cannot convert -1 dimensional array generic list of documentlist. if consume documentlist within service, no issues. can iterate each. but, within project, calls service, cannot consume documentlist. have set service pass string, , possible. list(of documentlist) issue.i think may need reflection, or proper understanding of collections. not sure. give thanks you. dim doclist documentlist() cannot homecoming complex type, had set documentlist array in project calling webservice. http://www.asquestion.com/question/60333227137608045/pro

jquery - Colorbox-rails gem brings up blank lightbox -

jquery - Colorbox-rails gem brings up blank lightbox - i've installed colorbox-rails gem , followed installation instructions. i'm applying ecommerce product page , want show product images in lightbox. however, when click on image, lightbox opens it's blank. here gem page: https://github.com/stevo/colorbox-rails here illustration ruby syntax on gem page: <%= link_to "my superb link", "#", :data => { :colorbox => true } %> i linking image here code. doesnt work - brings blank lightbox. <%= image_tag @listing.image.url, :data => { :colorbox => true } %> i tried below gives me error. <%= link_to image_tag @listing.image.url, "#", :data => { :colorbox => true } %> the url phone call works on it's own below it's rest of code. <%= image_tag @listing.image.url %> i'd add together multiple images users can click on 1 , click arrows view slideshow. how that?

c++ - Iterating through parameters of a variadic function template using variadic lambda -

c++ - Iterating through parameters of a variadic function template using variadic lambda - suppose have next function template: template <typename functor, typename... arguments> void iteratethrough(functor functor, arguments&&... arguments) { // apply functor arguments } this function implemented follows: template <typename functor, typename... arguments> void iteratethrough1(functor functor, arguments&&... arguments) { int iterate[]{0, (functor(std::forward<arguments>(arguments)), void(), 0)...}; static_cast<void>(iterate); } another way: struct iterate { template <typename... arguments> iterate(arguments&&... arguments) { } }; template <typename functor, typename... arguments> void iteratethrough2(functor functor, arguments&&... arguments) { iterate{(functor(std::forward<arguments>(arguments)), void(), 0)...}; } i have found yet approach uses variadic la

debugging - Tcl/Tk - can't read "UserArray": variable is array -

debugging - Tcl/Tk - can't read "UserArray": variable is array - i using activestate's tcldevkit debugger through code @ 1 point in execution of programme next error: can't read "userarray": variable array while executing "set userarray" ("uplevel" body line 1) invoked within "dbgnub_uplevelcmd dbgnub_uplevelcmd $args" invoked within "uplevel 1 [list set $name]" (procedure "dbgnub_tracevar" line 53) invoked within "dbgnub_tracevar 1 array userarray time1_satotrs1,2 w" (write trace on "userarray(time1_satotrs1,2)") invoked within "set userarray($item,$window) $profile_array($item)" this error utterly baffles me because understand tcl/tk, doing valid , legal. code goes: foreach item [array names profile_array] { set userarray($item,$window) $profile_array($item) } in tcl 1 allowed read , write index in array, don't thin

encoding - Check if unicode value is in Erlang binary string? -

encoding - Check if unicode value is in Erlang binary string? - i came across questions on how find value in list , aware of lists:member/2 . erlang lists:index_of function? how search item in list in erlang? is there lists:member/2 binary strings? need check if value nowadays in binary. imagine this: value_in_binary(<<"some random data">>, <<"d">>). %> true does exist? if not, how go implementing function this? check out binary:match/2,3. example 1> binary:match(<<"some random data">>, <<"d">>). {8,1} 2> binary:match(<<"some random data">>, <<"z">>). nomatch string encoding binary erlang default

Operator precedence overloading in Swift -

Operator precedence overloading in Swift - is there way override operator precedence when overloading operators custom classes? in example, + should have higher priority * . can override default operator precedences? class vector{ var x:int var y:int init(x _x:int, y _y:int){ self.x = _x self.y = _y } } func *(lhs:vector, rhs:vector)->int{ homecoming lhs.x * rhs.y + rhs.x + rhs.y } func +(lhs:vector, rhs:vector)->vector{ homecoming vector(x: lhs.x + rhs.x, y: lhs.y + rhs.y) } var v1 = vector(x: 6, y: 1) var v2 = vector(x: 3, y: 1) v1 * v2 + v1 hmm. appears can. operator infix + { associativity left precedence 140 } operator infix * { associativity left precedence 30 } allow x = 3 + 4 * 5 // outputs 35 but far can tell, can done @ "file scope", @ to the lowest degree according compiler error produced including within class. 'operator' may declared @ file scope. swift

javascript - Hide Ipad's keyboard, but still be able to enter into input field via custom keyboard -

javascript - Hide Ipad's keyboard, but still be able to enter into input field via custom keyboard - i have input field user enters numbers using "keyboard" made css/html on page. so, not need ipad's keyboard pop up. of answers found around suggests defocus input field, blur()-ing it. still need come in input field, find caret position, replace,etc, still need focus() in input field. there way create ipad's keyboard hidden, , focus still on input field? please consult link https://developer.apple.com/library/ios/documentation/uikit/reference/uitextfield_class/reference/uitextfield.html#//apple_ref/occ/instp/uitextfield/inputview , review input view property of uitextfield gives chance replace default keyboard own without dirty hacks simultaneously allowinf utilize entire default textfield functionality! however might require stick 1 or more protocols custom kb has implement! javascript jquery html ios css

cocoa - How to handle text selection in NSTextField -

cocoa - How to handle text selection in NSTextField - probably documented somewhere can't find how handle event of text selection in nstextfield, wan't respond event of user highlighting text, wan't selected text , it. have @ <nstextfielddelegate> , -textview:willchangeselectionfromcharacterrange:tocharacterrange: . cocoa selection nstextfield

mysql - How to show Json data to the dialog box in html -

mysql - How to show Json data to the dialog box in html - i beginner in ajax, dom, jsonm etc in web application. project utilize jquery ui parse json info , show of info database , retrive 1 info id, it's part of create, retrieve, update, , delete. retrieving key function here. can info , populate datatable info no problem. "aocolumns" :[ {"mdata" : "image"}, {"mdata" : "name"}, {"mdata" : "type"}, {"mdata" : "description"}, {"mdata" : "price"}, {"mdata" : "id", "mrender" : function(data, type,full) {return '<a href="#" id="'+ full.id +

How to configure system to use the FIWARE yum repository? -

How to configure system to use the FIWARE yum repository? - i know fi-ware offers public yum repository @ http://repositories.testbed.fiware.org/ can used install fi-ware packages such orion contexto broker. however, how can configure scheme utilize repository? e.g. .conf file need add together in /etc/yum.repos.d/ directory create work. thanks! you need add together file testbed-fi-ware.repo in /etc/yum.repos.d/ next lines: [fiware] name=fiware repository baseurl=http://repositories.lab.fiware.org/repo/rpm/x86_64/ gpgcheck=0 enabled=1 i hope helps you. edit: originally, name repositories.testbed.fiware.org changed repositories.lab.fiware.org on feburary 2016. yum fiware filab

c# - Longlist is not creating properly -

c# - Longlist is not creating properly - i want populate longlist via wcf service. compilation goes without errors, result of executed programme looks 3 lines of this: phoneapp1.servicereference1.worker instead of name , other info want display. service implementation is: public ienumerable<worker> getstufflist() { list<worker> stufflist = new list<worker>(); stufflist.add(new worker("john", 23, true)); stufflist.add(new worker("nick", 22, true)); stufflist.add(new worker("gill", 23, false)); homecoming stufflist; } private list<group<worker>> getstuffenumerable() { ienumerable<worker> stufflist = getstufflist(); homecoming getitemgroups(stufflist, c => c.age.tostring()); } private static list<group<t>> getitemgroups<t>(ienumerable<t> itemlist, func<t, string> getkeyfunc) { ienumer

android - Cannot Send data Through pendingIntent -

android - Cannot Send data Through pendingIntent - i trying set notification using pendingintent.but cant recieve info sent. these codes class displaying notification(working can every info intent) protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //---get notification id notification; // passed in mainactivity--- int notifid = getintent().getextras().getint("id"); string date = getintent().getextras().getstring("date"); string time = getintent().getextras().getstring("time"); string text = getintent().getextras().getstring("text"); //---pendingintent launch activity if user selects // notification--- notificationmanager nm = (notificationmanager) getsystemservice(notification_service); notification notif = new notification( r.drawable.ic_launcher, text +" "+date+" @ "+time, system.cur

How to play Video in Webview via a in Android? -

How to play Video in Webview via a <iframe> in Android? - i need play youtube video in webview, link video nowadays in tag. when run application, pic(thumbnail) comes in place play icon on it, , after clicking on it, shows black screen seekbar on @ 00:00 time, , loading symbol on it, nil happens or shown. remains there day. i using emulator 4.4 android. my code follows:- webview content = (webview)findviewbyid(r.id.webview1); string html="<html><body>some text goes here<br>" + "<iframe src=\"//www.youtube.com/embed/eu9kmies0wq?rel=0\" height=\"360\" width=\"640\" allowfullscreen=\"\" frameborder=\"0\"/></iframe></body></html>"; content.getsettings().setpluginstate(pluginstate.on_demand); content.getsettings().setjavascriptenabled(true); content.getsettings().setallowfileaccess(true); content.setwebchromeclient(new webchromeclie

How to post location with image to facebook in IOS? -

How to post location with image to facebook in IOS? - i trying share location along image facebook. have shared image unable share location. below code of sharing image. uiimage *facebookimage = [uiimage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:[nsstring stringwithformat:@"%@%@",imagesurl,str]]]]; nsmutabledictionary* params = [[nsmutabledictionary alloc] init]; [params setobject:@"new happening created on happenshare mobile app." forkey:@"message"]; [params setobject:facebookimage forkey:@"picture"]; [fbrequestconnection startwithgraphpath:@"me/photos" parameters:params httpmethod:@"post" completionhandler:^(fbrequestconnection *connection,id result,nserror *error) { if (error) { nslog(@"error : %@",error); } else { nslog(@"result : %@",result); } }]; now sharing location parameter should add together in above code. attaching image

MongoDB - Archiving GridFS files (via TTL) -

MongoDB - Archiving GridFS files (via TTL) - i know can set ttl index on files collection using: db.files.ensureindex({"uploaddate" : 1},{expireafterseconds : xxx}) the problem is, doesn't handle db.chunks collection. can create background job go on db.chunks , orphans misses point, since if must have background job, allow him work , faster (i can mass deletion chunks more easily). so, there smarter way of archiving\deleting files gridfs after predefined period of time? thanks mongodb

path aliases - Drupal 7 make url alias accept additional args -

path aliases - Drupal 7 make url alias accept additional args - i have node path 'node/78' , has alias 'the-island/news'. in 'node/78' path can add together additional args 'node/78/second/third', if add together in alias 'the-island/news/second/third' doesn't work. how create such aliases? have tried using pathauto module? https://www.drupal.org/project/pathauto drupal-7 path-aliases

javascript - ng-grid and custom directives with images -

javascript - ng-grid and custom directives with images - we having pretty major issues ng-grid , directives. basically have ng-grid, , have directive supplies image. what have done:- created simple directive displays image issue :- on scrolling image tended jump , downwards onto different rows after much googling, discovered should utilize $watch statement, our directive looks :- . mylists.directive('status', function () { homecoming { restrict: 'e', replace: true, template: '<div ng-switch="alert">' + '<div ng-switch-when=""></div>' + '<div ng-switch-default><img src="{{alert}}.ictrl" /></div>' + '</div>', scope: { alertdata: '=alertdata' }, link: function (scope, element, attrs) { function updateica

tfs - How can I put my Borland C++ Builder 6 project into Visual Studio Online -

tfs - How can I put my Borland C++ Builder 6 project into Visual Studio Online - we putting our existing embarcadero borland c++ builder 6 projects new free microsoft source command called "visual studio online" (aka online version of tfs or team foundation server formerly called team foundation service). http://www.visualstudio.com/products/what-is-visual-studio-online-vs how can set code bcb 6 project utilize system. of course of study i'd prefer have ide integration, long have kind of gui i'm fine doing source code tasks outside of bcb ide. are there bcb files binary , hence might issue comparing changes? any ideas appreciated. c++builder not have native tfs back upwards (not in latest version), allow lone vsonline support. @ to the lowest degree tfs, there third-party plugins allow c++builder access tfs: sourceconnexion tfs.us for tfs, can utilize standard tfs client gui. vsonline, knows. several files binary, including

jquery - How to keep a value unchanged? -

jquery - How to keep a value unchanged? - this basic question, but... <div id="caption">323</div> var = $("#caption").html(); now, content of #caption changed... and need starting value (323) alert (a); but result new value. how can maintain starting value unchanged ? var old=$('#caption').html(); $('#sub').on('click',function(){ $('#caption').html('525'); alert(old); }); demo jquery

python - How to create a new session in Django? -

python - How to create a new session in Django? - is possible create new session in django? instance have url going opened in new tab , new session created whenever visits url? i'm assuming delete previous session cookie? in case: to clear session info cookie: request.session.flush() to clear session info maintain same cookie utilize dict.clear(): request.session.clear() for details: https://docs.djangoproject.com/en/dev/topics/http/sessions/ python django

interface builder - iOS Custom Segue Not Working -

interface builder - iOS Custom Segue Not Working - i starting larn how develop ios apps. (note using xcode 6 beta , swift) think i'm building interfaces themselves, seem having problem segues. the first page of app simple screen sign button , sign in button. made separate view controller sign page , set text field on it. both of these view controllers in storyboard. made custom segue class animate start page , sign page moving 1 screen left, sign page showing. custom segue class: class slidefromrightsegue: uistoryboardsegue { override func perform() { allow screenwidth = uiscreen.mainscreen().bounds.width allow center = self.sourceviewcontroller.view!.center uiview.animatewithduration(0.25, animations: { self.sourceviewcontroller.view!.center = cgpoint(x: center.x - screenwidth, y: center.y) self.destinationviewcontroller.view!.center = cgpoint(x: center.x - screenwidth, y: center.y)

javascript - How to include jquery Countdown timer plug-in in Blogger template -

javascript - How to include jquery Countdown timer plug-in in Blogger template - i using blogger , 'simple' template create blog. want set in countdown timer. through research, i've found best way (that allows customisation) using jquery plugin keith wood (http://keith-wood.name/countdown.html). i'm not sure how include in html code...i've tried many things , can't show @ all. here extract code located before < / head >: <script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'/> <link href='https://www.dropbox.com/s/apli554dvptb01r/jquery.countdown.css' rel='stylesheet'/> <style type='text/css'> body &gt; iframe { display: none; } #defaultcountdown { width: 240px; height: 45px; } </style> <script src='https://www.dropbox.com/s/kt99b0ly3cx8u7l/jquery.plugin.js'/> <script src='https://www.dropbox.com/s/mr7tsda8236nerh/jquery.countdown.js'/>

ios - Game Center leaderboard shows one result -

ios - Game Center leaderboard shows one result - i've sent scores leaderboard different test accounts when seek see leaderboard can see score business relationship i'm logged in. used code send scores : - (void)reportscore:(int64_t)score forleaderboardid:(nsstring*)identifier { gkscore *scorereporter = [[gkscore alloc] initwithleaderboardidentifier: @"ghs"]; scorereporter.value = score; scorereporter.context = 0; [gkscore reportscores:@[scorereporter] withcompletionhandler:^(nserror *error) { if (error == nil) { nslog(@"score reported successfully!"); } else { nslog(@"unable study score!"); } }]; } this code i'm using show leaderboard: - (void)showleaderboardonviewcontroller:(uiviewcontroller*)viewcontroller { gkgamecenterviewcontroller *gamecentercontroller = [[gkgamecenterviewcontroller alloc] init]; if (gamecentercontroller != nil) { gam

angularjs - Angular Project Arcitectural Design -

angularjs - Angular Project Arcitectural Design - i'm new angular , mvc. "learn angular" project client home automation system. system's server supports plug-ins (written in python--something else larn :-)) i have built client responsive design (bootstrap) , can list of devices , values using restapi (i'm using $http), i'm reasonably comfortably angular basics now now want add together functionality update clients on device statues change. (i don't want utilize polling) plug-in architecture lets me create plug-in registers changes in device states. so here's scenario: i have 5 touch screen (mix of android , ios) around house. running client let's assume have lighting page shown, has status of lights (on/off/dim level). someone changes living room lite 70% 30%. done 1 of clients, native app on server or lite switch itself. the device status on server alter , generate notification plug-in receive i need update state of living roo

A straightforward Perforce migration to git on Windows -

A straightforward Perforce migration to git on Windows - i have local p4 server on computer manage code versioning. move development bitbucket - i've opened business relationship there. the first logical kickoff, see it, migrating p4 environment git (while keeping history of course) - seems headache unpracticed git user. i've tried git-p4 git bash, git windows apparently compiled w/o python. got git-p4.py. tried (in cmd): git-p4.py clone //depot/foo/bar/@all //opt/dest/. got "libiconv-2.dll missing" error. i've stopped because think i'm doing exclusively wrong. please help me understand how right... thanks. @mark, sorry hear ran error. one way utilize git-fusion. if follow steps in quickstart guide: http://answers.perforce.com/articles/kb_article/git-fusion-quick-start there section on 'creating git fusion repo' guide in creating git repo perforce server. maintain in mind, cannot skip steps , must install , configuration

process - What are all hidden iTunes & iCloud processes and services? -

process - What are all hidden iTunes & iCloud processes and services? - i have found next itunes & icloud processes , services. there anymore need know connecting net or running ? icloud , sub-processes process: icloud id: 6288 - c:\program files (x86)\common files\apple\internet services\icloud.exe process: applephotostreams id: 10600 c:\program files (x86)\common files\apple\internet services\applephotostreams.exe process: apsdaemon id: 9192- apple force - c:\program files (x86)\common files\apple\internet services\apsdaemon.exe process: icloudservices id: 5976 c:\program files (x86)\common files\apple\internet services\icloudservices.exe process: appleoutlookdavconfig id: 7912 - apple outlook dav config - c:\program files (x86)\common files\apple\internet services\appleoutlookdavconfig.exe itunes programme , sub-processes process: itunes id: 9440 - c:\program files (x86)\itunes\itunes.exe process: applemobiledevicehelper id: 3972 - c:\program fi

ruby - Regex to match look before this or that -

ruby - Regex to match look before this or that - i'm attempting match within of url. www.facebook.com http://www.facebook.com http://facebook.com should homecoming facebook my current regex (?<=www\.|http:\/\/).*(?=\.[a-za-z]{2,4}) this matches correctly except 1 http://www. , match www.facebook how create regex before match lastly occurrence of either www or http:// rubular link in ruby, can utilize this: (?i)^(?:http://)?(?:\w+\.)?\k\w+(?=\.[a-z]{2,4}$) see demo. ^ asserts @ origin of string (?i) puts in case-insensitive mode (?:http://)? optionally matches http:// part (?:\w+\.)? optionally matches subdomain \k keeps out have matched match returned \w+ matches facebook the (?=\.[a-z]{2,4}$) lookahead checks followed domain end of string. ruby regex

Posting html code with php fails at style attribute and spaces -

Posting html code with php fails at style attribute and spaces - i'm using ace editor website has been developed codeigniter framework. problem after submitting form, tags attributes stripped. html: <form enctype="multipart/form-data" method="post" action="<?php echo site_url( 'admin/slider/populatefile')?>"> <div id="e1" style="display: none;"> <?php if(isset($sliderhtml)) { echo $sliderhtml; } ?> </div> <textarea class=" form-control" id="editortextarea" name="sliderhtml" type="text" rows='20' wrap="off"> <?php if(isset($sliderhtml)) { echo $sliderhtml; } ?> </textarea> <pre id="editor"></pre> </form> php: function populatefile() { $sliderhtml = $this->input->post('sliderhtml'); //echo $sli

Freebase get all Movies by Actor -

Freebase get all Movies by Actor - i trying que freebase actors movies, managed films topic query, if seek search movies id found there , "null" response can plz help me here, how can actors movies metadata parsing title, artwork etc? currently stuck @ here: var que = '[{ "type": "/film/film", "name": null, "mid": "/m/02byfd" }]'; var json = json.stringify(eval("(" + que + ")")); var url2 = 'https://www.googleapis.com/freebase/v1/mqlread?query=' + json; $.getjson(url2,function(data){ console.log(data); }) the id id topic response @ film/actor thx help it's hard tell you're after question, if want freddie prinz, jr.'s films, can this: [{ "id": "/m/02byfd", "name": null, "/film/actor/film": [{ "film": null, "id": null, "character": null }] }]

enums - Polymorphism in Rust -

enums - Polymorphism in Rust - i'm writing board game ai in rust. there multiple rulesets game , i'd have rules logic separated board layout (they mixed). in language ruby i'd have separate rule sets implement same interface. in rust thought using trait , parameterizing board ruleset want utilize (e.g. board<rules1>::new() ). saving object implements trait in struct (like board ) not allowed. of course of study turn rules enum , looks bit messy me then, because can't define separate implementations members of enum. using pattern matching work, splits functionality along function axis , not along struct axis. have live or there way? the next code i'd use: pub struct rules1; pub struct rules2; trait rules { fn move_allowed() -> bool; } impl rules rules1 { fn move_allowed() -> bool { true } } impl rules rules2 { fn move_allowed() -> bool { false } } struct board<r: rules> { rules: r } fn m

ruby on rails - Submit doesn't do anything -

ruby on rails - Submit doesn't do anything - i'm using rails 4, bootstrap 3 , simple_form , reason "submit" button doesn't submit anything. it's not generating in server output me debug with. here code: <%= simple_form_for(@schedule) |f| %> <% if @schedule.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@schedule.errors.count, "error") %> prohibited schedule beingness saved:</h2> <ul> <% @schedule.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <form class="form-inline" role="form"> <div class="form-group"> <%= f.input :rating, collection: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] %> </br> <%

image - UIImageJPEGRepresentation creates a white bottom bar -

image - UIImageJPEGRepresentation creates a white bottom bar - i using uiimagejpegrepresentation after capture image avcapturesession , avcapturestillimageoutput . reason when compress images uiimagejpegrepresentation image has lean white line @ bottom of picture. know how prepare this? the problem resizing image, in doing proportions didn't line there empty pixel row on bottom defaults white because file jpeg. see link below a lean whiteline been added when resize image image jpeg avcapturesession uiimagejpegrepresentation

javascript - Toggling character in div on click -

javascript - Toggling character in div on click - i expect next code toggle html content of .articlearrow between , downwards arrows when .articletitle clicked: jquery $(".articletitle").click(function () { if ($(this).children('.articlearrow').html() == '&#8593;') $(this).children('.articlearrow').html('&#8595;'); else if ($(this).children('.articlearrow').html() == '&#8595;') $(this).children('.articlearrow').html('&#8593;'); }); html <div class='articletitle'> blah <div class='articlearrow'> &#8595; </div> </div> but doesn't anything. on other hand if take if...else if out , set character $(this).children('.articlearrow').html('&#8593;'); works. setting character works it's if...else if that's not getting triggered , can't figure out why. you ca

encryption - PHP Decrypting AES returns padding at front of string? -

encryption - PHP Decrypting AES returns padding at front of string? - i've been wrestling decrypting given string, generated remote coldfusion server, in php using aes in cbc mode pkcs5 padding. i've gotten point can decrypt string almost perfectly, issue there appears cruft @ origin of string. thought padding happened @ end, looking @ decrypted string, there's nil @ end, origin padded out string 64 characters long (the original string 32 characters long.) attempted switch padding removal code @ origin instead of end, characters don't provide info can utilize decipher how much padding remove, think coming somewhere else. here's code far function decrypt($hash) { $enc_key = "oq2vh+gswpn2crpccodtkg=="; $cipher = "rijndael-128"; $str = mcrypt_decrypt($cipher, base64_decode($enc_key), base64_decode($hash), mcrypt_mode_cbc); $block = mcrypt_get_block_size(mcrypt_rijndael_128, mcrypt_mode_cbc); $pad = ord($str[($len = strlen($s

javascript - stop animation in angularjs when filtering ng-repeat -

javascript - stop animation in angularjs when filtering ng-repeat - i have angular web application when loads list of "notes" scope array called notes . this list filtered within ng-repeat so: <div class="noteclass" ng-repeat="n in notes | propertyfilter: 'fields.notetabnumber' : selectedtab"> this works fine, , have added css animations css file when new item added notes array, animates scene. div.noteclass.ng-enter, div.noteclass.ng-leave, div.noteclass.ng-move { //my animations here } div.noteclass.ng-enter, div.noteclass.ng-move { //my farther animation functions } div.noteclass.ng-enter.ng-enter-active, div.noteclass.ng-move.ng-move-active { /// finished animations } my issue filter, can see, list filtered custom filter called propertyfitler filters notes based on 'tab' user has selected. which simple ul : <ul> <li ng-class="{selected: selectedtab==1}">...</l

android - Can't find my device with adb -

android - Can't find my device with adb - i'm running adb on ubuntu, , app (that i'd test) on galaxy s3. got s3 in debugging mode, i've edited /lib/udev/rules.d/51.android , .android files, restarted adb, , laptop, no luck. ideas might doing wrong? try on command prompt: sudo -s adb kill-server adb start-server some more things can seek find helpful. check info card, might have problem. plug info card port on system. android debugging adb samsung-mobile

php - Multiple return types of in a method? -

php - Multiple return types of in a method? - i have rule class has check($input) method returns boolean true if input valid or returns string error message when invalid. , because in php can't specify homecoming type when declaring functions (like in java example), can homecoming whatever. is best practice have method or variable return/contain 1 value type? e.g. boolean , string , or integer . usually when i'm implementing interface, 1 homecoming type expected each of methods. that allright of php functions have multiple homecoming type. illustration strpos() function it homecoming number if worked correctly , homecoming boolean false if not work expected however , gordonm said , multiple homecoming type may confuse when seek check wheater worked correctly or not. in general , multiple homecoming allright php functions. php return return-value return-type

Get path folder in URL with PHP -

Get path folder in URL with PHP - i utilize php code find url path of script page : define("url", dirname($_server['request_uri'])); on pc 1, result url : htt://site1/abc/ : /abc but on pc 2, result same url : \ don't understand why. if add together 'index.php', that's ok on pc 2 my goal create wizard installation , set url path in config file. you may unexpected results dirname() , see illustration in manual: echo "2) " . dirname("/etc/") . php_eol; // 2) / (or \ on windows) use parse_url() instead: $path = parse_url($_server['request_uri'], php_url_path); $path = '/'.implode('/', explode('/', ltrim($path, '/'), -1)); define("url", $path); php url

android - Make EditText work on an activity start -

android - Make EditText work on an activity start - i'm trying in app billing remove ads. i have bit of code : iabhelper.queryinventoryfinishedlistener mgotinventorylistener = new iabhelper.queryinventoryfinishedlistener() { public void onqueryinventoryfinished(iabresult result, inventory inventory) { // have been disposed of in meantime? if so, quit. if (mabhelper == null) return; // failure? if (result.isfailure()) { return; } // have premium upgrade? purchase premiumpurchase = inventory.getpurchase(sku_premium); mispremium = premiumpurchase != null; updateinterface(); } }; /** * updates interface */ private void updateinterface() { button savebutton = (button) findviewbyid(r.id.btupgrade); button btupgrade = (button) findviewbyid(r.id.btupgrade); if (mispremium) { final edittext edittext = (edittext) findviewbyid(r.id.edittex

entity framework - EF - Access derived types from context -

entity framework - EF - Access derived types from context - here's illustration of issue. here ef classes... public class basetype{ } public class derived : basetype{ } is there way straight access derived entities database context in next manner? context.derived.where(c=> c. whatever...); as stands when using context can see context.basetype entity-framework entity-framework-6

android - onPageScrolled method returns null after changing to lastest Support-v4 library -

android - onPageScrolled method returns null after changing to lastest Support-v4 library - i have unusual problem here, have dialog fragment , method within : @override public void onpagescrolled(int position, float positionoffset, int positionoffsetpixels) { currentposition = position; currentpositionoffset = positionoffset; scrolltochild(position, (int) (positionoffset * tabscontainer.getchildat(position).getwidth())); invalidate(); if (delegatepagelistener != null) { delegatepagelistener.onpagescrolled(position, positionoffset, positionoffsetpixels); } } when utilize older version of support-v4.jar works fine, when utilize latest version of it, method: scrolltochild(position, (int) (positionoffset * tabscontainer.getchildat(position).getwidth())); returns error: 06-19 11:56:23.764: e/androidruntime(1024): java.lang.nullpointerexception 06-19 11:56:23.764: e/androidruntime(1024)

Stripping auto-generated quotation marks using json.dumps( ) (Python) -

Stripping auto-generated quotation marks using json.dumps( ) (Python) - i'm using json.dumps() method via passing in ordereddict. (see below syntax). it's doing correctly, there 1 specific field "labels": consistently surrounds input " " (quotation marks) , need not to. desiredjson = ordereddict([('type', ""), ('labels', '' ), ('bgcolor', ''), ('bordercolor', '')]) (category_type, updatedlabels, bgcolors, bordercolors) in zip(type_, labels_, bgcolor_, bordercolor_): print category_type+updatedlabels desiredjson["type"] = category_type desiredjson["labels"] = '["%s", "%s"]' % (category_type, updatedlabels) desiredjson["bgcolor"] = bgcolors desiredjson["bordercolor"] = bordercolors json.dumps(desiredjson, sort_keys = false, indent = 4, separators=(',' , ': ')) here's loo

java - How to use refresher addon in vaadin? -

java - How to use refresher addon in vaadin? - i'm trying utilize refresher addon in vaadin. refresh method never executed. missing? @vaadinui @preserveonrefresh public class rootui extends ui { @override protected void init(vaadinrequest request) { refresher.setrefreshinterval(500); refresher.addlistener(new chatrefreshlistener()); addextension(refresher); } public static final refresher refresher = new refresher(); public class chatrefreshlistener implements refreshlistener { @override public void refresh(final refresher source) { system.out.println("test"); //this never executed } } } @configuration @componentscan @enableautoconfiguration public class myapp extends springbootservletinitializer { public static void main(string[] args) { springapplication.run(myapp.class, args); } @override protected springapplicationbuilder configure(springapplicationbuilder

mysql - Generating Update Query -

mysql - Generating Update Query - i have 2 identical mysql database running on different machine. problem have update few column values of table 1 db other. can generate update query particular column in phpmyadmin or whats other way generate update query can run same query on other machine , have values in sync. for example: machine1 employee table has salary column. want update query salary column based on primary key of employee table. e.g. update employee set salary = 5000 id = 1; update employee set salary = 5200 id = 2; ... ...................................where id = 1000; i not sure if understood question. if need alter in different database need connect other databse first. so: connect db1 update in db1 connect db2 update in db2 additionally can utilize transaction avoid problems 1 db updated , other 1 fail. if can't save db1 , db2 in same time, can sync 2 db: mysql database sync between 2 databases mysql sql phpmyadmin

Not able to display graph using achartengine. -

Not able to display graph using achartengine. - i retrieving info database , storing in 2 arrays. 1 array consists of temperature values , other has date . using timechart of achartengine still not able display graph. works when utilize random values x axis , utilize linechart. x axis labels 1970-01-01 5:30:00 . seems database values not beingness taken graph. can plz help? package com.ti.sensortag; import java.text.decimalformat; import java.text.numberformat; import java.text.parseexception; import java.text.simpledateformat; import java.util.date; import java.util.list; import org.achartengine.chartfactory; import org.achartengine.graphicalview; import org.achartengine.chart.pointstyle; import org.achartengine.model.timeseries; import org.achartengine.model.xymultipleseriesdataset; import org.achartengine.renderer.xymultipleseriesrenderer; import org.achartengine.renderer.xyseriesrenderer; import db.dbhandler; import db.temperature; import android.os.bundle; import a

c++ - Is this use pattern of virtual inheritance for "method injection" a known paradigm? -

c++ - Is this use pattern of virtual inheritance for "method injection" a known paradigm? - yesterday, came across question: forcing unqualified names dependent values originally, seemed specific question related broken vc++ behaviour, while trying solve it, stumbled upon utilize pattern of virtual inheritance hadn't come across before (i explain in second, after telling question have). found interesting, looked on , google, couldn't find anything. maybe, don't know right name ("method injection" 1 of guesses) , known. part of question community: is mutual utilize pattern or special case of known paradigm? see problems/pitfalls can avoided different solution? the problem pattern can solve following: suppose have class morph method dowork() . within dowork() , several functions called implementation supposed selectable user (that's why class called morph ). let's phone call called functions chameleons (since morph class doesn't kno

javascript - Bootstrap alert bar -

javascript - Bootstrap alert bar - you can visit total code here: http://pastebin.com/zyjg35al i started create test after "else". else { $('#route_update').click(function () { $('#comment').slidedown(); settimeout(function () { $('#comment').fadeout(); }, 1000); }); homecoming false; }, 'json'); homecoming false; using code, seems i've "uncaught syntaxerror: unexpected token" when force buttom, nil works. how can working? using bootstrap , jquery http://jsfiddle.net/gianluca/qxgt5/ fixing indentation made error more clear. remove code within else block , have: else { }, 'json'); it's not clear code posted you're trying do, or 'json' belongs to, doesn't go after else block. javascript jquery twitter-bootstrap

ruby on rails - Invite Friends Notification is not showing on facebook -

ruby on rails - Invite Friends Notification is not showing on facebook - <script src="http://connect.facebook.net/en_us/all.js"></script> <script> fb.init({ appid:'my_app_id', cookie:true, status:true, xfbml:true }); function facebookinvitefriends() { fb.ui({ method: 'apprequests', message: 'http://www.librify.com' }); } </script> //html code <div id="fb-root"></div> <a href='#' onclick="facebookinvitefriends();"> facebook invite friends link </a> this code sent invites on facebook notifications invites not showing. else required in code showing notification on facebook. go app->setting->add platform->app on facebook. fill-up canvas url , secure canvas url. , invite friends 1 time again , enjoy. ruby-on-rails facebook facebook-graph-api invite

java - Ncurses not supporting color -

java - Ncurses not supporting color - i writing android ssh client. have terminal object controls view , ssh object send commands server. my problem terminal displays in color during sessions when ncurses application opens, (tmux example), terminal displays in black , white. i able find this: http://invisible-island.net/ncurses/ncurses.faq.html#white_black not sure means. can guide me on more documentation on this, or if there open source java clients back upwards feature. not sure how prepare this. ok, launched application without term environmental variable set appropriately, , meant during initialization routines remote operating scheme believed wasn't talking terminal back upwards colors. now have set correctly, colors work. congratulations! however, setting within application going quite trick. because needs set before application launches. otherwise, when application launches, low level libraries linking query "environment" see kind of t

reflection - C# Approach to create dynamic objects with Intellisense support -

reflection - C# Approach to create dynamic objects with Intellisense support - i have client/server application using c#. in design, client request server info filtering , gathering supported server through c# classes , methods. i have single server connection receives requests , provides info client. so, client requests object, method , parameters. so, there client request like: getdata (myclass, mymethod, myparams[]); it works fine i´m using dynamic method invokation @ server: type type = system.type.gettype(myclass); object instance = system.activator.createinstance(type); methodinfo method = type.getmethod(mymethod); object[] parameters = new object[] { myparams[] }; var info = method.invoke(instance, parameters); ... info checking, filtering , returning client... i have problem have several different objects , methods, each 1 different checking , filtering. dynamic object not back upwards intellisen

javascript - Dust.js partial template -

javascript - Dust.js partial template - i seek follow illustration 1 (https://github.com/linkedin/dustjs/wiki/dust-little-less-know-language-constructs) tutorial. testing below: partial.tl {+greeting} hola {/greeting} {+world} world {/world} main.html <script type="text/x-template" id="itemtemplate"> {>partial/} </script> but didn't works. if know how partial template, please show me how. dust.js tutorial / guide hard find on internet. thank you. dust has compiled javascript before can execute it. .tl , .dust files source forms. if in client environment there pretty explanation here. basic illustration of client side templating dust.js javascript template-engine dust.js

html - Have Text stacked above an element using CSS -

html - Have Text stacked above an element using CSS - i trying acheive similar this [ sometext ] [ someothertext] actualtext actualtext2 but getting like som[etext ] someoth[ertext ] actualtext actualtext2 where [] denote image placed in background. semantically, want/need set stacked elements e.g. <li class="software1"> <div class="overlay"> -soft1 </div> 20 </li> where overlay element supposed text above actual text in front end of lis background. i build little jsfiddle http://jsfiddle.net/a3vrd/3/ displaying issue what want accomplish have text above above "normal" text , not elevated if next it. i guess there many ways this. assuming don't want utilize background-repeat (because have set none) need give same width list elements background image plan use. this similar m

javascript - Why is this parameter not used? -

javascript - Why is this parameter not used? - in backbone 1.1.2, @ line 279 // homecoming re-create of model's `attributes` object. tojson: function(options) { homecoming _.clone(this.attributes); }, options not used, why have there @ all. wasted memory. what missing here? per comment here 1 way of calling code -so why pass options when not used? tojson: function(options) { homecoming this.map(function(model){ homecoming model.tojson(options); }); }, it doesn't waste memory, since argument have available arguments[0] anyway (either options function phone call , vm has side-effects anyway, or it's object , it's reference). it serves document reference superclasses can implement. since js using prototypes object orientation, if create tojson function in 1 of superclasses, it'll used instead. javascript backbone.js