Search Results

Search found 1302 results on 53 pages for 'async'.

Page 20/53 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • RESTful Java on Steroids (Parleys, Podcast, ...)

    - by alexismp
    As reported previously here, the JAX-RS 2.0 (JSR 339) expert group is making good progress. If you're interested in what the future holds for RESTful Java web services, you can now watch Marek's Devoxx presentation or listen to him in the latest Java Spotlight Podcast (#74). Marek discusses the new client API, filters/handlers, BeanValidation integration, Hypermedia support (HATEOAS), server-side async processing and more. With JSR 339's Early Draft Review 2 currently out, another draft review is planned for April, the public review should be available in June while the final draft is currently scheduled for the end of the summer. In short, expect completion sometime before the end of 2012.

    Read the article

  • Use-cases for node.js and c#

    - by Chase Florell
    I do quite a bit of ASP.NET work (C#, MVC), but most of it is typical web development. I do Restful architecture using CRUD repositories. Most of my clients don't have a lot of advanced requirements within their applications. I'm now looking at node.js and it's performance implications (I'm addicted to speed), but I haven't delved into it all that much. I'm wondering if node.js can realistically replace my typical web development in C# and ASP.NET MVC (not rewriting existing apps, but when working on new ones) node.js can complement an ASP.NET MVC app by adding some async goodness to the existing architecture. Are there use-cases for/against C# and node.js? Edit I love ASP.NET MVC and am super excited with where it's going. Just trying to see if there are special use cases that would favor node.js

    Read the article

  • Read All Text from Textfile with Encoding in Windows RT

    - by jdanforth
    A simple extension for reading all text from a text file in WinRT with a specific encoding, made as an extension to StorageFile: public static class StorageFileExtensions {     async public static Task<string> ReadAllTextAsync(this StorageFile storageFile)     {         var buffer = await FileIO.ReadBufferAsync(storageFile);         var fileData = buffer.ToArray();         var encoding = Encoding.GetEncoding("Windows-1252");         var text = encoding.GetString(fileData, 0, fileData.Length);         return text;     } }

    Read the article

  • Pro Google App Engine developer interview questions (with answers)

    - by WooYek
    What are good questions to determine if applicant is pro Google App Engine developer? Questions that can distinguish that someone is not an ad-hoc GAE programmer, but is really doing professional GAE development, with all areas concerned (eg. performance, transactions, async/batch data processing). Please provide answers, so an intermediate developer (such as myself :) can interview someone more experienced. Please avoid open questions. If possible please provide a link to a documentation part that's covering a topic in question. Please keep one interview question/answer per response for better reading experience and easier interview preparation.

    Read the article

  • jqGrid - dynamically load different drop down values for different rows depending on another column value

    - by Renso
    Goal: As we all know the jqGrid examples in the demo and the Wiki always refer to static values for drop down boxes. This of course is a personal preference but in dynamic design these values should be populated from the database/xml file, etc, ideally JSON formatted. Can you do this in jqGrid, yes, but with some custom coding which we will briefly show below (refer to some of my other blog entries for a more detailed discussion on this topic). What you CANNOT do in jqGrid, referrign here up and to version 3.8.x, is to load different drop down values for different rows in the jqGrid. Well, not without some trickery, which is what this discussion is about. Issue: Of course the issue is that jqGrid has been designed for high performance and thus I have no issue with them loading a  reference to a single drop down values list for every column. This way if you have 500 rows or one, each row only refers to a single list for that particuolar column. Nice! SO how easy would it be to simply traverse the grid once loaded on gridComplete or loadComplete and simply load the select tag's options from scratch, via ajax, from memory variable, hard coded etc? Impossible! Since their is no embedded SELECT tag within each cell containing the drop down values (remeber it only has a reference to that list in memory), all you will see when you inspect the cell prior to clicking on it, or even before and on beforeEditCell, is an empty <TD></TD>. When trying to load that list via a click event on that cell will temporarily load the list but jqGrid's last internal callback event will remove it and replace it with the old one, and you are back to square one. Solution: Yes, after spending a few hours on this found a solution to the problem that does not require any updates to jqGrid source code, thank GOD! Before we get into the coding details, the solution here can of course be customized to suite your specific needs, this one loads the entire drop down list that would be needed across all rows once into global variable. I then parse this object that contains all the properties I need to filter the rows depending on which ones I want the user to see based off of another cell value in that row. This only happens when clicking the cell, so no performance penalty. You may of course to load it via ajax when the user clicks the cell, but I found it more effecient to load the entire list as part of jqGrid's normal editoptions: { multiple: false, value: listingStatus } colModel options which again keeps only a reference to the sinlge list, no duplciation. Lets get into the meat and potatoes of it.         var acctId = $('#Id').val();         var data = $.ajax({ url: $('#ajaxGetAllMaterialsTrackingLookupDataUrl').val(), data: { accountId: acctId }, dataType: 'json', async: false, success: function(data, result) { if (!result) alert('Failure to retrieve the Alert related lookup data.'); } }).responseText;         var lookupData = eval('(' + data + ')');         var listingCategory = lookupData.ListingCategory;         var listingStatus = lookupData.ListingStatus;         var catList = '{';         $(lookupData.ListingCategory).each(function() {             catList += this.Id + ':"' + this.Name + '",';         });         catList += '}';         var lastsel;         var ignoreAlert = true;         $(item)         .jqGrid({             url: listURL,             postData: '',             datatype: "local",             colNames: ['Id', 'Name', 'Commission<br />Rep', 'Business<br />Group', 'Order<br />Date', 'Edit', 'TBD', 'Month', 'Year', 'Week', 'Product', 'Product<br />Type', 'Online/<br />Magazine', 'Materials', 'Special<br />Placement', 'Logo', 'Image', 'Text', 'Contact<br />Info', 'Everthing<br />In', 'Category', 'Status'],             colModel: [                 { name: 'Id', index: 'Id', hidden: true, hidedlg: true },                 { name: 'AccountName', index: 'AccountName', align: "left", resizable: true, search: true, width: 100 },                 { name: 'OnlineName', index: 'OnlineName', align: 'left', sortable: false, width: 80 },                 { name: 'ListingCategoryName', index: 'ListingCategoryName', width: 85, editable: true, hidden: false, edittype: "select", editoptions: { multiple: false, value: eval('(' + catList + ')') }, editrules: { required: false }, formatoptions: { disabled: false} }             ],             jsonReader: {                 root: "List",                 page: "CurrentPage",                 total: "TotalPages",                 records: "TotalRecords",                 userdata: "Errors",                 repeatitems: false,                 id: "0"             },             rowNum: $rows,             rowList: [10, 20, 50, 200, 500, 1000, 2000],             imgpath: jQueryImageRoot,             pager: $(item + 'Pager'),             shrinkToFit: true,             width: 1455,             recordtext: 'Traffic lines',             sortname: 'OrderDate',             viewrecords: true,             sortorder: "asc",             altRows: true,             cellEdit: true,             cellsubmit: "remote",             cellurl: editURL + '?rows=' + $rows + '&page=1',             loadComplete: function() {               },             gridComplete: function() {             },             loadError: function(xhr, st, err) {             },             afterEditCell: function(rowid, cellname, value, iRow, iCol) {                 var select = $(item).find('td.edit-cell select');                 $(item).find('td.edit-cell select option').each(function() {                     var option = $(this);                     var optionId = $(this).val();                     $(lookupData.ListingCategory).each(function() {                         if (this.Id == optionId) {                                                       if (this.OnlineName != $(item).getCell(rowid, 'OnlineName')) {                                 option.remove();                                 return false;                             }                         }                     });                 });             },             search: true,             searchdata: {},             caption: "List of all Traffic lines",             editurl: editURL + '?rows=' + $rows + '&page=1',             hiddengrid: hideGrid   Here is the JSON data returned via the ajax call during the jqGrid function call above (NOTE it must be { async: false}: {"ListingCategory":[{"Id":29,"Name":"Document Imaging & Management","OnlineName":"RF Globalnet"} ,{"Id":1,"Name":"Ancillary Department Hardware","OnlineName":"Healthcare Technology Online"} ,{"Id":2,"Name":"Asset Tracking","OnlineName":"Healthcare Technology Online"} ,{"Id":3,"Name":"Asset Tracking","OnlineName":"Healthcare Technology Online"} ,{"Id":4,"Name":"Asset Tracking","OnlineName":"Healthcare Technology Online"} ,{"Id":5,"Name":"Document Imaging & Management","OnlineName":"Healthcare Technology Online"} ,{"Id":6,"Name":"Document Imaging & Management","OnlineName":"Healthcare Technology Online"} ,{"Id":7,"Name":"EMR/EHR Software","OnlineName":"Healthcare Technology Online"}]} I only need the Id and Name for the drop down list, but the third column in the JSON object is important, it is the only that I match up with the OnlineName in the jqGrid column, and then in the loop during afterEditCell simply remove the ones I don't want the user to see. That's it!

    Read the article

  • Stylecop 4.5.20.0 is available

    - by TATWORTH
    Stylecop 4.5.20.0 is available is available at http://stylecop.codeplex.com/releases/view/62209 This is the StyleCop 4.5 RC8. "This release includes the very latest StyleCop for ReSharper plugin and will automatically uninstall previous versions of StyleCop. This updated release contains around 200 bug fixes since the 4.4 RTW release and includes 5 new rules. Support for the async CTP is also added. SA1125 - UseShorthandForNullableTypes SA1411 - AttributeConstructorMustNotUseUnnecessaryParenthesis SA1517 - CodeMustNotContainBlankLinesAtStartOfFile SA1518 - CodeMustNotContainBlankLinesAtEndOfFile SA1649 - FileHeaderFileNameDocumentationMustMatchTypeName" StyleCop / Resharper 5.0 integration continues to improve. If you have not yet used them in your C# development, I urge you to try them out. I have found StyleCop 4.5 RC8 (and its RC predecessors) to be stable. Making changes to the code to make it style cop compliant is now very much easier. Can't code withoutThe best C# & VB.NET refactoring plugin for Visual Studio

    Read the article

  • Tack anchor link with Google Analytics

    - by Fredrik
    I have searched for how to track anchor links in analytics, but couldn't get it working. I have this code in the header: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('_setAllowAnchor', true); ga('create', 'UA-*******-1', '****.com'); ga('send', 'pageview'); </script> And my links looks like this: <a href='#/contact'><span>Contact</span></a> I also tried to use this links: <a href='#/contact' onClick="_gaq.push(['_trackPageview', location.pathname+location.search+location.hash]);"><span>Contact</span></a> Is there any tips on what I can do?

    Read the article

  • Mounting NFS directory causes creating Zero byte files

    - by Alaa
    I have two Servers, Server X (IP 192.168.1.1) and Server Y (IP 192.168.1.2), both of them are ubuntu 9.1 i have created varnish load balancer on them for my drupal website (pressflow 6.22) I have mounted a directory of imagecache from server X to Y as below @X:/etc/exports == /var/www/proj/htdocs/sites/default/files/images 192.168.1.2(rw,async,no_subtree_check) @Y:/etc/fstab == 192.168.1.1:/var/www/proj/htdocs/sites/default/files/images var/www/proj/htdocs/sites/default/files/images nfs defaults 0 0 also i made this on server X X:/var/www/proj/htdocs/sites/default/files$ chmod -R 777 images i tried to touch, rm, vim, and cat files in images directory that has been mounted on Y and everything went fine. now, ALWAYS when server Y's imagecache tries to create an image in images directory, the image is created with ZERO byte file size. anyone face the same before? any idea of how to fix this problem or what might cause it? Thanks for your help

    Read the article

  • Fixed Sized Buffer or Variable Buffers with C# Sockets

    - by Keagan Ladds
    I am busy designing a TCP Server class in C# that has events and allows the user of the class to define packets that the server can send a receive by registering a class that is derived from my "GenericPacket" class. My TCPListener uses Async methods such as .BeginReceive(..); My issue is that because I am using the .BeginReceive(); I need to specify a buffer size when I call the function. This means I cant read the whole packet if one of my defined packets is too big. I have thought of creating a fixed sized Header that gets read using .BeginRead(); and the read the rest using Stream.Read(); but this will lead to the whole server having to wait for this operation to complete. I would like to know if anyone has come across this before and I would appreciate any suggestions.

    Read the article

  • Why is 'libgnomevfs' files under /usr/include/gnome-vfs-2.0?

    - by George Edison
    Most applications, including the gnomevfs headers themselves, expect the files to be under /usr/include/libgnomevfs, but Ubuntu has them under /usr/include/gnome-vfs-2.0/libgnomevfs. Why? The package I'm referring to is called libgnomevfs2. Inside /usr/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs.h` we find: #include <libgnomevfs/gnome-vfs-acl.h> #include <libgnomevfs/gnome-vfs-address.h> #include <libgnomevfs/gnome-vfs-async-ops.h> #include <libgnomevfs/gnome-vfs-cancellation.h> ... Meaning that even the headers themselves expect the files to be in that location - and nothing that includes this file will work. Am I missing something, or is this a glitch?

    Read the article

  • Stop Google Analytics from appending hostname?

    - by Nick Q.
    I've come across an Analytics profile that is appending the rest of a URL to the end of a page's path. For example when looking at the page that exists at http://example.com/page I would expect to see /page but instead it shows me /page/http://example.com/. The profile has no filters applied to it, and until July was reporting as expected (/page), in July the site in question switched hosts (and absolutely nothing else, so I'm not sure that's the problem). The analytics code on the site is the standard Google Async code with a domain set. All other profiles for the site show /page as expected. Any ideas as to how I can get the profile to function as expected?

    Read the article

  • Wordpress Multisite (Subfolders) - Google Analytics Tracking

    - by mmundiff
    I have a Wordpress multisite subfolder instance that I would like to track via Google Analytics. I guess optimally this would be a plugin which I could track each site in two places The Main Tracking Code which totals all traffic from the Multisite instance The Individual Site tracking code to see how each site specifically is doing. I think this plugin would have worked for me if I had a subdomain multisite instance: http://wordpress.org/extend/plugins/google-analytics-multisite-async/installation/ I know I can manually place the dual tracking code (http://www.markinns.com/articles/full/adding_two_google_analytics_accounts_to_one_page) but that would involve editing a theme and I have multiple sites using TwentyEleven template. I don't think I can edit the theme and not have it wreak havoc on the rest of the sites using TwentyEleven. So has anyone done this? Is there a a technique I'm missing? Is there a plugin available to do this in Multisite Subfolder installations? Is there a way to manually insert GA codes into themes which are used by multiple sites? Any insight is appreciated.

    Read the article

  • Metro-style / iPhone apps development too demanding for newbie developers? [closed]

    - by linquize
    Both Metro-style and iPhone app require approval and publishing to app store. And they focus most on user interface and the quality of the software. Developers must deal with technical aspects, such as async programming (no UI blocking), no console program (must design a UI that cope with "Standard"), no CPU hungry (pause app if deactivated), need to study the permission matrix (not full access right), and more ... A newbie is not familiar with threading and synchronization. Do you thick they are too demanding for newbie developers? Can you give more examples how demanding it is?

    Read the article

  • Would I benefit changing from PHP to Node.js (in context)

    - by danneth
    The situation: We are about to roll out what is essentially a logging service. As we are rather PHP heavy, the current implementation use it. We will have about 200 computers (most on the same network) that will each send, via HTTP POST, around 5000 requests/day. With each request containing about 300 bytes of data. The receiving end is hosted at Amazon and is a very simple PHP form with some simple validation that puts everything in a database. Now, I've recently been introduced to Node.js and I'm curious as to if it would be a good fit for the backend here. Granted I could easily build something to test this. But since I haven't fully grasped the async-methology I would really like someone with experience to explain it to me.

    Read the article

  • How to create a Request Specific Thread Safe Static int Counter?

    - by user960567
    In one of my server application I have a class that look like, class A { static int _value = 0; void DoSomething() { // a request start here _value = 0; _value++; // a request end here } // This method can be called many time during request void SomeAsyncMethods() { _value++; } } The problem is SomeAsyncMethods is async. Can be called many times. What I need when a request start set _value = 0 and then asynchrosnously increment this. After end of request I need the total. But the problem is that another request at the same time can access the class.

    Read the article

  • Demographics and Interests reports

    - by Dyf
    I have an issue with Google Analytics, can't seem to find a guide how to activate Demographics and Interests reports. I am using the new version of analytics (Universal Analytics) and the script code looks something like this: (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); But the guide i found on googles page (https://support.google.com/analytics/answer/2819948?hl=sv) is for the old version (Classis Analytics). Anyone know how i can activate this on Universal Analytics or is this even possible? Thanks!

    Read the article

  • Google analytics shows wrong number of page views, asp.net website

    - by f_karlsson
    Sometimes it can be for example 4500 requests, after a few hours it shows a few thousand less. What is wrong? It looks like analytics corrects itself. I changed from classic to Universal a few months ago, do not know if it has anything to do with this. In masterpage: <script> (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'UA-xxxxxxxx-1', 'xxxxx.se'); ga('send', 'pageview'); </script>

    Read the article

  • Demographics and interests reports in Google universal analytics

    - by Dyf
    I have an issue with Google Analytics, can't seem to find a guide how to activate Demographics and Interests reports. I am using the new version of analytics (Universal Analytics) and the script code looks something like this: (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); But the guide I found on google's page is for the old version (Classis Analytics). Does anyone know how I can activate this on Universal Analytics? Is this even possible?

    Read the article

  • C# WPF to Embedded programming transition

    - by Cheltoonjr
    I've been learning C# .NET Framework for around 4-6 months (still starting) using some books, and have currently made my way up to Collections and Generics. I'll probably spend the next two months covering the rest up to LINQ and/or Garbage Collections. The thing is, I started to get interested in embedded systems and found out that you can use C# to code it through .NET MF, which mean I wouldn't have to learn C or C++. So, I would like to know if the knowledge I'll have by that time (2 months) will be enough to start working on Embedded (using C# .NET Micro Framework and Netduino) or I should probably see more about plain C# like Multithreading, async and other advanced features ? I want use embedded just as a hobby, at least by now, as I'll still have a long way through university. Although, I'll probably pick it as a career then. Thanks in advance!

    Read the article

  • jQuery - growlUI and ASP Update Panel Postback Problem

    - by leaf dev
    I am using the jQuery blockUI plugin's growlUI to display a return status message to the user when returning from an async postback from an update panel. What happens is after returning and displaying the growl notification, any further postbacks seem to be broken and the app just spins. I am using the ScriptManager.RegisterClientScriptBlock method to register the script. and calling the growl UI method in javascript with $.growlUI('Notification', 'Message'); There are no javascript errors being displayed.

    Read the article

  • How to use HttpContext.Current on asynchronous threads?

    - by Eran Betzalel
    I've a schedule tasks mechanism (very similar to DotNetNuke's) in my business logic library (a DLL that is used by ASP.Net website). When I use HttpContext.Current inside on of these tasks, it returns with a null value, because the current async thread (or task) was not initiated from a user's request. How can I use HttpContext.Current in these asynchronous threads? P.S - I think my question is more best-practices related than technical.

    Read the article

  • WebKit "Refused to set unsafe header "content-length"

    - by Paul
    I am trying to implement simple xhr abstraction, and am getting this warning when trying to set the headers for a POST. I think it might have something to do with setting the headers in a separate js file, because when i set them in the <script> tag in the .html file, it worked fine. The POST request is working fine, but I get this warning, and am curious why. I get this warning for both content-length and connection headers, but only in WebKit browsers (Chrome 5 beta and Safari 4). In Firefox, I don't get any warnings, the Content-Length header is set to the correct value, but the Connection is set to keep-alive instead of close, which makes me think that it is also ignoring my setRequestHeader calls and generating it's own. I have not tried this code in IE. Here is the markup & code: test.html: <!DOCTYPE html> <html> <head> <script src="jsfile.js"></script> <script> var request = new Xhr('POST', 'script.php', true, 'data=somedata', function(data) { console.log(data.text); }); </script> </head> <body> </body> </html> jsfile.js: function Xhr(method, url, async, data, callback) { var x; if(window.XMLHttpRequest) { x = new XMLHttpRequest(); x.open(method, url, async); x.onreadystatechange = function() { if(x.readyState === 4) { if(x.status === 200) { var data = { text: x.responseText, xml: x.responseXML }; callback.call(this, data); } } } if(method.toLowerCase() === "post") { x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); x.setRequestHeader("Content-Length", data.length); x.setRequestHeader("Connection", "close"); } x.send(data); } else { // ... implement IE code here ... } return x; }

    Read the article

  • Asyncronus javascript rendering widgets

    - by Joe J
    Hey all, I'm creating a javascript widget so third partys (web designers) can post a link on their website and it will render the widget on their site. Currently, I'm doing this with just a script link tag: <div class="some_random_div_in_html_body"> <script type='text/javascript' src='http://remotehost.com/link/to/widget.js'></script> </div> However, this has the side-effect of slowing down a thrid party's website render times of the page if my site is under a load. Therefore, I'd like the third party website to request the widget link from my site asyncronously and then render it on their site when the widget link loads completely. The Google Analytics javascript snippet seems to have a nice bit of asyncronous code that does a nice async request to model off of, but I'm wondering if I can modify it so that it will render content on the third party's site. Using the example below, I want the content of http://mysite.com/link/to/widget.js to render something in the "message" id field. <HTML> <HEAD><TITLE>Third Party Site</TITLE><STYLE>#message { background-color: #eee; } </STYLE></HEAD> <BODY> <div id="message">asdf</div> <script type="text/javascript"> (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = 'http://mysite.com/link/to/widget.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </BODY> </HTML> I don't know if what I'm trying to do constitutes Cross Site Scripting (still a bit vague on that concept) but am wondering if what I'm trying to do is possible. Or if anyone has any other approaches to creating javascript widgets effectively, I'd appreciate any advice. Thanks for reading this. Joe

    Read the article

  • Android Gallery View Update Images

    - by xger86x
    Hi, i have a question about using GalleryView. At first, i set five "default images" to show from drawable directory. But after, i want to run an Async Task in which i download the images, save them and show them in the gallery. For that i created the following Adapter: public class ImageAdapter extends BaseAdapter { int mGalleryItemBackground; private Context mContext; private ArrayList<Integer> mImageIds = new ArrayList<Integer>(); private ArrayList<Drawable> mImageDrawables = new ArrayList<Drawable>(); public ImageAdapter(Context c) { mContext = c; TypedArray a = obtainStyledAttributes(R.styleable.Gallery1); mGalleryItemBackground = a.getResourceId( R.styleable.Gallery1_android_galleryItemBackground, 0); a.recycle(); } public void setPlaces(int count) { for (int i = 0; i < count; i++) { mImageIds.add(R.drawable.tournoimg); mImageDrawables.add(null); } } public void setDrawable(String resource, int position) { Drawable image = Drawable.createFromPath(resource); mImageDrawables.add(position, image); } public int getCount() { return mImageIds.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { ImageView i = new ImageView(mContext); if (mImageDrawables.get(position) == null) i.setImageResource(mImageIds.get(position)); else i.setImageDrawable(mImageDrawables.get(position)); i.setLayoutParams(new Gallery.LayoutParams(60, 78)); i.setScaleType(ImageView.ScaleType.FIT_XY); i.setBackgroundResource(mGalleryItemBackground); return i; } } } and the following Async Task private class FillImages extends AsyncTask<ArrayList<Place>, Void, Void> { protected Void doInBackground(ArrayList<Place>... listplaces) { ArrayList<Place> places = listplaces[0]; Iterator<Place> it = places.iterator(); int position = 0; while (it.hasNext()) { Place p = it.next(); saveImage(p.getImage(), p.getURLImage()); // Gallery g = (Gallery) findViewById(R.id.gallery); mImageAdapter.setDrawable(p.getImage(), position); position++; mImageAdapter.notifyDataSetChanged(); } return (null); } But when i run it i have this error: Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Any idea? Thanks

    Read the article

  • error handling with NSURLConnection sendSynchronousRequest

    - by Nnp
    how can i do better error handling with NSURLConnection sendSynchronousRequest? is there any way i can implement - (void)connection:(NSURLConnection *)aConn didFailWithError:(NSError *)error i have a nsoperation queue which is getting data in background thats why i have sync request. and if i have to implement async request then how can i wait for request to get complete. because that method can't proceed without data.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >