Search Results

Search found 1911 results on 77 pages for 'paul kirby'.

Page 55/77 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • DefaultStyledDocument.styleChanged(Style style) may not run in a timely manner?

    - by Paul Reiners
    I'm experiencing an intermittent problem with a class that extends javax.swing.text.DefaultStyledDocument. This document is being sent to a printer. Most of the time the formatting of the document looks correct, but once in a while it doesn't. It looks like some of the changes in the formatting have not been applied. I took a look at the DefaultStyledDocument.styleChanged(Style style) code: /** * Called when any of this document's styles have changed. * Subclasses may wish to be intelligent about what gets damaged. * * @param style The Style that has changed. */ protected void styleChanged(Style style) { // Only propagate change updated if have content if (getLength() != 0) { // lazily create a ChangeUpdateRunnable if (updateRunnable == null) { updateRunnable = new ChangeUpdateRunnable(); } // We may get a whole batch of these at once, so only // queue the runnable if it is not already pending synchronized(updateRunnable) { if (!updateRunnable.isPending) { SwingUtilities.invokeLater(updateRunnable); updateRunnable.isPending = true; } } } } /** * When run this creates a change event for the complete document * and fires it. */ class ChangeUpdateRunnable implements Runnable { boolean isPending = false; public void run() { synchronized(this) { isPending = false; } try { writeLock(); DefaultDocumentEvent dde = new DefaultDocumentEvent(0, getLength(), DocumentEvent.EventType.CHANGE); dde.end(); fireChangedUpdate(dde); } finally { writeUnlock(); } } } Does the fact that SwingUtilities.invokeLater(updateRunnable) is called, rather than invokeAndWait(updateRunnable), mean that I can't count on my formatting changes appearing in the document before it is rendered? If that is the case, is there a way to ensure that I don't proceed with rendering until the updates have occurred?

    Read the article

  • importing symbols from python package into caller's namespace

    - by Paul C
    I have a little internal DSL written in a single Python file that has grown to a point where I would like to split the contents across a number of different directories + files. The new directory structure currently looks like this: dsl/ __init__.py types/ __init__.py type1.py type2.py and each type file contains a class (e.g. Type1). My problem is that I would like to keep the implementation of code that uses this DSL as simple as possible, something like: import dsl x = Type1() ... This means that all of the important symbols should be available directly in the user's namespace. I have tried updating the top-level __init__.py file to import the relevant symbols: from types.type1 import Type1 from types.type2 import Type2 ... print globals() the output shows that the symbols are imported correctly, but they still aren't present in the caller's code (the code that's doing the import dsl). I think that the problem is that the symbols are actually being imported to the 'dsl' namespace. How can I change this so that the classes are also directly available in the caller's namespace?

    Read the article

  • Would you store binary data in database or in file system?

    - by paul
    This is a question which has been asked before (large-text-and-images-in-sql) but mainly for data which will be changed. In my case the data will be stored and never changed. Just seems sensible to keep everything together. Are there any reasons why I should not store static binary data in a database? Assuming it is a sensible thing to do, are there any advantages to storing such data in separate tables? (You might begin to realise now that I'm not a DB expert...) Clarify: There will probably be no more than 10-20 users but these will be in the US and in the UK. The binary data will have to be transfered in any case.

    Read the article

  • retrieve Scrollbar position with javascript

    - by Paul
    I know how to do this in flash, but completely lost about regular html. I'm trying to detect the position of the browser scrollbar with Javascript to decide where abouts in the page the current view is. My guess is that I'd have to detect where the thumb on the track is, and then the height of the thumb as a percentage of the total height of the track. Am I over-complicating it, or does Javascript offer an easier solution than that? Any ideas code-wise. Thanks.

    Read the article

  • Redirecting without change of address in browser address bar

    - by Berny Paul
    I have a different but similar question. I have a dynamic dns account where I map my machine's dynamic IP to an address say, www.xxx.yyy.net Now, I have registered another short domain name say www.yyy.com, the hosting is on a linux server. Now, my machine is actually a webserver which runs .net website which can be accessed by www.xxx.yyy.net I need my homepage(index.php) in my www.yyy.com handle the redirection in a way that the pages to be loaded from www.xxx.yyy.net/.... but it should look in the browser as www.yyy.com/... Is there any way to do this using php?

    Read the article

  • merging and manupulating files in matlab

    - by Paul
    Is there a way to run a loop through a folder and process like 30 files for a month and give the average,max of each columns and write in one excel sheet or so?? I have 30 files of size [43200 x 30] I ran a different matlab scrip to generate them so the names are easy File_2010_04_01.xls , File_2010_04_02.xls ..... and so on I cannot merge them as each are 20mbs and matlab would crash. Any ideas? Thanks

    Read the article

  • How to work with overlapping repositories in Mercurial

    - by Paul W Homer
    Often I want to have a main repository of source, shared by several "similar" projects. Each sub-project contains most of the same files, but is a specific configurable instance. That means there are usually a bunch of files and directories that need to be different for each instance. In CVS I used to create the main repository and the secondary ones, then use the modules file to bind the two together for a specific name. In SVN I used svn:externals to tie back the secondary directories into the main one. What works in Mercurial?

    Read the article

  • How to detect the active iTunes store on the iPhone/iPod Touch/iPad?

    - by Paul
    I'd like to be able to determine which store the user connects to from inside my app, so that I can direct them to some appropriate content for their device AND store. Does anyone know how to get this information? Basically, if the user is in the UK, and connects to the UK store, I want my function/method to return GB, if in Korea, I want KR, Australia = AU etc. Any help would be appreciated.

    Read the article

  • How update dataset with datagrid view C#

    - by Paul
    I am beginner and I have this problem. How can I can update dataset with datagridview? I binding dataset in datagrid. Edit datagrid. At finish I want update dataset with datagridview. Thank you form any advice Sory, I use Winforms. Example: I bind dataset in datagridview. dataGridViewCustomers.DataSource = _ds.Tables[0]; //edit datagridview //on this place I want update dataset with datagrid view

    Read the article

  • Is it possible to make JQuery keydown respond faster?

    - by Drew Paul
    I am writing a simple page with JQuery and HTML5 canvas tags where I move a shape on the canvas by pressing 'w' for up, 's' for down, 'a' for left, and 'd' for right. I have it all working, but I would like the shape to start moving at a constant speed upon striking a key. Right now there is some kind of hold period and then the movement starts. How can I get the movement to occur immediately? Here the important part of my code: Your browser does not support the HTML5 canvas tag. start navigating coords should pop up here key should pop up here var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); //keypress movements var xtriggered = 0; var keys = {}; var north = -10; var east = 10; var flipednorth = 0; $(document).ready(function(e){ $("input").keydown(function(){ keys[event.which] = true; if (event.which == 13) { event.preventDefault(); } //press w for north if (event.which == 87) { north++; flipednorth--; } //press s for south if (event.which == 83) { north--; flipednorth++; } //press d for east if (event.which == 68) { east++; } //press a for west if (event.which == 65) { east--; } var msg = 'x: ' + flipednorth*5 + ' y: ' + east*5; ctx.beginPath(); ctx.arc(east*6,flipednorth*6,40,0,2*Math.PI); ctx.stroke(); $('#soul2').html(msg); $('#soul3').html(event.which ); $("input").css("background-color","#FFFFCC"); }); $("input").keyup(function(){ delete keys[event.which]; $("input").css("background-color","#D6D6FF"); }); }); </script> please let me know if I shouldn't be posting code this lengthy.

    Read the article

  • trying to show/hide a div but something is not working

    - by Paul
    window.addEvent('domready', function(){ $('detail_block_table').addEvent('click', function(){ if ($('detail_showDiv').getStyle('display') == 'none') { $('detail_showDiv').setStyle('display','block'); } else { $('detail_showDiv').setStyle('display','none'); } }); }); This is the code, it looks fine but something prevents it from working. Any ideas?

    Read the article

  • Open dot-file with dialogue in OSX

    - by Henrik Paul
    Since the GUI-side of OSX treats all dot-files (such as .htaccess) as hidden, it doesn't display them in any of the graphical UI:s, e.g. Finder or the Open-dialogues. How can I open a dot-file (.htaccess in this case) in a graphical editor, without doing that thing for all hidden files, universally and without going through Terminal.app? Edit: I'm on Leopard, if that makes a difference. Edit2: TextWrangler and TextMate seem to have features that allow you to open hidden files, which partly answers my question.

    Read the article

  • How to parse the file name and rename in Matlab

    - by Paul
    I am reading a .xls file and then procesing it inside and rewriting it in the end of my program. I was wondering if someone can help me to parse the dates as my input file name is like file_1_2010_03_03.csv and i want my outputfile to be newfile_2010_03_03.xls is there a way to incorporate in matlab program so i do not have to manually write the command xlswrite('newfile_2010_03_03.xls', M); everytime and change the dates as i input files with diff dates like file_2_2010_03_04.csv. Thanks

    Read the article

  • What features of Scala cannot be translated to Java?

    - by Paul
    The Scala compiler compiles direct to Java byte code (or .NET CIL). Some of the features of Scala could be re-done in Java straightforwardly (e.g. simple for comprehensions, classes, translating anonymous/inner functionc etc). What are the features that cannot be translated that way? That is presumably mostly of academic interest. More usefully, perhaps, what are the key features or idioms of Scala that YOU use that cannot be easily represented in Java? Are there any the other way about? Things that can be done straightforwardly in Java that have no straightforward equivalent in Scala? Idioms in Java that don't translate?

    Read the article

  • CSS: Namespace a piece of HTML

    - by Paul Tarjan
    I'm building a browser extension that will insert a chunk of HTML into some pages. I'd like the page's CSS to not apply to this section. What is the best way to do this? Is there a good reset I can put on the root element of my HTML and set it to !important so it gets applied after others?

    Read the article

  • JQuery datepicker numberOfMonths: display current selection month last

    - by Paul
    Hi, I have a jquery datepicker with the numberOfMonths set to 3, currently when I click on the datepicker, the left side month is the current month. In most cases, the user is only going to be selecting a date prior to todays date so I would prefer the current month selected to be the last calendar i.e. March, April, May instead of the current implementation which is May, June, July. Greatly appreciate any help!

    Read the article

  • addEventListener using apply()

    - by Paul
    I'm trying to invoke addEventListener() using apply() method. The code is like: function rewrite(old){ return function(){ console.log( 'add something to ' + old.name ); old.apply(this, arguments); } } addEventListener=rewrite(addEventListener); It doesn't work. The code works for normal JavaScript method, for example, function hello_1(){ console.log("hello world 1!"); } hello_1=rewrite(hello_1); Need help! Thanks!

    Read the article

  • Percentage difference between different values in the same keys of two different arrays.

    - by Paul
    Hey. I'm looking for a solution to this problem. I got 2 arrays, like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "19088" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "15566" } } array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "12043" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "11953" } } Now I'd like to create a new array, with the % difference between the values per key. Would be something like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "88,23" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "74,54" } } Can anyone help me how to create that array?

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >