FAQ Database Discussion Community


Owl Carousel 2 with lazyload option

javascript,jquery,lazy-loading,owl-carousel
I'm using Owl Carousel 2 in a project and it's working great. I want to lazyload the images in each item. Thankfully, Owl Carousel 2 has a built in option for that. However, there is no option to lazyload the images in the next one or two items (which are...

Lazy loading in datatable JSF

jsf,jsf-2,datatable,lazy-loading
In many project which I take care of it there is nothing like lazy paging in datatables. Does JSF have some kind of magic or am I right that its really big performance problem. If you watch some tutorials almost no one take care of lazy paging Lets say you...

Are generator expressions doing less work compared to list comprehensions?

python,optimization,lazy-loading,list-comprehension,generator-expression
While refactoring a piece of code, I noticed this: if product_id in [c["id"] for c in self.data.load_products()]: # Do something In turn, load_products() does an SQL query, and for every product: Performs some relatively CPU-costly operations and: Uses yield to return the products one by one to the caller. As...

Swift: lazy population of a collection view

ios,swift,uiimageview,uicollectionview,lazy-loading
I'm learning Swift, and writing a little app showing a collection view with images. It's not working and the images are never being displayed. I am seeing strange behavior in collectionView cellForItemAtIndexPath: when I lazily load the image to display in the cell and call collectionView.dequeueReusableCellWithReuseIdentifier() the second time, it...

Entity Framework update virtual property directly without creating new record

c#,entity-framework,lazy-loading
Here is a simple entity: public class Customer : Entity { public virtual Location Location { get; set; } } Now suppose we have a customer already: var customer = new Customer() {Location = new Location("China")}; and now we want to update his location: var customer = context.Customers.First(x => x.Location.Country...

Angularjs: ocLazyLoad vs Requirejs

angularjs,requirejs,lazy-loading,single-page-application
I'm working on a big angluar project and obviously we need a way to lazy load our scripts. I've worked with require.js before and it's quite good, but the problem is that after we concatenating and minifying our files, we got a 1.5M js file. So i just encountered OcLazyload...

ocLazyLoad: error using ngSanitizer

angularjs,lazy-loading
I want to use the angular application ngSanitize to use plain HTML in my application. I basically want to reproduce the functionality explained here in the docs but I want to lazy-load the module with ocLazyLoad. But for some reason I still get the error Error: [$sce:unsafe] Attempting to use...

fix image wrap size with the same size of Lazy Load image

jquery,image,lazy-loading,wrap,dimensions
I'm looking for to show background-color image before lazy-loading, with exactly the same dimension of the image. My script get width and height of each images and applises on image-wrap. my script : $(document).ready( function(){ $('section .lazywrap').each(function(){ var lazyWrap = $(this); var img = $(lazyWrap, this); lazyWrap.width(img.width()); lazyWrap.height(img.height()); console.log(lazyWrap.height()); });...

Android Lazy List Loader with MySQL database

android,mysql,json,listview,lazy-loading
I am just a newbie with Android programming. I am using Fedor's LazyList for my thesis. I've been trying to configure his code but I am not getting any luck. What I would like to do is retrieve data from mysql and place it into the textviews. However, I am...

jquery lazy load and other Jquery / javascript functions don't work after append

javascript,jquery,ajax,event-handling,lazy-loading
I'm attempting to create a page where a user can view pictures and like or dislike them. To make it user friendly, I'm creating a function that when a user clicks "load more post" jquery will fetch data from server.. I used append for this but javascript functions from the...

xcode copy dylib into bundle with lazy loading

c++,c,xcode,lazy-loading,dylib
I have an application (cocoa app) which loads a dylib (c library) lazy (dlopen). This dylib (the xcode project incl. sourcecode) is also a part of the workspace in xcode. Now I want xcode to automatically copy the dylib into the app bundle when the app is built (also compile...

Web page that loads content first, then beautifies it by deferred-loading hi res image swap-ins? [closed]

jquery,lazy-loading,retina-display,progressive-enhancement,deferred-loading
I have made a site that looks acceptable and strikes a balance between having a reasonable load time and not overly-compressing the JPEG images. One concern is that there is a 100% stretching full-screen background, which while it looks fine on 13-inch display, could spell ugliness on something like a...

How to update UIImages after NSURLConnection delegate completes

ios,objective-c,nsurlconnection,lazy-loading
So I'm pulling down about 50 images from my API using NSURLConnection, its working great, except its locking up the UI when it runs. I'm assuming that is because I'm updating the UI in real time form the NSURLConnection self delegate. So I'm thinking what I need to do is...

onclick redirection and lazy load

javascript,onclick,lazy-loading,primefaces-mobile
I want to run a javascript function when I click on a commandButton on signin.xhtml, but when I click on it, a redirection occur to dev.xhtml. I don't want this redirection, I want to stay on signin.xhtml. Actually it's not really a redirection because it's the same index.xhtml page but...

Lazy loading occurring for some reason when DeferredLoadingEnabled is false

c#,.net,linq-to-sql,lazy-loading
I'm using LinqToSql and in order to prevent lazy loading each datacontext has this setting: DeferredLoadingEnabled = false Now, I'm using a data context that add's 3 sub tables as a loadoption. Something like: EntitiesDataContext dc = new EntitiesDataContext(connectionString); dc.DeferredLoadingEnabled = false; LoadOptions lo = new LoadOptions(); lo.LoadWith<Entity1>(e => e.Entity2);...

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role

java,hibernate,lazy-loading,hibernate-mapping
I have table called category which has parent category field. I am using that field to get the sub categories. I have checked the answer for the similar question, the suggestion was (fetch = FetchType.EAGER). But I want to load it as LAZY because it is circular dependency. (Pointing to...

How can this behaviour using a Hibernate query be explained? Is it due to Hibernate lazyness?

hibernate,grails,groovy,gorm,lazy-loading
This morning, I ran into a behaviour i can not really explain : when trying to save (or retrieve if it already exists) some objects with the help of GORM, i was surprised by a NullPointerException when a object (with name "name3") is simply retrieved from the db and stored...

AngularJS Script to run after ng-repeat elements are loaded

angularjs,angularjs-directive,lazy-loading,ng-repeat,angular-services
I have a problem that I wasn't able to solve even looking to other posts on Stackoverflow. I'm making an App with AngularJS, and I would like to pick some links of images from my Json that stays on an apache2 server and swipe them like in a carousel. When...

Knockout - How to reset Dynamic observable array with new value

javascript,knockout.js,lazy-loading,observablecollection
I can't reset observable array with new value am using some lazy loading Technic. I can clear but can't reset, but it not allowing me to add new dynamic value. fiddle http://jsfiddle.net/kspxa8as/ js var i = 1; optionsProvider = function(self) { var self = self || {}; self.options = {};...

What is the Lazy constructor called when Ninject inject Lazy objects?

c#,ninject,lazy-loading
Lazy have several constructors through which you can control the threading behavior of a Lazy instance. What is the constructor used by Ninject to create the injected Lazy instance? How I can specify which constructor Ninject must use ? if that is possible.

Loading lots of Text (spannablestring) into Android textview taking 200ms plus?

android,textview,scrollview,lazy-loading,spannablestring
I'm currently developing a Bible in Android which is Paragraph based so a ListView won't work. I implemented a ViewPager using fragments for each new chapter that is loaded. The problem I'm having is that when I set the TextView text (mytextview.settext()), it takes over 200 ms just to display...

Assigning methods to object at run-time - Design Pattern

c#,.net,design-patterns,properties,lazy-loading
I have created an architecture in my C# code which does exactly what I want, but seems it would be very difficult to maintain in the long-run and am hoping there's a design pattern / better architecture I could be pointed towards. I have created an object Test which, again,...

How to force loading images for the webpages installed “lazy load” without scrolling?

javascript,google-chrome-extension,lazy-loading
I implement a Chrome extension. The extension needs to get all images URLs of webpages. However, some webpages have "lazy load" plug-in. My question is if it is possible that I can still get URLs without required manually scrolling down?

Using Glide for Android, how do I load images from asset and resources

android,lazy-loading,android-glide
I want to keep all the transformation, stoke and animations identical and was thinking if we can pass resource id or asset name in glide to load it from local ?

Entity Framework - Trouble with one-to-many relationship

c#,entity-framework,lazy-loading,virtual,one-to-many
We are making a code-first approach, and are having trouble with a one-to-many relationship. A Departement (Dep) has a list of Employees. Each Employee belongs to a Dep. (Required) I want to update the Employees name. (Without touching the Dep) I have reduced the sample to some simple classes: public...

Lazy Load not working after getting images with jquery

jquery,ajax,lazy-loading,dynamic-content,jquery-lazyload
Hello everybody I have a question I am using lazy load for my images in my website. I taking my first 10 datas using server side , here is ok. However I load next 10 datas by using jquery> ajax . I can get the data what I want but...

Rails: Mail::Message object isn't showing the message_id attribute but

ruby-on-rails,ruby,lazy-loading
I've a Mail::Message object that's created by the following way: mail_message_object = mailer.send(method_symbol, *parameters) Here the method_symbol specifies it the type of the mail. Now, my problem is that when try to use this particular mail_message_object's message_id, it shows me a nil. mail_message_object.message_id --> nil But if I do this...

AngularJS Lazy Load Template and Controller in UI-Router, RequireJS, OCLazyLoad

angularjs,requirejs,lazy-loading,angular-ui-router
I am attempting to lazy load a controller and template in my UI-Router router.js file, but am having difficulty with the template. The controller loads properly, but after that is loaded, we must load the template and this is where things go wrong. After ocLazyLoad loads the controller, we resolve...

Displaying multiple images causes massive memory usage

ios,swift,lazy-loading
I have an app that allows a user to go into their gallery and select photos from their photo library to add to the app, it is displayed in a tableview This is then added to an array which after UIImagePickerController fetches the image, reloads the collection view with the...

error loading javascript files dynamically

javascript,dynamic,load,lazy-loading
i am trying to lazy (dynamically) load javascript files in my webpage. i have used this : http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml function loadjscssfile(filename, filetype){ if (filetype=="js"){ //if filename is a external JavaScript file var fileref=document.createElement('script') fileref.setAttribute("type","text/javascript") fileref.setAttribute("src", filename) } else if (filetype=="css"){ //if filename is an external CSS file var fileref=document.createElement("link") fileref.setAttribute("rel", "stylesheet")...

Escape link in data-original attribute in img tag of ng-repeat

javascript,angularjs,angularjs-ng-repeat,lazy-loading
I see in console that my browser is making request to a link that does not exist as I have placed it in data-original of my image. But this is a malformed URL. Sample of this is given below: http://localhost:8080/%7B%7Bobject.array[0].url%7D%7D I have an <img src="" /> tag inside ng-repeat. I...

How to get filtered value on Primefaces lazy datatable?

jsf-2,primefaces,datatable,filtering,lazy-loading
I use lazy="true" on primefaces datatable because my data is large. But this time I didn't get the filtered list. I guess, the problem is dataTable value is org.primefaces.model.LazyDataModel and filteredValue is java.util.List. So, how can I get the filteredValue on my datatable ? Any suggestion? My datatable declaration :...

SetFetchMode Lazy doesn't overwrite ClassMap settings

c#,nhibernate,fluent-nhibernate,lazy-loading
In Criteria I do SetFetchMode as Lazy but still fetching all items, how can I fix this? public class MenuItem : BaseClass<MenuItem> { public virtual int MenuItemId { get; set; } public virtual string Text { get; set; } public virtual IList<MenuItem> Children { get; set; } public virtual MenuItem...

Progressively loading slide: Some images don't load or only load partially and quit

javascript,jquery,image,lazy-loading,slideshow
I'm progressively loading my images using Slick.js and I noticed that some of the images are either partially loading or not loading at all. For example, on this site, there are two galleries: Architecture and Design (in the nav). When the user clicks on either one, they are presented with...

Data URI image sizing (auto height)

css,image,lazy-loading,data-uri
I use Unveil.js to lazy load images. To save time/space, I use a base64 placeholder image: <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="https://unsplash.it/1000/500?image=631" width="1000" height="500" data-unveil="true" /> The problem I'm experiencing is how the placeholder image gets resized. It seems to always maintain an aspect ratio of 1 which is a problem for responsive...

Lazy Loading on a List of Objects using Java?

java,gwt,lazy-loading
I am using Java and GWT. I have a list of objects that loads dynamically (onPageLoad) and I want to show this list of objects using lazy loading. I don't know if there is such GWT component, or I have to use some js plug-in. I checked this post: http://www.appelsiini.net/projects/lazyload...

How does lazy module loading work in ES6

javascript,import,module,lazy-loading,ecmascript-6
How can I lazily-load ES6 modules? By lazy, I mean I don't want to actually load modules that aren't needed. For example, here's something I can do with RequireJS: function someEventHandler() { var SomeModule = require('some-module'), module = new SomeModule(); // ... } Something along the same lines doesn't appear...