Search Results

Search found 1045 results on 42 pages for 'josh fraser'.

Page 1/42 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Podcast: Advanced MVVM with Josh Smith

    - by craigshoemaker
    Author, Microsoft MVP and accomplished pianist Josh Smith, Sr. UX Developer at IdentityMine, joins the show to discuss some of Model View ViewModel’s more advanced scenarios. Full Speed: download Fast Version: download Josh shares is experience using MVVM gives some real-world advice on: Using modal dialogs Evils and virtues of code behind in views Use of attached behaviors Undo/redo strategies Working with animations Building a task based architecture for managing communication between View and ViewModel Frameworks in the MVVM space The Book Get first-hand experience implementing the solutions to the challenges discussed in the show by reading Josh’s new book ‘Advanced MVVM’. Resources The following resources are mentioned in the show: Laurent Bugnion's mix talk ‘Understanding the Model-View-ViewModel Pattern Josh Smith’s MVVM Foundation Laurent Bugnion’s MVVM Light framework Rob Eisenberg's Caliburn

    Read the article

  • Podcast: The Invisible UI : Natural User Interfaces with Josh Blake

    - by craigshoemaker
    Josh Blake of Infostrat joins Pixel8 to discuss NUI development in .NET. Josh is the author of the upcoming book Multitouch on Windows from Manning. Reaching far beyond theory and the niche market of Microsoft Surface, NUI development is now possible with Silverlight and WPF development on Windows 7 and Windows 7 Mobile devices. Subscribe to the podcast! The Natural User Interface (NUI) was a prominent force at MIX10. What is NUI? Wikipedia defines it as: Natural user interface, or NUI, is the common parlance used by designers and developers of computer interfaces to refer to a user interface that is effectively invisible, or becomes invisible with successive learned interactions, to its users. The word natural is used because most computer interfaces use artificial control devices whose operation has to be learned. A NUI relies on a user being able to carry out relatively natural motions, movements or gestures that they quickly discover control the computer application or manipulate the on-screen content. The most descriptive identifier of a NUI is the lack of a physical keyboard and/or mouse. In our interview Josh demystifies what NUI is, makes a distinction between gestures and manipulations, and talks about what is possible today for NUI development. For more from Josh make sure to check out his book: and watch his MIX Presentation: Developing Natural User Interfaces with Microsoft Silverlight and WPF 4 Touch Resources Mentioned in the Show Check out the following videos that show the roots and future of NUI development: Jeff Han's Multi-Touch TED Presentation Microsoft Surface Project Natal MIX10 Day 2 Keynote A few times during our talk Bill Buxton’s work is mentioned. To see his segment of the MIX10 day 2 keynote, click below:

    Read the article

  • Wordpress Podcast | Josh Holmes

    - by Josh Holmes
    I was thrilled and honored to be a guest on the Wordpress Podcast on WebMasterRadio.fm. This podcast is hosted by my friend Joost de Valk and Frederick Townes. You can read about the podcast, PHP on IIS, PHP on Azure and much more on my blog at Wordpress Podcast…

    Read the article

  • Josh Smith's MVVM Demo App: Add commands to MainWindowViewModel's command list

    - by MAD9
    I have a question concerning Josh Smith's famous demo app on MVVM. I try building a "real" application around it to learn WPF. He creates this CommandsList in the MainWindowViewModel containing 2 Commands (create new and view all customers). This list is readonly (why? any particular reason?). I thougt it would be nice to add and remove some commands, depending on the workspace that is currently selected. Like edit or delete a customer when it has the focus and so on. How would I accomplish this?! Can I just make it a normal list and add commands? Or bind the Commands-View to a commands list of the selected workspace instead of the MainWindow? How? Any other ways? Please share your ideas! Thank you very much!

    Read the article

  • Passing a parameter using RelayCommand defined in the ViewModel (from Josh Smith example)

    - by eesh
    I would like to pass a parameter defined in the XAML (View) of my application to the ViewModel class by using the RelayCommand. I followed Josh Smith's excellent article on MVVM and have implemented the following. XAML Code <Button Command="{Binding Path=ACommandWithAParameter}" CommandParameter="Orange" HorizontalAlignment="Left" Style="{DynamicResource SimpleButton}" VerticalAlignment="Top" Content="Button"/> ViewModel Code public RelayCommand _aCommandWithAParameter; /// <summary> /// Returns a command with a parameter /// </summary> public RelayCommand ACommandWithAParameter { get { if (_aCommandWithAParameter == null) { _aCommandWithAParameter = new RelayCommand( param => this.CommandWithAParameter("Apple") ); } return _aCommandWithAParameter; } } public void CommandWithAParameter(String aParameter) { String theParameter = aParameter; } #endregion I set a breakpoint in the CommandWithAParameter method and observed that aParameter was set to "Apple", and not "Orange". This seems obvious as the method CommandWithAParameter is being called with the literal String "Apple". However, looking up the execution stack, I can see that "Orange", the CommandParameter I set in the XAML is the parameter value for RelayCommand implemenation of the ICommand Execute interface method. That is the value of parameter in the method below of the execution stack is "Orange", public void Execute(object parameter) { _execute(parameter); } What I am trying to figure out is how to create the RelayCommand ACommandWithAParameter property such that it can call the CommandWithAParameter method with the CommandParameter "Orange" defined in the XAML. Is there a way to do this? Why do I want to do this? Part of "On The Fly Localization" In my particular implementation I want to create a SetLanguage RelayCommand that can be bound to multiple buttons. I would like to pass the two character language identifier ("en", "es", "ja", etc) as the CommandParameter and have that be defined for each "set language" button defined in the XAML. I want to avoid having to create a SetLanguageToXXX command for each language supporting and hard coding the two character language identifier into each RelayCommand in the ViewModel.

    Read the article

  • problem with tabbed interface as mentioned in the article of josh smith

    - by Egi
    hello guys, i ve got a problem with my programm. here is the link: http://dl.dropbox.com/u/2734432/TabbedInterface.7z once u have opened both tabs, u ll start loosing the references to other collections of the current item in the view. that is because these ids are nullable and once you switch over to the other tab they ll become null. my question is why and how can i corrent that behavoir? if you change the int? to int there are no more problem, but i need them to be nullable!

    Read the article

  • Illegal start of expression?

    - by Fraser
    I'm trying to build a simple Android app that increments a number displayed every time a button is pressed, but I can't work out how to fix the "illegal start of expression" error I keep getting. My code: package com.clicker; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class Clicker extends Activity { private int clickerNumber = 0; private TextView clickerText; private Button clickerButton; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); clickerText = (TextView)findViewById(R.id.clickerText); final Button clickerButton = (Button)findViewById(R.id.clickerButton); clickerButton.setOnClickListener(new View.OnClickListener()); { public void onClick(); { clickerNumber = clickerNumber++; clickerText.setText(Integer.toString(clickerNumber)); } } } } And compiler output: compile: [javac] Compiling 2 source files to /home/fraser/Applications/Android/Code/Clicker/bin/classes [javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:24: ')' expected [javac] clickerButton.setOnClickListener(new View.OnClickListener(); [javac] ^ [javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:26: illegal start of expression [javac] public void onClick(); [javac] ^ [javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:26: illegal start of expression [javac] public void onClick(); [javac] ^ [javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:26: ';' expected [javac] public void onClick(); [javac] ^ [javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:29: ';' expected [javac] clickerText.setText(Integer.toString(clickerNumber))); [javac] ^ [javac] 5 errors

    Read the article

  • Noob Objective-C/C++ - Linker Problem/Method Signature Problem

    - by Josh
    There is a static class Pipe, defined in C++ header that I'm including. The static method I'm interested in calling (from Objetive-c) is here: static ERC SendUserGet(const UserId &_idUser,const GUID &_idStyle,const ZoneId &_idZone,const char *_pszMsg); I have access to an objetive-c data structure that appears to store a copy of userID, and zoneID -- it looks like: @interface DataBlock : NSObject { GUID userID; GUID zoneID; } Looked up the GUID def, and its a struct with a bunch of overloaded operators for equality. UserId and ZoneId from the first function signature are #typedef GUID Now when I try to call the method, no matter how I cast it (const UserId), (UserId), etc, I get the following linker error: Ld build/Debug/Seeker.app/Contents/MacOS/Seeker normal i386 cd /Users/josh/Development/project/Mac/Seeker setenv MACOSX_DEPLOYMENT_TARGET 10.5 /Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/josh/Development/TS/Mac/Seeker/build/Debug -L/Users/josh/Development/TS/Mac/Seeker/../../../debug -L/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1 -F/Users/josh/Development/TS/Mac/Seeker/build/Debug -filelist /Users/josh/Development/TS/Mac/Seeker/build/Seeker.build/Debug/Seeker.build/Objects-normal/i386/Seeker.LinkFileList -mmacosx-version-min=10.5 -framework Cocoa -framework WebKit -lSAPI -lSPL -o /Users/josh/Development/TS/Mac/Seeker/build/Debug/Seeker.app/Contents/MacOS/Seeker Undefined symbols: "SocPipe::SendUserGet(_GUID const&, _GUID const&, _GUID const&, char const*)", referenced from: -[PeoplePaneController clickGet:] in PeoplePaneController.o ld: symbol(s) not found collect2: ld returned 1 exit status Is this a type/function signature error, or truly some sort of linker error? I have the headers where all these types and static classes are defined #imported -- I tried #include too, just in case, since I'm already stumbling :P Forgive me, I come from a web tech background, so this c-style memory management and immutability stuff is super hazy. Edit: Added full linker error text. Changed "function" to "method" Thanks, Josh

    Read the article

  • How are views constructed in Josh Smith's MVVM sample?

    - by Wim Coenen
    Being new to both WPF and MVVM, I'm studying Josh Smith's article on the MVVM pattern and the accompanying sample code. I can see that the application is started in app.xaml.cs by constructing a MainWindow object, wiring it to a MainWindowViewModel object and then showing the main window. So far so good. However, I can't find any code which instantiates the AllCustomersView or CustomerView classes. Using "find all references" on the constructors of those views comes up with nothing. What am I missing here?

    Read the article

  • Mark text in HTML

    - by Alon
    Hi I have some plain text and html. I need to create a PHP method that will return the same html, but with <span class="marked"> before any instances of the text and </span> after it. Note, that it should support tags in the html (for example if the text is blabla so it should mark when it's bla<b>bla</b> or <a href="http://abc.com">bla</a>bla. It should be incase sensitive and support long text (with multilines etc) either. For example, if I call this function with the text "my name is josh" and the following html: <html> <head> <title>My Name Is Josh!!!</title> </head> <body> <h1>my name is <b>josh</b></h1> <div> <a href="http://www.names.com">my name</a> is josh </div> <u>my</u> <i>name</i> <b>is</b> <span style="font-family: Tahoma;">Josh</span>. </body> </html> ... it should return: <html> <head> <title><span class="marked">My Name Is Josh</span>!!!</title> </head> <body> <h1><span class="marked">my name is <b>josh</b></span></h1> <div> <span class="marked"><a href="http://www.names.com">my name</a> is josh</span> </div> <span class="marked"><u>my</u> <i>name</i> <b>is</b> <span style="font-family: Tahoma;">Josh</span></span>. </body> </html> Thanks.

    Read the article

  • Can I use MX records to deliver some addresses to Google Apps and some to my server?

    - by Josh
    I have whm installed on my VPS, which my domain MX records are pointing to: 0:mail.mydomain.com and whm/cpanel has mail forwarding rules which pipes certain @mydomain email addresses into my CRM software. But for certain email addresses I want to forward into Google Apps. For example, [email protected], [email protected] pipes into cPanel -- CRM (mail.mydomain.com) but [email protected] should be going to Google MX records. Is that possible? The reason why is I want to register for Google Apps such as analytics and other Google services under [email protected]. My initial thoughts were to add a subdomain such as [email protected] and point that subdomain's MX records to Google.. but I want to avoid this if possible.

    Read the article

  • GDI+ is giving me errors

    - by user146780
    I want to use GDI + just to load a png. I included the headers and lib file then I do: Bitmap b; b.fromfile(filename); I get this from the compiler though. Error 1 error C2146: syntax error : missing ';' before identifier 'b' c:\users\josh\documents\visual studio 2008\projects\vectorizer project\vectorizer project\vectorizer project.cpp 23 Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\josh\documents\visual studio 2008\projects\vectorizer project\vectorizer project\vectorizer project.cpp 23 Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\josh\documents\visual studio 2008\projects\vectorizer project\vectorizer project\vectorizer project.cpp 23 Error 4 error C2440: '=' : cannot convert from 'const char [3]' to 'WCHAR *' c:\users\josh\documents\visual studio 2008\projects\vectorizer project\vectorizer project\vectorizer project.cpp 172 Error 5 error C2228: left of '.FromFile' must have class/struct/union c:\users\josh\documents\visual studio 2008\projects\vectorizer project\vectorizer project\vectorizer project.cpp 179 What is the correct way to do this? Thanks

    Read the article

  • Google authorship verification issue

    - by Fraser
    I'm trying to get my blog content author verified so my face gets into the Google search results. I managed to achieve this a few weeks back - When testing my content in the Google authorship testing tool it reported that I had been verified and I could see my mug in the results. All I had to do was wait a couple of weeks before I started popping up in the search results (I think(?)). However, I seem to have thrown a spanner in the works. I set up Google apps for my domain and merged my old Google+ profile into my google apps account. This seemed to reset my Google+ profile (no biggy, since it was a new profile and only had 1 connection). I re-set up my G+ account and tied it all in to my blog and it's content. I am now seeing some very strange behaviour. If you take a look at one of my blog posts through the snippet testing tool: http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fblog.fraser-hart.co.uk%2Fjquery-fullscreen-background-slideshow%2F&html= You will see that it is not recognising me as an author. However, when you enter my profile URL (https://plus.google.com/108765138229426105004) into the "Authorship verification by email" input, you will see that it does in fact recognise it as verified. Now, if you try and verify the same page again, it reverts back to unverified. I thought I may have to just wait it out but this has been over a week now and previously (before I merged my profile) it happened instantaneously. Has anyone experienced this bizarre behaviour before? What is happening here? More importantly, is there anything I can do to resolve it? (Apologies for the long and boring question). Cheers!

    Read the article

  • App freezing after lunch without any Error on Iphone Simulator?

    - by Meko
    HI.I am using CoreData on my UITable to show some records.It works when I first run.But if I run my app on simulator second time it shows up with data but then it stops.Sometimes it quits from app or it only froze and i cant click on table or tab bar. I looked also on Console but I thought there is no error.Here output from console The Debugger has exited with status 0. [Session started at 2010-03-30 00:22:06 +0300.] 2010-03-30 00:22:08.660 Paparazzi2[3556:207] Creating Photo: Urban disaster 2010-03-30 00:22:08.661 Paparazzi2[3556:207] Person is: Josh 2010-03-30 00:22:08.665 Paparazzi2[3556:207] Person is: Josh 2010-03-30 00:22:08.665 Paparazzi2[3556:207] -- Person Exists : Josh-- 2010-03-30 00:22:08.719 Paparazzi2[3556:207] Creating Photo: Concrete pitch forks 2010-03-30 00:22:08.719 Paparazzi2[3556:207] Person is: Josh 2010-03-30 00:22:08.721 Paparazzi2[3556:207] Person is: Josh 2010-03-30 00:22:08.721 Paparazzi2[3556:207] -- Person Exists : Josh-- 2010-03-30 00:22:08.727 Paparazzi2[3556:207] Creating Photo: Leaves on fire 2010-03-30 00:22:08.728 Paparazzi2[3556:207] Person is: Al 2010-03-30 00:22:08.734 Paparazzi2[3556:207] Person is: Al 2010-03-30 00:22:08.734 Paparazzi2[3556:207] -- Person Exists : Al-- [Session started at 2010-03-30 00:22:08 +0300.] GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all Attaching to process 3556. (gdb)

    Read the article

  • How do I copy a JavaScript object into another object?

    - by Josh K
    Say I want to start with a blank JavaScript object: me = {}; And then I have an array: me_arr = new Array(); me_arr['name'] = "Josh K"; me_arr['firstname'] = "Josh"; Now I want to throw that array into the object so I can use me.name to return Josh K. I tried: for(var i in me_arr) { me.i = me_arr[i]; } But this didn't have the desired result. Is this possible? My main goal is to wrap this array in a JavaScript object so I can pass it to a PHP script (via AJAX or whatever) as JSON.

    Read the article

  • webDAV and nautilus returns proxy hostname () error... what am I doing wrong?

    - by Josh Firth
    I am trying to connect to this address https://staff-files.com.auckland.ac.nz/hcwebdav/ for work, which works fine through firefox after it prompts for User/password. I want to access this through nautilus but keep getting: "HTTP ERROR: Cannot resolve proxy hostname () Please select another viewer and try again." I have tried using http, https, dav, davs in the go=location menu, and the same in connect to server method in nautilus as well, which returns the same error. University IT haven't been able to help: can someone here? Thanks, Josh

    Read the article

  • Microsoft UX Kit

    - by Josh Holmes
    Have you ever wondered what was possible with Silverlight, WPF or any of Microsoft’s User Experience (UX) technologies? Well, Christian Thilmany has answered that question in the form of the Microsoft UX Kit. Read more at Microsoft UX Kit | Josh Holmes

    Read the article

  • Microsoft Contributing More to OSS

    - by Josh Holmes
    I’m all excited – Microsoft has signed the Joomla! Contributor Agreement. You can read about that on the official Joomla! blog – Microsoft signs the Joomla! Contributor Agreement. There’s a couple of fairly momentous things about that statement. Read more at Microsoft Contributing More to OSS | Josh Holmes

    Read the article

  • Oracle’s New Memory-Optimized x86 Servers: Getting the Most Out of Oracle Database In-Memory

    - by Josh Rosen, x86 Product Manager-Oracle
    With the launch of Oracle Database In-Memory, it is now possible to perform real-time analytics operations on your business data as it exists at that moment – in the DRAM of the server – and immediately return completely current and consistent data. The Oracle Database In-Memory option dramatically accelerates the performance of analytics queries by storing data in a highly optimized columnar in-memory format.  This is a truly exciting advance in database technology.As Larry Ellison mentioned in his recent webcast about Oracle Database In-Memory, queries run 100 times faster simply by throwing a switch.  But in order to get the most from the Oracle Database In-Memory option, the underlying server must also be memory-optimized. This week Oracle announced new 4-socket and 8-socket x86 servers, the Sun Server X4-4 and Sun Server X4-8, both of which have been designed specifically for Oracle Database In-Memory.  These new servers use the fastest Intel® Xeon® E7 v2 processors and each subsystem has been designed to be the best for Oracle Database, from the memory, I/O and flash technologies right down to the system firmware.Amongst these subsystems, one of the most important aspects we have optimized with the Sun Server X4-4 and Sun Server X4-8 are their memory subsystems.  The new In-Memory option makes it possible to select which parts of the database should be memory optimized.  You can choose to put a single column or table in memory or, if you can, put the whole database in memory.  The more, the better.  With 3 TB and 6 TB total memory capacity on the Sun Server X4-4 and Sun Server X4-8, respectively, you can memory-optimize more, if not your entire database.   Sun Server X4-8 CMOD with 24 DIMM slots per socket (up to 192 DIMM slots per server) But memory capacity is not the only important factor in selecting the best server platform for Oracle Database In-Memory.  As you put more of your database in memory, a critical performance metric known as memory bandwidth comes into play.  The total memory bandwidth for the server will dictate the rate in which data can be stored and retrieved from memory.  In order to achieve real-time analysis of your data using Oracle Database In-Memory, even under heavy load, the server must be able to handle extreme memory workloads.  With that in mind, the Sun Server X4-8 was designed with the maximum possible memory bandwidth, providing over a terabyte per second of total memory bandwidth.  Likewise, the Sun Server X4-4 also provides extreme memory bandwidth in an even more compact form factor with over half a terabyte per second, providing customers with scalability and choice depending on the size of the database.Beyond the memory subsystem, Oracle’s Sun Server X4-4 and Sun Server X4-8 systems provide other key technologies that enable Oracle Database to run at its best.  The Sun Server X4-4 allows for up 4.8 TB of internal, write-optimized PCIe flash while the Sun Server X4-8 allows for up to 6.4 TB of PCIe flash.  This enables dramatic acceleration of data inserts and updates to Oracle Database.  And with the new elastic computing capability of Oracle’s new x86 servers, server performance can be adapted to your specific Oracle Database workload to ensure that every last bit of processing power is utilized.Because Oracle designs and tests its x86 servers specifically for Oracle workloads, we provide the highest possible performance and reliability when running Oracle Database.  To learn more about Sun Server X4-4 and Sun Server X4-8, you can find more details including data sheets and white papers here. Josh Rosen is a Principal Product Manager for Oracle’s x86 servers, focusing on Oracle’s operating systems and software.  He previously spent more than a decade as a developer and architect of system management software. Josh has worked on system management for many of Oracle's hardware products ranging from the earliest blade systems to the latest Oracle x86 servers. 

    Read the article

  • How long would it take to learn Python?

    - by Josh
    Hi all I have decided to take the time out after work to learn Python. Python appeals to me because at work (Web and eLearning Company), I have to follow out very repetitive tasks like delete all these tags, rename all these tasks and even more advanced repetive tasks. Additionally it would be good for me to get an understanding of Python first because of its fairly easy to learn syntax. How long would it take to learn the basics and go through these tutorials on Python (+ the Python tutorial)? I will only be spending 1 hour or so on it in the afternoons. http://openbookproject.net/thinkcs/python/english2e/index.html I have told my piano teacher I would like to take a month of learning piano to do this would this be adequate time? After this I may choose to learn PHP, because that is mainly what we use for web development at work. Thanks Josh

    Read the article

  • Programming Language? - To create a application (eLearning course) that will work on PC, Mac, iPhone, iPad, Touch etc?

    - by Josh
    Hi Currently at work I'm helping put together and create eLearning courses within Flash. Our senior programmers have knowledge of how to do this, Although - I would like to know how you could go from converting a eLearning course from Flash into a application for Mac and PC, looking similar to Garageband's music lessons? What programming language was used to create Garageband on Mac? What is the best way to create a application that will work on PC, Mac, iPhone, iPad, Touch etc, Rather then using flash and Actionscript to create online based applications, that will only work in a browser on Mac and PC? Any further tips? Thanks Josh

    Read the article

  • Not able to see databases in symlinked folder

    - by Josh Smith
    I created a folder on my Dropbox and then symlinked it to both of my computers that I use for development. The folder is working correctly and I can see all the files in it from both computers. The problem arises when I try and access the databases from my MacBook Air. When I open up MAMP Pro and start the web service I can't connect to my development sites, at least from one of my computers. My questions are: Is this even a good idea to symlink the db folder for MAMP? If it is not then is the a smart way to develop locally on two machines? Can I prompt phpMyAdmin to reindex the db folder so it can start accessing the databases? I have tried shutting down both versions of the server software. I have restarted both machines. I am at a loss right now. -Josh

    Read the article

  • Using Regex, how can I remove certain characters from the inside of tags in a string of html?

    - by Iain Fraser
    Suppose I have a string of html that contains a bunch of control characters and I want to remove the control characters from inside tags only, leaving the characters outside the tags alone. For example Here the control character is the numeral "1". Input The quick 1<strong>orange</strong> lemming <sp11a1n 1class1='jumpe111r'11>jumps over</span> 1the idle 1frog Desired Output The quick 1<strong>orange</strong> lemming <span class='jumper'>jumps over</span> 1the idle 1frog So far I can match tags which contain the control character but I can't remove them in one regex. I guess I could perform another regex on my matches, but I'd really like to know if there's a better way. My regex Bear in mind this one only matches tags which contain the control character. <(([^>])*?`([^>])*?)*?> Thanks very much for your time and consideration. Iain Fraser

    Read the article

  • HOW TO: Draggable legend in matplotlib

    - by Adam Fraser
    QUESTION: I'm drawing a legend on an axes object in matplotlib but the default positioning which claims to place it in a smart place doesn't seem to work. Ideally, I'd like to have the legend be draggable by the user. How can this be done? SOLUTION: Well, I found bits and pieces of the solution scattered among mailing lists. I've come up with a nice modular chunk of code that you can drop in and use... here it is: class DraggableLegend: def __init__(self, legend): self.legend = legend self.gotLegend = False legend.figure.canvas.mpl_connect('motion_notify_event', self.on_motion) legend.figure.canvas.mpl_connect('pick_event', self.on_pick) legend.figure.canvas.mpl_connect('button_release_event', self.on_release) legend.set_picker(self.my_legend_picker) def on_motion(self, evt): if self.gotLegend: dx = evt.x - self.mouse_x dy = evt.y - self.mouse_y loc_in_canvas = self.legend_x + dx, self.legend_y + dy loc_in_norm_axes = self.legend.parent.transAxes.inverted().transform_point(loc_in_canvas) self.legend._loc = tuple(loc_in_norm_axes) self.legend.figure.canvas.draw() def my_legend_picker(self, legend, evt): return self.legend.legendPatch.contains(evt) def on_pick(self, evt): if evt.artist == self.legend: bbox = self.legend.get_window_extent() self.mouse_x = evt.mouseevent.x self.mouse_y = evt.mouseevent.y self.legend_x = bbox.xmin self.legend_y = bbox.ymin self.gotLegend = 1 def on_release(self, event): if self.gotLegend: self.gotLegend = False ...and in your code... def draw(self): ax = self.figure.add_subplot(111) scatter = ax.scatter(np.random.randn(100), np.random.randn(100)) legend = DraggableLegend(ax.legend()) I emailed the Matplotlib-users group and John Hunter was kind enough to add my solution it to SVN HEAD. On Thu, Jan 28, 2010 at 3:02 PM, Adam Fraser wrote: I thought I'd share a solution to the draggable legend problem since it took me forever to assimilate all the scattered knowledge on the mailing lists... Cool -- nice example. I added the code to legend.py. Now you can do leg = ax.legend() leg.draggable() to enable draggable mode. You can repeatedly call this func to toggle the draggable state. I hope this is helpful to people working with matplotlib.

    Read the article

  • Using Regex, how can I remove certain characters from inside angle-brackets, leaving the characters

    - by Iain Fraser
    Edit: To be clear, please understand that I am not using Regex to parse the html, that's crazy talk! I'm simply wanting to clean up a messy string of html so it will parse Edit #2: I should also point out that the control character I'm using is a special unicode character - it's not something that would ever be used in a proper tag under any normal circumstances Suppose I have a string of html that contains a bunch of control characters and I want to remove the control characters from inside tags only, leaving the characters outside the tags alone. For example Here the control character is the numeral "1". Input The quick 1<strong>orange</strong> lemming <sp11a1n 1class1='jumpe111r'11>jumps over</span> 1the idle 1frog Desired Output The quick 1<strong>orange</strong> lemming <span class='jumper'>jumps over</span> 1the idle 1frog So far I can match tags which contain the control character but I can't remove them in one regex. I guess I could perform another regex on my matches, but I'd really like to know if there's a better way. My regex Bear in mind this one only matches tags which contain the control character. <(([^>])*?`([^>])*?)*?> Thanks very much for your time and consideration. Iain Fraser

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >