Search Results

Search found 1683 results on 68 pages for 'andrew barber'.

Page 10/68 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How should I sort images in an isometric game so that they appear in the correct order?

    - by Andrew
    Hi! This seems like a rather simple problem but I am having a lot of difficulty with it. What should I do to properly sort images in an isometric game? In a normal 2d top-down game one could use the screen y axis to sort the images. In this example the trees are properly sorted but the isometric walls are not. Example image: sorted by screen y Wall2 is one pixel below wall1 therefore it is drawn after wall1. If I sort by the isometric y axis the walls appear in the correct order but the trees do not. Example image: sorted by isometric y

    Read the article

  • How do I start "Ubuntu classic desktop" (no effects) from the command line

    - by Andrew Stern
    I am able to run sessions over an ssh connection but I rather use the "Ubuntu classic desktop (no effects)" version on Ubuntu 11.04 instead of the new Unity since I don't have 3d support on the laptop I'm using to display the graphical User Interface. How can I startup the older gnome-session without the 3d effects? I tried gnome-session but it seems to be the option with the 3d effects and I want a more stripped down session over my ssh session.

    Read the article

  • Are there any specific workflows or design patterns that are commonly used to create large functional programming applications?

    - by Andrew
    I have been exploring Clojure for a while now, although I haven't used it on any nontrivial projects. Basically, I have just been getting comfortable with the syntax and some of the idioms. Coming from an OOP background, with Clojure being the first functional language that I have looked very much into, I'm naturally not as comfortable with the functional way of doing things. That said, are there any specific workflows or design patterns that are common with creating large functional applications? I'd really like to start using functional programming "for real", but I'm afraid that with my current lack of expertise, it would result in an epic fail. The "Gang of Four" is such a standard for OO programmers, but is there anything similar that is more directed at the functional paradigm? Most of the resources that I have found have great programming nuggets, but they don't step back to give a broader, more architectural look.

    Read the article

  • If you had two projects with the same specification and only one was developed using TDD how could you tell?

    - by Andrew
    I was asked this question in an interview and it has been bugging me ever since. You have two projects, both with the same specification but only one of these projects was developed using Test Driven Development. You are given the source for both but with the tests removed from the TDD project. How can you tell which was developed using TDD? All I was able to muster up was something about the classes being more 'broken up' in to smaller chunks and having more visible APIs, not my proudest moment. I would be very interested to hear a good answer to this question.

    Read the article

  • How should I sort images in an isometric game so that they appear in the correct order?

    - by Andrew
    This seems like a rather simple problem but I am having a lot of difficulty with it. What should I do to properly sort images in an isometric game? In a normal 2d top-down game one could use the screen y axis to sort the images. In this example the trees are properly sorted but the isometric walls are not. Example image: sorted by screen y Wall2 is one pixel below wall1 therefore it is drawn after wall1. If I sort by the isometric y axis the walls appear in the correct order but the trees do not. Example image: sorted by isometric y

    Read the article

  • How can I gain access to a player instance in a Minecraft mod?

    - by Andrew Graber
    I'm creating Minecraft mod with a pickaxe that takes away experience when you break a block. The method for taking away experience from a player is addExperience on EntityPlayer, so I need to get an instance of EntityPlayer for the player using my pickaxe when the pickaxe breaks a block, so that I can remove the appropriate amount of experience. My pickaxe class currently looks like this: public class ExperiencePickaxe extends ItemPickaxe { public ExperiencePickaxe(int ItemID, EnumToolMaterial material){ super(ItemID, material); } public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) { if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { EntityPlayer e = new EntityPlayer(); // create an instance e.addExperience(-1); } return true; } } Obviously, I cannot actually create a new EntityPlayer since it is an abstract class. How can I get access to the player using my pickaxe?

    Read the article

  • Track sales and commission with third-party tool

    - by Andrew
    I have a clothing website where I link to various clothing retailers. I have reached an agreement with one of the retailers whereby they will pay a commission to us for every sale they make from traffic that was referred by our site. I need a mechanism for tracking how much commission should be paid to us, that involves as little work as possible to implement from their side. We both have Google Analytics. Option 1: They record a goal in their GA account whenever someone makes a purchase on their site. They see how many completed goals are marked as referral traffic from our site and calculate commission accordingly. The problem with this is that the whole process of calculating and paying commission will be manual. They will need to frequently check how many sales were generated by referral traffic from our site, and probably we will have to chase them for commission payments. Also - since we won't have access to their GA data - we will need to trust that they report all sales accurately. Option 2: Sign them up to an affiliate network like Commission Junction or Google's Affiliate Network, and connect to them through this network. The problem with this solution is that it seems too heavyweight; ideally we don't want to ask a retailer to go through the whole sign up process just to deal with us and pay us commission. I am assuming that there must be some lightweight service that tracks the number of sales by one site and pays commission accordingly to the other site, where the sign up and installation procedure is simple and fast.

    Read the article

  • How do I get mlocate to only index certain directories?

    - by Andrew Ferrier
    I'd like to use mlocate on my Ubuntu server, but only to index certain directories (e.g. /home and /data, but not everything under /). However, mlocate's standard configuration works the opposite way; you specify the paths you want to remove (with PRUNE_PATHS). Is there any easy way to achieve this, or any similar utility that will do what I want? (note: it should maintain an index like mlocate, so find is not acceptable, for example) Thanks.

    Read the article

  • How to become an expert in Python, PHP and Javascript? [closed]

    - by Andrew Alexander
    So I've been programming for about 9ish months now, and I've taught myself some Python, some PHP and some Javascript. I want to become better at these languages - I can hack something out, but a lot of things like OOP, using lists in the most effective ways, etc, is lost on me. What are the best ways to become an "expert" programmer? Does it depend on the nuances of the language, or is it more general? Is there any math I should be studying alongside it? Obviously a lot depends on what you want to do with it - so far I've mostly done small scale internal applications as well as web programming. How do I find out about good program design?

    Read the article

  • Ubuntu 12.10 running slow

    - by andrew
    I pasted syslog and perhaps anyone can see trouble that might need attention. It is running too slow for what I would suspect. Opening apps and web pages just takes forever. http://paste.ubuntu.com/1303211/ System Specs: Oct 24 12:42:55 ubuntu kernel: [ 1.369735] powernow-k8: Found 1 AMD V140 Processor (1 cpu cores) (version 2.20.00) http://en.wikipedia.org/wiki/List_of_AMD_Phenom_microprocessors#.22Champlain.22_.2845_nm.2C_Single-core.29_2

    Read the article

  • Best options for freelance or part-time programming? [closed]

    - by Andrew
    I apologize in advance if this is an inappropriate question for this SE. A few years back I was all set to study computer science and get a job programming, but went a totally different route and went into healthcare. I currently work as a paramedic on a rotating 24/48 schedule, so I have two days off for every day I work, and a decent bit of downtime on the days that I do work. I've been looking at ways to earn some extra money with all that spare time, and was wondering if it'd be worth the effort to try and find a part-time/freelance gig. I know HTML/CSS, PHP, and I'm pretty familiar with Python and Ruby (and Rails). Anyways, was hoping that someone could point me in the right direction as what "skill set" would give me the best chance to be able to land a part-time/freelance gig. I realize this is a rather open-ended question but any direction is appreciated.

    Read the article

  • How to edit files in a terminal with vim?

    - by andrew.46
    It is not always possible to edit and create files in a terminal and I would like to get the answers to the basics of manipulating files in a terminal using vim under Ubuntu Linux. Specific questions I have are: How can I open text files for editing? How can I save the file? How can I save the file with a different name? How can I leave the file without saving the changes? What settings are best in my configuration file and where is this file? How do I set the colors for vim? How do I show line numbers in vim and can this be toggled? A lot of questions here but I believe these questions and their answers should cover basic vim usage...

    Read the article

  • Speaking at SQL Saturday #146

    - by Andrew Kelly
      For any of you up in the New England area that are looking for some good and free SQL Server training you may want to check out the SQL Saturday this fall in southern NH. More specifically the event will be held in Nashua NH on October 20th 2012. There is a wonderful cast of speakers including myself (shameless plug ) with a wide range of topics of which I am sure everyone can find a few topics they are interested in.  I hope to see some familiar faces from my old stomping ground and...(read more)

    Read the article

  • As a programmer, what's the most valuable non-English (human) language to learn?

    - by Andrew M
    I was thinking that with my developer skills, learning new languages like French, German etc. might be easier for me now. I could setup the verbs as objects in Python and use dir(verb) to find its methods, tenses and stuff ;-) But seriously, if you're a professional developer, in my case in the UK, what's the best foreign language to learn from an employment perspective? I'm thinking, like Hindi - if all our programming jobs are getting outsourced to India, might as well position yourself to be the on-site, go-between guy. Mandarin - if the Chinese become the pre-eminent economy, the new USA, in ten or twenty years, then speaking their language would open up a huge market to you. Russian - maybe another major up-and-comer, but already closer to Western standards. More IT-sector growth here than anywhere else in the coming years? Japanese - drivers of global technology, being able to speak their language could give you a big competitive advantage over other Westerners But I'm just guessing/musing with all these points. If you have an opinion, or even better, some evidence, I'd like to hear it. If the programming things falls through then at least it'll make for more interesting holidays.

    Read the article

  • What program has this icon?

    - by Andrew M
    I noticed a screenshot that included this icon in the sidebar, does anyone know what it's from? It looks cool! Looks vaguely reminiscient of Chrome but different enough that it could be a coincidence. I've tried putting it into a google image search but without any luck. Original source was this Ubuntu help page on unity launchers. which includes the original, larger screenshot. For context, it's not important, I'm just curious.

    Read the article

  • Routed Command Question

    - by Andrew
    I'd like to implement a custom command to capture a Backspace key gesture inside of a textbox, but I don't know how. I wrote a test program in order to understand what's going on, but the behaviour of the program is rather confusing. Basically, I just need to be able to handle the Backspace key gesture via wpf commands while keyboard focus is in the textbox, and without disrupting the normal behaviour of the Backspace key within the textbox. Here's the xaml for the main window and the corresponding code-behind, too (note that I created a second command for the Enter key, just to compare its behaviour to that of the Backspace key): <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <TextBox Margin="44,54,44,128" Name="textBox1" /> </Grid> </Window> And here's the corresponding code-behind: using System.Windows; using System.Windows.Input; namespace WpfApplication1 { /// <summary> /// Interaction logic for EntryListView.xaml /// </summary> public partial class Window1 : Window { public static RoutedCommand EnterCommand = new RoutedCommand(); public static RoutedCommand BackspaceCommand = new RoutedCommand(); public Window1() { InitializeComponent(); CommandBinding cb1 = new CommandBinding(EnterCommand, EnterExecuted, EnterCanExecute); CommandBinding cb2 = new CommandBinding(BackspaceCommand, BackspaceExecuted, BackspaceCanExecute); this.CommandBindings.Add(cb1); this.CommandBindings.Add(cb2); KeyGesture kg1 = new KeyGesture(Key.Enter); KeyGesture kg2 = new KeyGesture(Key.Back); InputBinding ib1 = new InputBinding(EnterCommand, kg1); InputBinding ib2 = new InputBinding(BackspaceCommand, kg2); this.InputBindings.Add(ib1); this.InputBindings.Add(ib2); } #region Command Handlers private void EnterCanExecute(object sender, CanExecuteRoutedEventArgs e) { MessageBox.Show("Inside EnterCanExecute Method."); e.CanExecute = true; } private void EnterExecuted(object sender, ExecutedRoutedEventArgs e) { MessageBox.Show("Inside EnterExecuted Method."); e.Handled = true; } private void BackspaceCanExecute(object sender, CanExecuteRoutedEventArgs e) { MessageBox.Show("Inside BackspaceCanExecute Method."); e.Handled = true; } private void BackspaceExecuted(object sender, ExecutedRoutedEventArgs e) { MessageBox.Show("Inside BackspaceExecuted Method."); e.Handled = true; } #endregion Command Handlers } } Any help would be very much appreciated. Thanks! Andrew

    Read the article

  • Multi-Threading Question Concerning WPF

    - by Andrew
    Hello, I'm a newbie to threading, and I don't really know how to code a particular task. I would like to handle a mouse click event on a window that will kick off a while loop in a seperate thread. This thread, which is distinct from the UI thread, should call a function in the while loop which updates a label on the window being serviced by the UI thread. The while loop should stop running when the left mouse button is no longer being pressed. All the loop does is increment a counter, and then repeatedly call the function which displays the updated value in the window. The code for the window and all of the threading is given below (I keep getting some error about STA threading, but don't know where to put the attribute). Also, I'm hoping to use this solution, if it ever works, in another project that makes asynchronous calls elsewhere to a service via wcf, so I was hoping not to make any application-wide special configurations, since I'm really new to multi-threading and am quite worried about breaking other code in a larger program... Here's what I have: <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication2" Name="MyMainWindow" Title="MainWindow" Width="200" Height="150" PreviewMouseLeftButtonDown="MyMainWindow_PreviewMouseLeftButtonDown"> <Label Height="28" Name="CounterLbl" /> </Window> And here's the code-behind: using System.Windows; using System.Windows.Input; using System.Threading; namespace WpfApplication2 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private int counter = 0; public MainWindow() { InitializeComponent(); } private delegate void EmptyDelegate(); private void MyMainWindow_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Thread counterThread = new Thread(new ThreadStart(MyThread)); counterThread.Start(); } private void MyThread() { while (Mouse.LeftButton == MouseButtonState.Pressed) { counter++; Dispatcher.Invoke(new EmptyDelegate(UpdateLabelContents), null); } } private void UpdateLabelContents() { CounterLbl.Content = counter.ToString(); } } } Anyways, multi-threading is really new to me, and I don't have any experience implementing it, so any thoughts or suggestions are welcome! Thanks, Andrew

    Read the article

  • data from few MySQL tables sorted by ASC

    - by Andrew
    In the dbase I 've few tables named as aaa_9xxx, aaa_9yyy, aaa_9zzz. I want to find all data with a specified DATE and show it with the TIME ASC. First, I must find a tables in the dbase: $STH_1a = $DBH->query("SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'aaa\_9%' "); foreach($STH_1a as $row) { $table_name_s1[] = $row['table_name']; } Second, I must find a data wit a concrete date and show it with TIME ASC: foreach($table_name_s1 as $table_name_1) { $STH_1a2 = $DBH->query("SELECT * FROM `$table_name_1` WHERE date = '2011-11-11' ORDER BY time ASC "); while ($row = $STH_1a2->fetch(PDO::FETCH_ASSOC)) { echo " ".$table_name_1."-".$row['time']."-".$row['ei_name']." <br>"; } } .. but it shows the data sorted by tables name, then by TIME ASC. I must to have all this data (from all tables) sorted by TIME ASC. Thank You dev-null-dweller, Andrew Stubbs and Jaison Erick for your help. I test the Erick solution : foreach($STH_1a as $row) { $stmts[] = sprintf('SELECT * FROM %s WHERE date="%s"', $row['table_name'], '2011-11-11'); } $stmt = implode("\nUNION\n", $stmts); $stmt .= "\nORDER BY time ASC"; $STH_1a2 = $DBH->query($stmt); while ($row_1a2 = $STH_1a2->fetch(PDO::FETCH_ASSOC)) { echo " ".$row['table_name']."-".$row_1a2['time']."-".$row_1a2['ei_name']." <br>"; } it's working but I've problem with 'table_name' - it's always the LAST table name. //---------------------------------------------------------------------- end the ending solution with all fixes, thanks all for your help, :)) foreach($STH_1a as $row) { $stmts[] = sprintf("SELECT *, '%s' AS table_name FROM %s WHERE date='%s'", $row['table_name'], $row['table_name'], '2011-11- 11'); } $stmt = implode("\nUNION\n", $stmts); $stmt .= "\nORDER BY time ASC"; $STH_1a2 = $DBH->query($stmt); while ($row_1a2 = $STH_1a2->fetch(PDO::FETCH_ASSOC)) { echo " ".$row_1a2['table_name']."-".$row_1a2['time']."-".$row_1a2['ei_name']." <br>"; }

    Read the article

  • Silverlight Cream for January 13, 2011 -- #1026

    - by Dave Campbell
    In this Issue: András Velvárt, Tony Champion, Joost van Schaik, Jesse Liberty, Shawn Wildermuth, John Papa, Michael Crump, Sacha Barber, Alex Knight, Peter Kuhn, Senthil Kumar, Mike Hole, and WindowsPhoneGeek. Above the Fold: Silverlight: "Create Custom Speech Bubbles in Silverlight." Michael Crump WP7: "Architecting WP7 - Part 9 of 10: Threading" Shawn Wildermuth Expression Blend: "PathListBox: Text on the path" Alex Knight From SilverlightCream.com: Behaviors for accessing the Windows Phone 7 MarketPlace and getting feedback András Velvárt shares almost insider information about how to get some user interaction with your WP7 app in the form of feedback ... he has 4 behaviors taken straight from his very cool SufCube app that he's sharing. Reloading a Collection in the PivotViewer Tony Champion keeps working with the PivotViewer ... this time discussing the fact that you can't Reload or Refresh the current collection from the server ... at least not initially, but he did find one :) Tombstoning MVVMLight ViewModels with SilverlightSerializer on Windows Phone 7 Joost van Schaik takes a shot at helping us all with Tombstoning a WP7 app... he's using Mike Talbot's SilverlightSerializer and created extension methods for it for tombstoning that he's willing to share with us. Windows Phone From Scratch #17: MVVM Light Toolkit Soup To Nuts Part 2 Jesse Liberty is up to Part 17 in his WP7 series, and this is the 2nd post on MVVMLight and WP7, and is digging into behaviors. Architecting WP7 - Part 9 of 10: Threading Shawn Wildermuth is up to part 9 of 10 in his series on Architecting WP7 apps. This episode finds Shawn discussing Threading ... know how to use and choose between BackgroundWorker and ThreadPool? ... Shawn will explain. Silverlight TV 57: Performance Tuning Your Apps In the latest Silverlight TV, John Papa chats with Mike Cook about tuning your Silverlight app to get the performance up there where your users will be happy. Create Custom Speech Bubbles in Silverlight. Michael Crump's already gotten a lot of airplay out of this, but it's so cool.. comic-style callout shapes without using the dlls that you normally would... in other words, paths, and very cool hand-drawn looks on some too... very cool, Michael! Showcasing Cinch MVVM framework / PRISM 4 interoperability Sacha Barber has a post up on CodeProject that demonstratest using Cinch and Prism4 together... handily using MEF since Cinch relies on MEFedMVVM... this is a heck of a post... lots of code, lots of explanations. PathListBox: Text on the path Alex Knight keeps making this PathListBox series better ... this time he is putting text on the path... moving text... too cool, Alex! Windows Phone 7: Pinch Gesture Sample Peter Kuhn digs into the WP7 toolkit and examines GestureListener, pinch events, and clipping... examples and code supplied. How to change the StartPage of the Windows Phone 7 Application in Visual Studio 2010 ? Senthil Kumar discusses how to change the StartPage of your WP7 app, or get the program running if you happen to move or rename MainPage.xaml WP7 Text Boxes – OnEnter (my 1st Behaviour) Mike Hole has a post up about the issue with the keyboard appearing in front of the textbox, and maybe using the enter key to drop it... and he's developed a behavior for that process. WP7 ContextMenu in depth | Part1: key concepts and API WindowsPhoneGeek has some good articles that I haven't posted, but I'll catch up. This one is a nice tutorial on the WP7 Context menu... good explanation, diagrams, and code. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Silverlight Cream for December 27, 2010 -- #1016

    - by Dave Campbell
    In this Issue: Sacha Barber, David Anson, Jesse Liberty, Shawn Wildermuth, Jeff Blankenburg(-2-), Martin Krüger, Ryan Alford(-2-), Michael Crump, Peter Kuhn(-2-). Above the Fold: Silverlight: "Part 4 of 4 : Tips/Tricks for Silverlight Developers" Michael Crump WP7: "Navigating with the WebBrowser Control on WP7" Shawn Wildermuth Shoutouts: John Papa posted that the open call is up for MIX11 presenters: Your Chance to Speak at MIX11 From SilverlightCream.com: Aspect Examples (INotifyPropertyChanged via aspects) If you're wanting to read a really in-depth discussion of aspect oriented programming (AOP), check out the article Sacha Barber has up at CodeProject discussing INPC via aspects. How to: Localize a Windows Phone 7 application that uses the Windows Phone Toolkit into different languages David Anson has a nice tutorial up on localizing your WP7 app, including using the Toolkit and controls such as DatePicker... remember we're talking localized Windows Phone From Scratch – Animation Part 1 Jesse Liberty continues in his 'From Scratch' series with this first post on WP7 Animation... good stuff, Jesse! Navigating with the WebBrowser Control on WP7 In building his latest WP7 app, Shawn Wildermuth ran into some obscure errors surrounding browser.InvokeScript. He lists the simple solution and his back, refresh, and forward button functionality for us. What I Learned In WP7 – Issue #7 In the time I was out, Jeff Blankenburg got ahead of me, so I'll catch up 2 at a time... in this number 7 he discusses making videos of your apps, links to the Learn Visual Studio series, and his new website What I Learned In WP7 – Issue #8 Jeff Blankenburg's number 8 is a very cool tip on using the return key on the keyboard to handle the loss of focus and handling of text typed into a textbox. Resize of a grid by using thumb controls Martin Krüger has a sample in the Expression Gallery of a grid that is resizable by using 'thumb controls' at the 4 corners... all source, so check it out! Silverlight 4 – Productivity Power Tools and EF4 Ryan Alford found a very interesting bug associated with EF4 and the Productivity Power Tools, and the way to get out of it is just weird as well. Silverlight 4 – Toolkit and Theming Ryan Alford also had a problem adding a theme from the Toolkit, and what all you might have to do to get around this one.... Part 4 of 4 : Tips/Tricks for Silverlight Developers. Michael Crump has part 4 of his series on Silverlight Development tips and tricks. This is numbers 16 through 20 and covers topics such as Version information, Using Lambdas, Specifying a development port, Disabling ChildWindow Close button, and XAML cleanup. The XML content importer and Windows Phone 7 Peter Kuhn wanted to use the XML content inporter with a WP7 app and ran into problems implementing the process and a lack of documentation as well... he pounded through it all and has a class he's sharing for loading sounds via XML file settings. WP7 snippet: analyzing the hyperlink button style In a second post, Peter Kuhn responds to a forum discussion about the styles for the hyperlink button in WP7 and why they're different than SL4 ... and styles-to-go to get all the hyperlink goodness you want... wrapped text, or even non-text content. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • PASS Summit 2011 &ndash; Part II

    - by Tara Kizer
    I arrived in Seattle last Monday afternoon to attend PASS Summit 2011.  I had really wanted to attend Gail Shaw’s (blog|twitter) and Grant Fritchey’s (blog|twitter) pre-conference seminar “All About Execution Plans” on Monday, but that would have meant flying out on Sunday which I couldn’t do.  On Tuesday, I attended Allan Hirt’s (blog|twitter) pre-conference seminar entitled “A Deep Dive into AlwaysOn: Failover Clustering and Availability Groups”.  Allan is a great speaker, and his seminar was packed with demos and information about AlwaysOn in SQL Server 2012.  Unfortunately, I have lost my notes from this seminar and the presentation materials are only available on the pre-con DVD.  Hmpf! On Wednesday, I attended Gail Shaw’s “Bad Plan! Sit!”, Andrew Kelly’s (blog|twitter) “SQL 2008 Query Statistics”, Dan Jones’ (blog|twitter) “Improving your PowerShell Productivity”, and Brent Ozar’s (blog|twitter) “BLITZ! The SQL – More One Hour SQL Server Takeovers”.  In Gail’s session, she went over how to fix bad plans and bad query patterns.  Update your stale statistics! How to fix bad plans Use local variables – optimizer can’t sniff it, so it’ll optimize for “average” value Use RECOMPILE (at the query or stored procedure level) – CPU hit OPTIMIZE FOR hint – most common value you’ll pass How to fix bad query patterns Don’t use them – ha! Catch-all queries Use dynamic SQL OPTION (RECOMPILE) Multiple execution paths Split into multiple stored procedures OPTION (RECOMPILE) Modifying parameter values Use local variables Split into outer and inner procedure OPTION (RECOMPILE) She also went into “last resort” and “very last resort” options, but those are risky unless you know what you are doing.  For the average Joe, she wouldn’t recommend these.  Examples are query hints and plan guides. While I enjoyed Andrew’s session, I didn’t take any notes as it was familiar material.  Andrew is a great speaker though, and I’d highly recommend attending his sessions in the future. Next up was Dan’s PowerShell session.  I need to look into profiles, manifests, function modules, and function import scripts more as I just didn’t quite grasp these concepts.  I am attending a PowerShell training class at the end of November, so maybe that’ll help clear it up.  I really enjoyed the Excel integration demo.  It was very cool watching PowerShell build the spreadsheet in real-time.  I must look into this more!  On a side note, I am jealous of Dan’s hair.  Fabulous hair! Brent’s session showed us how to quickly gather information about a server that you will be taking over database administration duties for.  He wrote a script to do a fast health check and then later wrapped it into a stored procedure, sp_Blitz.  I can’t wait to use this at my work even on systems where I’ve been the primary DBA for years, maybe there’s something I’ve overlooked.  We are using EPM to help standardize our environment and uncover problems, but sp_Blitz will definitely still help us out.  He even provides a cloud-based update feature, sp_BlitzUpdate, for sp_Blitz so you don’t have to constantly update it when he makes a change.  I think I’ll utilize his update code for some other challenges that we face at my work.

    Read the article

  • Silverlight Cream for January 15, 2011 -- #1028

    - by Dave Campbell
    Note to #1024 Swag Winners: I'm sending emails to the vendors Sunday night, thanks for your patience (a few of you have not contacted me yet) In this Issue: Ezequiel Jadib, Daniel Egan(-2-), Page Brooks, Jason Zander, Andrej Tozon, Marlon Grech, Jonathan van de Veen, Walt Ritscher, Jesse Liberty, Jeremy Likness, Sacha Barber, William E. Burrows, and WindowsPhoneGeek. Above the Fold: Silverlight: "Building a Radar Control in Silverlight - Part 1" Page Brooks WP7: "Tutorial: Dynamic Tile Push Notification for Windows Phone 7" Jason Zander Training: "WP7 Unleashed Session I–Hands on Labs" Daniel Egan From SilverlightCream.com: Silverlight Rough Cut Editor SP1 Released Ezequiel Jadib has an announcement about the Rough Cut Editor SP1 release, and he walks you through the content, installation and a bit of the initial use. WP7 Unleashed Session I–Hands on Labs Daniel Egan posted Part 1 of 3 of a new WP7 HOL ... video online and material to download... get 'em while they're hot! WP7 Saving to Media Library Daniel Egan has another post up as well on saving an image to the media library... not the update from Tim Heuer... all good info Building a Radar Control in Silverlight - Part 1 This freakin' cool post from Page Brooks is the first one of a series on building a 'Radar Control' in Silverlight ... seriously, go to the bottom and run the demo... I pretty much guarantee you'll take the next link which is download the code... don't forget to read the article too! Tutorial: Dynamic Tile Push Notification for Windows Phone 7 Jason Zander has a nice-looking tutorial up on dynamic tile notifications... good diagrams and discussion and plenty of code. Reactive.buffering.from event. Andrej Tozon is continuing his Reactive Extensions posts with this one on buffering: BufferWithTime and BufferWIthCount ... good stuff, good write-up, and the start of a WP7 game? MEFedMVVM with PRISM 4 Marlon Grech combines his MEFedMVVM with Prism 4, and says it was easy... check out the post and the code. Adventures while building a Silverlight Enterprise application part #40 Jonathan van de Veen has a discussion up about things you need to pay attention to as your project gets close to first deployment... lots of good information to think about Silverlight or not. Customize Windows 7 Preview pane for XAML files Walt Ritscher has a (very easy) XAML extension for Windows 7 that allows previewing of XAML files in an explorer window... as our UK friends say "Brilliant!" Entity Framework Code-First, oData & Windows Phone Client From the never-ending stream of posts that is Jesse Liberty comes this one on EF Code-First... so Jesse's describing Code-First and OData all wrapped up about a WP7 app Sterling Silverlight and Windows Phone 7 Database Triggers and Auto-Identity Sterling and Database Triggers sitting in a tree... woot for WP7 from Jeremy Likness... provides database solutions including Validation, Data-specific concerns such as 'last modified', and post-save processing ... all good, Jeremy! A Look At Fluent APIs Sacha Barber has a great post up that isn't necessarily Silverlight, but is it? ... we've been hearing a lot about Fluent APIs... read on to see what the buzz is. Windows Phone 7 - Part 3 - Final Application William E. Burrows has Part 3 of his WP7 tutorial series up... this one completing the Golf Handicap app by giving the user the ability to manage scores. User Control vs Custom Control in Silverlight for WP7 WindowsPhoneGeek has a great diagram and description-filled post up on User Controls and Custom Controls in WP7... good external links too. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Lucene complex structure search

    - by archer
    Basically I do have pretty simple database that I'd like to index with Lucene. Domains are: // Person domain class Person { Set<Pair> keys; } // Pair domain class Pair { KeyItem keyItem; String value; } // KeyItem domain, name is unique field within the DB (!!) class KeyItem{ String name; } I've tens of millions of profiles and hundreds of millions of Pairs, however, since most of KeyItem's "name" fields duplicates, there are only few dozens KeyItem instances. Came up to that structure to save on KeyItem instances. Basically any Profile with any fields could be saved into that structure. Lets say we've profile with properties - name: Andrew Morton - eduction: University of New South Wales, - country: Australia, - occupation: Linux programmer. To store it, we'll have single Profile instance, 4 KeyItem instances: name, education,country and occupation, and 4 Pair instances with values: "Andrew Morton", "University of New South Wales", "Australia" and "Linux Programmer". All other profile will reference (all or some) same instances of KeyItem: name, education, country and occupation. My question is, how to index all of that so I can search for Profile for some particular values of KeyItem::name and Pair::value. Ideally I'd like that kind of query to work: name:Andrew* AND occupation:Linux* Should I create custom Indexer and Searcher? Or I could use standard ones and just map KeyItem and Pair as Lucene components somehow?

    Read the article

  • TwoWay Binding With ItemsControl

    - by Andrew
    I'm trying to write a user control that has an ItemsControl, the ItemsTemplate of which contains a TextBox that will allow for TwoWay binding. However, I must be making a mistake somewhere in my code, because the binding only appears to work as if Mode=OneWay. This is a pretty simplified excerpt from my project, but it still contains the problem: <UserControl x:Class="ItemsControlTest.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <Grid> <StackPanel> <ItemsControl ItemsSource="{Binding Path=.}" x:Name="myItemsControl"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBox Text="{Binding Mode=TwoWay, UpdateSourceTrigger=LostFocus, Path=.}" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <Button Click="Button_Click" Content="Click Here To Change Focus From ItemsControl" /> </StackPanel> </Grid> </UserControl> Here's the code behind for the above control: using System; using System.Windows; using System.Windows.Controls; using System.Collections.ObjectModel; namespace ItemsControlTest { /// <summary> /// Interaction logic for UserControl1.xaml /// </summary> public partial class UserControl1 : UserControl { public ObservableCollection<string> MyCollection { get { return (ObservableCollection<string>)GetValue(MyCollectionProperty); } set { SetValue(MyCollectionProperty, value); } } // Using a DependencyProperty as the backing store for MyCollection. This enables animation, styling, binding, etc... public static readonly DependencyProperty MyCollectionProperty = DependencyProperty.Register("MyCollection", typeof(ObservableCollection<string>), typeof(UserControl1), new UIPropertyMetadata(new ObservableCollection<string>())); public UserControl1() { for (int i = 0; i < 6; i++) MyCollection.Add("String " + i.ToString()); InitializeComponent(); myItemsControl.DataContext = this.MyCollection; } private void Button_Click(object sender, RoutedEventArgs e) { // Insert a string after the third element of MyCollection MyCollection.Insert(3, "Inserted Item"); // Display contents of MyCollection in a MessageBox string str = ""; foreach (string s in MyCollection) str += s + Environment.NewLine; MessageBox.Show(str); } } } And finally, here's the xaml for the main window: <Window x:Class="ItemsControlTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:ItemsControlTest" Title="Window1" Height="300" Width="300"> <Grid> <src:UserControl1 /> </Grid> </Window> Well, that's everything. I'm not sure why editing the TextBox.Text properties in the window does not seem to update the source property for the binding in the code behind, namely MyCollection. Clicking on the button pretty much causes the problem to stare me in the face;) Please help me understand where I'm going wrong. Thanx! Andrew

    Read the article

  • HTTP error code 405: tomcat Url mapping issue

    - by Andrew
    I am having trouble POSTing to my java HTTPServlet. I am getting "HTTP Status 405 - HTTP method GET is not supported by this URL" from my tomcat server". When I debug the servlet the login method is never called. I think it's a url mapping issue within tomcat... web.xml <servlet-mapping> <servlet-name>faxcom</servlet-name> <url-pattern>/faxcom/*</url-pattern> </servlet-mapping> FaxcomService.java @Path("/rest") public class FaxcomService extends HttpServlet{ private FAXCOM_x0020_ServiceLocator service; private FAXCOM_x0020_ServiceSoap port; @GET @Produces("application/json") public String testGet() { return "{ \"got here\":true }"; } @POST @Path("/login") @Consumes("application/json") // @Produces("application/json") public Response login(LoginBean login) { ArrayList<ResultMessageBean> rm = new ArrayList<ResultMessageBean>(10); try { service = new FAXCOM_x0020_ServiceLocator(); service.setFAXCOM_x0020_ServiceSoapEndpointAddress("http://cd-faxserver/faxcom_ws/faxcomservice.asmx"); service.setMaintainSession(true); // enable sessions support port = service.getFAXCOM_x0020_ServiceSoap(); rm.add(new ResultMessageBean(port.logOn( "\\\\CD-Faxserver\\FaxcomQ_API", /* path to the queue */ login.getUserName(), /* username */ login.getPassword(), /* password */ login.getUserType() /* 2 = user conf user */ ))); } catch (RemoteException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } // return rm; return Response.status(201).entity(rm).build(); } @POST @Path("/newFaxMessage") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public ArrayList<ResultMessageBean> newFaxMessage(FaxBean fax) { ArrayList<ResultMessageBean> rm = new ArrayList<ResultMessageBean>(); try { rm.add(new ResultMessageBean(port.newFaxMessage( fax.getPriority(), /* priority: 0 - low, 1 - normal, 2 - high, 3 - urgent */ fax.getSendTime(), /* send time */ /* "0.0" - immediate */ /* "1.0" - offpeak */ /* "9/14/2007 5:12:11 PM" - to set specific time */ fax.getResolution(), /* resolution: 0 - low res, 1 - high res */ fax.getSubject(), /* subject */ fax.getCoverpage(), /* cover page: "" – default, “(none)� – no cover page */ fax.getMemo(), /* memo */ fax.getSenderName(), /* sender's name */ fax.getSenderFaxNumber(), /* sender's fax */ fax.getRecipients().get(0).getName(), /* recipient's name */ fax.getRecipients().get(0).getCompany(), /* recipient's company */ fax.getRecipients().get(0).getFaxNumber(), /* destination fax number */ fax.getRecipients().get(0).getVoiceNumber(), /* recipient's phone number */ fax.getRecipients().get(0).getAccountNumber() /* recipient's account number */ ))); if (fax.getRecipients().size() > 1) { for (int i = 1; i < fax.getRecipients().size(); i++) rm.addAll(addRecipient(fax.getRecipients().get(i))); } } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } return rm; } } Main.java private static void main(String[] args) { try { URL url = new URL("https://andrew-vm/faxcom/rest/login"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/json"); FileInputStream jsonDemo = new FileInputStream("login.txt"); OutputStream os = (OutputStream) conn.getOutputStream(); os.write(IOUtils.toByteArray(jsonDemo)); os.flush(); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (conn.getInputStream()))); String output; System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); } // Don't want to disconnect - servletInstance will be destroyed // conn.disconnect(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } I am working from this tutorial: http://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >