Search Results

Search found 1872 results on 75 pages for 'tom o'.

Page 33/75 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • python - tkinter - update label from variable

    - by Tom
    I wrote a python script that does some stuff to generate and then keep changing some text stored as a string variable. This works, and I can print the string each time it gets changed. Problems have arisen while trying to display that output in a GUI (just as a basic label) using tkinter. I can get the label to display the string for the first time... but it never updates. This is really the first time I have tried to use tkinter, so it's likely I'm making a foolish error. What I've got looks logical to me, but I'm evidently going wrong somewhere! from tkinter import * outputText = 'Ready' counter = int(0) root = Tk() root.maxsize(400, 400) var = StringVar() l = Label(root, textvariable=var, anchor=NW, justify=LEFT, wraplength=398) l.pack() var.set(outputText) while True: counter = counter + 1 #do some stuff that generates string as variable 'result' outputText = result #do some more stuff that generates new string as variable 'result' outputText = result #do some more stuff that generates new string as variable 'result' outputText = result if counter == 5: break root.mainloop() I also tried: from tkinter import * outputText = 'Ready' counter = int(0) root = Tk() root.maxsize(400, 400) var = StringVar() l = Label(root, textvariable=var, anchor=NW, justify=LEFT, wraplength=398) l.pack() var.set(outputText) while True: counter = counter + 1 #do some stuff that generates string as variable 'result' outputText = result var.set(outputText) #do some more stuff that generates new string as variable 'result' outputText = result var.set(outputText) #do some more stuff that generates new string as variable 'result' outputText = result var.set(outputText) if counter == 5: break root.mainloop() In both cases, the label will show 'Ready' but won't update to change that to the strings as they're generated later. After a fair bit of googling and looking through answers on this site, I thought the solution might be to use update_idletasks - I tried putting that in after each time the variable was changed, but it didn't help. It also seems possible I am meant to be using trace and callback somehow to make all this work...but I can't get my head around how that works (I tried, but didn't manage to make anything that even looked like it would do something, let alone actually worked). I'm still very new to both python and especially tkinter, so, any help much appreciated but please spell it out for me if you can :)

    Read the article

  • Palm Mojo: Object properties

    - by tom
    There was another question with an answer saying that you can use event.down.x to get the x-coordinate of a tap event. It also said that this was not well documented in the Palm Mojo SDK. My question is how can I find the properties that I can use for any given Mojo object?

    Read the article

  • Can I do video communication with silverlight 4.0?

    - by tom greene
    With silverlight 4.0, it is possible to show a live video of the user on the screen: Here is the code VideoBrush videoBrush = new VideoBrush(); CaptureSource captureSource = new CaptureSource { VideoCaptureDevice = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices().First() }; bool b = CaptureDeviceConfiguration.RequestDeviceAccess(); videoBrush.SetSource(captureSource); captureSource.Start(); myrect.Fill = videoBrush; However, I am looking at a way to show the video to someone else - seeing oneself on screen is not that interesting. Is it possible? Do I need my own server? Can I use clowd services to do the communication? Are there performance issues?

    Read the article

  • JQuery Find #ID, RemoveClass and AddClass

    - by Tom
    Hi Guys, I have the following HTML <div id="testID" class="test1"> <img id="testID2" class="test2" alt="" src="some-image.gif" /> </div> I basically want to get to #testID2 and replace .test2 class with .test3 class ? I tried jQuery('#testID2').find('.test2').replaceWith('.test3'); But this doesn't appear to work ? Any ideas ?

    Read the article

  • How do I pass data from a BroadcastReceiver through to an Activity being started?

    - by Tom Hume
    I've got an Android application which needs to be woken up sporadically throughout the day. To do this, I'm using the AlarmManager to set up a PendingIntent and have this trigger a BroadcastReceiver. This BroadcastReceiver then starts an Activity to bring the UI to the foreground. All of the above seems to work, in that the Activity launches itself correctly; but I'd like the BroadcastReceiver to notify the Activity that it was started by the alarm (as opposed to being started by the user). To do this I'm trying, from the onReceive() method of the BroadcastReceiver to set a variable in the extras bundle of the intent, thus: Intent i = new Intent(context, MyActivity.class); i.putExtra(wakeupKey, true); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); In the onResume() method of my Activity, I then look for the existence of this boolean variable: protected void onResume() { super.onResume(); String wakeupKey = "blah"; if (getIntent()!=null && getIntent().getExtras()!=null) Log.d("app", "onResume at " + System.currentTimeMillis() + ":" + getIntent().getExtras().getBoolean(wakeupKey)); else Log.d("app", "onResume at " + System.currentTimeMillis() + ": null"); } The getIntent().getExtras() call in onResume() always returns null - I don't seem to be able to pass any extras through at all in this bundle. If I use the same method to bind extras to the PendingIntent which triggers the BroadcastReceiver however, the extras come through just fine. Can anyone tell me what's different about passing a bundle from a BroadcastReceiver to an Activity, as opposed to passing the bundle from an Activity to a BroadcastReceiver? I fear I may be doing something very very obvious wrong here...

    Read the article

  • Where are Eclipse Bookmarks stored?

    - by Tom Tresansky
    Does anyone know where bookmarks are stored in the Eclipse IDE? I had to delete a Java project from my workspace, then use the Import Existing project option to reset some configuration settings, and now my bookmarks are gone. I'm trying to understand how this affected my bookmarks, since everything on the file system except for the Eclipse .project and .classpath files should have remained unchanged.

    Read the article

  • After Effects: Mac to PC

    - by Tom
    Is it possible to open an After Effects file that's been created on a Mac with PC? I don't know what version the AE was on the Mac side, but I want to oepn it with CS3 on a PC laptop.

    Read the article

  • Python regular expression implementation details

    - by Tom
    A question that I answered got me wondering: How are regular expressions implemented in Python? What sort of efficiency guarantees are there? Is the implementation "standard", or is it subject to change? I thought that regular expressions would be implemented as DFAs, and therefore were very efficient (requiring at most one scan of the input string). Laurence Gonsalves raised an interesting point that not all Python regular expressions are regular. (His example is r"(a+)b\1", which matches some number of a's, a b, and then the same number of a's as before). This clearly cannot be implemented with a DFA. So, to reiterate: what are the implementation details and guarantees of Python regular expressions? It would also be nice if someone could give some sort of explanation (in light of the implementation) as to why the regular expressions "cat|catdog" and "catdog|cat" lead to different search results in the string "catdog", as mentioned in the question that I referenced before.

    Read the article

  • Specific checkboxes checked in symfony 1.4

    - by Tom
    Hi, I'm able to do the following for all checkboxes in a set (in an action): $this->form->getWidget('some_form_field')->setAttribute('checked', 'checked'); ... but I'm unable to set specific checkboxes to ticked on the basis of data returned from the db. I'm after something like: $this->form->getWidget('some_form_field')->setAttributes(array(....)); ... where I can refer to the specific checkboxes to be ticked somehow, or pass an array to it. There's nothing in the symfony documentation on this specifically and I've had enough of trying a dozen combinations to get it work. Any help would be appreciated. Thanks.

    Read the article

  • Keyboard Input & the Win32 message loop

    - by Tom J Nowell
    How do I handle key presses and key up events in the windows message loop? I need to be able to call two functions OnKeyUp(char c); and OnKeyDown(char c);. Current literature I've found from googling has lead me to confusion over WM_CHAR or WM_KEYUP and WM_KEYDOWN, and is normally targeted at PDA or Managed code, whereas I'm using C++.

    Read the article

  • Wordpress and Anythingslider Navigation Thumbnails

    - by Tom
    So I am using AnythingSlider in Wordpress. This is why I am trying to call the thumbnails from the original posts. Anything slider will configure thumbnail navigation like this: function formatText(index, panel) { return index + ""; } $(function () { $('.anythingSlider').anythingSlider({ navigationFormatter: formatText // Details at the top of the file on this use (advanced use) }); }); As you can see, the navigationFormatter will allow me to format the nav (including thumbnails) however I want. For example, to format thumbnails, I could do this: navigationFormatter : function(i, panel){ // add thumbnails as navigation links return '<img src="images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i - 1] + '.jpg">'; } So my issue is getting the wordpress slide images to show up there dynamically, rather than in a folder (as the above example shows). For reference, this is my php query that is pulling the posts image (from a script I've already written: <img class="slider-img" style="float:left;" src="<?php if(function_exists('wp_get_post_image')){ echo wp_get_post_image(array( 'return_html' => false, 'width' => 500 )); } ?>" /> I hope this update helps. Thank you guys so much. The Stack overflow community is great!

    Read the article

  • ArcObjects - enumerating feature classes and datasets within a geodatabase

    - by Tom
    I'm trying to enumerate the contents (feature classes and feature datasets, not interested in tables, etc) of a file geodatabase using vba/arcobjects. I have the file GDB set as an IGxDatabase object, but can't find a way of getting further in. I've had a look at the geodatabase object model and tried using IFeatureClass and IFeatureDataset but neither seem to return useful results. Thanks in advance for any assistance

    Read the article

  • How to use visibilitychange event on Firefox Extensions

    - by Tom S.
    I'm trying to learn how to make a firefox extension. I want to create a toolbar that only shows up on a specific page. I can make the toolbar appear, but then it should become hidden when I open or switch to a new tab, or close the tab with that specific page. I don't understand how to make the visibilitychange event work though, no matter what I try nothing happens. window.addEventListener("load", function load(event){ window.removeEventListener("load", load, false); myExtension.init(); },false); var myExtension = { init: function (aEvent) { gBrowser.addEventListener("DOMContentLoaded", this.showToolbar, false); }, showToolbar: function(aEvent) { var doc = aEvent.originalTarget; if(doc.location.href=="http://www.google.ca/"){ eToolbar=document.getElementById("nav-toolbar"); eToolbar.hidden=false; //no matter how I change this line below it never does anything gBrowser.addEventListener("mozvisibilitychange", this.toggleToolbar, false); } }, toggleToolbar: function(aEvent) { eToolbar=document.getElementById("nav-toolbar"); if(document["mozVisibilityState"]=="mozHidden"){ eToolbar.hidden=true; } else { eToolbar.hidden=false; } } }

    Read the article

  • Mercurial outgoing Hook

    - by Tom Bell
    I'm looking to create a Mercurial hook that pushes to a backup remote repository when I push to a local repository. I thought I could hook the 'outgoing' hook, but this creates a infinite loop that isn't pretty. So is there like a post-push hook, or would it be best to have the repository I am pushing to have an 'incoming' hook to push the to the remote backup instead?

    Read the article

  • http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Document.html#getDoctype()

    - by Tom Brito
    The Document class have a getDoctype method but doesn't have a setDoctype. The documentation says: The DOM Level 2 does not support editing the Document Type Declaration. docType cannot be altered in any way, including through the use of methods inherited from the Node interface, such as insertNode or removeNode. and in my project I need to generate xml files with my specified doctypes. I've tryied to create my own DefaultNode, but it throws "DOMException: Method not supported" for the setters. Any idea?

    Read the article

  • What is the coolest thing you can do in <10 lines of simple code? Help me inspire beginners!

    - by Tom Ritter
    I'm looking for the coolest thing you can do in a few lines of simple code. I'm sure you can write a Mandelbrot set in Haskell in 15 lines but it's difficult to follow. My goal is to inspire students that programming is cool. We know that programming is cool because you can create anything you imagine - it's the ultimate creative outlet. I want to inspire these beginners and get them over as many early-learning humps as I can. Now, my reasons are selfish. I'm teaching an Intro to Computing course to a group of 60 half-engineering, half business majors; all freshmen. They are the students who came from underprivileged High schools. From my past experience, the group is generally split as follows: a few rock-stars, some who try very hard and kind of get it, the few who try very hard and barely get it, and the few who don't care. I want to reach as many of these groups as effectively as I can. Here's an example of how I'd use a computer program to teach: Here's an example of what I'm looking for: a 1-line VBS script to get your computer to talk to you: CreateObject("sapi.spvoice").Speak InputBox("Enter your text","Talk it") I could use this to demonstrate order of operations. I'd show the code, let them play with it, then explain that There's a lot going on in that line, but the computer can make sense of it, because it knows the rules. Then I'd show them something like this: 4(5*5) / 10 + 9(.25 + .75) And you can see that first I need to do is (5*5). Then I can multiply for 4. And now I've created the Object. Dividing by 10 is the same as calling Speak - I can't Speak before I have an object, and I can't divide before I have 100. Then on the other side I first create an InputBox with some instructions for how to display it. When I hit enter on the input box it evaluates or "returns" whatever I entered. (Hint: 'oooooo' makes a funny sound) So when I say Speak, the right side is what to Speak. And I get that from the InputBox. So when you do several things on a line, like: x = 14 + y; You need to be aware of the order of things. First we add 14 and y. Then we put the result (what it evaluates to, or returns) into x. That's my goal, to have a bunch of these cool examples to demonstrate and teach the class while they have fun. I tried this example on my roommate and while I may not use this as the first lesson, she liked it and learned something. Some cool mathematica programs that make beautiful graphs or shapes that are easy to understand would be good ideas and I'm going to look into those. Here are some complicated actionscript examples but that's a bit too advanced and I can't teach flash. What other ideas do you have?

    Read the article

  • ClickOnce application configured to perform updates programmatically still sometimes displays the Cl

    - by Tom Hall
    We have a WPF application deployed using ClickOnce which checks for and performs updates programmatically on application startup. This generally behaves perfectly except for the case where the user chooses "No" to our "Do you wish to update?" prompt. In this case, the next time the user launches the application (consistently) the ClickOnce framework's "Update Available" dialog launches with the option to update or skip. This doesn't cause a technical problem but will be confusing to the user to potentially see two completely differently styled dialogs. (If the user chooses Skip to the ClickOnce dialog then the application then launches and renders our own "Update Available" dialog). Any ideas why the ClickOnce framework dialog is showing in this case? Thanks.

    Read the article

  • iPhone programming - problem with CoreFoundation forking, PLEASE for the love of god help! lol

    - by Tom
    Hello all, I've been working on an iPhone for several months. It's a 2d shooting game akin to the old Smash TV type games. I'm doing everything alone and it has come out well so far, but now I am getting unpredictable crashes which seem to be related to CoreFoundation forking and not exec()ing, as the message THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONA LITY_YOU_MUST_EXEC__ always shows up somewhere in the debugger. Usually it shows up around a CFRunLoopRunSpecific and is related to either a timer firing or _InitializeTouchTapCount. I cannot figure out exactly what is causing the fork to occur. My main game loop is running on a timer, first updating all the logic and then drawing everything with openGL. There is nothing highly complex or unusual. I understand you cannot make CF calls on the childside of a fork, or access shared memory and things like that. I am not explicitly trying to fork anything. My question is: can anyone tell me what type of activity might cause CoreFoundation to randomly fork like this? I'd really like to finish this game and I don't know how to solve this problem. Thanks for any help.

    Read the article

  • AMF data is incomplete with Flex Service

    - by Tom
    Hello everybody. I am bussy with a Flex Project with a data services. Flash builder installed Zend Framework with Zend_Amf. When i run the project i get the error NetConnection.Call.Failed: HTTP: Failed. With chalers i say that Zend_Amf give the error: AMF data is incomplete (0 bytes of 0 bytes). Please check the recording limits in the Recording Settings. I don't know what the problem means. I have searched on google, but i haven't found a good result. The Flex project code is: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:authservice="services.authservice.*"> <fx:Script> <![CDATA[ import mx.controls.Alert; protected function click_me_clickHandler(event:MouseEvent):void { text.text += "Test started"; testmeResult.token = authService.testme(); text.text += testmeResult.lastResult text.text += "Test ended"; } ]]> </fx:Script> <fx:Declarations> <s:CallResponder id="testmeResult"/> <authservice:AuthService id="authService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Button x="124" y="85" label="Click Me!" id="click_me" click="click_me_clickHandler(event)"/> <s:RichText x="58" y="114" width="238" height="182" id="text"/> </s:Application> The php code is: <?php class AuthService { public function testme() { return 'ik ben getest op'+date('d-m-Y H:i:s', time()); } }?> Please, help me!

    Read the article

  • Where can I find clear examples of MVC?

    - by Tom
    I've read a couple of things about MVCs but I still don't understand when they should be used and when they shouldn't be used. I am looking for clear examples that say things like "if you're developing this then you should use MVC, like this" and "if you're developing this, you shouldn't use MVC." Most of the examples I've seen rely on complex frameworks which have already implemented everything and you have to learn the framework and use it a lot to understand what's really happening. To many programmers, phrasings such as "UI business logic" sound like marketing terms — for example, the words "Instead the View binds directly to a Presentation Model" are used in this post. I am aware of the dangers that may lurk in the shadows as MVC is a concept and everyone feels like they know it best, yet nobody really knows exactly how to use it because there may be a lot of variables involved and everyone is allowed to have a different perspective on how to dissect a project into the Model, the View and the Controller. There is a lot of theory out there but very few clear examples. What I'm looking for are not "the best" ways of doing it so this should not be considered as subjective; I'm looking for different simple implementations that would allow me to decide on my own which are the best approaches. Succinctly: What are good on-line resources that present pro and con arguments to using MVC in various situations and provide clear examples to help the reader understand the concept?

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >