Posts

Showing posts from June, 2015

jquery - How to use turn.js in Ionic 2? -

i have ionic v1 project using turn.js i'm using ionic v2. i'm having problem import turn.js using jquery. angular.module('albumcontroller', []) .directive('flipbook', function () { return { restrict: 'e', replace: true, compile: function (element, attrs) { element.turn({ width: '300px', height: '300px', pages: 8 }).turn('peel', 'br'); element.addclass('flipbook'); return function (scope, el) { el.on('click', '[data-page]', function (e) { el.turn('page', $(e.target).data('page')); }); }; }, templateurl: "flipbook.html" } }); thanks! i don't know if have answer. me following: install jquery ionic(check here ) npm install --save turn.js import $ "jquery"; import "turn.js"; just can use $().t

c# - Prism for Xamarin.Forms unable to AutoWire -

i trying out prism.forms next client project. unfortunately, seeing strange behavior samples. pretext seems xf or prism not me including existing xaml page (also mentioned brian lagunas - man - himself @ evolve session). renaming page throws off , viewmodellocator can't seem locate viewmodel anymore. if re-create page same name, can't find viewmodel. manually setting bindingcontext works, trying not create dependencies constructor injection. question while working on existing code, minor change caused nullreference exception when using navigationpage root. here example of working sample app https://github.com/hnabbasi/xamarin/tree/master/xfprism/xfprism i using navigationpage , pushing contentpage. push contentpage, show modal page via button click , communicate. send parameters second content page via navigationparameters. to break it, try swap isayhello service ipagedialogservice. not sure what's going on that's breaking it. thanks in advance :)

formatting - Choosing Collectd time format -

i'm pushing collectd stats fluentd instance via http socket. latter complaining time format collectd float not integer. here's example output collectd: [{...,"time":1473707444.605,"interval":1.000,...] as can see, i'm outputting in json format. i cannot modify field in fluentd fails message instantly*. have specify different time format in collectd. iso-8601 if @ possible. anyone know how that? i've trawled docs can find far nothing :( can't believe not specifiable. *edit: wrong fluentd not allowing time formatting. does. however, original question still stands think time formatting output should possible somehow, no? collectd not allow changing format of time output sends.

sql - symfony doctrine: find objects where one of the one-to-many-associations is like value -

i have entity named "customer". @ entity there onetomany-association other entity "customer-status". want customer-objects 1 of customer-status-fields xyz. this not problem if make qb this: $qb->andwhere($qb->expr()->like('s.comment', ':comment')); $qb->setparameter('comment', "created @ %"); the problem is, customers customer-statuses query. these statuses. want statuses if like-query applies. i have searched found nothing this. idea? after few beers found anser. expected result should not define customer-status entity in select-operation. select parent-entity. this: $qb ->select(['c']) ->leftjoin('customer.statuses', 's') ->andwhere($qb->expr()->like('s.comment', ':comment')) ->setparameter('comment', "created @ %"); is right way instead of $qb ->select(['c', 's']) ->le

uitableview - UITableViewCell - When are the bounds properly set in iOS 10 -

i want create round uiview (myview) inside uitableviewcell prior ios 10 using func awakefromnib() that: class mycell: uitableviewcell { @iboutlet var myview: uiview! override func awakefromnib() { super.awakefromnib() print(myview.bounds.height) myview.layer.cornerradius = myview.bounds.height/2 myview.layer.maskstobounds = true } } myview height , set 30 via autolayout constraint in storyboard. but print(myview.bounds.height) show 1000.0 in console. corner radius instruction set radius 500 , myview disappear completely. is uitableviewcell life cycle change in ios 10 ? function view.bounds set change in ios 10 ? how can set cornerradius half view height in ios 10 ? here minimal projet reproduce issue to have result close want need add in uitableviewcontroller : override func viewdidappear(animated: bool) { super.viewdidappear(animated) tableview.reloaddata() } but i'm quite sure not optimal ... i had

Searching through data with multiple conditions VBA/Excel -

Image
i have list of data columns indicating test product went under , product. each product undergoes several tests example (hot medium cold). if can imagine, data specific product may b hot product1 medium product1 cold product1 i have many products under went testing spreadsheet extensive (a400 = cold, b400 = productx). trying see if each product underwent hot medium , cold testing. made additional column eliminate repeated product listing , search spreadsheet , find tests (no success). end goal create additional column parts did not go through of testing. make 4 new columns these formulas c: countifs(b:b,$a1,a:a,"hot") d: countifs(b:b,$a1,a:a,"medium") e: countifs(b:b,$a1,a:a,"cold") these show how many times each of products has been tested in respective category. then, use in last column: f: if(and($c1>0,$d1>0,$e1>0,"",$b1) this account items tested in more once. if had category not tes

javascript - Meteor 1.4 and pdfmake -

i trying generate simple pdf meteor application. code in method is: var fonts = { roboto: { normal: process.cwd().split('.meteor')[0] + "public/fonts/roboto -regular.ttf", bold: process.cwd().split('.meteor')[0] + "public/fonts/roboto-medium.ttf", italics: process.cwd().split('.meteor')[0] + "public/fonts/roboto-italic.ttf", bolditalics: process.cwd().split('.meteor')[0]+ "public/fonts/roboto-italic.ttf" } }; var pdfprinter = require('pdfmake/src/printer'); var printer = new pdfprinter(fonts); export const generateprojectlistpdf = () =>{ var docdefinition = { content: 'this sample pdf printed pdfmake' }; var pdfdoc = printer.createpdfkitdocument(docdefinition); pdfdoc.pipe(fs.createwritestream('pdfs/lists.pdf')); pdfdoc.end(); } i geting error fs.readfilesync not function. file font.js, pdfmake package. idea how solve challenge. edit

led - Can I use a Adafruit Neopixel RGB STRIP with a Particle Photon? -

i not sure if rgb strip below work particle photon. @ rgb strip product description mention mcu (microcontroller) should have @ least processor faster 8 mhz highly repeatable 100ns timing precision. searched , found okay on processing (stm32f205 120mhz arm cortex m3) unsure timing precision. what time precision? is time precision of particle photon enough? here link specific rgb strip more details ( adafruit neopixel digital rgb led strip - white 60 led ) thank much yes should fine. have used particle photon 8 led strip , not had issues. there neopixel library available photon well.

xml - How to install AEXML module in my iOS 10 and Xcode 8 application using carthage? -

i trying add aexml module ( https://github.com/tadija/aexml ) xml parsing in ios 10 application xcode 8. however, getting error while building dependencies command carthage update --platform ios . swift version: 3.0 xcode version: 8 carthage version: 0.17.2 cartfile github "tadija/aexml" error after running carthage update --platform ios command gsirn-021308:applepayswag-final chandeln$ swift -version apple swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38) target: x86_64-apple-macosx10.9 gsirn-021308:applepayswag-final chandeln$ carthage update --platform ios *** fetching aexml *** checking out aexml @ "4.0.0" *** xcodebuild output can found in /var/folders/q7/bltc5kls62n2mzlvwhctctzr0000gn/t/carthage-xcodebuild.3nnoot.log *** building scheme "aexml ios" in aexml.xcodeproj ** build failed ** following build commands failed: compileswift normal arm64 /users/chandeln/documents/applepayswag-final/carthage/checkouts/aexml/tests/

php - Laravel 5.2 EagerLoading relationship returns null -

i'm upgrading laravel 5.2 4.2 , running weird issues when i'm using eager loading on relationship, returns null, can call manually. here's parent model: namespace app\models\hours; class hours extends model { /** * model setup */ protected $table = 'leave_hours'; protected $primarykey = 'leave_id'; public $timestamps = false; /** * relationships */ public function hoursstatus() { return $this->belongsto('app\models\hours\hoursstatustype', 'leave_status_code'); } here's hoursstatustype model: <?php namespace app\models\hours; use illuminate\database\eloquent\model; class hoursstatustype extends model { /** * model setup */ protected $table = 'leave_status_type'; protected $primarykey = 'leave_status_code'; public $timestamps = false; /** * relationships */ public function hours() { return $this->hasmany('app\models\hours\hours&#

gwt 2.7 - Precise control of GWT permutations via *.gwt.xml -

i need precisely specify gwt permutations , control variation within them (combinations of property values supported each) have hard time finding detailed behaviour specification. during experimentation have learned have watch creating set-property ... when-property-is cycles though these cycles "stable" - i.e. not change part of cycle, "confirm" it. restricted can do, decided try way - define brand new property, (just) example: <define-property name="precise.permutation" values="webkit,gecko,ie,unsupported"/> ... , have like: <set-property name="precise.permutation" value="webkit"> <!-- ... custom conditions ... --> </set-property> <set-property name="precise.permutation" value="gecko"> <!-- ... custom conditions ... --> </set-property> <set-property name="precise.permutation" value="ie"> <!-- ... cus

ios - XCTest on Xcode 8 GM Seed -

i have set of xctest automation scripts running ui test of app, , trying out on xcode 8 ios 10 testing. however, seems xctest framework running slower xcode 7 @ moment. me experiencing issue? or app's problem; way built or xctest written? anyone else experience same issue of slowness on xcode 8? thanks,

sort swift array and keep track of original index -

i sort swift array , keep track of original indices. example: arraytosort = [1.2, 5.5, 0.7, 1.3] indexposition = [0, 1, 2, 3] sortedarray = [5.5, 1.3, 1.2, 0.7] indexposition = [1, 3, 0, 2] is there easy way of doing this? easiest way enumerate. enumerate gives each element in array index in order appear , can treat them separately. let sorted = arraytosort.enumerate().sort({$0.element > $1.element}) this results in [(.0 1, .1 5.5), (.0 3, .1 1.3), (.0 0, .1 1.2), (.0 2, .1 0.7)] to indices sorted: let justindices = sorted.map{$0.index} // [1, 3, 0, 2]

alfresco - How to filter folder children using cmis query? -

i filter children of folders cmis 1.0 compliant repository 1 query. far doesn't seem possible have settled execute 2 queries retrieve children (i.e. folders , documents), still filter children custom types have following query: select cmis:objecttypeid, cmis:objectid cmis:folder cmis:objecttypeid = 'my:custom1' or cmis:objecttypeid = 'my:custom2' or cmis:objecttypeid = 'cmis:folder' in_folder('workspace://spacesstore/fhj738tw-45hw-659u-9ds1-9cx3nh95r089') which doesn't work keep getting error mismatched input. i've used query in order children of particular folder string query; query = "select * cmis:document in_folder('" + folderid + "')"; and children itemiterable<queryresult> resultlist = session.query(query, false);// no need session ??? and for (queryresult qr : resultlist) { string iddocument = qr.getpropertybyqueryname("cmis:objectid").getfirstvalue().tostring(); d

r - Calculate means for multiple variables in with different sizes -

i have table , code @ below: data <- data.frame(subject = c(0,0,0,1,2,2), class = c("apple","apple","apple","orange","orange","orange"), name = c(1,1,1,0,1,1), name1 = c(0,1,1,1,1,1), name2 = c(1,1,1,0,0,1)) i want find average of each variable each class , each subject, , list table. example, table have average subject first; 0 mean 8/9 , 2 mean 5/6. second work out mean class; orange mean 2/3. breakdown average name,name1 , name2. i have tried code below, first store header list , sort subject , class lapply. isnt working. cols = c(head(data)) data[,lapply(.sd[,cols,with=false],mean),by=class|subject] library(reshape2) library(dplyr) data2 <- melt(data, c("subject", "class")) data.frame(summarize(group_by(data2, subject, class), avg_val = mean(value))) -> table_for_you

javascript - AJAX calls sequenced by JS Promises appear to be running in the proper order, but the output from the database suggests otherwise -

i have 2 files i'm working here. query.php script wrote handle mysql queries particular website. query_test.js series of ajax calls test query.php . query_test.js , see below, uses promises sequence 1 test after another, have made tests dependent upon 1 another. writing console, ajax calls appear finishing in correct order. problem output inconsistent , output of individual tests not reflecting results of tests before them. since individual tests seem work fine, believe sequencing issue. can't figure out why , how happening. for clarity, tests follows: test 1: retrieve entire table , display test 2: add new row, then retrieve , display table again test 3: select just-added row, display results test 4: update just-added row, retrieve , display table test 5: remove just-added row, retrieve , display table in example output below, notice table retrieved after test 2 not reflect row added , test 3's query returns nothing. isn't until test 4 previously-ad

angularjs - How to structure two different headers with ui-router? -

i'm doing refactoring angularjs 1.4.2 , ui-router , i'm not sure proper architecture should change. currently, using $state.go("main"); call main route , subsequent routes, separate components html page, controller, , service each. i'm thinking used because main content dynamic. the header section hard coded index.html page guess quick fix. header content needed same pages. what i'm attempting break out header html code index.html, 2 different header pages use new headercontroller , incorporate existing app structure, unless wrong architecture. have simple plunker try , working stand alone, it's not doing when click on buttons. so have 2 questions, proper ui-router structure app 2 different headers , there may 1 or 2 more added in later? i'm assuming want use 2 different states this, rather use url routing, can use either one. the second question is: why doesn't plunker work? app.js var myapp = angular.module('myapp

javascript - How to access the correct `this` inside a callback? -

i have constructor function registers event handler: function myconstructor(data, transport) { this.data = data; transport.on('data', function () { alert(this.data); }); } // mock transport object var transport = { on: function(event, callback) { settimeout(callback, 1000); } }; // called var obj = new myconstructor('foo', transport); however, i'm not able access data property of created object inside callback. looks this not refer object created other one. i tried use object method instead of anonymous function: function myconstructor(data, transport) { this.data = data; transport.on('data', this.alert); } myconstructor.prototype.alert = function() { alert(this.name); }; but exhibits same problems. how can access correct object? what should know this this (aka "the context") special keyword inside each function , value depends on how function

.net - How can I programmatically install a system service using c# to use a Group Managed Service Account (gMSA)? -

i deploying company's system in new environment, , out group has given me list of service accounts use each of our system services. however, they've told me accounts group managed service accounts (or gmsas short) , there no passwords since managed "key distribution service". i have not worked gmsas before, source our installers quite simple, it's not working due lack of passwords. var process = new serviceprocessinstaller() { account = serviceaccount.user, username = <username>, password = <password>, }; var service = new serviceinstaller() { servicename = <code_name>, displayname = <pretty_name>, }; service.servicesdependedon = <dependencies>; service.starttype = servicestartmode.automatic; service.delayedautostart = true; installers.add(process); installers.add(service); base.install(statesaver); how can modify service installers use gmsa when no password given. (or user admin rights) installing se

php - Laravel Model Relationship. which one? -

hey there should start given db work with. not sure relationship used. need able name of categories assigned articles. basically articles <> article_categories <> categories article_categories being connector articles |id|header|body|ect...| categories |id|parent_group|name| article_categories |article_id|category_id| so thought maybe hasmanythrough got errors. did arguments wrong. what tried first inside articles model (got error this) public function category(){ return $this->hasmanythrough('app\categories' , 'app\article_categories' ,'article_id' , 'category_id'); } hope explain situation. need use has many through or on complicating this? -thanks no need hasmanythrough belongstomany need. public function category(){ return $this->belongstomany('app\categories' , 'article_categories' ,'article_id' , 'category_id'); }

matplotlib - In ggplot for Python, using discrete X scale with geom_point()? -

the following example returns error. appears using discrete (not continuous) scale x-axis in ggplot in python not supported? import pandas pd import ggplot df = pd.dataframe.from_dict({'a':['a','b','c'], 'percentage':[.1,.2,.3]}) p = ggplot.ggplot(data=df, aesthetics=ggplot.aes(x='a', y='percentage'))\ + ggplot.geom_point() print(p) as mentioned, returns: traceback (most recent call last): file "/users/me/library/preferences/pycharm2016.1/scratches/scratch_1.py", line 30, in <module> print(p) file "/users/me/lib/python3.5/site-packages/ggplot/ggplot.py", line 116, in __repr__ self.make() file "/users/me/lib/python3.5/site-packages/ggplot/ggplot.py", line 627, in make layer.plot(ax, facetgroup, self._aes, **kwargs) file "/users/me/lib/python3.5/site-packages/ggplot/geoms/geom_poi

algorithm - Best way to reduce the size of image -

what best way reduce size of image in e-commerce website having billions of images ? a- using api, b-through html c-using bash script loop on d- using hadoop you not supposed ask third party software won't mention specifically. however, can use plugins smush or compress of images loader. on popular platforms, quick search smushing plugins work.

JSF @Named Target Unreachable, identifier '*bean*' resolved to null -

this question has answer here: identifying , solving javax.el.propertynotfoundexception: target unreachable 8 answers i checked there many other threads similar issues cannot find what's wrong one. cdi @named doesn't conflict @managedbean. bean class i'm using. @named @requestscoped public class userbean { private string name; public userbean() { } public string getname() { return name; } public void setname(string name) { this.name = name; } public string addvaluestoflashaction() { flash flash = facescontext.getcurrentinstance() .getexternalcontext().getflash(); flash.put("name", name); return "terms?faces-redirect=true"; } public void pullvaluesfromflashaction(componentsystemevent e) { flash flash = facescontext.getcurrenti

python - Mongo Update of Array Query using Upsert -

given menuitems list ['foo', 'bar', 'fooz', 'ball'] , menudb collection has 3 records: 'foo', 'bar', 'fooz' when run menudb.update({"_id" : {"$in": menuitems}}, {"$addtoset": {"stalecount": 100}}, upsert=true) instead of creating new record called 'ball', creates new record called 'objectid("57d730777bc6a465c9124111")'. is there way make newly created record's '_id' list? =thanks you can remove upsert if not want new item in menudb collection. seems id objectid instead of string. https://docs.mongodb.com/manual/reference/operator/query/in/ you can verify if _id foo exits in collection menudb.update({"_id" : "foo"}, {"$addtoset": {"stalecount": 100})

java - How do I create a user-defined method that returns the length of a string? -

i trying write program takes user's input , outputs number of characters typed in. have creating method calculates amount of characters, call method in main output results. encouraged use loop, don't see how work. can calculate number of characters using length(), can't figure out how make method work. have far: public static void main(string[] args) { scanner scnr = new scanner(system.in); string userinput = ""; system.out.println("enter sentence: "); system.out.print("you entered: "); userinput = scnr.nextline(); system.out.println(userinput); return; } public static int getnumofcharacters(int usercount) { int = 0; string userinput = ""; usercount = userinput.length(); return usercount; } } my method not returning length of string, gives me 0 or error. right now, never calling "getnumofcharacters" method in main. way java programs work, calling main method , executing line per lin

Mysql: auto increment one column based on another column -

Image
please problem in mysql. how change auto increment different value if 1 of column has same value.. example when inserting new value in table. if x_id 1 id 1 , on. if x_id 2 my id 1 .. ( id auto increment. ) this expected reult. sorry bad english. thank you. :) if understand correctly, want calculate x_id . if so, need column specifies ordering of rows. then, 1 method use correlated subquery: select t.id, (select count(*) t t2 t2.id = t.id , t2.?? <= t.??) x_id t; the ?? column specifies ordering.

Python Regex findall But Not Including the conditional string -

i have string: the quick red fox jumped on lazy brown dog lazy and wrote regex gives me this: s = quick red fox jumped on lazy brown dog lazy re.findall(r'[\s\w\s]*?(?=lazy)', ss) which gives me below output: ['the quick red fox jumped on ', '', 'azy brown dog ', ''] but trying output this: ['the quick red fox jumped on '] which means regex should give me till encounters first lazy instead of last 1 , want use findall . make pattern non-greedy adding ? : >>> m = re.search(r'[\s\w\s]*?(?=lazy)', s) # ^ >>> m.group() 'the quick red fox jumped on '

html - How would get two div tags to align horizontally -

okay have 2 div elements want align vertically, elements identified "navbar" , "title" have tried multiple times align them nothing seems work... great , code below. here code: body { background-color: black; } div.navbar { color: blue; background-color: white; text-align: center; max-width: 25%; min-width: 140px; flex: 1; } div.title { color: purple; text-align: center; } div.container { display: flex; } <!doctype html> <html> <head> <link rel='shortcut icon' href='favicon.png' type='image/png'/ > <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>bobby death mage</title> <script src="code.js" type="text/javascript" charset="utf-8"></script> <link href="style.css" rel="stylesheet" type="text

c# - Calling base class of a class in an assembly loaded into a seperate app domain -

i've been fighting few days , can't find on google particular situation. know want possible because have worked application (exit game photon) photon unfortunately not run under linux , have far why i'm trying "re-invent wheel) i have program loads assembly (plugin type of thing) seperate app domain pulls interface , can run fuctions defined in interface on class in assembly assembly class inherits base class in assembly. want able run fuction on base class without having add derived class exception base class: [serializable] public abstract class applicationbase : marshalbyrefobject, iapplicationbase { public abstract void setup(); public virtual void teardown() { } public virtual void onstoprequested() { } public virtual void onserverconnectionfailed(int errorcode, string errormessage, object state) { //do nothing individual servers } } test server class: public class testserver : applicationbase { protected readonly

php - Wordpress blog post looping on different class -

Image
i need since i'm beginner in php , wordpress (ain't got people around ask), how make php wordpress blog post loop in different class 1 latest post image.. here's html code: <!-- div wrapped large post --> <div class="blog"> <a href="#"> <div class="row"> <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12"> <img src="img/blog-super.jpg" class="img-responsive" /> </div> <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> <div class="img-content text-left culturo-imagery"> <h2>the thing marketers have fear fear of change</h2> <div class="article-super"> gladly, customer-service software company, offering organizations opportunity connect customers on

preg replace - PHP get file name from URL stripping extension and image dimesion -

following 1 of dynamically generated variable have http://www.niresh.guru/wp-content/uploads/2016/06/we-are-all-visual-creators-469x1024.jpg i want final output of filename stripping extension jpg , image dimesion 469x1024 , final name in lowercase final output im expecting we-are-all-visual-creators note hyphen before image dimension needed removed i need common function strip image dimension , image extensions jpg, png, jpeg , tiff (case insensitive) im using iphone ask question have tried few php researching in internet, due powercut can't use mac these info can provide thanks. please not downrate if have questions comment is want: $url = " http://www.niresh.guru/wp-content/uploads/2016/06/we-are-all-visual-creators-469x1024.jpg"; preg_match('~^.+/([\w-]+)-(\d+x\d+)(\.\w+)$~', $url, $match); print_r($match); output: array ( [0] => http://www.niresh.guru/wp-content/uploads/2016/06/we-are-all-visual-creators-469x1024.jpg [

laravel - PHP Elasticsearch returning 0.0 for all scores -

i have aws elasticsearch instance provisioned , seeded bunch of band names. if query via curl on command line nice set of weighted results including scores: curl -xget 'search-mydomain-3gk2dsu32xfb5ar4kcfablqjla.us-west-2.es.amazonaws.com:80/index/bands/_search?q=burn' {"took":13,"timed_out":false,"_shards": {"total":5,"successful":5,"failed":0},"hits": {"total":17,"max_score":5.6469817,"hits": [{"_index":"index","_type":"bands","_id":"17554","_score":5.6469817,"_source":{"id":17554,"band":"burn witch burn"}}, {"_index":"index","_type":"bands","_id":"30730","_score":4.617216,"_source":{"id":30730,"band":"burn halo"}

COALESCE in SQL Server vs COALESCE in MySQL -

as know coalesce ansi sql standard function. has same functionality across different rdbms (ie) returns first not null value list of values. consider following data setup create table tablea (customerid varchar(10), salary int); insert tablea (customerid, salary) values ('a1', 100), ('a2', 200), ('a3', 300), ('a4',400); create table tableb (customerid varchar(10), rate int); insert tableb (customerid, rate) values ('a1', 2), ('a2', 3), ('a3', 4); query : select t1.customerid, coalesce(t1.salary * t2.rate, 'na') salary tablea t1 left join tableb t2 on t1.customerid = t2.customerid in sql server when ran above code, generates following error msg 245, level 16, state 1, line 64 conversion failed when converting varchar value 'na' data type int. it's because coalesce function convert na integer since integer has higher precedence varchar . whe

css - Div Scroll With Page Using Jquery -

i'm trying make menu scroll user. this relativly using: #main-header-wrapper { width: 100vw; height: 75px; position: absolute; top: 0; left: 0; } what wanted animated type of scroll though, achievable using jquery: $(window).scroll(function(){ $("#main-header-wrapper").stop().animate({"margintop": ($(window).scrolltop()) + "px", "marginleft":($(window).scrollleft()) + "px"}, "slow" ); }); with jquery solution menu bar slides down top after user stops scrolling. but when user scrolls bar appears "stick" page before scrolling up. what i'd achieve down scroll animation still working is, if user scrolls there no animation @ all. bar @ top of page during entire scroll. codepen: http://codepen.io/think123/pen/maxlb the jquery taken from: how make <div> move , down when i'm scrolling page? i did come solution using accepted answer here: how can determine direct

javascript - angularjs - ng-click doesn't work inside script -

angular.module('myapp').controller('institutioncontrol', function ($scope, $rootscope,auth, $sessionstorage,$localstorage, $rootscope, $stateparams, $location, $http, $cookies,toastr,datafactory,$oclazyload,$interval) { if (!auth.is_login_sim()) { $location.path('/home'); return false; } $scope.user_auto_refreshhtml=''; $scope.islogged=auth.is_login_sim(); $scope.user_auto_refresh=''; console.log($scope.islogged); if( $scope.user_auto_refresh =='1'){ $scope.getinstitutionfilling=$interval(function(){ //alert('hello'); datafactory.post_api('institution/institutionfilling_details',{'user':auth.is_login_sim()}).then(function(results){ //console.log(results); $scope.institutionfilling_details=results.institution_details; $scope.user_auto_refresh=results.user_auto_refresh; console.log($scope.user_aut

Getting image from Django on AWS, to Android Glide. 404 error -

i implemented rest api using django-rest-framework, deployed aws-ec2. settings.py media_url = '/images/' media_root = os.path.join(base_dir, 'images') serializers.py class postserializer(serializers.modelserializer): author = serializers.readonlyfield(source='author.username') class meta: model = post fields = ('author', 'text', 'image') def create(self, validated_data): validated_data['author'] = self.context['request'].user return super(postserializer, self).create(validated_data) urls.py router = simplerouter() router.register(r'posts', views.postviewset, base_name='posts') urlpatterns = router.urls urlpatterns = [ url(r'^', include(router.urls)), ] views.py class postviewset(viewsets.modelviewset): serializer_class = postserializer permission_classes = [isauthenticated] queryset = post.objects.all() so, return

angularjs - Jasmine unit tests -

hi new jasmine. can body suggest write test case code in angularjs $('#issuedatespan').click(function(event) { event.preventdefault(); $('#datetimepickerissue').data('datetimepicker').show(); }); if understood correctly, want tests datetimepicker displayed. have tried like: describe('visibility', function() { it('datetimepicker displayed', function() { expect(element(by.id('datetimepickerissue').is(':visible')).tobe(true); }); }); or describe('visibility', function() { it('datetimepicker displayed', function() { expect($('#datetimepicker').is(':visible')).tobe(true); }); });