Search Results

Search found 9520 results on 381 pages for 'progress bar'.

Page 44/381 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • How do I update a progress bar in Cocoa during a long running loop?

    - by Nic
    Hi, I've got a while loop, that runs for many seconds and that's why I want to update a progress bar (NSProgressIndicator) during that process, but it updates only once after the loop has finished. The same happens if I want to update a label text, by the way. I believe, my loop prevents other things of that application to happen. There must be another technique. Does this have to do with threads or something? Am I on the right track? Can someone please give me a simple example, how to “optimize” my application? My application is a Cocoa Application (Xcode 3.2.1) with these two methods in my Example_AppDelegate.m: // This method runs when a start button is clicked. - (IBAction)startIt:(id)sender { [progressbar setDoubleValue:0.0]; [progressbar startAnimation:sender]; running = YES; // this is a instance variable int i = 0; while (running) { if (i++ = processAmount) { // processAmount is something like 1000000 running = NO; continue; } // Update progress bar double progr = (double)i / (double)processAmount; NSLog(@"progr: %f", progr); // Logs values between 0.0 and 1.0 [progressbar setDoubleValue:progr]; [progressbar needsDisplay]; // Do I need this? // Do some more hard work here... } } // This method runs when a stop button is clicked, but as long // as -startIt is busy, a click on the stop button does nothing. - (IBAction)stopIt:(id)sender { NSLog(@"Stop it!"); running = NO; [progressbar stopAnimation:sender]; } I'm really new to Objective-C, Cocoa and applications with a UI. Thank you very much for any helpful answer.

    Read the article

  • Why can I not get a WDS-originated PXE boot to progress past the first file download?

    - by Jeff Shattock
    I'm trying to work out an automated Windows install process, and thought I'd give WDS a look. After some promising initial progress, I seem to have hit a wall. I imported the boot and install WIMs, and created the capture WIM successfully. However, whenever I try to PXE boot the reference machine against the WDS server, it kinda craps out. It finds the server and downloads WDSNBP.COM successfully, and then gives the message "TFTP download failed." According to WireShark, the only communication between the WDS box and the client box is the successful TFTP request and download of boot\x86\WDSNBP.COM. No further requests are sent. The WDS log on the server shows the same thing, one successful download and no more activity. I've tried every combination of the following, with exactly zero change in behaviour: Win Server 2008R2 vs 2012 vs 2012R2 WDS virtualized on KVM, ESXi, VirtualBox, VMWare Workstation Client virtualized on KVM, ESXi, VirtualBox, VMWare Workstation Every network adaptor type offered by the virtualization platforms. "Actual" network vs isolated, virtual network. MS DHCP server vs Linux isc-dhcp-server Joined to a domain vs Stand-alone I tried changing the boot filename in DHCP to pxeboot.com instead, and it has no problem downloading that file instead, but it then crabs about Boot\BCD being corrupted. Also, with 2012, it doesnt appear that WDSNBP.com does the architecture detection, or at least does'nt report that it did. 2008 reports that it found x64, and then errors. I find myself out of things to check, and I dont see anything immediately wrong. Where do I go from here? WDS server is at 192.168.1.50, DHCP/DNS at 192.168.1.7. Console of the client computer after the boot: MAC: 52:54:00:28:94:0E UUID: blah blah Searching for server (DHCP)..... Me: 192.168.1.155, DHCP: 192.168.1.7, Gateway 192.168.1.1 Loading 192.168.1.50:boot\x86\wdsnbp.com ...(PXE).................done Downloaded WDSNCP... TFPT download failed Interesting parts of /etc/dhcp/dhcpd.conf on the Linux DHCP server: allow booting; allow bootp; option option-60 code 60 = string; option option-66 code 66 = string; option option-67 code 67 = string; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.110 192.168.1.253; next-server 192.168.1.50; option tftp-server-name "192.168.1.50"; option option-60 "PXEClient"; filename "boot\\x86\\wdsnbp.com"; option bootfile-name "boot\\x86\\wdsnbp.com"; }

    Read the article

  • Bottom button bar overlaps the last element of Listview!!

    - by elto
    I have a listview which is part of an Activity. I want user to have a choice for batch deleting the items in the listview, so when he chooses the corresponding option from the menu, every list item gets a checkbox next to it. When user clicks any checkbox, a button bar is to slide up from bottom (as in gmail app) and clicking delete button deletes the selected items, however clicking cancel button on the bar would uncheck all the checked items. This is my page layout.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" > <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:id="@+id/list_area" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" > <ListView android:id="@+id/mylist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:drawSelectorOnTop="false" android:layout_weight="1" /> <TextView android:id="@+id/empty_list_message" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:layout_gravity="center_vertical|center_horizontal" android:text="@string/msg_for_emptyschd" android:layout_margin="14dip" android:layout_weight="1" /> </LinearLayout> <RelativeLayout android:id="@+id/bottom_action_bar" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/schedule_bottom_actionbar_border" android:layout_marginBottom="2dip" android:layout_gravity="bottom" android:visibility="gone" > <Button android:id="@+id/delete_selecteditems_button" android:text="Deleted Selected" android:layout_width="140dip" android:layout_height="40dip" android:layout_alignParentLeft="true" android:layout_marginLeft="3dip" android:layout_marginTop="3dip" /> <Button android:id="@+id/cancel_button" android:text="Cancel" android:layout_width="140dip" android:layout_height="40dip" android:layout_alignParentRight="true" android:layout_marginRight="3dip" android:layout_marginTop="3dip" /> </RelativeLayout> </FrameLayout> </LinearLayout> so far, I have got everything working except that when the bottom bar becomes visible upon checkbox selection, it overlaps the last element of the list. All other list items can be scrolled up, but you cant scroll up the very last item of the list, therefore user can not select that item if he intends to. Here is the screenshot of the overlap. I have tried using the listview footer option, but that appends the bar to the end of the list instead of keeping it fixed at the bottom of the screen. Is there a way I could "raise" the listview enough so that the overlap wont happen?? BTW, I have already tried adding the bottom-margin to the listview itself, or the LinearLayout wrapping the listview right before making the button-bar visible, but it introduces other bugs like clicking one checkbox checks some another checkbox in listview.

    Read the article

  • SBT run differences between scala and java?

    - by Eric Cartner
    I'm trying to follow the log4j2 configuration tutorials in a SBT 0.12.1 project. Here is my build.sbt: name := "Logging Test" version := "0.0" scalaVersion := "2.9.2" libraryDependencies ++= Seq( "org.apache.logging.log4j" % "log4j-api" % "2.0-beta3", "org.apache.logging.log4j" % "log4j-core" % "2.0-beta3" ) When I run the main() defined in src/main/scala/logtest/Foo.scala: package logtest import org.apache.logging.log4j.{Logger, LogManager} object Foo { private val logger = LogManager.getLogger(getClass()) def main(args: Array[String]) { logger.trace("Entering application.") val bar = new Bar() if (!bar.doIt()) logger.error("Didn't do it.") logger.trace("Exiting application.") } } I get the output I was expecting given that src/main/resources/log4j2.xml sets the root logging level to trace: [info] Running logtest.Foo 08:39:55.627 [run-main] TRACE logtest.Foo$ - Entering application. 08:39:55.630 [run-main] TRACE logtest.Bar - entry 08:39:55.630 [run-main] ERROR logtest.Bar - Did it again! 08:39:55.630 [run-main] TRACE logtest.Bar - exit with (false) 08:39:55.630 [run-main] ERROR logtest.Foo$ - Didn't do it. 08:39:55.630 [run-main] TRACE logtest.Foo$ - Exiting application. However, when I run the main() defined in src/main/java/logtest/LoggerTest.java: package logtest; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; public class LoggerTest { private static Logger logger = LogManager.getLogger(LoggerTest.class.getName()); public static void main(String[] args) { logger.trace("Entering application."); Bar bar = new Bar(); if (!bar.doIt()) logger.error("Didn't do it."); logger.trace("Exiting application."); } } I get the output: [info] Running logtest.LoggerTest ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger ERROR Bar Did it again! ERROR LoggerTest Didn't do it. From what I can tell, ERROR StatusLogger Unable to ... is usually a sign that log4j-core is not on my classpath. The lack of TRACE messages seems to indicate that my log4j2.xml settings aren't on the classpath either. Why should there be any difference in classpath if I'm running Foo.main versus LoggerTest.main? Or is there something else causing this behavior? Update I used SBT Assembly to build a fat jar of this project and specified logtest.LoggerTest to be the main class. Running it from the command line produced correct results: Eric-Cartners-iMac:target ecartner$ java -jar "Logging Test-assembly-0.0.jar" 10:52:23.220 [main] TRACE logtest.LoggerTest - Entering application. 10:52:23.221 [main] TRACE logtest.Bar - entry 10:52:23.221 [main] ERROR logtest.Bar - Did it again! 10:52:23.221 [main] TRACE logtest.Bar - exit with (false) 10:52:23.221 [main] ERROR logtest.LoggerTest - Didn't do it. 10:52:23.221 [main] TRACE logtest.LoggerTest - Exiting application.

    Read the article

  • View Loading Problem

    - by riteshkumar1905
    Hello, I am using some xib without tab bar and some with tab bar. In starting i load the xib without tab bar-navigation bar then flow are working.But if i load a xib with tab bar-navigation bar then our all view slide bellow and half tab bar are not showing.Please anybody help me as soon as possible. Pleaseeee!!!!!!

    Read the article

  • Python function argument scope (Dictionaries v. Strings)

    - by Shaun Meyer
    Hello, given: foo = "foo" def bar(foo): foo = "bar" bar(foo) print foo # foo is still "foo"... foo = {'foo':"foo"} def bar(foo): foo['foo'] = "bar" bar(foo) print foo['foo'] # foo['foo'] is now "bar"? I have a function that has been inadvertently over-writing my function parameters when I pass a dictionary. Is there a clean way to declare my parameters as constant or am I stuck making a copy of the dictionary within the function? Thanks!

    Read the article

  • Are the following data type allocations analagous?

    - by byte
    I'm very interested in languages and their underpinnings, and I'd like to pose this question to the community. Are the following analagous to eachother in these languages? C# Foo bar = default(Foo); //alloc bar = new Foo(); //init VB.NET Dim bar As Foo = Nothing 'alloc bar = New Foo() 'init Objective-C Foo* bar = [Foo alloc]; //alloc bar = [bar init]; //init

    Read the article

  • Tab bar application with UINavigation Controller MOC not being retained.

    - by iamsmug
    I created a tab bar application from the template and added a navigation controller to one of the tabs. I have already created this app from the navigation app template already and is working. The reason I am doing it this way is because I need to add a tab bar and thought it would be easier starting by using the tab bar project template and adding the nav controller to it rather than the other way round. I have copied the data model over from the other project and added the relevant code to where it should be. The problem I am having is passing the moc from the app delegate to the tab with the nav controller on. Here is a snippet from my applicationDidFinishLaunching method in my app delegate: - (void)applicationDidFinishLaunching:(UIApplication *)application { [self createEditableCopyOfDatabaseIfNeeded]; Top_BananaTableViewController *top_BananaTableViewController = (Top_BananaTableViewController *)[navigationController topViewController]; top_BananaTableViewController.managedObjectContext = self.managedObjectContext; // Add the tab bar controller's current view as a subview of the window [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; } Everything seems fine here but when it comes to the fetchedResultsController on my nav controller view it bombs out with: '+entityForName: could not locate an NSManagedObjectModel for entity name 'cards'' When I checked what was set to my managedObjectContext on that view it was null. I don't know why or where it is loosing it's setting. Please help.

    Read the article

  • How Do I Disable URL Pre-Pending in the FireFox 3 Title Bar When Opeing A New Window With JavaScript

    - by N Rahl
    For (understandable) security reasons, Firefox does not allow JavaScript to open a new window without the address/location bar AND without pre-pending the page's URL to the title in the title bar. For example, when you set: <title>My Site</title> in the header, and open the page using location=no FireFox changes the header to read: http://www.mysite.com - My Site - Mozilla Firefox. I would like it to simply say: My Site Everything I've read suggests this behaviour can't be altered with scripting, and as such, this is not a scripting question. What I would like to know is, which setting(s) can I change in the browser itself to disable URL pre-pending to the title of new windows? This is for a company Intranet, and I control all of the computers/browsers that connect to the application.

    Read the article

  • How to access variables in an erb-subtemplate in puppet?

    - by c33s
    example.pp $foo = 'bar' $content = template('mymodule/maintemplate.erb') maintemplate.erb <% bar = foo + "extra" %> foobar = scope_function_template(['mymodule/subtemplate.erb']) subtemplate.erb <%# here i want to access the variable bar %> <%= bar %> there is the function <%= scope.lookupvar('::bar') %> is there a kind of parent::bar in erb templateing, or can i pass some variables to the subtemplate, or can i only access the outer variable (of the .pp file) with ::foo

    Read the article

  • In Ubuntu, my apps no longer have the system menu bar (not the panels!)

    - by user25522
    So, I booted up my box today after the weekend, and my apps no longer have the System Menu Bar at the top. It kinda sucks 'cause that's an easy way to maximize windows. How do I get it back? And I'm not talking about the panels at the top/bottom of the screen. This is what my terminal looks like. It's really missing the bar at the top. I have no rep so can't post pics, but here's a link to the image

    Read the article

  • wpf window refresh works at first, then stops

    - by mcl
    I've got a routine that grabs a list of all images in a directory, then runs an MD5 digest on all of them. Since this takes a while to do, I pop up a window with a progress bar. The progress bar is updated by a lambda that I pass in to the long-running routine. The first problem was that the progress window was never updated (which is normal in WPF I guess). Since WPF lacks a Refresh() command I fixed this with a call to Dispatcher.Invoke(). Now the progress bar is updated for a while, then the window stops being updated. The long-running work does eventually finish and the windows go back to normal. I have already tried a BackgroundWorker and quickly became frustrated by a threading issue related to an event triggered by the long-running process. So if that's really the best solution and I just need to learn the paradigm better, please say so. But I'd be really much happier with the approach I've got here, except that it stops updating after a bit (for example, in a folder with 1000 files, it might update for 50-100 files, then "hang"). The UI does not need to be responsive during this activity, except to report on progress. Anyway, here's the code. First the progress window itself: public partial class ProgressWindow : Window { public ProgressWindow(string title, string supertext, string subtext) { InitializeComponent(); this.Title = title; this.SuperText.Text = supertext; this.SubText.Text = subtext; } internal void UpdateProgress(int count, int total) { this.ProgressBar.Maximum = Convert.ToDouble(total); this.ProgressBar.Value = Convert.ToDouble(count); this.SubText.Text = String.Format("{0} of {1} finished", count, total); this.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate); } private static Action EmptyDelegate = delegate() { }; } <Window x:Class="Pixort.ProgressWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Pixort Progress" Height="128" Width="256" WindowStartupLocation="CenterOwner" WindowStyle="SingleBorderWindow" ResizeMode="NoResize"> <DockPanel> <TextBlock DockPanel.Dock="Top" x:Name="SuperText" TextAlignment="Left" Padding="6"></TextBlock> <TextBlock DockPanel.Dock="Bottom" x:Name="SubText" TextAlignment="Right" Padding="6"></TextBlock> <ProgressBar x:Name="ProgressBar" Height="24" Margin="6"/> </DockPanel> </Window> The long running method (in Gallery.cs): public void ImportFolder(string folderPath, Action<int, int> progressUpdate) { string[] files = this.FileIO.GetFiles(folderPath); for (int i = 0; i < files.Length; i++) { // do stuff with the file if (null != progressUpdate) { progressUpdate.Invoke(i + 1, files.Length); } } } Which is called thusly: ProgressWindow progress = new ProgressWindow("Import Folder Progress", String.Format("Importing {0}", folder), String.Empty); progress.Show(); this.Gallery.ImportFolder(folder, ((c, t) => progress.UpdateProgress(c, t))); progress.Close();

    Read the article

  • Template syntax for users - is there a right way to do it?

    - by RickM
    Ok, I'm in the middle of building a saas system, and as part of that, the hosted clients need to be able to edit certain layout templates, baqsically just html, css and javascript files. I'm obviously going to be wanting to use a template syntax here as it would be dumb to let people execute PHP code, so in this instance template syntax does need to be used. I know that in the grand scale of things, this is a very minor thing, but what template syntax do you use, and why? Is there one that's considered better than others? I've seen all sorts being used with no real consistency, for example: Smarty Style: {$someVar} {foreach from="foo" item="bar"} {$bar.food} {/foreach} ASP Style: {% someVar %} {% foreach foo as bar %} {% bar.food %} {% endforeach %} HTML Style: <someVar> <foreach from="foo" item="bar"> <bar:food> </foreach> PyroCMS/FuelPHP "LEX" Style: {{ someVar }} {{ foreach from="foo" item="bar" }} {{ bar:food }} {{ endforeach }} Obviously these arent 100% accurate (for example, LEX is used alongside PHP for loops), and are only to give you an example of what I mean. What, in your opinion would be the best one (if any) to go with. I ask this bearing in mind that people using this are likely to be novice users. I did look around at a bunch of hosted CMS and E-Commerce systems as these seem to make use of user-editable templates, and most seem to be using some form of their own syntax. I should note that whatever style I end up going with, it will be with a custom template handler due to the complexity of the system and how template files are stored. Plus I'd not want to touch the likes of Smarty with a barge pole!

    Read the article

  • What OO Design to use ( is there a Design Pattern )?

    - by Blundell
    I have two objects that represent a 'Bar/Club' ( a place where you drink/socialise). In one scenario I need the bar name, address, distance, slogon In another scenario I need the bar name, address, website url, logo So I've got two objects representing the same thing but with different fields. I like to use immutable objects, so all the fields are set from the constructor. One option is to have two constructors and null the other fields i.e: class Bar { private final String name; private final Distance distance; private final Url url; public Bar(String name, Distance distance){ this.name = name; this.distance = distance; this.url = null; } public Bar(String name, Url url){ this.name = name; this.distance = null; this.url = url; } // getters } I don't like this as you would have to null check when you use the getters In my real example the first scenario has 3 fields and the second scenario has about 10, so it would be a real pain having two constructors, the amount of fields I would have to declare null and then when the object are in use you wouldn't know which Bar you where using and so what fields would be null and what wouldn't. What other options do I have? Two classes called BarPreview and Bar? Some type of inheritance / interface? Something else that is awesome?

    Read the article

  • UIWebView loading progress and adjust web page to fit the view page?

    - by user262325
    Hello everyone I am using UIWebView to load a web page. There are 2 questions: 1.It it possible to track the percentage progress when UIWebView is loading the page? 2.I know there is property scalesPageToFit scalesPageToFit A Boolean value determining whether the webpage scales to fit the view and the user can change the scale. I try to set it to YES, but it looks like that it is not in public API and my app stopped with black screen, I am not sure what is wrong? Welcome any comment Thanks interdev

    Read the article

  • How to download file into string with progress callback?

    - by Kaminari
    I would like to use the WebClient (or there is another better option?) but there is a problem. I understand that opening up the stream takes some time and this can not be avoided. However, reading it takes a strangely much more amount of time compared to read it entirely immediately. Is there a best way to do this? I mean two ways, to string and to file. Progress is my own delegate and it's working good. FIFTH UPDATE: Finally, I managed to do it. In the meantime I checked out some solutions what made me realize that the problem lies elsewhere. I've tested custom WebResponse and WebRequest objects, library libCURL.NET and even Sockets. The difference in time was gzip compression. Compressed stream lenght was simply half the normal stream lenght and thus download time was less than 3 seconds with the browser. I put some code if someone will want to know how i solved this: (some headers are not needed) public static string DownloadString(string URL) { WebClient client = new WebClient(); client.Headers["User-Agent"] = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1045 Safari/532.5"; client.Headers["Accept"] = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; client.Headers["Accept-Encoding"] = "gzip,deflate,sdch"; client.Headers["Accept-Charset"] = "ISO-8859-2,utf-8;q=0.7,*;q=0.3"; Stream inputStream = client.OpenRead(new Uri(URL)); MemoryStream memoryStream = new MemoryStream(); const int size = 32 * 4096; byte[] buffer = new byte[size]; if (client.ResponseHeaders["Content-Encoding"] == "gzip") { inputStream = new GZipStream(inputStream, CompressionMode.Decompress); } int count = 0; do { count = inputStream.Read(buffer, 0, size); if (count > 0) { memoryStream.Write(buffer, 0, count); } } while (count > 0); string result = Encoding.Default.GetString(memoryStream.ToArray()); memoryStream.Close(); inputStream.Close(); return result; } I think that asyncro functions will be almost the same. But i will simply use another thread to fire this function. I dont need percise progress indication.

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >